Unsupervised Anomaly Detection for Mass-Scale ECG Screening Using Spectral-Temporal Variational Autoencoders
Sourav Garodia, Minhazul Abedin
Developed an unsupervised deep learning system for large-scale ECG anomaly detection using advanced Variational Autoencoder architectures, achieving strong performance with a Spectral-Temporal VAE (F1-score: 0.90, AUC-ROC: 0.93). The work integrates multi-domain signal modeling with a complete end-to-end pipeline and a functional screening interface.

More images
Abstract
Early identification of abnormal cardiac activity is essential for preventing critical cardiovascular events, yet manual interpretation of 12-lead electrocardiograms (ECGs) remains time consuming and prone to human error. This study develops a unified unsupervised anomaly detection framework using deep learning models trained exclusively on normal ECGs from the PTB-XL dataset, following a strict preprocessing pipeline including bandpass filtering, notch filtering, min-max normalization, and window segmentation. The system evaluates and compares seven autoencoder-based architectures, ranging from a baseline Convolutional Autoencoder (CAE) to recurrent VAE variants such as VAE, VAE-BiLSTM-Attention, VAE-BiLSTM-MHA, Beat-Aligned VAE (BA-VAE), Hierarchical-Latent VAE (HL-VAE), and the proposed Spectral-Temporal VAE (ST-VAE). All models are trained to reconstruct clean cardiac morphology. Anomalies are detected through reconstruction based scoring, combining reconstruction error and Kullback-Leibler divergence from the latent distribution. Window segments of the ECG are processed individually and aggregated to form a final anomaly score. The proposed ST-VAE introduces a dual branch encoder that jointly learns temporal morphology and frequency-domain rhythm signatures, fusing both representations into a compact latent space before decoding. This spectral-temporal modeling significantly improves the system’s ability to capture both structural waveform deviations and rhythm irregularities. Across all architectures, ST-VAE demonstrates superior performance, achieving the highest F1-score of 0.90, precision of 0.89, recall of 0.91, AUC-ROC of 0.93, and AUC-PR of 0.91 among evaluated models, while maintaining fast inference times suitable for real-time and batch-processing scenarios. The model is further deployed into a lightweight clinical screening tool capable of mass ECG analysis and anomaly identification, supporting scalable early warning systems in healthcare. This work shows that integrating frequency aware encoders, variational learning, and anomaly scoring leads to substantial improvements in unsupervised ECG abnormality detection, offering a strong foundation for automated cardiovascular screening.
Contributions
- Designed and implemented a complete research pipeline covering data preprocessing, model development, training, evaluation, and reporting.
- Conducted a comprehensive comparative study of multiple VAE-based architectures (including CAE, VAE, VAE-BiLSTM, VAE-MHA, BA-VAE, HL-VAE, and ST-VAE).
- Proposed and implemented a Spectral-Temporal VAE (ST-VAE) that integrates temporal and frequency-domain features for improved anomaly detection.
- Achieved state-of-the-art performance within the study, with ST-VAE reaching F1-score of 0.90 and AUC-ROC of 0.93
- Performed unsupervised anomaly detection on multivariate ECG time-series data (PTB-XL), focusing on real-world scalability challenges.
- Developed a robust anomaly scoring mechanism using reconstruction loss and KL-divergence for distinguishing normal vs abnormal ECG signals.
- Conducted extensive experimentation and evaluation, including precision, recall, F1-score, AUC-ROC, and AUC-PR comparisons across models.
- Built a web-based screening platform prototype enabling batch analysis, anomaly visualization, and report generation for practical usability
- reated detailed visualizations and analytical reports (model comparison charts, anomaly score plots, and ECG signal outputs) to support interpretability.
- uthored a thesis-grade report and defense presentation, covering background study, gap analysis, methodology, results, and real-world implications.