Contrastive Learning under Noisy Temporal Self-Supervision for Colonoscopy Videos

Luca Parolari, Pietro Gori, Lamberto Ballan, Carlo Biffi, Loic Le FolgocarXiv 2026

TL;DR

This paper introduces a self-supervised framework for learning robust visual representations of polyps from colonoscopy videos by exploiting the sequential nature of clinical workflows. By pairing a time-based curriculum learning strategy with a novel noise-aware contrastive loss, the method handles imperfect temporal associations and outperforms existing self-supervised and supervised baselines. Remarkably, using a lightweight encoder trained on just 27 videos, it matches or exceeds the performance of massive, general-purpose foundation models.

What Problem Does This Paper Address?

AI-assisted colonoscopy holds massive potential for improving colorectal cancer screening by helping clinicians detect, track, and characterize polyps. To do this effectively, deep learning models need to learn robust representations of polyp tracklets—sequences of consecutive video frames showing the same polyp.

Typically, training these models relies on supervised contrastive learning, which requires human experts to manually link tracklets belonging to the same polyp across an entire video. This annotation process is incredibly tedious, expensive, and demands specialized clinical expertise. While self-supervised learning (SSL) can bypass manual labeling, colonoscopy videos present a brutal visual environment: viewpoints shift rapidly, tissues deform, motion blur is common, and lighting varies wildly. Existing SSL methods often struggle to bridge the performance gap with their fully supervised counterparts.

Methods

The authors propose a novel framework that turns the natural, sequential structure of a colonoscopy procedure into a self-supervisory signal. During a typical procedure, an endoscopist inspects the colon, handles a polyp when encountered, and then moves on. Therefore, tracklets captured close together in time are highly likely to depict the same polyp.

Fig. 1: Our method. (Top) Tracklets detected in a colonoscopy video are used to derive the self-supervision and produce bags of tracklets for contrastive learn- ing. At the beginning of training (c ≈0), bags are constituted by temporally adjacent tracklets, yielding low-variation views that are likely to correspond to the same polyp. Later (c →1), bags progressively include more distant track- lets, increasing diversity but also the chance of incorrect associations. (Bottom) The model learns from within-bag associations while limiting noisy ones. In the example, the loss maximizes the similarity between tracklet 18, 15 and 21 while down-weighting the contribution of noisy associations such as tracklet 24.

The method consists of three core components:

  1. Rank-Based Bag Construction: For a given "anchor" tracklet, the model samples a "bag" of candidate positive tracklets from the same video. Instead of using a rigid time window, it ranks all other tracklets by temporal distance and samples from an exponential distribution over these ranks. This ensures a diverse mix of visual appearances while favoring temporally close tracklets.
  2. Curriculum Learning: Early in training, the model samples only the closest tracklets (low visual variation, high probability of being the same polyp). As training progresses, a cosine schedule relaxes the sampling distribution to include more distant tracklets, introducing greater appearance diversity but also more "noise" (incorrect associations).
  3. Noise-Aware Contrastive Loss: Because temporally close tracklets aren't guaranteed to be the same polyp (e.g., if two distinct polyps appear close together), the bags can be "impure." Standard contrastive losses (like SupCon) break down here because they treat all positives equally. The authors introduce a relaxed loss function requiring that at least one tracklet in the bag is highly similar to the anchor, allowing the model to safely ignore noisy, incorrect associations.

Datasets

The model was trained and evaluated using several open-access colonoscopy datasets:

  • REAL-Colon: Used for training (27 videos, 85 polyps) and evaluation of retrieval and re-identification (19 videos, 47 polyps).
  • SUN database & PolypSize: Combined with the REAL-Colon test set to evaluate polyp size estimation (totaling 161 videos, 189 polyps).
  • PolypsSet: Added alongside the other test sets to evaluate histology classification (totaling 195 videos, 210 polyps).

Key Insights and Ideas

  • Exploiting Procedural Structure: Instead of treating video frames as an unordered pool of images, leveraging the structured, sequential workflow of clinical procedures provides an incredibly strong implicit supervisory signal.
  • Embracing Noise via Mathematical Relaxation: Rather than trying to engineer a perfect, noise-free temporal window, the authors accept that data will be messy. By replacing strict contrastive constraints with a smooth log-sum-exp approximation of a max operator, the loss function inherently tolerates impure data bags.
  • Data Efficiency Over Brute Force: As shown in the curriculum analysis below, as the curriculum variable $c$ increases, the sampled rank expands and bag purity drops. Yet, the noise-aware loss handles this gracefully.
Fig. 2: (Left) Sampled rank throughout the curriculum. When c increases, higher ranks are sampled. (Right) Ratio of pure bags (i.e., bags containing only tracklets from the same polyp) throughout the curriculum.

Key Results

The authors evaluated their lightweight architecture against state-of-the-art fully supervised models, prior self-supervised methods, and massive foundation models across four downstream tasks: polyp retrieval, re-identification (ReID), size estimation, and histology classification.

Performance comparison against state-of-the-art methods.
  • Outperforming SSL Baselines: The proposed method achieved a 63.13% mAP on retrieval, representing a 23.69% relative improvement over prior self-supervised approaches.
  • Beating Fully Supervised Models: On histology classification, the method achieved 82.38% accuracy, significantly outperforming the best fully supervised baseline (73.29%).
  • David vs. Goliath: Despite being trained on only 27 videos, the lightweight model matched or exceeded the performance of massive general-purpose foundation models like DinoV2-giant (which has 1.1B parameters and is trained on 142 million images) across all downstream tasks, while using less than 3% of its parameters.

Limitations and Future Work

The primary limitation acknowledged in the paper is that the framework relies on ground-truth polyp detections to isolate and evaluate the representation learning stage. In a deployment scenario, it would need to be paired with an automated object detection and tracking system, meaning tracking errors or false positives could impact performance. The authors note that integrating this representation learning framework directly with upstream detection and tracking models is a promising direction for future work.

Summary updated

BibTeX
@misc{parolari2026contrastive,
  author = {Luca Parolari and Pietro Gori and Lamberto Ballan and Carlo Biffi and Loic Le Folgoc},
  title = {{Contrastive Learning under Noisy Temporal Self-Supervision for Colonoscopy Videos}},
  year = {2026},
  eprint = {2605.12320},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2605.12320},
}
Figure