CroCo: Self-Supervised Pre-training for 3D Vision Tasks by Cross-View Completion

Philippe Weinzaepfel, Vincent Leroy, Thomas Lucas, Romain Brégier, Yohann Cabon, Vaibhav Arora, Leonid Antsfeld, Boris Chidlovskii, Gabriela Csurka, Jérôme Revaud

TL;DR

CroCo (Cross-View Completion) is a self-supervised pre-training method that teaches models to reconstruct a heavily masked image by leveraging a second, unmasked view of the same scene. By shifting the focus from semantic "hallucination" to geometric reasoning, CroCo achieves state-of-the-art performance on 3D vision tasks like depth estimation and optical flow using a generic Transformer architecture.

What Problem Does This Paper Address?

Recent breakthroughs in self-supervised learning have been dominated by Masked Image Modeling (MIM), where a model learns by predicting missing patches of an image. While highly effective for high-level tasks like image classification, standard MIM (like MAE) often relies on "semantic priors"—for example, if an eye is masked, the model knows to put an eye there because it recognizes a face.

However, for 3D vision tasks—such as depth estimation, optical flow, or camera pose regression—semantic priors aren't enough. These tasks require a deep understanding of geometry and spatial relationships. In a single-view setup, reconstructing a masked wall is ambiguous; there's no geometric cue to tell the model exactly where a window or a corner should be. CroCo addresses this by introducing a second viewpoint, forcing the model to learn how to "match" features across views to solve the reconstruction puzzle.

Figure 1: Auto-completion vs. Cross-view completion tasks. Left: given a masked image, a model trained for auto-completion can only leverage the visible context to fill-in the blanks and thus relies mainly on high-level semantic information. Right: given an additional view of the same scene, cross-view completion makes precise reconstruction possible, assuming that the model is able to understand both the scene geometry and the spatial relationship between the two images.

Methods

The core of CroCo is the Cross-View Completion pretext task.

  1. Input: The model takes two images ($x_1$ and $x_2$) of the same scene from different viewpoints.
  2. Masking: A staggering 90% of the first image ($x_1$) is masked.
  3. Encoding: A Siamese Vision Transformer (ViT) encoder processes the visible patches of $x_1$ and the entirety of $x_2$ independently.
  4. Decoding: A decoder receives the encoded tokens from both images. The authors explored two architectures for fusion:
  5. CrossBlock: Alternates between self-attention on $x_1$ tokens and cross-attention between $x_1$ and $x_2$.
  6. CatBlock: Concatenates tokens from both views and applies self-attention across the joint set.
  7. Objective: The model is trained to minimize the Mean Squared Error (MSE) between the predicted and original pixels of the masked patches in $x_1$.
Figure 3: Overview of our CroCo model during pre-training. Patches from the first input image are partially masked; visible ones are encoded into their latent representations, then padded with masked tokens to account for hidden patches. The same encoder is used to encode the patches of the second image. The decoder receives the encoded tokens from both images and use them to reconstruct the masked parts of the first image.

What makes this "new" is the transition from a single-image reconstruction to a conditional reconstruction based on a second view. This setup implicitly forces the model to learn epipolar geometry and correspondence without any explicit supervision.

Datasets

  • Pre-training: The authors generated a massive synthetic dataset called Habitat, consisting of ~1.8 million image pairs. These were rendered using the Habitat simulator from 3D indoor datasets including HM3D, ScanNet, Replica, and ReplicaCAD.
  • Evaluation:
    • Monocular 3D: NYUv2 (depth estimation) and Taskonomy (8 different geometric tasks like surface normals and curvature).
  • Binocular/Geometric: MPI-Sintel (optical flow) and 7-scenes (absolute and relative camera pose).
  • Semantic: ADE20k (segmentation) and ImageNet-1K (classification) for comparison.

Key Insights and Ideas

  • Geometry over Semantics: Unlike MAE, which performs best when pre-trained on ImageNet, CroCo thrives on indoor scene datasets (Habitat). This suggests that for 3D tasks, the diversity of geometric structures is more important than the variety of object categories.
  • The 90% Masking Sweet Spot: A very high masking ratio is essential. It prevents the model from relying on local pixel correlations in the first image, forcing it to look at the reference image to find the missing information.
  • Implicit Correspondence: By learning to reconstruct $x_1$ from $x_2$, the model naturally learns to find corresponding points across views. This allows the exact same pre-trained architecture to be used for optical flow and relative pose estimation without adding task-specific "cost volumes" or complex geometric layers.
  • Solvability Matters: The authors found that pre-training works best when the two views have a "co-visibility" (overlap) of around 0.5. If the views overlap too much, the task is too easy; if they don't overlap at all, it becomes standard, ambiguous MIM.
Figure 2: Reconstruction examples from CroCo on scenes unseen during training. From top to bottom: reference image (input), masked image (input), CroCo output, original target image.

Key Results

  • Depth Estimation: On NYUv2, CroCo achieved an accuracy ($\delta_1$) of 85.6%, significantly outperforming a MAE model pre-trained on the same data (79.0%).
  • Taskonomy: CroCo ranked first or second on 6 out of 8 geometric tasks, showing superior transferability to dense 3D regression.
  • Optical Flow: Despite being a generic Transformer, CroCo achieved an Average Endpoint Error (AEPE) of 3.00 on Sintel (clean), which is competitive with specialized architectures like PWC-Net (2.55) that are specifically designed for flow.
  • Relative Pose: CroCo outperformed most existing methods that directly regress camera pose, proving its internal representations are highly sensitive to camera motion.

Limitations and Future Work

  • Semantic Trade-off: While CroCo is a beast at 3D tasks, it lags behind standard MIM models on high-level semantic tasks like ImageNet classification. The authors attribute this to the indoor-focused pre-training data.
  • Synthetic vs. Real: The current model relies heavily on synthetic data from the Habitat simulator. The authors suggest that future work should explore using real-world image pairs, perhaps sourced from Structure-from-Motion (SfM) pipelines.
  • Resolution: The model was primarily tested at $224 \times 224$ resolution. Scaling to higher resolutions for tasks like optical flow remains a challenge for future iterations.

Summary updated

BibTeX
@inproceedings{weinzaepfel2022croco,
  author = {Philippe Weinzaepfel and Vincent Leroy and Thomas Lucas and Romain Brégier and Yohann Cabon and Vaibhav Arora and Leonid Antsfeld and Boris Chidlovskii and Gabriela Csurka and Jérôme Revaud},
  title = {{CroCo: Self-Supervised Pre-training for 3D Vision Tasks by Cross-View Completion}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2022},
  url = {https://openreview.net/forum?id=wZEfHUM5ri},
}
Figure