How machine learning helps with thyroid disease prediction

Blog

Why machine learning matters for thyroid disease prediction

Thyroid disorders, including hypothyroidism, hyperthyroidism, and thyroid malignancies, are among the most common metabolic and endocrine conditions worldwide. Traditional diagnosis relies on clinical symptoms, physical evaluation, and biochemical assays. These assays measure levels of thyroid hormones, such as thyroid-stimulating hormone (TSH), Free T3 and Free T4, and thyroid antibodies (TPOAb). In addition, diagnosis uses ultrasound examinations and fine-needle aspiration biopsies. While established pathways are helpful, standard clinical cutoffs can sometimes miss subtle dysfunctions or fail to capture complex individual physiological variations. Machine learning (ML) has become increasingly essential in thyroid disease prediction by handling complex diagnostic variables and reducing diagnostic errors.

Supervised and unsupervised learning models

All machine learning models can be divided into two categories: supervised and unsupervised learning models, depending on the data they work with. Supervised models, such as logistic regression, decision trees, and neural networks, work with labeled data featuring explicitly defined outcomes. For example, each sample has a pre-defined target label like “hypothyroid” or “euthyroid”. These models generate predictions on new unlabeled data, usually referred to as validation samples. For this purpose, they use trained prediction values from the training set of labeled data.

Unsupervised models, such as K-means clustering, work with unlabeled data to discover hidden patterns or underlying structural distributions without pre-defined target labels.

Logistic regression models

Logistic Regression (LR) is a foundational statistical and machine learning model. It maps input features to a probability score using the sigmoid function. For thyroid disease prediction, it frequently serves as a powerful baseline model, achieving high classification accuracies on structured thyroid datasets. Because the model outputs explicit regression coefficients, medical researchers can directly translate them into odds ratios. These ratios quantify how much a single unit change in a biomarker, such as TSH, alters thyroid disorder risk.

However, LR relies on manual pre-modeled outcome-predictor relationships, often requiring manual feature engineering and complex data normalization. Oftentimes, a patient record has missing laboratory values, such as an unmeasured Free T3 test. Therefore, the missing data must be handled beforehand through imputation techniques.

Decision trees and extreme gradient boosting

Decision Trees are non-parametric supervised learning models that split data recursively based on feature thresholds. For example, these thresholds can be specific cutoff values for TSH or Free T4 levels. These models effectively capture non-linear relationships and interactions between various clinical parameters, such as age, sex, and hormone profiles. Unlike LR models, they do not require complex data normalization.

XGBoost is an advanced gradient-boosting ensemble framework that builds sequential decision trees, where each new tree corrects the residual errors of previous ones. XGBoost consistently ranks among the top-performing algorithms for tabular medical datasets by minimizing bias and variance, preventing overfitting on noisy clinical datasets, and handling missing values effectively.

Neural networks for thyroid disease prediction

Recent advancements in deep learning have dramatically enhanced how neural networks process data for thyroid disease prediction and classification. For example, they process image data, such as ultrasound scans, and numerical data, such as age, gender and TSH levels.

Medical imaging, particularly thyroid ultrasonography, relies on Convolutional Neural Networks (CNNs, shown in Figure 1) and specialized deep learning architectures to distinguish between benign and malignant thyroid nodules. Researchers frequently employ standard or retrained backbone CNNs, such as ResNet, via transfer learning to evaluate radiomics features like nodule shape, margins, echogenicity, and calcifications.

Joint predictive models, such as hybrid and radiomics-clinical fusion models, merge numerical patient metrics with quantitative image radiomics features. Fusing these data streams helps optimize diagnostic workflows and minimizes the necessity for invasive fine-needle aspiration biopsies on benign nodules.

Figure 1. The workflow for thyroid nodule classification using convolutional neural networks with ResNet18 and feature extraction. Evaluation indicators are used to evaluate the effect of model classification. In addition, a heatmap was employed to visualize the prediction results, by which authors extracted and analyzed the highlighted areas. Adapted from J. Yang et al 2022 [5].

How ML can change clinical practice

In thyroid disease prediction, performance evaluation ensures high validation standards and reliability before deployment. For example, evaluation uses metrics like AUC, F1 score, precision, and recall. In addition, feature extraction isolates essential clinical variables and radiomic biomarkers to catch subtle physiological variations early.

Bias and explainability in thyroid disease prediction

Key potential risks associated with almost every advanced ML model include algorithm bias from non-representative training datasets. In addition, the “black-box” nature makes clinical interpretability difficult. To fix bias, we need to build training sets that genuinely represent diverse patient groups. We also need to use smart data adjustments to stop health disparities from happening.

Tackling the “black-box” problem involves integrating explainable AI frameworks, such as SHapley Additive exPlanations (SHAP, shown in Figure 2). These frameworks, in turn, mathematically expose how specific features drive a prediction. Keeping these tools safe, fair and reliable comes down to regular check-ups on how models perform. In addition, teams with varied perspectives need to guide their use. Finally, doctors need to stay directly involved to oversee every decision before AI enters day-to-day clinical work.

Figure 2: Example of SHAP values of important features which impact the model output. Large positive SHAP values indicate that the feature’s specific value pushes the model’s prediction toward a positive outcome (such as a higher risk of thyroid disease), while large negative SHAP values pushes the prediction toward a negative outcome (such as a lower risk of thyroid disease, or a normal euthyroid state). Adopted from C. J. Ejiyi et al 2026 [6]

Author: Lucia Buljac (University of Split, Faculty of Science)

Key references

  1. Alkhazzar, H., & Moslem, B. (2024). Thyroid Disease Prediction Using Machine Learning Model: Decision Tree. EDRAAK, 2024, 84–100. https://doi.org/10.70470/edraak/2024/011
  2. Chaganti, R., Rustam, F., De La Torre Díez, I., Mazón, J. L. V., Rodríguez, C. L., & Ashraf, I. (2022). Thyroid Disease Prediction Using Selective Features and Machine Learning Techniques. Cancers, 14(16), 3914. https://doi.org/10.3390/cancers14163914
  3. Hu, M., Asami, C., Iwakura, H., Nakajima, Y., Sema, R., Kikuchi, T., Miyata, T., Sakamaki, K., Kudo, T., Yamada, M., Akamizu, T., & Sakakibara, Y. (2022). Development and preliminary validation of a machine learning system for thyroid dysfunction diagnosis based on routine laboratory tests. Communications Medicine, 2, Article 71. https://doi.org/10.1038/s43856-022-00071-1
  4. Chan, W.-K., Sun, J.-H., Liou, M.-J., Li, Y.-R., Chou, W.-Y., Liu, F.-H., Chen, S.-T., & Peng, S.-J. (2021). Using Deep Convolutional Neural Networks for Enhanced Ultrasonographic Image Diagnosis of Differentiated Thyroid Cancer. Biomedicines, 9(12), 1771. https://doi.org/10.3390/biomedicines9121771 Cited by: 38
  5. Yang, J., Shi, X., Wang, B., Qiu, W., Tian, G., Wang, X., Wang, P., & Yang, J. (2022). Ultrasound Image Classification of Thyroid Nodules Based on Deep Learning. Frontiers in Oncology, 12, 905955. https://doi.org/10.3389/fonc.2022.905955
  6. Ejiyi, C.J., Eze, F.O., Hossin, M.A. et al. A robust framework for clinically interpretable hypothyroidism diagnosis with Polynomial-SHAP and DeepSeqNet. J Big Data 13, 63 (2026). https://doi.org/10.1186/s40537-025-01332-1
Tag Post :
#EUfunded,#HorizonEurope,#InnoThyroGen,#Personalisedmedicine,#ThyroidHealth
Share This :