This repository contains the code and datasets for our IJCAI 2021 paper Electrocardio Panorama: Synthesizing New ECG views with Self-supervision.
A common ECG view present the signals from one view, determined by the physical ECG lead position. We present a new concept called Electrocardio Panorama, which allows doctors to observe the ECG signals from any viewpoints they want. To synthesize Electrocardio Panorama, we propose a model called Nef-Net, which only requires one or few ECG views as inputs.
Multi-lead electrocardiogram (ECG) provides clinical information of heartbeats from several fixed viewpoints determined by the lead positioning. However, it is often not satisfactory to visualize ECG signals in these fixed and limited views, as some clinically useful information is represented only from a few specific ECG viewpoints. For the first time, we propose a new concept, Electrocardio Panorama, which allows visualizing ECG signals from any queried viewpoints. To build Electrocardio Panorama, we assume that an underlying electrocardio field exists, representing locations, magnitudes, and directions of ECG signals. We present a Neural electrocardio field Network (Nef-Net), which first predicts the electrocardio field representation by using a sparse set of one or few input ECG views and then synthesizes Electrocardio Panorama based on the predicted representations. Specially, to better disentangle electrocardio field information from viewpoint biases, a new Angular Encoding is proposed to process viewpoint angles. Also, we propose a self-supervised learning approach called Standin Learning, which helps model the electrocardio field without direct supervision. Further, with very few modifications, Nef-Net can synthesize ECG signals from scratch. Experiments verify that our Nef-Net performs well on Electrocardio Panorama synthesis, and outperforms the previous work on the auxiliary tasks (ECG view transformation and ECG synthesis from scratch).
Please note that an Electrocardio Panorama actually has continuous unlimited views.
ECG data from scratch synthesis is just a supplementary function of our Nef-Net, but is obviously better than the previous GAN work for ECG data (e.g., SimGAN). It is suggested that the underlying ECG information is well captured by the Nef-Net model.
-
Prepare your env following requirements.txt
pip install requirements.txt
-
Train Nef-Net by
python -u main.py --config-file config/nef-net.yml
-
Run the demo: (TBC)
The code is just for reference. Our work is only the first step to explore the Electrocardio Panorama, and we are really looking forward to future work analysing or synthesizing Electrocardio Panorama.
Also, we provide some segmentation labels on Tianchi ECG dataset and PTB Diagnostic ECG dataset. You can use the labels in researches on Electrocardio Panorama and other ECG academic researches. We also provide an ECG segment annotation tool. Commercial purposes are not allowed. As for the original ECG data and labels, please use them following their policy.
Please cite the paper if the codes, ECG annotation tools or the dataset labels we provided are helpful:
@inproceedings{chen2021Electrocardio,
author = {Chen, Jintai and Zheng, Xiangshang, and Yu, Hongyun and Chen, Danny Z and Wu, Jian},
title = {{Electrocardio Panorama: Synthesizing New ECG views with Self-supervision}},
booktitle = {IJCAI},
year = {2021}
}