# Conditional GAN-Based Two-Stage ISP Tuning Method: A Reconstruction-Enhancement Proxy Framework
## 4 Experiments
### Proxy Performance Experiment  
In this section, in order to verify the advantages of the proposed two-stage proxy compared with the end-to-end proxy in terms of image quality, a comparison was made between the two methods for generating proxy images under certain convergence conditions, as well as the quality of the generated images under parameter changes. By comparing the proxy output and ISP output under random parameters in SSIM and HC mentioned above, the difference is evaluated. In order to verify structural similarity more specifically, the SSIM are optimized to be more focused on structure difference [31]. The optimized SSIM functions and HC functions are shown as follows:  
\[SSIM(I_{proxy},I_{ISP})=[l(I_{proxy},I_{ISP})^{0.2}\cdot c(I_{proxy},I_{ISP})^{ 2.8}\cdot s(I_{proxy},I_{ISP})^{3.5}] \tag{9}\]  
\[HC_{I_{1},I_{2}}=\frac{\sum_{i=1}^{N}(H_{1}(i)-\bar{H}_{1})(H_{2}(i)-\bar{H}_ {2})}{\sqrt{\sum_{i=1}^{N}(H_{1}(i)-\bar{H}_{1})^{2}}\cdot\sqrt{\sum_{i=1}^{N }(H_{2}(i)-\bar{H}_{2})^{2}}} \tag{10}\]  
Considering Equation (9), \(l\), \(c\), and \(s\) are metrics for luminance, contrast, and structure, respectively [27]. By adjusting the weight of those metrics [31], SSIM can measure structural differences more specifically, while assigning the task of distinguishing color differences to HC. Considering Equation (10), \(H_{1}\) and \(H_{2}\) are the histograms of two pictures, respectively, while \(\bar{H}_{1}\) and \(\bar{H}_{2}\) are mean of histogram. The Pearson Correlation Coefficient between the histograms of two images is calculated to get the value that measures the correlation between the chromaticity statistics of two images. Along with the measurement of the above two metrics, we also calculated the number of trainable parameters and forward propagation FLOPs of those two proxy networks. In the process of proxy training, as mentioned above, different LR and patch sizes are used. In the process of Re-stage training, we use ADAM (\(\beta_{1}\) = 0.9, \(\beta_{2}\) = 0.99) as the optimizer. The LR of \(G_{Re}\) and \(D_{Re}\) are set to 0.0002 and 0.00005, respectively. We use a batch size of 12. After about epoch 300, \(G_{Re}\) gradually converges. Among them, \(\alpha_{1}\) and \(\alpha_{2}\) in \(\mathcal{L}_{Re}\) have undergone our limited tests. At the same scale, changes in value have little impact on \(G_{Re}\) reception, and we set them to 0.01 and 1. At the same time, En-stage also needs to be trained. The same ADAM (\(\beta_{1}\) = 0.9, \(\beta_{2}\) = 0.99) is used as the optimizer. The LR of \(G_{Ent}\) and \(D_{En}\) are set to 0.001 and 0.0005, respectively, due to the En-stage being easier to converge than the Re-stage, and the network is also smaller. Similarly, a batch size of 12 is used. After about 200 epochs, \(G_{Ent}\) gradually converges. The \(\beta_{1}\) and \(\beta_{2}\) of \(\mathcal{L}_{En}\) have undergone our limited tests. Similar to the Re-stage, the same scale has less impact on \(G_{En}\) convergence,so it is set to 0.01 and 10. After the convergence of the rest and En-stage training, the joint training is carried out. In the joint training, the loss function is the equal combined loss function mentioned above. Similarly, the ADAM optimizer (\(\beta_{1}=0.9\), \(\beta_{2}=0.99\)) is used, and LR is set to 0.0005, and a batch size of 8 is used. After training of approximately epoch 150, the convergence trend begins to end. After proxy training, optimized SSIM and HC are used to evaluate the proxy performance of two-stage proxy and end-to-end proxy [20]. The results are shown in Table 2.  
From this table, we can see that, compared to optimized SSIM, the proposed method has a greater improvement on HC. Due to the fact that HC measures more the differences in color and brightness, while optimized SSIM focuses more on the differences in structure and details, the two-stage proxy method proposed is more effective in restoring color and brightness compared to the end-to-end proxy method.