Abstract
Endoscopy is a critical tool for gastrointestinal diagnosis, yet video quality is frequently compromised by environmental artifacts such as motion blur, bubbles, and specular reflections. This paper presents a comprehensive, real-time deep learning framework designed to detect, assess, and restore corrupted endoscopy frames. By utilizing a YOLOv3-spp detector and specialized Conditional Generative Adversarial Networks (CGANs), the system assigns a location-aware Quality Score (QS) to each frame and restores mildly corrupted data. Experimental results demonstrate that this approach preserves 25% more usable video data than standard processing, significantly enhancing the feasibility of downstream tasks like video mosaicking.
Introduction
The gastrointestinal environment presents a significant challenge for computer vision. Endoscopic procedures are often plagued by a variety of artifacts: motion blur from camera movement, bubbles in fluids, specular reflections (glare) from wet tissue, and pixel saturation from intense light sources. These artifacts create "gaps" in video sequences, making automated tasks like video mosaicking—which requires high frame overlap—nearly impossible.
Most existing solutions focus on single artifact types and typically discard corrupted frames. This framework proposes a shift from simple rejection to a "detect-assess-restore" paradigm, ensuring temporal smoothness and maximizing the clinical utility of the captured video.
Methods
The proposed framework operates in three distinct stages: detection, quality assessment, and restoration.
Detection and Quality Assessment
The system employs YOLOv3-spp to identify six artifact classes: blur, bubbles, specularity, saturation, contrast, and miscellaneous artifacts. Following detection, a Quality Score (QS) is calculated. Unlike generic noise metrics, the QS is clinically informed, weighting artifacts based on their type, total area, and proximity to the center of the frame, where diagnostic information is most critical.
Restoration Module
Frames are categorized based on their QS. High-quality frames are kept, severely corrupted frames are discarded, and mildly corrupted frames are sent to specialized Conditional GANs (CGANs) for restoration:
- Blur: Sharpened using a CGAN with high-frequency edge-based loss.
- Saturation/Contrast: Restored via CGAN combined with a Color Transfer Technique (CRT) to maintain tissue color fidelity.
- Bubbles/Specularity: Addressed through inpainting, where the network fills obscured regions using surrounding contextual information.
Results and Discussion
The framework achieves a processing speed of 88ms per frame, enabling real-time clinical application. The detector reached a mean Average Precision (mAP) of 49.0. Most importantly, the pipeline increased frame retention to 68.7% across test videos—a 25% improvement over raw video processing.
While the restoration of saturation and contrast visually improves frames, clinical experts noted a potential loss of 3D textural information, which is vital for depth perception. Future work will focus on expanding the dataset beyond the initial 1,290 annotated images and exploring end-to-end training to further optimize the modular pipeline.
Conclusion
By prioritizing restoration over rejection, this deep learning framework provides a robust solution for managing the inherent noise of endoscopy. The integration of artifact-specific GANs and a location-aware quality metric ensures that more clinical data is preserved for both human review and automated diagnostic analysis.
Summary updated