Abstract
Automated endoscopy video analysis is a challenging task in medical computer vision, with the primary objective of assisting surgeons during procedures. The difficulty arises from the complexity of surgical scenes and the lack of a sufficient amount of annotated data. In recent years, large-scale pretraining has shown great success in natural language processing and computer vision communities. These approaches reduce the need for annotated data, which is always a concern in the medical domain. However, most works on endoscopic video understanding use models pretrained on natural images, creating a domain gap between pretraining and finetuning. In this work, we investigate the need for endoscopy domain-specific pretraining based on downstream objectives. To this end, we first collect Endo700k, the largest publicly available corpus of endoscopic images, extracted from nine public Minimally Invasive Surgery (MIS) datasets. Endo700k comprises more than 700,000 unannotated raw images. Next, we introduce EndoViT, an endoscopy pretrained Vision Transformer (ViT). Through ablations, we demonstrate that domain-specific pretraining is particularly beneficial for more complex downstream tasks, such as Action Triplet Detection, and less effective and even unnecessary for simpler tasks, such as Surgical Phase Recognition. We will release both our code and pretrained models upon acceptance to facilitate further research in this direction.
Introduction
In medical computer vision, pretraining on large-scale natural image datasets like ImageNet is the standard practice. However, the significant domain gap between natural images (e.g., animals, landscapes) and endoscopic surgical scenes (e.g., internal organs, surgical instruments) limits the effectiveness of this approach. Furthermore, annotated medical data is scarce and expensive to obtain. This research explores whether pretraining on a massive, domain-specific, but unlabeled dataset can bridge this gap and under what conditions such pretraining is most beneficial.
Methodology
The researchers introduced Endo700k, a comprehensive dataset of over 700,000 unique endoscopic images aggregated from nine public sources. Using this data, they developed EndoViT, a Vision Transformer pretrained via a Masked Image Modeling (MIM) strategy. Specifically, they utilized the Masked Autoencoder (MAE) framework, where the model learns to reconstruct 75% of an image that has been masked. This process encourages the model to learn the underlying spatial structures and visual patterns of the surgical domain without requiring manual labels.
The training was further optimized using layer-wise learning rate decay, Stochastic Weight Averaging (SWA), and frequent evaluation to ensure robust generalization.
Results and Discussion
The study evaluated EndoViT on two primary downstream tasks: Surgical Phase Recognition (on Cholec80) and Action Triplet Detection (on CholecT45).
A key finding is that the benefit of domain-specific pretraining depends heavily on task complexity. For Surgical Phase Recognition, a relatively simple task that relies on temporal sequences, ImageNet-pretrained models performed comparably to EndoViT (89.56% vs 89.37% in Stage 2). This suggests that for high-level temporal tasks, the specific visual domain of pretraining is less critical than the model's ability to capture long-term cues.
However, for Action Triplet Detection—identifying the instrument, the action, and the target tissue—EndoViT showed a clear advantage. As shown in the table below, EndoViT achieved a mean Average Precision (mAP) of 30.17%, significantly outperforming both ImageNet-pretrained Transformers and traditional ResNet architectures.
Furthermore, in "few-shot" scenarios with limited labeled data (e.g., only 2 training videos), EndoViT maintained a substantial lead, reaching 17.59% mAP compared to 12.22% for ImageNet-ViT and 10.88% for ResNet50. This makes domain-specific pretraining an essential tool for researchers working on rare procedures where data is at a premium.
Conclusion
Domain-specific pretraining for endoscopy is highly effective for complex, fine-grained visual tasks like Action Triplet Detection and is particularly valuable when labeled data is scarce. For simpler, high-level temporal tasks like Phase Recognition, the domain gap is less impactful. Future research will focus on incorporating temporal information into the pretraining phase through Video Masked Autoencoders to further enhance performance across all surgical analysis tasks.
Summary updated