Weiqiang Liu, Minghui Wu, Keming Liu, Mingyao Wu, Yunfeng Wu
Kneeosteoarthritis (KOA) is a common degenerative joint disease that causes pain, stiffness, and impaired mobility. Automated Kellgren-Lawrence (KL) grading from knee X-ray images facilitates efficient screening and follow-up assessment. However, models trained on a single-source dataset frequently suffer performance degradation when applied to external cohorts, due to heterogeneities in image quality, acquisition protocols, class distributions, and annotation patterns. Furthermore, conventional domain adaptation approaches typically treat all source samples uniformly, making them vulnerable to negative transfer induced by ambiguous or distributionally divergent instances. To overcome these limitations, the present study develops a supervised contrastive domain adaptation framework designed for robust KOA severity grading under domain shift. The framework incorporates two task-specific modules: (1) a source-domain sample screening module that dynamically allocates class-wise quotas based on transferability and identifies high-value source samples by evaluating target intra-class affinity, inter-class separability, and source-class compactness; and (2) a target-balanced ordinal contrastive learning module that aligns the screened source samples with target features and imposes stronger constraints on negative pairs with larger KL-grade distances. The framework was evaluated bidirectionally on KneeKL (8260 images) and MedicalExpert-I (1650 images), two public knee radiograph datasets for KOA grading. With ResNet-18, it achieved a Quadratic Weighted Kappa (QWK) of 0.8557 for KneeKL-to-MedicalExpert-I transfer, exceeding source-only training and direct source-target merging by 0.2652 and 0.0468, respectively. Comparisons with representative existing methods and multiple experimental analyses further validate the competitiveness of the proposed framework.