GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com โ€” GitHub - Maryam-Skaik/ctg-fetal-health-ann-classification: Artificial Neural Network (ANN) project for multiclass fetal health classification using CTG data with TensorFlow, Keras, Dropout regularization, and Hyperparameter Tuning.

BranchesTags
Open more actions menu

Latest commit

 

History

6 Commits
6 Commits

Folders and files

NameName
Last commit message
Last commit date
data
data
 
 
notebook
notebook
 
 
README.md
README.md
 
 

Repository files navigation

๐Ÿง  Maternal Mortality (CTG) Multiclass Classification using Artificial Neural Networks

Python TensorFlow Scikit-Learn Status License

๐Ÿ“– Project Overview

This project focuses on building and evaluating Artificial Neural Network (ANN) models for multiclass classification of fetal health conditions using Cardiotocography (CTG) data.

The notebook demonstrates a complete machine learning workflow including:

  • Data preprocessing and cleaning
  • Feature scaling
  • Baseline neural network development
  • Regularization using Dropout
  • Hyperparameter optimization using KerasTuner
  • Model evaluation and interpretation
  • Confidence analysis using Softmax probabilities

The goal of the project is to classify fetal health status into:

  • Normal
  • Suspect
  • Pathological

using neural networks implemented with TensorFlow/Keras.


๐Ÿฉน Medical Context & Problem Statement

Cardiotocography (CTG) is a medical monitoring technique used during pregnancy to evaluate fetal well-being.

The dataset used in this project contains numerical measurements extracted from CTG exams, including patterns related to:

  • Fetal heart rate
  • Accelerations and decelerations
  • Uterine contractions
  • Variability measurements
  • Abnormal fetal behavior indicators

๐ŸŽฏ Project Objective

The main objective is to build a deep learning model capable of predicting fetal health condition based on CTG measurements.

The target variable is:

fetal_health

The model classifies fetal condition into three categories:

Class Medical Meaning
Normal Healthy fetal condition
Suspect Potential abnormalities requiring monitoring
Pathological High-risk condition requiring medical attention

๐Ÿ’ก Real-World Importance

Accurate fetal health prediction systems can support medical professionals by:

  • Assisting early detection of fetal risk
  • Reducing delayed diagnosis
  • Supporting clinical decision-making
  • Prioritizing high-risk pregnancy cases
  • Improving maternal and fetal healthcare outcomes

This makes multiclass classification especially valuable in healthcare AI applications where prediction reliability is critical.


๐Ÿฉบ About the Dataset

The dataset contains CTG (Cardiotocography) measurements collected during pregnancy.

Cardiotocography is commonly used to monitor:

  • Fetal heart rate
  • Uterine contractions
  • Overall fetal well-being

๐ŸŽฏ Target Variable

The original target column is:

fetal_health

Original classes:

Original Label Meaning
1 Normal
2 Suspect
3 Pathological

For compatibility with TensorFlow multiclass classification requirements, the target was transformed into:

Encoded Label Meaning
0 Normal
1 Suspect
2 Pathological

Transformation:

y = df['fetal_health'] - 1

โš™๏ธ Technologies & Libraries

๐Ÿ Core Libraries

  • Python
  • NumPy
  • Pandas
  • Matplotlib

๐Ÿค– Machine Learning & Deep Learning

  • Scikit-learn
  • TensorFlow
  • Keras
  • KerasTuner

๐Ÿงน Data Preprocessing

Several preprocessing steps were applied before training the neural networks.

โœ… Data Cleaning

The following checks were performed:

  • Verified missing values
  • Verified feature data types
  • Removed duplicate rows

๐Ÿ“Š Feature Scaling

StandardScaler was applied to normalize the input features.

Why scaling is important for neural networks:

  • Faster convergence
  • Stable gradient updates
  • Improved optimization performance
  • Better overall model training

๐Ÿง  Model Development

Three ANN approaches were implemented and compared.


1๏ธโƒฃ Baseline ANN Model

The first model was designed as a simple feedforward neural network to establish baseline performance.

๐Ÿ—๏ธ Architecture

  • Dense layer โ†’ 64 neurons (ReLU)
  • Dense layer โ†’ 32 neurons (ReLU)
  • Output layer โ†’ 3 neurons (Softmax)

โšก Compilation

  • Optimizer: Adam
  • Loss Function: Sparse Categorical Crossentropy
  • Metric: Accuracy

๐Ÿ“‰ Training Optimization

EarlyStopping was used to reduce unnecessary training and prevent overfitting.


2๏ธโƒฃ Improved ANN Model (Regularization)

The second model introduced Dropout layers to improve generalization and reduce overfitting.

๐Ÿ›ก๏ธ Regularization Strategy

Dropout randomly disables neurons during training, which:

  • Reduces overfitting
  • Improves generalization
  • Makes the model more robust

๐Ÿ—๏ธ Architecture

  • Dense(64, ReLU)
  • Dropout(0.3)
  • Dense(32, ReLU)
  • Dropout(0.2)
  • Dense(3, Softmax)

3๏ธโƒฃ Hyperparameter-Tuned ANN Model

KerasTuner with Hyperband optimization was used to automatically search for better hyperparameters.

๐Ÿ” Tuned Parameters

The tuner searched for:

  • Number of neurons
  • Dropout rate
  • Optimizer type

โš™๏ธ Optimizers Tested

  • Adam
  • RMSprop
  • Nadam

This produced the best-performing model in the project.


๐Ÿ“ˆ Model Evaluation

Multiple evaluation methods were used.

โœ… Classification Report

The models were evaluated using:

  • Precision
  • Recall
  • F1-score
  • Accuracy

๐Ÿ“Š Confusion Matrix

Confusion matrices were used to visualize prediction performance across all classes.


๐Ÿ”ฌ Softmax Confidence Analysis

The project also explored Softmax probability confidence.

Example:

max_probs = np.max(pred, axis=1)

This represents the confidence score of the model for each prediction.

๐Ÿ’ก Why Confidence Matters

In medical AI systems, confidence analysis is important because:

  • Low-confidence predictions may require human review
  • High-confidence predictions are generally more reliable
  • Thresholds can improve prediction precision

Example strategy:

  • High confidence โ†’ accept prediction
  • Low confidence โ†’ send for expert verification

๐Ÿ“Š Key Findings

๐Ÿฅ‡ Best Performing Model

The Hyperparameter-Tuned ANN achieved the best overall performance.

Why it performed best:

  • Better hyperparameter selection
  • Improved generalization
  • More balanced classification performance
  • Reduced overfitting

๐Ÿง  Project Insights

Several important deep learning concepts were demonstrated throughout the project:

โœ… Neural networks benefit significantly from:

  • Proper preprocessing
  • Feature scaling
  • Early stopping
  • Dropout regularization
  • Hyperparameter optimization

โœ… Medical classification challenges

The project also highlighted:

  • Difficulty in separating borderline classes
  • Importance of confidence-based prediction
  • The challenge of multiclass medical classification

โญ Final Note

This project represents an applied introduction to neural networks using TensorFlow/Keras and demonstrates a full deep learning workflow from preprocessing to model optimization and evaluation.

It also reflects iterative experimentation and practical ANN development practices commonly used in real-world machine learning projects.

About

Artificial Neural Network (ANN) project for multiclass fetal health classification using CTG data with TensorFlow, Keras, Dropout regularization, and Hyperparameter Tuning.

Topics

artificial-neural-networksclassificationctgdata-sciencedeep-learningfetal-healthhealthcarekeraskeras-tunermachine-learningmedical-aimulticlass-classificationneural-networkpythonscikit-learntensorflow

Resources

Readme
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402860 โ€” GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800ร—600. No cookies required.