Thanks to visit codestin.com
Credit goes to github.com

Skip to content

naomifridman/CTGDL

Repository files navigation

CTGDL Data Collection

Graphical abstract

SPAM dataset

The SPaM dataset consists of intrapartum cardiotocography (CTG) recordings collected for the 2nd Signal Processing and Monitoring (SPaM) in Labour Workshop held in Oxford, UK, in 2017. The associated CTG Challenge 2017 provided a shared benchmark for methods in fetal heart rate (FHR) and uterine contraction (UC) signal analysis, focusing on labour monitoring, fetal stress detection, and advanced signal processing and classification techniques.

Source and documentation:

In this repository, the SPaM subset is provided as preprocessed time-series files (FHR and UC at 4 Hz, with missing data preserved via NaN markers where applicable), ready for use in machine learning pipelines for fetal stress prediction and CTG pattern analysis.

FHRMA dataset

The FHRMA dataset contains fetal heart rate recordings with expert morphological annotations, including baseline, accelerations, and decelerations. It was originally introduced as a resource for training and evaluating algorithms for CTG morphological analysis and enables supervised and transfer-learning approaches for detecting clinically relevant patterns in FHR.

In this repository, FHRMA recordings are standardized to a common sampling rate and exported to tabular formats with aligned annotation channels to facilitate downstream modelling.

CTU-UHB

The CTU-UHB intrapartum CTG database comprises 552 recordings collected at Czech Technical University and University Hospital Brno, with detailed clinical outcome data including umbilical artery pH, Apgar scores, and maternal/neonatal parameters. Each recording includes FHR and UC signals acquired during labour, typically starting up to 90 minutes before delivery, and is accompanied by rich metadata suitable for supervised outcome prediction and retrospective CTG analysis.

In this repository, CTU-UHB data are provided as standardized 4 Hz FHR/UC time series and harmonized metadata tables, enabling consistent integration with SPaM and FHRMA for multi-source learning, benchmarking, and fetal stress prediction experiments.

Fetus stress prediction

📘 Predict Fetal Stress Using a Trained PatchTST Model

This repository includes the notebook pred_with_trained_PatchTST_and_plot.ipynb, which demonstrates how to apply a pretrained PatchTST model to fetal heart rate (FHR) and uterine contraction (UC) signals.
The notebook performs the full end‑to‑end workflow for fetal stress prediction:

🔍 What the Notebook Does

  • Loads the pretrained PatchTST classification model
  • Downloads only the required folders from the CTGDL dataset using sparse checkout
  • Loads preprocessed CTG signals (ctgdl_proc_samples)
  • Extracts valid 1800‑point windows from each signal
  • Converts each window into PatchTST patches
  • Runs the model to compute fetal stress probability
  • Saves prediction CSV files for each signal
  • Visualizes:
    • FHR and UC traces
    • Predicted stress probability
    • Optional CTU‑UHB metadata overlays

The notebook is designed to run entirely in Google Colab, with no installation or local setup required.


▶️ Open the Notebook in Google Colab

Click the badge below to launch the notebook directly in Colab:

Open In Colab


📄 Notebook File

pred_with_trained_PatchTST_and_plot.ipynb
Located in the root of this repository.


📦 Required Folders (automatically downloaded in Colab)

The notebook automatically fetches only the necessary directories using sparse checkout:

  • ctgdl_proc_samples/ — processed CTG signals
  • trained_model/ — pretrained PatchTST classification model
  • CTU_UHB/ — metadata for visualization

No full repository download is required.


🧠 Model

The notebook uses a pretrained PatchTST model configured for binary fetal stress classification.


📊 Output

For each signal ID:

  • A CSV file containing predicted stress probabilities
  • Optional visualization plots of FHR, UC, and predictions

All outputs are saved in the pred_csv/ directory.

About

CTG data collection and preprocessing

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors