Task-oriented image signal processors (ISPs) adapt RAW-to-RGB processing for downstream perception. However, explicit demosaicing is often simplified, kept fixed, or optimized primarily for reconstruction quality, leaving this stage insufficiently integrated into task adaptation. We propose Dem2TA, a framework that incorporates fidelity-supervised demosaicing into the adaptation of the perception pipeline. Starting from a pretrained demosaicing model, we jointly adapt the reconstruction frontend and downstream network using reconstruction and task supervision, together with complementary semantic and task representation alignment. We then freeze the adapted frontend and jointly optimize a lightweight local ISP with the downstream model to refine task-specific rendering without changing the reconstructed linear RGB. Experiments on synthetic RAW detection and box-prompted segmentation demonstrate the effectiveness of representation-guided joint adaptation and subsequent local rendering. Evaluation on a manually verified real-capture dataset further supports transfer beyond synthetic inputs. Compared with TA-ISP on the same adapted foundation, Dem2TA improves detection AP by 0.46 points and segmentation IoU by 1.06 points on synthetic COCO RAW, and segmentation IoU by 0.63 points on real captures.
Figures & tables
Figure 1: Comparison of task-driven ISP paradigms. (a,b) Joint image-mapping optimization and task-adaptive modulation. (c) Our two-stage approach jointly adapts reconstruction and perception through complementary supervision, then optimizes a local ISP with the reconstruction frontend frozen.
Figure 2: Overview of Dem2TA, which adapts fidelity features for perception before refining task rendering. Stage 1 jointly adapts the demosaicing frontend and downstream model with fidelity and complementary representation supervision. Stage 2 freezes the adapted frontend and jointly optimizes a local ISP with the downstream model. Flames and snowflakes indicate trainable and frozen modules.
Figure 3: Motivation for demosaicing adaptation. (a) Reconstruction oriented training optimizes demosaicing for fidelity independently of task learning. (b) Dem2TA combines reconstruction supervision, complementary representation alignment, and task feedback to jointly adapt the frontend and downstream network.
Figure 4: Motivation of complementary representation alignment. The pretrained demosaicing model provides a fidelity anchor, the task encoder supplies task-related spatial structure, and DINO provides regional semantics to bridge reconstruction and perception. These complementary priors guide the fused multiscale decoder features during joint adaptation.
Method
Reference
Detection (COCO)
Segmentation (COCO)
AP ↑
AP 50↑
AP 75↑
AP S↑
AP M↑
AP L↑
IoU ↑
Dice ↑
Prec. ↑
Recall ↑
Boundary F1 ↑
Boundary IoU ↑
Reconstruction-based pipelines with joint task fine-tuning
JD3Net
ICCP 2025
26.439
40.235
28.038
7.878
27.705
44.804
76.503
85.232
86.569
86.469
65.005
25.373
JD3Net + Fixed ISP
ICCP 2025
31.289
47.655
33.915
9.489
34.251
49.569
76.913
85.434
87.527
85.818
66.580
26.177
Mosaic-input methods without a standalone demosaicing network
RAW-Adapter
ECCV 2024
26.785
41.065
28.065
7.764
27.938
44.928
79.034
87.190
86.248
89.903
67.798
25.402
Table 1: Comparison on COCO detection and segmentation, grouped by processing pipeline. AdaptiveISP and TA-ISP are each evaluated with two demosaicing frontends. The best and second-best results are highlighted in red and blue, respectively.
Figure 5: Qualitative detection and box-prompted segmentation comparisons on synthetic COCO RAW inputs. The examples illustrate the task-level benefits of jointly adapting reconstruction and perception, followed by local ISP optimization.
Figure 6: Instance segmentation on real RAW data. Quad Bayer images from MIPI 2022 and Single Bayer images captured with Huawei Mate 70, iPhone 14, and iPhone 18 Pro. We annotated all instances. Results on real data show that our method is generalizable.
Figure 7: Demosaicing on real data using models trained on synthetic COCO. All outputs are rendered through the same fixed ISP.
Method
Reference
Segmentation
IoU ↑
Dice ↑
Boundary F1 ↑
Boundary IoU ↑
RAW-Adapter
ECCV 2024
82.468
89.629
50.545
14.508
AdaptiveISP †
NeurIPS 2024
79.636
88.512
34.971
10.908
Dark-ISP
ICCV 2025
82.331
89.490
50.850
15.012
TA-ISP †
CVPR 2026
82.890
89.838
51.934
14.640
Dem2TA (L)
Ours
83.519
90.236
53.964
15.773
Table 2: Segmentation results on the real-world dataset. The best and second-best results are shown in red and blue, respectively. † denotes using the Dem2TA (L) demosaicing model as its frontend.
Method
Reference
Param. (M)
Linear RGB
sRGB
Segmentation
PSNR ↑
SSIM ↑
PSNR ↑
SSIM ↑
LPIPS ↓
IoU ↑
BF1 ↑
SANet
AAAI 2022
5.72
40.1412
0.9719
30.2012
0.8554
0.2006
76.889
66.485
BMTNet
CVPR 2025
12.17
42.2246
0.9581
31.4946
0.8689
0.1779
76.921
66.562
ms-demosaic
ICCV 2025
10.68
43.2656
0.9798
33.7102
0.9025
0.1265
76.917
66.541
JD3Net
ICCP 2025
3.20
41.2850
0.9838
31.7322
0.9146
0.1302
76.913
66.580
FFNet
MDPI 2026
43.26
41.6340
0.9744
31.5293
0.8756
0.1778
76.907
66.502
Table 3: Reconstruction and segmentation results before and after joint adaptation, averaged over dual Bayer inputs. Segmentation uses original MobileSAM before adaptation and the jointly adapted model afterward, with a fixed ISP throughout. Best and second-best results are highlighted in red and blue, respectively.
Setting
IoU ↑
Dice ↑
Prec. ↑
BF1 ↑
BIoU ↑
Pretrained
76.924
85.512
87.498
66.591
26.201
Downstream-only fine-tune
77.262
85.691
87.730
66.839
26.305
Joint fine-tune, no alignment
77.379
85.780
87.894
67.011
26.412
+ DINO only
77.861
85.880
88.130
67.122
26.451
+ Task only, encoder tuned
79.032
87.001
89.231
68.464
26.511
+ DINO + Task, encoder frozen
79.593
88.045
90.699
68.914
26.162
Table 4: Ablation of adaptation components on COCO instance segmentation. “Encoder frozen” uses a separate frozen alignment copy; “encoder tuned” shares weights with the trainable downstream encoder. “Full” adds sequential local ISP adaptation; “Joint stages” updates the demosaicing frontend and local ISP together.
Figure 8: Relative gains over the fixed-ISP reference on COCO box-prompted segmentation. Individual controls provide gains, while the full local ISP achieves the largest improvements across all three metrics, supporting their joint use for prediction.
Figure 9: Composition of the real-capture evaluation set: (a) RAW CFA patterns, (b) scene content, (c) numbers of instances per image, and (d) types of prompts used to generate candidate masks.
Figure 10: Semi-automatic annotation workflow. SAM 3 generates candidate masks on an RGB reference image, which are then refined in CVAT to produce instance-level ground truth.
Figure 11: Examples of Quad Bayer data and instance annotations. From top to bottom: CFA mosaic visualization, single-channel RAW, RGB reference, and ground-truth instance masks. Different mask colors distinguish instances.
Figure 12: Examples of Single Bayer data and instance annotations. From top to bottom: CFA mosaic visualization, single-channel RAW, RGB reference, and ground-truth instance masks. Different mask colors distinguish instances.
Frontend
Stage 1
IoU ↑
Dice ↑
Boundary F1 ↑
L
Before
77.182
85.635
66.778
L
After
77.218
85.655
66.818
S
Before
77.064
85.545
66.518
S
After
76.997
85.501
66.361
Table 5: Frontend-only substitution with the original MobileSAM frozen on COCO box-prompted segmentation. Both rows for each model share the fixed ISP, prompts, and evaluation protocol.
Figure 13: Our local ISP achieves competitive performance with a small number of parameters. Circles denote methods using the same demosaicing frontend, while squares denote RAW-to-RGB methods. The dashed line indicates the performance of Fixed ISP.
Setting
IoU
Dice
Boundary F1
Fixed ISP (continued training)
80.023
87.508
68.121
Tone
80.342
88.086
69.827
Color
80.311
88.052
69.955
Detail
80.200
87.970
69.806
Tone + Color
80.288
88.032
69.784
Tone + Detail
80.165
87.949
69.656
Table 6: Local ISP component results on COCO box-prompted segmentation.
Image demosaicing reconstructs a full-color image from incomplete color measurements produced by a sensor covered with a color filter array (CFA). Most existing methods formulate demosaicing as pixel-level reconstruction and mainly rely on local textures, cross-channel correlations, and low-level image statistics. Our core insight is that reconstruction and visual understanding can be viewed as complementary views of shared scene structure: both are grounded in the same underlying physical world, and therefore the structural and physical information inferred from an image should remain consistent across the two tasks. We instantiate this idea with instance segmentation and propose SegDem, a cross-task decoder representation transfer framework for demosaicing. SegDem first learns region- and boundary-aware representations through instance-aware structural pretraining and then transfers the decoder to RAW-conditioned reconstruction. Segmentation- and demosaicing-conditioned features are further anchored to a shared frozen DINOv2 representation space to preserve structural organization across tasks. We instantiate SegDem with convolutional, Transformer-based, and state-space backbones for unified Single- and Quad-Bayer demosaicing. Extensive experiments on synthetic, external, and challenging datasets demonstrate consistent improvements across different architectures and CFA layouts.
Ping Chen, Xiangming Wang, Yongyong Chen +5
Harbin Institute of Technology, Shenzhen · Shanghai Jiao Tong University · Nanjing University (Suzhou)
To address module fragmentation, uninterpretable mappings, and deployment constraints in RAW-domain demosaicing, color correction, and detail enhancement, this paper proposes RPBA-Net, an interpretable residual pyramid bilateral affine network for RAW-domain ISP enhancement. Given packed RAW as input, the method performs residual affine base reconstruction by estimating a base RGB representation and learning identity-guided residual affine corrections, thereby unifying demosaicing and enhancement. It further builds pyramid bilateral affine grids and combines guide-driven autoregressive adaptive slicing with adaptive cross-layer fusion to hierarchically model global tone restoration and local texture enhancement. In addition, smoothness, cross-scale consistency, and magnitude regularization terms are introduced to improve model stability, controllability, and structural interpretability. Extensive experiments demonstrate that RPBA-Net surpasses representative RAW-to-sRGB methods and achieves state-of-the-art performance in reconstruction fidelity and perceptual quality, while maintaining low model complexity and strong deployment potential for mobile and embedded platforms.
Yucheng Xin, Wu Chen, Xiang Chen +7
School of Information Science and Engineering, Shandong Normal University, Jinan, China · National University of Defense Technology, Changsha, China · Nanjing University of Science and Technology, Nanjing, China +2
Multispectral demosaicing is crucial to reconstruct full-resolution spectral images from snapshot mosaiced measurements, enabling real-time imaging from neurosurgery to autonomous driving. Classical methods are blurry, while supervised learning requires costly ground truth (GT) obtained from slow line-scanning systems. We propose Perspective-Equivariant Fine-tuning for Demosaicing (PEFD), a framework that learns multispectral demosaicing from mosaiced measurements alone. PEFD a) exploits the projective geometry of camera-based imaging systems to leverage a richer group structure than previous demosaicing methods to recover more null-space information, and b) learns efficiently without GT by adapting pretrained foundation models designed for 1-3 channel imaging. On surgical and automotive datasets, PEFD recovers fine details such as blood vessels and preserves spectral fidelity, substantially outperforming recent approaches, nearing supervised performance. Furthermore, the performance of PEFD is demonstrated on raw, unprocessed data from a commercial multispectral sensor. Code is at https://github.com/Andrewwango/pefd.