Skip to content

UARK-AICV/TSRNet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TSRNet: Simple Framework for Real-time ECG Anomaly Detection with Multimodal Time and Spectrogram Restoration Network (ISBI 2024)

Nhat-Tan Bui · Dinh-Hieu Hoang · Thinh Phan · Minh-Triet Tran . Brijesh Patel . Donald Adjeroh . Ngan Le

Introduction

The electrocardiogram (ECG) is a valuable signal used to assess various aspects of heart health, such as heart rate and rhythm. It plays a crucial role in identifying cardiac conditions and detecting anomalies in ECG data. However, distinguishing between normal and abnormal ECG signals can be a challenging task. In this paper, we propose an approach that leverages anomaly detection to identify unhealthy conditions using solely normal ECG data for training. Furthermore, to enhance the information available and build a robust system, we suggest considering both the time series and time-frequency domain aspects of the ECG signal. As a result, we introduce a specialized network called the Multimodal Time and Spectrogram Restoration Network (TSRNet) designed specifically for detecting anomalies in ECG signals. TSRNet falls into the category of restoration-based anomaly detection and draws inspiration from both the time series and spectrogram domains. By extracting representations from both domains, TSRNet effectively captures the comprehensive characteristics of the ECG signal. This approach enables the network to learn robust representations with superior discrimination abilities, allowing it to distinguish between normal and abnormal ECG patterns more effectively. Furthermore, we introduce a novel inference method, termed Peak-based Error, that specifically focuses on ECG peaks, a critical component in detecting abnormalities. The experimental result on the large-scale dataset PTB-XL has demonstrated the effectiveness of our approach in ECG anomaly detection, while also prioritizing efficiency by minimizing the number of trainable parameters.

Prerequisites

  • Pytorch
  • Torchvision
  • Numpy
  • SciPy
  • HeartPy
  • PyWavelets

Datasets

To validate the effectiveness of our model, we conduct the experiments benchmark in PTB-XL dataset. We follow the same dataset preprocessing as in Jiang et al. Please refer to their repository for more details.

Usage

Training

  • Without Spectrogram branch
  • python train.py --dims "dimension of ECG signal" --data_path "path to train dataset" --save_path "path to save checkpoint"
    
  • With Spectrogram branch
  • python train.py --dims "dimension of ECG signal" --data_path "path to train dataset" --save_path "path to save checkpoint" --spec
    

Testing

  • Without Peak-based Error
  • python test.py --dims "dimension of ECG signal" --data_path "path to train dataset" --load_path "path to save checkpoint" 
    
  • With Peak-based Error
  • python test.py --dims "dimension of ECG signal" --data_path "path to train dataset" --load_path "path to save checkpoint" --mask_loss
    

Citation

@article{tsrnet,
      title={TSRNet: Simple Framework for Real-time ECG Anomaly Detection with Multimodal Time and Spectrogram Restoration Network}, 
      author={Nhat-Tan Bui and Dinh-Hieu Hoang and Thinh Phan and Minh-Triet Tran and Brijesh Patel and Donald Adjeroh and Ngan Le},
      journal={arXiv:2312.10187},
      year={2023}
}

Acknowledgment

A part of this code is adapted from these previous works: Jiang et al. and Phan et al.

FAQ

If you have any questions, please feel free to create an issue on this repository or contact us at tanb@uark.edu / hieu.hoang2020@ict.jvn.edu.vn.

About

[ISBI 2024] An implementation of TSRNet for ECG Anomaly Detection

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages