Face confrontation sample generation system based on multiple confrontation blocks and training method
Through a face adversarial sample generation system based on multiple adversarial blocks, the face key feature point extraction module and the GANs network are used to generate natural-style face adversarial samples, which solves the problems of style differences and insufficient robustness in the existing technology, and achieves High-quality and efficient face adversarial sample generation.
Patent Information
- Application Number
- CN202410758667.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2024-03-04
- Filing Date
- 2024-06-13
- Publication Date
- 2024-09-10
AI Technical Summary
Existing face adversarial sample generation methods do not consider style loss and naturalness during the training process, resulting in significant differences between the generated face mask and the original image, high recognition, low application value, and insufficient robustness.
Design a face adversarial sample generation system based on multiple adversarial blocks. It uses the face key feature point extraction module and GANs network to generate natural-style face adversarial samples through the generator and fusion module. It combines the encoder-decoder structure and Meta-learning ensemble models are trained to optimize generator and discriminator parameters to improve naturalness and transferability.
The generated face adversarial samples are significantly improved in naturalness and black-box attack success rate. The generated images are more natural, have enhanced robustness, and are suitable for practical applications.
Smart Images

Figure CN118628865A
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of artificial intelligence security technology, relates to human recognition technology, and in particular to a system and method for generating face adversarial samples based on multiple adversarial blocks. Background Art
[0002] Currently, face recognition technology plays an important role in a wide range of application scenarios, such as security access control, payment verification, social media tagging, etc. However, despite its wide application, research shows that face recognition models are vulnerable to adversarial samples. Adversarial samples are carefully designed input data whose purpose is to mislead machine learning models to produce incorrect outputs. In the field of face recognition, these adversarial samples can be created by adding adversarial blocks to the face of the target object. These blocks may include noise, texture perturbations, or other visual interferences, and their purpose is to disrupt the feature extraction process of the face recognition model, resulting in incorrect recognition results. Therefore, studying how to generate high-quality adversarial samples is particularly important for defense and anti-attack. Although the threat of adversarial samples cannot be ignored, current research shows that face adversarial sample attacks still have certain limitations. First, the style of face adversarial samples is very different from that of the original image, and their practical significance is not strong.
[0003] Patent CN202111368399.5 discloses a method, device and equipment for constructing a face adversarial sample generation model. Based on the generative adversarial network, by obtaining a face image sample and inputting it into the generator, the face mask output by the generator can be obtained; the sum of the face mask and the original face image is used as a face adversarial sample to input the discriminator to obtain the discrimination result; then the face adversarial sample is input into the target attack model to obtain the output result, so that one training is completed; then the parameters of the generator and the discriminator are updated according to the training results, and the training is repeated for a preset number of times to finally obtain the generator and discriminator with the optimal parameters, that is, the required face adversarial sample generation model. And further, face adversarial samples can be automatically generated through the face adversarial sample generation model. Compared with the traditional face adversarial sample generation method, the generation speed is significantly improved, and the quality of the generated face adversarial samples is better. However, this method does not consider the two factors of style loss and face naturalness during the training process, which leads to a significant difference between the generated face mask and the face in the original image, and there is a serious sense of boundary tearing. Although it is highly recognizable to the human eye, its practical application value is low, and the generated face adversarial samples are weakly robust. Summary of the invention
[0004] In view of the problems that face adversarial samples have huge differences in style from original images, have poor transferability, and have low success rate of black-box attacks, the purpose of the present invention is to provide a face adversarial sample generation system and method based on multiple adversarial blocks. Based on a face key feature point extraction network and a GANs network, a generation network for multi-adversarial block face adversarial samples with natural face style is designed and trained. The generated face adversarial samples have significant improvements over several traditional adversarial attack methods in terms of face naturalness and black-box attack success rate.
[0005] In order to achieve the above object, the present invention provides a face adversarial sample generation system based on multiple adversarial blocks, which comprises:
[0006] The facial key feature point extraction module is used to extract the facial key feature points of the source image, obtain the facial key feature point coordinate grid, determine the corresponding target attack area, and generate the corresponding 0-1 binary mask using the feature point coordinates around the eyes and the designated area of the triangular area of the face;
[0007] A generator, used for generating a corresponding generated image according to a target attack area;
[0008] The fusion module first generates multiple adversarial blocks based on the multiplication of the generated image and the binary mask, and then fuses them with the source image to obtain the final face adversarial sample.
[0009] The above-mentioned facial key feature point extraction module includes a BlazeFace short-range model and a facial mesh model set in sequence. The BlazeFace short-range model is a lightweight and accurate face detector designed and trained on the basis of the MobileNet face recognition network and optimized for mobile GPU inference. The facial mesh model adds a high-resolution network on the basis of the SSD detection model, improves the detection performance, and can add a complete mapping of the face. The facial key feature point extraction module combines the BlazeFace short-range model and the facial mesh model to output an estimated value of 478 3D facial feature points, and further extracts feature points from the actual face. The eyes and triangular areas of the face are less affected by changes in expression, and are also areas that are difficult to accurately identify in face recognition tasks. According to the above-mentioned facial key feature point extraction module, the facial key feature point coordinate grid is extracted to obtain the target attack area; and the corresponding 0-1 binary mask P is generated using the feature point coordinates around the eyes and the designated area of the triangular area of the face.
[0010] The above generator adopts an encoder-decoder structure, which is composed of one or more convolutional layers and one or more deconvolutional layers symmetrically arranged.
[0011] The above fusion module obtains the final face adversarial sample through the following formula:
[0012]
[0013] In the formula, For face adversarial samples, Represents the multiplication of the elements at the corresponding positions of the vector, P is the target area O of the source image G Binary masks of the same size, represents the generated image generated by the generator, G(﹒) represents the output result of the generator, represents multiple adversarial blocks. Therefore, in the present invention, only The obtained adversarial block replaces the corresponding area in the source image, thereby ensuring that the generated face is more natural.
[0014] The above-mentioned face adversarial sample generation system based on multiple adversarial blocks also includes a discriminator, which is used to distinguish the generated image generated by the generator and the target area of the control image during the generator training process. The discriminator is composed of several convolutional layers.
[0015] The present invention also provides a training method for the above-mentioned face adversarial sample generation system based on multiple adversarial blocks, which comprises the following steps:
[0016] L1 trains the generator; this step includes the following sub-steps:
[0017] L11 divides the data in the training set into a source image group and a control image group;
[0018] L12 extracts the images in the source image group and the reference image group respectively through the face key feature point extraction module, and determines the target attack area of each source image and the reference image;
[0019] L13 inputs the target attack area of each source image into the generator to generate a corresponding generated image;
[0020] The target areas of each generated image and control image generated by L14 are input into the discriminator for identification, and the generation loss and identification loss are obtained at the same time;
[0021] L15 updates the parameters of the generator and the discriminator using the generation loss and the identification loss; then, returns to step L13, and repeats the above steps L13-L15 until the discriminator cannot distinguish the target area between the generated image and the control image, or reaches the preset number of times;
[0022] L2 fine-tunes the generator trained in step L1 through an integrated model based on meta-learning.
[0023] The purpose of the above step L1 is to train the generator so that it can generate natural face images.
[0024] In step L14, the loss calculation formula is generated as follows:
[0025]
[0026] In the formula, O Gi represents the target region of the i-th source image; G(·) represents the output of the generator; D(·) represents the output of the discriminator; n represents the number of source images in each set of training samples;
[0027] The formula for calculating the identification loss is as follows:
[0028]
[0029] In the formula, O Di represents the target area of the i-th control image.
[0030] In the above step L14, the generation loss and the identification loss are used to optimize the parameters of the generator and the discriminator through the Adam optimization algorithm.
[0031] The purpose of the above step L2 is to fine-tune the generator and improve the transferability of adversarial samples. Based on the idea of meta-learning, suppose there are K pre-trained face detection models (F = F1, F , ,...,F . ,...,F / ) to form an integrated model based on meta-learning, arbitrarily select K-1 face detection models as training models and another face detection model as the test model, and follow the steps below to fine-tune and update the generator:
[0032] L21 designs K-1 training and testing branches based on K-1 training models to train and test the generator respectively; the training and testing steps along any branch are as follows:
[0033] L211 uses the generator to first perform attack training on the training model, and uses the attack loss obtained from the training to update the generator parameters;
[0034] L212 uses the generator with updated parameters to perform attack tests on the test model, and uses the attack loss obtained from the test to update the generator parameters;
[0035] L22 performs weighted addition of the generator parameters after different branch tests to obtain the integrated generator parameters;
[0036] L23 determines whether the preset upper limit of the number of trainings of the integrated model based on meta-learning has been reached. If not, it returns to step L21. Otherwise, the training of the integrated model based on meta-learning ends.
[0037] The face detection model in the meta-learning based integrated model is selected from Irse50, Ir152, Mobileface or Facenet, etc.
[0038] The steps for the generator to attack on a training model or a test model are as follows:
[0039] Step a, extracting key facial feature points from the source image in the source image group through the key facial feature point extraction module, and determining the corresponding target attack area and binary mask, then generating the corresponding generated image through the generator according to the target attack area, generating multiple adversarial blocks according to the generated image and the binary mask through the fusion module, and then combining the corresponding source images to obtain a number of face adversarial samples;
[0040] Step b: input the generated face adversarial samples and target images into the training model or the test model to obtain the corresponding attack loss.
[0041] The attack loss calculation formula is as follows:
[0042]
[0043] In the formula, I T represents the target image, and F(﹒) represents the output of the face detection model. By continuously reducing the attack loss, the generated adversarial samples It is close to the target image I4, so the face detection model judges the two as the same target.
[0044] The attack loss obtained based on all source images is summed up, and then combined with the generation loss to optimize the generator parameters through the Adam optimization algorithm. At the same time, the discrimination loss is calculated according to the formula (2) given above (including the target area of the control image), and the discriminator parameters are optimized through the Adam optimization algorithm.
[0045] In different meta-learning-based integrated model training iterations, the training model and the test model may be different and may be randomly selected from K face detection models.
[0046] The present invention is based on the face key feature point extraction module, extracts the target area of the face and the corresponding binary mask from the source image; then obtains the generated image through the generator, and then fuses the generated image with the source image through the fusion module to obtain the final face adversarial module. Compared with the prior art, the present invention has the following beneficial effects:
[0047] (1) The present invention obtains a generated image based on the target area extracted by the face key feature point extraction module through a generator, and simultaneously obtains a corresponding multi-adversarial block in combination with the binary mask obtained from the face, which is then fused with the source image to generate a more natural face image; the generated face adversarial sample has excellent face naturalness and is difficult to distinguish with the naked eye.
[0048] (2) In view of the huge difference between the styles of current face adversarial samples and source images, the present invention proposes a natural face adversarial sample generator training method based on multiple adversarial blocks, which can enable the generator to generate natural face images;
[0049] (3) The present invention updates and fine-tunes the generator through an integrated model based on meta-learning to improve the transferability of adversarial samples. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 This is a schematic diagram of the process of extracting key feature points of a face;
[0051] Figure 2 A diagram of the training process of the face adversarial sample generation system based on multiple adversarial blocks;
[0052] Figure 3 Schematic diagram of the training process for the generator;
[0053] Figure 4 Generate schematics for adversarial examples;
[0054] Figure 5 Schematic diagram of the process of fine-tuning the generator for the meta-learning based ensemble model;
[0055] Figure 6 Schematic diagram of the principle of the integrated model based on meta-learning. DETAILED DESCRIPTION
[0056] The specific implementation modes of the present invention are described below so that those skilled in the art can understand the present invention. However, it should be clear that the present invention is not limited to the scope of the specific implementation modes. For those of ordinary skill in the art, as long as various changes are within the spirit and scope of the present invention as defined and determined by the attached claims, these changes are obvious, and all inventions and creations utilizing the concept of the present invention are protected.
[0057] Example 1
[0058] This embodiment provides a face adversarial sample generation system based on multiple adversarial blocks, which includes a face key feature point extraction module, a generator and a fusion module.
[0059] The facial key feature point extraction module is used to extract the facial key feature points of the source image, obtain the facial key feature point coordinate grid, determine the corresponding target attack area, and use the feature point coordinates around the designated area of the eye and triangular area of the face to generate the corresponding 0-1 binary mask.
[0060] like Figure 1 As shown, the facial key feature point extraction module includes a BlazeFace short-range model and a facial mesh model, which are set in sequence. The BlazeFace short-range model is a lightweight and accurate face detector designed and trained on the basis of the MobileNet face recognition network and optimized for mobile GPU inference, see BlazeFace: Sub-millisecond Neural Face Detection on Mobile GPUs. The facial mesh model adds a high-resolution network on the basis of the SSD detection model, improves the detection performance, and can add a complete mapping of the face. The facial key feature point extraction module combines the BlazeFace short-range model and the facial mesh model to output an estimated value of 478 3D facial feature points. Further, feature points are extracted from the actual face and the facial feature points are located. The eyes and triangular areas of the face are less affected by changes in expression, and are also areas that are difficult to accurately identify in face recognition tasks. According to the above facial key feature point extraction module, the facial key feature point coordinate grid is extracted to obtain the target attack area; and the feature point coordinates around the eyes and triangular areas of the face are used to generate the corresponding 0-1 binary mask P, as shown Figure 4 shown.
[0061] The generator is used to generate a corresponding generated image according to the target attack area. In this embodiment, the network structure of the generator adopts an encoder-decoder framework; the encoder part includes two convolutional layers, performing two convolution operations; the decoder part includes two deconvolution layers symmetrically arranged with the convolutional layers, performing two deconvolution operations.
[0062] The fusion module first generates multiple adversarial blocks based on the multiplication of the generated image and the binary mask, and then fuses them with the source image to obtain the final face adversarial sample. Specifically, the fusion module obtains the final face adversarial sample through the following formula:
[0063]
[0064] In the formula, For face adversarial samples, Represents the multiplication of the elements at the corresponding positions of the vector, P is the target area O of the source image G A binary mask of the same size, representing the area covered by the generated image of the target hit area; represents the generated image generated by the generator, G(·) represents the output of the generator. Therefore, multiple adversarial block regions are fused with the target region and overlaid on the source image to obtain the final face adversarial sample.
[0065] The above-mentioned face adversarial sample generation system based on multiple adversarial blocks also includes a discriminator, which is used to distinguish the generated image generated by the generator and the target area of the control image during the generator training process. And force the generation of images that are as natural as real images. The generator and the discriminator "circulate back and forth" to obtain more and more natural generated images. The structure of the discriminator consists of three convolutional layers set in sequence, performing three convolution operations.
[0066] Example 2
[0067] This embodiment provides a training method for the face adversarial sample generation system based on multiple adversarial blocks in Embodiment 1, such as Figure 2 As shown, the following steps are included:
[0068] L1 trains the generator.
[0069] like Figure 3 and Figure 4 As shown, the purpose of this step is to train the generator to generate natural face images. This step includes the following sub-steps:
[0070] L11 divides the data in the training set into a source image group and a control image group.
[0071] In this embodiment, after the facial images are collected and annotated, a data set is created. Specifically, after the facial data is collected independently, the face annotation tool can be used to annotate the face. The data set images are sorted in a folder, and the name of the folder is the category of the image. The data set is divided into a training set and a test set according to an 8:2 ratio.
[0072] The data in the training set is divided into a source image group and a control image group to train the generator. In order to improve the training effect, the data in the training set can also be divided into several batches, and the generator is trained in batches according to steps L12-L15.
[0073] L12 extracts the images in the source image group and the reference image group respectively through the face key feature point extraction module, and determines the target attack area of each source image and reference image.
[0074] The facial key feature point extraction module is used to identify and locate the facial key feature points of the source image in the source image group, and extract the designated area of the eyes and triangular area of the face, that is, the target area, according to the coordinates of the facial key feature points; at the same time, a 0-1 binary mask P corresponding to the target area is generated, such as Figure 4 As shown in the figure, the white area represents the target area where multiple adversarial blocks are generated, and the black area is the non-key feature area. The key feature points of the face are identified and located in the control image of the control image group through the key feature point extraction module, and the designated area of the eyes and triangular area of the face, i.e., the target area, is extracted according to the coordinates of the key feature points of the face.
[0075] like Figure 4 As shown, in the input source image I G and comparison image I D In the case of , the facial key feature point extraction network generates corresponding facial key feature point coordinate grids for different faces, and uses the feature point coordinates around the eyes and triangular area to generate a 0-1 mask to obtain the target attack area O G and O6.
[0076] L13 inputs the target attack area of each source image into the generator to generate a corresponding generated image.
[0077] In this step, the target area O of the source image is G As the input of the generator G, the output has the face style of the source image
[0078] The target areas of each generated image and control image generated by L14 are input into the discriminator for identification, and the generation loss and identification loss are obtained at the same time.
[0079] The formula for calculating the generation loss is as follows:
[0080]
[0081] In the formula, O Gi represents the target region of the i-th source image; G(·) represents the output of the generator; D(·) represents the output of the discriminator; n represents the number of source images in each set of training samples;
[0082] The formula for calculating the identification loss is as follows:
[0083]
[0084] In the formula, O Di represents the target area of the i-th control image.
[0085] L15 uses the generation loss and the identification loss to update the generator and discriminator parameters; then, returns to step L13 and repeats the above steps L13-L15 until the discriminator cannot distinguish the target area between the generated image and the control image, or reaches the preset number of times.
[0086] This step uses the generation loss and the discrimination loss to optimize the parameters of the generator and the discriminator through the Adam optimization algorithm. Repeat the above steps L13-L15. When the discrimination loss approaches 0, it is considered that the discriminator cannot distinguish between the generated image and the real image (i.e., the target area of the control image). It can also be based on the preset number of iterations of steps L13-L15. When the preset upper limit is reached, it means that the generator can generate natural face images and achieve the training purpose of this step.
[0087] L2 fine-tunes the generator trained in step L1 through an integrated model based on meta-learning.
[0088] like Figure 5 and Figure 6 As shown in Figure 2, the purpose of this step is to fine-tune the generator to improve the transferability of adversarial samples. Assume that there are K pre-trained face detection models (F = F1, F2, ..., F j ,...,F k ) constitutes an integrated model based on meta-learning, arbitrarily selects K-1 face detection models as training models, and another face detection model as a test model. In this embodiment, the integrated model includes Irse50, Ir152, Mobileface and Facenet, that is, K=4.
[0089] Based on K-1 training models, L21 designs K-1 training and testing branches to train and test the generator respectively.
[0090] The training and testing steps along any branch are as follows:
[0091] L211 uses the generator to first perform attack training on the training model, and uses the attack loss obtained from the training to update the generator parameters.
[0092] The steps for the generator to attack the trained model are as follows:
[0093] Step a1, extracting key facial feature points from the source image in the source image group through the key facial feature point extraction module, and determining the corresponding target attack area and binary mask; then generating the corresponding generated image through the generator according to the target attack area; generating multiple adversarial blocks according to the generated image and the binary mask through the fusion module, and then combining the corresponding source images to obtain a number of face adversarial samples;
[0094] Step b1: input the generated face adversarial samples and target images into the training model to obtain the corresponding attack loss.
[0095] The target image can be selected from a control image set or a test set.
[0096] For any generated adversarial sample, the attack loss is calculated as follows:
[0097]
[0098] In the formula, I T represents the target image, and F(·) represents the output of the face detection model. By continuously reducing the attack loss, the generated adversarial samples With the target image I T The two images are close to each other, so that the face detection model judges them as the same target.
[0099] For all generated adversarial examples, the attack loss is summed to get ∑Γ, and then combined with the generated loss L gen , the total loss (1-α)∑Γ+αL for optimizing the generator parameters is obtained by weighted summation gen , α represents the weight; the generator parameters are then optimized using the Adam optimization algorithm. At the same time, the discrimination loss is calculated according to the formula (2) given above and combined with the target area of the control image, and the discriminator parameters are optimized using the Adam optimization algorithm.
[0100] L212 uses the generator with updated parameters to perform attack tests on the test model, and uses the attack loss obtained from the test to update the generator parameters.
[0101] The steps of the generator attack on the test model are as follows:
[0102] Step a2, extracting key facial feature points from the source image in the source image group through the key facial feature point extraction module, and determining the corresponding target attack area and binary mask; then generating a corresponding generated image based on the target attack area through the generator whose parameters are updated after step L211; generating multiple adversarial blocks based on the generated image and the binary mask through the fusion module, and then fusing them with the corresponding source images to obtain a number of face adversarial samples;
[0103] Step b2: Input the generated face adversarial samples and target images into the test model to obtain the corresponding attack loss.
[0104] The process of optimizing the parameters of the generator and discriminator is similar to the training process on the training model. For all generated adversarial samples, the attack loss is summed to get ∑Γ, and then combined with the generated loss L gen , the total loss (1-α)∑Γ+αL for optimizing the generator parameters is obtained by weighted summation gen , α represents the weight; the generator parameters are then optimized using the Adam optimization algorithm. At the same time, the discrimination loss is calculated according to the formula (2) given above and combined with the target area of the control image, and the discriminator parameters are optimized using the Adam optimization algorithm.
[0105] L22 performs weighted addition on the generator parameters after testing different branches to obtain the integrated generator parameters.
[0106] Different weights are assigned to the training models of different branches, and then the generator parameters after testing different branches are weighted added to obtain the integrated generator parameters.
[0107] L23 determines whether the preset upper limit of the number of trainings of the integrated model based on meta-learning has been reached. If not, it returns to step L21. Otherwise, the training of the integrated model based on meta-learning ends.
[0108] The preset number of iterations of the meta-learning-based integrated model training can be set, and the transferability of the adversarial samples generated by the generator can be improved through iterative training. In different meta-learning-based integrated model training iterations, the training model and the test model can be different and are randomly selected from K face detection models.
[0109] like Figure 6 As shown in the figure, in the first iteration of the integrated model, MobileFace, Irse50, and Irl52 are training models, and Facenet is a test model; different training models and test models constitute different training and test branches. In the second iteration of the integrated model, Facenet, Irse50, and Irl52 are training models, and MobileFace is a test model. This cycle is repeated until the preset upper limit is reached.
[0110] The test set includes 200 source images and 15 target images, which constitute 3000 identity pairs. Here, the MobileFace model is used as the attacked face detection model.
[0111] For any identity pair, follow the steps below to generate face adversarial samples and conduct attack tests on the face adversarial sample generation system based on multiple adversarial blocks:
[0112] S1 extracts key facial feature points from the source image through the facial key feature point extraction module and determines the corresponding target attack area and binary mask;
[0113] S2 generates a corresponding generated image through a generator according to the target attack area;
[0114] S3 generates multiple adversarial blocks based on the generated image and binary mask through the fusion module, and then fuses them with the corresponding source image to obtain the face adversarial sample;
[0115] S4 inputs the generated face adversarial samples and target images into the face detection model for attack testing.
[0116] The attack success rate is tested on the above 3000 identity pairs. After experiments, the attack success rate can reach 51.04%, which has a good attack effect.
[0117] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0118] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0119] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0120] The present invention uses specific embodiments to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
[0121] Those skilled in the art will appreciate that the embodiments described herein are intended to help readers understand the principles of the present invention, and should be understood that the protection scope of the present invention is not limited to such specific statements and embodiments. Those skilled in the art can make various other specific variations and combinations that do not deviate from the essence of the present invention based on the technical revelations disclosed by the present invention, and these variations and combinations are still within the protection scope of the present invention.
Claims
1. A face adversarial sample generation system based on multi-adversarial blocks, It is characterized in that include: The facial key feature point extraction module is used to extract the facial key feature points of the source image, obtain the facial key feature point coordinate grid, determine the corresponding target attack area, and generate the corresponding 0-1 binary mask using the feature point coordinates around the eyes and the designated area of the triangular area of the face; A generator, used for generating a corresponding generated image according to a target attack area; The fusion module first generates multiple adversarial blocks based on the multiplication of the generated image and the binary mask, and then fuses them with the source image to obtain the final face adversarial sample.
2. According to the multi-adversarial block-based face adversarial sample generation system of claim 1, It is characterized in that The fusion module obtains the final face adversarial sample through the following formula: In the formula, For face adversarial samples, Represents the multiplication of the elements at the corresponding positions of the vector, P is the target area O of the source image G Binary masks of the same size, represents the generated image generated by the generator, G(﹒) represents the output result of the generator, Represents a multi-adversarial block.
3. The face adversarial sample generation system based on multiple adversarial blocks according to claim 1 or 2, It is characterized in that The facial key feature point extraction module includes a BlazeFace short-range model and a facial mesh model arranged in sequence; the generator adopts an encoder-decoder structure, which is composed of more than one convolution layer and more than one deconvolution layer arranged symmetrically.
4. The face adversarial sample generation system based on multiple adversarial blocks according to claim 1, It is characterized in that A discriminator is also included for distinguishing target regions between generated images generated by the generator and control images during the generator training process.
5. The face adversarial sample generation system based on multiple adversarial blocks according to claim 4, It is characterized in that The discriminator consists of several convolutional layers.
6. The training method for generating a face adversarial sample system based on multiple adversarial blocks according to any one of claims 1 to 5, It is characterized in that The following steps are involved: L1 trains the generator; this step includes the following sub-steps: L11 divides the data in the training set into a source image group and a control image group; L12 extracts the images in the source image group and the reference image group respectively through the face key feature point extraction module, and determines the target attack area of each source image and the reference image; L13 inputs the target attack area of each source image into the generator to generate a corresponding generated image; The target areas of each generated image and control image generated by L14 are input into the discriminator for identification, and the generation loss and identification loss are obtained at the same time; L15 updates the parameters of the generator and the discriminator using the generation loss and the identification loss; then, returns to step L13, and repeats the above steps L13-L15 until the discriminator cannot distinguish the target area between the generated image and the control image, or reaches the preset number of times; L2 fine-tunes the generator trained in step L1 through an integrated model based on meta-learning.
7. The training method for generating a face adversarial sample system based on multiple adversarial blocks according to claim 6, It is characterized in that In step L14, the loss calculation formula is generated as follows: In the formula, O Gi represents the target region of the i-th source image; G(·) represents the output of the generator; D(·) represents the output of the discriminator; n represents the number of source images in each set of training samples; The formula for calculating the identification loss is as follows: In the formula, O Di represents the target area of the i-th control image.
8. The training method for generating a face adversarial sample system based on multiple adversarial blocks according to claim 6, It is characterized in that Assume there are K pre-trained face detection models (F = F 1 ,F 2 ,...,F j ,...,F k ) to form an integrated model based on meta-learning, arbitrarily select K-1 face detection models as training models and another face detection model as the test model, and follow the steps below to fine-tune and update the generator: L21 designs K-1 training and testing branches based on K-1 training models to train and test the generator respectively; the training and testing steps along any branch are as follows: L211 uses the generator to first perform attack training on the training model, and uses the attack loss obtained from the training to update the generator parameters; L212 uses the generator with updated parameters to perform attack tests on the test model, and uses the attack loss obtained from the test to update the generator parameters; L22 performs weighted addition of the generator parameters after different branch tests to obtain the integrated generator parameters; L23 determines whether the preset upper limit of the number of trainings of the integrated model based on meta-learning has been reached. If not, it returns to step L21. Otherwise, the training of the integrated model based on meta-learning ends.
9. The training method for generating a face adversarial sample system based on multiple adversarial blocks according to claim 8, It is characterized in that The face detection model in the meta-learning based integrated model is selected from Irse50, Ir152, Mobileface or Facenet.
10. The training method for generating a face adversarial sample system based on multiple adversarial blocks according to claim 8, It is characterized in that In step L21, the steps for the generator to attack the training model or the test model are as follows: Step a, extracting key facial feature points from the source images in the source image group through a key facial feature point extraction module, and determining the corresponding target attack area and binary mask; Then, according to the target attack area, the corresponding generated image is generated through the generator; Through the fusion module, multiple adversarial blocks are generated based on the generated image and binary mask, and then combined with the corresponding source image to obtain several face adversarial samples; Step b: input the generated face adversarial samples and target images into the training model or the test model to obtain the corresponding attack loss.
11. The training method for generating a face adversarial sample system based on multiple adversarial blocks according to claim 8 or 10, It is characterized in that The attack loss calculation formula is as follows: In the formula, I T represents the target image, and F(﹒) represents the output of the face detection model.
