A generalizable face liveness detection method based on frequency domain shortcut analysis
By employing frequency domain shortcut analysis and style suppression modulation mechanisms, the problem of insufficient generalization performance of face liveness detection methods under novel attack methods is solved, achieving efficient detection in complex scenarios.
Patent Information
- Application Number
- CN202411907906.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-24
- Publication Date
- 2026-01-02
- Estimated Expiration
- 2044-12-24
AI Technical Summary
Existing face liveness detection methods lack generalization performance when facing new attack methods, and the models are prone to relying on shortcut features, leading to failure in complex scenarios.
A frequency domain shortcut analysis method is adopted, which identifies and removes frequency domain shortcuts through a dynamic frequency domain masking mechanism. Combined with a style suppression modulation mechanism, features with high style information richness are suppressed, thereby improving the generalization performance of the model.
It significantly improves the model's generalization performance in unknown data domains and complex scenarios, reduces overfitting to training data, enhances the ability to explore different frequency bands, and improves the accuracy of face liveness detection.
Smart Images

Figure CN119763173B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of face liveness detection, in particular to a generalizable face liveness detection method based on frequency domain shortcut analysis. BACKGROUND
[0002] Face liveness detection aims to distinguish between live face images and physical presentation attacks (such as print attacks, video replay attacks, 3D mask attacks, etc.), and is a key step in the face recognition process. In daily life, the proliferation of physical presentation attacks can have a serious impact on the credibility of identity verification systems. In order to minimize the impact of physical presentation attacks, it has become increasingly important to develop face liveness detection technology. Early methods follow the traditional image classification pipeline, using convolutional neural networks to extract face features and distinguishing between real and fake faces by optimizing a binary classification loss function. With the advancement of physical technology, various new types of liveness attacks have emerged. These newly emerging attack data may differ significantly from the attack data in the training set in terms of lighting conditions, background environment, and attack methods, etc., resulting in the trained model failing in the test scene. Therefore, how to improve the generalization performance of the model has become a key factor affecting the practical value of the model.
[0003] Existing face liveness detection methods that can generalize can be roughly divided into two categories. ① From the data level. This kind of method mainly expands the diversity of training samples in the training process through data enhancement, feature enhancement and other means to improve the detection ability of the model when facing unknown attack samples. For example, Wang et al. (Wang Z, Wang Z, Yu Z, et al. Domain generalization via shuffled style assembly for face anti-spoofing. In CVPR. 2022) proposed a style exchange component to recombine the style information of samples from two different data domains in the feature space to generate features with diverse style information, alleviating the overfitting of the model to certain style information; ② From the optimization level. This kind of method uses meta learning or domain-adversarial training to learn generalizable features. For example, Liu et al. (Liu S, Zhang K Y, Yao T, et al. Adaptive normalized representation learning for generalizable face anti-spoofing. In ACM MM. 2021) proposed an adaptive feature normalization layer, which updates the parameters of the feature normalization layer through meta learning, so that the feature normalization also has generalization ability when dealing with samples from unknown data domains. For example, Jiang et al. (Jiang F, Li Q, Liu P, et al. Adversarial learning domain-invariant conditional features for robust face anti-spoofing. International Journal of Computer Vision, 2023, 131(7)) proposed a conditional domain adversarial framework, which aims to align the conditional distribution across data domains to learn domain-invariant conditional features. This method has shown good generalization performance in the scene where the training data is limited.
[0004] Although existing methods have improved the generalization performance of face liveness detection to some extent, they often ignore the simplicity bias inherited when training neural networks: the model seeks easy-to-learn representations (also known as shortcut features), which are mainly used to minimize the binary cross-entropy loss on the training data, thus only obtaining a partial understanding of spoofing attacks and may fail in complex scenarios. SUMMARY
[0005] Aiming at the defects in the prior art, the present application aims to provide a generalizable face liveness detection method based on frequency domain shortcut analysis.
[0006] According to one aspect of the present application, a generalizable face liveness detection method based on frequency domain shortcut analysis is provided, comprising:
[0007] inputting a to-be-tested image into a frequency domain reconstruction network to obtain a frequency domain feature retaining details;
[0008] starting a dynamic frequency domain mask mechanism, identifying potential frequency domain shortcuts of the frequency domain feature in a masked manner, and removing the frequency domain shortcuts of the frequency domain feature;
[0009] starting a style suppression mechanism, obtaining the richness of style features along the channel dimension according to the intermediate features obtained by the frequency domain reconstruction network, reducing the importance of the channels corresponding to the richness of the frequency domain features after removing the frequency domain shortcuts, and obtaining style-suppressed features;
[0010] inputting the style-suppressed features into a classifier to obtain a face liveness detection result.
[0011] Preferably, the step of inputting the to-be-tested image into the frequency domain reconstruction network to obtain the frequency domain feature retaining details comprises:
[0012] the to-be-tested image X obtains an encoder intermediate feature E enc through an encoder of the frequency domain reconstruction network dec , the frequency domain feature F output by the encoder obtains a decoder intermediate feature E a through a decoder, and the output is a gray-scale image
[0013] Preferably, the frequency domain reconstruction network is optimized based on an image block-based frequency domain reconstruction loss, specifically:
[0014]
[0015] wherein, is an image blocking operation, the image is divided into P×P blocks, i and j are the coordinates of the image block; is a fast Fourier transform; G(X) is a gray-scale version of the input image, X is the input to-be-tested image, is the output gray-scale image.
[0016] Preferably, the frequency domain reconstruction network is optimized using triplets, specifically:
[0017]
[0018] wherein f is the feature encoder output of the frequency domain reconstruction network, f a ,f p ,fn Anchors, positive samples and negative samples of the triplets are defined; δ(·) = ln(1 + exp(·)) is a softplus function.
[0019] Preferably, the dynamic frequency domain mask mechanism is started to identify potential frequency shortcuts of the frequency domain feature by masking, and remove the frequency shortcuts of the frequency domain feature, comprising:
[0020] Selecting a mask for removing potential frequency shortcuts;
[0021] Applying the selected mask to the input frequency domain feature to obtain the final output of the dynamic frequency domain mask mechanism, i.e., the frequency domain feature with frequency shortcuts removed.
[0022] Preferably, the mask for removing potential frequency shortcuts comprises:
[0023] Dividing the input frequency domain feature into several frequency bands Obtaining each frequency band Containing all frequencies with a distance of i from the lowest frequency L1;
[0024] According to several frequency bands Generate a series of masks The contained frequency is set to 0, otherwise it is set to 1;
[0025] Obtaining a series of masks Apply to the mapping feature of the input frequency domain feature F to obtain the feature F Corresponding to the contained frequency information i :
[0026]
[0027] Calculate F i The corresponding cross-entropy loss
[0028] In the training process, randomly select K frequency domain masks from a series of masks , and obtain different masks according to the above process in turn, and the corresponding cross-entropy loss The mask with the maximum cross-entropy loss is taken as the mask for removing potential frequency shortcuts.
[0029] Preferably, the style suppression mechanism is started to obtain the richness of the style feature along the channel dimension according to the intermediate feature obtained by the frequency domain reconstruction network, reduce the importance of the channels corresponding to the richness of the frequency domain feature after removing the frequency shortcuts, and obtain the style suppressed feature, comprising:
[0030] An encoder intermediate feature E enc and a decoder intermediate feature E dec are calculated to obtain a vector r indicating the richness of style information:
[0031]
[0032] where f θ ,f φ are two 1x1 convolutional layers for projecting E enc ,E dec into the same hidden space, and Pool(·) is a global average pooling;
[0033] Based on the vector r, the importance of the feature channels of the frequency domain features after removing the frequency domain shortcut is reduced, and finally the style-suppressed features F" are obtained:
[0034]
[0035] where σ(·) is a softmax function, and represents a channel-wise product.
[0036] Preferably, the style-suppressed features are input into a classifier to obtain a face liveness detection result, including:
[0037] The style-suppressed features F" are input into a final binary classifier to obtain a predicted attack probability as a face liveness detection result.
[0038] Preferably, the binary classifier is optimized using cross-entropy loss, specifically:
[0039]
[0040] y is an attack label, y = 1 represents an attack sample, and y = 0 represents a real face.
[0041] Preferably, the frequency domain reconstruction network, the dynamic frequency domain mask mechanism, and the style suppression mechanism are sequentially combined to form an overall face liveness detection network.
[0042] The total loss function of the face liveness detection network includes a classification cross-entropy loss a frequency domain reconstruction loss and a triplet loss Specifically:
[0043]
[0044] wherein λ1, λ2 are weight hyperparameters, when the classification cross-entropy loss of the verification set When convergence is reached, the training is stopped, and the optimization parameters of the face living body detection network are obtained.
[0045] Compared with the prior art, the embodiment of the present application has at least one of the following beneficial effects:
[0046] The generative face living body detection method based on frequency domain shortcut analysis in the embodiment of the present application aims to improve the generative performance of face living body detection, and creatively designs a dynamic frequency domain mask (DFM) mechanism to dynamically identify potential frequency domain shortcuts in the model training process and relieve the dependence of the model on these shortcut features through the mask.
[0047] The generative face living body detection method based on frequency domain shortcut analysis in the embodiment of the present application simultaneously introduces a novel style inhibition modulation (SIM) mechanism, calculates the richness of style features along the channel dimension according to the intermediate features of the frequency domain reconstruction network encoder and decoder, and selectively suppresses the feature channels with high style information richness to reduce the influence of style information irrelevant to classification on model decision.
[0048] The generative face living body detection method based on frequency domain shortcut analysis in the embodiment of the present application only relies on image-level binary classification labels for end-to-end training, reducing the dependence on additional annotations (such as face depth map, face reflectivity map, attack category label, etc.). At the same time, a large number of experiments on commonly used academic data sets verify the generative performance of the method of the embodiment of the present application on the face living body detection task. BRIEF DESCRIPTION OF DRAWINGS
[0049] Other features, objects and advantages of the present application will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings:
[0050] Figure 1 is the overall structure diagram of the generative face living body detection based on frequency domain shortcut analysis in an embodiment of the present application, a diagram is a frequency domain reconstruction network, b diagram is a dynamic frequency domain mask (DFM) mechanism, c diagram is a style inhibition modulation (SIM) mechanism;
[0051] Figure 2 is a mask selection process diagram in the dynamic frequency domain mask (Dynamic Frequency Masking, DFM) mechanism in a preferred embodiment of the present application;
[0052] Figure 3 is a data set part sample diagram in a specific embodiment of the present application, left: OULU-NPU right: CASIA-MFSD;
[0053] Figure 4 Fig. 1 shows a part of the dataset used in an embodiment of the application. Left: Idiap Replay-Attack, Right: MSU-MFSD.
[0054] Figure 5 Fig. 2 shows a part of the HQ-WMCA dataset used in an embodiment of the application. DETAILED DESCRIPTION
[0055] The application will be described in further detail below with reference to the embodiments. The following embodiments will contribute to further understanding of the application by those skilled in the art, but are not intended to limit the application in any form. It should be noted that, for those skilled in the art, without departing from the concept of the application, a number of modifications and improvements can be made. These all belong to the protection scope of the application.
[0056] It should be noted that the user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of related data need to comply with relevant regulations.
[0057] Face liveness detection can be essentially regarded as a physical material recognition task for the face (Yu Z, Li X, Niu X, et al. Face anti-spoofing with human material perception. In ECCV. 2020), in which the difference between the real face and the attack sample mainly reflects the subtle difference in the frequency domain features. Based on this, in an embodiment of the application, a generalizable face liveness detection method based on frequency domain shortcut analysis is provided, and the main steps are as follows:
[0058] S1, inputting the to-be-detected image into a frequency domain reconstruction network to obtain a frequency domain feature retaining details;
[0059] S2, starting a dynamic frequency domain mask mechanism, identifying the potential frequency domain shortcut of the frequency domain feature obtained in S1 in a mask manner, and removing the frequency domain shortcut of the frequency domain feature obtained in S1;
[0060] S3, starting a style suppression mechanism, calculating the richness of the style feature along the channel dimension according to the intermediate feature obtained by the frequency domain reconstruction network in S1, reducing the importance of the feature channel corresponding to the richness of the frequency domain feature after removing the frequency domain shortcut, and obtaining a style-suppressed feature;
[0061] S4, inputting the style-suppressed feature in S3 into a classifier to obtain a face liveness detection result.
[0062] The above embodiments, based on frequency domain shortcut analysis, provide a generalizable face liveness detection method. By mitigating the model's dependence on shortcut features in the frequency domain, the generalization performance of the model is improved. Simultaneously, a style suppression mechanism is introduced to suppress feature channels with high style information richness, thereby reducing the impact of classification-irrelevant style information on the model's decisions.
[0063] To preserve as much frequency domain detail as possible during the feature extraction stage to mitigate the overfitting of the model to certain frequency bands that attack features, a preferred embodiment of the present invention employs a frequency domain reconstruction network, such as... Figure 1 As shown in Figure a, the network includes a feature encoder and a feature decoder. Given an image input... The output of the frequency domain reconstruction network is a grayscale image. Grayscale images are used as the output of the frequency domain reconstruction network to reduce the retention of image style information such as hue and saturation, which negatively impact model generalization. During this process, the encoder's intermediate features R are also obtained. enc The frequency domain features F of the encoder output and the intermediate features E of the decoder. dec .
[0064] To emphasize local frequency domain details, in another embodiment of the present invention, a frequency domain reconstruction loss based on image patches is introduced to optimize the frequency domain reconstruction network, specifically:
[0065]
[0066] in, This is an image block division operation (dividing the image into P×P equal blocks), where i,j are the coordinates of the image blocks. This is a Fast Fourier Transform. G(X) is the grayscale version of the input image.
[0067] Meanwhile, to enhance the difference between real faces and attack samples in the feature space, another preferred embodiment of the present invention introduces a triplet loss, defined as:
[0068]
[0069] Where f is the feature encoder output of the frequency domain reconstruction network (after global average pooling), f a ,f p ,f n The anchor, positive sample, and negative sample of the triple are defined. δ(·) = ln(1 + exp(·)) is the softplus function. Simply put, the triple loss... In the feature space, samples of the same category are encouraged to be close together and samples of different categories are encouraged to be far apart, so as to obtain a clearer boundary between real and fake face classification.
[0070] While the frequency-domain reconstruction network proposed in the above embodiments helps to preserve the information of the full frequency band in a comprehensive but rough way, it is still necessary to alleviate the over-dependence of the entire detection model on specific frequency bands in a more specific way, so as to further reduce the impact of shortcut features. To this end, in one preferred embodiment of the present application, a dynamic frequency domain mask mechanism is proposed to dynamically identify the frequency shortcuts of the model at the current training round during the training process, and suppress the features of these shortcut frequency bands to promote the model's attention to a wider frequency band. Specifically, as shown in FIG. b and FIG. c of the drawings, Figure 1 Figure 2 The frequency domain features are divided into several frequency bands to identify shortcut frequency bands, each frequency band contains all frequencies that are i (l1 distance) away from the lowest frequency (i.e. the center frequency band). Thereafter, the dynamic frequency domain mask module will generate a series of masks containing frequency information set to 0 (shallow blue area in FIG. c), or 1 Figure 2 (deep blue area in FIG. c). Figure 2
[0071] In this way, the mask is applied to the input feature map F, that is, the feature F containing the frequency information of i :
[0072]
[0073] After the subsequent network and classification layer, the corresponding cross-entropy loss of F i can be calculated
[0074] During the training process, the dynamic frequency domain mask will randomly select K frequency domain masks, and sequentially obtain different masks corresponding cross-entropy loss
[0075] Finally, the mask with the maximum cross-entropy loss will be considered as the mask that removes the potential frequency shortcut, and this mask will be applied to F to obtain the final output F' of the dynamic frequency domain mask.
[0076] Based on the frequency domain reconstruction network and dynamic frequency mask (DFM) mechanism in the above embodiments, the face liveness detection model is promoted to explore different frequency bands more comprehensively. However, in a real scene, the image style changes such as face collection equipment, lighting conditions, background, etc. will also seriously affect the generalization performance of the face liveness detection method. These stylized information is reflected in different frequency bands, and the main function of DFM is to screen some frequency domain shortcut bands, rather than to optimize the information contained in the frequency band, so DFM may not be able to well suppress this kind of style information. In order to realize style suppression, one preferred embodiment of the present application further proposes a style suppression modulation mechanism, as shown in the c diagram of Figure 1 .
[0077] The style suppression modulation mechanism uses the intermediate features (denoted as E enc ,E dec ) of the encoder and decoder of the frequency domain reconstruction network to calculate a vector r indicating the richness of the style information:
[0078]
[0079] Where f θ ,f φ are two 1x1 convolutional layers used to project E enc ,E dec into the same hidden space, and Pool(·) is the global average pooling. The motivation of this operation is: the encoder of the reconstruction network receives the original color image, which contains complete style information. At the same time, the decoder is responsible for reconstructing the frequency domain information of the grayscale image, which will inevitably lead to the loss of style details. Therefore, by evaluating the difference between the intermediate features E enc ,E dec of the encoder and decoder, the richness of the style information in different feature channels can be measured to some extent: that is, the larger the value of the vector r, the richer the style information encoded in the channel. Then, based on the vector r, the style suppression modulation will reduce the importance of this part of the feature channel, and finally obtain the style-suppressed feature F":
[0080]
[0081] Where σ(·) is the softmax function, and ⊙ represents the channel-by-channel product.
[0082] Here, the value range of r is mapped to the interval (0, 1) by the sigmoid function σ, and then the result is subtracted by 1, denoted as (Therefore, the channel with a larger value in r is a smaller value at the corresponding position of ). F is The intermediate feature F' is multiplied, so that the position of the channel with a larger r value is multiplied by a smaller value, that is, the importance of the corresponding channel is reduced; the position of the channel with a smaller r value is also multiplied by a value less than 1, and then normalized, so the importance is a relative size, not an absolute size. The value of the feature channel with a larger r value after style suppression is smaller than the feature channel with a smaller r value, that is, the purpose of style suppression is achieved.
[0083] After obtaining the style-suppressed feature F'', in a preferred embodiment of the present application, the feature F'' after style suppression will be input into the final binary classifier to obtain the predicted attack probability As the result of face liveness detection.
[0084] Of course, in order to further optimize the classification model, in an embodiment, the predicted attack probability is obtained, and then the cross-entropy loss is calculated according to the corresponding attack label y (y = 1 represents an attack sample, and y = 0 represents a real face) to optimize the classification model, specifically:
[0085]
[0086] Based on the frequency domain reconstruction network, the dynamic frequency domain mask, and the style suppression modulation in the above embodiment, an overall face liveness detection network is formed, and in some specific embodiments of the present application, the face liveness detection network is optimized and trained as a whole, and the specific process is as follows:
[0087] Step 1, constructing a face liveness detection network based on an image classification model, specifically including:
[0088] Step 1.1, obtaining an initial image classification pre-training model (ResNet-18), selecting the first 3 layers of the initial image classification pre-training model as the encoder of the frequency domain reconstruction network, and using a 3-layer network with the same structure but replacing the convolution operation with a transposed convolution operation as the decoder of the frequency domain reconstruction network.
[0089] Step 1.2, connecting the proposed dynamic frequency domain mask (DFM) and style suppression modulation (SIM) after the output of the model frequency domain reconstruction network decoder. Connecting the binary classifier after the style suppression modulation (SIM), and finally outputting the classification probability.
[0090] Step 2, obtaining task training data, which is divided into a training set and a validation set. The task training data includes OULU-NPU, CASIA-MFSD, Idiap Replay-Attack, MSU-MFSD, HQ-WMCA, and other face liveness detection benchmark data sets. After that, the original video data is frame-extracted and face-extracted to obtain face images.
[0091] Step 3. Minimize the loss function defined in the present application on the training set using AdamW optimizer (contains classification cross-entropy loss, frequency domain reconstruction loss and triplet loss) to update network parameters:
[0092]
[0093] where λ1, λ2 are weight hyperparameters, and the default settings of the present application are λ1 = 1.0, λ2 = 0.1. When the classification cross-entropy loss of the validation set converges , stop training, and the optimized parameters of the face liveness detection network are obtained.
[0094] Step 4. Use the trained face liveness detection network to directly test on the test set, and calculate the commonly used indicators of image classification tasks, such as accuracy (Accuracy, ACC) and area under curve (Area under Curve, AUC).
[0095] To verify the feasibility and effectiveness of the generalizable face liveness detection method based on frequency domain shortcut analysis in the above embodiment, in a specific embodiment, any three of the four data sets OULU-NPU (denoted as O), CASIA-MFSD (denoted as C), Idiap Replay-Attack (denoted as I), and MSU-MFSD (denoted as M) (partial samples are shown in Figure 3 and Figure 4 ) are selected as training data, and the remaining one is used as test data for generalization test to verify the generalization performance of the method of the present embodiment in the cross-data domain scenario.
[0096] Table 1 compares the generalization performance of the present face liveness detection method in the cross-data set test scenario.
[0097]
[0098] The experimental results are shown in Table 1. The method of the present embodiment achieves similar or even higher generalization performance than existing methods in four separate generalization tests, and achieves the optimal classification indicators on average. This result verifies that the method of the present embodiment reduces the overfitting of the model to the training data by alleviating the model's dependence on the frequency domain shortcut, significantly improving the generalization performance of the model on unknown data domains.
[0099] In another specific embodiment, any seven attack categories and real face data in the HQ-WMCA data set are selected as training data, and the remaining one attack category and real face data are used as test data for cross-attack category test to verify the generalization performance of the present embodiment in dealing with unknown attack categories.
[0100] Table 2. Comparison of classification error rates of the present face liveness detection method and existing methods in the cross-attack category test scenario.
[0101]
[0102] In Table 2, Flex. corresponds to a flexible mask attack, Glasses corresponds to a glasses attack, Makeup corresponds to a makeup attack, Mann. corresponds to a mannequin attack, Paper. corresponds to a paper mask attack, Rigid. corresponds to a rigid mask attack, and Tattoo represents a tattoo attack, and Replay represents a video replay attack. Figure 5 Some examples of the dataset are shown. According to the experimental results in Table 2, the method of the embodiment of the present application achieves the lowest error rate on average, verifying that the method can still maintain good generalization performance when dealing with unknown attack categories. It is worth noting that the dataset contains not only common video replay attacks (Replay), but also the latest 3D mask attacks (such as flexible mask Flex. and rigid mask Rigid., etc.). This shows that the method of the embodiment of the present application can also have good detection ability when dealing with more realistic attack methods.
[0103] Further, in other specific embodiments, the sub-attack category data in the CASIA-MFSD, Idiap Replay-Attack, and MSU-MFSD datasets are selected for simultaneous cross-dataset and cross-attack category generalization tests to verify the generalization performance of the embodiment of the present application in more complex test scenarios.
[0104] Table 3. Comparison of generalization performance of the present face liveness detection method and existing methods in the cross-dataset and cross-attack category test scenario.
[0105]
[0106] In Table 3, in addition to the average results, the results in each column represent the AUC index when using different attack category data from the other two datasets for training and testing on the corresponding attack category of the current dataset. For example, the result of Video under CASIA-MFSD indicates that the model is trained using the Photo attack category (with real human faces) data of Replay-Attack and MSU-MFSD two datasets as the training set, and directly tested on the Video attack category (with real human faces) data of CASIA-MFSD. In this challenging test scenario, the method of the embodiment of the present application achieves a significant improvement in generalization performance on average. This result shows the application prospect and value of the method of the embodiment of the present application in complex test environments for face liveness detection.
[0107] The specific embodiments of the present application are described above. It needs to be understood that the present application is not limited to the specific embodiments described above, and various modifications or changes can be made by those skilled in the art within the scope of the claims, which does not affect the essential content of the present application. The above preferred features can be combined in any manner without conflict, and used.
Claims
1. A generalizable face liveness detection method based on frequency domain shortcut analysis, characterized in that, The method comprises the following steps: inputting a to-be-tested image into a frequency domain reconstruction network to obtain a frequency domain feature retaining details; starting a dynamic frequency domain mask mechanism to identify potential frequency domain shortcuts of the frequency domain feature in a mask manner, and removing the frequency domain shortcuts of the frequency domain feature; starting a style suppression mechanism to obtain richness of style features along a channel dimension according to intermediate features obtained by the frequency domain reconstruction network, reducing importance of channels corresponding to the richness in the frequency domain feature after the frequency domain shortcuts are removed, and obtaining style-suppressed features; inputting the style-suppressed features into a classifier to obtain a face liveness detection result; The starting of the dynamic frequency domain mask mechanism to identify potential frequency domain shortcuts of the frequency domain feature in a mask manner and remove the frequency domain shortcuts of the frequency domain feature comprises: selecting a mask for removing potential frequency shortcuts; applying the selected mask to the input frequency domain feature to obtain the final output of the dynamic frequency domain mask mechanism, i.e., the frequency domain feature from which the frequency domain shortcuts are removed; The selection of the mask for removing potential frequency shortcuts comprises: dividing the input frequency domain feature into several frequency bands each frequency band obtained contains all frequencies with distance i from the lowest frequency L1 According to several of the frequency bands Generating a series of masks The included frequency is set to 0, otherwise to 1; the obtained series of masks a mapping feature applied to the frequency domain feature F inputted, resulting in a removal a feature F corresponding containing frequency information i : F is calculated i Corresponding cross-entropy loss During training, from a series of masks K frequency domain masks are randomly selected from the data, and different masks are obtained by following the above process. Corresponding cross-entropy loss The mask that yields the maximum cross-entropy loss As a mask used to remove potential frequency shortcuts.
2. The generalizable face liveness detection method based on frequency domain shortcut analysis according to claim 1, characterized in that, The inputting of the to-be-tested image into the frequency domain reconstruction network to obtain the frequency domain feature retaining details comprises: The to-be-tested image X obtains the encoder intermediate feature E through the encoder of the frequency domain reconstruction network enc The frequency domain feature F output by the encoder obtains the decoder intermediate feature E through the decoder dec The output is a grayscale image 3. The generalizable face liveness detection method based on frequency domain shortcut analysis according to claim 2, characterized in that, The frequency domain reconstruction network is optimized based on an image block frequency domain reconstruction loss, specifically: wherein, is the image blocking operation, the image is divided into P x P blocks, i, j are the coordinates of the image block; is the fast Fourier transform; G(X) is the grayscale version of the input image, X is the input image to be measured, is the output grayscale image.
4. The generalizable face liveness detection method based on frequency domain shortcut analysis according to claim 2, characterized in that, The frequency domain reconstruction network is optimized based on a triplet, specifically: where f is the feature encoder output of the frequency domain reconstruction network, f a p n Anchors, positive samples and negative samples of triplets are defined; δ(·) = ln(l + exp(·)) is the softplus function. 5. The generalizable face liveness detection method based on frequency domain shortcut analysis according to claim 1, characterized in that, The starting of the style suppression mechanism to obtain the richness of the style features along the channel dimension according to the intermediate features obtained by the frequency domain reconstruction network, reduce the importance of the channels corresponding to the richness in the frequency domain feature after the frequency domain shortcuts are removed, and obtain the style-suppressed features comprises: an encoder intermediate feature e of the frequency domain reconstruction network enc , and a decoder intermediate feature E dec , a vector r indicating the richness of style information is calculated: where f θ ,f φ are two 1 x 1 convolutional layers for projecting E enc ,E dec into a same hidden space, Pool(·) is a global average pooling; based on the vector r, reducing the importance of the feature channels corresponding to the frequency domain shortcuts in the frequency domain feature, and finally obtaining the style-suppressed features F'': wherein σ(·) is a softmax function, and represents a channel-by-channel multiplication.
6. The generalizable face liveness detection method based on frequency domain shortcut analysis according to claim 5, characterized in that, The inputting of the style-suppressed features into the classifier to obtain the face liveness detection result comprises: input the feature F" after style suppression to the final binary classifier to obtain a predicted attack probability as a face liveness detection result.
7. The generalizable face liveness detection method based on frequency domain shortcut analysis according to claim 6, characterized in that, The binary classifier is optimized based on a cross-entropy loss, specifically: y is an attack label, y=1 represents an attack sample, and y=0 represents a real face.
8. The generalizable face liveness detection method based on frequency domain shortcut analysis according to claim 1, characterized in that, The frequency domain reconstruction network, the dynamic frequency domain mask mechanism, and the style suppression mechanism are sequentially combined to constitute a whole face liveness detection network. The total loss function of the face living body detection network Including a classification cross-entropy loss A frequency domain reconstruction loss And a triplet loss Specifically: wherein λ1, λ2 are weight hyperparameters, and when the classification cross-entropy loss of the verification set When convergence is reached, the training is stopped, and the optimized parameters of the face living body detection network are obtained.
Citation Information
Patent Citations
Social network deep counterfeit video detection method and system based on spatial-temporal characteristics
CN117523439A
Generalized face forgery detection method based on field robust representation learning
CN118506460A