ContraNeRF: Generalizable Neural Radiance Fields for Synthetic-to-real Novel View Synthesis via Contrastive Learning

Hao Yang, Lanqing Hong, Aoxue Li, Tianyang Hu, Zhenguo Li, Gim Hee Lee, Liwei Wang

Abstract

Generalizable Neural Radiance Fields (NeRFs) aim to synthesize novel views of unseen scenes in a single forward pass, typically relying on large-scale synthetic datasets for training. However, models trained on "perfect" synthetic data often fail to generalize to real-world environments due to noise, pose inaccuracies, and motion blur. This paper presents ContraNeRF, a framework that bridges the synthetic-to-real gap using geometry-aware feature extraction and a novel contrastive learning objective (GeoContrast). By enforcing geometric consistency across multiple views, ContraNeRF reduces artifacts and improves the accuracy of volume density predictions in complex real-world scenes.

Introduction

Neural Radiance Fields (NeRF) have revolutionized 3D scene representation, but standard implementations require extensive per-scene optimization. Generalizable NeRFs address this by learning to predict radiance and density from a set of sparse source images. To achieve this generalization, these models are often trained on massive synthetic datasets like 3D-FRONT, where ground-truth geometry and camera poses are perfect.

When these models are deployed on real-world data (e.g., ScanNet), they encounter a significant "synthetic-to-real" hurdle. Real-world data is inherently noisy. The authors identify a "sharp but wrong" phenomenon: models trained on synthetic data predict highly confident (sharp) volume densities that are geometrically inaccurate when applied to real-world scenes. This overconfidence leads to "floaters" and significant rendering artifacts. ContraNeRF is designed to mitigate these issues by regularizing the learning process through geometric consistency.

Methodology

ContraNeRF introduces two primary technical innovations to the generalizable NeRF pipeline to improve robustness and geometric accuracy.

1. Geometry-Aware Feature Extraction

Standard generalizable NeRFs often process input views in isolation. ContraNeRF utilizes cross-view attention to allow the model to "query" features from neighboring source views. By aggregating information across views before the rendering stage, the model can encode visibility information and geometric relationships directly into the feature representation. This collaborative feature extraction ensures that the model considers the 3D context of a point rather than relying solely on 2D appearance.

2. GeoContrast: Geometry-Aware Contrastive Learning

The core contribution of the paper is GeoContrast, a contrastive learning framework tailored for 3D geometry. The goal is to ensure that features representing the same 3D point across different views are similar (positive pairs), while features from different 3D points are distinct (negative pairs).

  • Geometric Constraints: Unlike standard 2D contrastive learning, GeoContrast uses the underlying 3D geometry to identify pairs, ensuring that the feature space is grounded in physical reality.
  • Weighted InfoNCE Loss: The authors implement a weighted loss function that prioritizes "hard" negative samples—points that are physically close to the true surface but do not lie on it. This forces the model to learn much finer geometric boundaries, preventing the "blurred" geometry often seen in other generalizable models.

Experimental Results

Synthetic-to-Real Generalization

The authors evaluated ContraNeRF by training it on the synthetic 3D-FRONT dataset and testing it on the real-world ScanNet dataset. ContraNeRF achieved a PSNR of 24.81, significantly outperforming the previous state-of-the-art, IBRNet (23.67). This result demonstrates that the contrastive regularization effectively prevents the model from overfitting to the noise-free characteristics of synthetic data.

Benchmark Performance

Beyond synthetic-to-real tasks, ContraNeRF was tested on standard computer vision benchmarks, including DTU and LLFF. Even when trained on real data, ContraNeRF outperformed existing models, suggesting that its geometry-aware features provide a universal benefit for novel view synthesis. Qualitative results show that ContraNeRF is particularly effective at preserving fine structural details, such as thin furniture legs and sharp table edges, which are often lost or distorted by baseline methods.

Discussion and Insights

  • Regularization via Consistency: The study highlights that contrastive learning acts as a powerful regularizer. By forcing "agreement" across multiple views, the model is discouraged from making overconfident predictions based on local, potentially noisy, textures.
  • Interpolation vs. Prediction: The authors observe that interpolation-based methods (blending colors from source images) are generally more robust to the domain gap than methods that attempt to predict colors from scratch. This is because the source images themselves already contain the correct real-world lighting and style.

Limitations and Future Work

While ContraNeRF significantly improves generalization, motion blur remains a challenge. Because the method relies on matching features across views, significant blur in the source images can degrade the quality of the GeoContrast matching. Future research may explore the integration of deblurring modules or blur-aware kernels to further enhance robustness for handheld consumer video captures.

Conclusion

ContraNeRF provides a robust solution to the synthetic-to-real generalization gap in NeRFs. By leveraging geometry-aware contrastive learning, the framework ensures that models trained on synthetic data remain accurate and reliable when faced with the complexities of the real world. This work moves the field closer to high-quality, instant 3D reconstruction from arbitrary image sets.

Summary updated

BibTeX
@inproceedings{yang2023contranerf,
  author = {Hao Yang and Lanqing Hong and Aoxue Li and Tianyang Hu and Zhenguo Li and Gim Hee Lee and Liwei Wang},
  title = {{ContraNeRF: Generalizable Neural Radiance Fields for Synthetic-to-real Novel View Synthesis via Contrastive Learning}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2023},
}
Figure