Adversarial sample detection method, device, equipment, and medium based on static face

By extracting the face area and posture angle from the face image, mapping it to the UV space for difference calculation and feature extraction, and using the convolutional neural network and binary classification model to detect adversarial samples, it solves the problem of low detection accuracy in the existing technology. problem, significantly reducing the false detection rate and missed detection rate.

CN113723280BActive Publication Date: 2024-09-27PING AN BANK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111001078.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-30
Publication Date
2024-09-27
Estimated Expiration
2041-08-30

AI Technical Summary

Technical Problem

The existing technology has low accuracy when detecting adversarial samples and cannot effectively identify newly generated adversarial samples, resulting in high false detection and missed detection rates.

Method used

By extracting the face area and posture angle from the face image, mapping it to the UV space, performing difference calculation and feature extraction, and using the pre-built convolutional neural network and binary classification model to determine whether it is an adversarial sample.

Benefits of technology

It improves the accuracy of adversarial sample detection, reduces the false detection rate and missed detection rate, and enhances the recognition ability of adversarial samples.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113723280B
    Figure CN113723280B
Patent Text Reader

Abstract

The present invention relates to artificial intelligence technology, and discloses an adversarial sample detection method based on static human faces, including: extracting a human face region, calculating a human face posture angle in the human face region, and adjusting the angle of the human face region according to the human face posture angle to obtain a target human face image; mapping the target human face image to a UV space to obtain a UV space texture map; comparing the UV space texture map with a standard UV space texture map to obtain a difference image; using a convolutional neural network to extract features from the difference image to obtain a feature sequence; according to the feature sequence, using a binary classification model to determine whether the target human face image is an adversarial sample image. In addition, the present invention also relates to blockchain technology, and the standard UV space texture map can be stored in a node of a blockchain. The present invention also proposes an adversarial sample detection device, an electronic device, and a storage medium based on a static human face. The present invention can improve the accuracy of adversarial sample monitoring.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a static face-based adversarial sample detection method, device, electronic device and computer-readable storage medium. Background Art

[0002] With the development of mobile Internet, face recognition scenarios (mobile payment, login, unlocking, identity verification, etc.) have been widely used in major Internet fields. However, as the number of application scenarios increases, hackers have also set their sights on this scenario. They tamper with the user's photos and forge the customer's face recognition scenario to achieve illegal purposes. With the rise of adversarial samples, hackers have been provided with a convenient weapon to break through face recognition. Hackers generate multiple adversarial samples for the same photo, and then send multiple requests to verify whether the generated adversarial samples can be successful. Therefore, in order to prevent the attack of adversarial samples, a detection technology that can detect adversarial samples is urgently needed.

[0003] At present, the method for detecting adversarial samples in the industry is mainly to classify the acquired adversarial samples and original images through a training process, so that the trained model can distinguish between the original images and adversarial samples. However, this method is directly related to the principle of adversarial sample generation. Once hackers use new adversarial sample generation strategies to generate adversarial samples, the trained model cannot accurately identify them, and the false detection rate and missed detection rate in actual use are very high. Summary of the invention

[0004] The present invention provides an adversarial sample detection method, device and computer-readable storage medium based on static human faces, the main purpose of which is to solve the problem of low accuracy when monitoring adversarial samples.

[0005] To achieve the above object, the present invention provides an adversarial sample detection method based on static faces, comprising:

[0006] Extracting a face region from a face image, calculating a face posture angle in the face region, and adjusting an angle of the face region according to the face posture angle to obtain a target face image;

[0007] Mapping the target face image to UV space to obtain a UV space texture map corresponding to the target face image;

[0008] Using a preset difference calculation strategy, the UV space texture map is compared with a pre-constructed standard UV space texture map to obtain a difference image;

[0009] Using a pre-built convolutional neural network to extract features from the difference image to obtain a feature sequence;

[0010] According to the feature sequence, a pre-built binary classification model is used to determine whether the target face image is an adversarial sample image.

[0011] Optionally, performing UV space mapping on the target facial image to obtain a UV space texture map corresponding to the target facial image includes:

[0012] Modeling the target face image using a pre-built three-dimensional face reconstruction model to obtain a three-dimensional linear face model;

[0013] Performing a decoupling operation on the three-dimensional linear face model to remove expression features in the three-dimensional linear face model to obtain a three-dimensional neutral face image;

[0014] The three-dimensional neutral face image is mapped to a UV plane using a parameterized algorithm to obtain a UV space texture image corresponding to the target face image.

[0015] Optionally, calculating the facial posture angle in the target facial image includes:

[0016] Automatically locating the face area in the target face image using a pre-built skin color segmentation algorithm;

[0017] Perform posture analysis based on the light-sensitive information of the target organ in the face area to calculate the face posture angle in the target face image.

[0018] Optionally, the using a preset difference calculation strategy to compare the UV space texture map with a pre-constructed standard UV space texture map to obtain a difference image includes:

[0019] Extract target areas from the UV space texture map and the pre-constructed standard UV space texture map respectively;

[0020] respectively configuring weights of target areas in the UV space texture map and the standard UV space texture map;

[0021] According to the weight and the pre-constructed difference calculation method, the UV space texture map is compared with a pre-constructed standard UV space texture map to obtain a difference image.

[0022] Optionally, before determining whether the target face image is an adversarial sample image using a pre-built binary classification model according to the feature sequence, the method further includes:

[0023] Obtaining a pre-constructed decision tree classification model, and importing the pre-constructed sample difference image set into the decision tree classification model for training;

[0024] During the training process, the XGBoost training algorithm is used to configure the weights of different classification trees in the decision tree classification model;

[0025] When the loss value in the training process reaches a preset standard threshold, the training process is stopped to obtain the trained binary classification model.

[0026] Optionally, the extracting features of the difference image using a pre-built convolutional neural network to obtain a feature sequence includes:

[0027] Using a convolution kernel in a pre-constructed convolutional neural network to perform a convolution operation on the difference image to obtain a primary feature matrix set;

[0028] Performing a maximum pooling operation on each primary feature matrix in the primary feature matrix set to obtain a pooled feature matrix set;

[0029] A full connection operation is performed on each pooling feature matrix in the pooling feature matrix set to obtain a feature sequence.

[0030] Optionally, before calculating the facial posture angle of the face in the target image, and extracting and aligning the facial part from the target image according to the facial posture angle to obtain the target facial image, the method further includes:

[0031] Extracting a facial feature sequence from the target face image, and using the facial feature sequence to query a pre-built face database;

[0032] When the facial feature sequence does not exist in the face database, determining that the target face image is not likely to be an adversarial sample;

[0033] When the target face image sequence is in the face database, it is determined that there is a possibility that the target face image is an adversarial sample.

[0034] In order to solve the above problems, the present invention also provides an adversarial sample detection device based on static human faces, the device comprising:

[0035] A target face image acquisition module is used to extract a face area from a face image, calculate a face posture angle in the face area, and adjust an angle of the face area according to the face posture angle to obtain a target face image;

[0036] A UV space texture construction module, used for mapping the target face image to the UV space to obtain a UV space texture map corresponding to the target face image;

[0037] A spatial texture comparison module is used to compare the UV spatial texture map with a pre-constructed standard UV spatial texture map using a preset difference calculation strategy to obtain a difference image;

[0038] The adversarial sample judgment module is used to use a pre-built convolutional neural network to extract features from the difference image to obtain a feature sequence, and based on the feature sequence, use a pre-built binary classification model to judge whether the target face image is an adversarial sample image.

[0039] In order to solve the above problem, the present invention further provides an electronic device, the electronic device comprising:

[0040] a memory storing at least one computer program; and

[0041] The processor executes the computer program stored in the memory to implement the above-mentioned adversarial sample detection method based on static faces.

[0042] In order to solve the above problems, the present invention also provides a computer-readable storage medium, in which at least one computer program is stored. The at least one computer program is executed by a processor in an electronic device to implement the above-mentioned adversarial sample detection method based on static faces.

[0043] The embodiment of the present invention maps the target face image into a UV space texture map, and then compares the UV space texture map with a pre-constructed standard UV space texture map to obtain a difference image, and classifies whether the target face image is an adversarial sample by analyzing the features in the difference image, wherein the difference feature information extracted from the difference image can focus on the difference analysis more intuitively, so that the false detection rate and missed detection rate of the binary classification model are greatly reduced. Therefore, the adversarial sample detection method, device, electronic device and computer-readable storage medium based on static faces proposed in the present invention can solve the problem of being unable to accurately judge adversarial samples. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1 A schematic diagram of a process flow of an adversarial sample detection method based on static faces provided by an embodiment of the present invention;

[0045] Figure 2 A schematic diagram of a process for calculating a facial posture angle provided by an embodiment of the present invention;

[0046] Figure 3 A schematic diagram of a process for generating a UV space texture map provided by an embodiment of the present invention;

[0047] Figure 4 A functional module diagram of an adversarial sample detection device based on static faces provided by an embodiment of the present invention;

[0048] Figure 5 A schematic diagram of the structure of an electronic device for implementing the adversarial sample detection method based on static faces provided by an embodiment of the present invention.

[0049] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0050] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0051] The embodiment of the present application provides an adversarial sample detection method based on static faces. The execution subject of the adversarial sample detection method based on static faces includes but is not limited to at least one of the electronic devices such as a server, a terminal, etc. that can be configured to execute the method provided by the embodiment of the present application. In other words, the adversarial sample detection method based on static faces can be executed by software or hardware installed on a terminal device or a server device, and the software can be a blockchain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, etc. The server can be an independent server, or it can be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and big data and artificial intelligence platforms.

[0052] Reference Figure 1 FIG. 1 is a flow chart of an adversarial sample detection method based on static human faces provided by an embodiment of the present invention. In this embodiment, the adversarial sample detection method based on static human faces includes:

[0053] S1. Extracting a face region from a face image, calculating a face posture angle in the face region, and adjusting an angle of the face region according to the face posture angle to obtain a target face image.

[0054] Detailed, such as Figure 2 As shown, in the embodiment of the present invention, extracting a face region from a face image and calculating a face posture angle in the face region includes:

[0055] S11, automatically locating the face area in the target face image using a pre-built skin color segmentation algorithm;

[0056] S12, performing posture analysis according to the light-sensitive information of the target organ in the face area, and calculating the face posture angle in the target face image.

[0057] The skin color segmentation algorithm is a regression algorithm that locates the face in the image based on the gradual and sudden changes in color. The embodiment of the present invention uses the skin color segmentation algorithm to locate the face in the target image, find the position of the face, and intercept the image in the prompt box automatically generated by the skin color segmentation algorithm to obtain the face area.

[0058] Furthermore, the embodiment of the present invention uses a deep alignment network (DAN) to identify the face region, and can directly obtain the face posture angle in the face region. The face posture angle is then used to adjust the angle of the face region to obtain a target face image.

[0059] Among them, the DAN is a deep transfer learning method that can identify various preset annotation points in the target face image for detection, which will not be elaborated here.

[0060] As is known to all, the adversarial sample is ultimately successful if it passes face recognition, and the target face image that does not pass face recognition does not need to be judged as an adversarial sample. Therefore, the embodiment of the present invention needs to perform face recognition before extracting the face area from the face image.

[0061] Therefore, in the embodiment of the present invention, before S1, the method further includes:

[0062] Extracting a facial feature sequence from the target face image, and using the facial feature sequence to query a pre-built face database;

[0063] When the facial feature sequence does not exist in the face database, determining that the target face image is not likely to be an adversarial sample;

[0064] When the target face image sequence is in the face database, it is determined that there is a possibility that the target face image is an adversarial sample.

[0065] The embodiment of the present invention can utilize a pre-trained feature extraction neural network to extract a facial feature sequence in the facial image, and then utilize a pre-built query system to query the facial database.

[0066] S2. Map the target face image to UV space to obtain a UV space texture map corresponding to the target face image.

[0067] The UV (U-VEEZ) is a two-dimensional texture coordinate with vertex component information of polygons and subdivided surface meshes, which can realize image texture mapping to surface meshes. The embodiment of the present invention converts the target face image into a UV space texture map to increase the implicit information of the image, making it easier to find the differences with the adversarial sample.

[0068] Detailed, such as Figure 3 As shown, in the embodiment of the present invention, mapping the target face image to the UV space to obtain the UV space texture map corresponding to the target face image includes:

[0069] S21, using a pre-built three-dimensional face reconstruction model to model the target face image to obtain a three-dimensional linear face model;

[0070] S22, performing a decoupling operation on the three-dimensional linear face model to remove expression features in the three-dimensional linear face model to obtain a three-dimensional neutral face image;

[0071] S23. Mapping the three-dimensional neutral face image to a UV plane using a parameterized algorithm to obtain a UV space texture image corresponding to the target face image.

[0072] The three-dimensional face reconstruction model is a model obtained by training an identity-based model and an expression-based model through a convolutional neural network. The coefficients of the expression-based and identity-based models in the face image can be fitted, and finally the fitted information is filled into a preset 3D model to obtain a 3D model corresponding to the face image.

[0073] The embodiment of the present invention uses the three-dimensional face reconstruction model to analyze the face image to obtain a three-dimensional face map, and the three-dimensional face map at this time is a combination of the character identity characteristics and expression characteristics. The embodiment of the present invention sets the coefficient of the expression base in the three-dimensional face map to a default value, thereby obtaining an expressionless three-dimensional neutral face map; finally, the embodiment of the present invention uses the parameterization algorithm to perform a non-rigid transformation on the face linear table on the three-dimensional neutral face map to obtain the UV space texture map.

[0074] S3. Using a preset difference calculation strategy, the UV space texture map is compared with a pre-constructed standard UV space texture map to obtain a difference image.

[0075] In an embodiment of the present invention, the method of using a preset difference calculation strategy to compare the UV space texture map with a pre-constructed standard UV space texture map to obtain a difference image includes:

[0076] Extract target areas from the UV space texture map and the pre-constructed standard UV space texture map respectively;

[0077] respectively configuring weights of target areas in the UV space texture map and the standard UV space texture map;

[0078] According to the weight and the pre-constructed difference calculation method, the UV space texture map is compared with a pre-constructed standard UV space texture map to obtain a difference image.

[0079] In one embodiment of the present invention, the difference calculation method is:

[0080] F x [i,j,k]=a*(X[i,j,k]-x[i,j,k])

[0081] In the formula, the F x [i, j, k] may represent the difference image, the x[i, j, k] is the UV space texture map, the X[i, j, k] is the standard UV space texture map; the i, j, k correspond to three coordinate systems; and a is the weight value of different target areas.

[0082] In an embodiment of the present invention, the UV space texture map is compared with a pre-constructed standard UV space texture map in the field of face recognition. Therefore, it is necessary to make a detailed comparison of the eye features, nose features, and mouth features in the above two space texture maps, which requires greater attention and therefore requires enhanced features, while other positions can be relatively weakened.

[0083] The weight value is set as follows in this embodiment of the present invention:

[0084]

[0085] The embodiment of the present application can automatically process the operation processes related to S1 to S3 based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.

[0086] S4. Using a pre-built convolutional neural network to extract features from the difference image to obtain a feature sequence.

[0087] In detail, in the implementation of the present invention, the feature extraction of the difference image using a pre-built convolutional neural network to obtain a feature sequence includes:

[0088] Using a convolution kernel in a pre-constructed convolutional neural network to perform a convolution operation on the difference image to obtain a primary feature matrix set;

[0089] Performing a maximum pooling operation on each primary feature matrix in the primary feature matrix set to obtain a pooled feature matrix set;

[0090] A full connection operation is performed on each pooling feature matrix in the pooling feature matrix set to obtain a feature sequence.

[0091] In an embodiment of the present invention, when the size of the difference image is 256*256, a sliding convolution operation with a step size of 1 is performed using N convolution kernels of size 3×3 to obtain N primary feature matrices of 254*254. The primary feature matrix set is subjected to a maximum pooling operation using a preset pooling layer to obtain N pooling feature matrices. Finally, the N pooling feature matrices are flattened using a Flatten layer to obtain N feature sequences.

[0092] Among them, the pooling layer and the Flatten layer are structures in the convolutional neural network, and are used to reduce the dimension of the data to reduce the amount of calculation in the subsequent recognition and judgment process.

[0093] S5. According to the feature sequence, use a pre-built binary classification model to determine whether the target face image is an adversarial sample image.

[0094] In one embodiment of the present invention, before using the pre-built binary classification model to determine whether the target face image is an adversarial sample image, the method further includes:

[0095] Obtaining a pre-constructed decision tree classification model, and importing the pre-constructed sample difference image set into the decision tree classification model for training;

[0096] During the training process, the XGBoost training algorithm is used to configure the weights of different classification trees in the decision tree classification model;

[0097] When the loss value in the training process reaches a preset standard threshold, the training process is stopped to obtain the trained binary classification model.

[0098] The embodiment of the present invention uses a pre-constructed sample difference image set and its corresponding label set to train the decision tree classification model. Since the training process of the decision tree classification model is prone to overfitting, the embodiment of the present invention uses the XGBoost training method to train the decision tree classification model, wherein the XGBoost is an additive model of the boosting integration concept.

[0099] The embodiment of the present invention uses the sample difference image set to train an XGboost single model with a mean absolute percentage error of less than 50%, and then implements model parameter interval setting based on the XGboost single model, and randomly obtains several XGboost sub-models, wherein the model parameters include the maximum depth of the subtree, the weight sum of the minimum leaf node sample, the proportion of training data samples, etc.; then, based on the several XGboost sub-models, the associated features are scored to evaluate the importance of the associated features, and then the most relevant and statistically significant training subsets are obtained, which greatly reduces the amount of data and thus shortens the model training time, and also improves the stability and accuracy of subsequent learning models.

[0100] The embodiment of the present invention limits the number of judgments of a single tree and reduces unnecessary resource consumption by setting the depth of each decision tree in the decision tree classification model to 30 and the minimum number of leaf nodes to 20. The embodiment of the present invention uses a loss function to determine the degree of training completion of the decision tree classification model.

[0101] Wherein, the loss function is:

[0102]

[0103] In the formula, is the true label corresponding to the first training set of the difference image, is the predicted label corresponding to the first training set in the difference image, and BCE is the binary cross loss function.

[0104] In the embodiment of the present invention, the loss function calculates the gap between the real label and the predicted label, which can represent the training effect of the model. The smaller the loss value, the higher the degree of training completion, and the larger the loss value, the lower the degree of training completion. When the loss value reaches the preset standard threshold of 0.05, it can be determined that the training process is completed and the trained binary classification model is obtained.

[0105] The embodiment of the present invention maps the face image into a UV space texture map, and then compares the UV space texture map with a pre-constructed standard UV space texture map to obtain a difference image, and classifies whether the target face image is an adversarial sample by analyzing the features in the difference image, wherein the difference feature information extracted from the difference image can focus on the difference analysis more intuitively, so that the false detection rate and missed detection rate of the binary classification model are greatly reduced. Therefore, the adversarial sample detection method, device, electronic device and computer-readable storage medium based on static faces proposed in the present invention can solve the problem of being unable to accurately judge adversarial samples.

[0106] like Figure 4, is a functional module diagram of an adversarial sample detection device based on static faces provided by an embodiment of the present invention.

[0107] The static face-based adversarial sample detection device 100 of the present invention can be installed in an electronic device. According to the functions implemented, the static face-based adversarial sample detection device 100 can include a target face image acquisition module 101, a UV space texture construction module 102, a space texture comparison module 103 and an adversarial sample judgment module 104. The module of the present invention can also be called a unit, which refers to a series of computer program segments that can be executed by an electronic device processor and can complete fixed functions, which are stored in the memory of the electronic device.

[0108] In this embodiment, the functions of each module / unit are as follows:

[0109] The target face image acquisition module 101 is used to extract a face area from a face image, calculate a face posture angle in the face area, and adjust the angle of the face area according to the face posture angle to obtain a target face image;

[0110] The UV space texture construction module 102 is used to map the target face image to the UV space to obtain a UV space texture map corresponding to the target face image;

[0111] The spatial texture comparison module 103 is used to compare the UV spatial texture map with a pre-constructed standard UV spatial texture map using a preset difference calculation strategy to obtain a difference image;

[0112] The adversarial sample judgment module 104 is used to use a pre-constructed convolutional neural network to extract features from the difference image to obtain a feature sequence, and use a pre-constructed binary classification model to determine whether the target face image is an adversarial sample image based on the feature sequence.

[0113] In detail, each module described in the static face-based adversarial sample detection device 100 in the embodiment of the present invention is used in the same manner as described above. Figures 1 to 3 The adversarial sample detection method based on static faces described in the present invention has the same technical means and can produce the same technical effect, so it will not be repeated here.

[0114] like Figure 5 , which is a schematic diagram of the structure of an electronic device for implementing an adversarial sample detection method based on static faces provided by an embodiment of the present invention.

[0115] The electronic device 1 may include a processor 10, a memory 11, a communication bus 12, and a communication interface 13, and may also include a computer program stored in the memory 11 and executable on the processor 10, such as an adversarial sample detection program based on static faces.

[0116] In some embodiments, the processor 10 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and combinations of various control chips. The processor 10 is the control core (ControlUnit) of the electronic device, and uses various interfaces and lines to connect the various components of the entire electronic device, and executes or executes programs or modules stored in the memory 11 (for example, executing adversarial sample detection programs based on static faces, etc.), and calls data stored in the memory 11 to execute various functions of the electronic device and process data.

[0117] The memory 11 includes at least one type of readable storage medium, and the readable storage medium includes a flash memory, a mobile hard disk, a multimedia card, a card-type memory (for example, an SD or DX memory, etc.), a magnetic memory, a disk, an optical disk, etc. In some embodiments, the memory 11 may be an internal storage unit of an electronic device, such as a mobile hard disk of the electronic device. In other embodiments, the memory 11 may also be an external storage device of an electronic device, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device. Further, the memory 11 may also include both an internal storage unit of the electronic device and an external storage device. The memory 11 can not only be used to store application software and various types of data installed in the electronic device, such as the code of the adversarial sample detection program based on static faces, but also can be used to temporarily store data that has been output or is to be output.

[0118] The communication bus 12 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is configured to realize connection and communication between the memory 11 and at least one processor 10, etc.

[0119] The communication interface 13 is used for communication between the above-mentioned electronic device and other devices, including a network interface and a user interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is generally used to establish a communication connection between the electronic device and other electronic devices. The user interface may be a display (Display), an input unit (such as a keyboard (Keyboard)), and optionally, the user interface may also be a standard wired interface, a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode, organic light-emitting diode) touch device, etc. Among them, the display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device and to display a visual user interface.

[0120] Figure 5 Only an electronic device with components is shown, and those skilled in the art will understand that Figure 5 The structure shown does not constitute a limitation on the electronic device 1, and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.

[0121] For example, although not shown, the electronic device may also include a power source (such as a battery) for supplying power to each component. Preferably, the power source may be logically connected to the at least one processor 10 through a power management device, so that the power management device can realize functions such as charging management, discharging management, and power consumption management. The power source may also include one or more DC or AC power sources, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components. The electronic device may also include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.

[0122] It should be understood that the embodiment is for illustration only and the scope of the patent application is not limited to this structure.

[0123] The static face-based adversarial sample detection program stored in the memory 11 of the electronic device 1 is a combination of multiple computer programs. When running in the processor 10, the following can be achieved:

[0124] Extracting a face region from a face image, calculating a face posture angle in the face region, and adjusting an angle of the face region according to the face posture angle to obtain a target face image;

[0125] Mapping the target face image to UV space to obtain a UV space texture map corresponding to the target face image;

[0126] Using a preset difference calculation strategy, the UV space texture map is compared with a pre-constructed standard UV space texture map to obtain a difference image;

[0127] Using a pre-built convolutional neural network to extract features from the difference image to obtain a feature sequence;

[0128] According to the feature sequence, a pre-built binary classification model is used to determine whether the target face image is an adversarial sample image.

[0129] Specifically, the specific implementation method of the processor 10 for the above-mentioned computer program can refer to the description of the relevant steps in the corresponding embodiment of the accompanying drawings, which will not be repeated here.

[0130] Furthermore, if the module / unit integrated in the electronic device 1 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. The computer-readable storage medium can be volatile or non-volatile. For example, the computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, and a read-only memory (ROM).

[0131] The present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor of an electronic device, the computer program can implement:

[0132] Extracting a face region from a face image, calculating a face posture angle in the face region, and adjusting an angle of the face region according to the face posture angle to obtain a target face image;

[0133] Mapping the target face image to UV space to obtain a UV space texture map corresponding to the target face image;

[0134] Using a preset difference calculation strategy, the UV space texture map is compared with a pre-constructed standard UV space texture map to obtain a difference image;

[0135] Using a pre-built convolutional neural network to extract features from the difference image to obtain a feature sequence;

[0136] According to the feature sequence, a pre-built binary classification model is used to determine whether the target face image is an adversarial sample image.

[0137] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.

[0138] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0139] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional modules.

[0140] It is obvious to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.

[0141] Therefore, no matter from which point of view, the embodiments should be regarded as illustrative and non-restrictive, and the scope of the present invention is limited by the appended claims rather than the above description, so it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any attached figure mark in the claims should not be regarded as limiting the claims involved.

[0142] The blockchain referred to in this invention is a new application mode of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.

[0143] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.

[0144] In addition, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the system claim can also be implemented by one unit or device through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any particular order.

[0145] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.

Claims

1. A static face-based adversarial sample detection method, characterized in that: The method comprises: Extracting a face region from a face image, calculating a face posture angle in the face region, and adjusting an angle of the face region according to the face posture angle to obtain a target face image; Mapping the target face image to UV space to obtain a UV space texture map corresponding to the target face image; Using a preset difference calculation strategy, the UV space texture map is compared with a pre-constructed standard UV space texture map to obtain a difference image; Using a pre-built convolutional neural network to extract features from the difference image to obtain a feature sequence; According to the feature sequence, using a pre-built binary classification model to determine whether the target face image is an adversarial sample image; The step of mapping the target face image to the UV space to obtain a UV space texture map corresponding to the target face image includes: using a pre-built three-dimensional face reconstruction model to model the target face image to obtain a three-dimensional linear face model; performing a decoupling operation on the three-dimensional linear face model to remove expression features in the three-dimensional linear face model to obtain a three-dimensional neutral face map; and using a parameterized algorithm to map the three-dimensional neutral face map to a UV plane to obtain a UV space texture map corresponding to the target face image. The method of using a preset difference calculation strategy to compare the UV space texture map with a pre-constructed standard UV space texture map to obtain a difference image includes: respectively extracting target areas in the UV space texture map and the pre-constructed standard UV space texture map; respectively configuring weights of the target areas in the UV space texture map and the standard UV space texture map; and comparing the UV space texture map with the pre-constructed standard UV space texture map according to the weights and a pre-constructed difference calculation method to obtain a difference image.

2. The static face-based adversarial sample detection method according to claim 1, characterized in that: The step of extracting a face region from a face image and calculating a face posture angle in the face region comprises: Automatically locating the face area in the target face image using a pre-built skin color segmentation algorithm; Perform posture analysis based on the light-sensitive information of the target organ in the face area to calculate the face posture angle in the face area.

3. The static face-based adversarial sample detection method according to claim 1, characterized in that: Before determining whether the target face image is an adversarial sample image using a pre-built binary classification model according to the feature sequence, the method further includes: Obtaining a pre-constructed decision tree classification model, and importing the pre-constructed sample difference image set into the decision tree classification model for training; During the training process, the XGBoost training algorithm is used to configure the weights of different classification trees in the decision tree classification model; When the loss value in the training process reaches a preset standard threshold, the training process is stopped to obtain the trained binary classification model.

4. The static face-based adversarial sample detection method according to claim 1, characterized in that: The method of extracting features from the difference image using a pre-built convolutional neural network to obtain a feature sequence includes: Using a convolution kernel in a pre-constructed convolutional neural network to perform a convolution operation on the difference image to obtain a primary feature matrix set; Performing a maximum pooling operation on each primary feature matrix in the primary feature matrix set to obtain a pooled feature matrix set; A full connection operation is performed on each pooling feature matrix in the pooling feature matrix set to obtain a feature sequence.

5. The static face-based adversarial sample detection method according to claim 1, characterized in that: Before extracting a face region from a face image, calculating a face posture angle in the face region, and adjusting an angle of the face region according to the face posture angle to obtain a target face image, the method further includes: Extracting a facial feature sequence from the target facial image, and using the facial feature sequence to query a pre-built facial database; When the facial feature sequence does not exist in the face database, determining that the target face image is not likely to be an adversarial sample; When the target face image sequence is in the face database, it is determined that there is a possibility that the target face image is an adversarial sample.

6. A static face-based adversarial sample detection device, used to implement the static face-based adversarial sample detection method according to any one of claims 1 to 5, characterized in that: The device comprises: A target face image acquisition module is used to extract a face area from a face image, calculate a face posture angle in the face area, and adjust an angle of the face area according to the face posture angle to obtain a target face image; A UV space texture construction module, used for mapping the target face image to the UV space to obtain a UV space texture map corresponding to the target face image; A spatial texture comparison module is used to compare the UV spatial texture map with a pre-constructed standard UV spatial texture map using a preset difference calculation strategy to obtain a difference image; The adversarial sample judgment module is used to use a pre-built convolutional neural network to extract features from the difference image to obtain a feature sequence, and based on the feature sequence, use a pre-built binary classification model to judge whether the target face image is an adversarial sample image.

7. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the adversarial sample detection method based on static faces as described in any one of claims 1 to 5.

8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the adversarial sample detection method based on static faces as described in any one of claims 1 to 5 is implemented.