Interpretable Machine Learning for Miscarriage Risk Prediction Using Anchor Rules and Counterfactual Explanations on Large Scale Data
Abstract
Miscarriage remains a critical concern in maternal health, particularly during early pregnancy when medical intervention options are limited. Although machine learning models have shown promise in identifying high-risk cases, their predictive opacity often undermines clinical trust and adoption. This study proposes an interpretable framework for analyzing miscarriage predictions by combining anchor rules and counterfactual explanations. A Random Forest classification model is applied to a dataset of maternal medical records, and its predictions are interpreted using explainable AI techniques that generate logical rule patterns (anchors) and simulate “what-if” scenarios (counterfactuals). Anchor rules provide human-understandable conditions that strongly influence the model’s decisions, while counterfactual explanations highlight the minimal changes required to alter prediction outcomes. The primary objective of this research is to develop a clinical decision support system that is not only accurate but also transparent and trustworthy for healthcare professionals, particularly for early miscarriage risk detection. The novelty of this approach lies in the integration of two explainability methods rarely combined in maternal health contexts, alongside an evaluation strategy that moves beyond conventional performance metrics such as Accuracy, Precision, Recall, F1-Score, or AUC, focusing instead on interpretability and practical relevance. This work holds significant value for clinicians by delivering actionable insights through clear and consistent risk patterns, thereby facilitating faster, more informed decision-making. Additionally, it contributes to the computer science community by demonstrating how robust machine learning models can be aligned with transparency, ethics, and accountability principles via explainable AI techniques especially in sensitive and high-stakes domains such as maternal and child healthcare.
Keywords: Explainable AI; Miscarriage Prediction; Anchor Rule; Counterfactual Explanation; Pregnancy Health.
Full Text:
PDFReferences
AL-ALAMI Z., ABU-HUWAIJ R., HAMADNEH S., and TAYBEH E. Understanding Miscarriage Prevalence and Risk Factors: Insights from Women in Jordan. Medicina, 2024, 60(7): 1044. https://doi.org/10.3390/medicina60071044
KIDD C., O’DRISCOLL D., O'BYRNE L.J., O'KEEFFE G.W., KHASHAN A.S., and Maher G.M. The association between threatened miscarriage in early pregnancy and depression or anxiety in offspring in late adolescence. Journal of Affective Disorders, 2025, 382: 48-54. https://doi.org/10.1016/j.jad.2025.04.060
REGAN L., and RAI R. Epidemiology and the medical causes of miscarriage. Best Practice & Research Clinical Obstetrics & Gynaecology. 2000, 14(5): 839-854. https://doi.org/10.1053/beog.2000.0123
OXFORD UNIVERSITY’S NUFFIELD DEPARTMENT OF WOMEN’S & REPRODUCTIVE HEALTH. Miscarriage: Research Overview, Risk Factors, and Current Studies. Nuffield Department of Women’s & Reproductive Health, University of Oxford, 2024. https://www.wrh.ox.ac.uk/research/miscarriages
QUENBY, S., GALLOS, I. D., DHILLON-SMITH, R. K., PODESEK, M., STEPHENSON, M. D., FISHER, J., BROSENS, J. J., BREWIN, J., RAMHORST, R., LUCAS, E. S., Mccoy, R. C., ANDERSON, R., DAHER, S., REGAN, L., AL-MEMAR, M., BOURNE, T., Macintyre, D. A., RAI, R., CHRISTIANSEN, O. B., SUGIURA-OGASAWARA, M., and COOMARASAMY, A. Miscarriage Matters: The Epidemiological, Physical, Psychological, and Economic Costs of Early Pregnancy Loss. The Lancet, 2021, 397(10285): 1658–1667. https://doi.org/10.1016/S0140-6736(21)00682-6.
MAGNUS M.C., HOCKEY R.L., HABERG S.E., and MISHRA G.T. Pre-pregnancy lifestyle characteristics and risk of miscarriage: the Australian Longitudinal Study on Women’s Health. The Australian Longitudinal Study on Women’s Health. BMC Pregnancy Childbirth, 2022, 22: 169. https://doi.org/10.1186/s12884-022-04482-9
SOFIA N., FADLYANA E., IRIANTI S., KRISNADI S., and SUSIARNO H. Maternal Risk Factors among Pregnant Women with Miscarriage. Althea Medical Journal, 2024, 11(1):57-62. https://doi.org/10.15850/amj.v11n1.3037
ALVES C., JENKINS S.M., and RAPP A. Early Pregnancy Loss (Spontaneous Abortion). In: StatPearls [Internet]. Treasure Island (FL): StatPearls Publishing, 2023 https://www.ncbi.nlm.nih.gov/books/NBK560521/
HEGDE J., and ROKSETH B. Applications of machine learning methods for engineering risk assessment – A review. Safety Science, 2020, 122:104492. https://doi.org/10.1016/j.ssci.2019.09.015
YANG Z., GOKON H., and Yu Q. Machine learning-based identification and assessment of snow disaster risks using multi-source data: Insights from Fukui prefecture, Japan. Progress in Disaster Science, 2025, 26:100426. https://doi.org/10.1016/j.pdisas.2025.100426
KARUNANIDHI D., RAJ M.R.H., PRAPANCHAN V.N., and SUBRAMANI T. Predicting groundwater fluoride levels for drinking suitability using machine learning approaches with traditional and fuzzy logic models-based health risk assessment. Geoscience Frontiers. 16(4):102087. https://doi.org/10.1016/j.gsf.2025.102087
GUO J., FEI T., YANG X., LILBURNE L., MOOT D., MARTIN B., TEIXEIRA., and YANG M. Can we use APSIM’s embedded expert knowledge to ‘train’ a machine learning model to identify, at high resolution, land suitable to grow lucerne (Medicago sativa L.) using simplified climate data?. European Journal of Agronomy, 2025, 171:127815. https://doi.org/10.1016/j.eja.2025.127815
PETCH J., DI S., and NELSON W. Opening the Black Box: The Promise and Limitations of Explainable Machine Learning in Cardiology. Canadian Journal of Cardiology, 2022, 38(2):204-213. https://doi.org/10.1016/j.cjca.2021.09.004
HASSIJA V., CHAMOLA V., MAHAPATRA A., SINGAL A., GOEL D., HUANG K., SCARDAPANE S., SPINELLI I., MAHMUD M., and HUSSAIN A. Interpreting Black-Box Models: A Review on Explainable Artificial Intelligence. Cognitive Computation Journal, 2024, 16:45-74. https://doi.org/10.1007/s12559-023-10179-8
ALANAZI A. Using machine learning for healthcare challenges and opportunities. Informatics in Medicine Unlocked, 2022, 30:100924. https://doi.org/10.1016/j.imu.2022.100924
MANIKANDA M., VENKATESH., ILAKKIYA T., KRISHNAMOORTHI M., RAMU M., and Senthilnathan C.R. Advancements and Difficulties of Machine Learning Applications in Customised Medicine. International Conference on Power, Energy, Control and Transmission Systems (ICPECTS), Chennai, India, 2024, pp. 1-4. https://doi.org/10.1109/ICPECTS62210.2024.10780344
UKWATHTHA J., HERATH S., and MEDDAGE D.P.P. A review of machine learning (ML) and explainable artificial intelligence (XAI) methods in additive manufacturing (3D Printing). Materials Today Communications, 2024, 41:110294. https://doi.org/10.1016/j.mtcomm.2024.110294
AL-NAJJAR H.A.H., PRADHAN B., BEYDOUN G., SARKAR R., PARK H., and ALAMRI A. A novel method using explainable artificial intelligence (XAI)-based Shapley Additive Explanations for spatial landslide prediction using Time-Series SAR dataset. Gondwana Research, 2023, 123:107-124. https://doi.org/10.1016/j.gr.2022.08.004
SHERPA D., ABHIJIT R.D., MITRA I., DHAR D., SHARMA S., CHAKRABORTY P., and CHAUDHURY K. Prediction of Idiopathic Recurrent Spontaneous Miscarriage using Machine Learning. International Conference on Computer, Electrical & Communication Engineering (ICCECE), Kolkata, India, 2023, pp. 1-8. https://doi.org/10.1109/ICCECE51049.2023.10085363
ALJAMEEL S.S., ALJABRI M., ASLAM N., ALOMARI D.M., ALYAHYA A., ALFARIS S., BLHARITH M., ABAHUSSAIN H., BOUJLEA D., and ALSULMI E.S. An Automated System for Early Prediction of Miscarriage in the First Trimester Using Machine Learning. Computers, Materials and Continua, 2023, 75(1):1291-1304.
https://doi.org/10.32604/cmc.2023.035710
SINGH S., TIWARI S., GOEL P., and TIWARI D. A Retrospective: Sightseeing Excursion of Threatened Miscarriage Pertaining Ensemble Machine Learning Algorithms. 6th International Conference on Information Systems and Computer Networks (ISCON), Mathura, India, 2023, pp. 1-7. https://doi.org/10.1109/ISCON57294.2023.10111961 [22] AMITAI, T., KAN-TOR, Y., OR, Y., SHOHAM, Z., SHOFARO, Y., RICHTER, D., HAR-VARDI, I., BEN-MEIR, A., SREBNIK, N., and BUXBOIM, A. Embryo classification beyond pregnancy: early prediction of first trimester miscarriage using machine learning. Journal of assisted reproduction and genetics, 2023, 40(2): 309–322. https://doi.org/10.1007/s10815-022-02619-5
BROWN M.G.L., PETERSON M.G., TEZAUR I.K., PETERSON K.J., and BULL D.L. Random Forest regression feature importance for climate impact pathway detection. Journal of Computational and Applied Mathematics, 2025, 464:116479. https://doi.org/10.1016/j.cam.2024.116479
HEIDARI M., MAATAR M.H., GHAFFARI H. Forward propagation dropout in deep neural networks using Jensen–Shannon and random forest feature importance ranking. Neural Networks, 2023, 165:238-247. https://doi.org/10.1016/j.neunet.2023.05.044
THANATHAMATHEE P., SAWANGARREERAK S., and NIZAM D.N.M. Enhancing Going Concern Prediction with Anchor Explainable AI and Attention-Weighted XGBoost. 2024, IEEE Access, 12, pp. 68345-68363. https://doi.org/10.1109/ACCESS.2024.3401007
DELAUNAY J., GALÁRRAGA L., and LARGOUËT C. Improving Anchor-based Explanations. International Conference on Information & Knowledge Management (CIKM), New York, USA, pp. 3269-3272. https://doi.org/10.1145/3340531.3417461
ZHANG H., and ZHANG J. Efficient and effective counterfactual explanations for random forests. Expert Systems with Applications, 2025, 293:128661. https://doi.org/10.1016/j.eswa.2025.128661
KURTZ J., BIRBIL Ş. Ī., and HERTOG D. D. Counterfactual explanations for linear optimization. European Journal of Operational Research, 2025. https://doi.org/10.1016/j.ejor.2025.06.016
ABEKOON, T., SAJINDRA H., RATHNAYAKE N., EKANAYAKE I.U., JAYAKODY A., and RATHNAYAKE U. A novel application with explainable machine learning (SHAP and LIME) to predict soil N, P, and K nutrient content in cabbage cultivation. Smart Agricultural Technology, 2025, 11:100879. https://doi.org/10.1016/j.atech.2025.100879
HERMOSILLA, P., BERRÍOS, S., and ALLENDE-CID, H. Explainable AI for Forensic Analysis: A Comparative Study of SHAP and LIME in Intrusion Detection Models. Applied Sciences, 2025, 15(13):7329. https://doi.org/10.3390/app15137329
Refbacks
- There are currently no refbacks.


