Adversarial sample generation method, device, storage medium and computer program product
The dual-branch discriminator adversarial generation network is used to generate adversarial samples and combined with the T-glasses adversarial sample mask, which solves the problem of the lack of large-scale adversarial samples in adversarial attack defense in face recognition systems and improves the security and stability of the system.
Patent Information
- Application Number
- CN202410807699.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-21
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2044-06-21
AI Technical Summary
Face recognition systems lack large-scale adversarial samples to defend against adversarial attacks, resulting in low security and stability.
Features are extracted from the images of the attacker and the attacked through a preset face recognition model, a dual-branch discriminator adversarial generation network is used to generate adversarial samples, and a T-glasses adversarial sample is generated based on the generated adversarial sample and the T-glasses adversarial sample mask. , used to train and evaluate defense systems.
It provides large-scale adversarial samples for training and evaluation, improves the security and stability of the face recognition system, and enhances the ability to defend against adversarial attacks.
Smart Images

Figure CN118379583B
Abstract
Description
Technical Field
[0001] The present application relates to the field of face recognition technology, and in particular to adversarial sample generation methods, devices, storage media and computer program products. Background Art
[0002] In the field of Internet finance, face recognition systems are widely used in various aspects of business identity authentication, such as user registration and login, real-name authentication, loan withdrawal application, etc. However, due to its importance in identity authentication, face recognition systems have become the main target of fraud attacks by criminals. With the continuous updating of fraud methods, adversarial attacks, as a new type of face recognition attack method, use specific means to change the input face image for the machine's face recognition method, thereby deceiving the face recognition system and causing it to misidentify or fail to recognize.
[0003] Existing face recognition systems have a high rate of missed detection for adversarial sample attacks. Once adversarial attacks are used by criminals, they will bring unpredictable fraud risks to financial companies and customers. Therefore, it is beneficial to improve the security and stability of face recognition systems by doing a good job in preventing adversarial attack fraud and conducting forward-looking research on adversarial attack defense technologies. However, the current research on face recognition defense against adversarial attacks lacks large-scale real data sets for training and evaluating defense methods, which severely limits the research and application of adversarial defense. Therefore, it is crucial to generate and produce large-scale adversarial samples.
[0004] The above contents are only used to assist in understanding the technical solution of the present invention and do not constitute an admission that the above contents are prior art. Summary of the invention
[0005] The main purpose of this application is to provide an adversarial sample generation method, device, storage medium and computer program product, aiming to solve the technical problem in the existing technology of face recognition defense adversarial attack research that lacks large-scale adversarial samples for training and evaluation, resulting in low security and stability.
[0006] To achieve the above objectives, the present application proposes a method for generating adversarial samples, the method comprising:
[0007] Extract features of the attacker image and the attacked image respectively by using a preset face recognition model to determine a first face region image in the attacker image and a second face region image in the attacked image;
[0008] Scaling the first face region image and the second face region image based on an input image size of a dual-branch discriminator adversarial generative network to obtain a scaled first face region image and a scaled second face region image, wherein the dual-branch discriminator adversarial generative network incorporates an edge detection branch and a noise perception branch;
[0009] Obtaining a generative adversarial sample based on the scaled first face region image and the scaled second face region image through the dual-branch discriminator adversarial generative network;
[0010] A T-glasses adversarial sample is generated based on the generated adversarial sample and the T-glasses adversarial sample mask.
[0011] In one embodiment, before the step of extracting features from the attacker image and the attacked image respectively by using a preset face recognition model to determine the first face area image in the attacker image and the second face area image in the attacked image, the step further includes:
[0012] Obtain eye key point index and nose key point index according to the coordinates of several facial key points of a preset face recognition model;
[0013] Determine the width of the T-type glasses, the width of the nose of the T-type glasses, and the inner frame width of the glasses frame of the T-type glasses based on the eye key point index;
[0014] Determine the height of the T-glasses according to the width of the T-glasses;
[0015] Determine the height of the nose of the T-type glasses according to the width of the nose of the T-type glasses;
[0016] Determine the inner frame height of the glasses frame of the T-type glasses according to the height of the T-type glasses;
[0017] A T-glasses adversarial sample mask is generated based on the T-glasses height, the T-glasses nose height and the glasses frame inner frame height.
[0018] In one embodiment, the step of obtaining and generating adversarial samples based on the scaled first face area image and the scaled second face area image through the dual-branch discriminator adversarial generative network includes:
[0019] Inputting the scaled first face region image and the scaled second face region image into the dual-branch discriminator adversarial generation network to construct a discriminator network and a generator network;
[0020] Generate adversarial attack perturbation vectors using random initialization;
[0021] generating, by the generator network, an adversarial attack perturbation based on the adversarial attack perturbation vector;
[0022] An adversarial sample is generated based on the adversarial attack disturbance and the scaled first face region image.
[0023] In one embodiment, before the step of generating a T-glasses adversarial sample based on the generated adversarial sample and the T-glasses adversarial sample mask, the step further includes:
[0024] Inputting the attacker's real image and the attacked's real image into the discriminator network to determine the first discriminator loss according to the first discriminator output result and the real image label;
[0025] Inputting the generated adversarial sample into the discriminator network to determine the second discriminator loss according to the second discriminator output result and the false image label;
[0026] determining a total discriminator loss based on the first discriminator loss and the second discriminator loss;
[0027] The discriminator parameters in the discriminator network are updated according to the discriminator total loss to obtain an updated discriminator network.
[0028] In one embodiment, before the step of generating a T-glasses adversarial sample based on the generated adversarial sample and the T-glasses adversarial sample mask, the step further includes:
[0029] Inputting the generated adversarial sample into the updated discriminator network to determine a first generator loss based on the discriminator output result and the false image label;
[0030] Extracting facial features of the attacker in the attacker image and facial features of the victim in the victim image respectively;
[0031] Determine a second generator loss based on the attacker's facial features and the attacked's facial features;
[0032] Determine the loss of the third generator based on the sample pixel points in the loss-generated adversarial sample;
[0033] determining a total generator loss based on the first generator loss, the second generator loss, and the third generator loss;
[0034] Updating generator parameters in the generator network according to the total generator loss;
[0035] When the updating is completed, the step of generating a T-glasses adversarial sample based on the generated adversarial sample and the T-glasses adversarial sample mask is performed.
[0036] In one embodiment, a plurality of first transposed convolution modules and a single second transposed convolution module are provided in the generator network; wherein the first transposed convolution module is composed of a transposed convolution layer, a batch normalization layer and a ReLU activation function; and the second transposed convolution module is composed of a transposed convolution layer and a Tanh activation function.
[0037] In one embodiment, an edge detection branch and a noise extraction branch are provided in the discriminator network; wherein the edge detection branch and the noise extraction branch both use the mobilenetv2 network structure as a backbone network, and the mobilenetv2 network structure is composed of a stack of inverted residual blocks.
[0038] In addition, to achieve the above-mentioned purpose, the present application also proposes an adversarial sample generation device, which includes: a memory, a processor, and a computer program stored on the memory and executable on the processor, and the computer program is configured to implement the steps of the adversarial sample generation method described above.
[0039] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the adversarial sample generation method described above are implemented.
[0040] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements the steps of the adversarial sample generation method described above.
[0041] The present application provides an adversarial sample generation method, which discloses extracting features of an attacker image and an attacked image respectively through a preset face recognition model, determining a first face region image in the attacker image and a second face region image in the attacked image; scaling the first face region image and the second face region image based on an input image size of a dual-branch discriminator adversarial generation network to obtain the scaled first face region image and the scaled second face region image, wherein the dual-branch discriminator adversarial generation network is integrated with an edge detection branch and a noise perception branch; and generating a first face region image and a second face region image based on the scaled first face region image and the scaled second face region image through the dual-branch discriminator adversarial generation network. The invention obtains generative adversarial samples from regional images; generates T-glasses adversarial samples based on the generative adversarial samples and the T-glasses adversarial sample masks; because the present invention obtains generative adversarial samples based on the first face region image in the attacker image and the second face region image in the attacked image through a dual-branch discriminator adversarial generative network, and generates T-glasses adversarial samples based on the generative adversarial samples and the T-glasses adversarial sample masks, the generated T-glasses adversarial samples can be used to train and evaluate the defense system in the future, thereby solving the technical problem of lack of large-scale adversarial samples for training and evaluation in the research on face recognition defense adversarial attacks in the prior art, resulting in low security and stability. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0043] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0044] Figure 1 A schematic diagram of a process flow provided for Embodiment 1 of the method for generating adversarial samples of the present application;
[0045] Figure 2 A flowchart of adversarial sample generation in the adversarial sample generation method of this application;
[0046] Figure 3 A flowchart of the second embodiment of the adversarial sample generation method of the present application is provided;
[0047] Figure 4 This is a design diagram of the generator network in the adversarial sample generation method of this application;
[0048] Figure 5This is a design diagram of the discriminator network in the adversarial sample generation method of this application;
[0049] Figure 6 This is a training flowchart of the dual-branch discriminator adversarial generation network in the adversarial sample generation method of this application;
[0050] Figure 7 Schematic diagram of the device structure of the hardware operating environment involved in the adversarial sample generation method in the embodiment of the present application.
[0051] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0052] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0053] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0054] The main solution of the embodiment of the present application is: feature extraction is performed on the attacker image and the attacked image respectively through a preset face recognition model to determine the first face area image in the attacker image and the second face area image in the attacked image; the first face area image and the second face area image are scaled based on the input image size of the dual-branch discriminator adversarial generation network to obtain the scaled first face area image and the scaled second face area image, and the dual-branch discriminator adversarial generation network is integrated with an edge detection branch and a noise perception branch; a generative adversarial sample is obtained based on the scaled first face area image and the scaled second face area image through the dual-branch discriminator adversarial generation network; a T-glasses adversarial sample is generated based on the generative adversarial sample and the T-glasses adversarial sample mask.
[0055] Due to the lack of large-scale real data sets for training and evaluating defense methods in the existing research on face recognition defense against adversarial attacks, the research and application of adversarial defense are limited.
[0056] The present application provides a solution, which obtains a generative adversarial sample based on a first face area image in an attacker's image and a second face area image in a victim's image through a dual-branch discriminator adversarial generative network, and generates a T-glasses adversarial sample based on the generated adversarial sample and a T-glasses adversarial sample mask, so that the generated T-glasses adversarial sample can be used to train and evaluate the defense system subsequently, thereby solving the technical problem of lack of large-scale adversarial samples for training and evaluation in the research on face recognition defense adversarial attacks in the prior art, resulting in low security and stability.
[0057] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, an adversarial sample generation device, etc. The following takes the adversarial sample generation device as an example (hereinafter referred to as the device) to illustrate this embodiment and the following embodiments.
[0058] Based on this, the embodiment of the present application provides a method for generating adversarial samples, referring to Figure 1 , Figure 1 This is a flowchart of the first embodiment of the adversarial sample generation method of the present application.
[0059] In this embodiment, the adversarial sample generation method includes steps S10 to S40:
[0060] Step S10: extracting features of the attacker image and the attacked image respectively by using a preset face recognition model to determine a first face region image in the attacker image and a second face region image in the attacked image.
[0061] It should be understood that the above-mentioned preset face recognition model may be a model for recognizing faces in images, and the preset face recognition model in this embodiment may include but is not limited to the ArcFace model.
[0062] It should be noted that the above-mentioned attacker image can be a digital domain image with noise disturbance added to it, which is input by a user attacking the face recognition defense system. The above-mentioned victim image can be a face image currently being recognized by the face recognition defense system. In practical applications, the attacker image can interfere with the judgment of the computer, causing the face recognition system to misrecognize or fail to recognize the victim image.
[0063] It should be noted that the first face area image may be an image of the face area portion of the attacker's image; correspondingly, the second face area image may be an image of the face area portion of the victim's image.
[0064] In the specific implementation, this solution can use the SCRFD face detection model to detect the face and obtain the face frame, and then use the above-mentioned preset face recognition model (such as the ArcFace model) to extract face features and conduct adversarial attacks against ArcFace. Among them, the SCRFD face detection model is a model that performs face detection through two strategies: sample redistribution (SR) and computational redistribution (CR). While ensuring high accuracy, SCRFD is lighter than other face detection models, reducing the time consumption of the face detection module and is more friendly to batch production of adversarial samples; ArcFace is widely used in face recognition comparison due to its high accuracy and robustness. Specifically, the face detection in this scheme can adopt the SCRFD-0.5G model based on Depth-wise Convbackbone, use the model weights pre-trained with the widerface dataset, set the input image size to 320×320, the face detection threshold to 0.5, and the face recognition model outputs the detection face frame and face key points to obtain the first face area image in the attacker's image and the second face area image in the attacked image. Among them, the SCRFD-0.5G model has a very small parameter amount while ensuring the reasoning accuracy, which helps to accelerate model training and reduce the actual loss caused by the face detection module. The face feature extraction adopts ArcFace with Resnet-50 as the backbone network. This model is widely used in the field of face recognition. The present invention performs adversarial attacks based on this network structure. In addition, the face detection model in this embodiment can also be replaced by other models, such as Retina Face, yolo series, TinaFace, etc., which can be selected according to actual conditions; in addition, the above-mentioned preset face recognition model can also be selected according to the face recognition system actually attacked. Currently, in addition to ArcFace, FaceNet, VGGFace, SphereFace and other face recognition models can also be used.
[0065] Step S20: scaling the first face area image and the second face area image based on the input image size of the dual-branch discriminator adversarial generative network to obtain the scaled first face area image and the scaled second face area image, wherein the dual-branch discriminator adversarial generative network integrates an edge detection branch and a noise perception branch.
[0066] It should be noted that the dual-branch discriminator generative adversarial network (DB-GAN) is a specific generative adversarial network (GAN) architecture designed with a dual-branch discriminator. In this embodiment, in order to achieve batch generation of face recognition adversarial attack samples, a new network architecture can be designed based on the basic idea of the adversarial generative network, and a dual-branch discriminator adversarial generative network integrating edge detection and noise perception can be constructed to achieve multi-view perception of real image discrimination and image generation.
[0067] It should be understood that the above-mentioned input image size can be the size that the image input to the dual-branch discriminator adversarial generation network should meet. Since in this embodiment, the first face area image and the second face area image need to be input into the dual-branch discriminator adversarial generation network for training to generate adversarial samples, before the first face area image and the second face area image are input into the dual-branch discriminator adversarial generation network, the first face area image and the second face area image should be scaled according to the input image size of the dual-branch discriminator adversarial generation network to obtain the scaled first face area image and the scaled second face area image, and the scaled first face area image and the scaled second face area image should be input into the dual-branch discriminator adversarial generation network.
[0068] Step S30: obtaining a generative adversarial sample based on the scaled first face area image and the scaled second face area image through the dual-branch discriminator adversarial generative network.
[0069] It should be noted that the above-mentioned generated adversarial sample adds a sample obtained by adversarial perturbation to the scaled first face area image. In this embodiment, the adversarial attack perturbation output by the generator in the dual-branch discriminator adversarial generation network can be fused with the attacker image (i.e., the scaled first face area image) to obtain a generated adversarial sample.
[0070] It should be noted that the dual-branch discriminator adversarial generative network in this scheme can evaluate the authenticity of the input image on the one hand, and its adversarial nature on the other hand, thereby generating T-glasses adversarial samples that can deceive the face recognition system and are not easy to detect.
[0071] Step S40: Generate a T-glasses adversarial sample based on the generated adversarial sample and the T-glasses adversarial sample mask.
[0072] It should be understood that the T-glasses adversarial sample mask may be a mask corresponding to the T-glasses; correspondingly, the T-glasses adversarial sample may be a sample obtained by adding the T-glasses adversarial perturbation to the adversarial sample. In this embodiment, the T-glasses adversarial sample mask may be used to add or change the perturbation in the generated adversarial sample to generate the T-glasses adversarial sample.
[0073] In practical applications, refer to Figure 2 , Figure 2 This is a flowchart of adversarial sample generation in the adversarial sample generation method of this application. Figure 2 As shown, the attacker image, the attacked image and the T-glasses adversarial sample mask can first be input into the dual-branch discriminator adversarial generative network, and the face recognition feature extraction model ArcFace can be used to extract the face features of the attacked person. Then, the dual-branch discriminator adversarial generative network is loaded to generate adversarial attack perturbations. After fusing the adversarial attack perturbations with the attacker image, the generated adversarial samples in the digital domain can be obtained, and finally the physical domain adversarial samples can be printed.
[0074] Furthermore, in the present embodiment, the shape of the existing T-glasses can be modified so that the attacker does not affect the detection of the coordinated action live body when wearing the T-glasses, while ensuring the success rate of the counter-attack on the face recognition system. Specifically, before the step S10, the method also includes: obtaining an eye key point index and a nose key point index according to the coordinates of several personal face key points of a preset face recognition model; determining the T-glasses width, the T-glasses nose width and the inner frame width of the T-glasses frame based on the eye key point index; determining the T-glasses height according to the T-glasses width; determining the T-glasses nose height according to the T-glasses nose width; determining the T-glasses frame inner frame height according to the T-glasses height; generating a T-glasses adversarial sample mask based on the T-glasses height, the T-glasses nose height and the inner frame height.
[0075] It should be noted that the coordinates of several facial key points of the preset face recognition model in this embodiment may include the coordinates of the outer corner of the left eye, the inner corner of the left eye, the outer corner of the right eye, the inner corner of the right eye and the coordinates of the tip of the nose. The above eye key point index can be a number or label for identifying and locating the key points of the eye area; correspondingly, the above nose key point index can be a number or label for identifying and locating the key points of the nose area. In this embodiment, the ArcFace model can be used to output the coordinates of 5 facial key points in the image based on the face image, and the eye key point coordinates and nose key point coordinates (such as nose tip coordinates and nasal root coordinates) in the image can be obtained based on these facial key point coordinates.
[0076] In practical applications, since the motion liveness detection system usually includes four actions: blinking, opening the mouth, shaking the head, and nodding, in order to allow the attacker to cooperate with the liveness detection action and not be intercepted by the motion liveness detection, the eye area can be removed on the basis of the existing T-glasses, and the nose area of the T-glasses can be retained, so that the attacker's coordinated liveness blinking and opening the mouth can be captured by the mobile terminal lens, while retaining as many facial feature areas of the attacked as possible to ensure the success rate of the adversarial attack. At this time, the process of making the T-glasses adversarial sample mask can be: after obtaining the eye key point index and the nose key point index, determine the left and right eye index spacing based on the eye key point index, and then set the T-glasses width to 2 times the left and right eye index spacing, and set the T-glasses height to 0.32 times the T-glasses width. In addition, the T-glasses nose width can be set to 0.7 times the left and right eye index spacing, and the T-glasses nose height can be set to 0.8 times the T-glasses nose width. In addition, the inner frame width of the T-glasses can be set to 0.68 times the index spacing between the left and right eyes, and the inner frame height of the T-glasses can be set to 0.4 times the height of the T-glasses. Then, a T-glasses mask can be generated according to the ratio of the T-glasses setting. Specifically, a blank mask with the same size as the input image is first created, and rectangles of the glasses and nose areas are drawn on the mask image and filled with black. Then, a rectangle of the inner frame area of the glasses is drawn and filled with white. At this time, a T-glasses adversarial sample mask is obtained.
[0077] In a specific implementation, after obtaining the generated adversarial sample, the device can fuse it with the pre-made T-glasses adversarial sample mask to obtain the T-glasses adversarial perturbation, and attach the T-glasses adversarial perturbation to the attacker's face image (here it can be the first face area image after scaling) to generate the final T-glasses adversarial sample in the digital domain. In the training process of this embodiment, the two-dimensional affine transformation technology can be used to attach the generated T-glasses adversarial perturbation to the attacker's face, so that the T-glasses fit better with the face, reduce the loss caused by the position offset of the glasses during training, and improve the robustness of the generated T-glasses adversarial sample to the physical world. In the actual application process, the attacker and the attacked pictures are input into the dual-branch discriminator adversarial generation network, and a large number of T-glasses adversarial samples can be generated in batches for training and evaluation of the adversarial attack defense model, thereby improving the security and robustness of the face recognition system.
[0078] The present embodiment provides an adversarial sample generation method, which discloses extracting features from an attacker image and an attacked image respectively through a preset face recognition model to determine a first face region image in the attacker image and a second face region image in the attacked image; scaling the first face region image and the second face region image based on an input image size of a dual-branch discriminator adversarial generation network to obtain the scaled first face region image and the scaled second face region image, wherein the dual-branch discriminator adversarial generation network is integrated with an edge detection branch and a noise perception branch; and extracting features from an attacker image and an attacked image respectively through a preset face recognition model to determine a first face region image in the attacker image and a second face region image in the attacked image; scaling the first face region image and the second face region image based on an input image size of a dual-branch discriminator adversarial generation network to obtain the scaled first face region image and the scaled second face region image. Generate adversarial samples from regional images; generate T-glasses adversarial samples based on the generated adversarial samples and the T-glasses adversarial sample masks; since this embodiment obtains generative adversarial samples based on the first face region image in the attacker image and the second face region image in the victim image through a dual-branch discriminator adversarial generative network, and generates T-glasses adversarial samples based on the generated adversarial samples and the T-glasses adversarial sample masks, the generated T-glasses adversarial samples can be used to train and evaluate the defense system in the future, thereby solving the technical problem of lack of large-scale adversarial samples for training and evaluation in the research on face recognition defense adversarial attacks in the prior art, resulting in low security and stability.
[0079] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated in the following. Figure 3 , Figure 3 A flowchart of the second embodiment of the adversarial sample generation method of the present application is provided.
[0080] In this embodiment, step S30 includes steps S301 to S304:
[0081] Step S301: inputting the scaled first face area image and the scaled second face area image into the dual-branch discriminator adversarial generation network to construct a discriminator network and a generator network.
[0082] It should be noted that the generator network can be a network used to generate adversarial perturbation samples in a dual-branch discriminator adversarial generative network. The discriminator network can be a network used to classify face images and distinguish between real faces and generated fake faces in a dual-branch discriminator adversarial generative network.
[0083] In practical applications, the generator receives a 1×100-dimensional perturbation vector as input, and generates a 3×160×160 adversarial perturbation image after several layers of upsampling. The upsampling uses multi-layer transposed convolution to expand the data dimension. The intermediate layers except the input layer and the output layer use the Batch Normalization layer (BN layer) and the ReLU activation function for stable training. The output layer uses the Tanh activation function to control the output range. The discriminator receives the 3×160×160 attacker's real face image, the fake face image output by the generator, and their corresponding labels as input, which is used to classify the face image and distinguish between the real face and the generated fake face. Due to the mutual excitation mechanism between the generator and the discriminator, the classification accuracy of the discriminator greatly affects the authenticity of the image generated by the generator, and plays a vital role in the training process of the adversarial generative network.
[0084] In this embodiment, a plurality of first transposed convolution modules and a single second transposed convolution module are provided in the generator network; wherein the first transposed convolution module is composed of a transposed convolution layer, a batch normalization processing layer and a ReLU activation function; and the second transposed convolution module is composed of a transposed convolution layer and a Tanh activation function.
[0085] In the specific implementation, the generator in this scheme is designed as a deep convolution generator, referring to Figure 4 , Figure 4 This is a design diagram of the generator network in the adversarial sample generation method of this application. Figure 4 As shown in the figure, after a 1×100-dimensional adversarial attack perturbation vector is input into the generator, the input noise can be upsampled through 5 transposed convolution modules, and the feature dimension of the adversarial noise can be gradually expanded to generate features with spatial structure. Among them, the first 4 transposed convolution modules (i.e., the first transposed convolution module mentioned above) are composed of a transposed convolution layer plus a Batch Normalization layer plus a ReLU activation function, and the last transposed convolution module (i.e., the second transposed convolution module mentioned above) uses a transposed convolution layer plus a Tanh activation function to limit the pixel value to a suitable range. After passing through the generator, a 3×160×160 adversarial perturbation sample can be generated.
[0086] In this embodiment, an edge detection branch and a noise extraction branch are provided in the discriminator network; wherein the edge detection branch and the noise extraction branch both use the mobilenetv2 network structure as the backbone network, and the mobilenetv2 network structure is composed of a stack of inverted residual blocks.
[0087] It should be noted that the above-mentioned discriminator may include: an edge detection branch (EDB) and a noise extraction branch (NEB), wherein the edge detection branch in this embodiment uses mobilenet as the backbone network. In order to make full use of the shallow and deep features of the image, the features of the depth separable convolution module are gradually combined for edge detection. In order to extract edge information, the Isotropic Sobel operator is introduced to detect edge features in all directions, and then the residual edge enhancer (REE) is used to balance the reasonable use of deep features and shallow features to obtain edge threshold maps and global feature maps. The noise extraction branch uses a statistical region merging (SRM) filter to extract image noise, and the image noise is passed through multiple layers of depth separable convolution modules to obtain a noise feature map. The discriminator updates parameters by calculating edge loss and global segmentation loss to identify the image generation area. By designing the TBD discriminator, the model can pay more attention to the smoothness of the edges of the generation area and reduce the noise of the generated image, so that the generated face recognition adversarial samples are closer to real faces and the edge connection is more natural.
[0088] In the specific implementation, in order to improve the discriminator's ability to distinguish real images from generated images, the discriminator in this scheme is designed as a dual-branch discriminator that integrates edge detection and noise perception. Figure 5 , Figure 5 This is the design diagram of the discriminator network in the adversarial sample generation method of this application. Figure 5As shown in the figure, the edge detection branch EDB uses mobilenetv2 as the backbone network. Since the mobilenetv2 network structure is composed of stacked inverted residual blocks, edge detection uses the features output by different inverted residual blocks to be progressively combined through the Isotropic Sobel filter (ISF) and the residual edge enhancer to achieve balanced utilization of shallow and deep features. Each ISF module consists of a Sobel convolution layer, a BN layer, a gradient amplitude calculation, and a Sigmoid layer to extract edge features; the residual edge enhancer (REE) consists of a 1×1 convolution, a 3×3 convolution-BN layer-ReLU activation function layer, and a 3×3 convolution, where a skip connection is added between the 1×1 convolution output and the last 3×3 convolution output. The outputs of different inverted residual blocks of the mobilenetv2 network are denoted as C1, C2, C3, and C4. The first REE output is obtained by passing C1 through an Isotropic Sobel filter and a REE, denoted as R1. The second REE output is obtained by passing C2 through an Isotropic Sobel filter and a REE, and then upsampling and adding it to R1 to obtain R2. And so on, R3 and R4 can be obtained. Finally, R4 is passed through a Sigmoid layer to obtain the edge threshold map output. The output C4 global feature map of the last inverted residual block becomes the second output of the edge detection branch.
[0089] In addition, the noise extraction branch NEB also uses mobilenetv2 as the backbone network. It first extracts image noise through the SRM filter, then extracts noise features through several inverted residual blocks, and obtains the output noise feature map of the last inverted residual block. The global feature map of the EDB branch and the noise feature map of the NEB branch are simply added and fused, and the global segmentation map of the image is obtained through bilinear upsampling and Sigmoid layer, that is, the real image area and the generated image area are segmented.
[0090] Step S302: Generate an adversarial attack disturbance vector using a random initialization method.
[0091] It is understandable that the random initialization method may be a method of randomly initializing the adversarial attack perturbation vector. In this embodiment, a 1×100-dimensional adversarial attack perturbation vector may be randomly initialized and the 1×100-dimensional adversarial attack perturbation vector may be input into the generator.
[0092] Step S303: Generate an adversarial attack disturbance based on the adversarial attack disturbance vector through the generator network.
[0093] In practical applications, after receiving the adversarial attack perturbation vector, the generator network can perform several layers of upsampling on the adversarial attack perturbation vector to generate adversarial attack perturbation. For example, the generator can receive a 1×100-dimensional adversarial attack perturbation vector as input, and after several layers of upsampling, it can generate a 3×160×160 adversarial attack perturbation.
[0094] Step S304: generating an adversarial sample based on the adversarial attack disturbance and the scaled first face region image.
[0095] It should be noted that after the generator outputs the adversarial attack perturbation, the adversarial attack perturbation can be fused with the attacker image to obtain a generated adversarial sample. In this scheme, in order to improve the sample generation accuracy, the first face area image of the attacker image is scaled in advance based on the input image size of the dual-branch discriminator adversarial generation network. Therefore, the adversarial attack perturbation and the scaled first face area image can be fused at this time to obtain a generated adversarial sample.
[0096] Furthermore, before step S40, the method further includes:
[0097] Step S411: inputting the attacker's real image and the attacked's real image into the discriminator network to determine the first discriminator loss according to the first discriminator output result and the real image label.
[0098] It should be understood that the above-mentioned real image labels may be labels in the real image of the attacker and the real image of the attacked.
[0099] It should be noted that the above-mentioned first discriminator loss can be a loss for supervising the edge detection of the discriminator. In practical applications, after the attacker's real picture and the attacked real picture are input into the two-branch discriminator, the first discriminator loss can be calculated based on the discriminator output and the real picture label. Among them, the first discriminator loss is used to supervise the edge detection of the discriminator, which is called edge loss. Since the edge pixels account for a small proportion of the entire image, the edge loss adopts the Dice loss suitable for extremely unbalanced samples. The formula is as follows:
[0100]
[0101] In the formula, loss E is the first discriminator loss, x i is the value of the edge image pixel, E(x i ) is the predicted value of the edge threshold image pixel, y i is the pixel value of the label image, W and H represent the width and height of the image respectively.
[0102] Step S412: inputting the generated adversarial sample into the discriminator network to determine the second discriminator loss according to the second discriminator output result and the false image label.
[0103] It can be understood that the above-mentioned false image labels can be labels in the attacker image and the attacked image.
[0104] It should be noted that the above second discriminator loss can be a loss for supervised image segmentation. In practical applications, the generated adversarial sample can be input into the two-branch discriminator, and the second discriminator loss can be calculated based on the discriminator output result and the false image label. The second discriminator loss is used for supervised image segmentation, and the cross entropy loss function is used. The formula is as follows:
[0105]
[0106] In the formula, loss S is the second discriminator loss, S(x i ) is the segmentation prediction value of the fusion of global features and noise features, y i is the pixel value of the label image.
[0107] Step S413: determining a total discriminator loss based on the first discriminator loss and the second discriminator loss.
[0108] It should be understood that after calculating the first discriminator loss and the second discriminator loss, the total discriminator loss can be calculated based on the first discriminator loss and the second discriminator loss. The calculation formula is as follows:
[0109]
[0110] In the formula, loss D is the total loss of the discriminator.
[0111] Step S414: updating the discriminator parameters in the discriminator network according to the total discriminator loss to obtain an updated discriminator network.
[0112] In practical applications, after calculating the total loss of the discriminator, the parameters in the discriminator network can be updated to update the discriminator network, thereby obtaining an updated discriminator network.
[0113] Furthermore, before step S40, the method further includes:
[0114] Step S421: Input the generated adversarial sample into the updated discriminator network to determine the first generator loss according to the discriminator output result and the false image label.
[0115] Step S422: extracting facial features of the attacker in the attacker image and facial features of the victim in the victim image respectively.
[0116] Step S423: Determine the second generator loss based on the attacker's facial features and the victim's facial features.
[0117] Step S424: Determine the third generator loss based on the sample pixel points in the loss-generated adversarial sample.
[0118] Step S425: Determine the total generator loss based on the first generator loss, the second generator loss and the third generator loss.
[0119] Step S426: Update the generator parameters in the generator network according to the total loss of the generator.
[0120] Step S427: when the update is completed, the step of generating a T-glasses adversarial sample based on the generated adversarial sample and the T-glasses adversarial sample mask is performed.
[0121] In the specific implementation, the generated adversarial sample can be input into the two-branch discriminator, and the first generator loss is calculated based on the discriminator output result and the false image label. The first generator loss uses the generated adversarial sample and its false label to calculate the cross entropy loss. The formula is similar to the second discriminator loss, denoted as loss F Then, the ArcFace model can be used to extract the facial features of the attacker and the attacked in the generated adversarial sample image and the attacked image, and the cosine similarity of the features of the two images is calculated to obtain the second generator loss, where the second generator loss is obtained by calculating the cosine similarity of the generated adversarial sample and the attacked features, and the formula is as follows:
[0122]
[0123] In the formula, loss C is the second generator loss, A i is the attacker’s facial feature, B i The facial features of the attacked person.
[0124] Then, we can continue to calculate the printability third generator loss. In this embodiment, the third generator loss is used to limit the printability of the generated T-glasses adversarial sample so that the adversarial sample can be transferred to the physical world. The printability loss is defined as follows:
[0125]
[0126] In the formula, loss Pis the loss of the second generator, i is the generated adversarial sample pixel, and P is the printable color gamut.
[0127] Finally, the first generator loss, the second generator loss, and the third generator loss can be added together to get the total generator loss, update the generator parameters, and finally complete the training. According to the T-glasses mask, the digital domain T-glasses are cropped on the adversarial sample image. The total generator loss is:
[0128]
[0129] In the formula, loss G is the total loss of the generator.
[0130] In the specific implementation, refer to Figure 6 , Figure 6 This is a training flow chart of the dual-branch discriminator adversarial generation network in the adversarial sample generation method of this application. Figure 6 As shown in the figure, first, a T-glasses adversarial sample mask can be made, and then the attacker's picture, the attacked picture and the T-glasses adversarial sample mask are input into the dual-branch discriminator adversarial generation network to build a discriminator network and a generator network, and then a 1×100-dimensional adversarial attack perturbation vector is randomly initialized, and the attacker's and the attacked's real pictures are input into the dual-branch discriminator, and the first discriminator loss is calculated according to the discriminator output and the real picture label; then the adversarial attack perturbation is input into the generator to obtain the generated adversarial attack perturbation, and then the output adversarial attack perturbation is fused with the attacker's picture to obtain the generated adversarial sample, and the generated adversarial sample picture is input into the dual-branch discriminator, and the second discriminator loss is calculated according to the discriminator output result and the false picture label; finally, the first discriminator loss and the second discriminator loss are added to obtain the total discriminator loss, and the discriminator parameters are updated. After that, the generated adversarial sample image can be input into the dual-branch discriminator, and the first generator loss is calculated based on the discriminator output result and the false image label, and the ArcFace model is used to extract the attacker and attacked facial features of the generated adversarial sample image and the attacked image, and the cosine similarity of the two image features is calculated to obtain the second generator loss, and then the printability third generator loss is calculated, and finally the first generator loss, the second generator loss, and the third generator loss are added together to obtain the total generator loss, and the generator parameters are updated. Finally, the training is completed, and the digital domain T-glasses are cropped on the adversarial sample image according to the T-glasses mask.
[0131] In this embodiment, it is disclosed that the scaled first face area image and the scaled second face area image are input into a dual-branch discriminator adversarial generation network to construct a discriminator network and a generator network; an adversarial attack perturbation vector is generated by a random initialization method; an adversarial attack perturbation is generated based on the adversarial attack perturbation vector by the generator network; and adversarial samples are obtained based on the adversarial attack perturbation and the scaled first face area image, so that the network can not only evaluate the authenticity of the input image, but also evaluate its adversarial nature, thereby generating T-glasses adversarial samples that can deceive the face recognition system and are not easy to detect.
[0132] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the adversarial sample generation method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.
[0133] The present application provides an adversarial sample generation device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the adversarial sample generation method in the above-mentioned embodiment one.
[0134] Reference below Figure 7 , which shows a schematic diagram of the structure of an adversarial sample generation device suitable for implementing the embodiment of the present application. The adversarial sample generation device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 7 The adversarial sample generation device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0135] like Figure 7As shown, the adversarial sample generation device may include a processing device 1001 (such as a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the adversarial sample generation device are also stored. The processing device 1001, ROM1002 and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the adversarial sample generation device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows an adversarial sample generation device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or provided instead.
[0136] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0137] The adversarial sample generation device provided by the present application adopts the adversarial sample generation method in the above embodiment, which can solve the technical problem of adversarial sample generation. Compared with the prior art, the beneficial effects of the adversarial sample generation device provided by the present application are the same as the beneficial effects of the adversarial sample generation method provided by the above embodiment, and the other technical features in the adversarial sample generation device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0138] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0139] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0140] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the adversarial sample generation method in the above-mentioned embodiment.
[0141] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM: Random Access Memory), a read-only memory (ROM: Read Only Memory), an erasable programmable read-only memory (EPROM: Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency: Radio Frequency), etc., or any suitable combination of the above.
[0142] The above-mentioned computer-readable storage medium may be included in the adversarial sample generation device; or it may exist independently without being assembled into the adversarial sample generation device.
[0143] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by an adversarial sample generating device, the adversarial sample generating device: extracts features of the attacker image and the attacked image respectively through a preset face recognition model to determine a first face area image in the attacker image and a second face area image in the attacked image; scales the first face area image and the second face area image based on the input image size of a dual-branch discriminator adversarial generating network to obtain the scaled first face area image and the scaled second face area image, wherein the dual-branch discriminator adversarial generating network incorporates an edge detection branch and a noise perception branch; obtains a generated adversarial sample based on the scaled first face area image and the scaled second face area image through the dual-branch discriminator adversarial generating network; and generates a T-glasses adversarial sample based on the generated adversarial sample and the T-glasses adversarial sample mask.
[0144] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0145] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0146] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0147] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned adversarial sample generation method, and can solve the technical problem that the research on face recognition defense adversarial attacks in the prior art lacks large-scale adversarial samples for training and evaluation, resulting in low security and stability. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the adversarial sample generation method provided by the above-mentioned embodiment, and will not be repeated here.
[0148] The present application also provides a computer program product, including a computer program, which implements the steps of the adversarial sample generation method as described above when executed by a processor.
[0149] The computer program product provided by the present application can solve the technical problem that the existing technology lacks large-scale adversarial samples for training and evaluation in the research on face recognition defense against adversarial attacks, resulting in low security and stability. Compared with the existing technology, the beneficial effects of the computer program product provided by the present application are the same as the beneficial effects of the adversarial sample generation method provided by the above embodiment, which will not be repeated here.
[0150] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A method for generating adversarial samples, characterized in that: The method includes: Extract features of the attacker image and the attacked image respectively by using a preset face recognition model to determine a first face region image in the attacker image and a second face region image in the attacked image; Scaling the first face region image and the second face region image based on an input image size of a dual-branch discriminator adversarial generative network to obtain a scaled first face region image and a scaled second face region image, wherein the dual-branch discriminator adversarial generative network incorporates an edge detection branch and a noise perception branch; Obtaining a generative adversarial sample based on the scaled first face region image and the scaled second face region image through the dual-branch discriminator adversarial generative network; A T-glasses adversarial sample is generated based on the generated adversarial sample and the T-glasses adversarial sample mask.
2. The method according to claim 1, characterized in that Before the step of extracting features from the attacker image and the attacked image respectively by using a preset face recognition model to determine the first face region image in the attacker image and the second face region image in the attacked image, the method further includes: Obtain eye key point index and nose key point index according to the coordinates of several facial key points of a preset face recognition model; Determine the width of the T-type glasses, the width of the nose of the T-type glasses, and the inner frame width of the glasses frame of the T-type glasses based on the eye key point index; Determine the height of the T-glasses according to the width of the T-glasses; Determine the height of the nose of the T-type glasses according to the width of the nose of the T-type glasses; Determine the inner frame height of the glasses frame of the T-type glasses according to the height of the T-type glasses; A T-glasses adversarial sample mask is generated based on the T-glasses height, the T-glasses nose height and the glasses frame inner frame height.
3. The method according to claim 1, characterized in that The step of obtaining and generating adversarial samples based on the scaled first face area image and the scaled second face area image through the dual-branch discriminator adversarial generation network comprises: Inputting the scaled first face region image and the scaled second face region image into the dual-branch discriminator adversarial generation network to construct a discriminator network and a generator network; Generate adversarial attack perturbation vectors using random initialization; generating, by the generator network, an adversarial attack perturbation based on the adversarial attack perturbation vector; An adversarial sample is generated based on the adversarial attack disturbance and the scaled first face region image.
4. The method according to claim 3, characterized in that Before the step of generating a T-glasses adversarial sample based on the generated adversarial sample and the T-glasses adversarial sample mask, the method further includes: Inputting the attacker's real image and the attacked's real image into the discriminator network to determine the first discriminator loss according to the first discriminator output result and the real image label; Inputting the generated adversarial sample into the discriminator network to determine the second discriminator loss according to the second discriminator output result and the false image label; determining a total discriminator loss based on the first discriminator loss and the second discriminator loss; The discriminator parameters in the discriminator network are updated according to the discriminator total loss to obtain an updated discriminator network.
5. The method according to claim 4, characterized in that Before the step of generating a T-glasses adversarial sample based on the generated adversarial sample and the T-glasses adversarial sample mask, the method further includes: Inputting the generated adversarial sample into the updated discriminator network to determine a first generator loss based on the discriminator output result and the false image label; Extracting facial features of the attacker in the attacker image and facial features of the victim in the victim image respectively; Determine a second generator loss based on the attacker's facial features and the attacked's facial features; Determine the loss of the third generator based on the sample pixel points in the loss-generated adversarial sample; determining a total generator loss based on the first generator loss, the second generator loss, and the third generator loss; Updating generator parameters in the generator network according to the total generator loss; When the updating is completed, the step of generating a T-glasses adversarial sample based on the generated adversarial sample and the T-glasses adversarial sample mask is performed.
6. The method according to any one of claims 3 to 5, characterized in that The generator network is provided with several first transposed convolution modules and a single second transposed convolution module; wherein the first transposed convolution module is composed of a transposed convolution layer, a batch normalization processing layer and a ReLU activation function; and the second transposed convolution module is composed of a transposed convolution layer and a Tanh activation function.
7. The method according to any one of claims 3 to 5, characterized in that The discriminator network is provided with an edge detection branch and a noise extraction branch; wherein the edge detection branch and the noise extraction branch both use the mobilenetv2 network structure as a backbone network, and the mobilenetv2 network structure is composed of a stack of inverted residual blocks.
8. An adversarial sample generation device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the adversarial sample generation method according to any one of claims 1 to 7.
9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the adversarial sample generation method according to any one of claims 1 to 7 are implemented.
10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the adversarial sample generation method according to any one of claims 1 to 7 are implemented.
