REVEAL: Representation-driven Endoscopic Visual Embedding Alignment for Latent Generation

1Eindhoven University of Technology 2Amsterdam University Medical Centers, University of Amsterdam

DCA-MI 2026 (ECCV Workshop)

Overview of the REVEAL framework, showing training, sampling, and feature extraction.

The REVEAL framework. Training (top) optimizes SiT blocks using joint denoising and feature alignment objectives. Feature extraction (bottom) yields high-dimensional patch descriptors for downstream analysis. Sampling (right) synthesizes images by traversing the learned reverse SiT trajectory.

Abstract

Developing foundation generative models for endoscopy is limited by the gap between natural and clinical images and the computational cost of training large Diffusion Transformers. Although representation alignment has improved efficiency in general computer vision, its role within the highly specialized endoscopic image space remains unclear. We introduce REVEAL (Representation-driven Endoscopic Visual Embedding Alignment), a foundation generative model trained on GastroNet-5M (GN-5M), a multicenter dataset of 5 million endoscopic frames.

Instead of depending on out-of-domain priors, REVEAL employs encoders pretrained directly on the endoscopic distribution to align diffusion latents with domain-specific visual features, preserving fine textures and intricate anatomical structures. Beyond image generation, REVEAL also serves as a powerful feature extractor; in multiple benchmarks, it delivers performance that is competitive with, and in several cases exceeds, endoscopic foundation models specifically tuned for classification tasks, while demonstrating strong representation robustness under realistic imaging corruptions.

REVEAL produces high-fidelity images and maintains robust structural coherence in latent-space edits such as inpainting and outpainting. This high-capacity backbone lowers the computational threshold for building specialized clinical tools, offering an open, versatile foundation for conditional synthesis, segmentation, and out-of-distribution detection in future intelligent gastroenterology systems. The code and model weights are publicly released.

REVEAL

REVEAL is a latent generative model that synthesizes high-fidelity endoscopic images by aligning the feature space of a Scalable Interpolant Transformer (SiT) with a specialized, pretrained vision encoder. The architecture operates within a compressed latent space, where an input image \(x\) is mapped to \(z = E(x)\) via a pretrained VAE encoder \(E\). The generative backbone is trained to reverse a stochastic interpolation process, while a Representation Alignment (REPA) strategy injects domain-specific knowledge into the student model by maximizing the cosine similarity between a pretrained teacher representation \(y_*\) and the student's hidden states \(h_t\).


Domain-Adapted Representation Alignment

Prevailing alignment strategies rely on general-purpose vision encoders trained on natural images, assuming that global semantic richness is the primary driver of synthesis quality. Endoscopic scenes, however, are characterized by subtle mucosal textures, specular reflections, and intricate anatomical morphologies, where global semantic labels provide insufficient signal. REVEAL instead grounds alignment in encoders pretrained directly on GN-5M, ensuring that the target representations are inherently aligned with the unique visual characteristics of endoscopic data.

To maximize the transfer of anatomical detail, REVEAL adopts the iREPA strategy, which introduces two refinements over standard REPA: a lightweight convolutional projection head that preserves the spatial relationships between adjacent patch tokens (instead of a point-wise MLP), and a spatial normalization layer applied to the teacher representations that increases the signal-to-noise ratio of local anatomical structures by trading off global information for spatial contrast.


Three Operational Modes

The integrated framework supports three primary operational modes. During training, the model jointly optimizes a denoising loss and the representation-alignment term. Once trained, the system enables high-fidelity sampling by traversing the learned reverse SiT trajectory to synthesize images from noise through the VAE decoder. Furthermore, the frozen SiT blocks serve as a robust feature extractor, yielding high-dimensional patch descriptors extracted from intermediate transformer layers at \(t{=}0\) that are suitable for downstream clinical tasks such as classification.


GastroNet-5M and Evaluation Datasets

REVEAL is pretrained on GN-5M, a large, multicenter dataset of 4,820,653 unlabeled endoscopic images collected from eight Dutch hospitals. Representation quality is evaluated via linear probing on two independent classification benchmarks: the public POLyp Artificial Recognition (POLAR) dataset, and a private Barrett's Esophagus neoplasia (BE) dataset enriched with subtle cases of early neoplasia. Robustness is further assessed on BE-C, a corrupted variant of the BE test set built from eight clinically realistic imaging corruptions (motion blur, defocus blur, overexposure, hue shift, saturation, contrast, sharpness, and brightness distortion) applied at randomized severities.

Results & Discussion

Component Analysis

We systematically evaluate the REVEAL architecture by disentangling the influence of latent space design, teacher representations, and model scaling on both generative and discriminative performance. VAE latent space selection shows that SD2's compact 4-channel bottleneck is more easily modulated by the SiT backbone than higher-dimensional alternatives, yielding superior fidelity at lower cost. Target representation ablations show that the domain-specific DINOv3-B (GN-5M) teacher outperforms all alternatives, including general-purpose SAM2, DINOv2, and DINOv3. Scaling the SiT backbone from Small to Large substantially reduces FID, and training on the full 5M-image dataset yields the largest single improvement across all metrics, with gains tapering after roughly 200k iterations.

Table 1 – Ablation of architectural components: latent spaces, target representations, and scaling factors, evaluated on image fidelity (FID) and downstream linear-probing accuracy (BE, POLAR). * trained on the full 5M-image set.
VAETarget Rep.Arch.Iters.FIDBEPOLAR
JiT-B/16150k28.10
SD2SiT-B/2150k13.550.8530.646
SD3SiT-B/2150k14.220.8710.646
FLUX.1-devSiT-B/2150k28.880.8410.642
FLUX.2-devSiT-B/2150k14.460.8240.638
SD2SAM2SiT-B/2150k10.980.8550.623
SD2DINOv2-BSiT-B/2150k10.510.8720.638
SD2DINOv3-BSiT-B/2150k10.780.8550.629
SD2DINOv2-B (GN-5M)SiT-B/2150k10.710.8600.653
SD2DINOv3-B (GN-5M)SiT-B/2150k10.180.8650.682
SD2DINOv3-B (GN-5M)SiT-S/2150k13.070.8630.682
SD2DINOv3-B (GN-5M)SiT-L/2150k9.330.8810.684
SD2DINOv3-B (GN-5M)SiT-L/2150k*5.430.9050.763
SD2DINOv3-B (GN-5M)SiT-L/2200k*5.370.9060.768
SD2DINOv3-B (GN-5M)SiT-L/2250k*5.320.9040.773

Classification Performance

We assess the semantic utility of REVEAL's features via linear probing on POLAR and BE. Despite being a generative model with no supervised signal, and operating on features from only the first 8 layers of a latent space compressed by a frozen, general-purpose SD2 VAE, REVEAL convincingly outperforms the endoscopy-specific EndoViT and Endo-FM foundation models, and surpasses all general-purpose encoders (SAM2, DINOv2, DINOv3) on both benchmarks. DINOv3 pretrained directly on GN-5M remains the strongest discriminative encoder overall.

Table 2 – Linear probing performance on downstream clinical benchmarks.
ModelArch.Resolution BEPOLAR
AUCAUPRCAUCAUPRC
SAM2ViT-B/161024 × 10240.5830.4630.6840.913
DINOv2ViT-B/14518 × 5180.7720.6730.6610.898
DINOv3ViT-B/16256 × 2560.7650.6950.7370.926
EndoViTViT-B/16224 × 2240.6290.4750.6320.892
Endo-FMViT-B/16224 × 2240.7640.6890.6830.908
DINOv2 (GN-5M)ViT-B/14336 × 3360.8180.7790.7900.948
DINOv3 (GN-5M)ViT-B/16256 × 2560.8350.7900.8080.947
REVEALSiT-L/2256 × 2560.7860.7280.7580.935

Robustness Performance

Under BE-C, the corrupted evaluation set, REVEAL again outperforms all general-purpose encoders and substantially surpasses the endoscopy-specific EndoViT and Endo-FM models, confirming that its representations encode clinically meaningful structure that generalizes under imaging artifacts. EndoViT in particular degrades catastrophically under corruption, despite being domain-specific. Since REVEAL is evaluated at the standard noise level \(t=0\), sampling features from intermediate diffusion timesteps — which naturally denoise corrupted inputs — is a promising direction for further robustness gains without any retraining.

Table 3 – Linear probing performance on the corrupted BE-C robustness benchmark.
ModelArch.ResolutionAUCAUPRC
SAM2ViT-B/161024 × 10240.5240.385
DINOv2ViT-B/14518 × 5180.7240.609
DINOv3ViT-B/16256 × 2560.7440.663
EndoViTViT-B/16224 × 2240.5240.400
Endo-FMViT-B/16224 × 2240.6920.588
DINOv2 (GN-5M)ViT-B/14336 × 3360.8100.774
DINOv3 (GN-5M)ViT-B/16256 × 2560.8140.771
REVEALSiT-L/2256 × 2560.7540.679

Qualitative Results

Unconditional samples from REVEAL (SiT-L/2), generated with a Heun solver using 50 function evaluations, capture the intricate light reflections and mucosal textures typical of the GN-5M distribution, with diversity across anatomical regions, lesion morphologies, and imaging conditions. As a spatial-robustness probe rather than a clinical benchmark, we additionally run inpainting and outpainting via resampling, following RePaint, without any architectural modification or task-specific finetuning. REVEAL reconstructs missing anatomical regions and extends the visible field of view while preserving structural continuity, indicating that alignment with a specialized teacher captures gastrointestinal morphology beyond the pixel level.

Unconditional samples generated by REVEAL, showing realistic mucosal texture and specular highlights.

Unconditional samples exhibit realistic mucosal texture and specular highlights.

Inpainting results reconstructing masked regions.

Inpainting reconstructs masked regions.

Outpainting results extending the field of view.

Outpainting extends the visible field of view.

Scaling & Future Work

REVEAL serves as a foundation generative model for endoscopy, trained at a massive multicenter scale that is typically inaccessible to most research groups. The architecture can be scaled along resolution — the SD2 VAE natively supports finer inputs — and model capacity, following the trends observed in the component analysis. The publicly released weights provide a strong initialization point for both directions, as well as for downstream clinical applications: conditional synthesis for targeted pathology generation and rare lesion augmentation, segmentation via generative features or Symmetrical Flow Matching, generative classifiers for diagnostic tasks, and out-of-distribution detection through likelihood estimation over the learned distribution.

BibTeX