SpiralDiff: Spiral Diffusion with LoRA for RGB-to-RAW Conversion Across Cameras
Organizations: School of Electrical and Information Engineering, Tianjin University · State key laboratory of Smart Power Distribution Equipment and System, Tianjin University · Individual
Abstract
RAW images preserve superior fidelity and rich scene information compared to RGB, making them essential for tasks in challenging imaging conditions. To alleviate the high cost of data collection, recent RGB-to-RAW conversion methods aim to synthesize RAW images from RGB. However, they overlook two key challenges: (i) the reconstruction difficulty varies with pixel intensity, and (ii) multi-camera conversion requires camera-specific adaptation. To address these issues, we propose SpiralDiff, a diffusion-based framework tailored for RGB-to-RAW conversion with a signal-dependent noise weighting strategy that adapts reconstruction fidelity across intensity levels. In addition, we introduce CamLoRA, a camera-aware lightweight adaptation module that enables a unified model to adapt to different camera-specific ISP characteristics. Extensive experiments on four benchmark datasets demonstrate the superiority of SpiralDiff in RGB-to-RAW conversion quality and its downstream benefits in RAW-based object detection. Our code and model are available at https://github.com/Chuancy-TJU/SpiralDiff.
Figures & tables
| Methods | Separate | Combined | ||||||
|---|---|---|---|---|---|---|---|---|
| FiveK Canon | FiveK Nikon | NOD Nikon | NOD Sony | FiveK Canon | FiveK Nikon | NOD Nikon | NOD Sony | |
| CycleISP [ 47 ] | 37.93 / 0.9913 | 40.18 / 0.9920 | 50.11 / 0.9985 | 46.57 / 0.9975 | 38.06 / 0.9911 | 38.86 / 0.9918 | 48.68 / 0.9984 | 46.12 / 0.9971 |
| InvISP [ 40 ] | 36.81 / 0.9814 | 34.30 / 0.9163 | 48.29 / 0.9954 | 44.76 / 0.9922 | 35.37 / 0.9828 | 36.60 / 0.9850 | 47.73 / 0.9948 | 44.43 / 0.9907 |
| ReRAW [ 3 ] | 35.08 / 0.9608 | 33.09 / 0.9265 | 48.25 / 0.9906 | 45.50 / 0.9788 | 32.70 / 0.9684 | 33.24 / 0.9648 | 46.39 / 0.9715 | 45.51 / 0.9817 |
| RAW-Diffusion [ 33 ] | 39.96 / 0.9890 | 39.68 / 0.9866 | 50.52 / 0.9954 | 47.31 / 0.9908 | 40.63 / 0.9889 | 40.35 / 0.9916 | 49.60 / 0.9950 | 46.80 / 0.9897 |
| SpiralDiff | 42.82 / 0.9936 | 41.72 / 0.9925 | 53.64 / 0.9990 | 50.46 / 0.9980 | 41.99 / 0.9931 | 43.19 / 0.9947 | 52.06 / 0.9987 | 49.52 / 0.9974 |
| Methods | FiveK Canon | NOD Nikon | ||
|---|---|---|---|---|
| PSNR | SSIM | PSNR | SSIM | |
| CycleISP [ 47 ] | 27.75 | 0.9833 | 35.86 | 0.9957 |
| InvISP [ 40 ] | 25.15 | 0.9699 | 36.66 | 0.9905 |
| ReRAW [ 3 ] | 26.36 | 0.9664 | 38.56 | 0.9691 |
| RAW-Diffusion [ 33 ] | 30.60 | 0.9739 | 40.05 | 0.9926 |
| SpiralDiff | 31.10 | 0.9856 | 40.79 | 0.9973 |
| Variant | FiveK Canon | NOD Nikon | ||
|---|---|---|---|---|
| PSNR | SSIM | PSNR | SSIM | |
| Baseline | 41.40 | 0.9906 | 53.48 | 0.9989 |
| 40.06 | 0.9912 | 53.42 | 0.9990 | |
| 42.82 | 0.9936 | 53.64 | 0.9990 | |
| Variant | FiveK Canon | NOD Nikon | ||
|---|---|---|---|---|
| PSNR | SSIM | PSNR | SSIM | |
| Uncond. | 41.99 | 0.9931 | 52.06 | 0.9987 |
| Embed. | 40.97 | 0.9917 | 51.44 | 0.9984 |
| CamLoRA | 42.46 | 0.9934 | 52.62 | 0.9988 |
| Variant | 1-shot | 5-shot | ||
|---|---|---|---|---|
| PSNR | SSIM | PSNR | SSIM | |
| Scratch | 39.83 | 0.9895 | 43.40 | 0.9951 |
| CamLoRA | 42.85 | 0.9942 | 43.92 | 0.9954 |
| Method | iPhone | Samsung |
|---|---|---|
| RAW-Diffusion (DDPM) | 22.74 / 0.7503 | 30.28 / 0.9140 |
| RAW-Diffusion (SpiralDiff) | 30.11 / 0.8810 | 34.07 / 0.9322 |
| Dataset | NOD Nikon | NOD Sony | ||||
|---|---|---|---|---|---|---|
| AP | AP 50 | AP 75 | AP | AP 50 | AP 75 | |
| RGB-only | 19.1 | 37.0 | 18.5 | 19.7 | 38.3 | 18.0 |
| RAW-only | 18.4 | 35.1 | 17.0 | 17.6 | 35.7 | 15.1 |
| RAW + CS-RAW | 24.5 | 46.2 | 23.5 | 25.9 | 49.3 | 24.5 |
| RAW + BDD-RAW | 26.7 | 49.5 | 25.1 | 29.0 | 55.1 | 26.5 |
| Method | FiveK Canon | FiveK Nikon | NOD Nikon | NOD Sony | ||||
|---|---|---|---|---|---|---|---|---|
| PSNR | SSIM | PSNR | SSIM | PSNR | SSIM | PSNR | SSIM | |
| CycleISP [ 47 ] | 27.75 | 0.9833 | 30.19 | 0.9872 | 35.86 | 0.9957 | 32.52 | 0.9890 |
| InvISP [ 40 ] | 25.15 | 0.9699 | 29.11 | 0.9764 | 36.66 | 0.9905 | 30.85 | 0.9782 |
| ReRAW [ 3 ] | 26.36 | 0.9664 | 27.51 | 0.9520 | 38.56 | 0.9691 | 34.96 | 0.9713 |
| RAW-Diffusion [ 33 ] | 30.60 | 0.9739 | 32.95 | 0.9850 | 40.05 | 0.9926 | 35.58 | 0.9792 |
| SpiralDiff | 31.10 | 0.9856 | 34.42 | 0.9908 | 40.79 | 0.9973 | 36.11 | 0.9919 |
| Rank | FiveK Canon | FiveK Nikon | NOD Nikon | NOD Sony | ||||
|---|---|---|---|---|---|---|---|---|
| PSNR | SSIM | PSNR | SSIM | PSNR | SSIM | PSNR | SSIM | |
| 41.99 | 0.9931 | 43.19 | 0.9947 | 52.06 | 0.9987 | 49.52 | 0.9974 | |
| 42.64 | 0.9928 | 43.52 | 0.9948 | 52.23 | 0.9987 | 49.78 | 0.9977 | |
| 42.34 | 0.9931 | 43.95 | 0.9948 | 52.47 | 0.9988 | 49.82 | 0.9977 | |
| 42.46 | 0.9934 | 43.82 | 0.9950 | 52.62 | 0.9988 | 50.08 | 0.9977 | |
| 42.00 | 0.9932 | 42.82 | 0.9945 | 52.36 | 0.9989 | 49.60 | 0.9978 | |
| Variant | FiveK Canon | FiveK Nikon | NOD Nikon | NOD Sony | ||||
|---|---|---|---|---|---|---|---|---|
| PSNR | SSIM | PSNR | SSIM | PSNR | SSIM | PSNR | SSIM | |
| RAW-Diffusion (DDPM) | 39.96 | 0.9890 | 39.68 | 0.9866 | 50.52 | 0.9954 | 47.31 | 0.9908 |
| RAW-Diffusion (SpiralDiff) | 41.53 | 0.9912 | 42.34 | 0.9920 | 50.54 | 0.9954 | 47.32 | 0.9907 |
Image-to-Image Translation
Image-to-image translation maps images between visual domains or modalities while preserving relevant content, structure, and semantics.
See all 115 papers