Face liveness detection method and system
By combining the central difference convolution module and the Swing Transformer model, global and local information of the face is extracted. Key information is enhanced by bottleneck attention and adaptive feature fusion modules, which solves the problems of insufficient detection accuracy and generalization performance in existing methods and achieves higher detection accuracy and robustness.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHN ENERGY NEW ENERGY TECHNOLOGY RESEARCH INSTITUTE CO LTD
- Filing Date
- 2023-11-27
- Publication Date
- 2026-07-17
AI Technical Summary
Existing face liveness detection methods cannot effectively combine global and local information of face images, resulting in low detection accuracy and poor generalization performance, especially when facing unknown types of fraud attacks.
By combining the central difference convolution module and the Swin Transformer model, local facial information is extracted through the central difference convolution module, global information is extracted through the Swin Transformer model, and a bottleneck attention module is introduced to enhance key information. Finally, information from different stages is fused through an adaptive feature fusion module.
It improves the detection accuracy and generalization ability of face liveness detection, enabling it to more effectively deal with unknown attacks and enhancing the robustness and detection accuracy of the model.
Smart Images

Figure CN117877128B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image recognition technology, specifically to a face liveness detection method and a face liveness detection system. Background Technology
[0002] In recent years, with the development of facial recognition technology, face liveness detection has become a crucial guarantee for facial recognition. The difference between fraudulent faces and real faces lies in the local details of key facial regions (eyes, nose, mouth). Fraudulent faces cannot replicate the local texture features of real faces, thus becoming an important basis for distinguishing between real and fake faces. Currently, mainstream face liveness detection methods are divided into two categories: methods based on manual feature extraction and methods based on deep learning. Methods based on manual feature extraction manually design feature operators based on differences in color, texture, material, image quality, and motion variations of facial images. However, as the quality of fraudulent face images gradually improves, the extraction performance of feature operators becomes significantly insufficient, causing a decline in the performance of such methods. Deep learning-based methods initially used convolutional neural network models to extract facial features and make judgments, achieving excellent results in most public dataset tests. However, due to the limited receptive field of convolutional neural networks, the model ignores global facial information, affecting model performance. Therefore, the Transformer model was introduced into the field of face liveness detection. The Transformer model possesses excellent global information extraction capabilities, demonstrating competitiveness in face liveness detection. However, its insufficient local information extraction ability prevents it from capturing subtle differences between real and fake faces. In practical applications, facing unknown types of fraud attacks, methods based on convolutional neural networks and Transformers, due to their respective limitations, cannot extract the inherent differences between real and fake faces, resulting in low detection accuracy and poor generalization performance. Therefore, there is an urgent need for a method that effectively combines global and local information from face images, fully utilizing information at different scales of the face to improve detection accuracy and generalization ability in the face of unknown attacks. Summary of the Invention
[0003] The purpose of this invention is to provide a face liveness detection method and system, so as to at least solve the problem that existing face recognition schemes cannot extract the inherent differences between real and fake faces, resulting in low detection accuracy and poor generalization performance.
[0004] To achieve the above objectives, the first aspect of the present invention provides a face liveness detection method, the method comprising: acquiring video image information containing face information, and obtaining frame image information based on the video image information; extracting face images from the frame image information, and constructing a dataset based on the face images; training the dataset based on a pre-trained face liveness recognition model to obtain a recognition result; wherein the face liveness recognition model is trained based on an improved SwingTransformer model; and determining whether the current face is live based on the recognition result, and outputting the determination result.
[0005] Optionally, obtaining frame image information based on the video image information includes: identifying video segments containing facial information in the video image; and performing frame extraction processing on the video segments based on a preset time period to obtain multiple frame image information.
[0006] Optionally, the step of extracting a face image from the frame image information includes: performing face detection in the frame image information based on the MTCNN algorithm; and based on the detection results, extracting the face region according to a preset extraction box size to obtain the extracted face image.
[0007] Optionally, the step of constructing a dataset based on face images includes: extracting face images from each frame of image information to obtain multiple face images; and constructing a dataset based on the multiple face images.
[0008] Optionally, the method further includes: training a face liveness recognition model, including: collecting historical image information containing face annotation states to construct a basic dataset; performing image preprocessing on the basic dataset to obtain training samples including a training set and a test set; training the model in a pre-constructed Swin Transformer model based on the training set to obtain an initial model; and testing and correcting the initial model based on the test set to obtain a face liveness recognition model.
[0009] Optionally, the method further includes: constructing a Swing Transformer model, including: constructing a central difference convolutional module before the Swing Transformer module to obtain a backbone model; introducing a bottleneck attention module on the backbone model to obtain a perceptual model; and constructing a corresponding adaptive feature fusion module on the output side of the perceptual model to obtain a Swing Transformer model.
[0010] Optionally, the execution rule of the central difference convolution module is as follows:
[0011]
[0012] Where x and y are the input and output feature maps of the central difference convolution, respectively; Indicates the current position of the input feature map; The location within the central region R; For convolution kernel; This is a hyperparameter.
[0013] Optionally, the execution rules of the adaptive feature fusion module include: performing global average pooling on the feature information output from different stages of the model; and fusing multiple feature information at different scales after global average pooling into a single feature information, with the specific rules being:
[0014]
[0015]
[0016] in, , , , For feature information at different scales; The fused feature information; , , , These represent the weights corresponding to the feature information; , To initialize the weight coefficients.
[0017] A second aspect of the present invention provides a face liveness detection system, the system comprising: an acquisition unit for acquiring video image information containing face information and obtaining frame image information based on the video image information; a cropping unit for cropping face images from the frame image information and constructing a dataset based on the face images; a training unit for training the dataset based on a pre-trained face liveness recognition model to obtain recognition results; wherein the face liveness recognition model is trained based on an improved Swin Transformer model; and an output unit for determining whether the current face is live based on the recognition results and outputting the determination result.
[0018] On the other hand, the present invention provides a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the above-described face liveness detection method.
[0019] Through the above technical solution, the present invention combines the central difference convolution module with the Swin Transformer model. The central difference convolution module is used to extract local facial information, and the Swin Transformer model is used to extract global facial information. At the same time, a bottleneck attention module is introduced to enhance the extracted key facial information and remove redundancy. Finally, the adaptive feature fusion module is used to fuse information from different stages of the backbone model, which can effectively improve the detection accuracy and generalization ability of the model in the face of unknown attacks.
[0020] Other features and advantages of the embodiments of the present invention will be described in detail in the following detailed description section. Attached Figure Description
[0021] The accompanying drawings are provided to further illustrate embodiments of the present invention and form part of the specification. They are used together with the following detailed description to explain the embodiments of the present invention, but do not constitute a limitation thereof. In the drawings:
[0022] Figure 1 This is a flowchart of the steps of a face liveness detection method provided in one embodiment of the present invention;
[0023] Figure 2 This is a structural diagram of the central difference operator provided in one embodiment of the present invention;
[0024] Figure 3 This is a system structure diagram of a face liveness detection system provided in one embodiment of the present invention. Detailed Implementation
[0025] The specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are for illustration and explanation only and are not intended to limit the present invention.
[0026] In recent years, with the development of facial recognition technology, face liveness detection has become a crucial guarantee for facial recognition. The difference between fraudulent faces and real faces lies in the local details of key facial regions (eyes, nose, mouth). Fraudulent faces cannot replicate the local texture features of real faces, thus becoming an important basis for distinguishing between real and fake faces. Currently, mainstream face liveness detection methods are divided into two categories: methods based on manual feature extraction and methods based on deep learning. Methods based on manual feature extraction manually design feature operators based on differences in color, texture, material, image quality, and motion variations of facial images. However, as the quality of fraudulent face images gradually improves, the extraction performance of feature operators becomes significantly insufficient, causing a decline in the performance of such methods. Deep learning-based methods initially used convolutional neural network models to extract facial features and make judgments, achieving excellent results in most public dataset tests. However, due to the limited receptive field of convolutional neural networks, the model ignores global facial information, affecting model performance. Therefore, the Transformer model was introduced into the field of face liveness detection. The Transformer model possesses excellent global information extraction capabilities, demonstrating competitiveness in face liveness detection. However, its insufficient local information extraction ability prevents it from capturing subtle differences between real and fake faces. In practical applications, facing unknown types of fraud attacks, methods based on convolutional neural networks and Transformers, due to their respective limitations, cannot extract the inherent differences between real and fake faces, resulting in low detection accuracy and poor generalization performance. Therefore, there is an urgent need for a method that effectively combines global and local information from face images, fully utilizing information at different scales of the face to improve detection accuracy and generalization ability in the face of unknown attacks.
[0027] To address the aforementioned problems, this invention proposes a novel face liveness detection method and system. This invention combines a central difference convolution module with a Swing Transformer model. The central difference convolution module extracts local face information, while the Swing Transformer model extracts global face information. Simultaneously, a bottleneck attention module is introduced to enhance the extracted key face information and remove redundancy. Finally, an adaptive feature fusion module fuses information from different stages of the backbone model, effectively improving the model's detection accuracy and generalization ability in the face of unknown attacks.
[0028] Figure 1 This is a flowchart of a face liveness detection method provided in one embodiment of the present invention. Figure 1 As shown, an embodiment of the present invention provides a face liveness detection method, the method comprising:
[0029] Step S10: Collect video image information containing facial information, and obtain frame image information based on the video image information.
[0030] Specifically, in real life, the need for identity verification and authentication based on facial information requires the identification of facial features to ensure the legitimate identity of the person in question. Therefore, ensuring that the facial information of the person in question is a live face is essential. If it is impossible to distinguish between a live face and an image face, leading to the misidentification of an image face as legitimate facial information and failing to pass the corresponding identity verification, it can easily cause security problems.
[0031] Preferably, in order to deal with common live face recognition scenarios, facial video information is collected based on the user's handheld terminal, a preset face acquisition device, etc., and then user face recognition is performed based on the collected facial video information.
[0032] Preferably, obtaining frame image information based on the video image information includes: identifying video segments containing facial information in the video image; and performing video image frame extraction processing in the video segments based on a preset time period to obtain multiple frame image information.
[0033] In this embodiment of the invention, the solution of the invention synchronously acquires multiple frame images in a video image based on a preset time period, thereby avoiding distortion of a single frame image due to lighting, equipment, or other reasons, avoiding accidental errors in subsequent face recognition, and ensuring recognition accuracy.
[0034] In another possible implementation, each frame of the video is read, and the video is extracted according to a preset number of frames to obtain a single frame image.
[0035] Step S20: Extract face images from the frame image information and construct a dataset based on the face images.
[0036] Specifically, face detection is performed on the frame image information based on the MTCNN (Multi-task Cascaded Convolutional Networks) algorithm; based on the detection results, the face region is cropped according to the preset cropping box size to obtain the cropped face image.
[0037] In this embodiment of the invention, the MTCNN algorithm is a deep learning-based method for face detection and alignment. It can simultaneously perform face detection and alignment tasks, offering better performance and faster detection speed compared to traditional algorithms. MTCNN is a multi-task network with a cascaded network structure. Its purpose is face detection and facial landmark localization, employing a coarse-to-fine localization process, analogous to using a microscope to locate the cell nucleus—first coarsely adjusting to find the target, then fine-tuning for detailed observation.
[0038] In one possible implementation, the MTCNN algorithm is used to detect faces in the proposed image. The MTCNN algorithm can accurately locate facial key points and extract face images of size 224×224 as the dataset.
[0039] Step S30: Train the dataset based on the pre-trained face liveness recognition model to obtain the recognition results.
[0040] Specifically, the method further includes: training a face liveness recognition model, including: collecting historical image information containing face annotation states to construct a basic dataset; performing image preprocessing on the basic dataset to obtain training samples including a training set and a test set; training the model in a pre-constructed Swin Transformer model based on the training set to obtain an initial model; and testing and correcting the initial model based on the test set to obtain a face liveness recognition model.
[0041] Preferably, the method further includes: constructing a Swing Transformer model, including: constructing a central difference convolutional module before the Swing Transformer module to obtain a backbone model; introducing a bottleneck attention module on the backbone model to obtain a perceptual model; and constructing a corresponding adaptive feature fusion module on the output side of the perceptual model to obtain a Swing Transformer model.
[0042] Specifically, a center difference convolution module is added before each module of the Swin Transformer to combine the extracted local and global facial information. A bottleneck attention module is also added to the Swin Transformer model to remove redundant information, allowing the model to focus more on key facial information. Finally, an adaptive feature fusion module is introduced to fuse information from different stages of the model, improving the utilization rate of the extracted facial information and completing the model construction. The specific steps include:
[0043] Step S301: The Swin Transformer model is selected as the basis. This model has a hierarchical structure and a sliding window attention mechanism, which can effectively extract global facial information. First, the image segmentation module (Patch Partition) divides the RGB face image of size (H,W) into blocks, resulting in image blocks of size (4,4), and flattens them to 48 channels. Second, the linear embedding module performs a linear transformation on the pixel channels of the image, mapping the number of feature map channels from 48 to C. Then, the feature map of size (H / 4,W / 4) and number of channels C is input into the Swin Transformer module for processing. The Swin Transformer module consists of four parts: a window multi-head self-attention layer (W-MSA), a sliding window multi-head self-attention layer (SW-MSA), a normalization layer (LN), and a multilayer perceptron (MLP). The sliding window multi-head self-attention layer achieves information interaction between different windows by cyclically shifting the regular window up and left by a distance of (N / 2,N / 2), thereby traversing global information.
[0044] Step S302: Add a central difference convolution module before the Swin Transformer module. Compared to ordinary convolution, central difference convolution can utilize the gradient information of face images to effectively extract the differences between real and fake faces. For example... Figure 2 As shown, the sampling operation of this operator is the same as that of ordinary convolution, but the aggregation stage focuses more on the center-to-center gradient of the sampled values. The specific formula is as follows:
[0045]
[0046] Where x and y are the input and output feature maps of the central difference convolution, respectively. This indicates the current position of the input feature map. The location within the central region R, For convolution kernel, This is a hyperparameter.
[0047] For the entire central difference convolutional module, since the input data dimension in the Swing Transformer model is different from that in the convolutional neural network, the data dimension input to the central difference convolutional module is transformed from (B,H×W,C) to (B,C,H,W). Then, the resulting data is input into a 1×1 convolutional layer, reducing the number of channels to C / 4, and then local features are extracted through a 3×3 central difference convolution. Finally, the dimension is restored through a 1×1 convolutional layer. At the same time, residual connections are added to prevent model degradation, and a normalization layer and ReLU activation function are added after each convolutional layer to improve the stability of the model.
[0048] Step S303: Introduce a bottleneck attention module at the bottleneck of the backbone model to guide the model to focus on key facial information and accelerate model training. The bottleneck attention module consists of a channel attention mechanism. Spatial attention mechanism Parallel composition. Input feature map. The bottleneck attention mechanism generates the corresponding three-dimensional feature response. The output feature map is obtained by multiplying it element-wise with the original input and then adding them together. The specific formula is as follows:
[0049]
[0050] in Depend on and The summation is then obtained using the Swish nonlinear excitation function, as shown in the following formula:
[0051]
[0052] The details of the channel attention mechanism and the spatial attention mechanism are as follows:
[0053] 1) The channel attention branch aims to reduce stray signals irrelevant to real / fake face recognition and enhance the weights of key channels. Input feature map First, global average pooling is performed, and then a multilayer perceptron (MLP) with hidden layers is used to estimate the attention weights for each channel. The neuron size in the hidden layer is set to... r represents the compression ratio; finally, batch normalization is used to readjust the output size to the input size, as shown in the following formula:
[0054]
[0055] in , , , .
[0056] 2) Spatial Attention Branch: This branch aims to directionally enhance the weights of key facial features. It employs dilated convolutions to expand the receptive field, capturing highly discriminative regions from the image context, thereby enhancing feature extraction capabilities. Specifically, the input feature map... First, it is adjusted by a 1×1 convolution. Then, two layers of 3×3 dilated convolutions are used to extract contextual information. Finally, a 1×1 convolution and batch normalization operation are used to restore the size to the input size. The specific formula is as follows:
[0057]
[0058] in represents the convolution operation, i represents the i-th layer, and j×j is the convolution kernel size.
[0059] Step S304: Since the Swin Transformer face liveness detection model is insufficient in the semantic description of shallow face feature maps and the perception of details in deep face feature maps, resulting in the loss of face detail information, the information of different scales obtained from the four stages of the Swin Transformer model is combined and input into the adaptive feature fusion module to improve the utilization rate of face information and enhance the generalization ability of the model.
[0060] Specifically, the adaptive feature fusion module first performs global average pooling on the feature information output from different stages of the backbone model, and then combines the resulting feature information at four different scales. , , , merge into The calculation formula is as follows:
[0061]
[0062]
[0063] in , , , These represent the weights corresponding to the feature information. , To initialize the weight coefficients.
[0064] Step S40: Based on the recognition result, determine whether the current face is a live object and output the determination result.
[0065] Specifically, based on the recognition results, it is determined whether the facial information in the current video is a live face, in order to determine whether the person currently verifying their identity is the actual person. In possible application scenarios, if the current facial information is identified as not being a live face, the current video is marked and an alarm message is output for relevant regulatory personnel to review.
[0066] In this embodiment of the invention, the improved Swin Transformer model achieves higher detection accuracy on multiple public datasets. Facing the OULU-NPU dataset with various unknown attack types, the improved Swin Transformer model can make correct judgments, demonstrating higher detection accuracy and stronger robustness. In cross-database tests on the CASIA-MFSD and REPLAY-ATTACK datasets, which are more relevant to real-world applications, the Swin Transformer model performs exceptionally well, exhibiting higher detection accuracy and demonstrating its generalization ability.
[0067] Figure 3 This is a system structure diagram of a face liveness detection system provided in one embodiment of the present invention. Figure 3 As shown, an embodiment of the present invention provides a face liveness detection system, the system comprising:
[0068] The acquisition unit is used to acquire video image information containing facial information and obtain frame image information based on the video image information.
[0069] Specifically, in real life, the need for identity verification and authentication based on facial information requires the identification of facial features to ensure the legitimate identity of the person in question. Therefore, ensuring that the facial information of the person in question is a live face is essential. If it is impossible to distinguish between a live face and an image face, leading to the misidentification of an image face as legitimate facial information and failing to pass the corresponding identity verification, it can easily cause security problems.
[0070] Preferably, in order to deal with common live face recognition scenarios, facial video information is collected based on the user's handheld terminal, a preset face acquisition device, etc., and then user face recognition is performed based on the collected facial video information.
[0071] Preferably, obtaining frame image information based on the video image information includes: identifying video segments containing facial information in the video image; and performing video image frame extraction processing in the video segments based on a preset time period to obtain multiple frame image information.
[0072] In this embodiment of the invention, the solution of the invention synchronously acquires multiple frame images in a video image based on a preset time period, thereby avoiding distortion of a single frame image due to lighting, equipment, or other reasons, avoiding accidental errors in subsequent face recognition, and ensuring recognition accuracy.
[0073] In another possible implementation, each frame of the video is read, and the video is extracted according to a preset number of frames to obtain a single frame image.
[0074] The cropping unit is used to crop facial images from the frame image information and construct a dataset based on the facial images.
[0075] Specifically, face detection is performed on the frame image information based on the MTCNN (Multi-task Cascaded Convolutional Networks) algorithm; based on the detection results, the face region is cropped according to the preset cropping box size to obtain the cropped face image.
[0076] In this embodiment of the invention, the MTCNN algorithm is a deep learning-based method for face detection and alignment. It can simultaneously perform face detection and alignment tasks, offering better performance and faster detection speed compared to traditional algorithms. MTCNN is a multi-task network with a cascaded network structure. Its purpose is face detection and facial landmark localization, employing a coarse-to-fine localization process, analogous to using a microscope to locate the cell nucleus—first coarsely adjusting to find the target, then fine-tuning for detailed observation.
[0077] In one possible implementation, the MTCNN algorithm is used to detect faces in the proposed image. The MTCNN algorithm can accurately locate facial key points and extract face images of size 224×224 as the dataset.
[0078] The training unit is used to train the dataset based on the pre-trained face liveness recognition model to obtain recognition results; wherein the face liveness recognition model is trained based on the improved Swing Transformer model.
[0079] Specifically, the method further includes: training a face liveness recognition model, including: collecting historical image information containing face annotation states to construct a basic dataset; performing image preprocessing on the basic dataset to obtain training samples including a training set and a test set; training the model in a pre-constructed Swin Transformer model based on the training set to obtain an initial model; and testing and correcting the initial model based on the test set to obtain a face liveness recognition model.
[0080] Preferably, the method further includes: constructing a Swing Transformer model, including: constructing a central difference convolutional module before the Swing Transformer module to obtain a backbone model; introducing a bottleneck attention module on the backbone model to obtain a perceptual model; and constructing a corresponding adaptive feature fusion module on the output side of the perceptual model to obtain a Swing Transformer model.
[0081] Specifically, a central difference convolution module is added before each module of the Swin Transformer to combine the extracted local facial information with global information. At the same time, a bottleneck attention module is added to the Swin Transformer model to remove redundant information and make the model pay more attention to key facial information. Finally, an adaptive feature fusion module is introduced to fuse information from different stages of the model, improve the utilization rate of the extracted facial information, and complete the model construction.
[0082] The output unit is used to determine whether the current face is a live person based on the recognition result, and output the determination result.
[0083] Specifically, based on the recognition results, it is determined whether the facial information in the current video is a live face, in order to determine whether the person currently verifying their identity is the actual person. In possible application scenarios, if the current facial information is identified as not being a live face, the current video is marked and an alarm message is output for relevant regulatory personnel to review.
[0084] In this embodiment of the invention, the improved Swin Transformer model achieves higher detection accuracy on multiple public datasets. Facing the OULU-NPU dataset with various unknown attack types, the improved Swin Transformer model can make correct judgments, demonstrating higher detection accuracy and stronger robustness. In cross-database tests on the CASIA-MFSD and REPLAY-ATTACK datasets, which are more relevant to real-world applications, the Swin Transformer model performs exceptionally well, exhibiting higher detection accuracy and demonstrating its generalization ability.
[0085] The present invention also provides a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the aforementioned xx.
[0086] Those skilled in the art will understand that all or part of the steps in the methods of the above embodiments can be implemented by a program instructing related hardware. This program is stored in a storage medium and includes several instructions to cause a microcontroller, chip, or processor to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0087] The optional embodiments of the present invention have been described in detail above with reference to the accompanying drawings. However, the embodiments of the present invention are not limited to the specific details described above. Within the scope of the technical concept of the embodiments of the present invention, various simple modifications can be made to the technical solutions of the embodiments of the present invention, and these simple modifications all fall within the protection scope of the embodiments of the present invention. It should also be noted that the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. To avoid unnecessary repetition, the embodiments of the present invention will not further describe the various possible combinations.
[0088] Furthermore, various different embodiments of the present invention can be combined in any way, as long as they do not violate the spirit of the embodiments of the present invention, they should also be regarded as the content disclosed by the embodiments of the present invention.
Claims
1. A method for detecting human face liveness, characterized in that, The method includes: Collect video image information containing facial information, and obtain frame image information based on the video image information; In the frame image information, facial images are extracted, and a dataset is constructed based on the facial images; The dataset is trained based on a pre-trained face liveness detection model to obtain recognition results; wherein... The face liveness recognition model is trained based on an improved Swing Transformer model; The training rules for training the face liveness recognition model include: collecting historical image information containing face annotation states to construct a basic dataset; performing image preprocessing on the basic dataset to obtain training samples including a training set and a test set; training the model on a pre-constructed Swin Transformer model based on the training set to obtain an initial model; and testing and correcting the initial model based on the test set to obtain the face liveness recognition model. The improved Swin Transformer model includes: The module consists of a Swin Transformer module, a central difference convolution module, a bottleneck attention module, and an adaptive feature fusion module; among which... The construction rules of the Swin Transformer model include: building a central difference convolutional module before the Swin Transformer module to obtain the backbone model; introducing a bottleneck attention module on the backbone model to obtain the perceptual model; and building a corresponding adaptive feature fusion module on the output side of the perceptual model to obtain the Swin Transformer model. Based on the recognition results, determine whether the current face is a live object and output the result.
2. The method according to claim 1, characterized in that, The step of obtaining frame image information based on the video image information includes: Identify video segments containing facial information within video images; Within the video segment, based on a preset time period, video image frame extraction processing is performed to obtain multiple frame image information.
3. The method according to claim 1, characterized in that, The step of extracting a face image from the frame image information includes: Face detection is performed on frame image information based on the MTCNN algorithm; Based on the detection results, the face region is cropped according to the preset cropping box size to obtain the cropped face image.
4. The method according to claim 2, characterized in that, The dataset constructed based on face images includes: Multiple face images are obtained by cropping face images from each frame of image information; The dataset is composed of multiple face images.
5. The method according to claim 1, characterized in that, The execution rules of the central difference convolution module are as follows: Where x and y are the input and output feature maps of the central difference convolution, respectively; Indicates the current position of the input feature map; The location within the central region R; For convolution kernel; This is a hyperparameter.
6. The method according to claim 1, characterized in that, The execution rules of the adaptive feature fusion module include: Global average pooling is performed on the feature information output at different stages of the model. The feature information from multiple different scales after global average pooling is fused into a single feature information, and the specific rules are as follows: in, , , , For feature information at different scales; The fused feature information; , , , These represent the weights corresponding to the feature information; , To initialize the weight coefficients.
7. A face liveness detection system, characterized in that, The system is used to perform the face liveness detection method according to any one of claims 1-6, and the system comprises: The acquisition unit is used to acquire video image information containing facial information and obtain frame image information based on the video image information; The cropping unit is used to crop face images from the frame image information and construct a dataset based on the face images; The training unit is used to train the dataset based on a pre-trained face liveness recognition model to obtain recognition results; wherein, The face liveness recognition model is trained based on an improved Swing Transformer model; The improved Swin Transformer model includes: The module consists of the Swin Transformer module, the central difference convolution module, the bottleneck attention module, and the adaptive feature fusion module. The output unit is used to determine whether the current face is a live person based on the recognition result, and output the determination result.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores instructions that, when executed on a computer, cause the computer to perform the face liveness detection method according to any one of claims 1-6.