| The objects in the natural world are rich and colorful,and color will provide rich information to human beings.However,due to the limitations of early imaging technology,or the limitations of modern imaging equipment,such as medical imaging,radar imaging,etc.,pictures or videos can only contain grayscale information,which greatly restricts the ability of human beings to obtain information.Therefore,how to color grayscale images in line with human cognition has become a hot topic.In essence,natural objects contain a variety of colors.Image colorization is a pathological problem.Coloring the same object can have multiple results.Affected by this uncertainty,grayscale image colorization is still a challenging task.The traditional coloring method needs a lot of manpower,and the coloring result also depends on the individual understanding and professional level of the colorer to a large extent.With the development of deep learning,fully automatic coloring becomes possible,and the results of coloring are also diverse.However,there are still problems such as insufficient color saturation and color blurring.In this paper,the grayscale image coloring algorithm is studied based on deep learning.The main work contents and innovations are as follows:1)A two-stage coloring method based on Vision Transformer is presented.Aiming at the disadvantage of desaturation in most image coloring methods,a coloring model combining Vision Transformer,color attention mechanism,and color correction network is proposed.This method regards the coloring problem as a classification problem,takes the standard Vision Transformer as the gray image feature extractor,adds color attention to the decoder to classify the color to the ab plane of the quantized Lab space,and uses convolutional neural network to refine the color in the second stage according to the results of the classification in the first stage.The experimental results show that this method can effectively improve the problem of color unsaturation and color fineness in the process of colorization,and make the colorization results more in line with the human eye preference.2)A two-stage coloring method based on Swin-Unet is presented.Aiming at the problem of color halo in image coloring methods,this paper proposes a coloring model which combines Unet,Swin Transformer,color attention mechanism,and color regression network.This method follows the idea that color is regarded as classification.The main feature extractor is the Swin Transformer.The decoder is also changed to the Swin Transformer model,and the color attention mechanism and brightness selection mask are added.The low-dimensional information extracted by the encoder and the high-dimensional information extracted by the decoder are spliced together through the crossing connection using the Unet architecture.The color result is then processed through the color correction network for two-stage refinement.The experimental results show that this method improves the problem of color halo in the coloring process,and the coloring effect is more accurate and full of vitality.In the experimental stage,the model is evaluated by using peak signal-to-noise ratio(PSNR),structural similarity(SSIM)and Colorfulness.Experimental verification on the test set consisting of the first 5000 images of the Image Net ILSVRC2012 test set shows that,the PSNR value,SSIM value and Colorfulness value are all ahead of the comparison algorithm.Under the premise of ensuring accurate coloring and high saturation,it can also identify and color small-scale targets,reaching the cutting-edge level of the current deep learning coloring algorithm. |