CardioCaps: Attention-Based Capsule Network for Class-Imbalanced Echocardiogram Classification

Hyunkyung Han, Jihyeon Seong, Jaesik Choi

Introduction

Automated analysis of echocardiograms—ultrasound videos of the heart—presents a significant challenge for computer vision. The heart's constant motion and the variability of capture angles require models that possess strong "translation equivariance," meaning the model must recognize anatomical structures regardless of their shift or rotation within the frame. While Capsule Networks (CapsNets) were designed to address these spatial relationships, they traditionally suffer from high computational costs due to iterative "dynamic routing" and struggle with the class imbalance inherent in medical datasets, where healthy cases significantly outnumber abnormal ones.

This paper introduces CardioCaps, a specialized Capsule Network architecture designed to overcome these hurdles. By replacing traditional routing with an efficient attention mechanism and incorporating clinical context through auxiliary tasks, CardioCaps achieves state-of-the-art performance in classifying echocardiograms.

Methodology

CardioCaps introduces three primary innovations to the standard Capsule Network framework:

1. Attention-based Routing

Traditional CapsNets use an iterative "agreement" process to route information between low-level and high-level capsules. This process has quadratic complexity, making it slow and difficult to scale. CardioCaps replaces this with a convolutional attention mechanism. This allows the network to determine the relationships between features in a single, non-iterative pass, significantly reducing training time while maintaining the spatial awareness that makes capsules effective.

2. Weighted Margin Loss

To address the 80/20 split between normal and abnormal cases in clinical data, the researchers modified the standard margin loss function. By introducing a weight based on class frequency, the model is penalized more heavily for misclassifying the minority (abnormal) class. This ensures the network does not simply default to predicting the majority class to achieve high nominal accuracy.

3. Auxiliary Regression Task

Beyond simple classification, CardioCaps is trained to perform a secondary task: predicting the Ejection Fraction (EF), a critical metric of cardiac pump function. This auxiliary loss serves as a regularizer, forcing the model to learn biologically relevant features that are essential for clinical diagnosis rather than relying on superficial image patterns.

Experimental Setup

The model was evaluated using the EchoNet-LVH dataset, which contains 12,000 parasternal-long-axis echocardiogram videos from Stanford Hospital. The researchers utilized a subset of 300 videos, pre-processed into a $256 \times 256$ format. The dataset was intentionally imbalanced (80% normal, 20% abnormal) to reflect real-world clinical conditions.

Results and Discussion

CardioCaps demonstrated significant improvements over both traditional Capsule Networks and standard deep learning architectures:

  • Accuracy: CardioCaps achieved 85.51%, a massive improvement over the 57.07% achieved by the original Dynamic Routing CapsNet (DR-CapsNet).
  • F1-Score: The model reached an F1-score of 0.8563, outperforming ResNet18 (0.8336) and Vision Transformers (0.7915).
  • Robustness: The architecture outperformed specialized models like U-Net and other advanced CapsNet variants (EM-CapsNets and Efficient-CapsNets) across PR AUC and ROC AUC metrics.

Ablation studies highlighted that the shared affine matrix within the capsule structure is vital for handling varying ultrasound angles; removing it led to a sharp decline in performance. Furthermore, the results suggest that non-iterative attention-based routing may actually provide better transformation robustness than the original iterative routing methods.

Conclusion and Future Work

CardioCaps represents a significant step forward in making Capsule Networks viable for medical imaging. By integrating clinical metrics like Ejection Fraction into the learning process and optimizing the routing mechanism, the model achieves high precision in a computationally efficient manner.

However, the researchers noted a persistent challenge with the false-negative ratio, where some abnormal cases were still missed by the model. Future research will focus on refining the attention heads and potentially incorporating temporal data from the full video sequences to further improve diagnostic sensitivity.

Summary updated

BibTeX
@inproceedings{han2024cardiocaps,
  author = {Hyunkyung Han and Jihyeon Seong and Jaesik Choi},
  title = {{CardioCaps: Attention-Based Capsule Network for Class-Imbalanced Echocardiogram Classification}},
  booktitle = {BigComp},
  year = {2024},
  doi = {10.1109/bigcomp60711.2024.00052},
}
Figure