Living body detection method and device, electronic equipment and storage medium

By combining adaptive pooling to process global features and region information of the image to be detected, the accuracy of existing liveness detection models is reduced due to spoofing attacks and image scale changes, thus achieving high-precision and fast liveness detection.

CN116912952BActive Publication Date: 2026-02-24CHINA MOBILEHANGZHOUINFORMATION TECH CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211456436.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-21
Publication Date
2026-02-24
Estimated Expiration
2042-11-21

AI Technical Summary

Technical Problem

Existing liveness detection methods suffer from a significant decrease in model accuracy when faced with attacks from proxies that are outside the range of manually designed features. Furthermore, due to feature changes caused by image scale variations, existing technologies have failed to effectively address this issue.

Method used

An adaptive average pooling and adaptive max pooling approach is adopted. The first and second models are used to process the global features and regional information of the image to be detected, respectively, to avoid image scale transformation and adapt to images of any size. The liveness detection result is determined by combining the classification model.

Benefits of technology

It improves the accuracy and speed of liveness detection, reduces computational load, avoids distortion and feature information shift caused by image scale transformation, and enhances the robustness and smoothness of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116912952B_ABST
    Figure CN116912952B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a kind of living body detection method, device, electronic equipment and storage medium.Therein, the method comprises: obtaining the first image corresponding to at least one size of the picture to be detected;First model is based on the first image processing, obtain the global feature information corresponding to the first image;Second model is based on the first image processing, obtain the first area information corresponding to the first image;The first model is different from the second model;According to the global feature information and the first area information, determine the living body detection result corresponding to the first image.No need to scale or adjust to uniform size to the picture to be detected, by first model and second model to the first image corresponding to at least one size processing, it can adapt to any size of the picture to be detected, avoid the distortion caused in picture scale transformation, feature information offset and other influences, with high precision, fast, less computing quantity and other advantages.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to computer vision technology, specifically to a liveness detection method, apparatus, electronic device, and storage medium. Background Technology

[0002] Limited by manually designed features, liveness detection methods suffer significant accuracy drops when encountering spoofing attacks outside the range of human experience-based features. Currently, deep learning-based liveness detection techniques first detect face regions in the input image, then input these face region images into a liveness detection algorithm model. To adapt to the model's input and output, the face region images typically need to be padded, cropped, or scaled to a uniform input size. Scale transformations distort the image's shape, altering its features and reducing model output accuracy. Currently, there is no effective solution to this problem. Summary of the Invention

[0003] In view of this, the main objective of the present invention is to provide a method, apparatus, electronic device and storage medium for detecting live organisms.

[0004] To achieve the above objectives, the technical solution of the present invention is implemented as follows:

[0005] This invention provides a method for detecting live organisms, the method comprising:

[0006] Obtain a first image corresponding to at least one size of the image to be detected;

[0007] The first image is processed based on the first model to obtain the global feature information corresponding to the first image;

[0008] The first image is processed based on the second model to obtain the first region information corresponding to the first image; the first model is different from the second model.

[0009] Based on the global feature information and the first region information, the liveness detection result corresponding to the first image is determined.

[0010] In the above scheme, determining the liveness detection result corresponding to the first image based on the global feature information and the first region information includes:

[0011] The global feature information and the first region information are fused to obtain the target information corresponding to the first image;

[0012] The target information is processed based on a classification model to determine the liveness detection result corresponding to the first image.

[0013] In the above scheme, the step of processing the first image based on the first model to obtain the global feature information corresponding to the first image includes:

[0014] The first image is processed based on the first model to obtain the first feature information;

[0015] The first feature information is processed based on each branch model in at least one branch model to obtain at least one first data corresponding to the first feature information;

[0016] Compress at least one first data corresponding to the first feature information to obtain at least one second data corresponding to the first feature information;

[0017] At least one second data corresponding to the first feature information is adjusted to obtain at least one third data corresponding to the first feature information.

[0018] Global feature information corresponding to the first image is determined based on at least one third data corresponding to the first feature information.

[0019] In the above scheme, the step of processing the first image based on the second model to obtain the first region information corresponding to the first image includes:

[0020] The first image is processed based on the second model to obtain the second feature information;

[0021] The second feature information is processed based on each branch model in at least one branch model to obtain at least one first data corresponding to the second feature information;

[0022] Compress at least one first data corresponding to the second feature information to obtain at least one second data corresponding to the second feature information;

[0023] At least one second data corresponding to the second feature information is adjusted to obtain at least one third data corresponding to the second feature information.

[0024] Based on at least one third data corresponding to the second feature information, the first region information corresponding to the first image is determined.

[0025] In the above scheme, the first data includes scale parameters and the number of channels; the method further includes:

[0026] The number of elements in the first data is determined based on the scale parameter and the number of channels.

[0027] In the above scheme, the method further includes:

[0028] The number of channels is compressed based on the number of elements and the scale parameter to obtain the second data corresponding to each of the at least one first data.

[0029] In the above scheme, the method further includes:

[0030] At least one second data with the same number of elements is adjusted to obtain at least one third data.

[0031] This invention provides a liveness detection device, comprising:

[0032] The acquisition module is used to acquire a first image corresponding to at least one size of the image to be detected;

[0033] The first processing module is used to process the first image based on the first model to obtain global feature information corresponding to the first image;

[0034] The second processing module is used to process the first image based on the second model to obtain the first region information corresponding to the first image; the first model is different from the second model.

[0035] The first determining module is used to determine the liveness detection result corresponding to the first image based on the global feature information and the first region information.

[0036] This invention provides an electronic device, including a memory and a processor. The memory stores a computer program that can run on the processor. When the processor executes the program, it implements the detection method described in any of the above claims.

[0037] This invention provides a storage medium storing executable instructions, which, when executed by at least one processor, implement the detection method described above.

[0038] This invention provides a liveness detection method, apparatus, electronic device, and storage medium. The method includes: acquiring a first image corresponding to at least one size of a target image; processing the first image based on a first model to obtain global feature information corresponding to the first image; processing the first image based on a second model to obtain first region information corresponding to the first image; wherein the first model and the second model are different; and determining a liveness detection result corresponding to the first image based on the global feature information and the first region information. This invention eliminates the need to scale or adjust the target image to a uniform size. By processing the first image corresponding to at least one size of the target image using the first and second models, it can adapt to target images of any size, avoiding distortion and feature information shift caused by image scaling. It offers advantages such as high accuracy, high speed, and low computational cost. Attached Figure Description

[0039] Figure 1 This is a schematic diagram illustrating the implementation process of the liveness detection method according to an embodiment of the present invention;

[0040] Figure 2 This is a schematic diagram of the deep neural network structure of the liveness detection method according to an embodiment of the present invention;

[0041] Figure 3 This is a schematic diagram of the adaptive pooling network structure of the liveness detection method according to an embodiment of the present invention;

[0042] Figure 4 This is a schematic diagram illustrating the features of different branches of the liveness detection method according to an embodiment of the present invention;

[0043] Figure 5 This is a schematic diagram of the composition and structure of the liveness detection device according to an embodiment of the present invention;

[0044] Figure 6 This is a schematic diagram of the hardware structure of a liveness detection device according to an embodiment of the present invention. Detailed Implementation

[0045] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the specific technical solutions of the invention will be further described in detail below with reference to the accompanying drawings of the embodiments of the present invention. The following embodiments are used to illustrate the present invention, but are not intended to limit the scope of the present invention.

[0046] In related technologies, facial recognition systems typically include a liveness detection module. The main function of liveness detection is to determine whether the face to be identified is a real face or a fake face attack, and to provide confidence information that the face is a real, live person. When the captured photo is a printed photo, a photo on an electronic screen, or an image of a face wearing a mask, the system can easily be compromised by external individuals using fake faces. To prevent fake face fraud, adding a liveness detection module to the facial recognition system can improve system security.

[0047] In related technologies, face liveness detection methods extract face image features by using manually designed feature factors such as Local Binary Pattern (LBP), Histogram of Oriented Gradients (HoG), Scale-invariant Feature Transform (SIFT), and Speeded-Up Robust Features (SURF). Based on the differences between live and non-live images in terms of color texture, image quality, deformation, and material, machine learning methods such as Support Vector Machines (SVM) classifiers are used to classify the liveness of the input face photo.

[0048] Deep learning-based face liveness detection technology primarily employs a cascaded structure of deep convolutional neural networks (CNNs), fully connected layers, and classification output layers. This structure extracts facial image features through CNNs, offering advantages such as comprehensive facial image feature information and feature combinations, including both low-dimensional geometric features and high-dimensional abstract features. Furthermore, it allows for sequential feature extraction and liveness classification of facial images, achieving end-to-end liveness detection. With the continuous evolution of CNN models and optimization methods, the accuracy of deep learning-based face liveness detection algorithms has been significantly improved.

[0049] Related technology 1: Using traditional edge features, eye features, blink detection at key points of the human eye, and deep neural network features, three classifiers are trained respectively. Then, using these classifiers and a pre-designed program flow, the results of the three detections are fused according to a certain logic to perform face liveness recognition.

[0050] Related Technology 2: First, acquire the image to be identified. Based on a face liveness detection classification model, obtain the face feature vector and liveness detection result of the image. The face liveness detection classification model is trained using a convolutional neural network with captured images and liveness images as samples. During training, the bias value of the convolutional neural network and a first preset dimension vector for each image sample are obtained. Any one-dimensional vector is selected from the first preset dimension vector, and the sum of all elements is calculated. The difference between the sum and the absolute value of the bias value yields a binary classification value for each image sample, representing the liveness detection result. If the binary classification value is positive, the image sample is a live image; otherwise, it is a non-live image.

[0051] However, the face liveness detection classification model in related technology two is trained using a convolutional neural network with captured images and liveness images as samples. During training, it obtains the bias value of the convolutional neural network and a first-preset dimension vector for each image sample. The difference between the sum of this first-preset dimension vector and the bias value is used as the liveness classification result. Because the first-preset dimension vector needs to be obtained, the images input to the model need to be normalized to a uniform size. Since the first-preset dimension vector obtained from the input model will change after the image scales, the final algorithm's accuracy in detecting liveness will also be affected.

[0052] Related technology 3: First, face localization processing is performed on the face image to be detected to determine preset facial key points. Based on the facial key points, the face image to be detected is cropped and normalized. The processed face image is then input into the face liveness detection model to obtain a first mask image. The value of each pixel in the first mask image is used to indicate whether the corresponding pixel in the target face image is a live image or a non-live image.

[0053] However, before performing face liveness detection on the input image, related technique three first performs face localization to determine facial key points in the face image to be detected, and then performs cropping and normalization processing on the face image to be detected based on the facial key points. Although this method uses each pixel in a more refined mask image for liveness classification, during image preprocessing, when images of different pixel sizes are normalized to the same size, the shape and features of the images change, leading to a decrease in model accuracy.

[0054] To address the shortcomings of the aforementioned related technologies, this invention provides a liveness detection method. The functions implemented by this method can be achieved by the processor in the liveness detection device calling program code. Of course, the program code can be stored in a computer storage medium. Thus, the computing device includes at least a processor and a storage medium.

[0055] This invention provides a method for detecting live organisms. Figure 1This is a schematic diagram illustrating the implementation process of the liveness detection method according to an embodiment of the present invention, as shown below. Figure 1 As shown, the method includes:

[0056] Step 101: Obtain a first image corresponding to at least one size of the image to be detected;

[0057] Step 102: Process the first image based on the first model to obtain the global feature information corresponding to the first image;

[0058] Step 103: Process the first image based on the second model to obtain the first region information corresponding to the first image; the first model is different from the second model;

[0059] Step 104: Determine the liveness detection result corresponding to the first image based on the global feature information and the first region information.

[0060] In step 101, the liveness detection method can be determined according to the actual situation and is not limited here. As an example, the liveness detection method can be an adaptive scale face liveness detection method based on deep learning.

[0061] The image to be detected can be determined based on the actual situation and is not limited here. As an example, the image to be detected can be a face image of at least one size.

[0062] The first image can be determined based on the actual situation and is not limited here. As an example, the first image can be a feature image corresponding to the image to be detected.

[0063] The process of obtaining a first image corresponding to at least one size of the image to be detected can be achieved by processing the image to be detected of at least one size based on a preset feature extraction method to obtain a first image of at least one size.

[0064] The preset feature extraction method can be determined according to the actual situation and is not limited here. As an example, the preset feature extraction method can be a feature extraction network. The backbone structure of the feature extraction network is based on ResNet-50 or other similar structures in residual networks (ResNet).

[0065] In step 102, the first model can be determined according to the actual situation, and is not limited here. As an example, the first model can be an adaptive average pooling model.

[0066] The global feature information can be determined based on the actual situation and is not limited here. As an example, the global feature information can be information with the characteristics of each pixel.

[0067] In step 103, the second model can be determined according to the actual situation, and is not limited here. As an example, the second model can be an adaptive max pooling model.

[0068] The information for the first region can be determined based on the actual situation and is not limited here. As an example, the information for the first region can be information with the characteristics of the region with the largest response.

[0069] In step 104, the liveness detection result can be determined according to the actual situation, and is not limited here. As an example, the liveness detection result can be confidence information used to characterize that the face in the image to be detected is a real, live person.

[0070] The adaptive pooling operation in this embodiment of the invention adopts a combination of adaptive average pooling and adaptive max pooling. It can obtain global feature information from average pooling and obtain the region information with the largest response from max pooling. Compared with the existing single pooling method, it can obtain richer features, thereby increasing the model accuracy.

[0071] This invention provides a liveness detection method, comprising: acquiring a first image corresponding to at least one size of a picture to be detected; processing the first image based on a first model to obtain global feature information corresponding to the first image; processing the first image based on a second model to obtain first region information corresponding to the first image; wherein the first model and the second model are different; and determining a liveness detection result corresponding to the first image based on the global feature information and the first region information. This invention eliminates the need to scale or adjust the picture to be detected to a uniform size. By processing the first image corresponding to at least one size of the picture to be detected using the first and second models, it can adapt to pictures of any size, avoiding distortion and feature information shift caused by image scaling. It has advantages such as high accuracy, high speed, and low computational cost.

[0072] In an optional embodiment of the present invention, determining the liveness detection result corresponding to the first image based on the global feature information and the first region information includes:

[0073] The global feature information and the first region information are fused to obtain the target information corresponding to the first image;

[0074] The target information is processed based on a classification model to determine the liveness detection result corresponding to the first image.

[0075] In this embodiment, the fusion processing of the global feature information and the first region information can be performed based on a preset fusion method. The preset fusion method can be determined according to actual circumstances and is not limited here. As an example, the preset fusion method can be a concat operation, specifically vector concatenation.

[0076] The global feature information can be determined based on the actual situation and is not limited here. As an example, the global feature information can be the output tensor of the first scale. The first region information can be determined based on the actual situation and is not limited here. As an example, the first region information can be the output tensor of the second scale. Wherein, the first scale and the second scale are the same.

[0077] The target information can be determined based on the actual situation and is not limited here. As an example, the target information can be an output tensor at a third scale. The third scale is the sum of the first scale and the second scale.

[0078] This embodiment employs adaptive pooling to adapt to the size of the image to be detected and to unify the scale of the output feature vector. Existing technologies typically scale or adjust images to a uniform size before inputting them into the model network. Compared to existing technologies, this embodiment does not change the size or proportion of the image and features, thus avoiding distortion and its impact on the output results.

[0079] The classification model can be determined based on the actual situation and is not limited here. As an example, the classification model can be a model that includes a fully connected layer and a classification output layer that includes a normalization index (softmax).

[0080] In an optional embodiment of the present invention, the step of processing the first image based on the first model to obtain global feature information corresponding to the first image includes:

[0081] The first image is processed based on the first model to obtain the first feature information;

[0082] The first feature information is processed based on each branch model in at least one branch model to obtain at least one first data corresponding to the first feature information;

[0083] Compress at least one first data corresponding to the first feature information to obtain at least one second data corresponding to the first feature information;

[0084] At least one second data corresponding to the first feature information is adjusted to obtain at least one third data corresponding to the first feature information.

[0085] Global feature information corresponding to the first image is determined based on at least one third data corresponding to the first feature information.

[0086] In this embodiment, the first feature information can be determined according to the actual situation, and is not limited here. As an example, the first feature information can be the information of each pixel in the feature image.

[0087] The number of the at least one branch model can be determined according to the actual situation and is not limited here. As an example, the number of the at least one branch model can be four.

[0088] The processing of the first feature information by each branch model in at least one branch model can be determined according to the actual situation and is not limited here. As an example, the processing of the first feature information by each branch model in at least one branch model can be a branching process of the first feature information.

[0089] The adaptive pooling operation in this embodiment adopts a scheme that combines multi-branch pooling with different scales. Compared with the existing single-scale pooling operation, the model in this embodiment has stronger robustness and better smoothing effect.

[0090] The first data corresponding to the first feature information can be determined according to the actual situation, and is not limited here. As an example, the first data corresponding to the first feature information can be a tensor of the first dimension.

[0091] The second data corresponding to the first feature information can be determined according to the actual situation, and is not limited here. As an example, the second data corresponding to the first feature information can be a tensor of the second dimension.

[0092] The third data corresponding to the first feature information can be determined according to the actual situation, and is not limited here. As an example, the third data corresponding to the first feature information can be a third-dimensional tensor.

[0093] The step of determining the global feature information corresponding to the first image based on at least one third data corresponding to the first feature information can be performed by convolution processing on at least one third data corresponding to the first feature information to obtain at least one fourth data corresponding to the first feature information; and by performing calculation processing on at least one fourth data corresponding to the first feature information to obtain the global feature information corresponding to the first image.

[0094] The fourth data corresponding to the first feature information can be determined according to the actual situation, and is not limited here. As an example, the fourth data corresponding to the first feature information can be a fourth-dimensional tensor.

[0095] The computational processing can be determined based on the actual situation and is not limited here. As an example, the computational processing may be to add the elements corresponding to different positions of the fourth data corresponding to the first feature information.

[0096] In an optional embodiment of the present invention, processing the first image based on the second model to obtain the first region information corresponding to the first image includes:

[0097] The first image is processed based on the second model to obtain the second feature information;

[0098] The second feature information is processed based on each branch model in at least one branch model to obtain at least one first data corresponding to the second feature information;

[0099] Compress at least one first data corresponding to the second feature information to obtain at least one second data corresponding to the second feature information;

[0100] At least one second data corresponding to the second feature information is adjusted to obtain at least one third data corresponding to the second feature information.

[0101] Based on at least one third data corresponding to the second feature information, the first region information corresponding to the first image is determined.

[0102] In this embodiment, the second feature information can be determined according to the actual situation, and is not limited here. As an example, the second feature information may be the information of the largest response region in the feature image.

[0103] The number of the at least one branch model can be determined according to the actual situation and is not limited here. As an example, the number of the at least one branch model can be four.

[0104] The processing of the second feature information by each branch model in at least one branch model can be determined according to the actual situation and is not limited here. As an example, the processing of the second feature information by each branch model in at least one branch model can be a branching process of the second feature information.

[0105] The first data corresponding to the second feature information can be determined according to the actual situation, and is not limited here. As an example, the first data corresponding to the second feature information can be a tensor with a fifth dimension. The fifth dimension is the same as the first dimension.

[0106] The second data corresponding to the second feature information can be determined according to the actual situation, and is not limited here. As an example, the second data corresponding to the second feature information can be a tensor with a sixth dimension. The sixth dimension is the same as the second dimension.

[0107] The third data corresponding to the second feature information can be determined according to the actual situation, and is not limited here. As an example, the third data corresponding to the second feature information can be a tensor with a seventh dimension. The seventh dimension is the same as the third dimension.

[0108] The step of determining the first region information corresponding to the first image based on at least one third data corresponding to the second feature information can be performed by convolution processing on at least one third data corresponding to the second feature information to obtain at least one fourth data corresponding to the second feature information; and by performing calculation processing on at least one fourth data corresponding to the second feature information to obtain the first region information corresponding to the first image.

[0109] The fourth data corresponding to the second feature information can be determined according to the actual situation and is not limited here. As an example, the fourth data corresponding to the second feature information can be a tensor with an eighth dimension. The eighth dimension is the same as the fourth dimension.

[0110] The computational processing can be determined based on the actual situation and is not limited here. As an example, the computational processing may be to add the elements corresponding to different positions of the fourth data corresponding to the second feature information.

[0111] In an optional embodiment of the present invention, the first data includes a scale parameter and the number of channels; the method further includes:

[0112] The number of elements in the first data is determined based on the scale parameter and the number of channels.

[0113] In this embodiment, the scale parameter can be determined according to the actual situation and is not limited here. As an example, the scale parameter can be the tensor feature scale of the first data.

[0114] The number of channels can be determined based on actual conditions and is not limited here. As an example, the number of channels can be the number of tensor channels of the first data.

[0115] Determining the number of elements in the first data based on the scale parameter and the number of channels can be achieved by processing the scale parameter and the number of channels using a preset calculation method. The preset calculation method can be determined based on actual circumstances and is not limited here. As an example, the preset calculation method can be multiplying the scale parameter and the number of channels.

[0116] In an optional embodiment of the present invention, the method further includes:

[0117] The number of channels is compressed based on the number of elements and the scale parameter to obtain the second data corresponding to each of the at least one first data.

[0118] In this embodiment, the step of compressing the number of channels according to the number of elements and the scale parameter to obtain the second data corresponding to each of the at least one first data can be achieved by increasing the scale parameter and decreasing the number of channels while keeping the number of elements unchanged, thereby obtaining the second data corresponding to each of the at least one first data.

[0119] In an optional embodiment of the present invention, the method further includes:

[0120] At least one second data with the same number of elements is adjusted to obtain at least one third data.

[0121] In this embodiment, adjusting at least one second data with the same number of elements to obtain at least one third data can be done by directly adjusting (resizing) the at least one second data when the number of elements is the same, to obtain at least one third data corresponding to the at least one second data.

[0122] To understand the embodiments of the present invention, the following description uses an adaptive scale face liveness detection method based on deep learning as an example.

[0123] Figure 2 This is a schematic diagram of the deep neural network structure of the liveness detection method according to an embodiment of the present invention, as shown below. Figure 2As shown, in the neural network structure, the input face image is first extracted by a feature extraction network to obtain the feature image corresponding to the face image. Then, it is input into two paths: path A inputs the feature image into an adaptive average pooling model, and path B inputs the feature image into an adaptive maximum pooling model. The subsequent operations in each path are channel compression, tensor shape adjustment, group convolution, and feature fusion. Finally, the output tensors of the two paths are concatenated and input into a fully connected layer and a classification output layer including softmax.

[0124] In the neural network structure described, the feature extraction network uses a skeleton structure based on ResNet-50 or other similar structures. Feature fusion employs a concat operation, specifically vector concatenation, where the median scale of path A is F. i The output tensor a and the B-path midscale are F i The output tensor b, after concatenation, yields a scale of 2F. i The tensor.

[0125] Figure 3 This is a schematic diagram of the adaptive pooling network structure for the liveness detection method according to an embodiment of the present invention. The detailed structures of paths A and B are as follows: Figure 3 As shown, the difference is that after the input operation of path A is adaptive average pooling, or after the input operation of path B is adaptive max pooling, the subsequent structure and operation are the same. The adaptive pooling operation is divided into 4 branches. The feature information obtained after adaptive average pooling or adaptive max pooling is passed through each adaptive pooling branch to obtain tensors with dimensions of 1×1×C, 2×2×C, 4×4×C, and 8×8×C respectively (Note: ignore the batch size of the 0th dimension, the same below). Then, a 1×1 convolution operation is used to perform channel compression processing, so that the dimensions of the tensor become 1×1×C0, 2×2×C1, 4×4×C2, and 8×8×C3. The formula for calculating the number of channels is shown in (1):

[0126] C0=2×2×C1=4×4×C2=8×8×C3 (1)

[0127] Due to the constraints of formula (1), the total number of elements in each branch is the same. Next, the tensor of each branch is adjusted to the same 1×1×F. i The input is then grouped into a convolutional layer, with F groups being the number of convolutions. i The next step is to sum the corresponding elements after grouping and convolving each branch, and then flatten it into a 1×F array. i A tensor of dimension F. Finally, the output dimension for paths A and B is 1×F. i Concatenating the tensors yields a 1×2F tensor. i A tensor with dimension 1×2F iThe tensor contains adaptive average pooling feature information from path A and adaptive max pooling feature information from path B.

[0128] Figure 4 This is a schematic diagram illustrating the features of different branches of the liveness detection method according to embodiments of the present invention, such as... Figure 4 As shown, after adaptive pooling and channel compression of the tensor, the tensor feature scale of the four branches increases sequentially and the number of channels decreases sequentially. This design can adapt to images of different sizes and extract features of different scales from the original image. The feature scale and number of channels satisfy the constraint of formula (1), which can fuse features of different scales in each branch and keep the output tensor dimension consistent.

[0129] This embodiment employs dual-channel pooling, combining the advantages of adaptive average pooling and adaptive max pooling. Average pooling can reflect the information of each pixel in the feature map, while max pooling can provide gradient feedback to the region with the largest response in the feature map. Combining the two pooling methods complements each other.

[0130] This embodiment also employs adaptive pooling and channel compression operations to adapt to images of arbitrary size and to maintain a uniform scale for the output feature vectors. This network structure, through the combination of adaptive pooling and channel compression, ensures that there is no need to perform a uniform scale transformation on the images to be detected, avoiding distortion and feature information shifts caused by image scale changes, while also outputting feature vectors of a uniform scale.

[0131] This embodiment also employs adaptive pooling at different scales for the feature maps. By constraining the pooling scale and the number of channels using formula (1), each pooling branch emphasizes different aspects of spatial scale and channel layer information. After group convolution, features at each scale are fused, which provides stronger robustness and smoothing effect when dealing with images to be detected at different scales. On the other hand, the pooling scale and the number of channels constrained in formula (1) can be extended by analogy according to actual needs.

[0132] This invention provides a liveness detection device. Figure 5 This is a schematic diagram of the composition and structure of the liveness detection device according to an embodiment of the present invention, as shown below. Figure 5 As shown, the device 500 includes:

[0133] The acquisition module 501 is used to acquire a first image corresponding to at least one size of the image to be detected;

[0134] The first processing module 502 is used to process the first image based on the first model to obtain global feature information corresponding to the first image;

[0135] The second processing module 503 is used to process the first image based on the second model to obtain the first region information corresponding to the first image; the first model is different from the second model.

[0136] The first determining module 504 is used to determine the liveness detection result corresponding to the first image based on the global feature information and the first region information.

[0137] In other embodiments, the first determining module 504 is further configured to fuse the global feature information and the first region information to obtain target information corresponding to the first image; and to process the target information based on a classification model to determine the liveness detection result corresponding to the first image.

[0138] In other embodiments, the first processing module 502 is further configured to process the first image based on the first model to obtain first feature information; process the first feature information based on each branch model in at least one branch model to obtain at least one first data corresponding to the first feature information; compress the at least one first data corresponding to the first feature information to obtain at least one second data corresponding to the first feature information; adjust the at least one second data corresponding to the first feature information to obtain at least one third data corresponding to the first feature information; and determine global feature information corresponding to the first image based on the at least one third data corresponding to the first feature information.

[0139] In other embodiments, the second processing module 503 is further configured to process the first image based on the second model to obtain second feature information; process the second feature information based on each branch model in at least one branch model to obtain at least one first data corresponding to the second feature information; compress the at least one first data corresponding to the second feature information to obtain at least one second data corresponding to the second feature information; adjust the at least one second data corresponding to the second feature information to obtain at least one third data corresponding to the second feature information; and determine the first region information corresponding to the first image based on the at least one third data corresponding to the second feature information.

[0140] In other embodiments, the first data includes a scale parameter and a number of channels; the device 500 further includes a second determining module, configured to determine the number of elements in the first data based on the scale parameter and the number of channels.

[0141] In other embodiments, the second processing module 503 further includes a compression unit, configured to compress the number of channels according to the number of elements and the scale parameter to obtain second data corresponding to each of the at least one first data.

[0142] In other embodiments, the second processing module 503 further includes an adjustment unit for adjusting at least one second data with the same number of elements to obtain at least one third data.

[0143] The description of the above device embodiments is similar to that of the above method embodiments, and has similar beneficial effects. For technical details not disclosed in the device embodiments of the present invention, please refer to the description of the method embodiments of the present invention for understanding.

[0144] It should be noted that, in the embodiments of the present invention, if the above-described liveness detection method is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical embodiments of the present invention, or the parts that contribute to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a liveness detection device (which may be a personal computer, server, or network device, etc.) to execute all or part 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 USB flash drives, portable hard drives, read-only memory (ROM), magnetic disks, or optical disks. Thus, the embodiments of the present invention are not limited to any specific hardware and software combination.

[0145] Correspondingly, embodiments of the present invention provide an electronic device, including a memory and a processor. The memory stores a computer program that can run on the processor. When the processor executes the program, it implements the detection method described in any of the above claims.

[0146] This invention provides a storage medium storing executable instructions, which, when executed by at least one processor, implement the detection method described above.

[0147] It should be noted that the descriptions of the storage medium and device embodiments above are similar to those of the method embodiments above, and have similar beneficial effects. For technical details not disclosed in the storage medium and device embodiments of the present invention, please refer to the descriptions of the method embodiments of the present invention for understanding.

[0148] It should be noted that, Figure 6This is a schematic diagram of a hardware entity structure of a liveness detection device according to an embodiment of the present invention, such as... Figure 6 As shown, the hardware entity of the liveness detection device 600 includes a processor 601 and a memory 603. Optionally, the liveness detection device 600 may also include a communication interface 602.

[0149] It is understood that memory 603 can be volatile memory or non-volatile memory, or both. Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), ferromagnetic random access memory (FRAM), flash memory, magnetic surface memory, optical disc, or compact disc read-only memory (CD-ROM); magnetic surface memory can be disk storage or magnetic tape storage. Volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Synchronous Static Random Access Memory (SSRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM), SyncLink Dynamic Random Access Memory (SLDRAM), and Direct Rambus Random Access Memory (DRRAM).The memory 603 described in this embodiment of the invention is intended to include, but is not limited to, these and any other suitable types of memory.

[0150] The methods disclosed in the above embodiments of the present invention can be applied to or implemented by processor 601. Processor 601 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuit of the hardware in processor 601 or by instructions in software form. The processor 601 may be a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Processor 601 can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of the present invention. A general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the methods disclosed in the embodiments of the present invention can be directly manifested as being executed by a hardware decoding processor, or being executed by a combination of hardware and software modules in the decoding processor. The software modules may be located in a storage medium, which is located in memory 603. Processor 601 reads the information in memory 603 and combines it with its hardware to complete the steps of the aforementioned method.

[0151] In an exemplary embodiment, the liveness detection device may be implemented by one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers (MCUs), microprocessors, or other electronic components to perform the aforementioned method.

[0152] In the several embodiments provided by this invention, it should be understood that the disclosed methods and apparatus can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple units or components may be combined, or integrated into another observation, or some features may be ignored or not executed. In addition, the communication connections between the various components shown or discussed may be through some interfaces, indirect coupling or communication connections between devices or units, and may be electrical, mechanical, or other forms.

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

[0154] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media that can store program code, such as mobile storage devices, read-only memory (ROM), magnetic disks, or optical disks.

[0155] Alternatively, if the integrated units described above in the embodiments of the present invention are implemented as software functional units and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical embodiments of the present invention, or the parts that contribute to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a liveness detection device (which may be a personal computer, server, or network device, etc.) to execute all or part 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 mobile storage devices, ROMs, magnetic disks, or optical disks.

[0156] The liveness detection method, apparatus, and computer storage medium described in this invention are only examples of the embodiments described in this invention, but are not limited thereto. Any liveness detection method, apparatus, and computer storage medium involved are within the protection scope of this invention.

[0157] It should be understood that the phrase "one embodiment" or "an embodiment" throughout the specification means that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of the invention. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. It should be understood that in the various embodiments of the invention, the sequence numbers of the above-described processes do not imply a sequential order of execution; the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the invention. The sequence numbers of the above-described embodiments of the invention are merely descriptive and do not represent the superiority or inferiority of the embodiments.

[0158] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0159] The above description is merely an embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A method for detecting liveness, characterized in that, The method includes: Obtain a first image corresponding to at least one size of the image to be detected; The first image is processed based on the first model to obtain global feature information corresponding to the first image; the global feature information includes information with the characteristics of each pixel and / or an output tensor at a first scale; the first model can adapt to images of any size to be detected; The first image is processed based on the second model to obtain the first region information corresponding to the first image; the first model is different from the second model; the first region information includes information with the characteristics of the maximum response region information and / or the output tensor of the second scale, which is the same as the first scale; the second model can adapt to any size of the image to be detected; Based on the global feature information and the first region information, the liveness detection result corresponding to the first image is determined.

2. The method according to claim 1, characterized in that, The step of determining the liveness detection result corresponding to the first image based on the global feature information and the first region information includes: The global feature information and the first region information are fused to obtain the target information corresponding to the first image; The target information is processed based on a classification model to determine the liveness detection result corresponding to the first image.

3. The method according to claim 1, characterized in that, The process of processing the first image based on the first model to obtain the global feature information corresponding to the first image includes: The first image is processed based on the first model to obtain the first feature information; The first feature information is processed based on each branch model in at least one branch model to obtain at least one first data corresponding to the first feature information; Compress at least one first data corresponding to the first feature information to obtain at least one second data corresponding to the first feature information; At least one second data corresponding to the first feature information is adjusted to obtain at least one third data corresponding to the first feature information. Global feature information corresponding to the first image is determined based on at least one third data corresponding to the first feature information.

4. The method according to claim 1, characterized in that, The step of processing the first image based on the second model to obtain the first region information corresponding to the first image includes: The first image is processed based on the second model to obtain the second feature information; The second feature information is processed based on each branch model in at least one branch model to obtain at least one first data corresponding to the second feature information; Compress at least one first data corresponding to the second feature information to obtain at least one second data corresponding to the second feature information; At least one second data corresponding to the second feature information is adjusted to obtain at least one third data corresponding to the second feature information. Based on at least one third data corresponding to the second feature information, the first region information corresponding to the first image is determined.

5. The method according to claim 3 or 4, characterized in that, The first data includes scale parameters and the number of channels; the method further includes: The number of elements in the first data is determined based on the scale parameter and the number of channels.

6. The method according to claim 5, characterized in that, The method further includes: The number of channels is compressed based on the number of elements and the scale parameter to obtain the second data corresponding to each of the at least one first data.

7. The method according to claim 6, characterized in that, The method further includes: At least one second data with the same number of elements is adjusted to obtain at least one third data.

8. A liveness detection device, characterized in that, include: The acquisition module is used to acquire a first image corresponding to at least one size of the image to be detected; The first processing module is used to process the first image based on the first model to obtain global feature information corresponding to the first image; The global feature information includes information with characteristics of each pixel and / or an output tensor at a first scale; the first model can adapt to images of any size to be detected; The second processing module is used to process the first image based on the second model to obtain the first region information corresponding to the first image; The first model differs from the second model; the first region information includes information with the characteristics of the maximum response region information and / or the output tensor at a second scale, the second scale being the same as the first scale; the second model can adapt to images of any size to be detected; The first determining module is used to determine the liveness detection result corresponding to the first image based on the global feature information and the first region information.

9. An electronic device comprising a memory and a processor, the memory storing a computer program executable on the processor, characterized in that, When the processor executes the program, it implements the detection method according to any one of claims 1 to 7.

10. A storage medium, characterized in that, The storage medium stores executable instructions that, when executed by at least one processor, implement the detection method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Image detection method and device, electronic equipment and storage medium

    CN114140613A