Lightweight face aging method based on dual attention mechanism

By introducing a dual attention mechanism and a lightweight network structure into the face aging algorithm, the problem of difficult deployment of face aging algorithm in the existing technology in embedded devices is solved, and high-resolution and high-resolution and high-resolution face aging image generation is achieved.

CN114445889BActive Publication Date: 2025-03-14WUHAN UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210095562.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-26
Publication Date
2025-03-14
Estimated Expiration
2042-01-26

AI Technical Summary

Technical Problem

The existing face aging algorithm has a large amount of calculation when deploying embedded devices, and the effect is not satisfactory and its authenticity is insufficient, making it difficult to achieve high-resolution face aging on mobile phones and other devices.

Method used

The lightweight face aging method based on the dual attention mechanism is adopted, and the identity feature extraction of face images is performed through traditional convolution, depth separation convolution, inverse bottleneck residuals, mixed domain attention and other technologies, and combined with the adaptive instance normalization layer to fusion age features to generate texture and color attention maps, and finally synthesize high-resolution aging face images.

Benefits of technology

It realizes the completion of network training under unsupervised learning, generates visually more realistic and clearer face aging images, and reduces the amount of computing, making it suitable for deployment on embedded devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114445889B_ABST
    Figure CN114445889B_ABST
Patent Text Reader

Abstract

The present invention provides a lightweight face aging method based on a dual attention mechanism, comprising the following steps: preprocessing an input face image; encoding an input target aging age and converting it into a multidimensional age vector; extracting identity features from the preprocessed face image to obtain a high-dimensional identity feature; inputting the multidimensional age vector into a multilayer perceptron to map it into an age-related high-dimensional age feature; obtaining a fused feature vector from the high-dimensional identity feature and the high-dimensional age feature through an adaptive instance normalization layer; using skip connections, upsampling, and multi-scale traditional convolutions on the fused feature vector to obtain a texture attention map and a color attention map; and finally obtaining an aging image of the face aged to the target age by fusing the texture attention map, the color attention map, and the input original image. The present invention can obtain a high-resolution image of the face aged to the target age.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of digital image processing, and in particular relates to a lightweight face aging method based on a dual attention mechanism. Background Art

[0002] With the improvement of living standards, people's pursuit of social entertainment quality is also increasing, and short videos have become the hottest social entertainment method. In the process of shooting short videos, the special effects simulation of face aging and rejuvenation has received unanimous praise from users due to its authenticity and fun. However, face aging is a very complex process that requires comprehensive consideration of various factors. In order to achieve the authenticity of the aging effect, the traditional algorithm has a relatively complex algorithm structure design. Especially in the process of realizing high-resolution face aging, the calculation amount of a single image is relatively large, which is not conducive to deployment on embedded devices such as mobile phones.

[0003] In order to solve the problem of difficulty in deploying face aging algorithms in embedded devices, researchers consider applying deep learning to face aging. Existing face aging algorithms usually design a relatively simple neural network model to achieve face aging. Although face aging can be achieved to a certain extent, the effect is not satisfactory and the authenticity is greatly reduced.

[0004] At present, lightweight network design has achieved great success in the field of deep learning and is also widely used in image processing research. However, it has been relatively less used in the specific field of face aging and requires more in-depth research, so there is still much room for improvement. Summary of the invention

[0005] The purpose of the present invention is to address the shortcomings of the above-mentioned background technology and to provide a lightweight face aging method based on a dual attention mechanism. Traditional convolution, depthwise separable convolution, inverted bottleneck residual, and mixed domain attention are used to extract identity features from input face images, and the target aging age is used as the input for image attribute editing. An adaptive instance normalization layer is used to realize the fusion of identity features and aging age features. By performing jump connections, upsampling, and convolution operations on the fused features, a texture attention map and a color attention map of the dual attention mechanism are generated. Finally, the texture attention map, the color attention map, and the original input image are combined to obtain a high-resolution image of the face that is finally aged to the target age, and network training can be completed under unsupervised learning conditions.

[0006] The technical solution adopted by the present invention is: a lightweight face aging method based on a dual attention mechanism, characterized in that it includes the following steps:

[0007] S1, preprocessing the input face image to achieve pixel normalization;

[0008] S2, encodes the input target aging age and converts it into a multi-dimensional age vector;

[0009] S3, extracting identity features from the preprocessed face image using an encoding network to obtain high-dimensional identity features;

[0010] S4, input the multi-dimensional age vector into a multi-layer perceptron, gradually increase the dimension, and map it into age-related high-dimensional age features;

[0011] S5, the high-dimensional identity feature and the high-dimensional age feature are fused through an adaptive instance normalization layer to obtain a fused feature vector;

[0012] S6, uses a decoding network constructed by skip connection, upsampling and multi-scale traditional convolution on the fused feature vector to obtain the texture attention map and color attention map; through the texture attention map, color attention map and input original image, the three are fused to obtain the final face aging image aged to the target age.

[0013] In the above technical solution, in step S1, the original input image x i Preprocessing, whose original age is i, is normalized according to the mean of [0.5, 0.5, 0.5] and the standard deviation of [0.5, 0.5, 0.5]. Stretching, cropping and noise are only introduced during the network training process to prevent overfitting of the network training.

[0014] In the above technical scheme, in order to solve the problem that common coding methods have weak correlation with adjacent ages, in step S2, a coding method combining classification and regression is designed. First, the age range in which the target aging age is located is confirmed, and the correlation between the target aging age and the boundary of the age range is obtained as the coding result through linear calculation, and a multi-dimensional age vector is obtained, so that the coding result retains a certain age correlation.

[0015] In the above technical solution, in step S2, according to the age interval width N=10, 0-100 years old is divided into 10 age intervals of 0-1, 1-2, 2-3…9-10, the input target aging age j is obtained, and the age interval is determined, that is, the age interval where j is located is the next integer A of j / N and the next integer B of j / N+1;

[0016] According to the determined age range, the correlation between the target age and the age range is calculated by the following formula group, and the correlation coefficients p and q can be obtained:

[0017] p+q=1

[0018] A×p+B×q=j

[0019] Then the encoding result of the target aging age j is an 11-dimensional vector T j :

[0020] m is an integer

[0021] In the above technical solution, in order to solve the problem of large amount of calculation and parameters in the traditional convolution method, in step S3, the encoding network includes a traditional convolution module, a depth-separable convolution module with a step size of 2, an inverted bottleneck residual module, and a mixed domain attention module; the traditional convolution module and the depth-separable convolution module with a step size of 2 in the encoding network are used to downsample and extract features of the preprocessed face image, the inverted bottleneck residual module in the encoding network is used to deepen the sampling depth for identity extraction, and the mixed domain attention module is used to enhance the encoding network's ability to extract important areas of identity features. The above method can effectively reduce the amount of parameters and calculations of the encoding network.

[0022] Preferably, one 7×7 traditional convolution module with a step size of 1 and two 3×3 depth-separable convolution modules with a step size of 2 are used to achieve downsampling and feature extraction, four 3×3 inverted bottleneck residual modules with a step size of 1 are used to deepen the convolution depth, and one mixed domain attention module is used to guide the network to extract important areas of features, and finally the image is extracted into a 128-dimensional n×n identity feature Z.

[0023] In the above technical solution, in step S4, the age vector in step S2 is input into a multi-layer perceptron of [11, 64, 128, 256], and the feature dimension is gradually increased to obtain a 256-dimensional 1×1 age vector L.

[0024] In the above technical solution, in order to reasonably and fully fuse the two feature vectors, in step S5, the high-dimensional age feature format is converted into two age feature vectors with the same dimension as the high-dimensional identity feature; the high-dimensional identity feature and the two age feature vectors are fused using an adaptive instance normalization layer (AdaIN) to obtain a fused feature vector AdaIN(Z,L) with the same dimension as the high-dimensional identity feature.

[0025]

[0026] Among them, Z represents identity features, L represents age features; μ(Z) and σ(Z) respectively represent the mean and standard deviation of identity features, which are calculated by mathematical formulas in the prior art; α(L) and β(L) respectively represent two age feature vectors after the age feature format is converted.

[0027] Preferably, the obtained 128-dimensional identity features and 256-dimensional age features are fused. First, the 256-dimensional features are compressed into two 128-dimensional 1×1 feature vectors, and then an adaptive instance normalization layer (AdaIN) is used to perform feature fusion to obtain a 128-dimensional n×n fused feature vector.

[0028] In the above technical solution, in order to solve the problem that the skip connection layer will weaken the role of the age information contained in the fusion feature during the decoding process, in step S6, a decoding network is constructed using a skip connection layer combined with an attention gate mechanism, an upsampling module, and a traditional convolution module to strengthen the role of age information in the decoding process, so that the generated image is closer to the target age; after the fusion feature vector is reduced in feature dimension and expanded in scale by using the decoding network, the output image of the decoding network is processed by two independent traditional convolution modules to generate a texture attention map R and a color attention map C that are consistent with the scale of the input image respectively; the unprocessed original face image x i The texture attention map R and the color attention map C are fused according to the following formula to finally obtain the aging face image x corresponding to the target age j ij :

[0029] x ij =R×x i +(1-R)×C

[0030] Preferably, two skip connection layers combined with an attention gate mechanism, two upsampling layers with a scale of 2, and two 3×3 traditional convolutions with a step size of 1 are used to construct a decoding network, and the resulting fused features are subjected to feature dimension reduction and scale expansion, and then two independent 7×7 traditional convolutions with a step size of 1 are used to generate a texture attention map R and a color attention map C that are consistent with the scale of the input image, respectively.

[0031] In the above technical solution, in order to enable the method to generate a face age composite image with more realistic vision and clearer details, step S7 is also included:

[0032] The authenticity discriminator used to discriminate the aging image result of the face finally aged to the target age is trained. The authenticity discriminator detects whether the input image is generated from step S6 and calculates the authenticity error loss value; the age discriminator is used to estimate the age of the aging face in the input image and calculate the age error loss value; the authenticity error loss value and the age error loss value are used to jointly guide the training process of the encoding network, multilayer perceptron and decoding network in steps S3-S6. The age discriminator uses VGG-FACE.

[0033] In the above technical solution, in order to solve the problem that the data set lacks paired data during the training process, step S8 is also included:

[0034] The face aging image result obtained in step S6 and the original age of the face image used in step S1 are input as the original face image and the target aging age using the cycle consistency principle, and steps S1-S6 are executed again to obtain an image of the aged image restored to the original age. The face image obtained by executing the above steps is compared with the original face image input in step S1 at the pixel level loss to guide the encoding network, multi-layer perceptron and decoding network training process of steps S3-S6.

[0035] In the above technical solution, in order to enable the method to generate a face age composite image with more realistic vision and clearer details, step S9 is also included:

[0036] Using the image reconstruction consistency principle, the original input image and the original age are used as the original face image and the target aging age input, and steps S1-S6 are executed again to obtain the original face image at the original age, which is compared with the original input face image at the pixel level and the age loss to guide the encoding network, multilayer perceptron and decoding network training process of steps S3-S6.

[0037] The present invention provides a computer-readable storage medium, on which is stored a program for a high-resolution facial image aging method using a dual attention mechanism for a lightweight network. When the program for a high-resolution facial image aging method using a dual attention mechanism for a lightweight network is executed by a processor, the steps of the high-resolution facial image aging method using a dual attention mechanism for a lightweight network described in the above technical solution are implemented.

[0038] The beneficial effects of the present invention are as follows: the present invention uses a depthwise separable convolution and an inverted bottleneck residual module to reduce the amount of computation required by a computer to extract identity features from a face image; uses an adaptive instance normalization layer to reduce the amount of computation required for high-dimensional spatial feature fusion; uses a fusion method of a texture attention map, a color attention map and an original input image to reduce the pixel loss between an aging image and an original image, thereby achieving high-resolution synthesis of aging face images; and uses a cycle consistency principle and a reconstruction consistency principle to achieve an unsupervised network training process. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 A flowchart of a lightweight face aging method based on a dual attention mechanism of the present invention;

[0040] Figure 2 A schematic diagram of the network structure of a lightweight face aging method based on a dual attention mechanism of the present invention;

[0041] Figure 3 This is a comparison chart between depth-wise separable convolution and traditional convolution;

[0042] Figure 4Comparison diagram of the inverted bottleneck residual module and the traditional residual module;

[0043] Figure 5 Schematic diagram of the skip connection layer combined with the attention gate mechanism;

[0044] Figure 6 A diagram showing the training process of a lightweight face aging method based on a dual attention mechanism according to the present invention;

[0045] Figure 7 This is a face aging effect diagram of a lightweight face aging method based on a dual attention mechanism of the present invention (the original image is 34 years old, and the aged image is 65 years old). DETAILED DESCRIPTION

[0046] The present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments to facilitate a clear understanding of the present invention, but they do not constitute a limitation on the present invention.

[0047] The present invention provides a lightweight face aging method based on a dual attention mechanism, which mainly includes: Figure 1 As shown in Figure 1, there are five aspects: input face image and target aging age preprocessing, face image identity extraction, high-dimensional age feature mapping, identity and age feature fusion, dual attention map generation and aging face image synthesis; Figure 6 As shown in the figure, the unsupervised training process of the network model includes the following steps:

[0048] 1. Input face image and target aging age preprocessing, including:

[0049] (1-1) The input face image is normalized, stretched and randomly cropped during the training process, and Gaussian noise is added to prevent overfitting of the network training. Specifically:

[0050] (1-1-1) The threshold range of the RGB channel of the input face image is adjusted from 0-255 to 0-1, and the normalized image is made to meet the mean of [0.5, 0.5, 0.5] and the standard deviation of [0.5, 0.5, 0.5]. During the training process, it is necessary to perform additional stretching and cropping before image normalization to stretch the image to 1.1 times the original size. In the stretched image, the image of the original size is randomly cropped, and Gaussian noise with an expectation of 0.5 and a variance of 0.5 is added after the face image is normalized.

[0051] (1-2) Encode the target aging age j, combine classification and regression encoding methods, first confirm the age range where the target age is located, obtain the correlation between the target age and the age range boundary through linear calculation, and output the age feature, specifically:

[0052] (1-2-1) According to the age interval width N=10, 0-100 years old is divided into 10 age intervals of 0-1, 1-2, 2-3…9-10, the input aging age j is obtained, and the age interval is determined, that is, the age interval where j is located is the next integer A of j / N and the next integer B of j / N+1.

[0053] (1-2-2) According to the age range determined by (1-2-1), the correlation between the target age and the age range is calculated by the following formula group, and the correlation coefficients p and q are obtained.

[0054] p+q=1

[0055] A×p+B×q=j

[0056] The encoding result of aging age j is an 11-dimensional vector T j ; In the following formula, m is an integer corresponding to the age range

[0057]

[0058] 2. Face image identity extraction, including the following steps:

[0059] (2) Use the traditional convolution module with a step size of 1, the depthwise separable convolution module with a step size of 2, the inverted bottleneck residual module, and the mixed domain attention module to construct an encoding network to extract identity features from the preprocessed face image. This step specifically includes the following sub-steps:

[0060] (2-1) Figure 2 As shown in the figure, a 7×7 traditional convolution with a padding of 3 and a stride of 1 is used for calculation, and the activation function is selected as ReLU. While preserving the higher receptive field of the convolution, it realizes the mapping from the 3×n×n low-dimensional space to the 32×n×n feature space.

[0061] (2-2) Figure 2 As shown in the figure, two 3×3 depthwise separable convolutions with padding of 1 and stride of 2 are used in succession. The activation function is h-swish. The convolution with stride of 2 can replace the pooling layer to achieve feature scale reduction. While reducing the parameters and the amount of calculation, the feature space can be reduced from 32×n×n to Then conversion.

[0062] Depthwise Separable Convolution ( Figure 3 The lower convolution module in the figure) is different from the traditional convolution ( Figure 3 The mixed domain convolution of the upper convolution module in the figure adopts the channel-by-channel convolution and point-by-point convolution methods to achieve the same convolution effect while greatly reducing the demand for computing power. The specific structure comparison is as follows: Figure 3 shown.

[0063] (2-3) Figure 2 As shown in the figure, four inverted bottleneck residual modules are used continuously for calculation, and the activation function is selected as h-swish. While reducing the parameters and the amount of calculation, the network is strengthened for extracting deep features.

[0064] The inverted bottleneck residual module is different from the traditional residual module. It uses point-by-point convolution to increase the dimension and depth-wise separable convolution to reduce the dimension. It introduces lightweight SE attention in the middle to achieve the extraction of deeper features with low computational complexity. The specific structure is compared as follows: Figure 4 As shown, the left side is the traditional residual module, and the right side is the inverted bottleneck residual module used in this method.

[0065] (2-4) Figure 2 As shown in the figure, a mixed-domain attention module is used to further guide the encoding network to focus on extracting the identity feature interest region.

[0066] 3. High-dimensional age feature mapping, including the following steps:

[0067] (3) For the age vector T of length 11, a multilayer perceptron with a dimension transformation of [11, 64, 128, 256] is used to map it to 256 dimensions, and a Sigmoid function is used for nonlinear mapping to obtain a 256-dimensional 1×1 age feature L.

[0068] L=G(b (3) +W (3) (s(b (2) +W (2) (s(b (1) +W (1) *T)))))

[0069] Where W represents the weight matrix of the fully connected layer, b represents the bias matrix of the fully connected layer, T represents the target aging age encoding result obtained by (1-2-2), G is the softmax function, and s is the Sigmoid function.

[0070] 4. Identity and age feature integration includes the following steps:

[0071] (4) First, the 256-dimensional 1×1 age feature L format is converted into two 128-dimensional 1×1 feature vectors, and then the adaptive instance normalization layer (AdaIN) is used for feature fusion. The fusion formula is as follows, and the 128-dimensional n×n fused feature AdaIN(Z,L) is obtained.

[0072]

[0073] μ(Z) and σ(Z) represent the mean and standard deviation of the identity feature, respectively, and are calculated using mathematical formulas in the prior art; α(L) and β(L) represent two 128-dimensional feature vectors after the age feature format is converted.

[0074] 5. Dual attention map generation and aged face image synthesis, including the following steps:

[0075] (5) Using skip connections, upsampling, and multi-scale traditional convolutions on the fused features, texture attention maps and color attention maps are obtained. The texture attention map, color attention map, and input original image are combined to obtain the final face aging image aged to the target age. This step specifically includes the following sub-steps:

[0076] (5-1) Figure 2 As shown in the figure, a skip connection layer combined with an attention gate mechanism is used to fuse features as gating signals to guide the weights of the skip connection layer, ultimately highlighting salient image regions and suppressing task-irrelevant feature responses.

[0077] The attention gate mechanism is as follows Figure 5 As shown, the fusion feature is used as the gating signal x g , first perform a 1×1 traditional convolution, and its compression feature is H g ×W g ×1, the skip connection layer is used as the controlled signal x l , the same 1×1 traditional convolution is performed, and the compressed feature is H l ×W l ×1, where H represents the height of the feature, W represents the width of the feature, and the subscripts l and g represent the corresponding signal sources; the two 1-dimensional vectors are concat to a 2-dimensional vector, and then undergo a 7×7 convolution to obtain H l ×W l ×1 Resampler layer, with the controlled signal x l Multiply to get the final output signal

[0078] (5-2) Figure 2 As shown in the figure, in this network structure, the fusion feature is completely consistent with the feature scale of the jump connection layer combined with the attention gate mechanism. The two are concat-connected together, and two upsampling with a scale factor of 2 and a 3×3 traditional convolution with a step size of 1 are used to realize the feature space from arrive Then to 32×n×n conversion.

[0079] (5-3) Figure 2As shown in the figure, the 32×n×n feature vector is convolved with 7×7×1 and 7×7×3 respectively to obtain the texture attention map R and the color attention map C, which are then fused with the original input image according to the following formula to finally obtain the aging image x ij .

[0080] 6. The unsupervised training process of the network model includes the following steps:

[0081] (6) Figure 6 As shown in the figure, during the network training process, the aging image obtained needs to be judged by the authenticity discriminator D, and the judgment result is used as the original loss function L of GAN GAN Guide the training of encoder network, decoder network, and multilayer perceptron.

[0082] L GAN (E,G,M)=E x~P(x) E y~P(y) [(D(G(E(x),M(y)))-1) 2 ]

[0083] Where E x~P(x) It represents the mathematical expectation under the distribution of input image x that conforms to P(x), E(*) represents the encoding network, G(*) represents the decoding network, M(*) represents the multilayer perceptron, P(x) represents the true distribution of the input image, P(y) represents the true distribution of the target aging age label, x represents the original input face image, and y represents the target aging age.

[0084] When guiding the discriminator D to train itself, the loss function is as follows

[0085] L GAN (D)=E x~P(x) E y~p(y) [(D(G(E(x),M(y)))) 2 ]+E x~P(x) [(D(x)-1) 2 ]

[0086] Where E x~P(x) It represents the mathematical expectation under the distribution of input image x that conforms to P(x), E(*) represents the encoding network, G(*) represents the decoding network, M(*) represents the multilayer perceptron, P(x) represents the true distribution of the input image, P(y) represents the true distribution of the target aging age label, x represents the original input face image, and y represents the target aging age.

[0087] The age discriminator V uses the existing VGG-FACE discriminator, so it does not need to be trained. The aged image is input into the face discriminator to get the estimated age, which is compared with the target age to get the loss function L age1 .

[0088]

[0089]

[0090] Where P(y j ) represents the target age distribution, C(y j ) represents the target age y j 101 vector obtained by One-hot encoding; L CE represents the cross entropy loss function.

[0091] (7) Figure 6 As shown in the figure, during the training process, there is a lack of paired data of the same subject at different ages for supervised learning. Therefore, the cycle consistency principle is used to solve this problem.

[0092] Theoretically, this method can obtain an image x aged to the target age through the above steps. ij , due to the lack of supervised samples, the aging image x ij Repeat the above steps to restore it to the original age i and obtain the restored image x iji , and the original image x i By comparison, we get the pixel-level loss function L cycle .

[0093] L cycle =||x i -x iji || 1·

[0094] where x i represents the original input image, x iji represents the cyclic reconstruction of the image, || || 1· Indicates L1 norm calculation.

[0095] At the same time, during the training process, it is necessary to constrain the identity feature Z obtained by the two encodings to guide the encoder to extract the accuracy of the identity feature. Therefore, the loss function is the Pearson correlation coefficient L id .

[0096]

[0097] Where μ and σ are the mean and standard deviation respectively, Z1 represents the identity feature extracted by the encoding network from the input original image during the aging process, and Z2 represents the identity feature extracted by the encoding network from the input aged image during the cyclic reconstruction process.

[0098] (8) Figure 6 As shown, in order to improve the quality of network image generation and age accuracy, the reconstruction consistency principle is adopted.

[0099] In theory, this method converts the original image x i and the original age i as the algorithm input, the reconstructed image x can be obtained ii , and the original image x i By comparison, we get the pixel-level loss function L recon And the age loss function L age2 .

[0100] L recon =||x i -x ii || 1·

[0101]

[0102] where || || 1· represents L1 norm calculation, P(y i ) represents the original age distribution, C(y i ) represents the original age y i 101 vector obtained by One-hot encoding; L CE represents the cross entropy loss function.

[0103] (9) Figure 6 As shown, the final loss function of the training generative network G for the lightweight face aging method based on the dual attention mechanism is L all As the target loss function, the Adam optimizer is used for parameter optimization to guide the training process of the encoding network, multilayer perceptron, and decoding network in steps S3-S6;

[0104] L all =λ GAN L GAN (E,G,M)+λ recon L recon +λ cycle L cycle +λ id L id +λ age1 L age1 +λ age2 L age2

[0105] It is easy for those skilled in the art to understand that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modification, equivalent replacement and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention. The contents not described in detail in this specification belong to the prior art known to professional and technical personnel in the field.

Claims

1. A lightweight face aging method based on dual attention mechanism, characterized by: The following steps are involved: S1, preprocessing the input face image to achieve pixel normalization; S2, encodes the input target aging age and converts it into a multi-dimensional age vector; S3, extracting identity features from the preprocessed face image using an encoding network to obtain high-dimensional identity features; S4, input the multi-dimensional age vector into a multi-layer perceptron, gradually increase the dimension, and map it into age-related high-dimensional age features; S5, the high-dimensional identity feature and the high-dimensional age feature are fused through an adaptive instance normalization layer to obtain a fused feature vector; S6, using a decoding network constructed by skip connection, upsampling and multi-scale traditional convolution on the fused feature vector to obtain a texture attention map and a color attention map; through the fusion of the texture attention map, the color attention map and the input original image, the three are finally aged to obtain the face aging image of the target age; In step S2, the coding method of classification and regression is combined to first confirm the age range where the target aging age is located, and obtain the correlation coefficient between the target aging age and the boundary of the age range as the coding result by linear calculation, so as to obtain a multi-dimensional age vector; In step S3, the encoding network includes a traditional convolution module, a depth-wise separable convolution module with a step size of 2, an inverted bottleneck residual module, and a mixed domain attention module; The preprocessed face images are downsampled and identity features are extracted using a traditional convolution module and a depthwise separable convolution module with a stride of 2. The inverted bottleneck residual module is used to deepen the sampling depth for identity feature extraction, and the mixed domain attention module is used to enhance the encoding network's ability to extract important areas of identity features. In step S5, the single high-dimensional age feature format is split into two age feature vectors having the same dimension as the high-dimensional identity feature; use The adaptive instance normalization layer performs feature fusion on the high-dimensional identity feature and the two age feature vectors to obtain a fused feature vector AdaIN(Z,L) with the same dimension as the high-dimensional identity feature. Wherein, Z represents identity feature, L represents age feature, μ(Z) and σ(Z) represent the mean and standard deviation of identity feature respectively, which are calculated by mathematical formula in the prior art; α(L) and β(L) represent two age feature vectors after the age feature format conversion respectively; In step S6, a decoding network is constructed using a skip connection layer combined with an attention gate mechanism, an upsampling module, and a traditional convolution module; after the fusion feature vector is reduced in feature dimension and expanded in scale using the decoding network, the output image of the decoding network is processed using two independent traditional convolution modules to generate a texture attention map R and a color attention map C that are consistent with the scale of the input image; the unprocessed original face image x i The texture attention map R and the color attention map C are fused according to the following formula to finally obtain the aging face image x corresponding to the target age j ij : x ij =R×x i +(1-R)×C。 2. The lightweight face aging method based on dual attention mechanism according to claim 1, characterized in that: The step S7 is also included: Training an authenticity discriminator for discriminating the face aging image result finally aged to the target age, the authenticity discriminator detecting whether the input image is from the one generated in step S6, and calculating the authenticity error loss value; Use the age discriminator to estimate the age of the aging face in the input image and calculate the age error loss value; The authenticity error loss value and the age error loss value are used to jointly guide the encoding network, multilayer perceptron and decoding network training processes in steps S3-S6.

3. The lightweight face aging method based on dual attention mechanism according to claim 1, characterized in that: It also includes step S8: The face aging image result obtained in step S6 and the original age of the face image used in step S1 are input as the original face image and the target aging age using the cycle consistency principle, and steps S1-S6 are executed again to obtain an image of the aged image restored to the original age. The face image obtained by executing the above steps is compared with the original face image used in step S1 at the pixel level loss to guide the encoding network, multi-layer perceptron and decoding network training process of steps S3-S6.

4. The lightweight face aging method based on dual attention mechanism according to claim 1, characterized in that: The step S9 is also included: Using the image reconstruction consistency principle, the original input image and the original age are used as the original face image and the target aging age input, and steps S1-S6 are executed again to obtain the original face image at the original age, which is compared with the original input face image at the pixel level and the age loss to guide the encoding network, multilayer perceptron and decoding network training process of steps S3-S6.

5. The lightweight face aging method based on dual attention mechanism according to claim 1, characterized in that: In step S2, according to the age interval width N=10, 0-100 years old is divided into 10 age intervals of 0-1, 1-2, 2-3...9-10, and the input target aging age j is obtained, and the age interval is determined, that is, the age interval where j is located is the lower integer A of j / N and the lower integer B of j / N+1; according to the determined age interval, the correlation between the target age and the age interval is calculated by the following formula group, and the correlation coefficient p, q can be obtained; p+q=1 A×p+B×q=j Then the encoding result of the target aging age j is an 11-dimensional vector T j : 。 6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program for a high-resolution facial image aging method with a dual attention mechanism for a lightweight network. When the program for a high-resolution facial image aging method with a dual attention mechanism for a lightweight network is executed by a processor, the steps of the high-resolution facial image aging method with a dual attention mechanism for a lightweight network as described in any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Face sketch image aging synthesis method and device and storage medium

    CN110222588A

  • Anti-age-interference face recognition method based on multi-space-time information fusion

    CN111611877A