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.
