A face recognition model attack defense method, device, equipment and storage medium
By determining and obstructing the perturbation sensitive area in the face recognition model, the model is trained to resist adversarial sample attacks, and the recognition error and security problems of the face recognition model under adversarial sample attacks are solved, achieving higher recognition accuracy and Security.
Patent Information
- Application Number
- CN202111445383.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-30
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2041-11-30
AI Technical Summary
Existing facial recognition models are easily misleading when facing adversarial sample attacks, resulting in abnormal recognition results and difficulty in effectively defending against digital attacks.
By obtaining the original and adversarial samples, the perturbation sensitive area is determined and occluded, the trained model is used for attack defense, and the model's robustness and recognition accuracy are enhanced.
Effectively reduce model identification errors, improve recognition accuracy, enhance model security, and defend against digital attacks.
Smart Images

Figure CN114332982B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a face recognition model attack defense method, device, equipment and storage medium. Background Art
[0002] The widespread application of machine learning makes the vulnerability of machine learning models increasingly important, especially face recognition systems that are widely used in surveillance, security, access control, financial verification, etc., whose security is easily threatened.
[0003] As one of the most important computer vision tasks, face recognition technology is based on deep neural networks (CNNs) to extract facial features. Although deep neural networks have a high accuracy rate in the field of image classification, they are very vulnerable to adversarial samples. For example, in escape identification, dangerous elements are mistakenly identified as any other face to bypass the security check of the face recognition system. Or a person is misjudged as another specific person so that the system can identify him as a specific authorized user and successfully authenticate the identity of the face recognition system. In addition, the same image perturbation can deceive many different network classifiers. This type of algorithm is called adversarial attack in the field of deep learning security. These adversarial samples have only very slight perturbations, and the pictures look almost indistinguishable to the naked eye, which can cause the neural network to completely change its classification of the picture, ultimately resulting in abnormal face recognition results.
[0004] Therefore, how to effectively improve the ability of face recognition models to defend against adversarial attacks is a technical problem that needs to be urgently solved by technical personnel in this field. Summary of the invention
[0005] In view of this, the purpose of the present invention is to provide a face recognition model attack defense method, device, equipment and storage medium, which can more effectively defend against digital attacks, reduce model recognition errors, improve model recognition accuracy and ensure recognition security. The specific scheme is as follows:
[0006] The first aspect of the present application provides a face recognition model attack defense method, comprising:
[0007] Acquire an original sample containing a human face and the adversarial sample corresponding to the original sample;
[0008] Determine the disturbance-sensitive area in the original sample, and perform occlusion processing on the disturbance-sensitive area of the original sample and the adversarial sample; wherein the disturbance-sensitive area is the area that has a greater impact on the recognition result after adding disturbance;
[0009] The original sample and the adversarial sample after occlusion processing are input into a face recognition model for model training, so as to use the trained face recognition model for attack defense.
[0010] Optionally, obtaining the original sample containing the face and the adversarial sample corresponding to the original sample includes:
[0011] The original sample containing the human face is obtained, and the adversarial sample corresponding to the original sample is generated by using a fast gradient signed attack algorithm.
[0012] Optionally, the generating the adversarial sample corresponding to the original sample by using a fast gradient signed attack algorithm includes:
[0013] The local face target in the original image is extracted, and interference noise is added to the extracted local face target using the fast gradient sign attack algorithm to generate the adversarial sample corresponding to the original sample.
[0014] Optionally, determining the disturbance-sensitive area in the original sample includes:
[0015] The original sample is processed using a convolutional neural network to obtain a heat map corresponding to the original sample, so as to determine the disturbance-sensitive area in the original sample based on the heat map.
[0016] Optionally, the using a convolutional neural network to process the original sample to obtain a heat map corresponding to the original sample includes:
[0017] Inputting the original sample into the convolutional neural network to obtain a corresponding feature map;
[0018] After upsampling the feature map, a dot product operation is performed with a matrix corresponding to the original image to obtain a first fractional response, and a response difference between the first fractional response and a second fractional response of the convolutional neural network to the original sample is determined as a classification weight of the feature map;
[0019] After multiplying the pixel points of the feature map by the corresponding classification weights, a weighted sum is calculated using a linear rectification function to obtain an original heat map;
[0020] The pixel size of the original heat map is adjusted to be consistent with the pixel size of the original sample to obtain the heat map corresponding to the original sample.
[0021] Optionally, determining the disturbance-sensitive area in the original sample based on the heat map includes:
[0022] The heat area in the heat map is divided according to the heat degree to obtain a preset number of area positions, and the area positions are determined as the disturbance sensitive areas.
[0023] Optionally, the performing occlusion processing on the disturbance-sensitive areas of the original sample and the adversarial sample includes:
[0024] The corresponding area position is randomly determined from the disturbance-sensitive area in a Gaussian random noise manner to perform occlusion processing, or the area positions in the disturbance-sensitive area are respectively subjected to occlusion processing in an accumulation manner.
[0025] A second aspect of the present application provides a face recognition model attack defense device, comprising:
[0026] A sample acquisition module, used to acquire an original sample containing a human face and the adversarial sample corresponding to the original sample;
[0027] An occlusion module, used to determine a disturbance-sensitive region in the original sample, and perform occlusion processing on the disturbance-sensitive region of the original sample and the adversarial sample; wherein the disturbance-sensitive region is a region that is more sensitive to added disturbance;
[0028] The defense module is used to input the original sample and the adversarial sample after occlusion processing into the face recognition model for model training, so as to use the trained face recognition model for attack defense.
[0029] The third aspect of the present application provides an electronic device, comprising a processor and a memory; wherein the memory is used to store a computer program, and the computer program is loaded and executed by the processor to implement the aforementioned face recognition model attack defense method.
[0030] The fourth aspect of the present application provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are loaded and executed by a processor, the aforementioned face recognition model attack defense method is implemented.
[0031] In the present application, the original sample containing the face and the adversarial sample corresponding to the original sample are first obtained; then the disturbance-sensitive area in the original sample is determined, and the disturbance-sensitive area of the original sample and the adversarial sample is occluded; wherein the disturbance-sensitive area is the area that has a greater impact on the recognition result after the disturbance is added; finally, the original sample and the adversarial sample after the occlusion process are input into the face recognition model for model training, so as to use the trained face recognition model for attack defense. It can be seen that the present application trains the face recognition model by using true and false training samples after occluding the disturbance-sensitive area, so that the trained face recognition model is more robust, the network architecture is more robust, and it can more effectively defend against digital attacks. At the same time, the trained model avoids the most obvious facial features to the greatest extent during the recognition process to pay more attention to the features of other areas, so as to reduce the model recognition error, improve the model recognition accuracy and ensure the recognition security. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the embodiments of the present invention 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, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0033] Figure 1 A flow chart of a face recognition model attack defense method provided in this application;
[0034] Figure 2 A schematic diagram of the structure of a face recognition model attack defense device provided in this application;
[0035] Figure 3 A structural diagram of an electronic device for defending against face recognition model attacks provided in this application. DETAILED DESCRIPTION
[0036] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0037] There are many methods for counterattacks against face recognition systems, which can be mainly divided into physical attacks and digital attacks. The attack characteristics of physical space are to directly add disturbances such as eyeglass frames, masks, stickers, etc. to the face image and modify the physical appearance of the face before the image is captured. Digital attacks are to modify the captured facial image by adding imperceptible disturbances to mislead the face recognition results, so that the model makes misclassification. The face recognition model in the prior art cannot effectively resist digital attacks. In response to the above technical defects, the present application provides a face recognition model attack defense solution, which trains the face recognition model by using true and false training samples after occluding the disturbance sensitive area, so that the trained face recognition model is more robust, the network architecture is more robust, and it can more effectively defend against digital attacks. At the same time, the trained model avoids the most obvious facial features to the greatest extent during the recognition process to pay more attention to the features of other areas, so as to reduce the model recognition error, improve the model recognition accuracy and ensure the recognition security.
[0038] Figure 1 A flow chart of a face recognition model attack defense method provided in an embodiment of the present application. Figure 1 As shown, the face recognition model attack defense method includes:
[0039] S11: Obtain an original sample containing a human face and the adversarial sample corresponding to the original sample.
[0040] In this embodiment, an original sample containing a face and the adversarial sample corresponding to the original sample are obtained. First, the original sample containing a face is obtained, and then a new attack sample is generated using the network. Specifically, the existing CNN neural network model is used, and the input of the first layer is directly obtained from the model as the input layer, and the output of the last layer is used as the output layer. The face recognition system is called M. In one embodiment, given the original image and restrictions, a clean and correct original sample image X is input to generate an adversarial sample Y. Assuming that it is a correct original face image X, the face recognition system can correctly classify it, and the corresponding true identity is M(X)=x. Among them, the sample image can be represented as a 3D matrix, including width x height x depth, the matrix elements are [0, 255] pixels, and x is the correct identity classification information. In another embodiment, given the original image and restrictions, a more strategic local adversarial sample Y is generated. The sample cannot be clearly distinguished from X in naked eye perception, but it is incorrectly classified in the system, that is, M(Y)≠M(X). This embodiment does not limit the specific identity to which M(Y) will be classified, that is, it is only necessary to change the output adversarial sample Y to any classification different from the original X.
[0041] This embodiment is applicable to the model defense of digital attacks in deep learning face recognition systems, mainly for attacks that only change the local facial features using the FGSM fast gradient sign attack method. Therefore, the adversarial sample corresponding to the original sample can be generated using the fast gradient sign attack algorithm (FGSM). In a white box environment, by finding the derivative of the model with respect to the input X, and then using the sign function to obtain the specific gradient direction of X, multiplying it by a step size, and by increasing the loss increment in the gradient direction, the model is misclassified to obtain the corresponding interference sample Y. In order to make the neural network target increase the loss of the model, so that M(Y) makes a wrong classification.
[0042] Furthermore, this embodiment can extract the local target of the face in the original image, and use the fast gradient sign attack algorithm to add interference noise to the extracted local target of the face to generate the adversarial sample corresponding to the original sample. Under the premise of ensuring that the perturbation is successful and the model classification is wrong, the perturbation range and perturbation object are delineated in different ways. Including perturbing the input layer (limiting only the local range of the input layer) and perturbing a certain feature of the hidden layer. For example, the interference sample Y is divided according to the facial features area, and a small local range is generated with the landmark as the center for delineation, including but not limited to eyebrows, eyes, nose, and mouth. The whole input layer of X is perturbed, but only the pixel variable of the delineated local area is retained, and the other areas are restored to the original image. Or the hidden layer is perturbed to take a certain important feature of X extracted by the hidden layer of the network as input, and the perturbation of the gradient direction corresponding to the feature is obtained, and the perturbation noise is added to the entire face area. The above steps extract the feature layer and local facial features of the input face image, attack the local information respectively, and generate attack samples corresponding to each local information. Local attack replaces the method of generating attack samples from the original whole image, selects more effective attacks, and at the same time reduces the amount of pixel interference in the whole image brought by the attack samples.
[0043] S12: Determine a disturbance-sensitive region in the original sample, and perform occlusion processing on the disturbance-sensitive region of the original sample and the adversarial sample; wherein the disturbance-sensitive region is a region that has a greater impact on the recognition result after adding disturbance.
[0044] In this embodiment, the perturbation-sensitive area in the original sample is determined, and the perturbation-sensitive area of the original sample and the adversarial sample is masked. The perturbation-sensitive area is the area that has a greater impact on the recognition result after the perturbation is added, that is, the quantified perturbation has the greatest perturbation effect on which specific pixels of the original image, and such perturbation-sensitive areas in the original image and the adversarial sample are partially masked according to a certain strategy. This implementation combines heat maps with model defense. First, the original sample is processed using a convolutional neural network to obtain a heat map corresponding to the original sample, and then the perturbation-sensitive area in the original sample is determined based on the heat map. A heat map is generated based on the last convolutional layer, and the heat map is used to characterize the sensitivity of the original image to the adversarial attack perturbation. The heat map is used to quantify the sensitivity of the model to the perturbation. At the same time, some sensitive areas of the original image and the adversarial sample image are masked according to a certain strategy to enhance the data.
[0045] Regarding the generation process of the heat map, the original sample is first input into the convolutional neural network to obtain the corresponding feature map. The original image X is input into the CNN network, and the K-layer feature map is output in the last convolutional layer. Then the feature map is upsampled and the dot product operation is performed with the matrix corresponding to the original image to obtain a first fractional response, and the response difference between the first fractional response and the second fractional response of the convolutional neural network to the original sample is determined as the classification weight of the feature map. After upsampling the K-layer feature layers respectively, dot multiplication is performed with the original image, and the response difference between the model to the dot multiplication result image of the feature layer and the original image and the model to the baseline is used as the weight of each feature layer for the classification result. Then, the pixel points of the feature map are multiplied with the corresponding classification weights and the weighted sum is calculated using the linear rectifier function (Relu) to obtain the original heat map. After the weights of all feature maps are obtained, the pixel points of the K-layer feature map are multiplied with their own weights respectively, and the weighted sum is obtained using Relu to screen out those pixels and corresponding positions that have a positive influence on the correct classification. Finally, the generated mapping image is resized to the size of the original image X, that is, the pixel size of the original heat map is adjusted to be consistent with the pixel size of the original sample, so as to obtain the heat map corresponding to the original sample.
[0046] It can be seen that the calculation of the weight of each feature layer in the process of generating a heat map according to the feature layer in this embodiment is an optimization of the existing CAM algorithm. The traditional CAM (Class Activation Mapping) algorithm for generating a heat map is to obtain the corresponding weight of each feature map by global average pooling of each layer of feature maps. This embodiment combines the upsampling of each feature layer, multiplies it with the original image, and uses the difference between the model's response to it and the model's response to the baseline as the weight of each feature layer for the classification result. After calculating the weights of all feature maps, the pixels of the K-layer feature map are multiplied by their own weights, and the weighted sum is obtained using Relu.
[0047] The heat map can be used as a distribution map of the face that is easy to decide on classification and recognition, indicating the sensitivity to disturbance and the area where the disturbance has the greatest impact on the classification detection result. Regarding the determination process of the disturbance-sensitive area, the heat area in the heat map is first divided according to the heat level to obtain a preset number of area positions (areas in the first few places of the heat map), and the area positions are determined as the disturbance-sensitive area. On the one hand, the corresponding area positions are randomly determined from the disturbance-sensitive area in the manner of Gaussian random noise for occlusion processing. According to the distribution of the heat map, a mask of Gaussian random noise distribution is generated according to a certain strategy, that is, for each original image and adversarial sample image, 1 to N area positions are randomly erased, and the original image and the attack sample are shielded from the areas that are more sensitive to interference, and data enhancement is completed. On the other hand, the area positions in the disturbance-sensitive area are respectively occluded in an accumulated manner. For each original image and adversarial sample image, the heat of the facial features is gradually accumulated from 1 to N areas for erasure, where N≤M.
[0048] S13: Inputting the original sample after occlusion processing and the adversarial sample into a face recognition model for model training, so as to use the trained face recognition model for attack defense.
[0049] In this embodiment, after the disturbance-sensitive area is masked, the mask-shielded original face image and the mask-shielded adversarial sample image are simultaneously sent to the CNN network for training, so that the CNN network can dig out the influence of other secondary areas on classification under attack, except for the most sensitive and representative areas of disturbance, thereby improving the robustness of the model to this type of samples. That is, the original sample and the adversarial sample after the masking process are input into the face recognition model for model training, so as to use the trained face recognition model for attack defense. It can be understood that the mixed input of the mask-shielded original image and the mask-shielded adversarial sample into the model allows the model to not only focus on the limited key representative area of the face to check whether it is forged during the training process, but also allow the model to detect other facial areas that have been neglected before, that is, the area that is sensitive to the disturbance to resist adversarial disturbance. This embodiment is applicable to various mainstream face recognition model structures.
[0050] In summary, adversarial samples pose a potential security threat to actual machine learning, especially digital attacks on face recognition systems with deep neural networks, which directly affect the classification results of the model. This embodiment is mainly a model defense strategy for digital attack methods. First, adversarial samples are generated according to the FGSM algorithm, but only certain local key facial features are retained. The model defense method for this type of adversarial attack is mainly divided into three stages. The first stage: In the threat model of white-box attack, the wrong face generated by the FGSM algorithm can only replace the corresponding local facial features of the original face image with the important facial features of the adversarial sample, and ensure that the other multiple attributes of the original face remain unchanged, including other facial features, postures, light shadows, and background lights. On the other hand, the features extracted from the hidden layer can be used to replace the original input layer as the input of FGSM, and its gradient direction is disturbed. The second stage: The original clean image is input into the CNN network, and the heat map corresponding to the image is calculated, which is also a map of the sensitivity to disturbance. The third stage: Select the local important area of the heat map, generate random Gaussian noise as a mask, and cover it on the original image and the adversarial sample image. By adding a mixed training network of masked adversarial samples and clean samples, data enhancement can be performed to regularize the neural network to a certain extent, thereby improving the robustness of the network. Specifically, the training method to improve the robustness of the network is to avoid and block the most sensitive facial feature areas that are most likely to affect the classification results, so that the model focuses on mining the previously ignored areas, thereby training to be able to identify fake faces generated by this type of attack method.
[0051] It can be seen that the embodiment of the present application first obtains the original sample containing the face and the adversarial sample corresponding to the original sample; then determines the perturbation-sensitive area in the original sample, and performs occlusion processing on the perturbation-sensitive area of the original sample and the adversarial sample; wherein the perturbation-sensitive area is the area that has a greater impact on the recognition result after adding the perturbation; finally, the original sample and the adversarial sample after the occlusion processing are input into the face recognition model for model training, so as to use the trained face recognition model for attack defense. The embodiment of the present application trains the face recognition model by using true and false training samples after occluding the perturbation-sensitive area, so that the trained face recognition model is more robust, the network architecture is more robust, and it can more effectively defend against digital attacks. At the same time, the trained model avoids the most obvious facial features to the greatest extent during the recognition process to pay more attention to the features of other areas, thereby reducing the model recognition error, improving the model recognition accuracy and ensuring the recognition security.
[0052] See also Figure 2 As shown, the embodiment of the present application also discloses a face recognition model attack defense device, including:
[0053] A sample acquisition module 11, used to acquire an original sample containing a human face and the adversarial sample corresponding to the original sample;
[0054] The occlusion module 12 is used to determine the disturbance-sensitive area in the original sample and perform occlusion processing on the disturbance-sensitive area of the original sample and the adversarial sample; wherein the disturbance-sensitive area is an area that is more sensitive to the added disturbance;
[0055] The defense module 13 is used to input the original sample and the adversarial sample after occlusion processing into the face recognition model for model training, so as to use the trained face recognition model for attack defense.
[0056] It can be seen that the embodiment of the present application first obtains the original sample containing the face and the adversarial sample corresponding to the original sample; then determines the perturbation-sensitive area in the original sample, and performs occlusion processing on the perturbation-sensitive area of the original sample and the adversarial sample; wherein the perturbation-sensitive area is the area that has a greater impact on the recognition result after adding the perturbation; finally, the original sample and the adversarial sample after the occlusion processing are input into the face recognition model for model training, so as to use the trained face recognition model for attack defense. The embodiment of the present application trains the face recognition model by using true and false training samples after occluding the perturbation-sensitive area, so that the trained face recognition model is more robust, the network architecture is more robust, and it can more effectively defend against digital attacks. At the same time, the trained model avoids the most obvious facial features to the greatest extent during the recognition process to pay more attention to the features of other areas, thereby reducing the model recognition error, improving the model recognition accuracy and ensuring the recognition security.
[0057] In some specific embodiments, the sample acquisition 11 specifically includes:
[0058] A feature extraction unit, used to obtain the original sample containing the human face, and extract the local target of the human face in the original image;
[0059] The sample generating unit is used to add interference noise to the extracted local face target by using the fast gradient sign attack algorithm to generate the adversarial sample corresponding to the original sample.
[0060] In some specific embodiments, the shielding module 12 specifically includes:
[0061] A heat map generation submodule, used to process the original sample using a convolutional neural network to obtain a heat map corresponding to the original sample;
[0062] A region determination submodule, configured to determine the disturbance-sensitive region in the original sample based on the heat map;
[0063] The occlusion submodule is used to perform occlusion processing on the disturbance-sensitive areas of the original sample and the adversarial sample.
[0064] In some specific embodiments, the heat map generation submodule specifically includes:
[0065] An input unit, used to input the original sample into the convolutional neural network to obtain a corresponding feature map;
[0066] a weight determination unit, configured to perform a dot product operation on the feature map after upsampling the feature map and the matrix corresponding to the original image to obtain a first fractional response, and determine a response difference between the first fractional response and a second fractional response of the convolutional neural network to the original sample as a classification weight of the feature map;
[0067] The weighted calculation unit is used to calculate the weighted sum of the pixels of the feature map and the corresponding classification weights using a linear rectification function to obtain an original heat map.
[0068] In some specific embodiments, the region determination submodule is specifically used to adjust the pixel size of the original heat map to be consistent with the pixel size of the original sample to obtain the heat map corresponding to the original sample.
[0069] In some specific embodiments, the shielding submodule specifically includes:
[0070] A random occlusion unit, used for randomly determining the corresponding area position from the disturbance sensitive area in a Gaussian random noise manner to perform occlusion processing;
[0071] The cumulative shielding unit is used to perform shielding processing on the area positions in the disturbance sensitive area in a cumulative manner.
[0072] Furthermore, an embodiment of the present application also provides an electronic device. Figure 3 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content in the diagram cannot be regarded as any limitation on the scope of use of the present application.
[0073] Figure 3 A schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the face recognition model attack defense method disclosed in any of the aforementioned embodiments. In addition, the electronic device 20 in this embodiment may specifically be a computer.
[0074] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.
[0075] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon may include an operating system 221, a computer program 222 and data 223, etc. The storage method can be temporary storage or permanent storage.
[0076] Among them, the operating system 221 is used to manage and control the hardware devices and computer programs 222 on the electronic device 20 to realize the operation and processing of the massive data 223 in the memory 22 by the processor 21, which can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program that can be used to complete the face recognition model attack defense method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks. The data 223 can include sample data collected by the electronic device 20.
[0077] Furthermore, an embodiment of the present application also discloses a storage medium, in which a computer program is stored. When the computer program is loaded and executed by a processor, the steps of the face recognition model attack defense method disclosed in any of the aforementioned embodiments are implemented.
[0078] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0079] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0080] The above is a detailed introduction to the face recognition model attack defense method, device, equipment and storage medium provided by the present invention. Specific examples are used in this article 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 general technical personnel in this field, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A method for defending against attacks on a face recognition model, characterized in that: include: Obtaining an original sample containing a human face and an adversarial sample corresponding to the original sample; The original sample is processed by using a convolutional neural network to obtain a heat map corresponding to the original sample, the heat area in the heat map is divided according to the heat degree to obtain a preset number of area positions ranked top in the heat map, the area positions are determined as disturbance-sensitive areas, and the disturbance-sensitive areas of the original sample and the adversarial sample are blocked; wherein the disturbance-sensitive area is an area that has a greater impact on the recognition result after adding disturbance; Inputting the original sample and the adversarial sample after occlusion processing into a face recognition model for model training, so as to use the trained face recognition model for attack defense; The process of processing the original sample by using a convolutional neural network to obtain a heat map corresponding to the original sample includes: Inputting the original sample into the convolutional neural network to obtain a corresponding feature map; After upsampling the feature map, a dot product operation is performed with a matrix corresponding to the original sample to obtain a first fractional response, and a response difference between the first fractional response and a second fractional response of the convolutional neural network to the original sample is determined as a classification weight of the feature map; After multiplying the pixel points of the feature map by the corresponding classification weights, a weighted sum is calculated using a linear rectification function to obtain an original heat map; The pixel size of the original heat map is adjusted to be consistent with the pixel size of the original sample to obtain the heat map corresponding to the original sample.
2. The face recognition model attack defense method according to claim 1, characterized in that: The obtaining of the original sample containing the human face and the adversarial sample corresponding to the original sample comprises: The original sample containing the human face is obtained, and the adversarial sample corresponding to the original sample is generated by using a fast gradient signed attack algorithm.
3. The face recognition model attack defense method according to claim 2, characterized in that: The generating the adversarial sample corresponding to the original sample by using the fast gradient sign attack algorithm includes: The local face target in the original sample is extracted, and interference noise is added to the extracted local face target using the fast gradient sign attack algorithm to generate the adversarial sample corresponding to the original sample.
4. The face recognition model attack defense method according to claim 1, characterized in that: The performing occlusion processing on the disturbance sensitive areas of the original sample and the adversarial sample includes: The corresponding area position is randomly determined from the disturbance-sensitive area in a Gaussian random noise manner to perform occlusion processing, or the area positions in the disturbance-sensitive area are respectively subjected to occlusion processing in an accumulation manner.
5. A face recognition model attack defense device, characterized in that: include: A sample acquisition module, used to acquire an original sample containing a human face and an adversarial sample corresponding to the original sample; An occlusion module, used to determine a disturbance-sensitive region in the original sample, and perform occlusion processing on the disturbance-sensitive region of the original sample and the adversarial sample; wherein the disturbance-sensitive region is a region that is more sensitive to added disturbance; A defense module, used for inputting the original sample after occlusion processing and the adversarial sample into a face recognition model for model training, so as to use the trained face recognition model for attack defense; The shielding module comprises: A heat map generation submodule, used to process the original sample using a convolutional neural network to obtain a heat map corresponding to the original sample; A region determination submodule, for dividing the heat regions in the heat map according to the heat levels to obtain a preset number of region positions that rank high in the heat map, and determining the region positions as disturbance sensitive regions; The heat map generation submodule includes: An input unit, used to input the original sample into the convolutional neural network to obtain a corresponding feature map; a weight determination unit, configured to perform a dot product operation on the feature map after upsampling the feature map and the matrix corresponding to the original sample to obtain a first fractional response, and determine a response difference between the first fractional response and a second fractional response of the convolutional neural network to the original sample as a classification weight of the feature map; A weighted calculation unit, configured to calculate a weighted sum of the pixels of the feature map and the corresponding classification weights using a linear rectification function to obtain an original heat map; The region determination submodule is further used to adjust the pixel size of the original heat map to be consistent with the pixel size of the original sample, so as to obtain the heat map corresponding to the original sample.
6. An electronic device, characterized in that: The electronic device includes a processor and a memory; wherein the memory is used to store a computer program, and the computer program is loaded and executed by the processor to implement the face recognition model attack defense method as described in any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that: Used to store computer executable instructions, which, when loaded and executed by a processor, implement the face recognition model attack defense method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Face recognition attack defense method based on Rosenbrock-PSO
CN109858368A
Attention-attack face recognition attack algorithm, in particular to attention-attack face recognition attack algorithm
CN110633655A
Detection and defense method based on FGSM anti-attack algorithm
CN111600835A
Method and device for evaluating face recognition model and method and device for image classification model
CN112215201A
Adversarial sample detection method and universal adversarial attack defense system
CN112396129A
