Fetal Arc: Predicting Fetal Health, and Birth-Weight of the fetus using Machine Learning

Simran
Analytics Vidhya
Published in
6 min readDec 12, 2021

--

New born baby lying down

Hello readers. How are you? I really hope you are doing awesome! If awesome, have a look at this article explore an interesting application, and if not awesome, let me tell you about something I made which made my day delighted, and maybe it creates your day too.

Do you love babies? They are super duper cute, innocent, have lovely features and you can’t help but love them. You might be a person who doesn’t like kids but for a mother, pregnancy is the most beautiful phase in a women’s life.

The moment a child is born, the mother is also born. She never existed before. The woman existed, but the mother, never. A mother is something absolutely new.”

For a mother it is altogether a new experience, she feels what she never felt, the motherhood is amazing. But have you ever thought about what would happen if this beautiful experience turns into a nightmare? Well, wait, what? Into nightmare! How can it be a nightmare in any case? This points to something I created in my Machine Learning Project.

MOTIVATION AND PROBLEM STATEMENT

Figure 1: Facts related to Pregnancy, birth

I was talking about the nightmare, well the facts shown above present them. According to WHO, one million babies die within 24 hours of birth due to premature birth and complications during birth. Also, around 810 women die each day during delivery or soon after delivery. This really causes the need to take care of the fetus with utmost priority. Your beautiful experiences shouldn’t turn into adversity. So, I created an application called Fetal Arc, where arc refers to full time from point of good news till delivery, it takes care of your baby. The two most common issues to address are:

1) Classifying fetal health as “NORMAL”, “SUSPECT” or “PATHOLOGICAL”

2) Predicting Birth Weight of the fetus

If we have measures for these two problems, then it could possibly help a lot and I would be even happier even if it saves one life. Rather, it should save every mother’s and her baby’s life.

Firstly, let me showcase the final website, and then I would tell you the models running behind, their evaluation metrics, and how enough they are. Actually, I always feel that firstly show people results and then if they are intrigued, they would definitely like to go around what is happening.

WEBSITE AND SERVICE

The link to the website is: https://fetalhealth-simran.herokuapp.com/

Figure 2: Homepage for website

Then there are two services as you can scroll down, rather you can also select services from the options above shown along with the “Home” menu.

Figure 3: Services for Fetal Arc

Lastly, on the home page, there is “about us” where new users can get to know about the project and vision.

Figure 4: About Us

Let’s say you want to first check fetal birth weight and avail of the service. For that, you have to fill the form shown below, which asks simple details for gestational age in days, then mother’s age in years, mother’s height in inches, mother’s weight in kgs, smoking habits of mother and parity meaning that is this you first child or not. (NOTE: Make sure to put in realistic values to get accurate results, though the exception handling is done!)

Figure 5: Parameters required for prediction

Let’s say I fill the values: 250, 35, 65, 60, No, and No for parameters in order as it is asked. Then after clicking on Proceed, I get the output as shown below.

Figure 6: Predicted Birth Weight

Let’s move on to another module which is Fetal Health Classification where the output label is “NORMAL”, “SUSPECT” or “PATHOLOGICAL”.

Figure 7: Fetal Health Classification Service

You can choose any option, for OPTION 1and OPTION 2, the outputs are shown in the figures below. OPTION 1 lets you directly enter values separated by a comma in case you already know about the parameters and the sequence in which it must be inputted, else go for OPTION 2.

Figure 8: Output when OPTION 1 is selected
Figure 9: Output when OPTION 2 is selected.

You can go for any of the two ways. Let’s say I fill the values, 150.0, 0.0, 0.0, 0.005, 0.0, 0.0, 0.0, 57.0, 0.5, 19.0, 7.7, 20.0, 147.0, 167.0, 3.0, 0.0, 157.0, 7.0, 0. 0, then the output is shown as “SUSPECT”. See figure below.

Figure 10: Output as “SUSPECT” for entered parameters

For values, 131.0, 0.008, 0.004, 0.004, 0.001, 0.0, 0.0, 55.0, 2.3, 0.0, 0.0, 56.0, 109.0, 165.0, 3.0, 0.0, 138.0, 25.0, 0.0, it shows “NORMAL”.

So that’s it for the demo part, let’s see what is happening inside it.

But wait, before that what is the dataset?

Dataset for predicting Fetal Health is taken from Kaggle. The link to the dataset is https://www.kaggle.com/andrewmvd/fetal-health-classification The dataset has 2126 training instances, with 21 attributes. The output label is Fetal health: 1 — Normal, 2 — Suspect 3 — Pathological.

For the birth weight prediction, there are 6 attributes and 1174 instances. The dataset can be found from http://people.reed.edu/~jones/141/Bwt.dat

Now let’s go to the part you guys may be waiting for if you love machine learning.

For Fetal Health Classification as “NORMAL”, “SUSPECT” or “PATHOLOGICAL”, I tried various machine learning algorithms and came up with something shown in Figure 11. There were 4 models which were used and then to get the final result, majority voting is used. The specifications for the models are given in Figure 11.

Figure 11: Final Model for Fetal Health Classification

That was for the model, but is it enough? Well, evaluation metrics are a must. I used “RECALL” as an evaluation metric because I didn’t want that “SUSPECT” or “PATHOLOGICAL” should be ignored! It should penalize if the model shows fetal health as “NORMAL” but it was “SUSPECT” or “PATHOLOGICAL” in reality. So, my final model has a macro recall score of 0.951539 and the classwise recall score is shown in Figures 12 and 13.

Figure 12: Final Model Results and comparison with baseline (On Train Set)
Figure 13: Final Model Results and comparison with baseline (On Test Set)

For birth weight prediction, the birth weight was predicted in kgs, where final weight = 5/6 * (weight predicted by Adaboost Regressor) + (1/6) * (weight predicted by RandomForest Regressor). This model was able to achieve 0.421 rmse on the training set and 0.441 rmse on the testing set. See Figure 14 for more details.

Figure 14: Final Model for Birth Weight Prediction and Evaluation metrics results

So, I really hope that now you know about this project and I feel that this would help people. Please provide feedback, both positive and negative feedbacks are welcomed. Thanks for reading :)

Link to GitHub Code: https://github.com/simranenggprojects/Fetal-Arc

--

--

Simran
Analytics Vidhya

A spiritual & honest being | M.Tech. 1st-year student | Passionate about teaching, helping others, data & machine learning | Believes in VOLUNESIA.