Beyond Explainability: A Clinically Constrained Counterfactual Machine Learning Framework for Malaria Diagnosis from Symptoms and Risk Factors
Preprint
- 12 October 2026
- preprint
- Published by MDPI AG in Preprints.org
Abstract
Diagnosis of malaria is challenging due to the complexity of clinical presentation, environmental risk factors and behavioural risk factors. Any machine learning (ML) technique can be used to help classify malaria; however, a high-accuracy model might not give much information on how the individual prediction was made. This research presents a clinically constrained counterfactual ML approach to classify malaria based on symptoms and risk factors. The accuracies, precisions, sensitivities, specificities, F1 scores, ROC-AUC and PR-AUC were used to compare the performance of Decision Tree, Random Forest and XGBoost classifiers. XGBoost gave the best overall performance with an accuracy of 83.06%, sensitivity of 87.16%, F1-score of 87.62%, ROC-AUC of 0.8830 and PR-AUC of 0.9387. Mosquito-bite exposure, bitter taste in the mouth, travelling to endemic areas, and severity of fever were some of the most important factors identified by feature-importance analysis. The chosen XGBoost model was then combined with a domain-driven counterfactual search method that safeguarded the immutable variables and limited the changes of the candidate variables based on clinical-consistency rules. The unconstrained baseline found no valid prediction-changing counterfactuals, while the constrained procedure found counterfactuals in 57.08% of the cases evaluated, with an average of 1.8237 modified features. The results demonstrate that domain-guided counterfactual search can deliver sparse prediction-change scenarios grounded in clinical knowledge, which are informative and easy to understand. The generated counterfactuals are meant to be an explanation of the model's decision boundary, not an assertion that changing a feature will cause a change in the patient's actual disease state. Before clinical application, the framework needs to be externally validated, have more robust resampling-based model validation and be compared to existing counterfactual-generation approaches.Keywords
All Related Versions
This publication has 36 references indexed in Scilit:
- Medical data types in machine learning and their challenges: A comprehensive reviewIntelligence-Based Medicine, 2026
- The role of explainability and transparency in fostering trust in AI healthcare systems: a systematic literature review, open issues and potential solutionsNeural Computing and Applications, 2024
- Model-agnostic counterfactual explanation: A feature weights-based comprehensive causal multi-objective counterfactual frameworkExpert Systems with Applications, 2024
- Integrating federated learning for improved counterfactual explanations in clinical decision support systems for sepsis therapyArtificial Intelligence in Medicine, 2024
- Occupational exposure to malaria, leishmaniasis and arbovirus vectors in endemic regions: A systematic reviewCurrent Research in Parasitology & Vector-Borne Diseases, 2024
- The role of explainability in AI-supported medical decision-makingDiscover Artificial Intelligence, 2024
- On the failings of Shapley values for explainabilityInternational Journal of Approximate Reasoning, 2024
- Malaria: A focused review for the emergency medicine clinicianThe American Journal of Emergency Medicine, 2023
- CARE: coherent actionable recourse based on sound counterfactual explanationsInternational Journal of Data Science and Analytics, 2022
- Counterfactual explanations and how to find them: literature review and benchmarkingData Mining and Knowledge Discovery, 2022