/Anomaly-Detection-in-Time-Series-with-Triadic-Motif-Fields

Anomaly Detection in Time Series with Triadic Motif Fields and Application in Atrial Fibrillation ECG Classification

Primary LanguagePython

Anomaly Detection in Time Series with Triadic Motif Fields and Application in Atrial Fibrillation ECG Classification

arXiv Binder PWC

Author: Yadong Zhang and Xin Chen

Paper: arXiv

Online demo: Binder

Modules

Module Path Note Default Settings
Basic 1. lib
2. data
3. model
1. Basic functions of the project.
2. Dataset processing.
3. Saved tail model weights.
1. -
2. no filter, z-normalization
3. MLP model
Classification 1. extractor
2. classifier
1. Features extraction of TMF images based on transfer learning.
2. Feature vectors classification to AF and non-AF probabilities.
1. VGG16, map-reduce use 10 nodes and 5 mpisize.
2. -
Evaluation 1. length_effect 1. Evaluate the trained model on varying-length ECG signals. 1. VGG16-MLP, map-reduce use 10 nodes and 5 mpisize.
App 1. pyQT app
2. bokeh app
1. Local app for classification and interpretation.
2. Web server for interpretation.
VGG16-MLP

Structures of Parallel Codes (mpi)

extractor and length_effect are parallelized on the linux clustering. (map-reduce)

  • .py: main code.
  • .sh: script for single submission to the pbs queue.
  • map*.py: map the tasks to multi-nodes and mpi.
  • reduce*.py: collect the results from the finished tasks.

Guidelines of APP

Features Classification Visualization Interactive Remote Local
pyQT app ✔️ ✔️ ✔️ ✔️
bokeh app ❌ (available in future) ✔️ ✔️ ✔️ ✔️
  1. Start page (click start)
    • Start button
    • Process bar & status hello
  2. Main page (from top to bottom)
    • Time series with label
    • Symmetrized Grad-CAM of AF and its predicted probability
    • Symmetrized Grad-CAM of non-AF and its predicted probability
    • Sliders of time index and delay to adjust the triadic time series motifs
      • Triad (red) in time series is corresponding to the cross (white) in two Symmetrized Grad-CAM images
      • The text with red background indicates the predicted type. main

bokeh

Python 3.6:

matplotlib
mpi4py==3.0.3
numba==0.50.1
scikit-learn==0.23.0
scipy==1.5.2
tensorflow==1.14.0
opencv-python
tqdm
PyQT5

Citation

Cite our work with:

@misc{zhang2020anomaly,
      title={Anomaly Detection in Time Series with Triadic Motif Fields and Application in Atrial Fibrillation ECG Classification}, 
      author={Yadong Zhang and Xin Chen},
      year={2020},
      eprint={2012.04936},
      archivePrefix={arXiv},
      primaryClass={cs.LG}
}