Zing Forum

Reading

CardioSpike: A Real-Time Arrhythmia Detection System Based on Convolutional Neural Networks

An end-to-end ECG classification system that uses convolutional neural networks to analyze ECG signals, enabling binary classification between normal heart rhythms and arrhythmias, with a web interface and REST API.

心电图分析卷积神经网络心律不齐检测医疗AIPyTorchFlask合成数据信号处理深度学习健康监测
Published 2026-06-14 04:44Recent activity 2026-06-14 04:53Estimated read 6 min
CardioSpike: A Real-Time Arrhythmia Detection System Based on Convolutional Neural Networks
1

Section 01

CardioSpike: Guide to the CNN-Based Real-Time Arrhythmia Detection System

CardioSpike is an end-to-end ECG classification system that uses Convolutional Neural Networks (CNN) to analyze ECG signals, enabling binary classification between normal heart rhythms and arrhythmias. It provides a web interface and REST API. The project includes a complete training pipeline and deployment services, demonstrating the application potential of deep learning in the healthcare field. This project is from GitHub, authored by Deshwan25boe10077, and released in June 2026.

2

Section 02

Project Background: The Necessity of AI for Heart Health

Heart disease is one of the leading causes of death worldwide, and arrhythmia is often an early sign of heart problems. Traditional ECG analysis relies on the experience of professional doctors, but in resource-poor areas or emergency situations, it is not easy to get timely professional diagnosis. CardioSpike aims to solve this practical pain point by using AI technology to automatically analyze ECG signals.

3

Section 03

Technical Architecture and Core Methods

Input Data Specifications

The system processes 2-second single-channel ECG signals (equivalent to lead II) with a sampling rate of 250Hz, totaling 500 data points.

Preprocessing Pipeline

ECG signal → Normalization (Min-max scaling) → Padding (fixed length) → Input to CNN.

CNN Architecture

Input layer → Conv1 (32 filters, kernel size 7) → ReLU + MaxPool → Conv2 (64 filters, kernel size 5) → ReLU + MaxPool → Fully connected layer 1 (128 dimensions) → Fully connected layer 2 (2 dimensions, Softmax) → Output probabilities of normal/arrhythmia.

4

Section 04

Training Process and Performance

Data Source

Trained using synthetic data (150 samples each for normal/arrhythmia), balancing privacy and controllable data distribution.

Training Configuration

25 training epochs, batch size of 16, learning rate of 0.001, Adam optimizer, cross-entropy loss function.

Expected Performance

Training accuracy >99%, validation accuracy >95%, CPU training time approximately 2-3 minutes.

5

Section 05

Deployment and Usage Methods

REST API

  • Health Check: GET /health returns status ok;
  • Prediction Interface: POST /predict takes an ECG signal of 500 floating-point numbers as input and returns the predicted category and probability.

Web Interface

The left panel allows loading/generating normal/abnormal ECGs, visualizing signals, and analyzing data; the right panel displays classification results, probability distribution, processing time, and other information.

6

Section 06

Limitations and Future Improvement Directions

Current Limitations

  1. Only uses synthetic data, not validated on real patient data;
  2. Single-channel analysis, no multi-lead support;
  3. Binary classification, no sub-type differentiation;
  4. Not clinically validated, not suitable for actual diagnosis.

Future Plans

  • Train using the MIT-BIH real arrhythmia database;
  • Support multi-class classification (e.g., atrial fibrillation, ventricular tachycardia, etc.);
  • Multi-lead ECG support;
  • Implementation of Spiking Neural Networks (SNN) and deployment on neuromorphic hardware.
7

Section 07

Project Value and Disclaimer

CardioSpike demonstrates the application potential of deep learning in the healthcare field, and its complete development framework (data generation → model training → API deployment → web interface) provides a reference for AI medical product development. However, the current version is for research purposes and has not been clinically validated.

Disclaimer: This system is for research and demonstration use only and is not suitable for clinical diagnosis or patient care. Please consult a professional medical personnel for ECG interpretation.