  This paper presents a comprehensive study of applying the convolutional
neural network (CNN) to solving the demosaicing problem. The paper presents two
CNN models that learn end-to-end mappings between the mosaic samples and the
original image patches with full information. In the case the Bayer color
filter array (CFA) is used, an evaluation with ten competitive methods on
popular benchmarks confirms that the data-driven, automatically learned
features by the CNN models are very effective. Experiments show that the
proposed CNN models can perform equally well in both the sRGB space and the
linear space. It is also demonstrated that the CNN model can perform joint
denoising and demosaicing. The CNN model is very flexible and can be easily
adopted for demosaicing with any CFA design. We train CNN models for
demosaicing with three different CFAs and obtain better results than existing
methods. With the great flexibility to be coupled with any CFA, we present the
first data-driven joint optimization of the CFA design and the demosaicing
method using CNN. Experiments show that the combination of the automatically
discovered CFA pattern and the automatically devised demosaicing method
significantly outperforms the current best demosaicing results. Visual
comparisons confirm that the proposed methods reduce more visual artifacts than
existing methods. Finally, we show that the CNN model is also effective for the
more general demosaicing problem with spatially varying exposure and color and
can be used for taking images of higher dynamic ranges with a single shot. The
proposed models and the thorough experiments together demonstrate that CNN is
an effective and versatile tool for solving the demosaicing problem.
