Article
Yuri Marx · Jun 1 6m read

Web app to Predict Maternal Risk using IRIS IntegratedML

Maternal Risk can be measured from some parameters well known to the medical community. In this way, in order to help the medical community and computerized systems, especially AI, the scientist Yasir Hussein Shakir published a very useful dataset for training ML algorithms in the detection/prediction of Maternal Risk. This publication can be found on the largest and best known data repository for ML, Kaggle at https://www.kaggle.com/code/yasserhessein/classification-maternal-health....

About the Dataset

Many pregnant women die from pregnancy issues as a result of a lack of information on maternal health care during and after pregnancy. It is more common in rural regions and among lower-middle-class families in emerging countries. During pregnancy, every minute should be observed to ensure the proper growth of the baby and the safe delivery (source: https://www.kaggle.com/code/yasserhessein/classification-maternal-health...).

Data has been collected from different hospitals, community clinics, maternal health cares through the IoT based risk monitoring system.

  • Age: Age in years when a woman is pregnant.
  • SystolicBP: Upper value of Blood Pressure in mmHg, another significant attribute during pregnancy.
  • DiastolicBP: Lower value of Blood Pressure in mmHg, another significant attribute during pregnancy.
  • BS: Blood glucose levels is in terms of a molar concentration, mmol/L.
  • HeartRate: A normal resting heart rate in beats per minute.
  • Risk Level: Predicted Risk Intensity Level during pregnancy considering the previous attribute.

Get the Maternal Risk data from Kaggle

The Maternal Risk data from Kaggle can be loaded into an IRIS table using the Health-Dataset application: https://openexchange.intersystems.com/package/Health-Dataset. To do this, from your module.xml project, set the dependency (ModuleReference for Health Dataset):

 
Module.xml with Health Dataset application reference

Web Frontend and Backend Application to Predict Maternal Risk

Go to Open Exchange  app link (https://openexchange.intersystems.com/package/Disease-Predictor) and follow these steps:

  1. Clone/git pull the repo into any local directory
$ git clone https://github.com/yurimarx/predict-diseases.git
  1. Open a Docker terminal in this directory and run:
$ docker-compose build
  1. Run the IRIS container:
$ docker-compose up -d 
  1. Go to Execute Query into Management Portal to train the AI model: http://localhost:52773/csp/sys/exp/%25CSP.UI.Portal.SQL.Home.zen?$NAMESPACE=USER
  2. Create the VIEW used to train:
CREATE VIEW MaternalRiskTrain AS SELECT BS, BodyTemp, DiastolicBP, HeartRate, RiskLevel, SystolicBP, age FROM dc_data_health.MaternalHealthRisk 
  1. Create the AI Model using the view:
CREATE MODEL MaternalRiskModel PREDICTING (RiskLevel) FROM MaternalRiskTrain 
  1. Train the model:
TRAIN MODEL MaternalRiskModel
  1. Go to http://localhost:52773/disease-predictor/index.html to use the Disease Predictor frontend and predict diseases like this: Maternal-Risk-Predictor

Behind the scenes

Backend ClassMethod to predict MaternalRisk Disease

InterSystems IRIS allows you execute SELECT to predict using the previous model created.

 
Backend ClassMethod to predict Maternal Risk

Now, any web application can consume the prediction and show the results. See the source code into frontend folder to predict-diseases application.

 

 

4
1 75
Discussion (0)1
Log in or sign up to continue