Anemia is one of the most common hematological disorders affecting millions of people worldwide and is characterized by reduced hemoglobin concentration or insufficient healthy red blood cells. Early diagnosis plays a significant role in preventing severe health complications and improving patient care. Machine Learning (ML) has emerged as an effective approach for developing intelligent clinical decision-support systems capable of analyzing medical data with high accuracy.
This paper presents a machine learning-based anemia prediction system using Complete Blood Count (CBC) parameters. Three supervised machine learning algorithms, namely Random Forest, Logistic Regression with L1 (Lasso) regularization, and Logistic Regression with L2 (Ridge) regularization, were implemented and evaluated using the same dataset and preprocessing pipeline. The proposed model utilizes five important hematological parameters: Gender, Hemoglobin (Hb), Mean Corpuscular Hemoglobin (MCH), Mean Corpuscular Hemoglobin Concentration (MCHC), and Mean Corpuscular Volume (MCV) for predicting whether a patient is likely to have anemia. A graphical user interface (GUI) developed using Python Tkinter enables users to enter patient blood parameters and receive immediate prediction results. Experimental evaluation was performed using Accuracy, Precision, Recall, and F1-Score. Among the evaluated algorithms, the Random Forest classifier achieved the highest accuracy of 100.00%, outperforming Lasso (99.30%) and Ridge (98.95%). Based on the comparative study, Random Forest was selected as the final deployment model. The proposed system provides a fast, accurate, and user-friendly approach for anemia prediction and demonstrates the effectiveness of ensemble learning techniques in healthcare applications.
Introduction
Anemia is a widespread public health problem caused by reduced hemoglobin levels, leading to inadequate oxygen supply in the body. It may result from nutritional deficiencies, chronic diseases, blood loss, or inherited disorders. Early diagnosis is crucial to prevent complications such as fatigue, weakened immunity, impaired cognitive function, and pregnancy-related risks. While anemia is traditionally diagnosed through Complete Blood Count (CBC) tests and expert interpretation, the growing use of Artificial Intelligence (AI) and Machine Learning (ML) has enabled faster and more accurate decision-support systems for disease prediction.
This study presents a comparative analysis of three supervised machine learning algorithms—Random Forest, Logistic Regression with L1 (Lasso) regularization, and Logistic Regression with L2 (Ridge) regularization—for anemia prediction using hematological parameters. All models were trained and evaluated under the same preprocessing pipeline to ensure a fair comparison. A Python Tkinter-based Graphical User Interface (GUI) was also developed to provide an interactive platform for real-time anemia prediction based on user-entered patient data.
The proposed methodology includes data collection, preprocessing, feature selection, data standardization, an 80:20 train-test split, model training, performance evaluation, and GUI-based prediction. Five clinical features—Gender, Hemoglobin (Hb), Mean Corpuscular Hemoglobin (MCH), Mean Corpuscular Hemoglobin Concentration (MCHC), and Mean Corpuscular Volume (MCV)—were used as input variables. Model performance was assessed using Accuracy, Precision, Recall, and F1-Score.
The literature review indicates that ensemble learning methods generally outperform traditional classifiers for structured medical datasets, while Logistic Regression remains popular due to its simplicity and interpretability. However, previous studies often lack comprehensive comparisons among multiple algorithms and practical deployment through user-friendly interfaces. This study addresses these gaps by comparing three algorithms under identical conditions and integrating the best-performing model into an interactive GUI.
Experimental results showed that all three models achieved excellent predictive performance. Random Forest obtained the highest accuracy (100%) along with perfect Precision, Recall, and F1-Score, outperforming both Lasso (99.30% accuracy) and Ridge (98.95% accuracy). Its superior performance is attributed to its ensemble learning approach, which effectively captures complex nonlinear relationships among hematological parameters while minimizing overfitting.
Conclusion
This paper presented a machine learning-based anemia prediction system using hematological parameters obtained from Complete Blood Count (CBC) reports. Three supervised machine learning algorithms—Random Forest, Logistic Regression with L1 (Lasso) regularization, and Logistic Regression with L2 (Ridge) regularization—were implemented and compared using the same preprocessing pipeline and evaluation methodology.
Experimental results demonstrated that all three algorithms achieved high predictive performance. Among them, the Random Forest classifier achieved the highest accuracy of 100.00%, outperforming both Lasso (99.30%) and Ridge (98.95%). Based on this comparative evaluation, Random Forest was selected as the final prediction model.
The developed Python Tkinter-based graphical user interface allows users to enter patient hematological parameters and obtain immediate prediction results. The proposed system provides an efficient, accurate, and user-friendly decision-support tool that can assist healthcare professionals in the early identification of anemia. The developed system demonstrates the practical application of machine learning in healthcare and has the potential to assist clinicians in early anemia screening.
References
[1] L. Breiman, \"Random Forests,\" Machine Learning, vol. 45, no. 1, pp. 5–32, 2001.
[2] F. Pedregosa, G. Varoquaux, A. Gramfort, V. Michel, B. Thirion, O. Grisel, et al., \"Scikit-learn: Machine Learning in Python,\" Journal of Machine Learning Research, vol. 12, pp. 2825–2830, 2011.
[3] World Health Organization (WHO), \"Anaemia,\" Geneva, Switzerland, 2023.
[4] D. W. Hosmer, S. Lemeshow, and R. X. Sturdivant, Applied Logistic Regression, 3rd ed., John Wiley & Sons, 2013.
[5] C. M. Bishop, Pattern Recognition and Machine Learning, Springer, 2006.
[6] W. McKinney, Python for Data Analysis, 3rd ed., O\'Reilly Media, 2022.