DOI: 10.5281/zenodo.17202038
title: Fetal Health from Real-World CTG: Superiority of Transformers in Three-Class Benchmarking and 0–100 Sequence-Level Regression

description: SummaryThis deposit provides a complete, two-task pipeline for modeling multi-channel cardiotocography (CTG) segments acquired from EDAN F3 NST devices:





Three-class classification (normal / suspicious / abnormal) and




Sequence-level regression on a clinician score scaled to 0–100.



We compare classic ML baselines (Logistic Regression, SVM-RBF, Random Forest, LightGBM, XGBoost) with five Transformer-based architectures (PatchCTG, PatchTST, iTransformer, TimesNetLite, ETCNN) under aligned splits and common evaluation criteria. Code is organized as Jupyter notebooks.



Data availability & ethicsThe dataset contains real, de-identified clinical records. All direct identifiers were removed under institutional ethics approval. We share these data to enable further scientific work and reproducibility. Users must comply with local IRB/ethics and data-governance policies.


Contents (what each file does)





00_Split_Data.ipynb — Creates seeded train/val/test splits and saves split manifests.




01_examdata.csv — Minimal index/metadata for raw recordings (record id, channels, timestamps) — serves as a schema example.




02_segmented.xlsx — Segment-level label sheet (windows passing FHR–UA–AFM synchronization checks; task labels / 0–100 scores).




03_ClassicModels.ipynb — Classic pipeline: feature extraction (basal rate, short/long-term variability, acceleration/deceleration counts, contraction density, etc.), scaling, SMOTE, model training, and metrics (Macro-F1, Accuracy, per-class P/R, macro ROC-AUC).




04_TransformersModel.ipynb — Common Transformer utilities: dataloaders, 1D-Conv projection to d_model, training loop, ReduceLROnPlateau, early stopping, logging/saving helpers.




05_Transformer_PatchTST.ipynb — PatchTST experiments (typical: d_model=256, patch_len=16, stride=8); regression and/or classification heads; outputs MAE/RMSE/R² or Macro-F1.




06_Transformer_PatchCTG.ipynb — PatchCTG experiments (d_model=128): training/validation curves and test metrics.




07_Transformer_ETCNN.ipynb — ETCNN (CNN + Transformer encoder hybrid) experiments (d_model=128): CNN front-end for local patterns + self-attention for long-range dependencies.




08_Transformer_iTransformer.ipynb — iTransformer experiments (d_model=128): multi-head self-attention, mean pooling, Linear(1) regression head.




09_Transformer_TimesNetLite.ipynb — TimesNetLite experiments (d_model=128): TimesBlock modules for periodic/trend pattern modeling.




_scored_output.xlsx — Example table of model outputs: segment id, ground truth label/score, predictions, and key metrics.




Result-A.txt — Classification summary logs (best Macro-F1, confusion matrices, ROC-AUC summaries).




Result-B.txt — Regression summary logs (Val/Test MAE–RMSE–R² and early-stopping info).



Prerequisites: Python ≥ 3.10; PyTorch; scikit-learn; lightgbm; xgboost; pandas; numpy; matplotlib.

Evaluation





Classification: Primary Macro-F1; additionally report Accuracy, per-class Precision/Recall, and macro ROC-AUC.




Regression: Primary MAE; additionally report RMSE and R². Model selection uses validation MAE with early stopping; final performance is reported on the test set.



License & citation





Data: CC BY 4.0 (Creative Commons Attribution 4.0 International).




Please cite this resource in derivative works.



Suggested citationKarataş, F. (2025). CTG-Trans: Notebooks and Pipelines for CTG Classification and Sequence-Level Regression (v1.0) [Data set & software]. Zenodo. https://doi.org/10.5281/zenodo.17202038

Keywords

cardiotocography; CTG; fetal heart rate; uterine activity; AFM; time series; classification; regression; Transformers; PatchTST; iTransformer; TimesNet

Contact

Ferhat Karataş — Firat University, Computer Engineering— ferhat@bilgipark.com