Arrhythmia Classifier Based on Ultra-Lightweight Binary Neural Network

Ninghao Pu, Zhongxing Wu, Ao Wang, Hanshi Sun, Zijin Liu, Hao Liu · DOI

TL;DR

Researchers from Southeast University have developed an ultra-lightweight Binary Neural Network (BNN) that classifies heart arrhythmias from ECG signals with high accuracy (up to 97.5%) while requiring less than 5 KB of storage. By quantizing weights and activations to a single bit and eliminating memory-heavy components, this model is perfectly tailored for the next generation of low-power wearable medical devices.

What Problem Does This Paper Address?

Cardiovascular diseases are the leading cause of death globally, and early detection of arrhythmias (irregular heartbeats) via Electrocardiography (ECG) is vital. While deep learning has revolutionized ECG analysis, most state-of-the-art models are "heavy"—they require significant memory and computational power.

This creates a bottleneck for the Artificial Intelligence-of-Things (AIoT). Wearable heart monitors have very limited battery life and storage. Most existing "lightweight" models still rely on multi-bit math or complex preprocessing, making them difficult to implement on cheap, tiny chips. The authors sought to bridge this gap by creating a model that is "hardware-friendly" from the ground up.

Methods

The core strategy is binarization. Instead of using standard 32-bit floating-point numbers for neural network weights and activations, the authors restricted them to just two values: $\{+1, -1\}$.

Key technical innovations include:

  • XNOR-POPCOUNT Logic: By using 1-bit values, complex multiplication is replaced by simple bit-wise XNOR operations and bit counting (POPCOUNT), which are incredibly fast and efficient in hardware.
  • Removing Fully Connected (FC) Layers: FC layers usually contain the bulk of a model's parameters. The authors replaced them with Global Sum Pooling (GSP), drastically reducing the memory footprint.
  • Operator Fusion: They mathematically fused PReLU (activation), Batch Normalization, and the Sign function into a single threshold function. This eliminates the need for floating-point math during the inference phase on a wearable device.
  • Softmax Replacement: To avoid the power-hungry exponential calculations required by a standard Softmax layer, they used a simple comparator to identify the highest-scoring class.

Datasets

The models were trained and evaluated using the gold-standard MIT-BIH Arrhythmia database from PhysioNet. The researchers tested two specific configurations:

  1. 5-class classification: Following the AAMI EC57 standard (Normal, Supraventricular, Ventricular, Fusion, and Unknown beats).
  2. 17-class classification: A more granular diagnostic task including various types of heart blocks and rhythms.

Key Insights and Ideas

  • The "Aha" Moment on Denoising: The authors experimented with quantizing the raw ECG input signal itself to $\{+1, -1\}$. They discovered this acts as an "extreme denoising" technique. Even with this loss of signal detail, the model maintained over 91% accuracy, suggesting that the shape of the wave is far more important than its precise amplitude for arrhythmia detection.
  • Universal Architecture: By standardizing the 1D-CNN blocks, the same network structure can switch between 5-class and 17-class monitoring simply by swapping the final output channel and weights.
  • Efficiency vs. Accuracy: The BNN achieved a compression ratio of nearly 30x compared to its full-precision counterpart, with an accuracy drop of less than 1%. This proves that for specific medical tasks, extreme quantization doesn't have to mean extreme performance loss.

Key Results

The proposed BNN sets a new benchmark for "ultra-lightweight" performance:

  • Accuracy: 96.90% for 5-class and 97.50% for 17-class classification.
  • Storage: Only 3.76 KB for the 5-class model and 4.45 KB for the 17-class model.
  • Comparison: Compared to other recent BNNs in the literature, this model is significantly smaller (e.g., one previous 1D-BNN required 266 KB) while achieving higher accuracy on the 17-class task.
  • Hardware Readiness: Because the model avoids division and exponential operations, it can be implemented directly into hardware arithmetic logic (like FPGAs) with minimal complexity.

Limitations and Future Work

While the accuracy and storage results are impressive, the authors note a few hurdles:

  • Sensitivity Gaps: There is still a slight gap in sensitivity (the ability to correctly identify a positive case) and F1-scores when compared to full-precision (32-bit) models.
  • Real-world Implementation: The current paper focuses on the algorithmic design and software simulation. The authors state that the next logical step is the actual FPGA implementation to measure real-world power consumption and hardware acceleration in a live environment.
  • Generalization: While the MIT-BIH dataset is a standard, testing on more diverse, "noisy" real-world data from actual wearable sensors will be necessary to prove clinical utility.

Summary updated

BibTeX
@inproceedings{pu2023arrhythmia,
  author = {Ninghao Pu and Zhongxing Wu and Ao Wang and Hanshi Sun and Zijin Liu and Hao Liu},
  title = {{Arrhythmia Classifier Based on Ultra-Lightweight Binary Neural Network}},
  booktitle = {ECAI},
  year = {2023},
  doi = {10.1109/ecai58194.2023.10193930},
}
Figure