# Conditional GAN-Based Two-Stage ISP Tuning Method: A Reconstruction-Enhancement Proxy Framework
## 4 Experiments
### Data Generation and ISP Tuning Preparation  
This article uses the open-source InfiniteISP [40] as a software ISP for tuning, and its pipeline is shown in Figure 5 below:Infinite-ISP includes common algorithms in the ISP pipeline, and it also exposes many parameters that can be tuned externally. This paper selects seven modules, BLC (black level correction), BNR (Bayer noise reduction), AWB (auto white balance), CSE (color saturation enhancement), sharpen, LDCI (local dynamic contrast improvement), and 2 DNR (2D noise reduction) as the target modules for tuning, while the parameters of the remaining modules are fixed as default. According to the classification rules in [14], the seven modules are divided into two categories: reconstruction and enhancement, where BLC, BNR, sharpen, and 2 DNR are tuning targets for the reconstruction stage, while AWB, CSE, and LDCI are tuning targets for the enhancement stage. All tuning parameters are shown in Table 1 below:  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Module** & **Parameter** & **Default Value** & **Min Value** & **Max Value** \\ \hline \multirow{4}{*}{BLC} & R sat * & 4095 & 1 & 21\({}^{3}\) \\  & Gr sat * & 4095 & 1 & 21\({}^{3}\) \\  & Gb sat * & 4095 & 1 & 21\({}^{3}\) \\  & B sat * & 4095 & 1 & 21\({}^{3}\) \\ \hline \multirow{4}{*}{BNR} & R std dev s * & 1 & 0 & 12 \\  & R std dev r & 0.1 & 0 & R std dev s \\  & G std dev s * & 1 & 0 & 12 \\  & G std dev r & 0.08 & 0 & G std dev s \\  & B std dev s * & 1 & 0 & 12 \\  & B std dev r & 0.1 & 0 & B std dev s \\ \hline \multirow{2}{*}{Sharpen} & sharpen sigma & 5 & 1 & 12 \\  & sharpen strength & 1 & 0 & 8 \\ \hline \multirow{2}{*}{2 DNR} & wts * & 10 & 1 & 2\({}^{4}\) \\ \hline \multirow{4}{*}{AWB} & underexposed & 5 & 0 & 16 \\  & percentage & 0.1 & 0 & 16 \\  & percentage & 3.5 & 0 & 16 \\ \hline CSE & saturation gain & 1.5 & 0 & 8 \\ \hline LDCI & clip limit * & 1 & 1 & 5 \\ \hline \hline \end{tabular}  
* Must be integer.  
\end{table}
Table 1: Parameters for tuning.  
Figure 5: The pipeline of Infinite-ISP. [[https://github.com/10x-Engineers/Infinite-ISP](https://github.com/10x-Engineers/Infinite-ISP)]([https://github.com/10x-Engineers/Infinite-ISP](https://github.com/10x-Engineers/Infinite-ISP)) (accessed on 23 October 2024).  
The above parameters are randomly generated within the range and sent to Infinite-ISP to obtain the target ISP for each parameter combination. The intermediate values for reconstruction and enhancement of the two training sessions need to be obtained by turning off AWB, CSE, and LDCI.  
For the denoising tuning dataset, we used the SIDD Medium RAW dataset and selected a total of twenty-eight images with different exposures from seven different scenes as the original images. We randomly generated a parameter set of eighteen parameters for tuning and combined it with twenty-eight images to form a dataset of 2800 image-parameter pairs as the first step for training the proxy.  
For the object detection tuning dataset, we use the KITTI dataset to select the object detection scene for generating the raw images for training the proxy. At the same time, in order to verify the performance of the tuning effect in object detection in this article, Fast R-CNN [44] was used to train a network for object detection on KITTI, and it was applied to the proxy loss calculation of CV tasks.