Enhancing Thyroid Disease Diagnosis With Machine Learning and Counterfactual Explainable AI

Authors:

Abstract
Thyroid disease affects millions worldwide and is often underdiagnosed due to complex symptom overlaps and reliance on laboratory interpretation. Machine learning (ML) offers promise for automated diagnosis, but model transparency remains a barrier to clinical adoption. In this study, we develop an interpretable ML framework for thyroid disease classification using a real-world dataset from the UCI repository. We evaluate five classifiers—including Random Forest, CatBoost, and Support Vector Classifier—under a rigorous nested cross-validation scheme to ensure unbiased performance estimation. Our best models achieve near-perfect accuracy (up to 99.7%) and AUC (1.000) on a reduced set of ten consensus physiological features, demonstrating that high performance can be maintained with parsimonious inputs. To enhance trust and clinical utility, we integrate dual explainable AI (XAI) techniques: SHAP for local feature attribution and counterfactual analysis for actionable "what-if" reasoning. These explanations align closely with known endocrine physiology (e.g., TSH and FTI as primary drivers), supporting their face validity. While limited by class imbalance and lack of external validation, our approach combines strong predictive power with transparent decision-making, offering a foundation for trustworthy clinical decision support systems in thyroid care.

This publication has 55 references indexed in Scilit: