ReRAW: RGB-to-RAW Image Reconstruction via Stratified Sampling for Efficient Object Detection on the Edge

Radu Berdan, Beril Besbinar, Christoph Reinders, Junji Otsuka, Daisuke IsoCVPR 2025

Introduction

Modern computer vision relies heavily on massive RGB datasets. However, edge devices like smart cameras and drones capture data in RAW sensor formats. Converting this RAW data to RGB via a traditional Image Signal Processor (ISP) is computationally expensive and discards valuable information. This paper introduces ReRAW, a framework that "un-processes" standard RGB images back into high-fidelity RAW data, enabling the training of object detectors that operate directly on raw sensor output.

Motivation: Bypassing the ISP Bottleneck

In standard imaging pipelines, the ISP performs demosaicking, white balancing, and tone mapping to create human-friendly 8-bit RGB images. For edge-based object detection, this process is a significant bottleneck, consuming power and reducing dynamic range. By running models directly on RAW data (typically 12-16 bits), devices can achieve higher accuracy and lower latency.

Comparison between the conventional ISP-based pipeline and the proposed optimal edge pipeline that processes RAW data directly.

The primary challenge is the lack of labeled RAW data. ReRAW addresses this by reconstructing realistic RAW sensor data from existing large-scale RGB datasets like BDD100K or COCO.

The ReRAW Framework

The ReRAW architecture is designed to handle the complex, non-linear relationship between RGB and RAW spaces. It employs several key components:

  • Multi-head Gamma Predictor (MGP): Predicts multiple "gamma-corrected" RAW candidates to account for varying lighting conditions.
  • Global Context Encoder (GCE): A ResNet-based module that extracts global luminosity and scene features to guide local reconstruction.
  • Stratified Sampling: To combat the statistical skew of RAW data toward dark values, the authors bin patches by brightness and sample uniformly. This ensures the model learns to reconstruct highlights accurately.
  • Hard-log Loss ($\mathcal{L}_{hln}$): A custom loss function that prioritizes accuracy in bright, information-rich pixels.
The ReRAW architecture, featuring the Multi-head Gamma Predictor (MGP), Global Context Encoder (GCE), and the reconstruction pipeline.

Key Results and Insights

ReRAW achieves state-of-the-art performance in both image reconstruction and downstream detection tasks:

  • Reconstruction Accuracy: ReRAW-S (using stratified sampling) achieved a PSNR of 41.00 dB on the NOD-Nikon dataset, significantly outperforming previous methods like InvISP.
  • Detection Performance: On the PASCALRAW benchmark, an RTMDet-s model trained on ReRAW-generated synthetic RAW data reached 63.19 mAP, a substantial improvement over the 57.62 mAP of the standard RGB pipeline.
  • Low-Light Robustness: The benefits of processing RAW data were most evident in nighttime scenes, where the increased bit depth and lack of ISP artifacts provide a much cleaner signal for detection.

Conclusion

ReRAW demonstrates that training on synthetic RAW data is a viable and superior alternative for edge-based computer vision. By bypassing the ISP, developers can create faster, more accurate, and more power-efficient models. Future work will explore even more sophisticated sampling techniques, such as high-entropy or dynamic range filtering, to further refine the reconstruction process.

Summary updated

BibTeX
@inproceedings{berdan2025reraw,
  author = {Radu Berdan and Beril Besbinar and Christoph Reinders and Junji Otsuka and Daisuke Iso},
  title = {{ReRAW: RGB-to-RAW Image Reconstruction via Stratified Sampling for Efficient Object Detection on the Edge}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2025},
  doi = {10.1109/cvpr52734.2025.01105},
}
Figure