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:
- Workshop page:
- Data description:
- Download (original workshop database):
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.
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.
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.
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:
- 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.
Click the badge below to launch the notebook directly in Colab:
pred_with_trained_PatchTST_and_plot.ipynb
Located in the root of this repository.
The notebook automatically fetches only the necessary directories using sparse checkout:
ctgdl_proc_samples/— processed CTG signalstrained_model/— pretrained PatchTST classification modelCTU_UHB/— metadata for visualization
No full repository download is required.
The notebook uses a pretrained PatchTST model configured for binary fetal stress classification.
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.
