The Differentiable Lens: Compound Lens Search over Glass Surfaces and Materials for Object Detection

Geoffroi Côté, Fahim Mannan, Simon Thibault, Jean-François Lalonde, Felix Heide

Abstract

Most camera lens systems are designed in isolation, separately from downstream computer vision methods. Recently, joint optimization approaches that design lenses alongside other components of the image acquisition and processing pipeline -- notably, downstream neural networks -- have achieved improved imaging quality or better performance on vision tasks. However, these existing methods optimize only a subset of lens parameters and cannot optimize glass materials given their categorical nature. In this work, we develop a differentiable spherical lens simulation model that accurately captures geometrical aberrations. We propose an optimization strategy to address the challenges of lens design -- notorious for non-convex loss function landscapes and many manufacturing constraints -- that are exacerbated in joint optimization tasks. Specifically, we introduce quantized continuous glass variables to facilitate the optimization and selection of glass materials in an end-to-end design context, and couple this with carefully designed constraints to support manufacturability. In automotive object detection, we report improved detection performance over existing designs even when simplifying designs to two- or three-element lenses, despite significantly degrading the image quality.

Introduction

Traditionally, camera lenses are designed to minimize geometric aberrations, such as blur and distortion, to produce the sharpest possible images for human viewing. Computer vision models are then trained on the data captured by these "ideal" lenses. However, a lens optimized for human perception is not necessarily optimal for a neural network's specific task.

This research bridges the gap between optical engineering and computer vision by introducing a fully differentiable pipeline for designing compound lenses. By jointly training the lens parameters—including shapes, spacings, and specific glass materials—alongside an object detection network, the authors demonstrate that cameras can be custom-tailored for the "eyes" of AI.

Methodology: A Fully Differentiable Optical Pipeline

The core of this approach is a differentiable compound lens simulation model that integrates several critical components to ensure accuracy and manufacturability.

The end-to-end differentiable pipeline, integrating a lens design subtask with an object detection subtask.

Exact Ray Tracing and Glass Optimization

Unlike previous methods that relied on approximations, this model implements exact ray tracing using differentiable Snell’s Law operations. This allows gradients to flow from the object detection loss back through the entire optical system. To handle the categorical nature of glass materials (e.g., choosing between specific brands), the authors represent glass as continuous variables (refractive index and Abbe number) and "snap" them to the closest real-world materials from the Ohara glass catalog during the forward pass. A straight-through estimator is employed to maintain differentiability.

Constraints and Corrections

The model also incorporates ray aiming correction to accurately simulate lenses with heavy aberrations and enforces manufacturing constraints. These constraints ensure the resulting lenses have realistic thicknesses, avoid overlapping elements, and maintain functional focal lengths.

Experimental Results and Key Insights

The system was evaluated using the BDD100K dataset for automotive object detection, with cross-dataset validation on the Udacity Autonomous Driving Dataset.

The "Good Enough" Blur

A striking finding is that optimized lenses often produce images that appear blurrier to humans than traditional designs. The optimizer frequently sacrifices image quality in the corners of the frame to sharpen regions where objects are most likely to appear, resulting in higher Mean Average Precision (mAP) despite a worse average "spot size."

Comparison between (a) a baseline lens optimized for image sharpness and (b) the proposed lens optimized for object detection. The optimized lens shows improved detection performance despite higher blur in certain regions.

Performance Gains and Hardware Simplification

On the BDD100K dataset, a two-element "Doublet" lens optimized with this method achieved 32.0 AP, compared to 30.3 AP for a version optimized for traditional sharpness. Furthermore, the results suggest that joint optimization can reduce hardware complexity; a 3-element optimized lens can nearly match the performance of a traditional 4-element design, potentially leading to cheaper and lighter camera systems for autonomous vehicles.

Conclusion

This work demonstrates that end-to-end optimization of both lens geometry and materials can significantly enhance downstream vision tasks. While currently limited to spherical surfaces, this approach paves the way for task-specific optical designs that prioritize functional accuracy over traditional aesthetic sharpness. Future work will explore the integration of aspheric surfaces and more complex lens architectures.

Summary updated

BibTeX
@misc{cote2022differentiable,
  author = {Geoffroi Côté and Fahim Mannan and Simon Thibault and Jean-François Lalonde and Felix Heide},
  title = {{The Differentiable Lens: Compound Lens Search over Glass Surfaces and Materials for Object Detection}},
  year = {2022},
  eprint = {2212.04441},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2212.04441},
}
Figure