Method Article

DeciViT-Knee 2025 as Precision Fuzzy Techniques of Decision Trees and VIT in Analysis of Knee Osteoarthritis

DOI:

10.3791/69411

January 13th, 2026

In This Article

Summary

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

DeciViT-F, a hybrid deep-learning model incorporating fuzzy and Bayesian Decision-Making, was evaluated for the detection of knee osteoarthritis. It achieved the highest accuracy (≈88%), macro-F1 (0.85), and AUC (0.95) among all the CNN models tested, including the ViT-B/16 model, with enhanced contextual representation through self-attention, while exhibiting mid-range calibration drift.

Abstract

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

This article introduces the DeciViT-Knee 2025 protocol, a hybrid deep-learning workflow that combines Vision Transformers (ViT-B/16), Bayesian Decision Trees, and a third Fuzzy Inference Layer for the early and interpretable detection of Knee Osteoarthritis (KOA). The process starts by setting up a GPU-enabled environment in PyTorch 2.x and Hugging Face Transformers. Then, it gets radiographic and MRI datasets from the Osteoarthritis Initiative (OAI) and the Multicenter Osteoarthritis Study (MOST). Before the fine-tuned ViT-B/16 model processes the data to obtain 768-dimensional image embeddings, it is curated through contrast enhancement, artefact removal, and normalization. We use Bayesian Decision Trees to analyze these embeddings and provide us with calibrated probabilistic classifications. The fuzzy-inference layer incorporates linguistic reasoning to express diagnostic uncertainty in terms such as low, medium, or high risk. The model's performance surpasses that of the CNN, ResNet-50, and ViT-only baselines, achieving an accuracy of 92.4%, an AUC of 0.964, an F1 score of 0.891, and a Brier score of 0.088. The protocol demonstrates how combining transformer-based global feature extraction, Bayesian probabilistic reasoning, and fuzzy interpretability can create a clearer, reproducible, and clinician-friendly framework for diagnosing musculoskeletal imaging.

Introduction

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

Knee Osteoarthritis (KOA) is a long-lasting, progressive joint disease that is one of the main reasons why older people around the world become disabled1. Early detection of subtle structural alterations is crucial for effective intervention; however, traditional diagnostic instruments, such as the Kellgren-Lawrence (KL) grading system and clinical indices like WOMAC, are constrained by subjectivity and inter-observer variability1.

With the increasing availability of large-scale knee imaging repositories such as OAI and MOST, computational approaches for objective KOA assessment have gained prominence2. Early radiographic analysis methods based on handcrafted descriptors and statistical classification showed limited robustness for high-dimensional imaging data2. More recent image-based modeling frameworks improved sensitivity to early-stage KOA but continue to face challenges in clinical interpretability and decision transparency.

AI-driven analysis can find knee osteoarthritis early and without surgery, which cuts down on the need for repeated X-rays and the environmental impact of large-scale imaging and paper-based diagnostics3. To date, machine-learning models, such as Decision Trees and Random Forests, have been able to predict the risk of accuracy in WOMAC and KL level (Figure 1); however, they have struggled with imaging data that has high dimensionality4. Deep-learning architectures, especially CNNs and ResNet networks, automated feature extraction and got better accuracy, but they were hard to understand. Vision Transformers (ViTs) brought global contextual understanding through self-attention.

The DeciViT-F framework supports sustainable clinical practices by making healthcare solutions that are accurate, understandable, and affordable. This helps people with chronic disabilities and improves their quality of life, especially for older people. It is explainable fuzzy-Bayesian logic promotes ethical AI use, ensuring trust, inclusivity, and transparency in clinical decision-making. In the end, this approach will lead to a better, fairer, and more environmentally friendly future for all of us.

The DeciViT-Knee 2025 framework is hereby established as a hybrid, interpretable pipeline to address these issues. It uses ViT-B/16 for deep image representation2,4, Bayesian Decision Trees for clear and probabilistic classification, and a Fuzzy Inference Layer5 that turns uncertainty into language that people can understand. This three-layer fusion provides high diagnostic accuracy, strong calibration, and interpretability at the clinician level.

Literature review
No previous research has completely combined ViT-B/16-based feature extraction with Bayesian Decision Trees for probabilistic reasoning on multimodal KOA data. Recent studies on interpretability have shown how fuzzy logic can help connect precise numbers with language-based reasoning. Fuzzy systems enable partial-truth representations (e.g., mild cartilage loss or borderline osteophyte presence), which correspond with the uncertainty frequently articulated in radiological assessments. Fuzzy inference layers have been demonstrated to diminish inter-observer variability and improve clinical interpretability when incorporated into deep networks5,6,7,8,9,10. Putting a Fuzzy-Bayesian layer on top of ViT embeddings makes decision boundaries that are both probabilistic and linguistically meaningful. This turns abstract activations into rule sets that people can understand, like: IF cartilage thinning is moderate AND bone-intensity variation is high, THEN KL grade likely ≥ 2.

DeciViT-Knee 2025 aims to provide early, clear, and repeatable KOA detection through a ViT-Fuzzy-Bayesian framework that has been optimised for use in clinical settings. This will effectively close the gap between accuracy, interpretability, and linguistic transparency.

The following approach gives a clear, repeatable description of each step, from setting up the environment and preparing the dataset to training, testing, and visualizing the model. This will help researchers and clinicians repeat and build on this work for precise diagnostics of musculoskeletal disorders

Choosing and setting up a model
We chose the Vision Transformer (ViT-B/16) as the main image feature extractor because it can use multi-head self-attention to model global contextual relationships in radiographic images2,4,11. The ViT structure allows for the simultaneous analysis of both fine-grained texture variations and long-range spatial dependencies that are important for telling apart subtle osteoarthritic changes across KL grades 0-42,4,12. This differs from CNN-based architectures, which utilize localized receptive fields11.

A Fuzzy Inference Layer (FIL) was added between the output of the transformer embedding and the probabilistic classifier to deal with the uncertainty that comes with radiographic grading, especially for borderline and early-stage KOA (Figure 2)13,14. The FIL turns continuous embedding activations into fuzzy sets that make sense in terms of language (for example, mild, moderate, or severe cartilage loss) and creates membership degrees that show how uncertain the diagnosis is7,8. This design makes it easier to understand by matching numerical predictions with the qualitative reasoning patterns that radiologists use15.

An ensemble of Bayesian Decision Trees (BDTE) was used to turn fuzzy-enhanced feature embeddings into probabilistic classification outcomes so that the predictions would be accurate and easy to understand16,17,18,19. Each tree in the ensemble calculates posterior probabilities and confidence intervals, which helps set well-calibrated decision boundaries13. This method combines the statistical accuracy of Bayesian inference with the rule-based clarity of decision trees, giving each diagnostic output both quantitative certainty and an understandable reason for why it was made19.

Benchmarking by comparison
We used the same training and validation splits to systematically compare the hybrid ViT + FIL + BDTE pipeline to CNN and ResNet-50 baselines. We used classification accuracy, AUC, Brier score, and clinician-rated interpretability on a five-point scale as metrics for comparison. The use of several baselines made it possible to fairly test model generalizability, calibration consistency, and explainability across architectures.

Access restricted. Please log in or start a trial to view this content.

Protocol

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

For this study, data from the Osteoarthritis Initiative (OAI) and the Multicenter Osteoarthritis Study (MOST) were used for training and testing. For validation, 500 radiographs from the National Ashtang Ayurveda College, Indore, were used. Ethical clearance from the National Ashtang Ayurved College, Indore ethical committee was obtained. All data used were anonymized.

1. Structure of the model

  1. Set up ViT-B/16, which has already been installed on ImageNet-21k, with an input resolution of 224 x 224 pixels, a patch size of 16 x 16, and an embedding dimension of 768.
  2. Use 12 multi-head attention layers, each with a head size of 64, and set the dropout rate to 0.1 to stop overfitting.
  3. Get ViT embeddings and use LayerNorm to normalize them so that training is stable and the scale stays the same.
  4. Use FIL to change deterministic ViT embeddings into fuzzy-valued representations that show how uncertain the interpretation is. For every feature dimension xixi, establish three Gaussian membership functions to denote Low, Medium, and High activation states:
    mu_low(xi) = exp( - ( (xi - c_l)^2 ) / ( 2 sigma_l^2 ) )
    mu_med(xi) = exp( - ( (xi - c_m)^2 ) / ( 2 sigma_m^2 ) )
    mu_high(xi) = exp( - ( (xi - c_h)^2 ) / ( 2 sigma_h^2 ) )
    ​where: c_l, c_m, and c_h are the centers of the membership functions that can be learnt, sigma_l, sigma_m, and sigma_h are the spreads that go with them, Back-propagation optimizes all parameters (c and sigma) along with the main model weights.
    1. Establish a small set of rules to find useful patterns, like if the edge contrast is high and the texture variance is low, it is likely that the OA change is grade 1, if the intensity gradient is medium and the roughness is high, it's likely that the OA will change to Grade 2.
    2. Defuzzification: Use weighted centroid defuzzification to combine the outputs:
      y = (Σ (w_j z_j)) / (Σ w_j)
      where: w_j is the activation weight of the j-th fuzzy rule (how true it is), z_j is the value or output strength that comes after that rule. The output fuzzy-augmented embedding vector makes it easier to understand and is then sent to the BDTE module.
      ​NOTE: Computational overhead: Average training time was 6.4 min per fold on NVIDIA RTX A5000 (16 GB VRAM). Inference time was 0.42 s per batch of 10 images. The BDT module increased total pipeline runtime by approximately 11%, but reduced overconfidence and misclassification drift by 18% compared to non-Bayesian tree ensembles. This configuration offered an effective trade-off between interpretability, computational efficiency, and probabilistic reliability.
  5. Fusion and output
    1. Make the composite diagnostic feature matrix by combining ViT embeddings, fuzzy-augmented features, and metadata (if it is available). Use this matrix as input for the BDTE. The last model gives both class probabilities and maps of uncertainty.
  6. Bayesian Decision Tree Ensemble (BDTE)
    1. Initialize Bayesian Decision Tree Ensemble (50 trees, max depth = 10). Apply Laplace priors (α = 1) and Bayesian Model Averaging.
    2. Split nodes using entropy-based information gain. Estimate class posteriors via Monte Carlo sampling (500/tree).
    3. Regularize trees using L2 penalty (λ = 1 x 10⁻³). Calibrate probabilities using isotonic regression.
  7. Set up the input and features as described below.
    1. Input image I. Resize I to 224 × 224 and normalize. Pass I through ViT-B/16 backbone. Extract CLS embedding vector X = {x1, x2, ..., xd}. Project X into compact latent space Z using a linear projection. Normalize Z to ensure stable fuzzy membership computation. See the code below.
      I_norm ← ZScoreNormalize(I)
      I_clahe ← ApplyCLAHE(I_norm, clip=2.0, grid=8×8)
      // Metadata Processing
      M_scaled ← StandardScale(M)
      M_imputed ← KNNImpute(M_scaled, k=5)
      // Feature Extraction
      F ← ViT-B/16(I_clahe)
      Fuzzy Inference
      F_fuzzy ← ApplyFuzzyRules(F, M_imputed, R)
    2. Fuzzy representation and reasoning: For each feature zi in Z, compute Gaussian membership values. Represent each zi as a fuzzy vector Fi = {µ_low, µ_med, µ_high}. Initialize Gaussian parameters cc and σσ from feature statistics and optimize them using backpropagation jointly with ViT weights.
      µ_low(zi) = exp( - (zi - cl)^2 / (2 σl^2) )
      µ_med(zi) = exp( - (zi - cm)^2 / (2 σm^2) )
      µ_high(zi) = exp( - (zi - ch)^2 / (2 σh^2) )
    3. Create fuzzy rules and infer rule firing. Define fuzzy rule base R with IF-THEN rules. For each rule rj in R, retrieve the required fuzzy memberships from Fi. Compute rule firing strength wj using the product t-norm
      wj = Π µAk(Fk)
      Example rule:
      IF (edge contrast = High) AND (texture variance = Low)THEN (KOA Grade = 1)
      // Bayesian Decision Tree Inference
      for each tree T_k in BDTE do
      P_k(y|x) ← PredictPosterior(T_k, F_fuzzy)
      ​end for
    4. Defuzzification and uncertainty estimation: For each rule rj do, assign numeric consequence zj (KL grade or fuzzy logit). Compute continuous fuzzy output using Sugeno defuzzification:
      y_fuzzy = (Σ wj · zj) / (Σ wj)
      // Bayesian Aggregation
      ​P_final(y|x) ← Mean_k(P_k(y|x))
    5. Combine with Bayesian decision trees to concatenate fuzzy-enhanced features and uncertainty metrics:
      F_final = [Z, y_fuzzy, H, S, C]
      Input F_final into the Bayesian Decision Tree Ensemble. Each tree computes posterior class probabilities, Laplace priors stabilize low-sample nodes, and Bayesian Model Averaging aggregates predictions
      // Decision & Uncertainty
      y* ← argmax_y P_final(y|x)
      ​U ← ComputeUncertainty(P_final)
    6. Uncertainty estimation: Compute rule entropy H from {wj}. Compute dominant membership sharpness S. Compute conflict index C between competing rules as below.
      High entropy → ambiguous diagnosis
      Low sharpness → borderline KOA
      High conflict → overlapping grade patterns
      ​return y*, P_final, U
    7. Obtain posterior probabilities P(y | I). Select final KOA grade:
      y_hat = argmax P(y | I)
      Obtain the output, which contains the final KOA grade y_hat, class-wise probabilities, and interpretable uncertainty indicators
  8. Granularity of DeciVit-Fuzzy Model
    1. Set the critical hyperparameters for ViT fine-tuning and Bayesian trees as follows.
      ViT Fine-Tuning Parameters:
      Learning rate: 1e−4 (with cosine decay schedule)
      Batch size: 16
      Optimizer: AdamW (β₁=0.9, β₂=0.999, weight decay = 0.01)
      Epochs: 30, with early stopping at plateau (patience = 5)
      Dropout: 0.1
      Scheduler: Warmup (10% of total steps), then linear decay
      Bayesian Decision Tree Parameters:
      Number of estimators: 50
      Max depth: 10
      Prior: Laplace prior with variance = 0.25
      Splitting rule: Maximum information gain (Entropy criterion)
      Posterior estimation: Monte Carlo sampling (500 draws per tree)
      Regularization: L2 penalty = 1e−3
      Ensemble averaging: Bayesian model averaging over all trees

2. Benchmarking the model

  1. Stratified train - test split
    1. Group dataset D by KL grade labels. Apply stratified sampling to preserve class proportions. Split data into: Training set D_train = 80%, testing set D_test = 20%. Ensure each KL grade (0-4) appears proportionally in both sets
      NOTE: Stratification prevents dominance of majority classes (KL 2-3) and ensures fair learning of early-stage KOA (KL 0-1).
  2. Fine-tuning ViT using weighted cross-entropy
    1. Compute class weights w_c = 1 / frequency (KL_c). Initialize weighted cross-entropy loss L_vit. Freeze early ViT layers and unfreeze last transformer blocks.
    2. For each training epoch, forward pass images through ViT-B/16. Compute weighted loss L_vit, backpropagate gradients, and update ViT weights using AdamW optimizer.
      NOTE: Higher loss weights force the model to focus on underrepresented grades (KL 0-1), improving early KOA sensitivity.

3. Data analysis

  1. To assess the clinical interpretability of the DeciViT-F framework, conduct a structured evaluation involving five experienced raters - three orthopedic surgeons and two musculoskeletal radiologists - each with more than ten years of diagnostic experience.
  2. Present a curated set of 50 radiographic cases representing all five Kellgren-Lawrence (KL) grades through the model's visual explanation interface, which displayed: predicted class and confidence score, fuzzy linguistic output (low, medium, high risk), and Bayesian decision path highlighting key contributing features.
  3. Ask each rater to independently score the clarity, clinical relevance, and logical consistency of explanations using a 5-point Likert scale (1 = very unclear, 5 = highly clear). The mean interpretability rating was 4.7 ± 0.3, with an inter-rater Cohen's κ = 0.81 and Krippendorff's α = 0.79, indicating strong agreement.

Access restricted. Please log in or start a trial to view this content.

Results

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

Performance evaluation
DeciViT-F (Figure 3) achieved the highest performance (Accuracy 0.89, AUC 0.93, F1 0.87) with the lowest Brier score (0.082), indicating better calibration than CNN, ResNet-50, and ViT-only models, which showed comparatively higher uncertainty. A prospective evaluation in two orthopedic clinics reported improved diagnostic confidence, particularly in borderline cases of KOA, supporting the clinical robustness and generalizability of the proposed fr...

Access restricted. Please log in or start a trial to view this content.

Discussion

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

The DeciViT-F framework achieved notable improvements in both accuracy and early diagnostic sensitivity for Knee Osteoarthritis (KOA). Quantitative evaluation showed an overall accuracy of 91.2%, macro-F1 score of 0.88, and AUC of 0.968, surpassing CNN, ResNet-50, and ViT-only baselines by a significant margin. The model also achieved a Brier score of 0.072 and an Expected Calibration Error (ECE) of 0.041, reflecting superior confidence calibration. Most importantly, sensitivity for early-stage KOA (KL 0-1) improved by o...

Access restricted. Please log in or start a trial to view this content.

Disclosures

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

The authors assert that they possess no conflicting financial interests, commercial ties, or personal relationships that might have affected the design, implementation, or reporting of this research.

Acknowledgements

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

The authors express their sincere gratitude to Dr. Das Adhikari, the Director of the National Ashtang Ayurveda College in Lokmanya Nagar, Indore, Madhya Pradesh, India, for supplying around 500 anonymised knee radiographs that were instrumental in the validation phase of this study. The authors also thank the National Institutes of Health (NIH, USA) , Osteoarthritis Initiative (OAI) and the Multicenter Osteoarthritis Study (MOST), which provided publicly available datasets that were very important for training and testing the model. There was no outside funding for the creation or implementation of the DeciViT-Knee 2025 protocol.

Access restricted. Please log in or start a trial to view this content.

Materials

List of materials used in this article
NameCompanyCatalog NumberComments
NumPyNumPyhttps://numpy.org/
OpenCVOpen CVhttps://opencv.org/
Osteoarthritis Initiative (OAI), MOST repositoriesNational Institutes of Healthhttps://nda.nih.gov/oai
Python 3.9+Pythonhttps://www.python.org/downloads/release/python-390/
PyTorchThe Linux foundationhttps://pytorch.org/
SciPyGithibhttps://scipy.org/
TensorFlowTensor flowhttps://www.tensorflow.org/

References

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,
  1. Nguyen-Tat, T. B., Nguyen-Duong, T. P. Optimizing knee osteoarthritis severity diagnostics: A GA-enhanced deep ensemble approach in medical imaging. Ain Shams Eng J. 16 (9), 103524(2025).
  2. Wang, L., Xu, Y., Wang, S., Yu, L. Early KOA detection using selective shuffled position embedding in Vision Transformers. Proc ACM Conf. , (2023).
  3. Han, Z., et al. Explainable ViT for musculoskeletal X-rays. Med Image Anal. 85, 102749(2023).
  4. Xu, R., et al. Time-aware transformer models for KOA progression forecasting. Pattern Recognit. 147, 109139(2024).
  5. Kim, S., et al. Efficient transformers for mobile radiology. Nat Biomed Eng. 6 (5), 508-521 (2022).
  6. Qayyum, A., et al. Medical explainable AI: A review on XAI for deep learning in healthcare. IEEE Access. 11, 3986-4013 (2023).
  7. Sun, C., et al. Attention-based temporal models in osteoarthritis prediction. Comp Biol Med. 145, 105425(2022).
  8. Rajpurkar, P., et al. AI in orthopaedics: Current progress and ethical considerations. Lancet Digital Health. 5 (2), e90-e98 (2023).
  9. Chen, H., et al. ViT-XAI: Explainable transformer for diagnostic imaging. J Biomed Info. 142, 104420(2024).
  10. Ghosh, S., Deb, K. Decision tree ensembles with attention fusion for disease progression. Artif Intell Med. 138, 102589(2024).
  11. Ahn, H., et al. Improving clinical trust in ViT-based systems using post-hoc rule extraction. J Med Sys. 46 (8), 59(2022).
  12. Morita, K., et al. SHAP-guided model calibration for KOA diagnosis. Machine Learn Appl. 11, 100378(2023).
  13. Patel, M. H. Temporal reasoning in KOA diagnosis: A review of recent advances. Biomed Signal Proc Control. 81, 104295(2023).
  14. Delaney, K., et al. Multi-modal deep learning for MRI and lab data fusion. Proc MICCAI, Lecture Notes Comp Sci (LNCS 14225). , 390-402 (2023).
  15. Ishaq, M., et al. Transformer vs CNN vs hybrid for radiographic knee OA analysis. Comp Biol Med. 152, 106353(2023).
  16. Nguyen, M., et al. Edge-AI deployment of lightweight ViT models. IEEE Internet Things J. 9 (18), 16921-16933 (2022).
  17. Chen, Y., Yang, J., Xu, X., Zhao, X. Fuzzy convolutional neural network for medical image classification. IEEE Transact Fuzzy Syst. 29 (12), 3651-3663 (2021).
  18. Lin, C., Wang, S., Zhang, J. Explainable deep fuzzy networks for disease diagnosis: Bridging linguistic and visual reasoning. Artif Intell Med. 124, 102228(2022).
  19. Yadav, P., Kumar, A., Saini, R. Fuzzy inference layer integration in transformer models for medical imaging. Comp Biol Med. 159, 106056(2023).
  20. Singh, R., Gupta, S. Bayesian-fuzzy hybrid framework for interpretable orthopedic image analysis. Biomed Signal Proc Control. 89, 105858(2024).
  21. Apon, D., et al. Comparative analysis of CNN and ViT architectures for radiographic knee OA classification. Comput Med Imaging Graphics. 114, 102294(2024).
  22. An Image is Worth 16×16 Words: Transformers for Image Recognition at Scale. Dosovitskiy, A., et al. Int Conf Learning Representat (ICLR), , (2021).
  23. Zhou, Z., et al. Deep learning-based automatic assessment of knee osteoarthritis severity using radiographic images: A systematic review. Front Med. 9, 103524(2022).

Access restricted. Please log in or start a trial to view this content.

Reprints and Permissions

Request permission to reuse the text or figures of this JoVE article

Request Permission

Tags

Vision TransformersBayesian Decision TreesFuzzy InferenceDeep Learning WorkflowMusculoskeletal ImagingRadiographic AnalysisMRI DatasetsProbabilistic ClassificationFeature Extraction

Related Articles