Colorizing grayscale images automatically has consistently posed a formidable challenge, and in recent years approaches using deep neural networks have become mainstream techniques. However, the results of colorizing these images remain unsatisfactory, ignoring color richness and structural consistency. As a result, we propose an image coloring method based on the combination of a sparse attention mechanism network and a color distribution predictor. Firstly, the color distribution predictor uses anchors to predict the color distribution of different regions or pixels in the image, so that the model can better understand the color relationship of different regions in the image, and make the coloring results more natural and consistent with the real-world color distribution. The sparse attention-based Transformer network is then used to generate a low-resolution coarse coloring by reference to the sampled anchor color first, before upsampling it to a high-resolution image. Sparse attention not only accelerates the training and inference process of the Transformer model, but also improves the coloring quality as well as preserves image details. The results show that our method achieves significant superiority, reducing computational complexity, improving efficiency, and producing more realistic color images with better coloring results.
|