Differentiable Sensor Layouts for End-to-End Learning of Task-Specific Camera Parameters

Hendrik Sommerhoff, Shashank Agnihotri, Mohamed Saleh, Michael Moeller, Margret Keuper, Andreas Kolb

This paper, titled "Differentiable Sensor Layouts for End-to-End Learning of Task-Specific Camera Parameters," presents a novel approach to a fundamental but often overlooked aspect of computer vision: the physical arrangement of pixels on a camera sensor.

TL;DR

The authors introduce the first end-to-end differentiable pipeline that jointly optimizes a camera's pixel layout and a downstream neural network. By allowing the sensor to adapt its pixel density to the specific task—such as focusing more resolution on the horizon for autonomous driving—they achieve significant performance gains, particularly when operating under tight resolution budgets.

What Problem Does This Paper Address?

In standard computer vision, we almost always assume that images are captured on a uniform, rectangular grid of pixels. This "one-size-fits-all" approach treats every region of an image as equally important. However, in many real-world tasks, information is not distributed uniformly. For instance, in autonomous driving, the spatial frequency of objects near the horizon is much higher than that of the road directly in front of the car.

Furthermore, training deep learning models is often limited by GPU memory, forcing researchers to artificially downsample high-resolution images. This paper asks: if we have a limited "pixel budget," can we learn an optimal, non-uniform way to distribute those pixels to maximize the performance of a specific AI task?

Methods

The core contribution is a differentiable sensor simulation framework. Traditionally, the pixel layout is a fixed hardware choice. The authors turn this into a learnable parameter by:

  1. Analytic Parameterization: They define a bijective deformation function ($\phi$) that warps a standard uniform grid into a non-uniform one while preserving the grid's topology (neighboring pixels stay neighbors). They propose two specific shapes: curvilinear (circularly symmetric) and rectangular (independent horizontal and vertical warping).
  2. Differentiable Image Formation: They model the energy measured by a pixel as an integral of radiance over the pixel's area. To make this trainable, they derive an analytic gradient for the sensor layout parameters using Reynold’s transport theorem, allowing the loss from the neural network to flow back and "push" the pixel boundaries to better locations.
  3. Drop-in Module: They provide a PyTorch layer that can be integrated into existing pipelines. It approximates the sensor simulation by sampling from high-resolution images using bilinear interpolation.
Figure 1. The overall pipeline for end-to-end learning of task-specific pixel layouts.

For image-to-image tasks like semantic segmentation, the authors include a "back-warping" step. Since the network operates on a deformed image, its output is also deformed. They use the inverse of the learned layout to map the predictions back to a uniform grid for comparison with ground truth labels.

Datasets

The authors evaluated their method on three distinct tasks:

  • MNIST: A toy example using a tiny $4 \times 4$ resolution to classify hand-written digits.
  • Cityscapes: A complex dataset of urban street scenes used for semantic segmentation.
  • CelebA: A dataset of facial attributes used for multi-label classification.

Key Insights and Ideas

  • "Learned Foveation": The system naturally learns a "foveated" layout—putting higher pixel density where the most important information resides. For centered objects like digits or faces, it concentrates pixels in the middle. For driving scenes, it concentrates them at the horizon.
  • Topology Matters: By ensuring the deformation is bijective and preserves topology, the authors can use standard, off-the-shelf CNN architectures (like ResNet or PSPNet) on the deformed images without needing specialized kernels.
  • Physical Realizability: Unlike some "learned resizer" methods that produce complex, non-buildable mappings, the rectangular layouts proposed here are geometrically simple and could theoretically be manufactured as physical sensors.
Figure 2. The curvilinear (top row) and rectangular (bottom row) pixel layouts used in this paper and their behavior under different parameters on a 20 × 20 sensor.

Key Results

The quantitative improvements were most dramatic at low resolutions:

  • MNIST (4x4): Accuracy improved from 83.63% (uniform) to 90.90% (learned).
  • Cityscapes Segmentation: The learned rectangular layout consistently outperformed the uniform baseline. At a resolution of $129 \times 65$, the Mean Intersection over Union (mIoU) jumped from 37.11% to 39.44%.
  • Qualitative Gains: In driving scenes, the learned layout successfully detected small, distant objects (like poles or pedestrians near the horizon) that the uniform layout completely missed.
Figure 4. Learned sensor layout for 4 × 4 MNIST classification. Top row: pixel layouts overlayed over the original 28 × 28 image. Bottom row: Simulated sensor output. The network fine-tuned on the uniform layout wrongly classifies (a) as a 7 while the end-to- end optimized network classifies (b) as a 4.

Limitations and Future Work

  • Spatial Bias Dependency: The method relies on the dataset having a consistent spatial bias. If objects of interest appear randomly anywhere in the frame, a uniform grid remains the most robust choice.
  • Simple Deformations: The current deformation functions are relatively simple (only two parameters). The authors suggest that more complex, free-form deformations could yield even better results.
  • CNN Assumptions: Standard CNNs assume that the distance between all adjacent pixels is equal. The authors note that exploring "continuous CNNs" that explicitly account for varying pixel sizes could be a fruitful future direction.

Summary updated

BibTeX
@misc{sommerhoff2023differentiable,
  author = {Hendrik Sommerhoff and Shashank Agnihotri and Mohamed Saleh and Michael Moeller and Margret Keuper and Andreas Kolb},
  title = {{Differentiable Sensor Layouts for End-to-End Learning of Task-Specific Camera Parameters}},
  year = {2023},
  eprint = {2304.14736},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2304.14736},
}
Figure