Face recognition anti-attack defense method based on GAN
By generating images of eyes, nose, and mouth based on GAN and combining DCT transform and various loss functions for optimization, the problems of unnatural adversarial examples and low attack success rate are solved, achieving more natural and efficient adversarial attack effects.
Patent Information
- Application Number
- CN202410836281.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-26
- Publication Date
- 2024-11-22
- Estimated Expiration
- 2044-06-26
AI Technical Summary
Existing methods for generating adversarial examples for face recognition produce unnatural examples, have low attack success rates, and exhibit low model transferability.
A GAN-based approach is adopted to generate images of eyes, nose, and mouth through a global GAN generator and a local GAN generator. The generator and discriminator are optimized by combining DCT transform and various loss functions to generate adversarial examples with high naturalness, high attack success rate, and strong transferability.
The generated adversarial examples are more natural and can effectively attack face recognition models, improving the accuracy and transferability of attacks and protecting face images from illegal face recognition systems.
Smart Images

Figure CN119006974A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of face recognition technology, and in particular to a GAN-based face recognition counterattack defense method. Background Art
[0002] The rapid development of face recognition technology has brought about a huge social impact. The collection of face data in scenarios such as social media and public place surveillance has become the norm, however, this also makes individual privacy more vulnerable to infringement. Face recognition systems can be used to identify social media profiles and track user relationships through large-scale photo analysis. This excessive monitoring of users urgently requires an effective method to help individuals protect their facial images from unauthorized face recognition systems.
[0003] At present, the main methods for protecting facial privacy are: obfuscation technology, data poisoning attacks, and avoidance using adversarial examples.
[0004] Using adversarial examples to initiate evasion is the mainstream face privacy protection method now. It intentionally creates confusing inputs to deceive the facial recognition system and make it make errors in practical applications. The mainstream adversarial example evasion attack method is mainly impersonation, that is, making the generated adversarial examples be identified as the specified Target. Adversarial examples are generated by making small but targeted perturbations to the input data. This perturbation is small enough to be imperceptible to the human eye, but sufficient to cause the machine learning model to produce incorrect output. For example, AMT-GAM, which has been popular in recent years, designed a regularization module based on feature disentanglement to improve the visual quality of adversarial images, and then developed a joint training pipeline to train the generator, discriminator and regularization module. The generator can complete two tasks at the same time, makeup transfer and adversarial attack, and establish a robust mapping between different data manifolds. It has good effects on various commercial face recognition APIs, but the generation of adversarial examples is overly dependent on reference images of makeup, and the generated adversarial examples with makeup are very unnatural, especially when generating adversarial examples for male face images. Most of the existing methods for avoiding adversarial examples have the problem that the generated adversarial examples are unnatural and the success rate of adversarial examples being recognized as the target identity by face recognition models is low. Summary of the invention
[0005] The present invention provides a GAN-based face recognition adversarial attack defense method to overcome the problems existing in most existing face privacy protection methods, such as unnatural generated adversarial examples, low attack success rate, and low transferability of attack models.
[0006] In order to achieve the above object, the technical solution of the present invention is:
[0007] A GAN-based face recognition adversarial attack defense method, comprising:
[0008] S1: Inputting the original face image and the face facial expression unit into the global GAN generator, and using the discriminator for adversarial training to obtain the original adversarial example image that conforms to the face facial expression unit;
[0009] S2: cropping the original face image to obtain images of eyes, nose and mouth; constructing an overall GAN generator, an eye GAN generator, a nose GAN generator and a mouth GAN generator; and inputting the original face image and the images of eyes, nose and mouth and the facial expression unit into the overall GAN generator, the eye GAN generator, the nose GAN generator and the mouth GAN generator to obtain generated overall, eye, nose and mouth images;
[0010] S3: cropping the original adversarial example image to obtain adversarial images of eyes, nose and mouth; performing DCT transformation on the generated whole body, eyes, nose and mouth images and the original adversarial example image, adversarial images of eyes, nose and mouth, and removing high-frequency components; calculating the naturalness loss function of the whole body, eyes, nose and mouth images generated after DCT transformation and removal of high-frequency components and the original adversarial example image, adversarial images of eyes, nose and mouth;
[0011] S4: inputting the whole image of the target to be tested and cropping the whole image of the target to be tested into target images of eyes, nose and mouth, subjecting the original adversarial example image, the adversarial images of the eyes, nose and mouth, the whole image of the target to be tested and the target images of the eyes, nose and mouth to DCT transformation respectively, and removing low-frequency components, and calculating the attack success rate loss function of the original adversarial example image, the adversarial images of the eyes, nose and mouth after DCT transformation and removal of low-frequency components, the whole image of the target to be tested and the target images of the eyes, nose and mouth;
[0012] S5: construct k pre-trained face recognition models, transform the original adversarial example image by probability through the input diversity function Tp, attack the face recognition model, and obtain a diversity attack loss function of the adversarial example processed by the input diversity function Tp and the feature image obtained by the face recognition model of the overall image of the target to be tested;
[0013] S6: Use the three loss functions to update the parameters of the global GAN generator and the discriminator, input the original face image into the updated global GAN generator and discriminator, and generate a final adversarial example.
[0014] Furthermore, the original face image and the face facial expression unit are input into the global GAN generator, and adversarial training is performed using the discriminator to obtain the original adversarial example image that conforms to the face facial expression unit, including:
[0015] S11, inputting the original face image and the face facial expression unit into the global GAN generator to obtain the original adversarial example image;
[0016] S12, using a discriminator to evaluate the original face image and the original adversarial example image, and perform adversarial training with the global GAN generator, the adversarial training process is shown in formulas (1) and (2),
[0017]
[0018] in, represents the discriminator loss, represents the global GAN generator loss, D represents the discriminator, G represents the global GAN generator, λ c represents the discriminative loss weight, λ gp represents the gradient penalty loss weight, represents the original face image, a0 represents the facial expression unit of the original face image itself, a i Represents the input facial expression unit, x * Represents the random interpolation distribution of the original face image and the generated image.
[0019] Further, S3 crops the original adversarial example image to obtain adversarial images of eyes, nose and mouth; performs DCT transformation on the generated whole, eyes, nose and mouth images and the original adversarial example image, the adversarial images of eyes, nose and mouth, and removes high-frequency components; calculates the naturalness loss function of the whole, eyes, nose and mouth images generated after DCT transformation and removal of high-frequency components and the adversarial images of eyes, nose and mouth, including:
[0020] S31, cropping the original adversarial example image to obtain adversarial images of eyes, nose and mouth;
[0021] S32, performing DCT transformation on the generated whole body, eye, nose and mouth images and the adversarial images of the eye, nose and mouth to obtain DCT components;
[0022] S33, setting a value greater than the DCT component as a high-frequency component, resetting the high-frequency component to 0, and removing the high-frequency component;
[0023] S34, calculate the naturalness loss function of the whole image, eyes, nose and mouth after removing the high-frequency components and the adversarial images of the eyes, nose and mouth, the naturalness loss function includes SSIM loss and MSE loss, the whole image is subjected to SSIM loss, and the local feature is subjected to MSE loss, the naturalness loss function is shown in formula (3),
[0025]
[0026] in, It represents the DCT component obtained after the image is transformed by DCT and the high-frequency components are removed, λ g represents the global natural loss weight, G p represents the local GAN generator, which is the eye GAN generator, the nose GAN generator and the mouth GAN generator, λ l represents the local natural loss weight, Crop p Adversarial images of the eyes, nose, and mouth obtained by cropping the adversarial example.
[0027] Further, S4 inputs the whole image of the target to be tested and crops the whole image of the target to be tested into target images of eyes, nose and mouth, respectively performs DCT transformation on the original adversarial example image, the adversarial images of the eyes, nose and mouth, the whole image of the target to be tested and the target images of the eyes, nose and mouth, and removes low-frequency components, and calculates the attack success rate loss function of the original adversarial example image, the adversarial images of the eyes, nose and mouth after DCT transformation and removal of low-frequency components, the whole image of the target to be tested and the target images of the eyes, nose and mouth, including:
[0028] S41, inputting an entire image of the target to be measured and cutting the entire image of the target to be measured into target images of eyes, nose and mouth;
[0029] S42, subjecting the original adversarial example image, the adversarial images of the eyes, nose and mouth, the overall image of the target to be tested and the target images of the eyes, nose and mouth to DCT transformation respectively to obtain DCT components;
[0030] S43, setting a value smaller than the DCT component as a low-frequency component, resetting the low-frequency component to 0, and removing the low-frequency component;
[0031] S44, calculating the attack success rate loss function of the original adversarial example image with the low-frequency component removed, the adversarial image of the eyes, nose and mouth, the overall image of the target to be tested, and the target image of the eyes, nose and mouth, and using the MSE loss to calculate the attack success rate loss function, as shown in formula (4),
[0032]
[0033] in, It represents the DCT component obtained after the image is transformed by DCT and the low-frequency components are removed. t represents the target image, λ1 represents the global attack loss weight, λ2 represents the local attack loss weight, and m represents the median of the image after DCT transformation.
[0034] Further, S5 constructs k pre-trained face recognition models, and transforms the original adversarial example image through the input diversity function Tp for probability, attacks the face recognition model, and obtains a diversity attack loss function of the adversarial example processed by the input diversity function Tp and the feature image obtained by the face recognition model of the overall image of the target to be tested, including:
[0035] S51, construct k pre-trained face recognition models;
[0036] S52, subjecting the original adversarial example image to probability transformation through an input diversity function Tp, and inputting the adversarial example and the target image processed by the input diversity function Tp into the k pre-trained face recognition models to obtain k feature images of the adversarial example and the target image;
[0037] S53, calculating the diversity attack loss function of the k feature images of the adversarial example and the k feature images of the target image, as shown in formula (5),
[0038]
[0039] Among them, λ trans represents the transferable enhancement loss weight, K represents the k-person face recognition model, C k (.) represents the feature image obtained by face recognition model k.
[0040] Further, S6 uses the three loss functions to update the parameters of the global GAN generator and the discriminator, inputs the original face image into the updated global GAN generator and discriminator, and generates a final adversarial example, including:
[0041] S61. According to the three loss functions, use the back propagation algorithm to calculate the gradient values of the global GAN generator generation parameters and the discriminator discrimination parameters, and calculate new generation parameters and discrimination parameters according to the gradient values and the learning rate in the GMAA method;
[0042] S62, using the new generation parameters and discrimination parameters to update the global GAN generator generation parameters and the discriminator discrimination parameters, generate and save a GAN generator weight file, configure a new global GAN generator according to the GAN generator weight file, and obtain an updated global GAN generator and discriminator;
[0043] S63, inputting the original face image into the updated global GAN generator to generate adversarial examples, and using the updated discriminator to evaluate the original face image and the adversarial examples to obtain an evaluated loss function;
[0044] S64. Perform adversarial training on the updated global GAN generator and the updated discriminator according to the loss function to obtain a minimum loss function and generate a final adversarial example.
[0045] Compared with traditional obfuscation technology, the present invention has a higher attack accuracy by performing DCT transformation on the image, can generate more natural face images, attack the trained face recognition model, and improve the diversity of attackable models of adversarial examples; this method ensures that the generated face images can be used normally on social media, and effectively protects the face images from being infringed by illegal face recognition systems. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0047] Figure 1 A schematic diagram of a GAN-based face recognition counterattack defense method of the present invention;
[0048] Figure 2 It is the overall processing procedure diagram of the present invention;
[0049] Figure 3 This is a simulation result diagram of an embodiment of the present invention. DETAILED DESCRIPTION
[0050] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0051] This embodiment provides a GAN-based face recognition adversarial attack defense method. Figure 1 As shown, including:
[0052] S1: Inputting the original face image and the face facial expression unit into the global GAN generator, and using the discriminator for adversarial training to obtain the original adversarial example image that conforms to the face facial expression unit;
[0053] S2: cropping the original face image to obtain images of eyes, nose and mouth; constructing an overall GAN generator, an eye GAN generator, a nose GAN generator and a mouth GAN generator; and inputting the original face image and the images of eyes, nose and mouth and the facial expression unit into the overall GAN generator, the eye GAN generator, the nose GAN generator and the mouth GAN generator to obtain generated overall, eye, nose and mouth images;
[0054] S3: cropping the original adversarial example image to obtain adversarial images of eyes, nose and mouth; performing DCT transformation on the generated whole body, eyes, nose and mouth images and the original adversarial example image, adversarial images of eyes, nose and mouth, and removing high-frequency components; calculating the naturalness loss function of the whole body, eyes, nose and mouth images generated after DCT transformation and removal of high-frequency components and the adversarial images of eyes, nose and mouth of the original adversarial example image;
[0055] S4: inputting the whole image of the target to be tested and cropping the whole image of the target to be tested into target images of eyes, nose and mouth, subjecting the original adversarial example image, the adversarial images of the eyes, nose and mouth, the whole image of the target to be tested and the target images of the eyes, nose and mouth to DCT transformation respectively, and removing low-frequency components, and calculating the attack success rate loss function of the original adversarial example image, the adversarial images of the eyes, nose and mouth after DCT transformation and removal of low-frequency components, the whole image of the target to be tested and the target images of the eyes, nose and mouth;
[0056] S5: construct k pre-trained face recognition models, transform the original adversarial example image by probability through the input diversity function Tp, attack the face recognition model, and obtain a diversity attack loss function of the adversarial example processed by the input diversity function Tp and the feature image obtained by the face recognition model of the overall image of the target to be tested;
[0057] S6: Use the three loss functions to update the parameters of the global GAN generator and the discriminator, input the original face image into the updated global GAN generator and discriminator, and generate a final adversarial example.
[0058] Specifically, the present invention first inputs the original face image and the face expression unit into the global GAN generator, and uses the discriminator to perform adversarial training to obtain the original adversarial example image that meets the expression characteristics of the face expression unit. The training GAN can continuously optimize the parameters to improve the generation ability of the GAN. The discriminator can distinguish between real images and generated images, and prompt the generator to generate more realistic adversarial examples; then the original face image is cropped to obtain images of eyes, nose and mouth; an overall GAN generator, an eye GAN generator, a nose GAN generator and a mouth GAN generator are constructed; and the original face image and the images of the eyes, nose and mouth are compared with the face facial expression unit. The expression unit is input into the overall GAN generator, the eye GAN generator, the nose GAN generator and the mouth GAN generator to obtain the generated overall, eye, nose and mouth images, generate the eye, nose and mouth images, and input the corresponding generator, which can better generate the detailed features of the image, and make loss adjustment to the global GAN with the adversarial example to generate a more natural adversarial example; the original adversarial example image is cropped to obtain the adversarial images of the eyes, nose and mouth; the original adversarial example image is cropped to obtain the adversarial images of the eyes, nose and mouth; the generated overall, eye, nose and mouth images are compared with the original adversarial example image, the eyes, The adversarial images of the nose and mouth are transformed by DCT, and the high-frequency components are removed; the naturalness loss function of the whole, eye, nose and mouth images generated after DCT transformation and removal of high-frequency components and the original adversarial example image, the adversarial images of the eyes, nose and mouth is calculated. DCT converts the image into DCT components. By adjusting the high and low frequencies of the DCT components, GAN can generate adversarial examples with higher attack success rates and more natural images. By removing high-frequency components, the feature similarity between the adversarial example and the original image can be reduced, so that the adversarial example can better learn the features of the target image; the whole image of the target to be tested is input and the whole image of the target to be tested is cropped into the target of the eyes, nose and mouth. Image, the original adversarial example image, the adversarial images of the eyes, nose and mouth, the overall image of the target to be tested and the target images of the eyes, nose and mouth are respectively subjected to DCT transformation, and low-frequency components are removed, and the attack success rate loss function of the original adversarial example image, the adversarial images of the eyes, nose and mouth, the overall image of the target to be tested and the target images of the eyes, nose and mouth after DCT transformation and removal of low-frequency components is calculated, and the low-frequency components of the adversarial example and the target image are removed as loss, which can improve the similarity between the high-frequency features and the target image while ensuring the visual effect of the adversarial example, thereby improving the accuracy of the attack, and using the MSE loss function can ensure the delicacy of local features;Construct k pre-trained face recognition models, transform the original adversarial example images through the input diversity function Tp for probability, attack the face recognition models, obtain the diversity attack loss function of the adversarial examples processed by the input diversity function Tp and the feature images obtained by the face recognition model of the overall image of the target to be tested, and attack the trained k face recognition models to improve the transferability of the adversarial attack and the success rate of the black box attack. The input diversity function Tp adds noise to the adversarial examples and randomly crops them, which can improve the transferability of the adversarial examples. The adversarial examples can maintain good adversarial capabilities in different face recognition systems; use the three loss functions to update the parameters of the global GAN generator and the discriminator, input the original face image into the updated global GAN generator and discriminator, and generate the final adversarial example. ;
[0059] In a specific embodiment, the original face image and the face facial expression unit are input into the global GAN generator, and the discriminator is used for adversarial training to obtain the original adversarial example image that conforms to the face facial expression unit:
[0060] S11, inputting the original face image and the face facial expression unit into the global GAN generator to obtain the original adversarial example image;
[0061] S12, using a discriminator to evaluate the original face image and the original adversarial example image, and perform adversarial training with the global GAN generator, the adversarial training process is shown in formulas (6) and (7),
[0062]
[0063] in, represents the discriminator loss, represents the global GAN generator loss, D represents the discriminator, G represents the global GAN generator, λ c represents the discriminative loss weight, λ gp represents the gradient penalty loss weight, represents the original face image, a0 represents the facial expression unit of the original face image itself, a i Represents the input facial expression unit, x * Represents the random interpolation distribution of the original face image and the generated image.
[0064] Original image According to a0, an adversarial example that meets the expression features of a0 is generated. The discriminator distinguishes between real images and generated images. The loss function makes the features of real images approach 1 and the features of generated images approach 0. A loss of random interpolation distribution is added to encourage the generator to generate more realistic adversarial examples. The global GAN generator and discriminator are an existing deep learning model architecture. Training GAN can continuously optimize parameters to improve the generation ability of GAN. The GAN generator is a part of GAN.
[0065] In a specific embodiment, the original face image is cropped to obtain images of eyes, nose and mouth; an overall GAN generator, an eye GAN generator, a nose GAN generator and a mouth GAN generator are constructed; and the original face image and the images of the eyes, nose and mouth and the facial expression unit are input into the overall GAN generator, the eye GAN generator, the nose GAN generator and the mouth GAN generator, and the scheme for obtaining the generated overall, eye, nose and mouth images is:
[0066] The generator is a pre-trained generator from the Adv-Makeup model. The original face image is cropped to obtain images of the eyes, nose and mouth, and the images are input into the corresponding generator to obtain the corresponding generated image.
[0067] The present invention generates images of eyes, nose and mouth and inputs them into corresponding generators, which can better generate detailed features of the images and adjust the global GAN with adversarial examples to generate more natural adversarial examples.
[0068] In a specific embodiment, the original adversarial example image is cropped to obtain adversarial images of eyes, nose and mouth; the original adversarial example image is cropped to obtain adversarial images of eyes, nose and mouth; the generated whole, eyes, nose and mouth images and the original adversarial example image, adversarial images of eyes, nose and mouth are subjected to DCT transformation, and high-frequency components are removed; the scheme for calculating the naturalness loss function of the whole, eyes, nose and mouth images generated after DCT transformation and removal of high-frequency components and the original adversarial example image, adversarial images of eyes, nose and mouth is:
[0069] S31, cropping the original adversarial example image to obtain adversarial images of eyes, nose and mouth;
[0070] S32, performing DCT transformation on the generated whole body, eye, nose and mouth images and the adversarial images of the eye, nose and mouth to obtain DCT components;
[0071] S33, setting a value greater than the DCT component as a high-frequency component, resetting the high-frequency component to 0, and removing the high-frequency component;
[0072] S34, calculate the naturalness loss function of the whole image, eyes, nose and mouth images after removing high-frequency components and the adversarial images of eyes, nose and mouth, the naturalness loss function includes SSIM loss and MSE loss, the whole image is subjected to SSIM loss, and the local feature is subjected to MSE loss, the naturalness loss function is shown in formula (8),
[0073]
[0074] in, It represents the DCT component obtained after the image is transformed by DCT and the high-frequency components are removed, λ g represents the global natural loss weight, set to 20, G p represents the local GAN generator, which is the eye GAN generator, the nose GAN generator and the mouth GAN generator, λ l Represents the local natural loss weight, set to 20, Crop p Adversarial images of the eyes, nose, and mouth obtained by cropping the adversarial example.
[0075] This scheme undergoes DCT transformation. DCT transformation is a signal processing technology and a variant of Fourier transform. It can decompose the signal into a combination of cosine waves of different frequencies. The main advantage is that it provides an effective way to represent the energy distribution of the signal. DCT converts the image into DCT components. By adjusting the high and low frequencies of the DCT components, GAN can generate adversarial examples with higher attack success rates and more natural images.
[0076] The human eye mainly recognizes through low frequencies, so we only need to ensure the similarity of low frequencies as much as possible. By removing high-frequency components, we can reduce the feature similarity between the adversarial example and the original image, so that the adversarial example can better learn the features of the target image. The generated image and the adversarial example are used as losses and passed to the discriminator. The discriminator learns to distinguish between real images and generated images, so as to ensure the overall coordination of the adversarial example and the naturalness of local feature details. The overall image generated by G and G global The generated image is subjected to SSIM loss to ensure the consistency of overall perception, and the local features are subjected to MSE loss to ensure the delicacy of local features.
[0077] In a specific embodiment, the whole image of the target to be tested is input and the whole image of the target to be tested is cropped into target images of eyes, nose and mouth, the original adversarial example image, the adversarial images of eyes, nose and mouth, the whole image of the target to be tested and the target images of eyes, nose and mouth are respectively subjected to DCT transformation, and low-frequency components are removed, and the scheme for calculating the attack success rate loss function of the original adversarial example image, the adversarial images of eyes, nose and mouth after DCT transformation and removal of low-frequency components, the whole image of the target to be tested and the target images of eyes, nose and mouth is:
[0078] S41, inputting an entire image of the target to be measured and cutting the entire image of the target to be measured into target images of eyes, nose and mouth;
[0079] S42, subjecting the original adversarial example image, the adversarial images of the eyes, nose and mouth, the overall image of the target to be tested and the target images of the eyes, nose and mouth to DCT transformation respectively to obtain DCT components;
[0080] S43, setting a value smaller than the DCT component as a low-frequency component, resetting the low-frequency component to 0, and removing the low-frequency component;
[0081] S44, calculating the attack success rate loss function of the original adversarial example image with the low-frequency component removed, the adversarial image of the eyes, nose and mouth, the overall image of the target to be tested, and the target image of the eyes, nose and mouth, and using the MSE loss to calculate the attack success rate loss function, as shown in formula (9),
[0082]
[0083] in, It represents the DCT component obtained after the image is transformed by DCT and the low-frequency components are removed. t represents the target image, λ1 represents the global attack loss weight, which is set to 20, λ2 represents the local attack loss weight, which is set to 20, and m represents the median of the image after DCT transformation.
[0084] In this scheme, the low-frequency components of the adversarial example and the target image are removed as loss, which can improve the similarity between the high-frequency features and the target image while ensuring the visual effect of the adversarial example, thereby improving the accuracy of the attack. The use of the MSE loss function can ensure the delicacy of local features.
[0085] In a specific embodiment, k pre-trained face recognition models are constructed, the original adversarial example images are subjected to probability transformation through the input diversity function Tp, and the face recognition model is attacked to obtain a diversity attack loss function of the adversarial example processed by the input diversity function Tp and the feature image obtained by the face recognition model of the overall image of the target to be tested. The scheme is:
[0086] S51, construct k pre-trained face recognition models;
[0087] S52, subjecting the original adversarial example image to probability transformation through an input diversity function Tp, and inputting the adversarial example and the target image processed by the input diversity function Tp into the k pre-trained face recognition models to obtain k feature images of the adversarial example and the target image;
[0088] S53, calculating the diversity attack loss function of the k feature images of the adversarial example and the k feature images of the target image, as shown in formula (10),
[0089]
[0090] Among them, λ trans represents the transferable enhancement loss weight, which is set to 25, K represents k face recognition models, C k (.) represents the feature image obtained by face recognition model k.
[0091] This scheme attacks the trained k face recognition models to improve the transferability of adversarial attacks and the success rate of black-box attacks. After the input diversity function Tp probability transformation, the input diversity function Tp is a transformation function. The function will add noise to the adversarial examples, and then randomly crop the adversarial examples with probability p. The input diversity function Tp adds noise to the adversarial examples and randomly crops them, which can improve the transferability of the adversarial examples, that is, the ability of the adversarial examples to maintain good adversarial properties in different face recognition systems.
[0092] In a specific embodiment, the three loss functions are used to update the parameters of the global GAN generator and the discriminator, and the original face image is input into the updated global GAN generator and discriminator to generate the final adversarial example:
[0093] S61. According to the three loss functions, the gradient values of the global GAN generator generation parameters and the discriminator discrimination parameters are calculated using the back propagation algorithm, and new generation parameters and discrimination parameters are calculated according to the gradient values and the learning rate in the GMAA method. The initial learning rate in this embodiment is 0.0001.
[0094] S62, using the new generation parameters and discrimination parameters to update the global GAN generator generation parameters and the discriminator discrimination parameters, generate and save a GAN generator weight file, configure a new global GAN generator according to the GAN generator weight file, and obtain an updated global GAN generator and discriminator;
[0095] S63, inputting the original face image into the updated global GAN generator to generate adversarial examples, and using the updated discriminator to evaluate the original face image and the adversarial examples to obtain an evaluated loss function;
[0096] S64, performing adversarial training on the updated global GAN generator and the updated discriminator according to the loss function, obtaining a minimum loss function, and generating a final adversarial example;
[0097] like Figure 2 As shown in the figure, a clean face image real and a facial expression unit AU are input. AU will be input into the overall GAN generator, eye GAN generator, nose GAN generator and mouth GAN generator at the same time to ensure that the naturalness training module generates natural and delicate overall and local face images with natural expressions. The overall GAN generator, eye GAN generator, nose GAN generator and mouth GAN generator will perform mean square error loss with the generated adversarial example fake. The eyes, nose and mouth of the fake and Target target images are respectively cut off and DCT transformed. Because the face recognition system recognizes the identity of the face through the low frequency and high frequency of the image, and the human eye mainly perceives the identity of the face through the low frequency, the component less than half of the average value of the DCT component is taken as the low frequency component and removed, and the high frequency component of the fake and Target is used as loss. The fake is cropped with a probability of p, and the transformed fake and Target are input into k pre-trained face recognition models, and the output is used as loss. The above loss is used with the back propagation algorithm to calculate the gradient value, and the parameters of the global GAN generator are updated according to the gradient value and learning rate. The discriminator evaluates the original face image and the generated adversarial examples, calculates the loss function and gradient value, and updates the discriminator parameters according to the gradient value and learning rate. The discriminator and the generator compete with each other to obtain the minimum loss function, which prompts the generator to generate more natural adversarial examples with higher attack accuracy and more diverse attack models.
[0098] The following table shows the attack success rate of the face recognition model FR@0.01 of GMAA and this method under different input Au expressions. The pre-trained models are facenet, ir152, and irse50. The attacked black box model is mobile_face, the dataset is 128x128CelebA-HQ, and the training environment is RTX2060, Ubuntu22.04.4LTS.
[0099] A0 Au1 Au2 Au3 Au4 Au5 GMAA 59.49 59.23 61.19 76.66 57.39 57.69 This method 63.82 62.61 66.57 81.98 61.50 71.45
[0100] From the table, it can be seen that the numerical value obtained by the present invention is larger, which means that the success rate of the attack of the present invention is higher and the effect of privacy protection is better. Figure 3 An input image and a result graph of adversarial examples for an embodiment of the present invention.
[0101] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A GAN-based face recognition adversarial attack defense method, characterized in that: include: S1: Input the original face image and the face facial expression unit into the global GAN generator, and use the discriminator to perform adversarial training to obtain the original adversarial example image that conforms to the face facial expression unit; S2: cropping the original face image to obtain images of eyes, nose and mouth; constructing an overall GAN generator, an eye GAN generator, a nose GAN generator and a mouth GAN generator; and inputting the original face image and the images of eyes, nose and mouth and the facial expression unit into the overall GAN generator, the eye GAN generator, the nose GAN generator and the mouth GAN generator to obtain generated overall, eye, nose and mouth images; S3: cropping the original adversarial example image to obtain adversarial images of eyes, nose and mouth; performing DCT transformation on the generated whole body, eyes, nose and mouth images and the original adversarial example image, adversarial images of eyes, nose and mouth, and removing high-frequency components; calculating the naturalness loss function of the whole body, eyes, nose and mouth images generated after DCT transformation and removal of high-frequency components and the original adversarial example image, adversarial images of eyes, nose and mouth; S4: inputting the whole image of the target to be tested and cropping the whole image of the target to be tested into target images of eyes, nose and mouth, subjecting the original adversarial example image, the adversarial images of the eyes, nose and mouth, the whole image of the target to be tested and the target images of the eyes, nose and mouth to DCT transformation respectively, and removing low-frequency components, and calculating the attack success rate loss function of the original adversarial example image, the adversarial images of the eyes, nose and mouth after DCT transformation and removal of low-frequency components, the whole image of the target to be tested and the target images of the eyes, nose and mouth; S5: construct k pre-trained face recognition models, transform the original adversarial example image by probability through the input diversity function Tp, attack the face recognition model, and obtain a diversity attack loss function of the adversarial example processed by the input diversity function Tp and the feature image obtained by the face recognition model of the overall image of the target to be tested; S6: Use the three loss functions to update the parameters of the global GAN generator and the discriminator, input the original face image into the updated global GAN generator and discriminator, and generate a final adversarial example.
2. The GAN-based face recognition adversarial attack defense method according to claim 1, characterized in that: S1 inputs the original face image and the face facial expression unit into the global GAN generator, and uses the discriminator to perform adversarial training to obtain the original adversarial example image that conforms to the face facial expression unit, including: S11, inputting the original face image and the face facial expression unit into the global GAN generator to obtain the original adversarial example image; S12, using a discriminator to evaluate the original face image and the original adversarial example image, and perform adversarial training with the global GAN generator, the adversarial training process is shown in formulas (1) and (2), in, represents the discriminator loss, represents the global GAN generator loss, D represents the discriminator, G represents the global GAN generator, λ c represents the discriminative loss weight, λ gp represents the gradient penalty loss weight, represents the original face image, a0 represents the facial expression unit of the original face image itself, a i Represents the input facial expression unit, x * Represents the random interpolation distribution of the original face image and the generated image.
3. The GAN-based face recognition adversarial attack defense method according to claim 1, characterized in that: S3 crops the original adversarial example image to obtain adversarial images of eyes, nose and mouth; performs DCT transformation on the generated whole, eyes, nose and mouth images and the original adversarial example image, the adversarial images of eyes, nose and mouth, and removes high-frequency components; calculates the naturalness loss function of the whole, eyes, nose and mouth images generated after DCT transformation and removal of high-frequency components and the adversarial images of eyes, nose and mouth, including: S31, cropping the original adversarial example image to obtain adversarial images of eyes, nose and mouth; S32, performing DCT transformation on the generated whole body, eye, nose and mouth images and the adversarial images of the eye, nose and mouth to obtain DCT components; S33, setting a value greater than the DCT component as a high-frequency component, resetting the high-frequency component to 0, and removing the high-frequency component; S34, calculate the naturalness loss function of the whole image, eyes, nose and mouth after removing the high-frequency components and the adversarial images of the eyes, nose and mouth, the naturalness loss function includes SSIM loss and MSE loss, the whole image is subjected to SSIM loss, and the local feature is subjected to MSE loss, the naturalness loss function is shown in formula (3), in, It represents the DCT component obtained after the image is transformed by DCT and the high-frequency components are removed, λ g represents the global natural loss weight, G p represents the local GAN generator, which is the eye GAN generator, the nose GAN generator and the mouth GAN generator, λ l represents the local natural loss weight, Crop p Adversarial images of the eyes, nose, and mouth obtained by cropping the adversarial example.
4. The GAN-based face recognition adversarial attack defense method according to claim 1, characterized in that: S4 inputs the whole image of the target to be tested and cuts the whole image of the target to be tested into target images of eyes, nose and mouth, respectively performs DCT transformation on the original adversarial example image, the adversarial images of eyes, nose and mouth, the whole image of the target to be tested and the target images of eyes, nose and mouth, and removes low-frequency components, and calculates the attack success rate loss function of the original adversarial example image, the adversarial images of eyes, nose and mouth after DCT transformation and removal of low-frequency components, the whole image of the target to be tested and the target images of eyes, nose and mouth, including: S41, inputting an entire image of the target to be measured and cutting the entire image of the target to be measured into target images of eyes, nose and mouth; S42, subjecting the original adversarial example image, the adversarial images of the eyes, nose and mouth, the overall image of the target to be tested and the target images of the eyes, nose and mouth to DCT transformation respectively to obtain DCT components; S43, setting a value smaller than the DCT component as a low-frequency component, resetting the low-frequency component to 0, and removing the low-frequency component; S44, calculating the attack success rate loss function of the original adversarial example image with the low-frequency component removed, the adversarial image of the eyes, nose and mouth, the overall image of the target to be tested, and the target image of the eyes, nose and mouth, and using the MSE loss to calculate the attack success rate loss function, as shown in formula (4), in, It represents the DCT component obtained after the image is transformed by DCT and the low-frequency components are removed. t represents the target image, λ1 represents the global attack loss weight, λ2 represents the local attack loss weight, and m represents the median of the image after DCT transformation.
5. The GAN-based face recognition adversarial attack defense method according to claim 1, characterized in that: S5 constructs k pre-trained face recognition models, and transforms the original adversarial example image through the input diversity function Tp for probability, attacks the face recognition model, and obtains a diversity attack loss function of the adversarial example processed by the input diversity function Tp and the feature image obtained by the face recognition model of the overall image of the target to be tested, including: S51, construct k pre-trained face recognition models; S52, subjecting the original adversarial example image to probability transformation through an input diversity function Tp, and inputting the adversarial example and the target image processed by the input diversity function Tp into the k pre-trained face recognition models to obtain k feature images of the adversarial example and the target image; S53, calculating the diversity attack loss function of the k feature images of the adversarial example and the k feature images of the target image, as shown in formula (5), Among them, λ trans represents the transferable enhancement loss weight, K represents the k-person face recognition model, C k (.) represents the feature image obtained by face recognition model k.
6. The GAN-based face recognition adversarial attack defense method according to claim 1, characterized in that: S6 uses the three loss functions to update the parameters of the global GAN generator and the discriminator, inputs the original face image into the updated global GAN generator and discriminator, and generates a final adversarial example, including: S61. According to the three loss functions, use the back propagation algorithm to calculate the gradient values of the global GAN generator generation parameters and the discriminator discrimination parameters, and calculate new generation parameters and discrimination parameters according to the gradient values and the learning rate in the GMAA method; S62, using the new generation parameters and discrimination parameters to update the global GAN generator generation parameters and the discriminator discrimination parameters, generate and save a GAN generator weight file, configure a new global GAN generator according to the GAN generator weight file, and obtain an updated global GAN generator and discriminator; S63, inputting the original face image into the updated global GAN generator to generate adversarial examples, and using the updated discriminator to evaluate the original face image and the adversarial examples to obtain an evaluated loss function; S64. Perform adversarial training on the updated global GAN generator and the updated discriminator according to the loss function to obtain a minimum loss function and generate a final adversarial example.
Citation Information
Patent Citations
Anti-occlusion face recognition method based on DWT-DCT watermark under big data
CN103984933A
Symmetric and local discrimination-based generative adversarial face correction method and system
CN113378721A
Encrypted face recognition method based on neural network and DCT (Discrete Cosine Transform)
CN113807258A
Face privacy protection method and device based on local directional adversarial attack
CN116844203A
Face-resisting privacy protection method
CN117912082A
Cited By
Face prototype reconstruction method and system fused with anti-attack defense mechanism
CN120726704A
A face prototype reconstruction method and system fusing an anti-attack defense mechanism
CN120726704B
