Abstract
Modern computer vision often relies on the idealized pinhole camera model, which fails to account for the complex lens distortions and vignetting present in real-world optics. We present NeuroLens, a novel framework that utilizes Invertible Neural Networks (INNs) to model these phenomena. By leveraging the mathematical properties of i-ResNets, NeuroLens provides a flexible, differentiable, and reversible mapping between ideal and distorted coordinates. Our approach significantly improves the accuracy of camera calibration and 3D reconstruction, particularly for wide-angle and fisheye lenses, while enabling seamless integration into end-to-end optimization pipelines like Neural Radiance Fields (NeRF).
Introduction
In computer vision, the "pinhole camera model" is a convenient fiction. Real-world lenses introduce significant artifacts, primarily distortion (where straight lines appear curved) and vignetting (the gradual reduction of image brightness toward the periphery).
Existing solutions generally fall into two categories, both with inherent flaws:
- Parametric Models: These utilize fixed mathematical formulas, such as polynomials. While computationally efficient, they often fail to capture complex "mustache" or "barrel" distortions found in high-end or specialized wide-angle lenses.
- Non-Parametric Models: These map every pixel to a specific 3D ray. Although highly flexible, they are often over-parameterized, requiring massive amounts of calibration data and remaining prone to overfitting.
Furthermore, modern 3D reconstruction techniques like Neural Radiance Fields (NeRF) require differentiable models to allow gradients to pass through the lens parameters during scene optimization. Traditional calibration tools are rarely designed for such end-to-end integration.
Methodology
The core of our approach is NeuroLens, which employs an Invertible Residual Network (i-ResNet) to model the mapping between "ideal" pinhole coordinates and "distorted" sensor coordinates.
Invertible Architecture
Camera systems must function in two directions: projection (mapping a 3D point to a 2D pixel) and ray casting (shooting a ray from a pixel into the 3D world). By utilizing an INN, the model is mathematically guaranteed to be reversible and differentiable in both directions, ensuring consistency between these two operations.
Lipschitz Constraint and Regularization
To ensure the model remains a diffeomorphism—a smooth, bijective mapping—we enforce a Lipschitz constraint on the network weights. This acts as a powerful inductive bias, preventing the model from producing physically impossible or jagged distortions. This neural structure acts as a superior regularizer compared to traditional mathematical formulas, fitting complex curves while remaining resilient to noise in calibration data.
Joint Optimization and Calibration
We co-designed a new calibration board and a deep-learning-based keypoint detector (based on MobileNet-v3). Unlike standard grayscale checkerboards, our markers utilize color and specific patterns optimized for the detector. This achieves sub-pixel accuracy even under heavy blur or significant lens artifacts.
Experiments and Results
We evaluated NeuroLens across several synthetic and real-world datasets:
- SynLens: A new synthetic dataset featuring over 400 real-world lens profiles (Canon, Nikon, etc.) simulating realistic distortion and vignetting.
- Real-World Data: Challenging wide-angle and fisheye datasets from drones (UZH-FPV) and action cameras (GoPro).
Key Findings
- Superior Accuracy: On the SynLens benchmark, NeuroLens achieved a Root Mean Square (RMS) reprojection error of 0.072, nearly doubling the accuracy of the previous state-of-the-art (0.135).
- Robustness: On GoPro super-wide footage, NeuroLens outperformed standard OpenCV calibration, reducing RMS error from 1.50 to 1.46—a significant gain at sub-pixel scales.
- NeRF Integration: Adding NeuroLens to a NeRF pipeline allowed for the reconstruction of scenes from extremely distorted fisheye video, a scenario where standard NeRF implementations typically produce blurry artifacts or fail to converge.
Conclusion and Future Work
NeuroLens demonstrates that invertible neural networks provide a robust and flexible alternative to traditional lens modeling. While the model currently performs best with a "sane" initialization (such as an identity mapping), it offers unprecedented fidelity for complex optics. Future work will explore training the model on a broad prior of lens types, potentially allowing the system to estimate the distortion of a novel lens from a single uncalibrated image.
Summary updated