The invention relates to a face
image restoration method introducing an attention mechanism, and the method comprises the steps: (1) obtaining an
original data set, carrying out the image preprocessing, obtaining a needed face image
data set, and reasonably dividing and arranging the face image
data set into a
test set and a
data set; (2) inputting the training data set into an
image restoration model introduced into a context attention layer for training, wherein two parallel
encoder networks are introduced into a generator network, one
encoder network is used for performing
convolution operation to extract advanced feature images, and the other
encoder is used for introducing a context attention layer network to realize long-range association between a foreground region and a backgroundregion; and (3) inputting the
test data set into the trained face restoration model, and testing the restoration capability of the trained restoration model for the defective face image. According tothe method, after the context attention layer is introduced, the problem that the background region information cannot be fully utilized by the restoration model due to the limited
receptive field size of the
convolutional neural network is solved, the long-range association of the
background information and the foreground region is realized, and the background region information is fully utilizedto fill the foreground region. After the context attention layer is introduced, the restoration model obtains a better restoration effect on some detail textures, and the restoration effect of the face image is also improved on the whole.