Arrhythmia Classifier using Binarized Convolutional Neural Network for Resource-Constrained Devices

Ao Wang, Wenxing Xu, Hanshi Sun, Ninghao Pu, Zijin Liu, Hao LiuarXiv 2022 · DOI

Abstract

Deep learning has significantly advanced electrocardiogram (ECG) analysis, yet deploying these models on resource-constrained wearable devices remains a challenge due to high computational and memory requirements. This paper introduces the Binarized Topographic Piecewise Network (BTPN), a 1-bit Convolutional Neural Network (CNN) optimized for edge deployment. By binarizing weights and activations, the BTPN replaces resource-intensive floating-point multiplications with efficient bitwise operations. To maintain high accuracy, the researchers utilized a piecewise polynomial gradient approximation and a topographic-based learning rate strategy. Experimental results on the MIT-BIH Arrhythmia Database demonstrate that the BTPN achieves 95.67% accuracy—nearly matching full-precision models—while providing a 12.65x speedup and a 24.8x reduction in storage footprint.

Introduction

While deep learning models excel at arrhythmia detection, their "resource-hungry" nature often precludes real-time monitoring on low-power wearables like smartwatches. Standard CNNs rely on 32-bit floating-point math, leading to high latency and power consumption. Binarized Neural Networks (BNNs) offer a potential solution by compressing weights to 1-bit values, but they traditionally suffer from significant accuracy degradation. The BTPN model addresses this gap, providing clinical-grade performance within the tight constraints of edge hardware.

The BTPN Architecture and Binarization

The core innovation of the BTPN lies in its binarization scheme. Both weights and activations are constrained to +1 or -1, allowing the model to bypass standard convolution math. Instead, it utilizes XNOR and bit-counting (PopCount) operations, which are natively faster on hardware.

Comparison between standard convolution (top) and binarized convolution using XNOR and PopCount operations (bottom).

Beyond simple quantization, the authors made specific architectural adjustments to ensure stability. They found that placing the Batch Normalization (BN) layer after the pooling layer was essential for convergence in a 1-bit environment. This hardware-algorithm co-design ensures that the architecture is inherently suited for the noise introduced by binarization.

Overcoming Training Challenges

Training BNNs is notoriously difficult because the "Sign" function used for binarization has a derivative of zero almost everywhere, which halts backpropagation. To solve this, the authors replaced the standard tanh approximation with a piecewise polynomial function. This function more closely fits the Sign function's behavior, ensuring better gradient flow and model convergence.

The piecewise polynomial function used for gradient approximation compared to the standard tanh function.

Additionally, the researchers implemented a Topographic-Based (TB) learning rate. Given that the loss landscape of a BNN is more "undulating" and prone to local minima than full-precision models, this strategy uses a higher initial learning rate to navigate the complex optimization terrain before cooling down to stabilize the final weights.

Experimental Results

The BTPN was evaluated using 7,740 ECG signal fragments from the MIT-BIH Arrhythmia Database, categorized into five AAMI standard classes (N, S, V, F, and Q). The model demonstrated exceptional efficiency with minimal performance trade-offs:

  • Accuracy: 95.67%, representing only a 0.78% drop from the full-precision baseline (96.45%).
  • Computational Speedup: 12.65x faster inference compared to standard models.
  • Storage Compression: 24.8x reduction in weight parameter storage.
  • Memory Efficiency: 3.78x reduction in runtime memory overhead.

Conclusion and Future Work

The BTPN model proves that high-accuracy arrhythmia detection is feasible on the edge. While the current model achieves significant compression, the authors note that the first convolutional layer and Batch Normalization layers still utilize floating-point math to preserve feature integrity. Future research will focus on "fully" binarized paths and optimizing BatchNorm layers to further reduce floating-point dependencies, eventually targeting dedicated hardware platforms like FPGAs for real-time clinical applications.

Summary updated

BibTeX
@misc{wang2022arrhythmia,
  author = {Ao Wang and Wenxing Xu and Hanshi Sun and Ninghao Pu and Zijin Liu and Hao Liu},
  title = {{Arrhythmia Classifier using Binarized Convolutional Neural Network for Resource-Constrained Devices}},
  year = {2022},
  eprint = {2205.03661},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2205.03661},
}
Figure