TL;DR
EndoCIL is a novel class-incremental learning (CIL) framework designed specifically for endoscopic image classification. By combining a distribution-aligned exemplar replay strategy, a prior-regularized class-balanced loss, and classifier gradient calibration, it effectively overcomes catastrophic forgetting caused by severe domain shifts and clinical class imbalances.
What Problem Does This Paper Address?
In clinical settings, medical imaging AI cannot remain static; it must continuously adapt to new disease variants, emerging diagnostic technologies, and varying imaging modalities. Class-incremental learning (CIL) aims to let models learn new classes sequentially without forgetting old ones.
However, standard replay-based CIL methods fail miserably when applied to endoscopic images due to two main challenges:
- Domain Discrepancies: Endoscopic images from different devices exhibit massive variations in lighting, contrast, and color spaces. Standard replay methods select "average" representative images, which inadvertently discards critical edge-case samples.
- Dual-Phase Class Imbalance: Clinical data is inherently imbalanced (lesions are rare compared to healthy tissue). In a CIL setup, this creates intra-phase imbalance (skewed distributions within the current task) and inter-phase imbalance (the massive size difference between new task data and the tiny memory buffer allocated for old tasks). This dual imbalance heavily biases the model toward newly introduced classes.
Methods
The authors propose EndoCIL, a unified single-stage framework consisting of three core components:
- Maximum Mean Discrepancy Based Replay (MDBR): Instead of selecting exemplars based on feature means (which clusters samples tightly around a center and ignores distribution shape), MDBR uses a greedy selection strategy to minimize the Maximum Mean Discrepancy between the replay buffer and the original dataset. This ensures the buffer retains a diverse, distribution-aligned set of samples, including critical edge cases.
- Prior Regularized Class Balanced Loss (PRCBL): To combat class imbalance, PRCBL injects log prior statistics directly into the model's logits (logit adjustment) to bias predictions away from over-represented classes. It also scales the cross-entropy loss using weights derived from the "effective number of samples" to handle both intra- and inter-phase imbalances.
- Calibration of Fully-Connected Gradients (CFG): CFG dynamically adjusts the gradients in the final fully connected layer. By scaling down the classification gradients of new classes and balancing them against knowledge distillation gradients, it prevents the classifier from developing a strong bias toward newly seen data.
Datasets
The framework was validated on four prominent, publicly available endoscopic datasets, filtered to exclude classes with fewer than 100 images to ensure statistical reliability:
- Hyper-Kvasir: 16 filtered classes split into 5 sequential tasks.
- Gastrovision: 16 filtered classes split into 5 sequential tasks.
- Kvasir-Capsule: 10 filtered classes split into 5 sequential tasks.
- Capsule Vision: 9 filtered classes split into 4 sequential tasks.
Key Insights and Ideas
- The Danger of the "Mean" Exemplar: In natural images, saving the most "typical" samples (mean-based selection) works well. In endoscopy, domain shifts mean that edge cases are often where the vital diagnostic boundaries lie. Distribution alignment via MMD preserves these boundaries far better than mean clustering.
- Gradient Suffocation: An important ablation insight revealed that applying gradient calibration (CFG) directly to standard cross-entropy loss actually hurts performance. The gradients of new classes drop to zero too quickly (around epoch 40), causing underfitting. However, when paired with the prior-regularized loss (PRCBL), the gradients remain active and stable throughout training, unlocking the true potential of gradient calibration.
Key Results
EndoCIL was compared against a wide array of state-of-the-art CIL methods (including iCaRL, DER, FOSTER, and DGR) across buffer sizes of 30, 40, and 50 samples per class.
- Superior Accuracy: EndoCIL consistently ranked first or second across almost all evaluation metrics. For example, on the Hyper-Kvasir dataset with a buffer size of 30, EndoCIL achieved a final task accuracy ($Acc_{last}$) of 78.13%, outperforming the second-best method (FOSTER) by 1.57%.
- Mitigating Forgetting: It demonstrated exceptional stability, significantly reducing average forgetting ($AF$) compared to standard baselines. On Capsule Vision (buffer size 40), it achieved an $AF$ of just 12.22%, compared to iCaRL's 39.44%.
- Efficiency: Unlike top-performing alternatives like BiC or FOSTER, which require complex two-stage training sessions, EndoCIL achieves these results in a highly efficient, single-stage training pipeline.
Limitations and Future Work
While PRCBL significantly improves overall and historical class accuracy, the authors noted that it can slightly reduce the model's performance on newly introduced classes during their specific incremental phase compared to standard cross-entropy loss. Future work will focus on refining this balance to maximize plasticity for new tasks without sacrificing the stability of historical knowledge. Additionally, scaling the MMD kernel matrix computation to handle extremely large-scale datasets remains a computational bottleneck to address.
Summary updated