CTG Classification with Machine Learning and Transformer Models: Python Scripts and Data
收藏资源简介:
This repository contains the Python scripts and datasets used for the doctoral thesis study comparing classical machine learning (Cluster-A) and transformer-based (Cluster-B) models in the classification of cardiotocography (CTG) data. Files and their purposes: 00_Split_Data.ipynb – Jupyter notebook for splitting the original CTG dataset into training, validation, and test subsets. 01_examdata.csv – Example raw dataset containing CTG signals and labels. 02_segmented.xlsx – Pre-processed and segmented CTG dataset ready for model input. 03_ClassicModels.ipynb – Implementation of classical machine learning algorithms (SVM-RBF, Random Forest, XGBoost, LightGBM, Logistic Regression) with evaluation metrics. 04_TransformersModel.ipynb – Implementation of transformer-based deep learning models (PatchCTG, PatchTST, iTransformer, TimesNetLite, ETCNN). Result-A.txt – Output file summarizing performance metrics of classical machine learning models. Result-B.txt – Output file summarizing performance metrics of transformer-based models. _scored_output.xlsx – Final scored dataset with model predictions and evaluation results. Scope:The provided scripts include data preprocessing and augmentation (balancing imbalanced classes using SMOTE and data augmentation techniques), training and validation workflows, and evaluation metrics (accuracy, precision, recall, F1-score, confusion matrices). Visualization utilities (ROC curves, classification reports, and model comparisons) are also integrated. These resources are intended to support reproducibility and further research on the application of artificial intelligence models in fetal monitoring and obstetric anesthesia.
本仓库包含用于博士论文研究的Python脚本与数据集,该研究对比了经典机器学习(Cluster-A)与基于Transformer(Cluster-B)的模型在胎儿心率监护图(cardiotocography, CTG)数据分类任务中的表现。 文件及其用途如下: 00_Split_Data.ipynb – 用于将原始CTG数据集划分为训练集、验证集与测试集的Jupyter Notebook。 01_examdata.csv – 包含CTG信号与标签的示例原始数据集。 02_segmented.xlsx – 已完成预处理与分段、可直接用于模型输入的CTG数据集。 03_ClassicModels.ipynb – 经典机器学习算法(支持向量机-径向基核函数、随机森林、XGBoost、LightGBM、逻辑回归)的实现代码与评估指标计算脚本。 04_TransformersModel.ipynb – 基于Transformer的深度学习模型(PatchCTG、PatchTST、iTransformer、TimesNetLite、ETCNN)的实现代码。 Result-A.txt – 汇总经典机器学习模型性能指标的输出文件。 Result-B.txt – 汇总基于Transformer的模型性能指标的输出文件。 _scored_output.xlsx – 包含模型预测结果与评估结果的最终评分数据集。 研究范围:本仓库提供的脚本涵盖数据预处理与数据增强(采用SMOTE算法平衡类别不平衡问题,并辅以其他数据增强技术)、训练与验证流程,以及各类评估指标(准确率、精确率、召回率、F1值、混淆矩阵)的计算。此外还集成了可视化工具(ROC曲线、分类报告与模型对比可视化)。 本资源旨在支持人工智能模型在胎儿监护与产科麻醉领域应用的可复现研究与进一步探索。



