Using Machine Learning Models to Detect Anemia and Evaluate Accuracy Across Patient Subgroups in Blood Test Data
DOI:
https://doi.org/10.58445/rars.4004Keywords:
Anemia, Machine Learning, Random Forest, Logistic RegressionAbstract
Anemia is a widespread blood disorder currently affecting 2 billion people around the world. While machine learning (ML) has shown potential for enhanced detection of the condition using complete blood count (CBC) data, previous studies have found that ML models are unable to make consistent predictions across different demographic subgroups and patient populations. The study discussed in this paper trained and assessed two supervised ML models, Random Forest and Logistic Regression, on a CBC anemia dataset from the Eureka Diagnostic Center (EDC) in Lucknow, India, consisting of 364 patients. Hemoglobin (HGB) and features mathematically derived from it were excluded as an effort to prevent data leakage. During the study, Random Forest performed better than Logistic Regression in every accuracy metric considered for both overall testing and subgroup analysis, but both models performed poorly for elderly patients, aged 65 years and older. An ML framework, SHapley Additive exPlanations (SHAP), was used to analyze the importance of each of the features in the dataset, with red blood cell (RBC) count, packed cell volume (PCV), mean cell volume (MCV), and red cell distribution width (RDW) as the most important factors, while age and sex did not have substantial influence on the results. Both models were externally validated on a separate dataset from the Al-Zahraa Al-Ahly Hospital (AAH) in Iraq, which resulted in high accuracy and precision, but recall declined severely, suggesting that many true anemia cases were misdiagnosed when these ML models were applied to an unknown and different patient population. The results suggest that ML models could be used to detect anemia accurately within the population they were trained on, but for real-world use, the models will need to be trained on more diverse datasets.
References
Mayo Clinic Staff. (2026, May 5). Anemia. Mayo Clinic. Retrieved July 24, 2026, from https://www.mayoclinic.org/diseases-conditions/anemia/symptoms-causes/syc-20351360
Penn Medicine. (2026). Anemia. Penn Medicine. Retrieved July 24, 2026, from https://www.pennmedicine.org/conditions/anemia
Lecturio. (2024, December 17). Anemia: Overview and Types. Lecturio. Retrieved July 24, 2026, from https://www.lecturio.com/concepts/anemia-overview/
Ritchie, H. (2024, November 25). Billions of people suffer from anemia, but there are cheap ways to reduce this. Our World in Data. Retrieved July 24, 2026, from https://ourworldindata.org/billions-people-suffer-anemia-cheap-ways-reduce
Williams, A. M., Ansai, N., Ahluwalia, N., & Nguyen, D. T. (2024, December). Anemia Prevalence: United States, August 2021–August 2023. NCHS Data Briefs. Retrieved July 24, 2026, from https://www.ncbi.nlm.nih.gov/books/NBK612586/
Al-Antari, M. A. (2023). Artificial Intelligence for Medical Diagnostics—Existing and Future AI Technology! Diagnostics, 13(4). https://pmc.ncbi.nlm.nih.gov/articles/PMC9955430/
Amjad, H., Hussain, Z., Hasan, M., & Hassan, M. U. (2025). Machine learning-based models for screening of anemia and leukemia using features of complete blood count reports. Scientific Reports. https://www.nature.com/articles/s41598-025-21279-w
Xhepaliu, A., Adar, N., & Leka, M. (2026). Machine Learning-Driven Anemia Diagnosis: A Comparative Study Using Blood Biomarkers from Complete Blood Count Data. SpringerLink. Retrieved July 24, 2026, from https://link.springer.com/chapter/10.1007/978-3-032-07373-0_30
Addo, O. Y., Williams, A., Young, M. F., Sharma, A. J., Mei, Z., Kassebaum, N. J., Socorro Jeffereds, M. E., Suchdev, P. S., & Yu, E. X. (2021). Evaluation of Hemoglobin Cutoff Levels to Define Anemia Among Healthy Individuals. ResearchGate. Retrieved July 24, 2026, from https://www.researchgate.net/publication/353743396_Evaluation_of_Hemoglobin_Cutoff_Levels_to_Define_Anemia_Among_Healthy_Individuals
Vohra, R., Pahareeya, J., & Hussain, A. (2021, April 22). Complete Blood Count Anemia Diagnosis [Data set]. Mendeley Data. https://doi.org/10.17632/dy9mfjchm7.1
Pedregosa, F., Varoquaux, G., Gramfort, A., Michel, V., Thirion, B., Grisel, O., Blondel, M., Prettenhofer, P., Weiss, R., Dubourg, V., Vanderplas, J., Passos, A., Cournapeau, D., Brucher, M., Perrot, M., & Duchesnay, É. (2011, October). Scikit-learn: Machine Learning in Python. Journal of Machine Learning Research. Retrieved July 24, 2026, from https://www.jmlr.org/papers/v12/pedregosa11a.html
Sami, S., & Farhan, A. (2022, November 21). CBC Dataset [Data set]. Mendeley Data. https://doi.org/10.17632/28s2bhdjfd.1
Lundberg, S. M., & Lee, S.-I. (2017). A Unified Approach to Interpreting Model Predictions. Neural Information Processing Systems. Retrieved July 24, 2026, from https://papers.nips.cc/paper/2017/hash/8a20a8621978632d76c43dfd28b67767-Abstract.html
Downloads
Posted
Categories
License
Copyright (c) 2026 Research Archive of Rising Scholars

This work is licensed under a Creative Commons Attribution 4.0 International License.