A lightweight face liveness detection method and system based on dual auxiliary supervision

By adopting a dual auxiliary supervision method in face liveness detection, extracting and fusing features of different sizes and dimensions, and using depth estimation and reflection artifact labels for supervised learning, the trade-off between detection accuracy and model simplicity is solved. , achieving efficient face liveness detection in resource-constrained environments.

CN118522056BActive Publication Date: 2024-10-01JIANGXI NORMAL UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410977073.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-22
Publication Date
2024-10-01
Estimated Expiration
2044-07-22

AI Technical Summary

Technical Problem

Existing face liveness detection methods are difficult to balance between detection accuracy and model simplicity. Especially on resource-constrained smart terminals, how to balance detection accuracy and model complexity has become an urgent problem to be solved.

Method used

A lightweight face liveness detection method based on dual auxiliary supervision is used to extract features of different scales through preprocessing images and fuse them through the attention mechanism. It combines depth estimation labels and reflection artifact labels for supervised learning to generate discriminative features to improve detection accuracy. sex.

Benefits of technology

By extracting features of different sizes and dimensions, the receptive field and detail expression ability of the detection method are improved, more robust general semantic features are obtained, the accuracy and robustness of detection are effectively improved, and the calculation amount and parameter amount of the model are reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118522056B_ABST
    Figure CN118522056B_ABST
Patent Text Reader

Abstract

The present invention discloses a lightweight human face liveness detection method and system based on dual auxiliary supervision, and the detection method includes the following steps: S1, preprocessing the target image to form a preprocessing graph; S2, extracting features of different scales according to the preprocessing graph and fusing the features of different scales through an attention mechanism to obtain a general semantic feature; S3, reconstructing the depth features and reflection features of the human face in the real scene according to the general semantic features; S4, fusing the general semantic features, the depth features and the reflection features to obtain a discriminant feature; S5, outputting a judgment result according to the discriminant feature. By extracting features of different sizes and dimensions, it is beneficial to mine the face fraud attack line in features of different sizes and dimensions; by fusing features of different sizes and dimensions through an attention mechanism, the receptive field and detail expression ability of the detection method are effectively improved, and more robust general semantic features can be obtained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of face recognition, and in particular to a lightweight face liveness detection method and system based on dual auxiliary supervision. Background Art

[0002] With the development of science and technology, face recognition technology has become an indispensable part of people's daily life. From mobile payment to security monitoring, this technology plays an important role in many fields. However, with the popularization of technology, it also brings a series of security challenges, the most notable of which is face fraud attacks.

[0003] Face fraud attacks are the use of illegal means to forge or tamper with face information to deceive face recognition systems. This attack method is diverse, including but not limited to printing photos, replaying videos, etc. These attack methods easily deceive traditional face recognition systems, posing a great threat to users' privacy and property security.

[0004] Therefore, in order to protect the security of face recognition systems, face liveness detection technology came into being. This technology analyzes the input face image to determine whether it is a real face, thus providing a safety line for face recognition systems.

[0005] At present, the mainstream face liveness detection algorithms mainly rely on deep learning technology. Compared with traditional methods, face liveness detection algorithms based on deep learning have significant advantages in detection effect. However, these algorithms are often complex in structure and require a lot of computing resources and storage space. In practical applications, especially on resource-constrained smart terminals, how to balance detection accuracy and model complexity has become an urgent problem to be solved. Summary of the invention

[0006] The purpose of the present invention is to provide a lightweight face liveness detection method and system based on dual auxiliary supervision, so as to solve the problem that the existing detection methods cannot take into account both detection accuracy and model simplicity.

[0007] To achieve the above-mentioned purpose, the present invention provides the following technical solutions: a lightweight face liveness detection method based on dual auxiliary supervision, the detection method comprising the following steps: S1: preprocessing the target image to form a preprocessing graph; S2: extracting features of different scales according to the preprocessing graph and fusing the features of different scales through an attention mechanism to obtain a general semantic feature; S3: reconstructing the depth features and reflection features of the face in the real scene according to the general semantic features, and generating a depth estimation label and a reflection artifact label through the preprocessing graph, and supervising the reconstruction process of the depth features and reflection features through the depth estimation label and the reflection artifact label; S4: fusing the general semantic features, the depth features and the reflection features to obtain the discriminant features; S5: outputting the judgment result according to the discriminant features.

[0008] Compared with the prior art, the beneficial effects of the present invention are as follows: by extracting features of different sizes and dimensions, it is helpful to mine clues of face fraud attacks in features of different sizes and dimensions, help the detection method learn more fraud clues, and improve the accuracy of detection; by integrating features of different sizes and dimensions through the attention mechanism, it effectively improves the receptive field and detail expression ability of the detection method, and can obtain more robust general semantic features. Considering the problem of insufficient learning of binary supervision models, it is proposed to use depth estimation maps and reflection artifact maps as pseudo-labels for auxiliary supervision, which helps the detection method learn more subtle fraud clues and improves the accuracy of detection.

[0009] Preferably, the above S2 specifically includes the following steps:

[0010] S21: Perform blueprint differential convolution and pooling operations on the preprocessed image to form high-dimensional features;

[0011] S22: Extract features at different levels based on high-dimensional features;

[0012] S23: According to the attention mechanism, corresponding enhanced features are extracted from features at different levels, and the enhanced features corresponding to features at different levels are fused to form common semantic features.

[0013] Preferably, the above S22 specifically includes the following steps:

[0014] S221: Extract shallow features based on high-dimensional features;

[0015] S222: extracting middle-level features based on shallow-level features;

[0016] S223: extract deep features based on middle-level features;

[0017] The above S221, S222 and S223 all include the following steps:

[0018] S2201: Perform three consecutive blueprint differential convolution operations on the input features to obtain intermediate features;

[0019] S2202: Connect the input feature and the intermediate feature through a residual direct connection operation to obtain a direct connection feature;

[0020] S2203: Performing a pooling operation on the directly connected features to obtain output features;

[0021] The above step S23 further includes the following steps:

[0022] The method of extracting enhanced features based on shallow features, mid-level features or deep features is:

[0023]

[0024] Where: Indicates shallow features, middle features or deep features, Indicates the corresponding enhanced features extracted based on shallow features, middle features or deep features; Represents an element-by-element multiplication operation; Represents the Sigmoid activation function; represents a standard convolution operation; represents the maximum pooling operation, represents the average pooling operation;

[0025] The fusion method of common semantic features is:

[0026]

[0027] Where: represents the downsampling operation, Represents a splicing operation, represents the corresponding enhanced features extracted based on the shallow features, Represents the corresponding enhanced features extracted from the middle-level features, Represents the corresponding enhanced features extracted based on the deep features.

[0028] Preferably, the above S3 further includes the following steps:

[0029] S31: performing three blueprint differential convolution operations on the general semantic features, the second blueprint differential convolution operation outputs the depth feature, and the third blueprint differential convolution operation outputs the depth map;

[0030] S32: Perform PRNet operation on the preprocessed image to generate a depth estimation image;

[0031] S33: A depth estimation label is formed through the depth estimation map. The depth estimation label is expressed as follows:

[0032]

[0033] Where: I represents the preprocessed image, y represents the corresponding label, Represents the depth estimation map of the face, represents the depth estimation graph regularization factor;

[0034] S34: Design a deep loss function. The deep loss function includes:

[0035] Mean square error loss function, the calculation method of the mean square error loss function is as follows:

[0036]

[0037] Where: N represents the number of samples in a batch, It represents the general semantic features obtained by S2 based on the samples with index h in a batch. represents the predicted output of the general semantic feature after S3, A label map representing auxiliary supervision;

[0038] Compared with the depth loss function, the calculation method of the depth loss function is as follows:

[0039]

[0040] Where: It represents a 3×3 filter in which the value of the center point of the filter is -1, the value of the zth neighbor in the eight neighborhoods of the center point is 1, and the values ​​of the remaining neighbors are 0;

[0041] S35: performing three blueprint differential convolution operations on the general semantic features, the second blueprint differential convolution operation outputs a reflection feature, and the third blueprint differential convolution operation outputs a reflection map;

[0042] S36: performing a SIRF operation on the preprocessed image to form a reflection artifact image;

[0043] S37: A reflection artifact label is formed by the reflection artifact map. The expression of the reflection artifact label is as follows:

[0044]

[0045] Where: Reflection artifact map representing the face, is the reflection map regularization factor;

[0046] S38: Design a reflection loss function, which includes a mean square error loss function.

[0047] Preferably, the method for generating the discriminant feature in the above S4 is:

[0048]

[0049] Where: represents two consecutive blueprint differential convolution operations, represents the deep features, Represents the reflection characteristics, It means subtracting the corresponding elements of two matrices. It represents the addition of corresponding elements of two matrices.

[0050] Preferably, the above step S5 specifically includes the following steps:

[0051] S51: performing an adaptive average pooling operation on the discriminant features to obtain adaptive average pooling information;

[0052] S52: performing a full connection operation on the adaptive average pooling information to obtain full connection information;

[0053] S53: Map the full connection information to between 0 and 1 through the SoftMax function to obtain the discrimination result;

[0054] S54: Design a classification loss function. The calculation method of the classification loss function is as follows:

[0055]

[0056] In the formula, represents the true label of the sample with index c in a batch, It indicates that the detection method estimates the probability of the category of the sample with index c in a batch.

[0057] Preferably, the calculation method of the blueprint differential convolution operation is as follows:

[0058]

[0059] Where: Represents the value of the output feature map with channel n and coordinates (p, q). Represents the value of the input feature map with channel m and coordinates (p+i, q+j) at the position, Represents the value of the convolution kernel with channel m and coordinate (i, j). represents a hyperparameter.

[0060] Based on another object of the present invention, the present invention provides the following technical solution: a lightweight face liveness detection system based on dual auxiliary supervision, the detection system uses the above-mentioned detection method, including:

[0061] A preprocessing module, used for preprocessing the image to form a preprocessing image;

[0062] The general feature extraction module is used to extract features of different scales from the preprocessed image and fuse the features of different scales through the attention mechanism to obtain general semantic features;

[0063] Auxiliary feature extraction module, used to reconstruct the depth features and reflection features of the face in the real scene according to the general semantic features, and generate the depth estimation label and reflection artifact label through the preprocessing map, and supervise the reconstruction process of the depth features and reflection features through the depth estimation label and reflection artifact label;

[0064] Feature enhancement module, used to fuse common semantic features, deep features and reflection features to obtain discriminative features;

[0065] The classifier is used to output the judgment result according to the discriminant features.

[0066] Based on another purpose of the present invention, the present invention provides the following technical solution: a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned detection method when executing the computer program.

[0067] Based on another object of the present invention, the present invention provides the following technical solution: a storage medium having a computer program stored thereon, wherein the computer program implements the above-mentioned detection method when executed by a processor. BRIEF DESCRIPTION OF THE DRAWINGS

[0068] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0069] Figure 1 It is a schematic flow chart of a lightweight face liveness detection method based on dual auxiliary supervision;

[0070] Figure 2 It is a schematic diagram of the system structure of the present invention;

[0071] Figure 3 Extraction flow chart for general semantic features;

[0072] Figure 4 Flowchart for discriminative feature extraction.

[0073] In the figure: 100, detection system; 110, preprocessing module; 120, general feature extraction module; 130, auxiliary feature extraction module; 140, feature enhancement module; 150, classifier. DETAILED DESCRIPTION

[0074] In order to enable those skilled in the art to better understand the solution of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0075] In this article, the terms "upper, lower, inside, outside" and the like are established based on the positional relationships shown in the drawings. The corresponding positional relationships may also change depending on the drawings, and therefore cannot be understood as absolute limitations on the scope of protection; moreover, relational terms such as "first" and "second" and the like are merely used to distinguish one component from another with the same name, and do not necessarily require or imply any actual relationship or order between these components.

[0076] Embodiment 1

[0077] like Figure 1 As shown, a lightweight face liveness detection method based on dual auxiliary supervision includes the following steps:

[0078] S1: Preprocessing the target image to form a preprocessing graph; the target image is a picture to be detected containing a face, which at least includes a picture taken by a photographic device when detecting face activity, a picture intercepted by an electronic device from a video stream, or a corresponding picture data set, the data set includes but is not limited to OULU-NPU and CelebA-Spoof, and the face in the target image is converted into a standard posture through preprocessing to facilitate subsequent detection;

[0079] S2: Extract features of different scales from the preprocessed image and fuse them through the attention mechanism to obtain universal semantic features. Extract features of different scales from the preprocessed image through the feature extraction network. Extracting features of different scales is conducive to mining face fraud attack clues in features of different sizes and dimensions. Splice features of different sizes and dimensions through the attention mechanism. Splicing through the attention mechanism effectively improves the receptive field and detail expression ability of the detection method, and can obtain more robust universal semantic features.

[0080] S3: Reconstruct the depth features and reflection features of the face in the real scene based on the general semantic features, and generate the depth estimation label and reflection artifact label through the preprocessing map, and supervise the reconstruction process of the depth features and reflection features through the depth estimation label and reflection artifact label; improve the ability of the detection method to extract face fraud attack clues by extracting the depth features and reflection features, and generate the depth estimation map and reflection artifact map through the preprocessing map through the PRNet (PacketRadioNetwork) operation and SIRF operation respectively during the extraction process, generate the depth estimation label and reflection artifact label through the depth estimation map and reflection artifact map, and supervise the reconstruction process of the depth features and reflection features through the depth estimation label and reflection artifact label to help the detection method learn more subtle fraud clues and improve the accuracy of detection;

[0081] S4: Fusion of common semantic features, depth features and reflection features to obtain discriminant features; S5: Output of judgment results based on the discriminant features.

[0082] Specifically, the effects achieved by the present invention through the above steps are: by extracting features of different sizes and dimensions, it is helpful to mine the clues of face fraud attacks in features of different sizes and dimensions, help the detection method learn more fraud clues, and improve the accuracy of detection; by integrating features of different sizes and dimensions through the attention mechanism, the receptive field and detail expression ability of the detection method are effectively improved, and more robust general semantic features can be obtained. Considering the problem of insufficient learning of binary supervision models, it is proposed to use depth estimation maps and reflection artifact maps as pseudo-labels for auxiliary supervision, which helps the detection method learn more subtle fraud clues and improves the accuracy of detection.

[0083] Preferably, the preprocessing in S1 specifically includes the following steps: (1) using a face detection algorithm to detect faces in the target image. The specific face detection algorithm can adopt an advanced detection algorithm in the industry according to actual conditions, such as any one of MTCNN (Multi-Task Convolutional Neural Network), HaarCascades and RetinaFace. Of course, other face detection algorithms can also be used as long as they can achieve the effect of detecting faces;

[0084] (2) After the face is detected, the detection algorithm is used to obtain the detection results of the feature points such as eyes and nose tip in the target image, and the target image is transformed based on the above detection results so that the face in the transformed target image conforms to the standard posture;

[0085] (3) According to the results of face detection and transformation, a certain area is cropped from the transformed target image to form a preprocessing image; preferably, the area includes the face area and a certain boundary around the face area. By adding the certain boundary, the preprocessing image contains more background information. The certain boundary is preferably 2 cm around the face area.

[0086] Preferably, the above detection method is trained on the two datasets of OULU-NPU and CelebA-Spoof. Of course, it can also be trained on other qualified datasets without limitation.

[0087] like Figure 3 As shown, further, the above S2 specifically includes the following steps:

[0088] S21: performing a blueprint differential convolution operation and a pooling operation on the preprocessed image to form a high-dimensional feature; the blueprint differential convolution operation and the pooling operation are used to increase the dimension of the preprocessed image and reduce the size of the preprocessed image, thereby reducing the amount of calculation of the model;

[0089] S22: Extract features at different levels based on high-dimensional features; the network for extracting features at different levels is a feature extraction network similar to a feature pyramid structure, thereby extracting features of different sizes and dimensions, which is conducive to mining clues of face fraud attacks in features of different sizes and dimensions;

[0090] The feature extraction network in S22 is similar to a feature pyramid structure, and the feature extraction network preferably includes three feature extraction stages, in which features of different scales are extracted respectively; the specific steps of extracting features of different scales are as follows:

[0091] S221: Extract shallow features based on high-dimensional features (64×64×128);

[0092] S222: extract middle-level features based on shallow-level features (32×32×128);

[0093] S223: extract deep features based on middle-level features (16×16×128);

[0094] Furthermore, the above-mentioned methods for extracting features in S221, S222 and S223 all include the following steps:

[0095] S2201: Perform three consecutive blueprint differential convolution operations on the input features to obtain intermediate features; the number of feature channels in the three consecutive blueprint differential convolution operations first increases and then decreases. Preferably, the number of feature channels in the three consecutive blueprint differential convolution operations is 128-196-128 respectively; that is, the output channel of the first blueprint differential convolution operation is 128, the output channel of the second blueprint differential convolution operation is 196, and the output channel of the third blueprint differential convolution operation is 128;

[0096] S2202: Connect the input feature and the intermediate feature through a residual direct connection operation to obtain a direct connection feature; in order to avoid gradient disappearance, a residual direct connection operation is added, and the residual direct connection operation can keep the gradient flowing during the back propagation process, thereby ensuring the learning speed of the detection method;

[0097] S2203: Perform a pooling operation on the directly connected features to obtain output features; the pooling operation is used to reduce the dimension to output features of the corresponding scale, and the output features can be shallow features (64×64×128), middle features (32×32×128) or deep features (16×16×128).

[0098] By setting up three feature extraction stages, richer and more abstract feature representations are gradually extracted, while maintaining the smooth transmission and dimensionality reduction of feature information, providing strong support for subsequent detection and judgment, thereby improving the performance and generalization ability of the overall algorithm;

[0099] S23: According to the attention mechanism, corresponding enhanced features are extracted from features at different levels, and the enhanced features corresponding to features at different levels are fused to form a common semantic feature (16×16×384). By fusing features of different sizes and dimensions through the attention mechanism, the receptive field and detail expression ability of the detection method are effectively improved, and more robust fusion features can be obtained.

[0100] The above step S23 further includes the following steps:

[0101] The method for extracting enhanced features based on shallow features (64×64×128), mid-level features (32×32×128) or deep features (16×16×128) is:

[0102]

[0103] Where: Represents shallow features (64×64×128), mid-level features (32×32×128), or deep features (16×16×128), Indicates the corresponding enhanced features extracted based on shallow features, middle features or deep features; Represents an element-by-element multiplication operation; Represents the Sigmoid activation function; represents a standard convolution operation; represents the maximum pooling operation, represents the average pooling operation;

[0104] The fusion method of general semantic features (16×16×384) is:

[0105]

[0106] Where: represents the downsampling operation, Represents a splicing operation, represents the corresponding enhanced features extracted based on the shallow features, Represents the corresponding enhanced features extracted from the middle-level features, Represents the corresponding enhanced features extracted based on the deep features.

[0107] Furthermore, the above S3 also includes the following steps:

[0108] S31: performing three blueprint differential convolution operations on the general semantic features, wherein the first blueprint differential convolution operation has an output channel of 128, the second blueprint differential convolution operation has an output channel of 64, and the third blueprint differential convolution operation has an output channel of 1. The second blueprint differential convolution operation outputs a depth feature, and the third blueprint differential convolution operation outputs a depth map.

[0109] S32: Perform PRNet operation on the preprocessed image to generate a depth estimation image;

[0110] S33: A depth estimation label is formed through the depth estimation map. The depth estimation label is expressed as follows:

[0111]

[0112] Where: I represents the preprocessed image, y represents the corresponding label, Represents the depth estimation map of the face, represents the regularization factor of the depth estimation graph, preferably ;Supervise the formation of depth maps through depth estimation labels;

[0113] S34: Design a deep loss function. The deep loss function includes:

[0114] In this embodiment, a 16×16 face depth estimation map and a face reflection artifact map are used as two auxiliary supervision labels. In this embodiment, a mean square error loss function is used to perform pixel-by-pixel supervision on the generated label map. The calculation method of the mean square error loss function is as follows:

[0115]

[0116] Where: N represents the number of samples in a batch, It represents the general semantic features obtained by S2 based on the samples with index h in a batch. Indicates the prediction output of the general semantic feature after S3. The prediction output is a depth estimation map or a reflection artifact map. Specifically, when calculating the depth loss function, the prediction output is a depth estimation map. When calculating the reflection loss function, the prediction output is a reflection artifact map. Represents the auxiliary supervision label map, which is a depth estimation label or a reflection artifact label. Specifically, when calculating the depth loss function, the auxiliary supervision label map is the depth estimation label, and when calculating the reflection loss function, the auxiliary supervision label map is the reflection artifact label;

[0117] On the basis of the above mean square error loss function, in order to meet the needs of face liveness detection tasks for supervising fine-grained information, the contrastive depth loss is introduced to help the network learn more fine-grained information. The calculation method of the contrastive depth loss function is as follows:

[0118]

[0119] Where: It represents a 3×3 filter in which the value of the center point of the filter is -1, the value of the zth neighbor in the eight neighborhoods of the center point is 1, and the values ​​of the remaining neighbors are 0;

[0120] S35: performing three blueprint differential convolution operations on the general semantic features, wherein the first of the three blueprint differential convolution operations is a blueprint differential convolution operation with an output channel of 128, the second is a blueprint differential convolution operation with an output channel of 64, and the third is a blueprint differential convolution operation with an output channel of 1. The second blueprint differential convolution operation outputs a reflection feature, and the third blueprint differential convolution operation outputs a reflection map.

[0121] S36: performing a SIRF operation on the preprocessed image to form a reflection artifact image;

[0122] S37: A reflection artifact label is formed by the reflection artifact map. The expression of the reflection artifact label is as follows:

[0123]

[0124] Where: Reflection artifact map representing the face, is the reflection map regularization factor, preferably ;Supervising the formation of reflectance maps via reflection artifact labels;

[0125] S38: Design a reflection loss function, the reflection loss function includes a mean square error loss function, and the reflection loss function is equal to the mean square error loss function.

[0126] like Figure 4 As shown, further, the method for generating the discriminant features in the above S4 is:

[0127]

[0128] Where: is the discriminant feature, which is a three-dimensional tensor on the real number set R, with a dimension of 64x16x16. Represents two consecutive blueprint differential convolution operations, the first one is a blueprint differential convolution operation with an output channel of 128, and the second one is a blueprint differential convolution operation with an output channel of 64. represents the deep feature, which is a three-dimensional tensor on the real number set R, with a dimension of 64x16x16. represents the reflection feature, which is a three-dimensional tensor on the real number set R, with a dimension of 64x16x16, It means subtracting the corresponding elements of two matrices. It represents the addition of the corresponding elements of the two matrices. The deep feature is subtracted from the reflection feature to achieve feature complementarity, and then it is added to the general semantic feature to generate the final discriminant feature for the final judgment.

[0129] Furthermore, the above step S5 specifically includes the following steps:

[0130] S51: performing an adaptive average pooling operation on the discriminant features to obtain adaptive average pooling information;

[0131] S52: performing a full connection operation on the adaptive average pooling information to obtain the full connection information, where the full connection operation is used to convert the channel dimension of the adaptive average pooling information to obtain the full connection information;

[0132] S53: Mapping the fully connected information to between 0 and 1 through the SoftMax function to obtain the predicted probabilities of real faces and fraudulent faces, and then determine whether the target image is a real face or a fraudulent face;

[0133] S54: Design a classification loss function. The calculation method of the classification loss function is as follows:

[0134]

[0135] In the formula, represents the true label of the sample with index c in a batch, , the true label is the label that the sample carries before detection, It indicates that the detection method estimates the probability of the category of the sample with index c in a batch. .

[0136] Furthermore, the calculation method of the above blueprint differential convolution operation is as follows:

[0137]

[0138] Where: Represents the value of the output feature map with channel n and coordinates (p, q). Represents the value of the input feature map with channel m and coordinates (p+i, q+j) at the position, Represents the value of the convolution kernel with channel m and coordinate (i, j). Represents a hyperparameter, preferably The blueprint differential convolution in this embodiment significantly reduces the number of model parameters and computational complexity while maintaining model performance. This lightweight design makes the algorithm more efficient and faster in practical applications. It can effectively capture complex fine-grained features, which helps to improve the recognition accuracy and robustness of the face liveness detection algorithm against fraud attacks.

[0139] Embodiment 2

[0140] The same parts in this embodiment as those in the first embodiment are given the same figure marks, and the same text descriptions are omitted.

[0141] like Figure 2 As shown, this embodiment discloses a lightweight face liveness detection system based on dual auxiliary supervision. The detection system 100 uses the detection method as in Example 1, including: a preprocessing module 110, which is used to preprocess the image to form a preprocessing image; a general feature extraction module 120, which is used to extract features of different scales from the preprocessing image and fuse the features of different scales through an attention mechanism to obtain a general semantic feature; an auxiliary feature extraction module 130, which is used to reconstruct the depth features and reflection features of the face in the real scene according to the general semantic features, and generate a depth estimation label and a reflection artifact label through the preprocessing image, and supervise the reconstruction process of the depth feature and the reflection feature through the depth estimation label and the reflection artifact label; a feature enhancement module 140, which is used to fuse the general semantic features, the depth features and the reflection features to obtain the discriminant features; a classifier 150, which is used to output the judgment result according to the discriminant features.

[0142] Embodiment 3

[0143] The same parts as those in the first and second embodiments of the present embodiment are given the same reference numerals, and the same text descriptions are omitted.

[0144] This embodiment discloses a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the detection method in the first embodiment is implemented.

[0145] Embodiment 4

[0146] The same parts as those in the first, second and third embodiments of the present embodiment are given the same reference numerals, and the same textual descriptions are omitted.

[0147] This embodiment discloses a storage medium on which a computer program is stored. When the computer program is executed by a processor, the detection method in the first embodiment is implemented.

[0148] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

Claims

1. A lightweight face liveness detection method based on dual auxiliary supervision, characterized in that: The detection method includes the following steps: S1: preprocessing the target image to form a preprocessing image; S2: extracting features of different scales according to the preprocessed graph, and fusing the features of different scales through an attention mechanism to obtain a common semantic feature; S3: reconstructing the depth feature and reflection feature of the face in the real scene according to the universal semantic feature, generating a depth estimation label and a reflection artifact label through the preprocessing image, and supervising the reconstruction process of the depth feature and the reflection feature through the depth estimation label and the reflection artifact label; S4: fusing the general semantic feature, the depth feature and the reflection feature to obtain a discriminant feature; S5: Outputting a judgment result according to the discrimination feature; The method for generating the discriminant feature in the above S4 is: Where: represents two consecutive blueprint differential convolution operations, represents the depth feature, represents the reflection characteristic, It means subtracting the corresponding elements of two matrices. It means adding the corresponding elements of two matrices. Represents common semantic features; The above step S5 specifically includes the following steps: S51: performing an adaptive average pooling operation on the discriminant feature to obtain adaptive average pooling information; S52: performing a full connection operation on the adaptive average pooling information to obtain full connection information; S53: Map the full connection information to between 0 and 1 through the SoftMax function to obtain the discrimination result; S54: Design a classification loss function, the calculation method of the classification loss function is as follows: In the formula, represents the true label of the sample with index c in a batch, Indicates the estimated probability of the category of the sample with index c in a batch by the detection method; The calculation method of the blueprint differential convolution operation is as follows: Where: Represents the value of the output feature map with channel n and coordinates (p, q). Represents the value of the input feature map with channel m and coordinates (p+i, q+j) at the position, Represents the value of the convolution kernel with channel m and coordinate (i, j). represents a hyperparameter.

2. According to the lightweight human face liveness detection method based on dual auxiliary supervision according to claim 1, it is characterized in that: The above S2 specifically includes the following steps: S21: performing a blueprint differential convolution operation and a pooling operation on the preprocessed image to form a high-dimensional feature; S22: extracting features at different levels according to the high-dimensional features; S23: Corresponding enhanced features are extracted from features at different levels according to the attention mechanism, and the enhanced features corresponding to features at different levels are fused to form a common semantic feature.

3. According to the lightweight human face liveness detection method based on dual auxiliary supervision according to claim 2, it is characterized in that: The above S22 specifically includes the following steps: S221: Extracting shallow features according to the high-dimensional features; S222: extracting middle-layer features according to the shallow-layer features; S223: extracting deep features according to the middle-level features; The above S221, S222 and S223 all include the following steps: S2201: performing the blueprint differential convolution operation three times in a row on the input feature to obtain an intermediate feature; S2202: Connect the input feature and the intermediate feature through a residual direct connection operation to obtain a direct connection feature; S2203: Perform the pooling operation on the directly connected features to obtain output features; The above step S23 further includes the following steps: The method for extracting the enhanced feature according to the shallow feature, the middle feature or the deep feature is: Where: represents the shallow feature, the middle feature or the deep feature, represents the corresponding enhanced feature extracted according to the shallow feature, the middle feature or the deep feature; Represents an element-by-element multiplication operation; Represents the Sigmoid activation function; represents a standard convolution operation; represents the maximum pooling operation, represents the average pooling operation; The fusion method of the general semantic features is: Where: represents the downsampling operation, Represents a splicing operation, represents the corresponding enhanced feature extracted according to the shallow feature, represents the corresponding enhanced feature extracted according to the middle-level feature, It represents the corresponding enhanced feature extracted according to the deep feature.

4. According to the lightweight human face liveness detection method based on dual auxiliary supervision according to claim 3, it is characterized in that: The above S3 also includes the following steps: S31: performing the blueprint differential convolution operation three times on the general semantic feature, the second blueprint differential convolution operation outputs the depth feature, and the third blueprint differential convolution operation outputs a depth map; S32: Performing a PRNet operation on the preprocessed image to generate a depth estimation image; S33: forming a depth estimation label through the depth estimation map, and the depth estimation label is expressed as follows: Where: I represents the preprocessed image, y represents the corresponding label, the depth estimation map representing a face, represents the depth estimation graph regularization factor; S34: Design a depth loss function, where the depth loss function includes: The mean square error loss function is calculated as follows: Where: N represents the number of samples in a batch, represents the general semantic feature obtained by S2 based on the sample with index h in a batch, represents the predicted output of the general semantic feature obtained by S3, A label map representing auxiliary supervision; The comparison depth loss function is calculated as follows: Where: It represents a 3×3 filter in which the value of the center point of the filter is -1, the value of the zth neighbor in the eight neighborhoods of the center point is 1, and the values ​​of the remaining neighbors are 0; S35: performing the blueprint differential convolution operation three times on the general semantic feature, wherein the second blueprint differential convolution operation outputs the reflection feature, and the third blueprint differential convolution operation outputs a reflection map; S36: performing a SIRF operation on the preprocessed image to form a reflection artifact image; S37: forming a reflection artifact label through the reflection artifact image, wherein the reflection artifact label is expressed as follows: Where: Reflection artifact map representing the face, is the reflection map regularization factor; S38: Design a reflection loss function, wherein the reflection loss function includes the mean square error loss function.

5. A lightweight face liveness detection system based on dual auxiliary supervision, the detection system using the detection method according to any one of claims 1 to 4, characterized in that: include: A preprocessing module, used for preprocessing the image to form a preprocessing image; A general feature extraction module, used to extract features of different scales from the preprocessed image and fuse the features of different scales through an attention mechanism to obtain a general semantic feature; An auxiliary feature extraction module, used to reconstruct the depth features and reflection features of a face in a real scene according to the universal semantic features, and generate a depth estimation label and a reflection artifact label through the preprocessing graph, and supervise the reconstruction process of the depth features and the reflection features through the depth estimation label and the reflection artifact label; A feature enhancement module is used to fuse the general semantic feature, the depth feature and the reflection feature to obtain a discriminant feature, wherein the method for generating the discriminant feature is: Where: represents two consecutive blueprint differential convolution operations, represents the depth feature, represents the reflection characteristic, It means subtracting the corresponding elements of two matrices. It means adding the corresponding elements of two matrices. Represents common semantic features; The calculation method of the blueprint differential convolution operation is as follows: Where: Represents the value of the output feature map with channel n and coordinates (p, q). Represents the value of the input feature map with channel m and coordinates (p+i, q+j) at the position, Represents the value of the convolution kernel with channel m and coordinate (i, j). represents a hyperparameter; A classifier, used to output a judgment result according to the discrimination feature; The classifier specifically includes the following operating steps: S51: performing an adaptive average pooling operation on the discriminant feature to obtain adaptive average pooling information; S52: performing a full connection operation on the adaptive average pooling information to obtain full connection information; S53: Map the full connection information to between 0 and 1 through the SoftMax function to obtain the discrimination result; S54: Design a classification loss function, the calculation method of the classification loss function is as follows: In the formula, represents the true label of the sample with index c in a batch, It indicates that the detection method estimates the probability of the category of the sample with index c in a batch.

6. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the detection method according to any one of claims 1 to 4 is implemented.

7. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the detection method according to any one of claims 1 to 4 is implemented.