What is fetal health risk? Fetal health risk refers to any condition or factor that could potentially harm a developing fetus during pregnancy. These risks can lead to complications such as birth defects, developmental delays, preterm birth, or even miscarriage.
What can lead to fetal health risk? fetal health problems can be caused by maternal age, lifestyle choices, pre-existing medical conditions, pregnancy complications and structural problems.
Source(https://www.healthline.com/health/pregnancy/risk-factors)
According to the UNICEF, the neonatal period is the most vulnerable time for a child. Globally, 2.3 million children died in the first month of life in 2022 – approximately 6,300 neonatal deaths every day.
Source: (https://data.unicef.org/topic/child-survival/neonatal-mortality/)
- My main aim in this project is to use machine learning to detect fetal health risks which in turn can prevent fetal and maternal mortality. I intend to use classification algorithms to achieve the lowest error in prediction.
The dataset was sourced from the University of California Irvine dataset archive consisting of over 2126 Cardiotogram (CTGs) measurements of fetal heart rate (FHR) and uterine contraction (UC) features classified by expert obstetricians.

Data Source:(https://archive.ics.uci.edu/dataset/193/cardiotocography)
- It is a binary classification problem, where given the above set of features, I need to classify and predict fetal health risks.
- Data Collection
- Importing Data
- Data Cleaning
- Handling Missing Data
- Outlier Detection and Removal
- Data Transformation
- Exploring Data using Descriptive Statistics
- Understanding Data using
- Univariate Analysis
- Bivariate Analysis
- Multivariate Analysis
- Understanding Data using
- Understanding Data using Visualizations
- Univariate
- Histograms
- Density Plot
- Bivariate
- Boxplot
- Multivariate
- Correlation Matrix
- Univariate
-
histogram_medianandhistogram_modegive nearly identical information, I can track only one of these metrics to save time and resources without sacrificing accuracy in fetal health assessments. -
The strong negative relationship between
histogram_modeandbaseline_valuemeans that when one goes up and the other goes down, it could indicate important changes in fetal health. I could prioritize this pattern as an early warning system. -
Some metrics like
fetal_movementandbaseline_valuedon’t influence each other much. This means they measure different aspects of fetal health, so a comprehensive monitoring system should track both for a full picture. -
The "histogram" metrics all provide similar insights, so I could reduce the number of metrics it tracks. This would make data collection quicker, reducing the workload for healthcare staff without losing important patient information.
- Features Selection
- Data Train/Test/Split
- Algorithm Comparisms
- Logistic Regression
- K-Nearest Neighbour
- Decision Tree Classifier
- Support Vector Machine
- Linear Discriminant Analysis
- Serialize (Save Model)
I believe that Interpretable ML is key to Responsible AI
- I implemented explainable AI techniques using Decision Tree and model interpretation to understand the decisions made by the black-box machine learning model for individual patients. With this technique, healthcare professionals can gain insights into which features are most influential in predicting the patient's outcome (i.e., Normal, Suspected or Pathological).

Since this is a binary classification problem, I used the following metrics:
- Confusion matrix - For getting a better clarity of the number of correct/incorrect predictions made by the model.
- Classification report - For providing insights into the model's performance.
- Accuracy score - To evaluate the overall performance of the classification model.

- To make the model accessible to both patients and doctors, I operationalized the system with a user-friendly Flask web application. The Flask web app provides a friendly user interface where users can input relevant parameters through a web form. Upon submission, the app processes the input data using the accurately trained cloud based fetal health machine learning model and provides the predicted outcome (Normal, Pathological or Suspected). A demo of the Flask web app is shown below;
- Not yet deployed due to lack of funding.
- ✅ Model achieved an accuracy of >90% using K-Nearest Neighbor machine learning algorithm
- ✅ Model built on robust dataset classified & labelled by expert Obstetricians to ensure reliable and actionable prediction
- ✅ Model operationalized with a user friendly flask web application
- I leveraged a robust cloud ML platform and implemented a quality control check, experiment tracking, model maintenance and model monitoring techniques to observe data drift and prevent performance degradation. This is to help ensure model fairness, improve model performance and maintain model reliability.

- Python
- Coding Tools
- VS Code
- Lightning.ai
- ML Libraries
- Scikit-Learn
- Pandas
- Numpy
- Matplotlib
- Seaborn
- Lime
- Joblib
- Comet ML
- Web App Frameworks
- Flask
- Bootstrap
- HTML
- CSS
- JavaScript
The dataset was sourced from the University of California Irvine dataset archive consisting of over 2126 Cardiotogram (CTGs) measurements of fetal heart rate (FHR) and uterine contraction (UC) features classified by expert obstetricians.(https://archive.ics.uci.edu/dataset/193/cardiotocography).
As an AI Engineer with a background in Medicine, I am deeply committed to the holistic well-being of mothers and their children. This project involving detecting fetal health risks reflects my dedication to working towards the 2030 United Nations Sustainable Development Goal 3 of ending all preventable deaths under five years of age using machine learning techniques and a Data-Driven approach.
I'm Abraham Obianke. For any enquiries, feedbacks, partnerships or collaborations feel free to Connect with me on LinkedIn or send me an Email via abrahamoaks@gmail.com.
- Healthline (https://www.healthline.com/health/pregnancy/risk-factors)
- University of California Irvine dataset archive (https://archive.ics.uci.edu/dataset/193/cardiotocography)
- The United Nations Children's Fund (UNICEF) (https://data.unicef.org/topic/child-survival/neonatal-mortality/)














