Learning Through Guidance: Knowledge Distillation for Endoscopic Image Classification

Harshala Gammulle, Yubo Chen, Sridha Sridharan, Travis Klein, Clinton Fookes · DOI

Abstract

Endoscopy plays a major role in identifying any underlying abnormalities within the gastrointestinal (GI) tract. There are multiple GI tract diseases that are life-threatening, such as precancerous lesions and other intestinal cancers. In the usual process, a diagnosis is made by a medical expert which can be prone to human errors and the accuracy of the test is also entirely dependent on the expert's level of experience. Deep learning, specifically Convolution Neural Networks (CNNs) which are designed to perform automatic feature learning without any prior feature engineering, has recently reported great benefits for GI endoscopy image analysis. Previous research has developed models that focus only on improving performance, as such, the majority of introduced models contain complex deep network architectures with a large number of parameters that require longer training times. However, there is a lack of focus on developing lightweight models which can run in low-resource environments, which are typically encountered in medical clinics. We investigate three KD-based learning frameworks, response-based, feature-based, and relation-based mechanisms, and introduce a novel multi-head attention-based feature fusion mechanism to support relation-based learning. Compared to the existing relation-based methods that follow simplistic aggregation techniques of multi-teacher response/feature-based knowledge, we adopt the multi-head attention technique to provide flexibility towards localising and transferring important details from each teacher to better guide the student. We perform extensive evaluations on two widely used public datasets, KVASIR-V2 and Hyper-KVASIR, and our experimental results signify the merits of our proposed relation-based framework in achieving an improved lightweight model (only 51.8k trainable parameters) that can run in a resource-limited environment.

Introduction

Early detection of abnormalities in the gastrointestinal (GI) tract, such as precancerous polyps, is critical for patient outcomes. However, manual endoscopic screenings are subject to human error, with miss rates for neoplastic polyps reaching up to 26%. While deep learning, particularly Convolutional Neural Networks (CNNs), has shown promise in automating detection, most state-of-the-art models are computationally intensive. These "heavyweight" architectures require significant memory and processing power, making them unsuitable for low-resource clinical environments like portable tablets or wireless capsule endoscopes. This research addresses the need for lightweight yet accurate models through Knowledge Distillation (KD).

Methodology: Multi-Head Attention Knowledge Distillation

The core of this work is the application of Knowledge Distillation, where a large "teacher" model transfers its learned expertise to a smaller "student" model. The authors explore three KD paradigms: response-based (mimicking final predictions), feature-based (mimicking intermediate representations), and a novel relation-based approach.

The primary contribution is a multi-teacher relation-based framework utilizing a multi-head attention-based feature fusion mechanism. Unlike traditional methods that simply average teacher outputs, this mechanism identifies and fuses the most informative cues from multiple teachers (e.g., ResNet50 and ResNet101). By localizing important details in the teachers' feature maps, the attention mechanism provides superior guidance, allowing the student to capture complex non-linear relationships.

The proposed multi-head attention-based feature fusion mechanism for relation-based knowledge distillation.

The student architecture is an ultra-lightweight CNN comprising basic layers (Conv2d, BatchNorm, ReLU, MaxPool) and a final fully connected layer, totaling just 51,895 parameters.

Experimental Results

The framework was evaluated on two public datasets: KVASIR-V2 (7,200 images, 8 classes) and Hyper-KVASIR (10,662 images, 23 classes).

Model Efficiency

A key highlight is the extreme portability of the student model. As shown in the table below, the student model is approximately 448 times smaller than the ResNet50 teacher in terms of parameters.

Comparison of total parameters and model size across student and teacher architectures.

Performance Gains

Despite its small size, the student model achieves significant performance boosts through KD:

  • KVASIR-V2: The base student model's accuracy improved from 80.6% to 83.6% using the proposed KD_REL_T2 framework.
  • Hyper-KVASIR: Accuracy increased from 77.0% to 82.0% on this more complex, imbalanced dataset.

Qualitative analysis using Grad-CAM heatmaps further validated the approach, showing that KD-trained students focus more precisely on pathological regions (like polyp centers) rather than irrelevant image boundaries.

Conclusion and Future Work

This study demonstrates that a highly compressed model (~210 KB) can maintain diagnostic utility through sophisticated distillation techniques. The proposed multi-head attention mechanism effectively bridges the gap between lightweight architecture and high-performance requirements. Future work will focus on "online" distillation to reduce upfront training costs and developing class-aware loss functions to better handle the inherent class imbalances in medical datasets.

Summary updated

BibTeX
@misc{gammulle2023learning,
  author = {Harshala Gammulle and Yubo Chen and Sridha Sridharan and Travis Klein and Clinton Fookes},
  title = {{Learning Through Guidance: Knowledge Distillation for Endoscopic Image Classification}},
  year = {2023},
  eprint = {2308.08731},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2308.08731},
}
Figure