We propose MPCNN, a novel feature extraction method for single-lead ECG analysis in apnea classification. Specifically, our approach is inspired by Matrix Profile (MP) algorithms, which utilize fixed-length subsequence distance profiles to capture critical features in the PQRST segment of an ECG signal. We extracted MinDP, MaxDP, and MeanDP values from these distance profiles to serve as inputs for CNN models. We compared this new feature extraction approach with conventional methods, such as R-peaks and RR intervals, in various experiments. Our results demonstrate that our technique has significant potential and efficacy for SA classification, delivering promising per-segment and per-recording performance metrics.
The overall of our proposed SA detecion. (1) Reducing noise and artifacts. (2) Our main contribution in this paper, where we generate a series of subsequences
The data is available at Apnea-ECG Database. Please download and extract the file to dataset
.
Python 3.10.12
Keras 2.12.0
TensorFlow 2.12.0
Please run the file preprocessing.py
to extract the data for CNN's input. In our method, we also design ablation study with show as below:
The design of the ablation studys with different window size.
Read the comment in preprocessing.py
to get the file data for each situation.
After preprocessing, we will test our method using three different deep learning architectures: modified LeNet-5, BAFNet, and SEMSCNN. Please refer to the paper for more information about each model. The performance was evaluated on Google Colab, and the files are in the ".ipynb" format. Change the filename from ".pkl" to test the results for each dataset (from BAFNET_model.ipynb
, LeNet5_model.ipynb
, and SE-MSCNN_model.ipynb
. Additionally, read the comments in each file to understand how to modify the code to conduct other experiments to test the effectiveness of each term in the feature extraction process of MPCNN: MinDP, MaxDP, and MeanDP (from
After finishing the per-recording classification and extracting the CSV file, go to test_per_recording.py
and enter the name of the '.csv' file as instructed in the comments to obtain the results of the per-segment classification.
If you have any question, please don't hesitate to contact me at [email protected]
We would like to thank the authors JackAndCole and Bettycxh for their open-source immplementations for: LeNet5, BAFNet and SEMSCNN.