(54.2, 1.8){\fbox{\includegraphics[trim=200px 0px 360px 350px, clip, scale=0.3]{./figure/discussion/L_B_orig}}}
\end{overpic}
}
\subfigure[The manipulated output]
{
\begin{overpic}[width=0.23\linewidth]{./figure/discussion/L_B_out}
\put(54.2, 1.8){\fbox{\includegraphics[trim=200px 0px 360px 350px, clip, scale=0.3]{./figure/discussion/L_B_out}}}
\end{overpic}
}
\subfigure[The histogram of the output]{\includegraphics[width=0.23\linewidth]{./figure/discussion/L_out_hist}}
\caption{The result of global luminance histogram manipulation. We replace the global luminance histogram of image (b) with that of (a) during the forward process to analyze our network.  (c) and (d) show the result and the change of the histogram. As the deep network recognizes the content of (a) that consists of many dark and bright pixels, we can see that the histogram (red) shifts to the middle from the original (blue).}
\label{fig:discussion_1}
\end{figure*}

\begin{figure*}
\center
\subfigure[An external image]{\includegraphics[width=0.23\linewidth]{./figure/discussion/rg_A}}
\subfigure[Original]{
\begin{overpic}[width=0.23\linewidth]{./figure/discussion/rg_B_orig}
\put(54.2, 1.8){\fbox{\includegraphics[trim=200px 70px 360px 290px, clip, scale=0.3]{./figure/discussion/rg_B_orig}}}
\end{overpic}
}
\subfigure[The manipulated output]
{
\begin{overpic}[width=0.23\linewidth]{./figure/discussion/rg_B_out}
\put(54.2, 1.8){\fbox{\includegraphics[trim=200px 70px 360px 290px, clip, scale=0.3]{./figure/discussion/rg_B_out}}}
\end{overpic}
}
\subfigure[Errormap]{\includegraphics[width=0.23\linewidth]{./figure/discussion/rg_B_err}}
\caption{The result of global chromiance histogram manipulation. This time we manipulated the color histogram where (a) is the image from which we extract the global chrominance histogram. (c) shows the manipulated output and (d) shows the errormap between (b) and (c). As the network recognizes the color distribution of image (a), the network modifies color more in the green and the brown regions.}
\label{fig:discussion_2}
\end{figure*}


\subsection{Experimental results}
Table~\ref{table:quantitative} shows the quantitative results using the 50 test images in our dataset for each camera.
In the table, PSNR values comparing the RGB values of the recovered image with the ground truth are reported. 
For both the forward rendering (RAW-to-sRGB) and the reverse rendering (sRGB-to-RAW), the proposed method outperforms the other baseline methods in all categories except for very few Min and MaX errors among test images. 

Results using the MLP were usually worse than the other methods and this indirectly indicates the scene dependency in photographs. 
While the SRCNN showed some ability to deal with the scene dependency, its receptive field is limited to local neighborhoods and it cannot model the global scene context.
The MLP and the SRCNN are optmized to model the mean of the color mapping in dataset and some of high values of the Min and the Max values in the results can be explained that some test images exist around the mean of our dataset.

One can expect that hierarchical CNN features are able to capture the local and the global scene context that are useful for the scene dependent imaging. 
However, the experimental results show that they are not as efficient as our color histogram features.
We attribute the bad performance of the FCN to the fact that the FCN is not sufficiently trained on only hundreds of training examples.
Although we could sufficiently train the HCN through the in-network sampling method~\cite{BansalChen16,Larsson16}, concatenating multi-level upsampled feature maps consume large memory for high-definition images from consumer cameras, which cannot be handled in test time.
In summary, the results clearly show that our deep network that learns the local and the global color distribution is more efficient for accurately modelling the scene dependent image processing in cameras.

\Fref{fig:qualitative} shows some of the examples of the image recovery. 
The figure shows that the proposed method can model the in-camera imaging process accurately in a qualitative way.
It also shows that the other baseline methods also do a reasonable job of recovering images as the scene dependency applies to a set of specific colors or regions.

\begin{figure*}
\subfigure[]{
\begin{tabular}{c@{}c@{}c}
\multicolumn{3}{c}{\includegraphics[width=0.3\linewidth]{./figure/deblurring/B}} \\
\includegraphics[width=0.097\linewidth]{./figure/deblurring/B_img}
\includegraphics[width=0.097\linewidth]{./figure/deblurring/B_deblur_jpg}
\includegraphics[width=0.097\linewidth]{./figure/deblurring/B_deblur_raw}
\end{tabular}
}
\subfigure[]{
\begin{tabular}{c@{}c@{}c}
\multicolumn{3}{c}{\includegraphics[width=0.3\linewidth]{./figure/deblurring/A}} \\
\includegraphics[width=0.097\linewidth]{./figure/deblurring/A_img}
\includegraphics[width=0.097\linewidth]{./figure/deblurring/A_deblur_jpg}
\includegraphics[width=0.097\linewidth]{./figure/deblurring/A_deblur_raw}
\end{tabular}
}
\subfigure[]{
\begin{tabular}{c@{}c@{}c}
\multicolumn{3}{c}{\includegraphics[width=0.3\linewidth]{./figure/deblurring/C}} \\
\includegraphics[width=0.097\linewidth]{./figure/deblurring/C_img}
\includegraphics[width=0.097\linewidth]{./figure/deblurring/C_deblur_jpg}
\includegraphics[width=0.097\linewidth]{./figure/deblurring/C_deblur_raw}
\end{tabular}
}
\caption{Image deblurring results. Blurred images are shown on top. In the bottom: original blurred image patch, deblurred result using~\cite{pan2016blind} in sRGB space, and deblurred result in RAW space. Deblurring in RAW space outputs much sharper images.}
\label{fig:deblurring}
\end{figure*}


\subsection{Analysis}
We conducted more experiments to analyze the scene dependent processing learned by our network. 
For the analysis, we use two RAW images A and B. 
We first extract the learnable histogram feature from A, and replace the extracted histogram of B with that of A before injecting it to the DNN forward process. 
Note that the RAW image itself is the same, we just simulate the scene context change by changing the histogram. 
The intention of this analysis is to see how our network responds to the changes in the scene context. 

\Fref{fig:discussion_1} shows the result of manipulating the global luminance histogram. 
The histogram in \fref{fig:discussion_1} (a) indicates the luminance distribution of a high contrast image, which is typical for backlit photos. We replace the histogram (a) with that of image (b) during the forward process of (b).
\Fref{fig:discussion_1} (c) and (d) show the result of the manipulation. As can be seen, the deep network brightens shadow regions and darken highlight regions.
The network recognizes many dark regions and bright regions in the given histogram, and compensates by shifting the brightness to the middle (red in \fref{fig:discussion_1} (d)) compared to the original histogram (blue in \fref{fig:discussion_1} (d)). Note that it is what the Auto Lighting Optimizer of Canon cameras does as described in~\cite{CanonBrochure}.

In \fref{fig:discussion_2}, we show the result of manipulating the global chrominance histogram by going through the same process as explained above. 
By changing the global color context