Table of Contents
Fetching ...

RAW-Flow: Advancing RGB-to-RAW Image Reconstruction with Deterministic Latent Flow Matching

Zhen Liu, Diedong Feng, Hai Jiang, Liaoyuan Zeng, Hao Wang, Chaoyu Feng, Lei Lei, Bing Zeng, Shuaicheng Liu

TL;DR

This work tackles the ill-posed problem of reconstructing sensor RAW data from RGB images by reframing RGB-to-RAW reconstruction as a deterministic latent transport problem. It introduces RAW-Flow, a framework that learns a time-continuous velocity field in latent space to transport RGB latent representations $z_0$ toward RAW latents $z_1$, followed by decoding to high-fidelity RAW outputs. A Dual-domain Latent Autoencoder with a dual-domain feature alignment loss and a cross-scale context guidance module enable stable training and accurate reconstruction across domains. Empirical results on multiple RAW datasets show that RAW-Flow surpasses state-of-the-art regression and diffusion-based methods in both RAW-domain metrics and visual quality, highlighting its practical potential for RAW data recovery from RGB images.

Abstract

RGB-to-RAW reconstruction, or the reverse modeling of a camera Image Signal Processing (ISP) pipeline, aims to recover high-fidelity RAW data from RGB images. Despite notable progress, existing learning-based methods typically treat this task as a direct regression objective and struggle with detail inconsistency and color deviation, due to the ill-posed nature of inverse ISP and the inherent information loss in quantized RGB images. To address these limitations, we pioneer a generative perspective by reformulating RGB-to-RAW reconstruction as a deterministic latent transport problem and introduce a novel framework named RAW-Flow, which leverages flow matching to learn a deterministic vector field in latent space, to effectively bridge the gap between RGB and RAW representations and enable accurate reconstruction of structural details and color information. To further enhance latent transport, we introduce a cross-scale context guidance module that injects hierarchical RGB features into the flow estimation process. Moreover, we design a dual-domain latent autoencoder with a feature alignment constraint to support the proposed latent transport framework, which jointly encodes RGB and RAW inputs while promoting stable training and high-fidelity reconstruction. Extensive experiments demonstrate that RAW-Flow outperforms state-of-the-art approaches both quantitatively and visually.

RAW-Flow: Advancing RGB-to-RAW Image Reconstruction with Deterministic Latent Flow Matching

TL;DR

This work tackles the ill-posed problem of reconstructing sensor RAW data from RGB images by reframing RGB-to-RAW reconstruction as a deterministic latent transport problem. It introduces RAW-Flow, a framework that learns a time-continuous velocity field in latent space to transport RGB latent representations toward RAW latents , followed by decoding to high-fidelity RAW outputs. A Dual-domain Latent Autoencoder with a dual-domain feature alignment loss and a cross-scale context guidance module enable stable training and accurate reconstruction across domains. Empirical results on multiple RAW datasets show that RAW-Flow surpasses state-of-the-art regression and diffusion-based methods in both RAW-domain metrics and visual quality, highlighting its practical potential for RAW data recovery from RGB images.

Abstract

RGB-to-RAW reconstruction, or the reverse modeling of a camera Image Signal Processing (ISP) pipeline, aims to recover high-fidelity RAW data from RGB images. Despite notable progress, existing learning-based methods typically treat this task as a direct regression objective and struggle with detail inconsistency and color deviation, due to the ill-posed nature of inverse ISP and the inherent information loss in quantized RGB images. To address these limitations, we pioneer a generative perspective by reformulating RGB-to-RAW reconstruction as a deterministic latent transport problem and introduce a novel framework named RAW-Flow, which leverages flow matching to learn a deterministic vector field in latent space, to effectively bridge the gap between RGB and RAW representations and enable accurate reconstruction of structural details and color information. To further enhance latent transport, we introduce a cross-scale context guidance module that injects hierarchical RGB features into the flow estimation process. Moreover, we design a dual-domain latent autoencoder with a feature alignment constraint to support the proposed latent transport framework, which jointly encodes RGB and RAW inputs while promoting stable training and high-fidelity reconstruction. Extensive experiments demonstrate that RAW-Flow outperforms state-of-the-art approaches both quantitatively and visually.
Paper Structure (15 sections, 9 equations, 6 figures, 4 tables)

This paper contains 15 sections, 9 equations, 6 figures, 4 tables.

Figures (6)

  • Figure 1: Visual comparisons with previous state-of-the-art methods. The proposed RAW-Flow reconstructs higher-fidelity local details, global luminance, and color information. Differences are best observed in the error maps.
  • Figure 2: The overall pipeline of our proposed RAW-Flow framework. Given an input RGB image, the RGB encoder $\mathcal{E}_{\text{rgb}}$ extracts the initial latent $\mathbf{z}_{\text{rgb}}$ ($\mathbf{z}_0$), while the RAW encoder $\mathcal{E}_{\text{raw}}$ provides the target latent $\mathbf{z}_{\text{raw}}$ ($\mathbf{z}_1$) during training. A deterministic vector field $\hat{\mathbf{v}}_\theta(\mathbf{z}_t, t)$ is learned to model the latent flow between $\mathbf{z}_0$ and $\mathbf{z}_1$, with cross-scale context guidance injected to enhance the flow estimation. During inference, the predicted flow guides the transport of RGB latent features toward the RAW domain. The resulting latent $\hat{\mathbf{z}}_{\text{raw}}$ is then decoded by $\mathcal{D}_{\text{raw}}$ to reconstruct the RAW image.
  • Figure 3: Overview of the Dual-domain Latent Autoencoder (DLAE), which jointly encodes RGB and RAW inputs to enable latent-space alignment and high-fidelity reconstruction.
  • Figure 4: Qualitative comparisons with state-of-the-art RGB-to-RAW reconstruction methods on the FiveK-Nikon, FiveK-Canon, and PASCALRAW datasets. For each method, we show the reconstructed RAW image and the corresponding error map, which visualizes the pixel-wise difference from the ground-truth RAW image (darker regions indicate smaller errors).
  • Figure 5: Visual comparisons of our ablation study about the injected feature $f_\text{rgb}$ and the feature alignment loss $\mathcal{L}_\text{fea}$ of the proposed dual-domain autoencoder (DLAE).
  • ...and 1 more figures