Temporal Context Framework for Endoscopy Artefact Segmentation and Detection

Haili Ye, Hanpei Miao, Jiang Liu, Dahan Wang, Heng LiEndocv@isbi 2022

Introduction

Endoscopy is a critical diagnostic tool for identifying gastrointestinal pathologies, including colon cancer. While deep learning has significantly advanced the automated identification of artifacts such as bubbles, specularity, and surgical instruments, most existing models operate on a single-frame basis. This "snapshot" approach often fails in clinical settings where motion blur or light saturation can obscure critical details in individual frames, leading to inconsistent or "vibrating" detections in video feeds.

To address this, researchers have developed a Temporal Context Framework that shifts endoscopy AI from isolated image analysis to processing continuous video sequences. By introducing a specialized Temporal Context Transformer (TCT), the framework leverages information from neighboring frames to "repair" errors and stabilize detections.

The Temporal Context Framework

The proposed framework is designed to be architecture-agnostic, allowing it to be integrated into various existing segmentation and detection models. The core component is the Temporal Context Transformer (TCT), which establishes correlations between features across a sequence of $L$ frames.

Overview of the Endoscopy Artefact Segmentation and Detection Models incorporating the TCT module.

Key Components of the TCT:

  1. Timing Code: Unlike standard Transformers that use positional encoding for sequences of words, the TCT utilizes a "timing code" based on the actual time difference between frames, helping the model understand chronological distance.
  2. Dual Attention Mechanisms: The TCT employs self-attention and cross-attention modules. The decoder specifically uses parallel modules for "feature compensation" (filling in missing information from blurry frames) and "contraction" (refining feature maps).
  3. Dual Task Support: The framework supports both segmentation (using a U-Net-like decoder with skip connections) and detection (feeding into a Feature Pyramid Network and detection heads like Faster R-CNN).

Experimental Results

The framework was evaluated using the EndoCV2022 challenge dataset, consisting of 24 endoscopic video sequences. The models were trained to identify five categories: nonmucosa, artefact, saturation, specularity, and bubbles.

Quantitative performance comparison showing improvements across multiple state-of-the-art models when using the TCT.

As shown in the results, the addition of the TCT led to consistent performance gains across various architectures:

  • Segmentation: For the U-Net baseline, the Dice coefficient improved significantly from 0.525 to 0.653. Similar gains were observed for DANet and PraNet.
  • Detection: For Faster R-CNN, the mean Average Precision ($mAP_{50}$) rose from 0.464 to 0.563. Improvements were also noted for Cascade R-CNN and Swin Transformer architectures.

Insights on Model Depth

Ablation studies revealed a "sweet spot" for model complexity. Using $N=2$ layers in the TCT provided optimal performance; increasing the depth to $N=3$ layers led to overfitting and a subsequent decrease in accuracy metrics.

Conclusion and Future Work

The Temporal Context Framework demonstrates that temporal continuity is a powerful tool for improving the robustness of endoscopy AI. By treating video as a sequence rather than a collection of independent images, the TCT effectively uses clearer neighboring frames to compensate for low-quality data in the current frame.

While the framework shows great promise, current limitations include high memory requirements—limiting training batch sizes—and increased computational overhead. Future research will focus on optimizing these models for real-time deployment in surgical suites and extending the framework to tasks like instrument tracking and surgical workflow recognition.

Summary updated

BibTeX
@inproceedings{ye2022temporal,
  author = {Haili Ye and Hanpei Miao and Jiang Liu and Dahan Wang and Heng Li},
  title = {{Temporal Context Framework for Endoscopy Artefact Segmentation and Detection}},
  booktitle = {Endocv@isbi},
  year = {2022},
}
Figure