Two-stage coarse-to-fine multi-classification face anti-counterfeiting method and device and medium

By employing a two-stage, multi-classification face anti-spoofing method, different loss functions are used to guide network learning, initially untangling the network and enhancing deception features. This solves the problem of face recognition systems being deceived by forged images, and improves recognition accuracy and stability.

CN116453175BActive Publication Date: 2026-04-07SOUTH CHINA UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-02
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

Existing facial recognition systems are easily fooled by forged facial images such as photos, videos, and 3D masks, leading to decreased recognition accuracy and difficulty in effectively distinguishing between real faces and deceptive behavior.

Method used

A two-stage, coarse-to-fine multi-class face anti-spoofing method is adopted. First, the unentangled features are initially learned through binary cross-entropy loss and Hessian loss. Then, in the second stage, the feature generator and classifier are further trained through multi-class cross-entropy loss and consistency loss to generate and identify real and deceptive features.

Benefits of technology

It improves the recognition accuracy of face anti-spoofing tasks, effectively distinguishes different types of deception behavior, reduces the difficulty of model training, and increases stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116453175B_ABST
    Figure CN116453175B_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on two-stage from coarse to fine multi-classification face anti-counterfeiting method, device and medium, wherein the method includes the following steps: collecting face anti-counterfeiting dataset, and defining class label respectively for two-stage from coarse to fine target;Through the first stage pre-training preliminary training feature generator, carry out fraud feature enhancement in the second stage, further learn to untangle feature, finally obtain face anti-counterfeiting identification result.The application uses different supervision functions for training for two-stage, takes multi-classification as learning goal, can capture the difference features between different fraud types more, is more suitable for deep neural network to learn feature, improves face anti-counterfeiting identification accuracy.The application can be widely applied in computer vision field.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer vision, and in particular to a two-stage, coarse-to-fine multi-classification face anti-spoofing method, device, and medium. Background Technology

[0002] With the advent of the AI ​​era and the continuous advancement of intelligent technology, many intelligent applications have been integrated into our lives. Among them, facial recognition systems are a particularly important application, appearing in various life and work scenarios, such as facial payment, attendance tracking, and facial verification for travel. While bringing convenience, they also bring certain risks. Due to the ease of obtaining facial data, the low cost of forgery, and the high potential profits, many attempts have emerged to deceive facial recognition systems using forged faces, such as photos, replayed videos, and 3D masks. Such representational attacks can directly or indirectly cause incalculable financial losses, making facial anti-spoofing particularly important. This field is also a key research area currently being pursued by computer vision researchers.

[0003] To address the deception problem in facial recognition systems, many scholars have conducted in-depth research, and various anti-spoofing methods have been proposed. These can be broadly categorized into methods based on liveness cues, methods based on texture cues, methods based on pseudo-depth maps, and methods based on domain adaptation or domain generation. Liveness cues-based methods primarily utilize human behavioral and physiological characteristics, including explicit facial movements such as blinking and lip movements, as well as implicit physiological features, such as using telephoto pneumatic pulse wave recording to detect heart rate. Texture cues-based methods mainly utilize local features of facial appearance, such as using the LBP operator and HOG features to represent the texture information of facial images. Compared to these traditional handcrafted features, depth model-based methods are more efficient at adaptively extracting texture features through convolutional neural networks. Researchers studying these techniques focus more on designing a suitable neural network to learn the best texture features, rather than designing the texture features themselves. Pseudo-depth map-based methods first use 3D reconstruction to obtain a depth map of a single RGB image as a label, then train another model to predict the depth map of a facial image, thereby distinguishing between real and deceptive faces. These three types of face anti-spoofing methods achieve considerable performance in intra-class testing and are interpretable. Domain-adaptation or domain-generation-based methods address the inconsistency in feature distribution between source and target domain data to some extent. Their aim is to enable the algorithm to generalize well to unseen scenarios. For example, minimizing the minimum average difference can bridge the feature spaces of the source and target domains. Another approach is to use gradient reversal layers and adversarial learning strategies to blur the boundaries between different sample domains. These methods can improve cross-domain testing performance and meet the needs of real-world scenarios. Summary of the Invention

[0004] In order to at least partially solve one of the technical problems existing in the prior art, the purpose of this invention is to provide a two-stage, coarse-to-fine multi-classification face anti-counterfeiting method, device and medium.

[0005] The technical solution adopted in this invention is:

[0006] A two-stage, coarse-to-fine multi-classification face anti-spoofing method includes the following steps:

[0007] Collect a face anti-spoofing dataset and define category labels as binary and multi-class for the two-stage coarse-to-fine target;

[0008] In the first stage, multiple loss functions are used as supervision and binary classification is used as the target to initially train the feature generator and the binary classifier. The real features and deceptive features in the face image are deentangled and reconstructed using a reconstruction network. Then, a discriminator is used for recognition, and the feature generator is trained adversarially.

[0009] The deception features of the unentangled data are enhanced and then fused with real information to generate a deception-enhanced face image;

[0010] In the second stage, multiple loss functions are used as supervision, multi-class classification is used as the objective, and deception-enhanced face images are used as training data to further train the feature generator and multi-class classifier.

[0011] During the testing phase, the results predicted by the multi-classifier were categorized into two classes: real and deceptive.

[0012] Furthermore, the category labels for the two-stage, coarse-to-fine objectives are defined as binary and multi-class, respectively, including:

[0013] In the first phase, the binary task category labels are "real" and "deception"; in the second phase, the multi-class task category labels are "real", "print deception", "video playback deception", and "3D face mask deception".

[0014] Furthermore, a feature generator is trained by using binary cross-entropy loss and Hessian loss together as supervision functions to learn the real and deceptive features of face images.

[0015] A feature generator is constructed, and the feature generator adopts a residual network structure.

[0016] A binary classifier is constructed, wherein the binary classifier adopts a fully connected network structure;

[0017] A reconstruction network is constructed, wherein the reconstruction network and the feature generator have a symmetrical structure.

[0018] The real features and deceptive features are reconstructed separately, and then a discriminator is used for identification. Generative adversarial loss is used to train the feature generator and discriminator alternately.

[0019] Furthermore, the supervision function for the generator is as follows:

[0020]

[0021] In the formula, m is the number of samples, D is the discriminator, R is the reconstruction network, F is the feature output by the feature generator, and the subscript 1 indicates that the channel belongs to the true feature, and the subscripts 2-4 indicate that the channel belongs to the deceptive feature.

[0022] The supervision function for the discriminator is as follows:

[0023]

[0024] In the formula, n1 is the number of real samples, n2 is the number of deceptive samples, and I is the input sample.

[0025] Furthermore, the enhancement of the deception features obtained from the de-entanglement process, followed by fusion with real information to generate a deception-enhanced face image, includes:

[0026] The feature values ​​of the deception feature are amplified by a factor of 1;

[0027] A 1×1 convolution is used to fuse real features with amplified deception features to generate a deception-enhanced face image, which serves as the input for the second stage.

[0028] Furthermore, in the second stage, multiple loss functions are used as supervision, multi-class classification is used as the objective, and deception-enhanced face images are used as training data to further train the feature generator and the multi-class classifier, including:

[0029] The feature generator is trained by using multi-class cross-entropy loss, Hessian loss, and consistency loss as supervision functions; the feature generator in the second stage shares parameters with the feature generator in the first stage.

[0030] A multi-class classifier is constructed, and the multi-class classifier adopts a fully connected network structure.

[0031] Furthermore, the method of jointly using multi-class cross-entropy loss, Hessian loss, and consistency loss as supervision functions to train the feature generator includes:

[0032] Given a deception-enhanced face image, a feature generator with the same structure as the first stage is used to obtain the separation features F'1, F'2, F'3, and F'4. Since the real part of the deception-enhanced face image remains unchanged, the feature map F1 of the first channel obtained by the feature generator should be invariant. This is constrained by a pixel-level consistency loss, as shown below:

[0033] L p =||F1-F'1||

[0034] In the formula, F1 represents the true features obtained by the first-stage feature generator, and F'1 represents the true features obtained by the second-stage feature generator;

[0035] In the second stage, Hessian loss is used for supervision to ensure that the real features and deceptive features obtained by the feature generator are unentangled;

[0036] Multi-class cross-entropy loss is used as a supervision function to achieve the goal of the second-stage multi-class classification task, as shown below:

[0037]

[0038] Among them, y i It is the one-hot encoding of the sample label. When the sample belongs to the i-th class, y i =1, otherwise y i =0.

[0039] Furthermore, during the testing phase, the results predicted by the multi-classifier are categorized into two classes: real and deceptive, including:

[0040] If the prediction is true, output it directly; if the prediction is photo spoofing, video replay spoofing, or 3D mask spoofing, output it as spoofing.

[0041] Another technical solution adopted in this invention is:

[0042] A two-stage, coarse-to-fine multi-classification face anti-counterfeiting device includes:

[0043] At least one processor;

[0044] At least one memory for storing at least one program;

[0045] When the at least one program is executed by the at least one processor, the at least one processor implements the method described above.

[0046] Another technical solution adopted in this invention is:

[0047] A computer-readable storage medium storing a processor-executable program, which, when executed by a processor, performs the method described above.

[0048] The beneficial effects of this invention are as follows: This invention employs a two-stage approach, progressing from coarse to fine, that is, from binary classification to multi-class classification, to guide network learning. Different supervision functions are used for different stages. In the first stage, binary cross-entropy loss, Hessian loss, and generative adversarial loss are used to initially learn unentangled features, providing a foundation for the second stage. In the second stage, deception features are enhanced using multi-class cross-entropy loss, Hessian loss, and consistency loss to further guide model learning. This two-stage design is more suitable for the network to learn both genuine and deception features related to unentanglement, while multi-class tasks enable the network to learn more discriminative features, thereby improving the recognition accuracy of face anti-spoofing tasks. Attached Figure Description

[0049] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following description is provided with accompanying drawings of the relevant technical solutions in the embodiments of the present invention or the prior art. It should be understood that the accompanying drawings described below are only for the purpose of clearly illustrating some embodiments of the technical solutions of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without any creative effort.

[0050] Figure 1 This is a flowchart of a multi-classification face anti-counterfeiting method based on a two-stage coarse-to-fine approach in an embodiment of the present invention.

[0051] Figure 2 This is a structural block diagram of the first stage in an embodiment of the present invention;

[0052] Figure 3 This is a structural block diagram of the second stage in an embodiment of the present invention. Detailed Implementation

[0053] The embodiments of the present invention are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention. The step numbers in the following embodiments are set only for ease of explanation, and there is no limitation on the order between the steps. The execution order of each step in the embodiments can be adaptively adjusted according to the understanding of those skilled in the art.

[0054] In the description of this invention, it should be understood that the orientation descriptions, such as up, down, front, back, left, right, etc., are based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limiting this invention.

[0055] In the description of this invention, "several" means one or more, "multiple" means two or more, "greater than," "less than," and "exceeding" are understood to exclude the stated number, while "above," "below," and "within" are understood to include the stated number. The use of "first" and "second" in the description is merely for distinguishing technical features and should not be construed as indicating or implying relative importance, or implicitly indicating the number of indicated technical features, or implicitly indicating the order of the indicated technical features.

[0056] In the description of this invention, unless otherwise explicitly defined, terms such as "set up," "install," and "connect" should be interpreted broadly, and those skilled in the art can reasonably determine the specific meaning of the above terms in this invention in conjunction with the specific content of the technical solution.

[0057] like Figure 1 As shown, this embodiment provides a two-stage, coarse-to-fine multi-classification face anti-spoofing method, including the following steps:

[0058] S1. Collect face anti-spoofing datasets and define category labels as binary and multi-class for the two-stage coarse-to-fine target.

[0059] Specifically: In the first phase, the two-category task category is labeled as real and deception; in the second phase, the multi-category task category is labeled as real, print deception, video replay deception, and 3D face mask deception.

[0060] S2. In the first stage, multiple loss functions are used as supervision and binary classification is used as the target to initially train the feature generator and the binary classifier. The real features and deceptive features in the face image are de-entangled and reconstructed using a reconstruction network. Then, a discriminator is used for recognition, and the feature generator is trained adversarially.

[0061] Step S2 includes steps S21-S25:

[0062] S21. Use binary cross-entropy loss and Hessian loss together as supervision functions to train the feature generator and learn the real and deceptive features of face images.

[0063] S22. Construct a feature generator using a residual network structure.

[0064] S23. Construct a binary classifier using a fully connected network structure;

[0065] S24. Construct a reconstruction network, which is symmetrical to the feature generator;

[0066] S25. Reconstruct the real features and deceptive features separately, and then use a discriminator for identification. Employ generative adversarial loss and alternately train the feature generator and discriminator.

[0067] S3. Enhance the deception features of the unentangled data, and then fuse them with real information to generate a deception-enhanced face image.

[0068] Step S3 includes steps S31-S32:

[0069] S31. Magnify the feature values ​​of the deception feature by a factor;

[0070] S32. Use 1×1 convolution to fuse real features with amplified deception features to generate a deception-enhanced face image, which serves as the input for the second stage.

[0071] S4. In the second stage, multiple loss functions are used as supervision and multi-class classification is used as the objective. Deceptive enhanced face images are used as training data to further train the feature generator and multi-class classifier.

[0072] Step S4 includes steps S41-S43:

[0073] S41. Use multi-class cross-entropy loss, Hessian loss, and consistency loss together as supervision functions to train the feature generator.

[0074] S42, The feature generator in the second stage shares parameters with the first stage;

[0075] S43. Construct a multi-class classifier, wherein the multi-class classifier adopts a fully connected network structure.

[0076] S5. During the testing phase, the results predicted by the multi-classifier are categorized into two classes: real and deceptive.

[0077] Specifically: if the prediction is true, output directly; if the prediction is photo spoofing, video replay spoofing, or 3D mask spoofing, output the spoofing category.

[0078] The system framework of the first phase is as follows: Figure 2 As shown, model building and training include the following steps A1-A3:

[0079] Step A1: Extract deentangled features from the input sample using a feature generator. Specifically, the feature generator has a residual structure and uses depthwise separable convolution and pointwise convolution instead of traditional convolution. Depthwise separable convolution uses the same number of kernels as the number of channels to convolve the corresponding channels. Furthermore, an inter-channel attention mechanism is added to the last convolutional layer. The feature map obtained from the last convolution is passed through a fully connected layer to obtain a set of corresponding weight values, which are then multiplied with the feature map to obtain the output. The input image starts at 256×256×3, and the generator produces a 16×16×4 feature map. The four channels represent four separate feature representations, including one true feature and three deceptive features.

[0080] Step A2: Establish the generative adversarial learning branch. Specifically, after obtaining four separating features, they are divided into two parts: real features and deceptive features. Then, a reconstruction network is used to reconstruct the real and deceptive features to obtain synthesized real and deceptive face images. This reconstruction process is symmetrical to the feature generation process described above, constituting an upsampling process. The model structure and the feature generator form a U-shaped network. After obtaining the synthesized face, a fully convolutional discriminator is constructed, specifically consisting of 7 convolutional layers and 3 pooling layers, ultimately outputting a 2-channel map, where each channel represents a category of output (real or deceptive). The first channel compares the reconstructed real sample with the real real sample, and the second channel compares the synthesized deceptive sample with the real deceptive sample. During training, the generator and discriminator are updated alternately. The supervision function for the generator is shown in Equation 1:

[0081]

[0082] Where m is the number of samples, D is the discriminator, R is the reconstruction network, F is the feature output by the feature generator, and a subscript of 1 indicates that the channel belongs to the true feature, while subscripts 2-4 indicate that the channel belongs to the deceptive feature. The supervision function for the discriminator is shown in Equation 2:

[0083]

[0084] Where n1 is the number of real samples, n2 is the number of deceptive samples, and I is the input sample.

[0085] Step A3: Establish the binary classification and de-entanglement learning branch. Specifically, after obtaining four separating features F1, F2, F3, and F4, the separating features F1, F2, F3, and F4 are passed through a global average pooling layer to obtain x1, x2, x3, and x4. Then, the Hessian matrix of G with respect to x is calculated:

[0086]

[0087] Using Hessian loss as supervision to guide the feature generator to obtain as few separate features as possible, it is only necessary to make the off-diagonal elements of the Hessian matrix zero. Thus, the Hessian loss is shown in Equation 4:

[0088]

[0089] Simultaneously, binary cross-entropy loss is used for supervision. Features x1, x2, x4, x4 are passed through a fully connected layer to obtain the predicted probability y'. The binary cross-entropy loss is expressed as follows:

[0090] L ce2 =-y·log(y')-(1-y)·log(1-y') (5)

[0091] The system framework of the second phase is as follows: Figure 3 As shown, model building and training include the following steps B1-B3:

[0092] Step B1: Enhance F2, F3, and F4 from the separated features obtained by the first-stage feature generator by multiplying them by an amplification factor λ. In this embodiment, this parameter is set to 2 to increase the weight of deception cues in the input deception samples. Then, the enhanced deception features and the real features are fused through a 1×1 convolutional layer to generate a deception-enhanced face image, which serves as the input for the second stage.

[0093] Step B2: Input the deception-enhanced face image, and use a feature generator with the same structure as the first stage to obtain the separation features F'1, F'2, F'3, and F'4. Since the real part of the deception-enhanced face image is invariant, that is, the feature map F1 of the first channel obtained by the feature generator should be invariant. This is constrained by a pixel-level consistency loss, as shown below:

[0094] L p =||F1-F'1|| (6)

[0095] In the second stage, Hessian loss is still used for supervision to ensure that the real and deceptive features obtained by the feature generator are disentangled. Simultaneously, multi-class cross-entropy loss is used as the supervision function to achieve the goal of the multi-class task in the second stage, as shown below:

[0096]

[0097] Where y i It is the one-hot encoding of the sample label. When the sample belongs to the i-th class, y i =1, otherwise y i =0.

[0098] Step B3: The last layer of the second-stage model is the softmax layer, which will obtain the probability values ​​of the input sample belonging to the four categories. At this time, the category corresponding to the maximum predicted probability value is the category determined by the model. In addition, since the face anti-spoofing task only needs to determine whether it is real or deceptive, when the model predicts any of the three deception types, it is classified as the deception type and used as the final output.

[0099] In summary, compared with existing technologies, this embodiment's two-stage, coarse-to-fine multi-classification face anti-spoofing method has the following advantages:

[0100] (1) In this embodiment, multi-classification is used as the final goal to guide network learning, which can better capture the differences between different types of deception and is more suitable for deep neural networks to learn features.

[0101] (2) This embodiment adopts a two-stage training mode. The first stage is used as pre-training to obtain unentangled features, which facilitates the multi-classification target in the second stage. The progressive training greatly reduces the training difficulty of the model and increases its stability.

[0102] (3) In this embodiment, different supervision functions are used in the two stages, such as binary classification, multi-class cross-entropy loss, Hessian loss, generative adversarial loss, consistency loss, etc., to guide the network learning in a targeted manner and constrain the corresponding conditions to meet the actual needs of each stage.

[0103] This embodiment also provides a two-stage, coarse-to-fine multi-classification face anti-counterfeiting device, including:

[0104] At least one processor;

[0105] At least one memory for storing at least one program;

[0106] When the at least one program is executed by the at least one processor, the at least one processor implements Figure 1 The method shown.

[0107] This embodiment of the present invention provides a multi-classification face anti-counterfeiting device based on a two-stage coarse-to-fine approach. It can execute a multi-classification face anti-counterfeiting method based on a two-stage coarse-to-fine approach provided in the method embodiment of the present invention. It can execute any combination of the implementation steps of the method embodiment and has the corresponding functions and beneficial effects of the method.

[0108] This application also discloses a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device can read the computer instructions from the computer-readable storage medium and execute the computer instructions, causing the computer device to perform... Figure 1 The method shown.

[0109] This embodiment also provides a storage medium storing instructions or programs that can execute the dual-stage coarse-to-fine multi-classification face anti-spoofing method provided in the method embodiment of the present invention. When the instructions or programs are run, any combination of implementation steps of the method embodiment can be executed, and the method has the corresponding functions and beneficial effects.

[0110] In some alternative embodiments, the functions / operations mentioned in the block diagrams may not occur in the order shown in the operation diagrams. For example, depending on the functions / operations involved, two consecutively shown blocks may actually be executed substantially simultaneously, or the blocks may sometimes be executed in reverse order. Furthermore, the embodiments presented and described in the flowcharts of this invention are provided by way of example to provide a more comprehensive understanding of the technology. The disclosed methods are not limited to the operations and logic flows presented herein. Alternative embodiments are contemplated in which the order of various operations is altered and sub-operations described as part of a larger operation are executed independently.

[0111] Furthermore, although the invention has been described in the context of functional modules, it should be understood that, unless otherwise stated, one or more of the described functions and / or features may be integrated into a single physical device and / or software module, or one or more functions and / or features may be implemented in a separate physical device or software module. It is also understood that a detailed discussion of the actual implementation of each module is unnecessary for understanding the invention. Rather, given the properties, functions, and internal relationships of the various functional modules in the apparatus disclosed herein, the actual implementation of the module will be understood within the scope of conventional skill of an engineer. Therefore, those skilled in the art can implement the invention as set forth in the claims using ordinary techniques without excessive experimentation. It is also understood that the specific concepts disclosed are merely illustrative and not intended to limit the scope of the invention, which is determined by the full scope of the appended claims and their equivalents.

[0112] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0113] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device.

[0114] More specific examples of computer-readable media (a non-exhaustive list) include: electrical connections (electronic devices) having one or more wires, portable computer disk drives (magnetic devices), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Furthermore, computer-readable media can even be paper or other suitable media on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in computer memory.

[0115] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.

[0116] In the foregoing description of this specification, references to terms such as "one embodiment," "another embodiment," or "some embodiments" indicate that a specific feature, structure, material, or characteristic described in connection with an embodiment or example is included in at least one embodiment or example of the present invention. In this specification, illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0117] Although embodiments of the invention have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.

[0118] The above is a detailed description of the preferred embodiments of the present invention. However, the present invention is not limited to the above embodiments. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of the present invention. All such equivalent modifications or substitutions are included within the scope defined by the claims of this application.

Claims

1. A two-stage, coarse-to-fine multi-classification face anti-spoofing method, characterized in that, Includes the following steps: Collect a face anti-spoofing dataset and define category labels as binary and multi-class for the two-stage coarse-to-fine target; In the first stage, multiple loss functions are used as supervision, and binary classification is used as the target to initially train the feature generator and the binary classifier. The real features and deceptive features in the face image are deentangled, and the deentangled real features and deceptive features are respectively input into the reconstruction network for reconstruction to obtain the reconstructed image. Then, the discriminator is used to recognize the reconstructed image. Generative adversarial training is performed between the generator composed of the feature generator and the reconstruction network and the discriminator to optimize the feature generator. The deception features of the unentangled data are enhanced and then fused with real information to generate a deception-enhanced face image; In the second stage, multiple loss functions are used as supervision, multi-class classification is used as the objective, and deception-enhanced face images are used as training data to further train the feature generator and multi-class classifier. During the testing phase, the results predicted by the multi-classifier were categorized into two classes: real and deceptive.

2. The multi-classification face anti-counterfeiting method based on a two-stage, coarse-to-fine approach as described in claim 1, characterized in that, The category labels for the two-stage, coarse-to-fine objectives are defined as binary and multi-class, including: In the first phase, the binary task category labels are "real" and "deception"; in the second phase, the multi-class task category labels are "real", "print deception", "video playback deception", and "3D face mask deception".

3. The multi-classification face anti-counterfeiting method based on a two-stage, coarse-to-fine approach as described in claim 1, characterized in that, In the first stage, multiple loss functions are used as supervision, and binary classification is used as the target for initial training of the feature generator and the binary classifier. The real and deceptive features in the face image are deentangled, and the deentangled real and deceptive features are respectively input into the reconstruction network for reconstruction to obtain a reconstructed image. Then, a discriminator is used to recognize the reconstructed image. Generative adversarial training is performed between the generator (composed of the feature generator and the reconstruction network) and the discriminator to optimize the feature generator, including: By using binary cross-entropy loss and Hessian loss as supervision functions, a feature generator is trained to learn the real and deceptive features of face images. A feature generator is constructed, and the feature generator adopts a residual network structure. A binary classifier is constructed, wherein the binary classifier adopts a fully connected network structure; A reconstruction network is constructed, wherein the reconstruction network and the feature generator have a symmetrical structure. The real features and deceptive features are reconstructed separately, and then a discriminator is used for identification. Generative adversarial loss is used to train the generator and the discriminator alternately.

4. The multi-classification face anti-counterfeiting method based on a two-stage, coarse-to-fine approach as described in claim 3, characterized in that, Supervision function for generator as follows: In the formula, For the sample size, R is the discriminator, R is the reconstruction network, F is the feature output by the feature generator, and the subscript 1 indicates that the channel belongs to the true feature, and the subscript 2-4 indicates that the channel belongs to the deceptive feature; Supervision function for discriminator as follows: In the formula, This represents the actual number of samples. To deceive the sample size, This is the input sample.

5. The multi-classification face anti-counterfeiting method based on a two-stage, coarse-to-fine approach as described in claim 1, characterized in that, The process of enhancing the deception features of the unentangled data and then fusing them with real information to generate a deception-enhanced face image includes: The eigenvalues ​​of the deceptive features are amplified by a factor of 1; A 1×1 convolution is used to fuse real features with amplified deception features to generate a deception-enhanced face image, which serves as the input for the second stage.

6. The multi-classification face anti-counterfeiting method based on a two-stage coarse-to-fine approach according to claim 1, characterized in that, In the second stage, multiple loss functions are used as supervision, multi-class classification is used as the objective, and deceptively enhanced face images are used as training data to further train the feature generator and the multi-class classifier, including: The feature generator is trained by using multi-class cross-entropy loss, Hessian loss, and consistency loss as supervision functions; the feature generator in the second stage shares parameters with the feature generator in the first stage. A multi-class classifier is constructed, and the multi-class classifier adopts a fully connected network structure.

7. The multi-classification face anti-counterfeiting method based on a two-stage, coarse-to-fine approach as described in claim 6, characterized in that, The method of jointly using multi-class cross-entropy loss, Hessian loss, and consistency loss as supervision functions to train the feature generator includes: Input a deception-enhanced face image, use a feature generator consistent with the first-stage structure, and obtain the separated features. , , , Since the real portion of the deceptively enhanced face image remains unchanged—that is, the F1 value of the feature map of the first channel obtained by the feature generator should be invariant—it is constrained by a pixel-level consistency loss, as shown below: In the formula, This represents the true features obtained by the first-stage feature generator. This represents the true features obtained by the second-stage feature generator; In the second stage, Hessian loss is used for supervision to ensure that the real features and deceptive features obtained by the feature generator are unentangled; Multi-class cross-entropy loss is used as a supervision function to achieve the goal of the second-stage multi-class classification task, as shown below: in, It is the one-hot encoding of the sample label, when the sample belongs to the i-th class. =1, otherwise =0.

8. The multi-classification face anti-counterfeiting method based on a two-stage coarse-to-fine approach according to claim 1, characterized in that, During the testing phase, the results predicted by the multi-classifier are categorized into two classes: real and deceptive, including: If the prediction is true, output it directly; if the prediction is photo spoofing, video replay spoofing, or 3D mask spoofing, output it as spoofing.

9. A multi-classification face anti-counterfeiting device based on a two-stage, coarse-to-fine classification method, characterized in that, include: At least one processor; At least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the method of any one of claims 1-8.

10. A computer-readable storage medium storing a processor-executable program, characterized in that, The processor-executable program, when executed by the processor, is used to perform the method as described in any one of claims 1-8.

Citation Information

Patent Citations

  • Generalized fake face detection method based on meta-learning

    CN112784790A

  • Living body detection method and system based on double-decoupling generation and semi-supervised learning

    CN114663986A