Method and device for generating anti-attack sample of face detection model
By building three-dimensional models and optimizing helmet texture maps, a robust adversarial attack sample was generated, which solved the problem of face detection models decreasing aggression and insufficient generalization capabilities in the physical world in the existing technology, and achieved the effectiveness of adversarial attacks and stability.
Patent Information
- Application Number
- CN202410773340.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-14
- Publication Date
- 2024-11-12
AI Technical Summary
The prior art is difficult to generate robust adversarial samples, making face detection models less aggressive in the physical world and difficult to generalize in complex environments and irrelevant identities.
By building three-dimensional models, including helmet and face models, random combination and rendering, the gradient descent algorithm is used to optimize the helmet texture map, generate adversarial attack samples, and achieve robustness and generalization capabilities of adversarial attack samples.
The generated adversarial attack samples have a higher attack success rate in complex environments and irrelevant identities, which can effectively reduce the probability of the face detection model identifying face areas and achieve robustness and generalization ability of adversarial attacks.
Smart Images

Figure CN118941885A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of face detection model adversarial attack, and more specifically, to a method and device for generating adversarial attack samples of a face detection model, an electronic device, and a computer-readable storage medium. Background Art
[0002] Facial image analysis algorithms based on deep learning technology, such as face detection, face identity recognition, and face attribute analysis (expression and age, etc.), have achieved rapid development and are widely used in security-sensitive fields such as security. Among them, face detection algorithms can locate the position of faces from natural scene images and are a prerequisite for other face image analysis tasks. However, face detection algorithms based on deep learning can be easily misled by maliciously designed adversarial samples and make wrong judgments, which brings security risks to related applications. For example, criminals may use adversarial samples to circumvent detection systems based on facial features.
[0003] In order to deal with potential security risks, existing face adversarial attack techniques study how to generate effective adversarial samples to help evaluate and improve the security of face image analysis algorithms.
[0004] Adversarial attacks on face analysis systems can be divided into two categories: attacks in the digital world and attacks in the physical world, based on the way the attacks are generated and implemented. Among them, attacks in the digital world add adversarial perturbations to the global area of the image to deceive the face image analysis model. However, this global attack adds noise to both the face and the background (such as the sky) in the image. Unless the digital image of the adversary system can be directly modified, it is often difficult to migrate to the physical world. Existing attacks on the physical world use patches or textures to add restricted perturbation areas to the surface of specific objects, thereby obtaining adversarial samples that can be migrated from the digital world to the physical world (for example, through printing or light projection). However, in the process of migrating adversarial samples from the digital world to the physical world, adversarial samples often produce distortions in shape and color due to three-dimensional space transformations, lighting transformations, and material characteristics, resulting in a decrease in aggressiveness; the characteristics of the target object will also affect the feasibility of the layout method (for example, the wearing scheme applied to the face that blocks sensitive areas).
[0005] Therefore, how to generate more robust adversarial samples is a problem that must be solved to realize physical world attacks. Summary of the invention
[0006] The present application proposes a method and device for generating adversarial attack samples of a face detection model, an electronic device and a computer-readable storage medium to solve the problem of how to generate adversarial samples of a face detection model with good robust performance.
[0007] According to one aspect of the present application, a method for generating an adversarial attack sample of a face detection model is proposed, comprising: constructing a three-dimensional model in response to an adversarial attack instruction for face detection, wherein the three-dimensional model comprises at least one three-dimensional helmet model, multiple three-dimensional face models, and multiple two-dimensional background images; randomly combining the three-dimensional models to obtain face-helmet combination images under different environments; using the face-helmet combination image to test a preset face detection model to obtain a face detection score for the face detection model; and using the face detection score and a preset loss function to optimize the helmet texture map through a gradient descent algorithm to obtain the adversarial attack sample.
[0008] According to some embodiments, the three-dimensional models are randomly combined to obtain combined images of faces and helmets in different environments, including randomly combining the three-dimensional models to generate combined three-dimensional models of different faces wearing the same helmet; sampling the combined three-dimensional models of different faces wearing the same helmet under random viewing angles and lighting conditions and performing three-dimensional model spatial transformation, rendering the combined three-dimensional models of different faces wearing the same helmet into two-dimensional images, and obtaining the combined images of faces and helmets in different environments.
[0009] According to some embodiments, the helmet texture map is optimized using the face detection score and a preset loss function through a gradient descent algorithm to obtain the adversarial attack sample, including using the face detection score to calculate a loss value of a preset loss function; calculating a derivative of the loss function with respect to the helmet texture map based on the loss value; and minimizing the loss function through a gradient descent algorithm to optimize the helmet texture map to obtain the adversarial attack sample.
[0010] According to some embodiments, the loss function is shown as follows:
[0011]
[0012] in, is the score for faces, is the score without face, and batchsize is the number of samples of the face-helmet combination model for testing.
[0013] According to some embodiments, the generation method also includes counting the face detection accuracy of the face detection model under multiple rendering imaging angles; using the face detection accuracy, performing importance sampling on random perspectives to determine random perspective samples that optimize the adversarial attack samples.
[0014] According to some embodiments, before randomly combining the three-dimensional models to obtain combined images of human faces and helmets in different environments, the generation method further includes performing base color clustering on the helmet three-dimensional models to generate a camouflage helmet three-dimensional model.
[0015] According to some embodiments, base color clustering is performed on the adversarial attack samples to generate a camouflage helmet three-dimensional model, including generating the base color of the camouflage adversarial attack samples by base color clustering; generating the camouflage helmet texture map by using the generated base color, preset color distribution control points and preset probability distribution seeds through the Gumbel-normalized exponential function and distance weighting; and generating the camouflage helmet three-dimensional model by using the camouflage helmet texture map.
[0016] According to some embodiments, the three-dimensional models are randomly combined to obtain combined images of faces and helmets in different environments, including using the camouflage helmet texture map to generate a three-dimensional model of a camouflage helmet; using the generated three-dimensional model of the camouflage helmet to randomly combine the multiple three-dimensional face models and multiple two-dimensional background images to generate combined three-dimensional model samples of different faces wearing the same camouflage helmet; using the combined model samples to sample the combined three-dimensional model samples of different faces wearing the same camouflage helmet under random viewing angles and lighting conditions and perform three-dimensional space conversion to obtain combined images of faces and helmets of different faces wearing the same camouflage helmets in different environments.
[0017] According to some embodiments, the helmet texture map is optimized using a gradient descent algorithm using the face detection score and a preset loss function to obtain the adversarial attack sample, including using the face detection score to calculate a loss value of a preset loss function; based on the loss value, calculating a derivative of the loss function with respect to a preset control point and the probability distribution seed; and minimizing the loss function using a gradient descent algorithm to optimize the control point and the probability distribution seed to generate a camouflage adversarial attack sample for the face detection model.
[0018] According to one aspect of the present application, a device for generating adversarial attack samples of a face detection model is proposed, comprising a three-dimensional model construction unit, for constructing a three-dimensional model in response to an adversarial attack instruction for face detection, wherein the three-dimensional model comprises at least one three-dimensional helmet model, multiple three-dimensional face models and multiple two-dimensional background images; a face-helmet combination image generation unit, for randomly combining the three-dimensional models to obtain face-helmet combination images under different environments; and a face detection model detection unit, for testing a preset face detection model using the face-helmet combination image to obtain a face detection score for the face detection model; and an adversarial attack sample generation unit, for optimizing a helmet texture map by a gradient descent algorithm using the face detection score and a preset loss function to obtain the adversarial attack sample.
[0019] According to one aspect of the present application, an electronic device is proposed, comprising: a processor; and a memory storing a computer program, wherein when the computer program is executed by the processor, the processor executes the editing method as described in any of the previous embodiments.
[0020] According to one aspect of the present application, a non-transitory computer-readable storage medium is provided, on which computer-readable instructions are stored. When the instructions are executed by a processor, the processor executes the editing method as described in any of the previous embodiments.
[0021] According to some embodiments of the present application, by generating human face helmet models in different environmental backgrounds, the generalization ability of adversarial attack samples for complex environments and irrelevant identities is achieved. By continuously reducing the probability that the face detection model thinks the face area is most likely to exist, thereby generating the probability that the face detection model thinks the face area is most likely not to exist, the generation of adversarial attack samples for the face detection model is achieved.
[0022] It should be understood that the foregoing general description and the following detailed description are exemplary only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for describing the embodiments. By describing the exemplary embodiments in detail with reference to the drawings, the above and other objectives, features and advantages of the present application will become more apparent.
[0024] Figure 1 A flow chart of a method for generating adversarial attack samples of a face detection model according to an exemplary embodiment of the present application is shown.
[0025] Figure 2 A flow chart of a method for generating adversarial attack samples of another face detection model according to an exemplary embodiment of the present application is shown.
[0026] Figure 3 A schematic diagram of a process of constructing a three-dimensional model according to an exemplary embodiment of the present application is shown.
[0027] Figure 4 A schematic diagram of a process for generating adversarial attack samples according to an exemplary embodiment of the present application is shown.
[0028] Figure 5 A schematic diagram showing the color types and distribution generated using traditional Thiessen polygon technology.
[0029] Figure 6 A schematic diagram of a camouflage texture map generated according to an exemplary embodiment of the present application is shown.
[0030] Figure 7 A schematic diagram of a differentiable rendering process according to an exemplary embodiment of the present application is shown.
[0031] Figure 8 A schematic diagram of a 3D printing process of a head mounted device according to an embodiment of the present application is shown.
[0032] Fig. 9 A block diagram of a device for generating face detection adversarial attack samples according to an exemplary embodiment of the present application is shown.
[0033] Fig.10 An electronic device according to an exemplary embodiment of the present application is shown. DETAILED DESCRIPTION
[0034] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that this application will be comprehensive and complete and will fully convey the concepts of the example embodiments to those skilled in the art. The same reference numerals in the figures represent the same or similar parts, and thus their repeated description will be omitted.
[0035] The described features, structures or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced without one or more of these specific details, or other modes, components, materials, devices or operations may be adopted. In these cases, known structures, methods, devices, implementations, materials or operations will not be shown or described in detail.
[0036] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0037] The terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.
[0038] Adversarial attacks on face systems can be divided into two categories, namely, disappearance attacks and identity attacks, according to the results and stages of the attacks. Disappearance attacks prevent the system from detecting faces in the early face detection stage, thereby misleading the system into thinking that there are no faces in the captured images, and thus not performing subsequent face image analysis tasks, such as face recognition. Identity attacks prevent the system from correctly identifying the identity of faces in the later face recognition stage, thereby misleading the system into identifying the identities of random or specific other people.
[0039] According to the embodiments of the present application, attacks on face detection in the early stages of face analysis tasks are more suitable for completing escape tasks (for example, indiscriminate attacks from unmanned armed systems) than other algorithms that mislead identity recognition. In addition, since the embodiments of the present application do not directly modify facial features, but modify the features of head-mounted devices, they can be used in conjunction with other methods of modifying facial features to mislead identity recognition or enhance countermeasures against face detection. Compared with attack schemes for glasses, masks, facial stickers, etc., the attack scheme for head-mounted devices can cover a larger angle and will not block the facial features and cause inconvenience in movement.
[0040] In other embodiments, real 3D face data is used as training data, rendered using a 3D differentiable renderer, and UV textures that are mapped from 2D to 3D are attacked, and importance sampling is performed according to the angle attack success rate graph during training. These processes explicitly simulate the continuous 3D spatial transformation of the real physical world, and enhance the angles that are difficult to optimize, significantly improving the robustness of the adversarial attack under multiple angles. At the same time, because it is a texture attack on a 3D model, it can be well migrated from the digital world to the physical world and prepared in reality.
[0041] According to other embodiments, by combining the clustering-based base color extraction and the camouflage adversarial texture generation algorithm training restart method, a head-mounted device with controllable color and texture can be produced under the condition of reducing the loss of attack performance. In terms of appearance, it has the advantages of not attracting attention and being able to blend with the background color of the environment.
[0042] The specific embodiments of the present application are described in detail below in conjunction with the accompanying drawings.
[0043] Figure 1 A flow chart of a method for generating adversarial attack samples of a face detection model according to an exemplary embodiment of the present application is shown, Figure 1 The generation method shown includes steps S101, S103, S105 and S107. Figure 1 Taking as an example, a method for generating adversarial attack samples of a face detection model according to an exemplary embodiment of the present application is described in detail.
[0044] like Figure 1 As shown, in step S101, in response to the adversarial attack instruction of face detection, a three-dimensional model is constructed, wherein the three-dimensional model includes at least one helmet three-dimensional model, multiple face three-dimensional models and multiple background two-dimensional images.
[0045] According to an embodiment of the present application, when constructing a helmet three-dimensional model, the existing helmet is first three-dimensionally modeled to obtain the helmet three-dimensional model mesh data; then, the helmet three-dimensional model is UV unfolded using the helmet three-dimensional model mesh data to establish a mapping relationship between the vertex coordinates in the helmet three-dimensional model mesh data and the UV coordinates of the UV texture map.
[0046] According to some embodiments, when constructing a three-dimensional face model, a 3D scanning tool is used to scan the face to generate mesh data and UV mapping data of the face.
[0047] According to other embodiments, when constructing a background two-dimensional image, a camera is used to capture natural images of various scenes without human faces for enhancing training data, thereby preventing the generated adversarial attack samples from overfitting to a specific background and improving their robustness.
[0048] In step S103, the three-dimensional models are randomly combined to obtain combined images of human faces and helmets in different environments.
[0049] According to an embodiment of the present application, in step S103, first, the three-dimensional models are randomly combined to generate a combined three-dimensional model of different faces wearing the same helmet; then, the combined three-dimensional model of different faces wearing the same helmet is sampled and the three-dimensional model is spatially transformed under random viewing angles and lighting conditions, and the combined three-dimensional model of different faces wearing the same helmet is rendered into a two-dimensional image to obtain the combined image of the face and helmet in different environments.
[0050] In a specific embodiment, in step S103, differentiable rendering technology is used to randomly combine the helmet three-dimensional model, the face three-dimensional model and the background two-dimensional image according to a random strategy using different backgrounds, lighting and three-dimensional space transformations, and the three-dimensional model is rendered as a picture to simulate the camera acquisition image at any angle that may appear in the real physical world, thereby realizing the generalization ability of adversarial attack samples to complex environments and irrelevant identities.
[0051] The method of combining a face and a head-mounted device in three-dimensional space is simpler and more effective than the method of locating the face on a two-dimensional image and then adding a head-mounted device map. The entire process does not require additional annotation data and avoids the pose distortion caused by inaccurate annotation. Therefore, the face-helmet combination model sample obtained according to the embodiment of the present application has better robustness than other methods that directly perform rough approximation on a 2D face image with limited available angles.
[0052] In some embodiments, in step S103, important sampling parameters are also obtained according to the adversarial attack samples generated in step S105. In a specific embodiment, first, the face detection accuracy of the face detection model under multiple rendering imaging angles is counted; then, importance sampling is performed using the face detection accuracy to determine the sampling angle to determine the random viewing angle sample that optimizes the adversarial attack sample; finally, the face-helmet combination model is optimized according to the determined optimization direction, so that the face-helmet combination model is continuously updated in the direction of the gradient of the loss function. After multiple iterative trainings, the final adversarial attack sample is determined.
[0053] For example, firstly, the attack effect of generating adversarial attack samples is evaluated, and based on the evaluation results, the sampling angles with low probability of misleading the face detection model are determined; then, these sampling angles are used as important sampling parameters. After that, the random strategy is adjusted based on these important sampling parameters, and step S103 is iteratively executed to generate samples of the face-helmet combination model. Then, step S105 is executed.
[0054] According to some embodiments, the sampling parameters include camera angle, camera distance, ambient lighting direction, and lighting intensity.
[0055] In step S105, a preset face detection model is tested using the face-helmet combination image to obtain a face detection score of the face detection model.
[0056] In some embodiments, step S105 includes white-box attack and black-box attack. For white-box attack, a face detection model to be attacked is preset, such as RetinaFace; for black-box attack, one or more face detection models are preset as replacement models. Each preset face detection model includes a model algorithm file and a trained model weight. Then, the generated face helmet combination model sample is used to attack multiple preset face detection models to generate adversarial attack samples of multiple face detection models.
[0057] In step S107, the face detection score and a preset loss function are used to optimize the helmet texture map through a gradient descent algorithm to obtain the adversarial attack sample.
[0058] According to an embodiment of the present application, in step S107, first, the face detection score is used to calculate the loss value of a preset loss function; then, based on the loss value, the derivative of the loss function with respect to the helmet texture map is calculated; finally, the loss function is minimized by a gradient descent algorithm to optimize the helmet texture map and obtain the adversarial attack sample.
[0059] In some embodiments, the loss function is as shown in formula (1).
[0060]
[0061] in, is the score for faces, is the score without face, and batchsize is the number of samples of the face-helmet combination model for testing.
[0062] according to Figure 1 The embodiment shown achieves the generalization capability of adversarial attack samples for complex environments and irrelevant identities by generating face helmet models in different environmental backgrounds. The helmet texture map is optimized through the gradient descent algorithm to minimize the loss function, and the probability of the face detection model believing that the most likely face area exists is continuously reduced, thereby achieving the generation of adversarial attack samples for the face detection model.
[0063] According to an embodiment of the present application, in order to make the generalization ability of the final adversarial attack sample stronger, it is necessary to execute steps S101 to S107 repeatedly until the loss of the loss function reaches the minimum.
[0064] In order to make the generated adversarial attack samples more concealed in visual perception, according to the embodiments of the present application, the following is proposed: Figure 2The flowchart of another method for generating adversarial attack samples of a face detection model is shown in FIG. Figure 2 The method for generating adversarial attack samples shown includes Figure 1 Steps S101 to S105 in the embodiment also include step S102. Step S102 is performed after step S101 and before step S103. For the sake of simplicity, only the following is described here. Figure 1 The differences are shown below, and the similarities will not be repeated here.
[0065] like Figure 2 As shown, in step S102, base color clustering is performed on the helmet three-dimensional model to generate a camouflage helmet three-dimensional model.
[0066] It should be noted that the helmet 3D model for base color extraction can be the initial helmet 3D model or the helmet 3D model in the adversarial attack sample obtained after step S107. Since the adversarial attack sample obtained after step S107 is the adversarial attack sample with the minimum loss function, the helmet 3D model in the adversarial attack sample obtained after step S107 can be used to improve Figure 2 Computational efficiency of the illustrated embodiment.
[0067] According to an embodiment of the present application, in step S102, first, the base color of the camouflage anti-attack sample is generated by base color clustering; then, the generated base color, preset color distribution control points and preset probability distribution seeds are used to generate the camouflage helmet texture map through the Gumbel-normalized exponential function and distance weighting; finally, the camouflage helmet texture map is used to generate the camouflage helmet three-dimensional model.
[0068] According to some embodiments, generating the primary color of the camouflage adversarial attack sample by using primary color clustering includes obtaining a primary color close to the background from the background of the adversarial attack sample, or obtaining a primary color with a better attack evaluation value from the adversarial attack sample.
[0069] For example, the forest background is mainly green, and similar green base colors can be obtained through clustering.
[0070] For another example, if there are a large number of colors with RGB values of [24, 78, 12] in the adversarial attack samples, then this color is likely to have a strong effect in misleading the face detection system, and this color is obtained through clustering.
[0071] In some embodiments, the color selection range can be further standardized by specifying a color range (for example, the green channel must be the highest).
[0072] In other embodiments, according to the expected color features, for example, green within the preset RGB range, n clusters are initialized, and a clustering algorithm (for example, K-Means algorithm) is used to perform color clustering on the adversarial attack samples to obtain k colors within the expected range. When k is the same as n, the execution is terminated to obtain n primary colors within the expected range. If k is less than n, the number of clusters is increased, and the clustering algorithm is restarted for clustering until n colors within the expected range are obtained.
[0073] In a specific embodiment, when generating the camouflage helmet texture map, the preset color distribution control points are used to control the color and texture distribution of the camouflage anti-UV texture map. In a specific embodiment, a random color in the base color set is randomly defined for each control point.
[0074] In some other embodiments, the size of the anti-attack UV texture map is set to be h in height and w in width, and 2hwn random numbers that conform to uniform distribution are initialized as probability distribution seeds, where hwn probability distribution seeds are set to constant seed. fixed , no longer change; in addition, hwn seeds are set as optimizable variables seed train , optimized during training. The probability distribution seed is used for the Gumbel-normalized exponential function to generate discrete colors.
[0075] After step S102, the camouflage helmet three-dimensional model generated in step S102 is used to replace the helmet three-dimensional model in step S101, and steps S103 to S107 are executed.
[0076] According to an embodiment of the present application, in step S103, when the three-dimensional models are randomly combined to obtain combined images of faces and helmets in different environments, first, the camouflage helmet three-dimensional model is generated using the camouflage helmet texture map; then, the generated camouflage helmet three-dimensional model is randomly combined with the multiple three-dimensional face models and multiple two-dimensional background images to generate combined three-dimensional model samples of different faces wearing the same camouflage helmet; finally, using the combined model samples, the combined three-dimensional model samples of the different faces wearing the same camouflage helmets are sampled and converted into three-dimensional space under random viewing angles and lighting conditions to obtain combined face-helmet images of different faces wearing the same camouflage helmets in different environments.
[0077] According to other embodiments, in step S107, when optimizing the helmet texture map by using the face detection score and the preset loss function through the gradient descent algorithm to obtain the adversarial attack sample, first, the loss value of the preset loss function is calculated by using the face detection score; then, based on the loss value, the derivative of the loss function with respect to the preset control point and the probability distribution seed is calculated; finally, the control point and the probability distribution seed are optimized by minimizing the loss function through the gradient descent algorithm to generate a camouflage adversarial attack sample of the face detection model.
[0078] According to some other embodiments, after step S107, the process further includes preparing a head mounted device capable of attacking in the physical world.
[0079] Figure 3 A schematic diagram of a process of constructing a three-dimensional model according to an exemplary embodiment of the present application is shown below. Figure 3 , a process of constructing a three-dimensional model according to an exemplary embodiment of the present application is described in detail.
[0080] like Figure 3 As shown, the process of building a three-dimensional model includes a helmet modeling preparation stage, a face modeling preparation stage and a background modeling preparation stage.
[0081] In the preparation stage of helmet modeling, first, determine the prototype of the head-mounted device (e.g., hat, helmet) used to make the attack sample according to the application scenario, use a 3D scanning tool to scan the prototype of the head-mounted device, obtain its three-dimensional mesh data, and save the acquired three-dimensional data in the format of vertices, faces, and normals in a helmet model file in the .obj format in the form of a mesh; then, use a three-dimensional modeling software (e.g., Blender, 3dsMax) to UV unfold the helmet model, and establish a mapping relationship between the vertex coordinates in the helmet mesh model and the UV coordinates of the UV texture map. Among them, the UV texture map enables the head-mounted device to add adversarial perturbations to any area of the surface, increasing the angle range of the attack face detection model. In some embodiments, the unfolded UV coordinates are saved in the .obj model file, the helmet map is saved as a .png image file, and the association between the helmet map and the UV coordinates is saved through the .mtl material file.
[0082] In the preparation stage of face modeling, 3D scanning tools are used to generate mesh data and UV mapping data of an individual face or multiple distinguishable faces of different identities, and the mesh data is stored in an .obj file, the UV mapping data is saved in a .png image file, and the correspondence between the face mesh data and the UV mapping data is saved through a .mtl material file.
[0083] Real three-dimensional face data can narrow the domain gap between the digital world and the physical world. In this embodiment, face features in continuous three-dimensional space are used to improve the robustness of the attack face detection model in the physical world.
[0084] In the background modeling preparation stage, multiple natural images (such as outdoor scenes, indoor environments, etc.) that do not include human faces are collected to enhance the training data, preventing the attack samples from overfitting to specific backgrounds and improving their robustness.
[0085] Figure 4 A schematic diagram of a process of generating an adversarial attack sample according to an exemplary embodiment of the present application is shown. Figure 4 The process shown includes a process for generating adversarial attack samples for head-mounted devices with unlimited colors and a process for generating adversarial attack samples for head-mounted devices with camouflage.
[0086] like Figure 4 As shown, in the face detection model generation stage, the face detection model is first determined according to the attack type.
[0087] For example, for white-box attacks, prepare a face detection model to be attacked, such as RetinaFace; for black-box attacks, prepare one or more face detection models as replacement models. For each model, prepare its model algorithm file and trained model weights.
[0088] In the unrestricted color adversarial texture initialization stage, firstly, a helmet adversarial texture map without color and texture restrictions is generated based on the texture map in the helmet model. The superscript indicates the number of iterations, and the initialization value includes a grayscale image, a Gaussian distribution image, or a specified image.
[0089] In the initialization phase of unrestricted color optimization, set an optimizer, such as Adam, to optimize the adversarial texture map texture unlimited In some embodiments, the learning rate is set to 0.02.
[0090] In the adversarial texture reasoning stage, a differentiable 3D rendering algorithm is used to use the helmet adversarial texture map, the constructed face model, the helmet model and the background model to render a face image with a helmet, which is then input into the face detection model for reasoning testing to obtain a score.
[0091] During the rendering process, the texture map in the helmet model is replaced with the helmet adversarial texture map texture optimized using the optimizer unlimited .
[0092] According to an embodiment of the present application, based on the scoring results, the parameters for generating a face image with a helmet are optimized, and the helmet adversarial texture map is iteratively optimized through a gradient descent algorithm using a preset loss function to speed up the efficiency of generating adversarial samples.
[0093] In a specific embodiment, in each iteration, we simultaneously use a variety of different space, lighting, face, and background combinations to obtain multiple face images wearing adversarial helmets in different combinations, as shown in formula (2).
[0094]
[0095] in, is a face image with a helmet, background is a background model, parameter batch is the rendering imaging angle parameter, Render is a differentiable 3D rendering algorithm, image batch To generate a face image with a helmet including the background.
[0096] For example, the number of samples in each iteration is set to 64 images, which contain 4 different face data and background data. Each face data generates 16 images with the same background but different spatial and illumination changes. This method allows adversarial samples to learn effective perturbations in continuous three-dimensional space and illumination, independent of the background and face identity. Since large batches of random changes in faces and backgrounds will increase the difficulty of model learning, a training method with relatively fixed faces and backgrounds and large spatial and illumination changes is selected to meet real-world scenarios.
[0097] The image is input into the face detection model FaceDetect for inference, as shown in formula (3).
[0098] pred batch =FaceDetect(image batch ) (3)
[0099] Among them, pred = (classification, boxes, scores) is the inference information output by the face detection model, and FaceDetect is the face detection model.
[0100] For black-box attacks, multiple different face detection models are used for reasoning, as shown in formula (4).
[0101]
[0102] Among them, FaceDetect model For multiple different face detection models.
[0103] In the loss function calculation stage, the loss function shown in formula (1) is used to maximize the face detection model's output without faces and minimize the face detection model's output with faces, and the expected value is obtained by averaging the combinations of various spaces, illuminations, faces, and backgrounds.
[0104] For black-box attacks, the adversarial attack loss function is the adversarial attack loss function for each model. The sum of the average values of .
[0105] In some embodiments, in order to enhance the physical feasibility of adversarial samples, other losses are used for constraints, such as total variation loss, unprintable loss, etc., as shown in formula (4).
[0106] loss=loss adv +loss tv +loss nps (4)
[0107] Among them, loss is the loss and loss tv is the total variation loss, loss nps This is non-printable loss.
[0108] In the gradient reversal attack stage, Adam optimization is used to calculate the gradient of the helmet texture through the chain method, and the gradient descent method is used for backpropagation optimization.
[0109] In the importance sampling stage, within a test batch, the attack success rate within each angle range of the rendering imaging angle parameter Parameter in each iteration is updated and counted, and the attack success rate graph within each angle range is calculated. For example, the attack success rate is calculated in every 10-degree azimuth angle and every 4-degree pitch angle range, and then averaged with the attack success rates in other historical test batches. Using the attack success rate graph as the importance sampling parameter, the rendering imaging angle parameter is adjusted, as shown in formula (5). Among them, the lower the attack success rate, the greater the probability of parameter sampling.
[0110] sanpleProbability=Normalize(1-aseMap+γ) (5)
[0111] Among them, asrMap is the cumulative attack success rate map, Normalize is the normalization operation, so that the sum of the normalized sampleProbability is 1, and γ is the smoothing coefficient, which ensures that when the subsequent iterative training generates face helmet attack samples including the background, the angles with high attack success rates can be sufficiently sampled to prevent catastrophic forgetting during training. Through importance sampling, the attack success rate of some angles with low attack success rates can be significantly improved, and the multi-view robustness of the adversarial head-mounted device can be enhanced.
[0112] The process is then iterated from the adversarial texture inference stage to the adversarial texture inference stage until the loss function of the generated adversarial attack samples converges.
[0113] Finally, save the UV texture map of the trained adversarial attack sample as an unrestricted version of the adversarial attack sample, a blueprint for making physical world adversarial samples, or as a basic version of a camouflage headset.
[0114] Due to the Figure 4 The prepared head-mounted device adversarial attack sample that generates unlimited colors has good attack capabilities and can mislead face detection models in the digital world, and can be used to produce adversarial samples in the physical world. However, this version of the adversarial head-mounted device has certain defects in visual concealment due to its unnatural colors and textures, although it can deceive machine models, it is easy to attract human attention.
[0115] According to the embodiments of the present application, Figure 4 Based on the head-mounted device anti-attack samples produced, an embodiment of the generation process of producing camouflage head-mounted device anti-attack samples is given. Figure 4 The camouflage head-mounted device adversarial attack samples generated by the embodiment shown can produce a more natural adversarial head-mounted device at the cost of slightly sacrificing attack performance under the constraints of limiting color types and texture appearance.
[0116] like Figure 4 As shown, first, the base color is extracted from the helmet 3D model, and n colors are selected as the basic colors of the camouflage against the head-mounted device. base .
[0117] According to some embodiments, when performing primary color extraction, n predefined primary colors can be directly specified, or a scene image of a head-mounted device application can be obtained, and the image can be color clustered using a K-Means algorithm to obtain n primary colors closest to the main color of the scene, or primary colors that meet the range can be obtained from a head-mounted device adversarial attack sample with unlimited colors.
[0118] Although it is possible to obtain the desired or background primary colors by directly specifying n predefined primary colors or obtaining the scene image of the head-mounted device application, the attack performance may be reduced due to the limitation of the number of colors and texture distribution. In order to improve the attack performance, the embodiment of the present application obtains the primary colors that meet the range from the head-mounted device adversarial attack sample with unlimited colors, and extracts the colors with better attack performance.
[0119] For example, first preset the color features expected to be obtained, such as green within a certain RGB range. Initialize n clusters, and use the K-Means algorithm to perform color clustering on the unrestricted version of the UV texture map to obtain k colors that meet the expected range. If k = n, terminate the algorithm to obtain n base colors that meet the expected range. If k < n, increase the number of clusters and restart the K-Means algorithm for clustering until n colors that meet the expected range are obtained.
[0120] In the initialization stage of the camouflage confrontation texture, use the generated types of camouflage colors, preset color control points, and probability distribution seeds to generate a camouflage texture map.
[0121] Figure 5 The diagram shows the types and distributions of colors generated using the traditional Thiessen polygon technique, as Figure 5 shown. At the color boundaries, the colors are discontinuous, so they are not differentiable mathematically and cannot be optimized by adversarial deep learning techniques.
[0122] Figure 6 The diagram shows the schematic diagram of the generated camouflage texture map according to the exemplary embodiments of the present application, as Figure 6 shown. The control points are the red dots in the figure. Each control point is marked with the (u, v) coordinates in the texture map and represents a color. The color of each pixel in the texture map depends on the colors of the nearby control points (for example, if a pixel is close to the control point representing white-green, then this pixel has a higher probability of showing white). In this way, the types and distributions of colors can be controlled to achieve the camouflage effect.
[0123] For example, set m as the number of control points for each color, such as m = 512. Initialize mn randomly distributed control points with map coordinates point = (u, v) uniformly into the UV map. Define a random color from the obtained set of base colors for every m control points according to the uniform distribution. For the control points of a specific color, its coordinates are represented by point conyrol,color The control points are used to control the color and texture distribution of the camouflage confrontation UV texture map.
[0124] Set the size of the adversarial attack UV texture map to be h in height and w in width. Initialize 2hwn random numbers that conform to the uniform distribution as probability distribution seeds seed, where hwn seeds are set as constants seed fixed , and will no longer change; the other hwn seeds are set as optimizable variables seed train , and are optimized during training. The seeds are used for the Gumbel-normalized exponential function to generate discrete colors.
[0125] In the initialization stage of the camouflage optimizer, two optimizers, such as Adam, are set to optimize the control points and probability distribution seeds, and the learning rates can be set to 0.001 and 0.01 respectively.
[0126] During the camouflage countermeasure texture initialization stage, it is also necessary to synthesize the UV map.
[0127] For example, for each control point control,color , the coordinates close to it are expected to be point pixel The pixel has a greater probability of changing to the same color as the control point. The probability distribution of each pixel changing to each color is shown in formulas (6) and (7).
[0128]
[0129] Among them, point control,color is the control point, point pixel Camouflage against UV texture map coordinates, a is a boundary blur hyperparameter, the smaller its value, the clearer the camouflage boundary, in some embodiments, the value of a is 1, probability pixel,color=x is the probability distribution of pixels, and n is the number of determined primary colors.
[0130] To ensure differentiability, the color color is generated for each pixel through the Gumbel-normalized exponential function pixel , as shown in formula (9). The Gumbel distribution can be obtained by transforming the random distribution seed, as shown in formula (8).
[0131] gumbel=-log(-log(β·seed train +(1-β)·seed fixed )) (8)
[0132]
[0133] Among them, seed train and seeds fixed are respectively initialized uniformly distributed random numbers, β is a hyperparameter used to control the ratio of optimizable random numbers to non-optimizable random numbers, which can usually be set to 0.5, Softmax is a normalized exponential function, and temperature is a temperature coefficient, which is a parameter used to control the randomness level of Softmax output. The higher its value, the stronger the randomness. In some embodiments, the value of temperature is 1.
[0134] Using the above pixel color generation process, the adversarial UV map generator Voronoi is designed to generate the entire camouflage adversarial UV texture map, as shown in formula (10).
[0135] Texture camouflage =Voronoi(point,seed) (10)
[0136] Among them, Voronoi is the abbreviation of formula (6) to (9), which describes the calculation of the color of a pixel by inputting a control point and a probability distribution seed. Voronoi means that the calculation shown in formula (6) to (9) is performed for each pixel to obtain a camouflage texture map. Different from the prior art, the prior art uses the traditional Thiessen polygon method to calculate the color of each pixel. pixel The color assigned to the control point closest to it is not differentiable. However, in the embodiment of the present application, by using distance weighting, Gumbel random and normalized exponential function Softmax, the pixel color can be differentiated.
[0137] In the adversarial texture thrust stage, the generated camouflage adversarial UV texture map is used to replace the helmet texture map in the unrestricted color head-mounted device adversarial attack sample. The adversarial texture reasoning stage, loss function calculation stage, gradient back propagation attack stage and importance sampling are performed in sequence with reference to the unrestricted color head-mounted device adversarial attack sample. And according to the importance sampling results, the face helmet camouflage model including the background is iteratively generated and iteratively trained. And the trained adversarial attack UV texture map is saved as the camouflage version of the adversarial attack sample, as the blueprint for the production of physical world adversarial samples.
[0138] Since the camouflage adversarial attack is limited by the distribution of color and texture, the random initialization values of the control points and seeds have a greater impact on the results. In order to speed up the convergence, it is necessary to try multiple sets of random initialization values, count the lo decrease rate of the loss function in the early iterations, and select the random initialization value corresponding to the lowest loss value as the initialization value for the final formal training.
[0139] Figure 7 A schematic diagram of a differentiable rendering process according to an exemplary embodiment of the present application is shown. Figure 7 The differentiable rendering process shown includes a 3D model synthesis stage, a desired transformation parameter setting stage, and a 3D rendering stage.
[0140] In the 3D rendering synthesis stage, the 3D model data is defined as object, as shown in formula (11).
[0141] object=(mesh,texture) (11)
[0142] Among them, mesh is the mesh data and texture is the texture map.
[0143] The three-dimensional model function Join is used to generate a helmet model including a human face, as shown in formula (12).
[0144] object=Join(object face ,object helmet ,transform object ) (12)
[0145] Among them, object is the 3D model data of the face of a person wearing a head-mounted device, the subscript represents the 3D model data of a specific part, and transform object It is a three-dimensional space homogeneous coordinate transformation matrix used to adjust the positional relationship between the face and the helmet. Its value can be obtained by debugging in the three-dimensional modeling software.
[0146] In the expected transformation parameter setting stage, a three-dimensional differentiable renderer is used to write an expected transformation parameter setter Parameter, which is used to generate rendering parameters of different angles, distances, and lighting conditions in the 3D space, as shown in formula (13).
[0147] transform,lighting=Parameter(importance) (13)
[0148] Among them, importance is the importance sampling parameter, which controls the probability distribution of transform and lighting. The range of transform and lighting is defined according to the application scenario. For example, transform and lighting are defined as camera azimuth (-60,60), elevation (-20,20), distance (40,60) and light intensity (0.8,1), light direction ((0,1), (0,1), (0,1)). Through importance sampling, the success rate of attacks at some angles can be significantly improved, and the multi-view robustness of adversarial head-mounted devices can be enhanced.
[0149] In the three-dimensional rendering stage, the face of the person wearing the head-mounted device is rendered onto the background image according to the three-dimensional micro-environment renderer Render, as shown in formula (14).
[0150] image=Render(object,background,parameter) (14)
[0151] Among them, background is the background image, and Render renders the face of the person wearing the head-mounted device onto the background image through the rendering parameters set by parameter.
[0152] According to an embodiment of the present application, arbitrary facial data and head-mounted device data are combined, and rendered onto a 2D image using different backgrounds, lighting, and three-dimensional space transformations to simulate camera-collected images from any angle that may appear in the real physical world. The method of combining faces and head-mounted devices in three-dimensional space is simpler and more effective than the method of locating the face on a two-dimensional image and then adding a head-mounted device map. The entire process does not require additional annotation data, and avoids pose distortion caused by inaccurate annotations. It has better robustness than other methods that directly perform rough approximations on 2D face images with limited available angles.
[0153] Figure 8 A schematic diagram of a 3D printing process of a head mounted device according to an embodiment of the present application is shown. Figure 8 As shown in the figure, import the head-mounted device .obj model file, .mtl material file and adversarial attack UV texture map .png file into the 3D printer. Use the 3D printer to 3D print the designed head-mounted device with adversarial attack texture, so as to obtain a wearable adversarial sample in the physical world.
[0154] The above mainly introduces the embodiments of the present application from the perspective of the method. Those skilled in the art should easily appreciate that, in combination with the operations or steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Those skilled in the art can use different ways to implement the described functions for each specific operation or method, and such implementation should not be considered to be beyond the scope of the present application.
[0155] The following describes the device embodiments of the present application. For details not described in the device embodiments of the present application, reference can be made to the method embodiments of the present application.
[0156] Fig. 9 A block diagram of a device for generating a face detection adversarial attack sample according to an exemplary embodiment of the present application is shown. Fig. 9The generating device shown includes a three-dimensional model building unit 901, a face-helmet combination image generating unit 903, a face detection model detecting unit 905, and an adversarial attack sample generating unit 907. The three-dimensional model building unit 901 is used to respond to the adversarial attack instruction of face detection to build a three-dimensional model, wherein the three-dimensional model includes at least one helmet three-dimensional model, multiple face three-dimensional models, and multiple background two-dimensional images; the face-helmet combination image generating unit 903 is used to randomly combine the three-dimensional models to obtain face-helmet combination images under different environments; and the face detection model detecting unit 905 is used to test a preset face detection model using the face-helmet combination image to obtain a face detection score of the face detection model; the adversarial attack sample generating unit 907 uses the face detection score and a preset loss function to optimize the helmet texture map through a gradient descent algorithm to obtain the adversarial attack sample.
[0157] Fig.10 An electronic device according to an exemplary embodiment of the present application is shown. Fig.10 The electronic device 200 according to this embodiment of the present application is described. Fig.10 The electronic device 200 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.
[0158] like Fig.10 As shown, the electronic device 200 is in the form of a general computing device. The components of the electronic device 200 may include, but are not limited to: at least one processing unit 210, at least one storage unit 220, a bus 230 connecting different system components (including the storage unit 220 and the processing unit 210), a display unit 240, etc.
[0159] The storage unit stores program codes, which can be executed by the processing unit 210, so that the processing unit 210 executes the methods described in this specification according to various exemplary embodiments of the present application. For example, the processing unit 210 can execute the following: Figure 1 The method shown in .
[0160] The storage unit 220 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 2201 and / or a cache memory unit 2202 , and may further include a read-only memory unit (ROM) 2203 .
[0161] The storage unit 220 may also include a program / utility 2204 having a set (at least one) of program modules 2205, such program modules 2205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0162] Bus 230 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0163] The electronic device 200 may also communicate with one or more external devices 300 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 200, and / or communicate with any device that enables the electronic device 200 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 250. Furthermore, the electronic device 200 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 260. The network adapter 260 may communicate with other modules of the electronic device 200 via the bus 230. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 200, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0164] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software or by combining software with necessary hardware. The technical solution according to the implementation method of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, or a network device, etc.) to execute the above method according to the implementation method of the present application.
[0165] The software product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination thereof. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.
[0166] Computer readable storage media may include data signals propagated in baseband or as part of a carrier wave, wherein readable program codes are carried. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The readable storage medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, device, or device. The program codes contained on the readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination thereof.
[0167] Program code for performing the operations of the present application may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0168] The computer-readable medium carries one or more programs. When the one or more programs are executed by a device, the computer-readable medium implements the aforementioned functions.
[0169] Those skilled in the art will appreciate that the above modules can be distributed in the device according to the description of the embodiment, or can be changed accordingly and only used in one or more devices different from the embodiment. The modules of the above embodiments can be combined into one module, or further divided into multiple sub-modules.
[0170] According to an embodiment of the present application, a computer program is provided, including a computer program or an instruction. When the computer program or the instruction is executed by a processor, the method described above can be executed.
[0171] The embodiments of the present application are described in detail above. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application. At the same time, changes or deformations made by those skilled in the art based on the ideas of the present application, the specific implementation methods and the scope of application of the present application, all belong to the scope of protection of the present application. In summary, the content of this specification should not be construed as a limitation on the present application.
Claims
1. A method for generating adversarial attack samples of a face detection model, characterized in that: include: In response to the adversarial attack instruction of face detection, construct a three-dimensional model, wherein the three-dimensional model includes at least one helmet three-dimensional model, multiple face three-dimensional models and multiple background two-dimensional images; Randomly combining the three-dimensional models to obtain combined images of human faces and helmets in different environments; Using the face-helmet combined image to test a preset face detection model to obtain a face detection score of the face detection model; and The face detection score and a preset loss function are used to optimize the helmet texture map through a gradient descent algorithm to obtain the adversarial attack sample.
2. The generation method according to claim 1, characterized in that: The three-dimensional models are randomly combined to obtain combined images of human faces and helmets in different environments, including: Randomly combining the three-dimensional models to generate combined three-dimensional models of different faces wearing the same helmet; The combined three-dimensional model of different faces wearing the same helmet is sampled and spatially transformed under random viewing angles and lighting conditions, and the combined three-dimensional model of different faces wearing the same helmet is rendered into a two-dimensional image to obtain the combined image of the face and helmet under different environments.
3. The generation method according to claim 1, characterized in that: Utilizing the face detection score and a preset loss function, the helmet texture map is optimized by a gradient descent algorithm to obtain the adversarial attack sample, including: Calculate the loss value of a preset loss function using the face detection score; According to the loss value, calculating the derivative of the loss function with respect to the helmet texture map; The loss function is minimized by a gradient descent algorithm to optimize the helmet texture map and obtain the adversarial attack sample.
4. The generation method according to claim 3, characterized in that: The loss function is shown as follows: in, is the score for faces, is the score without face, and batch size is the number of samples of the face-helmet combination model for testing.
5. The generation method according to claim 1, characterized in that: Also includes: Counting the face detection accuracy of the face detection model under multiple rendering imaging angles; The face detection accuracy is used to perform importance sampling on random view angles to determine random view angle samples that optimize the adversarial attack samples.
6. The generation method according to claim 1, characterized in that: Before randomly combining the three-dimensional models to obtain combined images of human faces and helmets in different environments, the generation method further includes: The three-dimensional model of the helmet is clustered by base colors to generate a three-dimensional model of the camouflage helmet.
7. The generation method according to claim 6, characterized in that: Performing base color clustering on the adversarial attack sample to generate a camouflage helmet three-dimensional model, including: Generate the base color of the camouflage anti-attack sample by using base color clustering; Using the generated base color, the preset color distribution control point and the preset probability distribution seed, the camouflage helmet texture map is generated through the Gumbel-normalized exponential function and distance weighting; The camouflage helmet texture map is used to generate the camouflage helmet three-dimensional model.
8. The generation method according to claim 6, characterized in that: The three-dimensional models are randomly combined to obtain combined images of human faces and helmets in different environments, including: Using the camouflage helmet texture map, generating a camouflage helmet three-dimensional model; The generated camouflage helmet three-dimensional model is randomly combined with the multiple face three-dimensional models and multiple two-dimensional background images to generate combined three-dimensional model samples of different faces wearing the same camouflage helmet; By using the combined model samples, the combined three-dimensional model samples of different faces wearing the same camouflage helmet are sampled and converted into three-dimensional space under random viewing angles and lighting conditions to obtain face-helmet combined images of different faces wearing the same camouflage helmet in different environments.
9. The generation method according to claim 8, using the face detection score and a preset loss function, optimizing the helmet texture map through a gradient descent algorithm to obtain the adversarial attack sample, comprising: Using the face detection score, calculate the loss value of the preset loss function; Calculating, according to the loss value, a derivative of the loss function with respect to a preset control point and the probability distribution seed; The loss function is minimized by a gradient descent algorithm to optimize the control points and the probability distribution seeds, thereby generating camouflage adversarial attack samples of the face detection model.
10. A device for generating adversarial attack samples of a face detection model, characterized in that: include: A three-dimensional model construction unit, configured to construct a three-dimensional model in response to a confrontation attack instruction of face detection, wherein the three-dimensional model includes at least one helmet three-dimensional model, a plurality of face three-dimensional models and a plurality of background two-dimensional images; A human face and helmet combined image generating unit, used for randomly combining the three-dimensional models to obtain human face and helmet combined images in different environments; and A face detection model detection unit, used to test a preset face detection model using the face-helmet combination image to obtain a face detection score of the face detection model; The adversarial attack sample generating unit optimizes the helmet texture map by a gradient descent algorithm using the face detection score and a preset loss function to obtain the adversarial attack sample.
11. An electronic device, characterized in that: include: A memory and a processor; wherein the memory stores one or more computer instructions, wherein when the one or more computer instructions are executed by the processor, the generation method as described in any one of claims 1-9 is implemented.
12. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed, the generation method according to any one of claims 1 to 9 is implemented.
