Pix2Pix-Based Grayscale Image Coloring Method
Hong Li, Qiaoxue Zheng, Jing Zhang, Zhuoming Du, Zhanli Li, Baosheng Kang · Journal of Computer-Aided Design & Computer Graphics · 2021
In this study, a grayscale image coloring method combining the Pix2Pix model is proposed to solve the problem of unclear object boundaries and low image coloring quality in colorization neural networks. First, an improved U-Net structure, using eight down-sampling and up-sampling layers, is adopted to extract features and predict the image color, which improves the network model’s ability to extract deep image features. Second, the coloring image quality is tested under different loss functions, L1 loss and smooth L1 loss, to measure the distance between the generated image and ground truth. Finally, gradient penalty is added to improve the network stability of the training process. The gradient of each input data is penalized by constructing a new data distribution between the generated and real image distribution to limit the discriminator gradient. In the same experimental environment, the Pix2Pix model and summer2winter data are utilized for comparative analysis. The experiments demonstrate that the improved U-Net using the smooth L1 loss as generator loss generates better colored images, whereas the L1 loss better maintains the structural information of the image. Furthermore, the gradient penalty accelerates the model convergence speed, and improves the model stability and image quality. The proposed image coloring method learns deep image features and reduces the image blurs. The model raises the image quality while effectively maintaining the image structure similarity.