Video Capsule Endoscopy Classification using Focal Modulation Guided Convolutional Neural Network

Abhishek Srivastava, Nikhil Kumar Tomar, Ulas Bagci, Debesh Jha · DOI

Abstract

Video Capsule Endoscopy (VCE) is a vital diagnostic tool for gastrointestinal health, yet the manual analysis of its high-volume image data remains a significant clinical bottleneck. This paper presents FocalConvNet, a hybrid deep learning architecture designed to optimize both diagnostic accuracy and processing speed. By integrating focal modulation with lightweight convolutional blocks, FocalConvNet captures both local features and global context without the computational overhead of traditional Transformers. Evaluated on the Kvasir-Capsule dataset, the model achieves a weighted F1-score of 0.6734 and a throughput of 148.02 images per second, establishing a new benchmark for real-time computer-aided diagnosis in endoscopy.

Introduction

Video Capsule Endoscopy (VCE) has revolutionized the examination of the small intestine. By utilizing a pill-sized camera that captures thousands of images during its transit through the digestive tract, clinicians can non-invasively detect pathologies such as ulcers, bleeding, and polyps. However, the sheer volume of data generated—often exceeding 50,000 images per procedure—presents a daunting challenge. Manual review is labor-intensive and susceptible to fatigue-induced errors, which can lead to missed anomalies.

Computer-Aided Diagnosis (CADx) systems offer a solution, but existing models often struggle with a trade-off between local precision and global context. Standard Convolutional Neural Networks (CNNs) are efficient at extracting local features but often fail to grasp wider anatomical relationships. Conversely, Vision Transformers (ViTs) excel at global modeling but are computationally expensive and lack the "inductive bias" (inherent structural assumptions) necessary to perform well on smaller or imbalanced medical datasets. FocalConvNet addresses this gap by merging the strengths of both paradigms.

Methodology: The FocalConvNet Architecture

The primary innovation of FocalConvNet is the replacement of the standard self-attention mechanism found in Transformers with Focal Modulation.

Focal Modulation and Global Context

Unlike the "query-key-value" interactions in Transformers, which scale quadratically with input size, focal modulation aggregates multi-scale contexts to modulate the input query. This allows the network to capture global-local spatial interactions more efficiently, providing the "global reach" of a Transformer at a fraction of the computational cost.

Hybrid Structural Components

FocalConvNet employs a strategic combination of blocks to maintain high throughput while maximizing representational power:

  • Lightweight Convolutional Blocks: Utilizing depth-wise separable convolutions (a $1 \times 1$ point-wise convolution followed by a $3 \times 3$ depth-wise convolution), the model mimics standard convolutions while drastically reducing parameter counts and increasing speed.
  • Squeeze-and-Excitation (S&E) Blocks: These are integrated within the convolutional stages to compute inter-dependencies between channels, enhancing the network's ability to focus on relevant features.
  • Inductive Bias: By retaining a convolutional backbone, the model benefits from translation invariance and locality, which are crucial for learning effectively from medical datasets where specific pathologies may be scarce.

Experimental Evaluation

The model was rigorously tested using the Kvasir-Capsule dataset, currently the world’s largest public VCE dataset.

Dataset and Preprocessing

The dataset comprises 44,228 labeled images across 13 classes. A significant challenge is its "long-tailed" distribution; for example, "Normal mucosa" contains over 34,000 samples, whereas "Blood" contains only 446. To ensure statistical robustness, the authors focused on 11 categories, excluding extremely rare classes like "Polyp" and "Hematin" (fewer than 70 samples each).

Performance Metrics

FocalConvNet was benchmarked against several state-of-the-art architectures, including ResNet-152, DenseNet-169, Swin Transformer, and ConvNeXt.

  • Accuracy and F1-Score: The model achieved a weighted F1-score of 0.6734 and an accuracy of 0.6373, outperforming the previous state-of-the-art (GMSRF-Net) by nearly 1% and 2.8%, respectively.
  • Matthews Correlation Coefficient (MCC): In the context of imbalanced data, FocalConvNet reached an MCC of 0.2964, surpassing the second-best model (ConViT-S) by 1.95%.
  • Clinical Viability (Throughput): For clinical application, speed is a necessity. FocalConvNet achieved a throughput of 148.02 images per second on an NVIDIA V100 GPU. This is nearly 20 times faster than GMSRF-Net (7.6 images/sec) and significantly outpaces lightweight models like EfficientNetV2-S (65.23 images/sec).

Discussion and Limitations

While FocalConvNet represents a significant advancement, the "long-tail" problem in medical imaging remains a hurdle. The macro-average F1-score (0.2178), which weighs all classes equally, is notably lower than the weighted average. This indicates that even state-of-the-art models still struggle to identify the rarest anomalies with high precision.

Conclusion

FocalConvNet demonstrates that the quadratic complexity of standard Transformer attention is not a prerequisite for capturing global context in medical imaging. By leveraging focal modulation and lightweight convolutions, the model provides a high-speed, high-accuracy solution tailored for the demands of real-time clinical VCE. Future research will explore the use of generative models (such as GANs) to synthesize data for rare classes, potentially balancing the dataset and further improving detection rates for elusive pathologies.

Summary updated

BibTeX
@inproceedings{srivastava2022video,
  author = {Abhishek Srivastava and Nikhil Kumar Tomar and Ulas Bagci and Debesh Jha},
  title = {{Video Capsule Endoscopy Classification using Focal Modulation Guided Convolutional Neural Network}},
  booktitle = {CBMS},
  year = {2022},
  url = {https://openreview.net/forum?id=9O57Ntekqs},
}
Figure