alphaFeedback

WorksComputer Science

Annotation-Free Representation Learning for Polyp Retrieval in Colonoscopy Videos

AI contributions
  • Claude
View details
Ancillary data
1 code link
View

Abstract

Colonoscopy is inherently comparative: reliable visual assessment of polyps often depends on complementary views acquired under different viewpoints and imaging conditions. Retrieving such views requires polyp tracklet representations, which recent contrastive methods learn from temporal cues but still build from manually annotated bounding boxes. We propose an annotation-free framework that constructs tracklet views directly from raw colonoscopy videos, enabling temporal self-supervised learning on full-procedure videos, including frames without visible polyps. On REAL-Colon, our method achieves state-of-the-art results on tracklet retrieval and re-identification, outperforming both self-supervised and supervised baselines. We then introduce few-shot polyp retrieval, a task closer to clinical use, where a few observations of a target polyp are used to retrieve its remaining tracklets: with only two examples, our method surpasses most competing methods given ten. Finally, we show that a modest number of unlabeled procedures suffices for competitive performance, making on-site model development more practical. Code is available at https://github.com/lparolari/freerep.

Introduction

Colonoscopy is the gold standard for the prevention and early detection of colorectal cancer [1]. Deep learning increasingly supports it through computer-aided polyp detection [2] and characterization [3]. Polyp retrieval aims to recover additional views of a target lesion from colonoscopy videos, starting from one or a few observations. Aggregating information across these complementary views could support polyp characterization and facilitate lesion assessment and reporting during post-procedure review [4, 5]. However, learning representations of polyp tracklets—sequences of consecutive detections of the same polyp—is challenging: different polyps may look similar, while the same polyp may vary substantially in appearance over time [6]. Representations must therefore be robust to appearance changes while remaining discriminative across polyps.

Supervised contrastive learning on polyp entity annotations, i.e., labels linking observations of the same polyp, yields strong tracklet representations [7]. Yet, such labels are costly to collect, as they require expert clinicians. Temporal self-supervised methods reduce this cost by deriving positive pairs from temporal continuity: by splitting tracklets into temporal segments [8, 9], by integrating textual reports through momentum contrast [10], or by sampling pseudo-positives among temporally close tracklets of the same procedure [11].

These approaches nevertheless rely on ground-truth bounding boxes to construct polyp-centered training inputs, providing explicit spatial supervision during representation learning. Such annotations are costly and time-consuming to obtain. They also restrict training to annotated polyp observations, excluding the large majority of each procedure, namely frames without visible polyps, which still carry useful information about normal colonic appearance.

In this work, we learn polyp tracklet representations directly from raw colonoscopy videos, without bounding boxes or polyp identity labels. Since tracklets can no longer be polyp-centered, we redefine them as sequences of consecutive frames. However, our experiments show that global frame-level views underperform because of the lack of locality. Therefore, we adopt a temporally consistent random cropping strategy that restores locality without annotations. This enables temporal self-supervision on full-procedure videos and yields state-of-the-art results on REAL-Colon for tracklet retrieval and re-identification. We then introduce few-shot polyp retrieval, which retrieves the remaining tracklets of a lesion from a few examples, as in post-procedure review. With only two support tracklets, our method outperforms most baselines that use ten.

Our contributions are: (i) an annotation-free framework that achieves state-of-the-art results by learning directly from raw full-procedure videos; (ii) a novel few-shot polyp retrieval protocol; (iii) analyses of the trade-off between spatial supervision and data scale, and of cross-cohort robustness.

Annotation-Free Representation Learning Framework

We train a visual encoder by contrastive learning without the two sources of supervision of polyp-centric settings: ground-truth polyp detections and polyp entity annotations. Temporally consistent crops of raw frames recover the locality of polyp-centered views (§ 2.1), extending training to full-procedure videos, including frames without visible polyps (§ 2.2). Pseudo-positive associations derived from temporal proximity within each video replace polyp entity labels (§ 2.3), enabling annotation-free representation learning.

Annotation-Free Tracklet Views

Polyp-centric frameworks build each training sample from ground-truth polyp detections. Without them, we redefine a tracklet as a short sequence of consecutive frames from the same video, whether or not a polyp is visible.

The most direct view is then a sequence of full frames, which removes the spatial prior that focused the encoder on the polyp. However, this full-frame baseline loses 15% (relative) with respect to the crop-based state-of-the-art trained with ground-truth detections. Full frames shift the visual domain toward global endoscopic views with large background regions, instruments, specular highlights, and blur.

We therefore keep local views but sample them without detections: a random crop is drawn once per tracklet and applied to all its frames, preserving spatial coherence. This yields a 27% relative improvement over full frames, surpasses the crop-based state-of-the-art by 8%, and performs comparably to a synthetic box crop based on dataset-level bounding-box statistics, which, unlike ours, requires annotations (Table 2).

Training setupTracklet RetrievalTracklet ReID
Annot.LossViewsFullmAPHR@1AUROCAUPR
ID+BoxSupConBBox×\times57.5284.2494.3343.81
BoxNoise-Aw.BBox✓\checkmark61.4991.1793.8951.78
StatsNoise-Aw.Synth.✓\checkmark65.6091.7195.1457.72
–Noise-Aw.Frame✓\checkmark52.2784.1089.2443.74
–SupConCrop✓\checkmark64.3189.5494.9749.83
–Noise-Aw.Crop✓\checkmark66.4792.8095.0354.91

Table 2. Ablation toward annotation-free training. Annot.: polyp identities and boxes (ID+Box), boxes (Box), box statistics (Stats), or none (–); Loss: supervised contrastive (SupCon) or noise-aware (Noise-Aw.); Views: ground-truth box crops (BBox), synthetic box crops (Synth.), full frames (Frame), or random crops (Crop); Full: full-procedure training. Gray: annotation-dependent; bold: best annotation-free.

Full-Procedure Training

Since views no longer depend on detections, training is not confined to annotated polyp tracklets and extends to raw full-procedure videos, including the mucosal patterns, lumen views, and other colonoscopy-specific content that polyp-centric methods discard.

We build the training set from REAL-Colon, which contains 60 full-procedure videos from four acquisition cohorts. We follow the split of [11], but retain the full content of its 27 training videos with polyps and add the 14 videos without visible polyps that it omitted. The resulting 41-video training set, a superset of the previously used annotated data, contains 1,725,537 frames, of which only 171,957 (approximately 10%) show at least one polyp.

Temporal Self-Supervision

We optimize the tracklet encoder with the temporal self-supervised framework of [11], which derives pseudo-positive associations from the temporal structure of colonoscopy videos rather than from polyp identity labels. We leave the objective unchanged and modify only its input domain: tracklets are no longer required to contain a polyp, which allows training on full-procedure videos.

Formally, each training tracklet xix_i has a source video viv_i and a temporal position pip_i. For an anchor aia_i, the candidate pseudo-positives are the tracklets of the same video (vj=viv_j = v_i), ranked by temporal distance. We sample κ\kappa of them without replacement from an exponential distribution over ranks with temperature τ\tau, obtaining a bag Bi={bik}k=1κB_i = \{b_{ik}\}_{k=1}^{\kappa}; a curriculum increases τ\tau in training, from close to broader context.

We minimize the noise-aware contrastive loss [11]:

L=−∑ilog⁡∑kes(zik,yi)∑kes(zik,yi)+∑j≠i∑kes(zik,yj)\mathcal{L} = - \sum_i \log\frac{\sum_k e^{s(z_{ik},y_i)}}{\sum_k e^{s(z_{ik},y_i)} + \sum_{j \ne i} \sum_k e^{s(z_{ik},y_j)}}

where yi=fθ(ai)y_i = f_\theta(a_i) and zik=fθ(bik)z_{ik} = f_\theta(b_{ik}) are the encoder representations of the anchor and of the kk-th element of its bag, and s(⋅,⋅)s(\cdot,\cdot) is a similarity function. Summing over the bag lets the model weight the most relevant pseudo-positives instead of forcing all temporal neighbors to match the anchor equally.

Experimental Results

Dataset and Downstream Setup

We use REAL-Colon [19], which contains 60 full-procedure colonoscopy videos from four acquisition cohorts recorded at six clinical centers on three continents with equipment from two manufacturers. We follow the setup of [11]. Training uses 41 videos without any annotation (§ 2.2); evaluation uses the 19-video test set (47 polyps), which contains only tracklets with visible polyps.

Tracklet retrieval and ReID Following [11], each test tracklet is used in turn as a query, and the remaining tracklets are ranked by the cosine similarity of their embeddings to it; we report mAP and HR@1, the fraction of queries whose top-ranked tracklet depicts the same polyp. For re-identification, the cosine similarity of each tracklet pair is thresholded to separate same-polyp from different-polyp pairs, and performance is summarized by AUROC and AUPR.

Few-shot polyp retrieval Tracklet retrieval treats each tracklet as an independent query, whereas in clinical review an expert may hold one or a few observations of a polyp and search for its other appearances. We therefore retrieve at the polyp level: for each target polyp, we randomly sample a support set S={s1,…,sK}S = \{s_1, \ldots, s_K\} of K∈{1,2,3,5,10}K \in\{1, 2, 3, 5, 10\} of its tracklets and rank each gallery tracklet g∈Gg \in\mathcal{G} by sim⁡(g,S)=max⁡si∈Scos⁡(fθ(g),fθ(si))\operatorname{sim}(g,S) = \max_{s_i \in S} \cos(f_\theta(g), f_\theta(s_i)), keeping the support tracklets as separate exemplars. Random sampling models an average review scenario rather than a curated selection; we repeat it R=50R = 50 times and report the mean mAP.

MethodParams (M)FLOPs (G)Tracklet Retrieval mAP (↑)Tracklet Retrieval HR@1 (↑)Tracklet ReID AUROC (↑)Tracklet ReID AUPR (↑)Few-Shot Polyp Retrieval K=1K=1Few-Shot Polyp Retrieval K=2K=2Few-Shot Polyp Retrieval K=3K=3Few-Shot Polyp Retrieval K=5K=5Few-Shot Polyp Retrieval K=10K=10
General Purpose FM
DinoV2-S/14 [12]22.144.247.3189.8180.0729.7747.9157.0462.7365.6472.57
DinoV2-g/14 [12]1136233148.2990.3578.2327.0448.0857.2062.4066.4672.13
DinoV3-S/16 [13]21.634.748.9588.9980.4731.7747.6057.3662.9566.8076.59
V-JEPA2 [14]326.0272.129.0170.7969.8417.1422.2928.4632.7033.3839.93
Endoscopy FM
EndoFM [15]121.3190.145.7587.6479.7131.9145.1256.2861.8065.4673.03
EndoFM-LV [16]121.3190.128.2163.1867.5619.2822.5428.2228.9230.9538.22
EndoViT [17]86.6134.931.1268.3468.2617.5128.1835.6038.6840.7747.77
SurgeNet [18]24.331.044.7585.8775.8625.2347.1458.2563.3768.1875.87
Fully supervised
Sup [7]25.633.154.7281.9393.8541.5850.6055.7558.2359.6063.22
TA [7]25.633.157.5284.2494.3343.8153.1257.9460.4962.3368.52
Weakly supervised
MVE [8]25.633.142.0581.2579.7327.4748.4156.2558.4760.5865.89
TPC [9]25.633.143.2575.8278.4027.5851.1559.4663.0065.5169.90
NTSSL [11]25.633.161.4991.1793.8951.7859.2467.6471.3674.6981.34
Self-supervised
MVE [8]25.633.146.2280.4389.7431.9344.6951.6754.0354.6259.30
TPC [9]25.633.149.9484.6591.6035.6646.9654.7357.4958.7962.83
Ours25.633.166.4792.8095.0354.9163.4673.1075.5878.8085.72

Table 1. Comparison with State-of-the-Art: our approach outperforms self-supervised, weakly supervised, and fully supervised baselines. Bold: best; underline: second best.

Implementation Details

The tracklet encoder follows prior work [8, 9, 7, 11]: an ImageNet-pretrained ResNet-50 [20] extracts frame features, which a three-layer transformer encoder (8 heads, dmodel=256d_{\mathrm{model}} = 256) aggregates and a two-layer MLP (256→128256 \to128) projects for contrastive learning. We use κ=4\kappa= 4 and a batch size of 60. The curriculum schedules τ\tau in the exponential distribution from τmin⁡=0.3\tau_{\min} = 0.3 to τmax⁡=12\tau_{\max} = 12, using a cosine scheduler [11]. Videos are temporally subsampled by a factor of four, and a tracklet spans L=8L = 8 subsampled frames (about one second); views are random resized crops (scale range (0.08, 1), 232×232232 \times232 pixels) sampled once per tracklet, with no further augmentation. We train for 25 epochs with AdamW (learning rate 10−510^{-5}, weight decay 10−410^{-4}) on a single NVIDIA A100 GPU. At test time, as in [9, 7, 11], tracklets are built by linking ground-truth detections with an IoU of at least 0.1, each enlarged to 5×5\times the bounding-box diagonal.

Comparison with State-of-the-Art

Tab. 1 compares our approach with the state-of-the-art. Self-supervised baselines are re-trained on our training set, while weakly and fully supervised baselines use its annotated subset. Our framework outperforms previous self-supervised approaches by 33.10% in retrieval mAP and by 3.74% and 53.98% in ReID AUROC and AUPR (relative). MVE [8] and TPC [9] draw positive views from distinct segments of a tracklet, presuming a polyp that stays visible throughout, which rarely holds for generic frame sequences.

Our method also surpasses NTSSL [11], a weakly supervised method that shares our objective but relies on bounding boxes, and the fully supervised baselines on all metrics; against TA [7], our method slightly improves AUROC and improves AUPR by 25.34%, i.e., with fewer false positives. Foundation models give strong generic features but are not optimized for the temporal, low-semantics structure of colonoscopy; endoscopy-specific ones rarely beat general-purpose ones, consistent with their smaller scale and surgical training data.

Few-shot polyp retrieval All methods benefit from additional support observations, confirming that single views of a polyp are ambiguous. Moving from K=1K = 1 to K=2K = 2 raises our mAP from 63.46 to 73.10, already exceeds the K=10K = 10 performance of nearly all baselines; the only exceptions are DinoV3-S/16, SurgeNet, and NTSSL, which uses ground-truth boxes during training. With K=10K = 10, our method reaches 85.72 mAP.

Supervision vs. Scaling

We next ask how much unlabeled full-procedure video is needed to offset the removal of spatial supervision. We train on nested subsets of the 41-video training split (4, 8, 16, 24, 32, and 41 videos), with five independent subsets per size to average out the choice of videos. Fig. 1 compares the results with NTSSL [11], which uses ground-truth boxes on the full training set.

Performance grows steadily with the number of videos: the annotation-free model matches NTSSL at around 24 videos on retrieval and AUPR, and at 32 videos on AUROC, and keeps improving up to the full 41-video set. In line with scaling results on natural images [21], more unlabeled videos can thus be more effective than fewer spatially annotated polyp observations. This break-even point is specific to REAL-Colon and should not be read as a universal threshold.

Scaling of annotation-free training with the number of training videos

Figure 1. Scaling of annotation-free training with the number of training videos (nested subsets; shaded band: ± std over five subsets per size). Dashed lines: NTSSL [11]. The break-even point is reached between 24 and 32 videos, depending on the metric, and performance keeps improving up to 41 videos.

Robustness to Cohort Removal

We assess robustness to unseen acquisition domains by re-training our model from scratch with each of the four REAL-Colon cohorts withheld in turn (leave-one-cohort-out, LOCO) and evaluating it on the unchanged test set. As a matched control, we use the 32-video random subsets of § 3.4, which remove a comparable amount of data drawn from all cohorts.

In Figure 2, LOCO averages 62.90 mAP, above NTSSL (61.49), which uses ground-truth boxes and every cohort, and close to the control (64.11). Re-identification is slightly more sensitive (92.32 against 93.95 AUROC for the control). Withholding a cohort thus costs about as much as removing the same amount of data, and in mAP it still surpasses NTSSL trained on all cohorts, suggesting resilience to cohort removal.

Robustness to cohort removal

Figure 2. Robustness to cohort removal: random subsets (five 32-video subsets drawn from all cohorts) against leave-one-cohort-out (LOCO) training. Differences between the two protocols are not significant (Welch’s tt-test, pp-values below each panel), indicating no large effect of removing a cohort.

Ablation Study

Table 2 traces the path from polyp-centric supervised learning to our annotation-free setting. Replacing identity labels with temporal self-supervision and the noise-aware loss raises retrieval mAP from 57.52 to 61.49 and ReID AUPR from 43.81 to 51.78, showing that temporal associations are an effective supervisory signal when their noise is addressed. Switching to random crops on full-procedure videos with the same loss improves every metric further, reaching 66.47 mAP and 54.91

AUPR. A supervised contrastive loss over the same temporal bags remains competitive (64.31 mAP), so the temporal sampling itself provides useful structure, but it lowers HR@1 and AUPR. Full frames perform worst on every metric, while synthetic boxes, which rely on annotation statistics, trade lower retrieval scores for higher ReID AUPR.

Conclusion

We presented an annotation-free framework that learns polyp tracklet representations from raw full-procedure colonoscopy videos. Without bounding-box or identity annotations, it achieves state-of-the-art results on REAL-Colon for tracklet retrieval, re-identification, and few-shot polyp retrieval, using only a modest number of unlabeled procedures. Validation is currently confined to REAL-Colon; although it spans six centers on three continents and two manufacturers, it is the only public full-procedure dataset with persistent polyp identities, and we hope new datasets will enable broader validation.

Declarations

Ethics. This retrospective study uses open-access human subject data from REAL-Colon [19]; ethical approval was not required, as confirmed by the data license.

Competing interests. C.B. is affiliated with Cosmo Intelligent Medical Devices, developer of the GI Genius device.

Acknowledgments. We acknowledge ISCRA for awarding this project access to the LEONARDO supercomputer, owned by the EuroHPC Joint Undertaking, hosted by CINECA (Italy).

AI disclosure. Claude (Anthropic) was used to improve the writing and to prepare the charts; the authors reviewed and take responsibility for all content.

References

  1. [1]Cesare Hassan, Marco Spadaccini, Andrea Iannone, et al., “Performance of artificial intelligence in colonoscopy for adenoma and polyp detection: A systematic review and meta-analysis,” Gastrointest. Endosc., vol. 93, no. 1, pp. 77–85, 2021.DOI
  2. [2]Jason A. Dominitz, Andrew J. Gawron, Grace B. Mc-Kee, et al., “Impact of availability of computer-aided detection devices on adenoma detection during colonoscopy: A cluster randomized study,” Gastroenterology, vol. 171, no. 5, pp. 870–884, 2026.DOI
  3. [3]Cesare Hassan, Tommy Rizkala, Yuichi Mori, et al., “Computer-aided diagnosis for the resect-and-discard strategy for colorectal polyps: A systematic review and meta-analysis,” Lancet Gastroenterol. Hepatol., vol. 9, no. 11, pp. 1010–1019, 2024.
  4. [4]Tatsushi Naito, Takuto Nosaka, Tomoko Tanaka, et al., “Usefulness of an artificial intelligence-based colonoscopy report generation support system,” Clin. Endosc., vol. 58, no. 2, pp. 327–330, 2025.DOI
  5. [5]Qingzhong Chen, Shilun Cai, Crystal Cai, et al., “Colo-SCRL: Self-supervised contrastive representation learning for colonoscopic video retrieval,” in IEEE Int. Conf. Multimedia Expo (ICME), 2023, pp. 1056–1061.arxiv.org/abs/2303.15671
  6. [6]Samuel Gussman-Toh, Wei-Chung Cheng, et al., “Assessing AI polyp detection delay using tracklets,” in IEEE Int. Symp. Biomed. Imaging (ISBI), 2026, pp. 1–4.
  7. [7]Luca Parolari, Andrea Cherubini, Lamberto Ballan, et al., “Temporally-aware supervised contrastive learning for polyp counting in colonoscopy,” in Med. Image Comput. Comput. Assist. Interv. (MICCAI), 2025.
  8. [8]Yotam Intrator, Natalie Aizenberg, Amir Livne, et al., “Self-supervised polyp re-identification in colonoscopy,” in Med. Image Comput. Comput. Assist. Interv. (MICCAI), 2023, pp. 590–600.DOI
  9. [9]Luca Parolari, Andrea Cherubini, Lamberto Ballan, et al., “Towards polyp counting in full-procedure colonoscopy videos,” in IEEE Int. Symp. Biomed. Imaging (ISBI), 2025, pp. 1–5.arxiv.org/abs/2502.10054
  10. [10]Suncheng Xiang, Cang Liu, et al., “VT-ReID: Learning discriminative visual-text representation for polyp re-identification,” in IEEE Int. Conf. Acoust., Speech Signal Process. (ICASSP), 2024, pp. 3170–3174.DOI
  11. [11]Luca Parolari, Pietro Gori, Lamberto Ballan, et al., “Contrastive learning under noisy temporal self-supervision for colonoscopy videos,” in Med. Image Comput. Comput. Assist. Interv. (MICCAI), 2026.arxiv.org/abs/2605.12320
  12. [12]Maxime Ouab, Timothée Darcet, Théo Moutakanni, et al., “DINOv2: Learning robust visual features without supervision,” TMLR, vol. 2024, 2024.
  13. [13]Oriane Siméoni, Huy V. Vo, Maximilian Seitzer, et al., “DINOv3,” arXiv preprint arXiv:2508.10104, 2025.arxiv.org/abs/2508.10104
  14. [14]Mido Assran, Adrien Bardes, David Fan, et al., “V-JEPA 2: Self-supervised video models enable understanding, prediction and planning,” arXiv preprint arXiv:2506.09985, 2025.arxiv.org/abs/2506.09985
  15. [15]Zhao Wang, Chang Liu, Shaoting Zhang, et al., “Foundation model for endoscopy video analysis via large-scale self-supervised pre-train,” in Med. Image Comput. Comput. Assist. Interv. (MICCAI), 2023, pp. 101–111.arxiv.org/abs/2306.16741
  16. [16]Zhao Wang, Chang Liu, et al., “Improving foundation model for endoscopy video analysis via representation learning on long sequences,” IEEE J. Biomed. Health Inform., vol. 29, no. 5, pp. 3526–3536, 2025.DOI
  17. [17]Dominik Batic, Felix Holm, Ege Özsoy, et al., “EndoViT: Pretraining vision transformers on a large collection of endoscopic images,” Int. J. Comput. Assist. Radiol. Surg., vol. 19, no. 6, pp. 1085–1091, 2024.DOI
  18. [18]Tim J. M. Jaspers, Ronald L. P. D. de Jong, Yiping Li, et al., “Scaling up self-supervised learning for improved surgical foundation models,” Med. Image Anal., vol. 108, pp. 103873, 2026.DOI
  19. [19]Carlo Biffi, Giulio Antonelli, et al., “REAL-Colon: A dataset for developing real-world AI applications in colonoscopy,” Sci. Data, vol. 11, no. 1, pp. 539, 2024.arxiv.org/abs/2403.02163
  20. [20]Kaiming He, Xiangyu Zhang, Shaoqing Ren, et al., “Deep residual learning for image recognition,” in IEEE/CVF Conf. Comput. Vis. Pattern Recognit. (CVPR), 2016, pp. 770–778.arxiv.org/abs/1512.03385
  21. [21]Xiaohua Zhai, Alexander Kolesnikov, et al., “Scaling vision transformers,” in IEEE/CVF Conf. Comput. Vis. Pattern Recognit. (CVPR), 2022, pp. 1204–1213.arxiv.org/abs/2106.04560

Paper details

vlnc:W_apyk9q4r
v1 · latestHistory (1)

published · Fresh — added to the Hub within the last 30 days

added ·

Usage

views · 0

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

CC BY 4.0

Original source

  • Computer Science

Claude · View statement →

Looking for related papers…
Contents