1. Introduction
Knee osteoarthritis (KOA) is one of the most common degenerative joint diseases worldwide and a leading cause of disability in older adults [
1]. Early identification of structural deterioration is critical for timely intervention, treatment planning, and preventing long-term disability. Radiographic assessment using the Kellgren–Lawrence (KL) grading system remains the clinical standard for KOA severity evaluation [
2]. In clinical environments, accurate KL grading can help orthopedists determine disease progression, select weight-bearing therapies, and avoid unnecessary surgical procedures. However, manual grading requires expert radiologists and is inherently subjective, leading to significant inter-observer variability. Each grade sample and criterion is illustrated in
Figure 1.
Recent advances in deep learning have enabled automated KL grade classification from knee radiographs, demonstrating performance comparable to expert readers in some settings [
3,
4]. Despite this progress, several challenges remain unresolved. First, the visual boundary between early disease stages, particularly KL-1 and KL-2, is subtle and characterized by marginal radiographic findings such as doubtful osteophytes or mild joint space narrowing. This ambiguity frequently leads to confusion between adjacent grades, limiting the clinical reliability of automated systems. Second, most existing approaches [
5,
6] rely solely on image-based cues and lack explicit incorporation of clinical semantics. While such models often perform well for advanced KOA stages (KL-3 and KL-4), where structural deformities are pronounced, they struggle to capture the nuanced pathological changes present in borderline cases. Third, achieving balanced sensitivity and specificity across all grades remains challenging due to class imbalance and heterogeneity in radiographic appearance.
For automated KOA grading systems to be clinically deployable, they must not only achieve high accuracy but also reason in a medically meaningful manner and provide transparent explanations for their predictions. This requirement motivates the integration of vision–language alignment, where radiological knowledge is explicitly encoded using textual descriptions and leveraged as an additional supervisory signal. Vision–Language Models (VLMs) [
7,
8], such as Contrastive Language–Image Pretraining (CLIP) [
9], learn joint representations of images and text, enabling alignment between visual patterns and semantic concepts. In the context of KOA grading, aligning model predictions with clinically grounded textual descriptions, such as “definite osteophytes,” “moderate joint space narrowing,” or “subchondral sclerosis,” can guide the learning process toward disease-relevant attributes and improve interpretability.
In this work, we present a vision–language-guided ordinal learning framework for automated KOA severity assessment from knee radiographs. The proposed approach integrates a Vision Transformer (ViT) backbone with CORAL-based ordinal regression to explicitly model the ordered nature of KL grades. In addition, CLIP-based semantic supervision is employed to align visual features with medically meaningful textual descriptions of KOA pathology. This design enables the model to capture subtle radiographic distinctions between adjacent grades while maintaining strong performance for advanced disease stages. Overall, this study demonstrates that integrating domain-specific knowledge through vision–language alignment significantly improves the reliability, interpretability, and clinical relevance of automated KOA severity grading, highlighting its potential for supporting routine radiological assessment and longitudinal disease monitoring.
The primary objective of this study is to develop a clinically grounded and ordinally consistent framework for automated KOA grading that improves discrimination between subtle intermediate disease stages. Specifically, we investigate the following research question: can the integration of vision–language semantic alignment with transformer-based ordinal regression improve fine-grained KL grade classification while maintaining interpretability and robustness? We hypothesize that explicitly modeling disease severity as an ordered process and aligning visual features with clinically meaningful textual descriptors will reduce inter-grade ambiguity, particularly between KL1 and KL2, and yield more stable and clinically faithful predictions. The code is available at:
https://github.com/Zahid672/kneeKL224 (accessed on 1 March 2026).
The main contributions of this study are as follows:
We identify key limitations of existing KOA grading systems, including lack of ordinal awareness and absence of clinical semantic grounding.
We propose VL-OrdinalFormer, a unified framework that integrates a ViT backbone with CORAL-based ordinal regression to explicitly model disease progression.
We introduce a vision–language distillation module that aligns visual representations with clinically grounded textual descriptions.
We incorporate ensemble inference, class-aware weighting, and calibrated threshold optimization to enhance robustness and balanced performance.
We provide interpretability analyses demonstrating anatomically meaningful attention patterns consistent with radiological reasoning.
In summary, the challenges of subtle inter-grade differences, lack of ordinal awareness, and limited semantic grounding motivate the need for a unified framework that integrates transformer-based global modeling, explicit ordinal regression, and clinically meaningful vision–language alignment.
The remaining paper is organized as follows:
Section 2 presents a comprehensive review of related work to contextualize our research. Further, we discuss Dataset and preprocessing in
Section 3. Next, in
Section 4 we detail our proposed methodology, including its overview, and main architecture. We then describe our experimental setup, including baseline comparison, ablation studies in
Section 6.
Section 7 presents the interpretability and analysis, whereas
Section 8 consists of the discussion. Finally, in
Section 9, we present the conclusion.
2. Related Work
2.1. Radiographic KOA Grading
The KL system is the standard radiographic scale for assessing KOA severity. It grades structural changes from 0 (no radiographic features of OA) to 4 (severe joint space loss and bone deformity), based on the presence and extent of osteophytes, joint space narrowing, subchondral sclerosis, and bony deformity. KL grading is routinely used in clinical practice and large cohort studies such as the Osteoarthritis Initiative (OAI), since it provides a simple, discrete summary of disease status that can be used for diagnosis, prognosis, and treatment planning [
10]. However, KL grading is inherently subjective. Multiple studies have shown considerable inter and intra-observer variability, particularly in early stages such as KL-1 and KL-2, where radiographic changes are subtle and sometimes overlap with normal anatomical variation [
11]. This variability affects patient stratification in clinical trials and can obscure real treatment effects. It also motivates the development of automated or decision-support systems that can produce more consistent assessments.
Traditional computer-aided diagnosis approaches [
12,
13] for KOA used hand-engineered features, such as joint space width, shape descriptors, or texture features extracted from defined regions of interest. These were often combined with classical machine learning classifiers, but typically required careful preprocessing, manual tuning, and did not generalize well across datasets or imaging protocols. Recent work has shifted toward end-to-end deep learning methods that operate directly on X-ray images, aiming for fully automatic KL grading. Several recent papers have shown that deep learning models can reach performance comparable to experienced radiologists on KL grading tasks. For example, Vaattovaara et al. [
14] developed a deep learning model for KL grading that achieved diagnostic accuracy comparable to highly experienced human readers in an external validation cohort. Other studies [
15] have explored multi-view radiographs, hierarchical classification schemes, and integration of prior anatomical knowledge to improve robustness and clinical relevance. Despite these advances, early KOA detection (KL-1 and KL-2) remains a key weakness across most existing systems, with performance consistently higher for KL-3 and KL-4 than for mild disease [
11].
2.2. CNN-Based KOA Classification
Deep CNNs were the first family of models to substantially improve automatic KL grading. A landmark work by Chen et al. [
16] proposed a fully automatic KOA severity grading pipeline based on deep neural networks. Their system first used a customized YOLOv2 detector to localize knee joints in full radiographs and then applied a fine-tuned VGG-19 classifier with a novel ordinal loss on the OAI dataset. The proposed ordinal formulation explicitly encoded the ordered structure of KL grades in the loss function, and achieved an accuracy of about 69.7% and a mean absolute error of 0.344 on the KL grading task, outperforming earlier CNN baselines. This work is frequently used as a reference baseline for subsequent KOA grading studies that adopt the same dataset and evaluation splits.
Later studies extended CNN-based KOA grading in several directions. Swiecicki et al. [
17] developed a fully automatic deep learning algorithm for KL grading and evaluated it on multi-institutional data, reporting quadratic kappa scores that approached the agreement between human readers. Pan et al. [
15] proposed a hierarchical classification framework that separates the detection of OA from the estimation of its severity, which aims to reflect radiologists’ reasoning and improves performance on intermediate grades. Other works compared a variety of CNN architectures, including VGG-16/19, ResNet-101, and EfficientNet variants, to identify the most suitable backbone for KL grading, again highlighting that performance gains are often largest for advanced OA and more modest for early stages [
16].
Ensemble CNN approaches have also been explored. Pi et al. [
10] used ensemble deep learning networks to improve the robustness of KL classification and showed that aggregating multiple models reduced prediction variance and increased diagnostic performance, especially for KL-3 and KL-4. Nasef et al. [
18] evaluated different deep learning and classical machine learning models for KL grading on multiple public datasets and reported that, while deep models clearly outperform traditional approaches, they still face challenges related to class imbalance and dataset heterogeneity.
Overall, CNN-based KOA classification methods have demonstrated that fully automatic KL grading is feasible and can reach strong performance, particularly for moderate and severe OA. However, they are limited by relatively local receptive fields, reliance on image-only supervision, and a lack of mechanisms to explicitly incorporate clinical definitions or ordinal structure beyond the loss design.
2.3. Vision Transformers in Medical Imaging
ViTs [
19] have recently emerged as competitive alternatives to CNNs for visual representation learning. Unlike CNNs [
20], which build features through progressively larger convolutional receptive fields, ViTs operate on image patches using self-attention, which allows them to model long-range dependencies and global context more naturally. This property is especially useful in medical imaging tasks where clinically relevant patterns may span larger anatomical regions or multiple structures.
Several surveys provide comprehensive overviews of Transformer architectures in medical imaging [
21,
22,
23], covering tasks such as classification, segmentation, detection, reconstruction, and report generation. Shamshad et al. [
21] summarized more than 125 Transformer-based methods and outlined how pure ViTs and hybrid CNN–Transformer architectures have been applied to diverse modalities including X-ray, CT, MRI, ultrasound, and histopathology. More recent reviews have specifically focused on ViTs in classification settings, highlighting their advantages in capturing global context and their limitations when data is scarce or highly imbalanced [
23]. In biomedical image classification, several works have demonstrated that ViTs can match or surpass CNN performance when combined with appropriate pretraining and data augmentation. Halder et al. [
24] systematically evaluated ViTs on MedMNIST classification tasks and showed that they can provide competitive performance with suitable optimization and regularization strategies. Transformer-based models have also been successfully used in segmentation, where architectures like TransUNet, Swin-UNet, and hybrid CNN–ViT designs capture both local structure and global anatomy [
21].
Despite these advances, ViTs in KOA grading are still relatively underexplored compared to CNNs. The potential benefits are clear; for instance, ViTs can aggregate information across the whole knee joint and better capture global patterns such as alignment, multi-compartment joint space narrowing, and diffuse osteophyte distribution. However, they also require careful handling of dataset size, class imbalance, and regularization to avoid overfitting. In this context, combining ViTs with ordinal losses and ensemble inference, as done in this work, is a natural extension of earlier CNN-based KOA grading systems.
2.4. Vision–Language Models in Clinical AI
Vision–Language Models (VLMs) [
7] extend the idea of representation learning by jointly modeling images and text in a shared embedding space. CLIP [
9] is a prominent example that is trained on large collections of image-text pairs [
25] to align visual content with natural language descriptions. This alignment enables zero-shot classification, cross-modal retrieval, and text-guided interpretation without task-specific retraining. In the clinical domain, this capability is particularly appealing because radiology practice routinely integrates images with textual reports, and many diagnostic criteria are defined using structured medical terminology.
Recent years have seen rapid growth in adapting CLIP-like models to medical imaging. MedCLIP [
26], for instance, learns from unpaired chest X-ray images and radiology reports and has demonstrated strong performance on both zero-shot and supervised classification tasks. Zhao et al. [
27] conducted a comprehensive survey of CLIP in medical imaging, summarizing pretraining strategies, datasets, and downstream applications ranging from classification to dense prediction and multimodal retrieval. Other models such as PMC-CLIP [
28] and RadCLIP [
29] leverage large biomedical literature corpora or radiology text archives to develop domain-adapted VLMs capable of disease classification, report generation, and visual question answering.
A consistent theme in these studies is that VLMs [
7] often improve interpretability and robustness relative to image-only models. Because VLMs operate in a joint vision–language space, predictions can be grounded in human-readable concepts, enabling more transparent error analysis and semantic reasoning. Recent work has shown that text prompts capturing pathology descriptions can guide models toward clinically relevant regions even when annotated data are limited, enabling weakly supervised classification and zero-shot anomaly detection [
27].
Despite this progress, the use of VLMs for ordinal, disease-staging problems such as KL-based KOA grading remains largely unexplored. Most existing CLIP-based medical applications target binary, multilabel, or standard multiclass classification settings, where classes are assumed to be independent and unordered. In contrast, KOA severity follows a strict radiological progression, and neighboring grades (e.g., KL1 vs. KL2) differ only by subtle morphological cues. This creates a fundamentally different learning problem that benefits from ordinal regression rather than standard classification. Furthermore, grade-specific textual criteria such as “definite osteophytes with possible joint space narrowing” for KL2 provide rich semantic information that has not been incorporated into prior CLIP-based medical models.
Existing VLM frameworks such as MedCLIP [
26], PMC-CLIP [
28], and RadCLIP [
29] primarily address classification or report-generation tasks and do not incorporate ordinal regression, threshold-based decision functions, or disease staging supervision. Moreover, these models focus on natural alignment between images and free-text radiology reports, whereas the present work leverages structured, grade-specific radiological definitions as explicit text prompts. Our method is therefore distinct in two key aspects: (1) it integrates VLM-derived semantic supervision into a ViT-based CORAL ordinal regression framework tailored to KL grading, and (2) it uses CLIP text embeddings as auxiliary targets to improve fine-grained discrimination between adjacent disease stages. To our knowledge, this constitutes the first integration of CLIP-style text supervision within an ordinal KOA severity grading pipeline.
6. Experimental Results
To validate whether the proposed vision–language-guided ordinal framework effectively addresses the challenges identified earlier, we conduct a comprehensive experimental evaluation across multiple baselines and ablation settings. All final results are reported on the official held-out OAI test set, which consists of 1656 knee radiographs spanning five KL grades (KL0–KL4).
Table 2 presents a comparative analysis of our proposed model with previous state-of-the-art models. It is important to note that results reported from prior publications may involve differences in preprocessing strategies, training schedules, data splits, and evaluation protocols. Therefore, these comparisons are provided primarily for contextual reference. Direct and controlled performance comparisons are conducted using locally reproduced baselines under identical experimental conditions, as summarized in
Table 3.
6.1. Baseline Comparison with Previous Work
Table 3 presents a direct comparison between reproduced CNN- and transformer-based baselines and the proposed ViT–CORAL framework. In addition to the VGG19 ordinal baseline, we also reproduce a plain ViT trained with cross-entropy loss, which achieves an accuracy of 68.59% and a macro F1-score of 69.42%. This result confirms that global self-attention alone provides a noticeable improvement over conventional CNN architectures, but remains limited when disease severity is treated as a set of independent classes. In contrast, the proposed ViT–CORAL with ensemble inference and TTA achieves 70.29% accuracy and a 70.19% macro F1-score, corresponding to a +1.7% absolute accuracy gain and a +0.8% macro F1 improvement over the reproduced ViT baseline, and a +5.5% absolute accuracy improvement over the reproduced VGG19 ordinal model. These results demonstrate that explicitly modeling the ordinal structure of KL grades provides complementary benefits beyond those obtained from transformer architectures alone.
Overall, the proposed VL-OrdinalFormer consistently outperforms both CNN and transformer-based baselines by addressing three key limitations of prior approaches: lack of ordinal awareness, absence of clinical semantic guidance, and sensitivity to data imbalance. Unlike standard ViT classifiers trained with cross-entropy, our CORAL-based formulation embeds the natural ordering of disease severity directly into the learning process, reducing implausible grade transitions and improving discrimination between adjacent grades. Moreover, vision–language alignment via CLIP introduces clinically meaningful supervision by associating visual patterns with radiological concepts such as osteophytes, joint-space narrowing, and subchondral sclerosis. This semantic grounding is particularly beneficial for early and borderline cases (KL1–KL2), where visual differences are subtle and often misclassified by image-only models. Finally, ensemble inference combined with TTA and threshold optimization stabilizes predictions and mitigates overfitting, leading to balanced improvements across all KL grades. As a result, the proposed framework achieves superior accuracy, macro F1-score, and AUROC while maintaining ordinally consistent and clinically interpretable predictions.
6.2. Ablation Studies
To quantify the contribution of each component, we conduct a systematic ablation study by incrementally introducing the proposed design elements, i.e., CORAL-based ordinal regression, class-aware weighting emphasizing KL1–KL2, CLIP-based vision–language distillation, ensemble inference across folds, and TTA and threshold optimization.
As summarized in
Table 4, each component contributes to consistent performance gains. While ordinal regression establishes a strong foundation, the largest improvements arise from ensemble averaging and calibrated ordinal decoding. This confirms the complementary nature of the proposed components and their collective contribution to robust performance.
6.3. Class-Wise Improvement Analysis
Table 5 reports class-wise F1-scores for the reproduced VGG19 baseline, the reproduced plain ViT baseline trained with cross-entropy loss, and the proposed ViT–CORAL model. Moving from a CNN to a transformer backbone already yields consistent gains across most grades, particularly for KL2 and KL3, confirming the benefit of global context modeling in knee radiograph analysis. However, the plain ViT baseline still exhibits noticeable confusion in the early and mid-grade categories, where subtle structural changes dominate.
In contrast, the proposed VL-OrdinalFormer achieves further and more consistent improvements across clinically challenging grades. Compared with the VGG19 baseline, it yields improvements of +6.6% for KL1, +19.4% for KL2, +9.2% for KL3, and +4.9% for KL4, directly targeting the primary source of diagnostic ambiguity in early and moderate KOA assessment. When compared against the plain ViT baseline, additional gains are observed for KL0 (+4.2%), KL1 (+1.1%), KL2 (+2.8%), and KL3 (+4.8%), demonstrating that ordinal modeling provides complementary benefits beyond transformer-based feature extraction alone.
Importantly, performance for KL0 remains stable or improves, indicating that enhanced sensitivity to mid-grade disease does not come at the expense of normal or advanced cases. Most remaining errors are confined within a
grade margin, reflecting ordinally consistent and clinically reasonable misclassifications.
Figure 5 further illustrates the improved prediction distribution across adjacent ordinal boundaries, with reduced long-range grade jumps compared to both CNN and softmax-based transformer baselines.
6.4. Statistical Significance Analysis
To rigorously assess whether the observed performance improvements are statistically meaningful, we conducted paired statistical analyses using fold-level results obtained from stratified five-fold cross-validation (n = 5 independent folds). Each fold yields one independent estimate of macro F1-score and accuracy for every compared model, forming paired samples for hypothesis testing.
We have performed two primary comparisons: (i) the reproduced VGG19 ordinal baseline versus the final VL-OrdinalFormer ensemble model, and (ii) the softmax-based ViT baseline versus the CORAL-based ViT model with vision–language guidance. For each fold, we compared the paired macro F1-scores. Before applying parametric tests, we evaluated the normality of fold-level performance differences using the Shapiro–Wilk test. As no significant deviation from normality was observed (p > 0.05), paired two-sided t-tests were applied. To further ensure robustness without relying on distributional assumptions, Wilcoxon signed-rank tests were additionally conducted, yielding consistent conclusions.
For macro F1-score, the proposed model demonstrated statistically significant improvements over both baselines (paired t-test, p < 0.01). The corresponding Wilcoxon signed-rank tests confirmed significance (p < 0.05), indicating that the performance gains are unlikely to arise from random variation in data splits. Beyond statistical significance, we computed Cohen’s d to quantify the magnitude of improvement. The effect size for the comparison with the reproduced VGG19 baseline was in the moderate-to-large range, while the improvement over the softmax-based ViT baseline corresponded to a moderate effect size. These findings indicate that the observed gains are not only statistically significant but also practically meaningful.
To further assess performance stability, 95% confidence intervals were estimated via bootstrap resampling of the test predictions. The confidence intervals for both accuracy and macro F1-score did not overlap with those of the reproduced VGG19 baseline, demonstrating clear separation between methods at the 95% confidence level. Overall, these statistical analyses confirm that the improvements achieved by the proposed VL-OrdinalFormer are consistent across folds, statistically reliable, and of meaningful practical magnitude.
7. Interpretability and Analysis
For medical AI systems to be clinically adopted, their predictions must be transparent and supported by interpretable evidence that clinicians can understand and validate. In the context of KOA severity assessment, interpretability is particularly important because diagnostic decisions rely on subtle radiographic cues. Accordingly, we integrate two complementary interpretability strategies: vision–language similarity heatmaps and feature attribution using Gradient-weighted Class Activation Mapping (Grad-CAM). Together, these techniques provide insight into the radiographic structures that drive model predictions and support clinical trust in automated KOA grading.
7.1. CLIP-Based Similarity Heatmaps
The proposed VLM enables explicit alignment between visual features extracted from knee radiographs and radiologically grounded textual descriptions associated with KL grades. Visual embeddings from the image encoder and textual embeddings derived from KL-specific descriptions are projected into a shared latent space learned by the CLIP framework. These textual descriptors encode clinically meaningful severity cues, such as “no osteophytes and normal joint space” for KL0, “doubtful osteophytes” for KL1, “definite osteophytes with mild joint space narrowing” for KL2, “marked joint space narrowing” for KL3, and “bone-on-bone cartilage loss” for KL4.
Similarity-based attention heatmaps are generated by computing the correspondence between localized visual regions and the textual embedding of the predicted KOA grade. These heatmaps highlight anatomical regions that contribute most strongly to the model’s decision. For KL0 cases, activation patterns are diffuse and weak, reflecting the absence of radiographically evident pathology. In KL1 cases, attention becomes mildly concentrated around joint margins, consistent with early or doubtful osteophyte formation. KL2 cases exhibit clearer localization within the medial tibiofemoral compartment, indicating emerging joint space narrowing. For advanced stages (KL3 and KL4), strong and focused activation is observed along osteophyte boundaries and severely narrowed joint surfaces, capturing hallmark degenerative changes. These findings demonstrate that vision–language semantic alignment encourages anatomically meaningful reasoning and enhances the clinical interpretability of the model’s predictions, particularly for early and borderline disease stages.
7.2. Semantic Alignment Margin Analysis
To quantitatively evaluate the contribution of vision–language alignment, we compute the cosine similarity margin between the predicted KL-grade text embedding and the nearest competing grade embedding. Correctly classified samples exhibit significantly larger similarity margins compared to misclassified samples, indicating stronger semantic alignment between visual features and clinically grounded textual descriptors. This quantitative evidence supports the role of CLIP-based supervision in improving fine-grained discrimination between adjacent KL grades.
7.3. Grad-CAM Visualization of Radiographic Features
To further analyze the internal decision-making behavior of the proposed ViT, we employ Grad-CAM with an attention-rollout strategy applied to the final prediction logits. This approach highlights image regions that contribute most strongly to the predicted KL grade, enabling visual inspection of whether the model relies on clinically meaningful radiographic cues.
For each KL grade, representative knee radiographs are selected and transformer attention maps are aggregated across layers and heads, projected back to the original
image space, and overlaid on the input radiographs. As illustrated in
Figure 6, the resulting heatmaps consistently emphasize anatomically relevant structures, including the tibiofemoral joint space, marginal osteophytes, cortical irregularities, and subchondral bone contours, while largely ignoring background regions. For correctly classified KL3 and KL4 cases, activations are strongly concentrated along regions exhibiting pronounced joint space narrowing and bone remodeling, reflecting hallmark features of advanced KOA. In KL2 cases, Grad-CAM responses typically localize to regions of emerging medial joint space narrowing, which differentiates them from KL1 samples that display weaker and more diffuse activation patterns. Analysis of misclassified examples provides additional insight, when KL2 images are predicted as KL1, the corresponding heatmaps often emphasize superficial cartilage regions while failing to capture subtle medial collapse, suggesting opportunities for further refinement in fine-grained lesion representation.
Overall, these visual explanations demonstrate that the proposed ViT-L/16 CORAL model bases its predictions on clinically meaningful radiographic biomarkers rather than spurious background artifacts. The alignment between Grad-CAM activations and established diagnostic criteria supports the interpretability and clinical credibility of the proposed framework, enabling clinicians to qualitatively assess model reasoning alongside predicted KOA severity.
7.4. Quantitative Ordinal Consistency Analysis
To complement qualitative interpretability visualizations, we quantitatively analyze the ordinal error distribution of the proposed model using the confusion matrix in
Figure 5. We compute the proportion of misclassifications that remain within a clinically plausible adjacent range, i.e., predictions within
KL grade from the ground truth. Across the OAI test set (
n = 1656), the model produces 492 misclassifications in total. Among these, 406 errors (82.5%) fall within a single adjacent KL grade (e.g., KL1↔KL2 or KL2↔KL3), indicating that most mistakes correspond to borderline cases where even expert agreement is known to be challenging. In contrast, non-adjacent errors (
) account for only 86 cases (17.5%). Importantly, long-range misclassifications are extremely rare: only 1 case (0.2% of all errors; 0.06% of all test samples) exhibits a jump of three grades (
), and no extreme KL4→KL0 failures are observed. This behavior is consistent with the progressive nature of KL staging and supports the clinical plausibility of the proposed ordinal modeling.
7.5. Robustness to Acquisition and Projection Variability
To evaluate the robustness of the proposed model beyond the primary OAI cohort, we conducted a controlled stress-test analysis by simulating domain shifts commonly observed across imaging systems and acquisition protocols. Specifically, we introduced geometric perturbations (rotations up to ±20°) to approximate flexion and projection variability, contrast and gamma adjustments to simulate manufacturer-dependent post-processing differences, additive Gaussian noise, Gaussian blur to mimic resolution degradation, and combined perturbations representing more challenging acquisition conditions.
As shown in
Table 6, the 5-fold ensemble model demonstrated strong stability under realistic perturbations. Under ±20° rotation, Macro-F1 decreased only from 0.6992 to 0.6851 (ΔF1 = −1.4%), indicating limited sensitivity to projection variability. Contrast and gamma shifts resulted in performance reductions within approximately 1–2%. Moderate noise produced negligible impact (less than 1% drop). Although stronger blur and combined perturbations led to larger degradation, performance remained above 0.61 Macro-F1 even under the most challenging setting.
These findings suggest that the proposed Vision–Language Ordinal Transformer framework exhibits meaningful robustness to acquisition and projection variability. Nevertheless, future work will include multi-center external validation to further assess cross-institutional generalization.
8. Discussion
The experimental results demonstrate consistent improvements across accuracy, macro F1-score, and class-wise performance, particularly for clinically ambiguous intermediate grades. In this section, we interpret these findings in the context of ordinal modeling, semantic alignment, robustness, and clinical applicability.
8.1. Impact of Vision–Language Alignment on Ordinal Classification
KOA severity assessment is inherently ordinal, as radiographic abnormalities evolve gradually from KL0 to KL4. Conventional multi-class classifiers [
34] typically treat grade labels as independent categories, which often results in ambiguous decision boundaries between adjacent grades, particularly KL1 and KL2. The proposed vision–language-guided framework addresses this limitation by introducing semantic supervision derived from clinically grounded textual descriptions. By associating visual patterns with interpretable descriptors such as joint space narrowing, osteophyte formation, and subchondral sclerosis, the model learns representations that more closely reflect expert-defined grading criteria. This semantic alignment effectively narrows the gap between image appearance and clinical interpretation, leading to reduced confusion between neighboring grades. The observed gains in macro recall and F1-score for KL1 and KL2 provide quantitative evidence that vision–language guidance enhances sensitivity to subtle radiographic biomarkers.
8.2. Generalization and Robustness Across Variations
Knee radiographs exhibit substantial variability due to differences in acquisition protocols, patient anatomy, exposure conditions, and positioning. Image-only models are prone to overfitting spurious textures or intensity patterns that may not correspond to true pathological changes. In contrast, vision–language-guided learning introduces semantic constraints that encourage the model to focus on anatomically and clinically meaningful structures. Moreover, the use of CORAL-based ordinal regression enforces smooth transitions between severity levels, avoiding abrupt decision boundaries and promoting stable predictions under distribution shifts. The consistent performance observed across five-fold cross-validation, along with balanced classification metrics, indicates that the proposed framework achieves improved robustness and generalization across heterogeneous data. While this study focused on KL grade classification in KOA, the proposed ViT–CORAL pipeline is generalizable to other medical tasks with ordinal label structures. Examples include diabetic retinopathy staging, liver fibrosis grading, and cancer progression scores. Future work may explore adapting this approach to other modalities where ordinal reasoning is critical for clinical decision-making.
8.3. Comparison with Radiologist Variability
Previous clinical studies have reported notable inter-observer variability in KL grading, particularly for borderline cases such as KL1 and KL2, where Cohen’s kappa values often range from fair to moderate. In this context, perfectly deterministic classification is neither feasible nor clinically expected. Instead, the goal of automated systems should be to achieve performance comparable to expert consistency while maintaining transparency. The proposed approach demonstrates performance approaching reported levels of expert agreement, especially when ensemble inference, TTA, and threshold optimization are applied. Importantly, interpretability analyses show that the model consistently attends to anatomical regions and radiographic cues commonly used by radiologists, supporting the clinical plausibility of its predictions.
Overall, these findings suggest that vision–language-guided ordinal learning represents a meaningful advancement for automated KOA assessment. By jointly leveraging medical text semantics, ordinal disease structure, and radiographic imaging cues, the proposed framework reduces diagnostic ambiguity and enhances interpretability. This combination positions the method as a reliable and scalable tool for supporting radiological workflows and longitudinal KOA monitoring in real-world clinical settings.
8.4. Incorporating Full Radiology Reports for Enhanced Semantic Alignment
An interesting direction for further refinement of the semantic alignment module is the incorporation of full radiology reports instead of structured grade-specific prompts. While structured prompts provide controlled supervision explicitly aligned with KL definitions and preserve ordinal consistency within the CORAL framework, free-text radiology reports may capture richer patient-specific nuances, including descriptive assessments of joint space narrowing, osteophytes, sclerosis, and additional contextual findings.
In the present study, structured prompts were intentionally employed to ensure stable and monotonic semantic grounding across severity levels, as the OAI dataset does not provide standardized report-level annotations corresponding to each radiograph. Moreover, free-text reports often contain heterogeneous and potentially noisy information unrelated to radiographic severity, which could introduce semantic ambiguity and weaken ordinal consistency.
Nevertheless, integrating report-level supervision represents a promising future direction. Advanced vision–language architectures could leverage report embeddings through cross-attention mechanisms, multimodal contrastive learning, or large pre-trained language models to enrich semantic representations while preserving ordinal interpretability. Such extensions may further enhance patient-specific modeling and cross-domain generalization, particularly in multi-center clinical settings.
8.5. Implementation Details
All experiments were implemented in PyTorch 2.7.1+cu118 using the official ViT models provided by torchvision. Training and evaluation were conducted on an NVIDIA RTX 3090 GPU, with a system equipped with 64 GB of RAM. The proposed ordinal classifier is built upon a ViT-L/16 backbone pretrained on ImageNet-1K and adapted for five-grade KL severity prediction using a CORAL-based output formulation. An overview of the complete training and evaluation pipeline is provided in Algorithm 1, while key hyperparameters are summarized in
Table 7.
| Algorithm 1 Training pipeline of the proposed ViT-L/16 CORALframework |
Require: Dataset , KL grades , number of folds K, batch size B, learning rate , class weights , distillation weight Ensure: Trained fold models - 1:
Pre-processing - 2:
Resize all images to 224 × 224 and normalize (ImageNet statistics). - 3:
Define clinical text prompts and obtain CLIP text embeddings . - 4:
Cross-validation and training - 5:
Stratify-split into K patient-level folds. - 6:
for to K do - 7:
Construct , , . - 8:
Load ViT-L/16 backbone (ImageNet weights) and replace classifier with CORAL head. - 9:
Initialize optimizer (e.g., AdamW) and learning-rate scheduler. - 10:
for each epoch do - 11:
for each mini-batch do - 12:
Apply data augmentation to . - 13:
Extract CLS feature . - 14:
Compute CORAL logits . - 15:
Convert to ordinal labels . - 16:
- 17:
if VLM distillation is enabled then - 18:
Compute cosine scores and teacher distribution - 19:
Derive student distribution from - 20:
- 21:
else - 22:
- 23:
end if - 24:
Update network parameters using - 25:
end for - 26:
Evaluate on and monitor MAE/F1(macro) for early stopping - 27:
end for - 28:
Save best-performing model as - 29:
end for
|
The dataset is organized into separate training, validation, and test directories, each containing class-specific subfolders corresponding to KL0–KL4. During model development, the original training and validation sets are merged, and stratified five-fold cross-validation is performed at the image level to preserve the KL grade distribution in each split. For each fold, four subsets are used for training and one subset is reserved for validation. All knee radiographs are resized to a spatial resolution of pixels. During training, data augmentation includes random resized cropping, horizontal flipping, and small-angle rotations to improve robustness to variations in acquisition conditions and patient positioning. Validation and test images undergo center cropping and normalization only. All inputs are normalized using the ImageNet RGB mean and standard deviation.
The ViT-L/16 backbone is initialized with ImageNet-1K pretrained weights. The original softmax classification head is removed and replaced with a linear layer producing outputs, where corresponds to the number of KL grades. These outputs represent CORAL logits associated with ordered decision thresholds. For a ground-truth label , CORAL targets are defined as binary indicators for . Training minimizes a weighted binary cross-entropy loss across all thresholds. To address threshold-specific class imbalance, a pos_weight term is computed from the empirical label distribution, and additional per-sample class weighting is applied to emphasize the clinically challenging KL1 and KL2 categories.
For each fold, training proceeds until either the maximum number of epochs is reached or early stopping is triggered when validation accuracy fails to improve for ten consecutive epochs. The checkpoint corresponding to the best validation accuracy is saved for each fold. After completing all five folds, a second-stage threshold calibration is performed. Specifically, checkpoints from all folds are reloaded, and test time-augmented logits are collected on each fold’s validation set. These logits are concatenated across folds, and a global decision threshold is selected from the interval with a step size of by maximizing the macro F1-score. This single calibrated threshold is then fixed for all subsequent evaluations. During testing, two evaluation settings are considered. First, the best-performing single-fold model is evaluated using TTA and the tuned threshold . For each test image, four augmented variants (original image, horizontal flip, and rotations of +10° and −10°) are generated. Logits are averaged across augmentations, passed through a sigmoid function, and decoded into an ordinal prediction by counting the number of thresholds exceeding . Performance metrics and confusion matrices are computed for this single-model setting.
Second, a five-model ensemble is evaluated to exploit complementary information learned across different training splits. For each test image, test time-augmented logits are computed independently for each fold-specific model, averaged across augmentations, and then averaged across models before applying the same threshold-based decoding rule. Ensemble predictions are used to compute accuracy, macro- and weighted-averaged precision, recall, F1-score, specificity, and macro AUROC.
As shown in
Table 7 the learning rate of
and weight decay of
were selected based on established practices in ViT fine-tuning, where large-capacity models benefit from conservative learning rates and moderate regularization to ensure stable convergence. The AdamW optimizer was chosen due to its decoupled weight decay formulation and demonstrated robustness in transformer-based architectures. A cosine annealing learning rate schedule is employed to provide a smooth decay over training epochs, which empirically improves convergence stability on the OAI dataset. A batch size of 8 represents a practical trade-off between GPU memory constraints and reliable gradient estimation for the ViT-L/16 backbone. Early stopping with a patience of ten epochs mitigates overfitting on the relatively small validation folds while avoiding unnecessarily prolonged training. To address class imbalance and the clinical importance of intermediate disease stages, per-class sample weights of
are applied, modestly emphasizing KL1 and KL2 without introducing instability. Finally, the global threshold (
) tuning strategy is designed to optimize the macro F1-score on validation data, reflecting balanced performance across all KL grades. This post hoc calibration improves ordinal boundary placement while preserving a simple and interpretable decision rule at deployment time, which is important for clinical adoption.
8.6. Deployment Considerations in Clinical Workflows
The proposed framework employs a ViT-L/16 backbone, which is a high-capacity transformer architecture with substantial computational requirements. While this design contributes to improved feature representation and ordinal stability, practical deployment considerations are important in real-world clinical environments. Knee osteoarthritis grading is typically performed post-acquisition and does not require millisecond-level real-time inference. In our implementation, single-image inference requires less than one second on modern GPU hardware and remains feasible on CPU-based systems within clinically acceptable timeframes.
For resource-constrained settings, several optimization strategies may be adopted. Knowledge distillation can transfer semantic–ordinal representations from the ViT-L/16 teacher model to a smaller student architecture (e.g., ViT-B/16 or lightweight CNN), significantly reducing computational cost while preserving performance. Additionally, model pruning and quantization techniques can further decrease memory footprint and inference latency. A hybrid deployment paradigm may also be considered, wherein the high-capacity model operates on centralized servers for batch analysis, while a distilled lightweight model supports real-time or edge-based applications. These strategies enable practical integration of the proposed framework into clinical workflows without compromising scalability.
As shown in
Table 8, the proposed ViT-L/16 backbone has substantially higher representational capacity compared to both the VGG19 and ViT-B/16 baselines. While this increased capacity contributes to improved discrimination of subtle radiographic features, it also entails higher computational and memory requirements. However, KL grading is not a hard real-time task requiring millisecond-level inference. In practical deployment scenarios, inference can be performed on centralized hospital servers or supported through model compression strategies such as knowledge distillation or quantization.
8.7. Toward a Lightweight VL-OrdinalFormer for Clinical Deployment
Although the proposed ViT-L/16 backbone provides strong representational capacity and improved discrimination of subtle radiographic changes, its computational footprint may limit deployment in resource-constrained environments. As a practical extension, we propose a lightweight variant, termed VL-OrdinalFormer-Lite, based on knowledge distillation from the ViT-L/16 teacher model to a smaller student architecture such as ViT-B/16.
In this framework, the student model would be trained to replicate both the CORAL ordinal logits and the vision–language alignment representations of the teacher. By transferring ordinal threshold consistency and semantic embeddings, the lightweight model can preserve fine-grained discrimination between adjacent KL grades while significantly reducing parameter count and inference cost.
Such a distillation strategy would enable real-time or edge-based clinical deployment without compromising ordinal stability or interpretability. Future work will investigate compression techniques including structured pruning, low-rank adaptation, and mixed-precision quantization to further improve efficiency while maintaining diagnostic reliability.
9. Conclusions and Future Work
This study introduced a vision–language-guided ordinal learning framework for fully automated KOA severity assessment from radiographic images. By integrating a ViT-L/16 backbone with CORAL-based ordinal regression and CLIP-driven semantic supervision, the proposed method achieves consistent improvements over existing baselines. In particular, it outperforms the widely used VGG19 and ViT frameworks in terms of accuracy and macro-level classification metrics, with notable gains for the clinically challenging KL1 and KL2 categories, where subtle morphological changes often lead to inter-observer disagreement. Complementary interpretability analyses using Grad-CAM and CLIP similarity maps further demonstrate that the model attends to clinically relevant structures, including joint space width, marginal osteophytes, and subchondral bone characteristics. The use of ensemble inference with TTA contributes to improved prediction stability and robustness against anatomical variability and acquisition-related differences, strengthening the suitability of the approach for real-world clinical settings. Together, these findings indicate that combining ordinal constraints with vision–language representations provides an effective and interpretable paradigm for automated KOA grading. Future work will explore several extensions of the proposed framework. First, incorporating bilateral and multi-view radiographs may enable more comprehensive modeling of joint asymmetry and tibiofemoral alignment, which are important indicators of KOA progression. Second, aligning model outputs with structured radiology report terminology could support natural-language explanations and facilitate integration into existing clinical workflows. Finally, evaluation on large-scale, multi-center datasets will be pursued to assess generalizability across diverse patient populations, imaging protocols, and clinical environments. These directions aim to further advance automated KOA assessment toward reliable and scalable real-world deployment.