
International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
Volume: 13 Issue: 04 | Apr 2026 www.irjet.net p-ISSN: 2395-0072
THYROID DISEASE PREDICTION & PRECAUTIONS USING MACHINE
LEARNING
J. Bramaramba 1 , A. Sathisha Reddy2 , M. Sravanthi3 , M. Likitha 4, V. Suchitra5
1 Asst. Professor, Dept. of Information Technology, Vidya Jyothi Institute of Technology, Hyderabad, India 2,3,4,5 B.Tech Students, Dept. of Information Technology, Vidya Jyothi Institute of Technology, Hyderabad, India
Abstract - Disorders related to the thyroid gland are among the most common endocrine issues, significantly influencingmetabolism,energybalance,andoverallhealth. Earlyidentificationoftheseconditionsiscrucial;however, traditionaldiagnosticmethodsprimarilyrelyonlaboratory testingandexpertinterpretation,whichcanbecostly,timeconsuming, and prone to human error. This research presents a machine learning–based system aimed at predicting thyroid diseases while also providing tailored healthcarerecommendations.
The proposed approach integrates several classification algorithms, including Random Forest, Logistic Regression, and k-Nearest Neighbors (k-NN), to analyze thyroid ultrasound images alongside relevant patient health information.Thesystemisstructuredthroughasystematic pipelineconsistingofdatacollection,preprocessing,feature extraction,modeltraining,andevaluation.Advancedimage processingtechniquesareappliedtoextractkeyattributes such as texture, shape, and intensity from ultrasound images,enablingaccuratedifferentiationofvariousthyroid conditions.
Furthermore, a user-friendly web application built with Flask serves as an interactive interface, allowing users to upload medical images, input health details, and receive immediatepredictionresults.Inadditiontodiagnosis,the system incorporates a recommendation module that provides personalized guidance, including diet plans, exercise suggestions, preventive strategies, and foods to avoid,dependingonthediagnosedcondition.
Experimental results demonstrate that this method improves diagnostic accuracy, reduces analysis time, and enhancesaccessibilitycomparedtoconventionaltechniques. Overall, the study highlights the potential of integrating machine learning with web technologies to develop intelligent, efficient, and accessible solutions for thyroid diseasemanagement.
Key Words: Machine Learning, Thyroid Disease Prediction, Random Forest, Logistic Regression, kNearest Neighbors, Ultrasound Image Analysis, Healthcare Application, Predictive Modeling
1. INTRODUCTION
Thyroiddisordersareamongthemostcommonendocrine conditions, having a significant impact on metabolism, energyregulation,andoverallhealth.Thethyroidglandis
essentialforhormoneproduction,andanyimbalanceinits functioning can lead to disorders such as hypothyroidism andhyperthyroidism.Theseconditionsareoftendifficultto identifyintheirearlystagesbecausetheirsymptomstendto bemildornonspecific,makingtimelydiagnosischallenging. With rapid technological progress, machine learning has become an influential tool in the healthcare sector. It facilitates the analysis of large datasets, helps uncover hiddenpatterns,andsupportsaccuratediseaseprediction. Thisworkfocusesonutilizingmachinelearningtechniques to design an intelligent system for predicting thyroid disorders by analyzing ultrasound images along with relevantpatienthealthparameters.
The proposed system incorporates multiple machine learning algorithms, including Random Forest, Logistic Regression, and k-Nearest Neighbors (k-NN), to improve predictionaccuracyandreliability.Inaddition,aweb-based application developed using Flask provides an interactive anduser-friendlyplatform,enablinguserstoinputdataand receivepredictionresultsefficiently.
2. PROBLEM STATEMENT
Thyroiddisordersareagrowinghealthconcernthataffect metabolism, hormone balance, and overall body function. Early detection remains challenging due to mild or nonspecificsymptoms.Traditionaldiagnosticmethodsrelyon laboratorytestssuchasT3,T4,andTSHalongwithexpert evaluation,whichcanbetime-consuming,costly,andprone toinconsistencies.
Current diagnostic systems have several limitations, including dependence on manual analysis, lack of standardized procedures, and limited use of advanced technologies like machine learning. Additionally, existing approaches do not provide integrated solutions that combine disease prediction with personalized healthcare recommendations.
Analyzing thyroid ultrasound images also presents difficultiesduetonoise,varyingimagequality,andcomplex tissue structures. The absence of automated feature extractionandprocessingmethodsreducestheaccuracyof diagnosis. Moreover, increasing medical data requires efficient systems capable of handling large datasets and providingreal-timeresults.
Thisstudyaddressestheneedforamachinelearning-based system that can accurately and efficiently predict thyroid disorders using medical images and patient data. By

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
Volume: 13 Issue: 04 | Apr 2026 www.irjet.net p-ISSN: 2395-0072
applying algorithms such as Random Forest, Logistic Regression,andk-NearestNeighbors(k-NN),theproposed solution aims to improve diagnostic accuracy, reduce evaluation time, and support better healthcare decisionmaking.
3. RELATED WORK
3.1 Machine Learning-Based Thyroid Disease Prediction
Numerousstudieshaveexploredtheuseofmachinelearning for predicting thyroid disorders. Islam et al. (2025) implementedensembletechniquessuchasRandomForest and XGBoost to enhance accuracy and address data imbalanceissues.Likewise,Metkewaretal.(2025)evaluated models including Logistic Regression and Random Forest, concluding that Random Forest delivered superior performance.
3.2 Intelligent Systems for Early Detection
Research by Sheela Devi and Parveen Kumar (2025) introduced an XGBoost-based approach for early thyroid disease detection, achieving improved accuracy through hyperparameteroptimization.OthermethodsutilizingNaïve Bayes and big data frameworks demonstrated good scalability but comparatively lower accuracy than more advancedalgorithms.
3.3 Web-Based and Real-Time Prediction Systems
Santhoshini and Goutham (2025) designed a Random Forest-driven model integrated with a Flask-based web application to enable real-time predictions. Recent developmentsemphasizecombiningmachinelearningwith web technologies to create interactive platforms that provide fast results along with personalized healthcare suggestions.
4. SYSTEM ARCHITECTURE
The proposed framework is developed as an intelligent machinelearningsystemaimedatpredictingthyroiddisease fromultrasoundimages.Itiscomposedofseveralintegrated components,namelytheuserinterface,preprocessingunit, feature extraction module, classification module, and recommendationsystem.
The process starts with user interaction through a webbased interface built using Flask, where users can upload thyroid ultrasound images. Once the image is received, it undergoes preprocessing steps such as resizing, normalization,andnoisereductiontoimprovedataquality.
Following preprocessing, the system performs feature extractiontoderiverelevantcharacteristicsfromtheimages.
These extracted features are then supplied to machine learning models for classification. The classification stage employs algorithms like Logistic Regression, K-Nearest Neighbors(KNN),andRandomForest,implementedusing Scikit-learn,todeterminethestageofthyroiddisease.
Based on the classification results, the recommendation module provides tailored suggestions, including dietary guidance, precautionary measures, and suitable exercises. Finally, all outputs are presented to the user through the webinterface.

5. METHODOLOGY
Theapproachfollowedinthisstudyaimstobuildanefficient machine learning-based system for classifying thyroid disease using ultrasound images. The overall process includes several stages: data acquisition, preprocessing, feature extraction, model development, performance evaluation,andfinalprediction.
5.1 Data Collection
ThedatasetutilizedinthisworkissourcedfromtheKaggle repositoryandcontainslabeledthyroidultrasoundimages. These images are grouped into three categories: early, moderate,andseverestages.Toensurereliableassessment ofmodelperformance,thedatasetissplitintotrainingand testingsetsusingan80:20ratio.
5.2 Data Preprocessing
To enhance the quality and uniformity of the input data, several preprocessing techniques are applied. Images are resized to a standard dimension of 224 × 224 pixels to maintain consistency. Noise is reduced using appropriate filtering methods, while pixel values are normalized to stabilize the learning process. Additionally, data augmentationtechniquessuchasrotationandflippingare employed to increase dataset diversity and reduce overfitting.

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
Volume: 13 Issue: 04 | Apr 2026 www.irjet.net p-ISSN: 2395-0072
5.3 Feature Extraction
Inthisstage,rawimagedataistransformedintomeaningful numerical features that can be processed by machine learning models. The extracted features include texture characteristics that capture tissue patterns, shape-related attributesthatdescribestructuraldifferences,andintensitybased features that reflect variations in pixel brightness. Thesefeaturesserveasinputsforclassification.
5.4 Model Training
Theprocessedfeaturesareusedtotrainseveralsupervised learningalgorithms,includingLogisticRegression,K-Nearest Neighbors (KNN), and Random Forest. These models are implementedusingScikit-learn,andtheirhyperparameters arefine-tunedtoachieveoptimalperformanceandaccuracy.
5.5 Model Evaluation
Toassesstheeffectivenessofthetrainedmodels,standard evaluation metrics are employed. These include accuracy, precision,recall,andF1-score,whichcollectivelyprovidea comprehensivemeasureofclassificationperformanceacross differentdiseasestages.
5.6 Prediction and Recommendation
For prediction, users upload thyroid ultrasound images throughthesysteminterface.Themodelprocessestheinput and determines the corresponding disease stage early, moderate,orsevere. Based onthe predicted outcome, the systemgeneratespersonalizedrecommendations,including dietary advice, precautionary measures, and exercise guidelines.
5.7 Workflow Diagram

6. RESULTS & DISCUSSION
6.1
Clean-Data Classification Performance
The dataset consists of 156 thyroid ultrasound images divided into three categories: stage1, stage2, and thyroid. After preprocessing and extracting relevant features, the modelsweretestedon32samples.
Allthreealgorithms KNN,LogisticRegression,andRandom Forest exhibitedhighclassificationaccuracy.BothLogistic Regression and Random Forest achieved flawless results, whereasKNNproducedafewmisclassifications,particularly withinthestage2category.
6.2 Accuracy Comparison of ML Models
Theperformanceoftheevaluatedmachinelearningmodels was assessed based on their classification accuracy. The comparativeresultsarepresentedinTable1
Table -1: Accuracy Comparison of Machine Learning Models
Interpretation:
Logistic Regression and Random Forest achieved perfect accuracy, indicating their effectiveness in correctly classifyingalltestsamples.Incomparison,theKNNmodel also demonstrated strong performance but exhibited a slightlyloweraccuracyduetominormisclassifications.


International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
Volume: 13 Issue: 04 | Apr 2026 www.irjet.net
6.3 Comparison of Precision, Recall & F1-Score
The classification performance of the models was further evaluatedusingprecision,recall,andF1-score.Thedetailed resultsforeachmodelarepresentedinTables2–4.
Table -2: Performance Metrics of KNN Model

6.4 Confusion Matrix of Logistic Regression
Table -3: Performance Metrics of Logistic Regression Model
Table -4: Performance Metrics of Random Forest Model
Interpretation:
Logistic Regression and Random Forest achieved perfect precision,recall,andF1-scoreacrossallclasses,indicating idealclassificationperformance.Incontrast,theKNNmodel, although highly effective, exhibited a slight reduction in recallforthestage2class,suggestingminormisclassification inthiscategory.
As the Logistic Regression model achieved an accuracy of 100%,theresultingconfusionmatrixcontainsonlycorrectly classifiedinstances,withnoobservedmisclassifications.The matrixsummarizesthedistributionofpredictionsacrossall classesforatotalof32testsamples.
Table -5: Confusion Matrix of Logistic Regression
Actual \ Predicted stage1 stage2 thyroid stage1(8) 8
(7)
(17)
Interpretation:
Allsamplesarecorrectlyclassified,withnofalsepositivesor falsenegatives.ThisindicatesthattheLogistic Regression model achieved perfect classification performance on the testdataset.

– 5: Confusion Matrix – Logistic Regression

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
Volume: 13 Issue: 04 | Apr 2026 www.irjet.net p-ISSN: 2395-0072
6.5 Consolidated Model Comparison
A comparative analysis of the evaluated machine learning models is presented in Table 7, considering accuracy, precision,recall,F1-score,andoverallobservations.
Table -5: Consolidated Comparison of Machine Learning Models
The results indicate that both Logistic Regression and Random Forest achieved perfect accuracy and evaluation metrics.However, Logistic Regression wasselectedas the most suitable model due to its simplicity, lower computational cost, and superior interpretability. These advantages make it particularly appropriate for real-time medicaldecision-makingapplications.
7. CONCLUSIONS
Thisstudyintroducedamachinelearning–basedsystemfor predicting thyroid diseases and suggesting appropriate precautions, highlighting the value of advanced computationaltechniquesinenhancingearlydiagnosis.The modelutilizesalgorithmssuchasRandomForest,Logistic Regression, and K-Nearest Neighbors to process medical data and deliver reliable predictions. By overcoming the inefficienciesofconventionaldiagnosticapproaches,which areoftenslowandinconsistent,thesystemsupportsquicker and more accurate decision-making in the healthcare domain.
In addition, the system incorporates an intuitive web applicationbuiltwiththeFlaskframework,enablingusersto enter their medical information and receive immediate diagnostic feedback. Beyond prediction, it offers tailored healthguidance,includingdietrecommendations,exercise routines, precautionary advice, and food limitations. This makesthesystemawell-roundedhealthassistancetoolthat notonlydetectspotentialissuesbutalsoaidsinmanaging overallwell-being.
In summary, the proposed approach advances intelligent healthcare by encouraging early detection, raising awareness, and promoting preventive strategies. It helps reduce the workload of healthcare professionals while enabling individuals to actively manage their health. With
further refinement, this system can develop into a more dependableandcomprehensivesolutionforthyroiddisease predictionandcare.
8. FUTURE WORK
Several improvements can be considered to enhance the effectivenessandscopeofthesystem:
1. Incorporatingadvanceddeeplearningtechniques, suchasConvolutionalNeuralNetworks(CNNs),to furtherimprovepredictionprecision.
2. Leveraginglargerandreal-timemedicaldatasetsto strengthen model performance and ensure better generalization.
3. Creating a mobile-based application to make the systemmoreaccessibleanduser-friendly.
4. Connecting the system with wearable devices to enable continuous health tracking and real-time dataacquisition.
5. Addingfeaturesforonlinedoctorconsultationsand extending the system to support prediction of multiplediseases.
ACKNOWLEDGEMENT
The authors gratefully acknowledge the guidance of Ms. J. Bramaramba(Supervisor),Dr.A.Obulesu(HOD,IT),andthe management of Vidya Jyothi Institute of Technology, Hyderabad,forprovidingtheinfrastructureandsupportthat madethisresearchpossible.
REFERENCES
[1] M.D.Islametal.(2025).Enhancedpredictionofthyroid disease through ensemble machine learning techniques. JournalofComputationalArtificialIntelligenceSystems
[2]P.Metkewaretal.(2025).Acomparativestudyofmodels used for thyroid disease prediction. Journal of Advanced InformationTechnology.
[3]M.V.S.DeviandP.Kumar(2025).Anintelligentmachine learning approach for the early identification of thyroid disorders.SEEJPH
[4] S. Santhoshini and M. A. Goutham (2025). A holistic method for predicting thyroid cancer. Engineering, Technology&AppliedScienceResearch(ETASR)
[5]A.Géron(2019).Hands-OnMachineLearningwithScikitLearn,Keras,andTensorFlow.O’ReillyMedia.
[6]J. Han, M. Kamber, and J. Pei (2011). Data Mining: ConceptsandTechniques.MorganKaufmann.

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
Volume: 13 Issue: 04 | Apr 2026 www.irjet.net p-ISSN: 2395-0072
[7]F.Pedregosaetal.(2011).Scikit-learn:APython-based machine learning library. Journal of Machine Learning Research(JMLR).
[8]Kaggle.Thyroiddiseasedataset.
[9]FlaskDocumentation.Flaskwebframework.
[10]World Health Organization. Information on thyroid disordersandendocrinehealth.
2026, IRJET | Impact Factor value: 8.315 | ISO 9001:2008