All-in-one electrical atrial substrate indicators with deep anomaly detection [BSPC 2024]
This repository implements a framework for detecting anomalies in atrial electrogram (EGM) signals using deep learning techniques and classical methods. The project is based on the paper All-in-one electrical atrial substrate indicators with deep anomaly detection, published in Biomedical Signal Processing and Control.
The implementation relies on the following libraries:
numpy
pandas
scipy
torch
test_patient.py
This script executes the anomaly detection method for a specified test patient while training the model using a list of other patients.
For each patient, the following files must be placed in the patients
directory:
{patient_name}_unipolars.npy
- Contains unipolar signals.{patient_name}_bipolars.npy
- Contains bipolar signals.{patient_name}.csv
- A CSV file with information about the data points, such as voltages, activation times (AT), and optionally coordinates.
The output is saved in the indicators
directory. For each signal, the following are computed:
- Classic indicators (e.g., Fractionation Index, Duration, Voltage).
- Anomaly scores from deep learning methods.
-
models.py
Contains the implementation of the deep learning methods. -
indicators.py
Includes methods for calculating the classic indicators. -
preprocess.py
Provides methods for preprocessing the signals. -
train_utils.py
Contains utilities for training the deep learning models.
If you use this code, please cite the following paper:
@article{BINDINI2024106737,
title = {All-in-one electrical atrial substrate indicators with deep anomaly detection},
journal = {Biomedical Signal Processing and Control},
volume = {98},
pages = {106737},
year = {2024},
issn = {1746-8094},
doi = {https://doi.org/10.1016/j.bspc.2024.106737},
author = {Luca Bindini and Stefano Pagani and Andrea Bernardini and Benedetta Grossi and Andrea Giomi and Antonio Frontera and Paolo Frasconi},
}
All material is available under Creative Commons BY-NC 4.0. You can use, redistribute, and adapt the material for non-commercial purposes, as long as you give appropriate credit by citing our paper and indicate any changes you've made.