Face living body detection model compression method and device and electronic equipment

By using feature decoupling and similarity information-driven network compression methods, the performance degradation of face liveness detection models on mobile devices after compression is solved, improving the accuracy of liveness detection for the second face attribute type and reducing model complexity.

CN117079320BActive Publication Date: 2026-01-23BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310896729.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-20
Publication Date
2026-01-23
Estimated Expiration
2043-07-20

AI Technical Summary

Technical Problem

In existing technologies, the performance of face liveness detection models degrades significantly after compression on mobile devices, failing to effectively improve the accuracy of liveness detection for second face attribute types and reduce complexity.

Method used

By acquiring first and second face images with different face attribute types, a feature decoupling model is used to separate common features and differential features. Similarity information is combined to compress the preset feature extraction network. The face liveness detection model is compressed using reparameterization and principal component analysis. The feature extraction network is pruned and merged to generate the target face liveness detection model.

Benefits of technology

This study achieves improved accuracy and reduced complexity in the face liveness detection model under the second face attribute type, maintaining detection accuracy while reducing computational burden.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117079320B_ABST
    Figure CN117079320B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a compression method and device of a face living body detection model and an electronic device. The method comprises: performing face difference feature extraction on a first face image and a second face image based on a first feature extraction network of a feature decoupling model to obtain a first face living body feature corresponding to the first face image and a second face living body feature corresponding to the second face image; performing compression processing on a preset feature extraction network according to first similarity information of the first face living body feature and the second face living body feature and second similarity information between the first feature extraction network and the preset feature extraction network to obtain a third feature extraction network; and performing compression processing on a face living body detection model for the first face image based on the third feature extraction network and a second feature extraction network to obtain a target face living body detection model for performing living body detection on the second face image. The compression accuracy and efficiency of the face living body detection model can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of image data processing technology, and in particular to a compression method, apparatus and electronic device for a human face liveness detection model. Background Technology

[0002] Face liveness detection is a crucial component of face recognition systems, which are typically performed on mobile devices with limited computing power. Due to computational constraints, compressing face liveness detection models is essential. Therefore, current technologies directly apply existing model compression methods to face liveness detection tasks, but the performance of pruned face liveness detection models significantly degrades. Summary of the Invention

[0003] This disclosure provides a compression method, apparatus, and electronic device for a face liveness detection model, which can improve the accuracy of face liveness detection for a second face attribute type and reduce the complexity of the face liveness detection model for the second face attribute type. The technical solution of this disclosure is as follows:

[0004] According to a first aspect of the present disclosure, a method for compressing a face liveness detection model is provided, comprising:

[0005] A first face image, a second face image, and a feature decoupling model are acquired. The face attribute type of the first face image is different from that of the second face image. The feature decoupling model is trained based on sample face images under the face attribute type of the first face image. The feature decoupling model includes a first feature extraction network for extracting face difference features and a second feature extraction network for extracting face general features.

[0006] Based on the first feature extraction network, facial difference features are extracted from the first face image and the second face image respectively to obtain the first face liveness feature corresponding to the first face image and the second face liveness feature corresponding to the second face image.

[0007] The first similarity information between the first face liveness feature and the second face liveness feature, and the second similarity information between the first feature extraction network and the preset feature extraction network are determined; the preset feature extraction network refers to a preset network used to extract facial difference features of the second face image;

[0008] Based on the first similarity information and the second similarity information, the preset feature extraction network is compressed to obtain a third feature extraction network;

[0009] Based on the third feature extraction network and the second feature extraction network, the face liveness detection model used for the first face image is compressed to obtain the target face liveness detection model used for liveness detection of the second face image.

[0010] In one possible implementation, the feature decoupling model is obtained through the following steps:

[0011] Obtain the liveness tag information corresponding to the sample face image;

[0012] The sample face image is input into the corresponding initial decoupling model to perform face difference feature and face general feature extraction processing to obtain sample general features and sample difference features;

[0013] The general features of the samples are input into the domain discriminator to obtain the discrimination result;

[0014] The sample difference features are input into the corresponding classifier to obtain the classification result;

[0015] Based on the first loss information between the classification result and the liveness label information, the differential feature extraction network in the initial decoupling model is trained to obtain the first feature extraction network.

[0016] Based on the discrimination result, the general feature extraction network in the initial decoupling model is trained to obtain the second feature extraction network;

[0017] The first feature extraction network and the second feature extraction network are combined to obtain the feature decoupling model.

[0018] In one possible implementation, the step of compressing the preset feature extraction network based on the first similarity information and the second similarity information to obtain a third feature extraction network includes:

[0019] Based on the first similarity information and the second similarity information, determine the second loss information;

[0020] The preset feature extraction network is trained based on the second loss information until the loss condition is met, thus obtaining the third feature extraction network.

[0021] In one possible implementation, the step of compressing the face liveness detection model for the first face image using a reparameterization method based on the third feature extraction network and the second feature extraction network to obtain a target face liveness detection model for liveness detection of the second face image includes:

[0022] The second face image is input into the face liveness detection model used for the first face image to obtain liveness detection features;

[0023] The liveness detection features are multiplied by the model parameters of the second feature extraction network to obtain the first face liveness prediction features;

[0024] The liveness detection features are multiplied by the model parameters of the third feature extraction network to obtain the second face liveness prediction features;

[0025] Based on the first face liveness prediction features and the second face liveness prediction features, penalty constraint information is obtained.

[0026] The second feature extraction network and the third feature extraction network are compressed using the penalty constraint information to obtain the first general feature extraction network and the first differential feature extraction network corresponding to the second face image;

[0027] The face liveness detection model for the first face image is processed by interacting with the first general feature extraction network and the first differential feature extraction network to obtain the target face liveness detection model for the second face image.

[0028] In one possible implementation, the step of compressing the face liveness detection model for the first face image based on the third feature extraction network and the second feature extraction network to obtain a target face liveness detection model for liveness detection of the second face image includes:

[0029] The third feature extraction network is used to prune the channels in the face liveness detection model for the first face image to obtain the first sub-network;

[0030] The second feature extraction network is used to prune the channels in the face liveness detection model for the first face image to obtain a second sub-network;

[0031] The first sub-network and the second sub-network are merged to obtain the target face liveness detection model used for liveness detection of the second face image.

[0032] In one possible implementation, the method further includes:

[0033] Principal component analysis is performed on the second feature extraction network and the third feature extraction network respectively to obtain the first principal component information corresponding to the second feature extraction network and the second principal component information corresponding to the third feature extraction network.

[0034] The first principal component information and the second principal component information are balanced to obtain the balanced second general feature extraction network and the second differential feature extraction network.

[0035] The step of compressing the face liveness detection model for the first face image based on the third feature extraction network and the second feature extraction network to obtain a target face liveness detection model for the second face image includes:

[0036] Based on the second general feature extraction network and the second differential feature extraction network, the face liveness detection model used for the first face image is compressed to obtain the target face liveness detection model used for liveness detection of the second face image.

[0037] In one possible implementation, the step of balancing the first principal component information and the second principal component information to obtain the balanced second general feature extraction network and the second differential feature extraction network includes:

[0038] Obtain the first percentage occupied by the first M principal components in the first principal component information and the second percentage occupied by the first M principal components in the second principal component information; where M is an integer greater than 1;

[0039] The first percentage and the second percentage are adjusted until the difference between the first percentage and the second percentage is less than a threshold. The second feature extraction network when the difference is less than the threshold is used as the second general feature extraction network, and the third feature extraction network when the difference is less than the threshold is used as the second differential feature extraction network.

[0040] According to a second aspect of the present disclosure, a compression apparatus for a face liveness detection model is provided, comprising:

[0041] The acquisition module is configured to acquire a first face image, a second face image, and a feature decoupling model. The face attribute type of the first face image is different from that of the second face image. The feature decoupling model is trained based on sample face images under the face attribute type of the first face image. The feature decoupling model includes a first feature extraction network for extracting face difference features and a second feature extraction network for extracting face general features.

[0042] The differential feature extraction module is configured to perform facial differential feature extraction on the first face image and the second face image respectively based on the first feature extraction network, so as to obtain the first face liveness feature corresponding to the first face image and the second face liveness feature corresponding to the second face image;

[0043] The similarity determination module is configured to determine first similarity information between the first face liveness feature and the second face liveness feature, and second similarity information between the first feature extraction network and a preset feature extraction network; the preset feature extraction network refers to a preset network used to extract facial difference features of the second face image;

[0044] The third feature extraction network acquisition module is configured to perform compression processing on the preset feature extraction network based on the first similarity information and the second similarity information to obtain the third feature extraction network;

[0045] The face liveness detection model acquisition module is configured to perform compression processing on the face liveness detection model used for the first face image based on the third feature extraction network and the second feature extraction network, so as to obtain the target face liveness detection model used for liveness detection of the second face image.

[0046] In one possible implementation, the above-mentioned device further includes:

[0047] The training sample acquisition module is configured to acquire the liveness label information corresponding to the face image of the sample;

[0048] The feature extraction module is configured to input the sample face image into the corresponding initial decoupling model, perform face difference feature and face general feature extraction processing, and obtain sample general features and sample difference features;

[0049] The discrimination module is configured to execute a discrimination result by inputting the general features of the sample into a domain discriminator.

[0050] The classification module is configured to input the sample difference features into the corresponding classifier to obtain the classification result;

[0051] The first training module is configured to execute a first loss information between the classification result and the liveness label information to train the differential feature extraction network in the initial decoupling model, thereby obtaining the first feature extraction network.

[0052] The second training module is configured to train the general feature extraction network in the initial decoupling model based on the discrimination result, so as to obtain the second feature extraction network.

[0053] The merging module is configured to merge the first feature extraction network and the second feature extraction network to obtain the feature decoupling model.

[0054] In one possible implementation, the third feature extraction network acquisition module includes:

[0055] The loss information determination unit is configured to determine second loss information based on the first similarity information and the second similarity information;

[0056] The network training unit is configured to train the preset feature extraction network based on the second loss information until the loss condition is met, thereby obtaining the third feature extraction network.

[0057] In one possible implementation, the face liveness detection model acquisition module includes:

[0058] The liveness detection unit is configured to input the second face image into the face liveness detection model used for the first face image to obtain liveness detection features;

[0059] The first face liveness prediction feature acquisition unit is configured to perform a dot product of the liveness detection feature and the model parameters of the second feature extraction network to obtain the first face liveness prediction feature.

[0060] The second face liveness prediction feature acquisition unit is configured to perform a dot product of the liveness detection features and the model parameters of the third feature extraction network to obtain the second face liveness prediction features.

[0061] The constraint unit is configured to perform a penalty constraint based on the first face liveness prediction feature and the second face liveness prediction feature.

[0062] The compression unit is configured to perform compression processing on the second feature extraction network and the third feature extraction network respectively using the penalty constraint information to obtain the first general feature extraction network and the first differential feature extraction network corresponding to the second face image;

[0063] The model parameter interaction unit is configured to perform model parameter interaction processing between the face liveness detection model for the first face image and the first general feature extraction network and the first differential feature extraction network, respectively, to obtain the target face liveness detection model for liveness detection of the second face image.

[0064] In one possible implementation, the face liveness detection model acquisition module includes:

[0065] The first sub-network acquisition unit is configured to perform pruning processing on the channels in the face liveness detection model for the first face image using the third feature extraction network to obtain the first sub-network;

[0066] The second sub-network acquisition unit is configured to perform pruning processing on the channels in the face liveness detection model for the first face image using the second feature extraction network to obtain the second sub-network;

[0067] The sub-mesh merging unit is configured to merge the first sub-network and the second sub-network to obtain the target face liveness detection model for liveness detection of the second face image.

[0068] In one possible implementation, the device further includes:

[0069] The principal component analysis module is configured to perform principal component analysis on the second feature extraction network and the third feature extraction network respectively, to obtain the first principal component information corresponding to the second feature extraction network and the second principal component information corresponding to the third feature extraction network.

[0070] The equalization processing module is configured to perform equalization processing on the first principal component information and the second principal component information to obtain the equalized second general feature extraction network and the second differential feature extraction network.

[0071] Accordingly, the face liveness detection model acquisition module is further configured to perform compression processing on the face liveness detection model used for the first face image based on the second general feature extraction network and the second differential feature extraction network, so as to obtain a target face liveness detection model used for liveness detection of the second face image.

[0072] In one possible implementation, the equalization processing module includes:

[0073] The principal component percentage acquisition unit is configured to acquire the first percentage occupied by the first M principal components in the first principal component information and the second percentage occupied by the first M principal components in the second principal component information; where M is an integer greater than 1;

[0074] The equalization processing unit is configured to perform adjustments on the first percentage and the second percentage until the difference between the first percentage and the second percentage is less than a threshold, and to use the second feature extraction network when the difference is less than the threshold as the second general feature extraction network, and to use the third feature extraction network when the difference is less than the threshold as the second differential feature extraction network.

[0075] According to a third aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to execute the instructions to implement the method as described in any one of the first aspects above.

[0076] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided such that, when instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform any of the methods described in the first aspect of the present disclosure.

[0077] According to a fifth aspect of the present disclosure, a computer program product is provided, including computer instructions that, when executed by a processor, cause a computer to perform the method described in any one of the first aspects of the present disclosure.

[0078] The technical solutions provided by the embodiments of this disclosure have at least the following beneficial effects:

[0079] By acquiring first and second face images with different face attribute types, and a feature decoupling model corresponding to the first face image, and this feature decoupling model can separate the common features and differential features of the face, the decoupling and extraction of face liveness features are realized. Then, by combining the first similarity information between the first and second face liveness features, and the second similarity information between the first feature extraction network and the preset feature extraction network, the preset feature extraction network is compressed, and based on the third feature extraction network and the second feature extraction network, the face liveness detection model for the first face image is compressed to obtain the target face liveness detection model for the second face image. This accurately and quickly transfers the liveness detection knowledge under the face attribute type of the first face image to the liveness detection model under the face attribute type of the second face image, which can reduce the complexity of the face liveness detection model corresponding to the second face image and improve the accuracy of face liveness detection for the second face image.

[0080] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0081] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure, and are not intended to unduly limit this disclosure.

[0082] Figure 1 This is a schematic diagram illustrating an application environment according to an exemplary embodiment.

[0083] Figure 2 This is a flowchart illustrating a compression method for a face liveness detection model according to an exemplary embodiment.

[0084] Figure 3This is a schematic diagram illustrating adversarial training of a feature decoupling model according to an exemplary embodiment.

[0085] Figure 4 This is a schematic diagram illustrating a compression process using a preset feature extraction network based on similarity, according to an exemplary embodiment.

[0086] Figure 5 This is a schematic diagram illustrating face liveness detection model compression based on a reparameterization method according to an exemplary embodiment.

[0087] Figure 6 This is a schematic diagram illustrating principal component analysis using a second feature extraction network and a third feature extraction network according to an exemplary embodiment.

[0088] Figure 7 This is a block diagram of a compression device for a face liveness detection model according to an exemplary embodiment.

[0089] Figure 8 This is a block diagram illustrating an electronic device for compressing a face liveness detection model according to an exemplary embodiment.

[0090] Figure 9 This is a block diagram illustrating an electronic device for compressing a face liveness detection model according to an exemplary embodiment. Detailed Implementation

[0091] To enable those skilled in the art to better understand the technical solutions of this disclosure, the technical solutions in the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings.

[0092] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.

[0093] Artificial intelligence (AI) is the theory, methods, technology, and application systems that use digital computers or computers-controlled machines to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. AI software technology mainly includes computer vision, speech processing, natural language processing, and machine learning / deep learning.

[0094] In recent years, with the research and progress of artificial intelligence technology, it has been widely applied in many fields. The solutions provided in this application involve technologies such as computer vision, machine learning / deep learning, etc., and are specifically illustrated through the following embodiments:

[0095] Please see Figure 1 , Figure 1 This is a schematic diagram illustrating an application environment according to an exemplary embodiment, such as... Figure 1 As shown, the application environment may include server 01 and terminal 02.

[0096] In an optional embodiment, server 01 can be used for compression processing of the face liveness detection model. Specifically, server 01 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.

[0097] In an optional embodiment, terminal 02 can utilize a compressed face liveness detection model to perform liveness detection on faces of the second face attribute type. Specifically, terminal 02 can be, but is not limited to, electronic devices such as smartphones, desktop computers, tablets, laptops, smart speakers, digital assistants, augmented reality (AR) / virtual reality (VR) devices, and smart wearable devices. Optionally, the operating system running on the electronic device can be, but is not limited to, Android, iOS, Linux, and Windows.

[0098] In addition, it should be noted that, Figure 1 The example shown is merely one application environment of the compression method for the face liveness detection model provided in this disclosure.

[0099] In the embodiments described in this specification, the server 01 and the terminal 02 can be directly or indirectly connected through wired or wireless communication, and this application does not impose any restrictions on this.

[0100] It should be noted that the following diagram illustrates one possible sequence of steps, and it is not strictly required to follow this order. Some steps can be performed in parallel without interdependence. The user information (including but not limited to user device information, user personal information, user behavior information, etc.) and data (including but not limited to data used for display, training data, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties.

[0101] Figure 2 This is a flowchart illustrating a compression method for a face liveness detection model according to an exemplary embodiment. Figure 2 As shown, the steps may include the following.

[0102] In step S201, the first face image, the second face image, and the feature decoupling model are acquired.

[0103] In the embodiments of this specification, the face attribute type of the first face image (referred to as the first face attribute type) is different from the face attribute type of the second face image (referred to as the second face attribute type). The feature decoupling model can be trained based on sample face images under the face attribute type of the first face image. This feature decoupling model can include a first feature extraction network for extracting facial difference features and a second feature extraction network for extracting facial general features. That is, the feature decoupling model can be used to decouple the facial general features and facial difference features under the face attribute type of the first face image, thereby separating the general features and difference features of the face.

[0104] As an example, face attribute types can be classified based on different lighting conditions, different types of face liveness attacks, different face features, etc., and this disclosure does not limit them.

[0105] In the embodiments described in this specification, a pre-trained feature decoupling model can be obtained. As an example, two encoders (i.e., two feature extraction networks) can be trained through adversarial learning to obtain a feature decoupling model including a first feature extraction network and a second feature extraction network. The sample face images used in training have corresponding liveness label information, which can be either real or fake faces.

[0106] Accordingly, a face image of the first face attribute type corresponding to the sample face image can be obtained as the first face image, and a face image of the second face attribute type can be obtained as the second face image. That is, if a decoupling model has already been trained using face images of the first face attribute type to decouple the general and differential features of face images of the first face attribute type, then a face image of the second face attribute type can be obtained as the second face image. This second face image can then be used to compress the face liveness detection model corresponding to the first face attribute type, thereby transferring the liveness detection knowledge of the first face attribute type to the face liveness detection model corresponding to the second face attribute type. The second face attribute type is different from the first face attribute type.

[0107] In one possible implementation, adversarial learning constraints can be used to learn common facial features across different facial attribute types. This involves using a discriminator to constrain the common facial features across all facial attribute types to reside in the same feature space, and using cross-entropy classification constraints to ensure that both common and difference features have effective discriminative power for each facial attribute type, thus ensuring that the output of the classifier for each facial attribute type matches the label information. Based on this, as... Figure 3 As shown, the feature decoupling model corresponding to the first face attribute type can be obtained through the following steps: obtain the liveness label information corresponding to the sample face image. As an example, at least two face attribute types of sample face images and the liveness label information corresponding to each sample face image can be obtained, such as real face or fake face.

[0108] This allows sample face images to be input into the corresponding initial decoupling model for facial difference feature extraction and general facial feature extraction, yielding sample general features and sample difference features. The sample general features are then input into a domain discriminator to obtain a discrimination result. Furthermore, the sample difference features can be input into a corresponding classifier to obtain a classification result. For example, Figure 3 As shown, each face attribute type has a corresponding initial decoupling model, such as... Figure 3 The first feature extraction network and the second feature extraction network are shown. It should be noted that the first face attribute type mentioned above can be at least one of the at least two face attribute types.

[0109] Furthermore, based on the first loss information between the classification result and the liveness label information, the differential feature extraction network in the initial decoupling model can be trained to obtain the first feature extraction network; the training here can be based on supervised gradient descent, which will not be elaborated here. The first loss information can be calculated based on the cross-entropy function, and this disclosure does not limit it.

[0110] Furthermore, the general feature extraction network in the initial decoupling model can be trained based on the discrimination result to obtain the second feature extraction network. For example, it can be trained until the discrimination result indicates that the similarity of the general facial features under at least two facial attribute types is less than a set threshold, and the general feature extraction network with similarity less than the set threshold is used as the second feature extraction network. Finally, the first feature extraction network and the second feature extraction network can be merged to obtain the feature decoupling model.

[0111] It should be noted that the second feature extraction network in the feature decoupling model of at least two face attribute types can be the same, while the first feature extraction network can be different.

[0112] By using adversarial learning, a feature decoupling model is obtained to separate common facial features and differential facial features. This provides a basis for pruning the second feature extraction network for common features and the first feature extraction network for differential features. For a given second facial attribute type, differential pruning is performed based on the characteristics of the second facial attribute type and the first facial attribute type to achieve better accuracy.

[0113] In one possible implementation, the preset feature extraction network can be pre-configured. As an example, the number of rows in the preset feature extraction network can be the target number of channels indicated by the compression, and the number of columns can be the number of channels in the face liveness detection model for the first face attribute type. As another example, for subsequent compression of the face liveness detection model using re-parameters, the preset feature extraction network can be an identity matrix.

[0114] In step S203, facial difference features are extracted from the first face image and the second face image respectively based on the first feature extraction network to obtain the first face liveness feature corresponding to the first face image and the second face liveness feature corresponding to the second face image.

[0115] In the embodiments of this specification, a first face image can be input into a first feature extraction network to extract face difference features and obtain a first face liveness feature of a first face attribute type; and a second face image can be input into the first feature extraction network to extract face difference features and obtain a second face liveness feature of a second face attribute type.

[0116] In step S205, the first similarity information between the first face liveness feature and the second face liveness feature, and the second similarity information between the first feature extraction network and the preset feature extraction network are determined; the preset feature extraction network refers to a preset network used to extract the face difference features of the second face image.

[0117] The second similarity information can be the similarity information between the feature matrices of the preset feature extraction network and the first feature extraction network. The feature matrix in the first feature extraction network can refer to the matrix of convolutional kernels in the first feature extraction network, and can be an N*N matrix, such as an identity matrix. N can be an integer greater than 1; as an example, N can be 4, but this disclosure does not limit it.

[0118] It should be noted that, in the case of at least two face attribute types, the similarity information between the preset feature extraction network and the first feature extraction network of any face attribute type can be determined separately, so that the sum of the similarity information of at least two face attribute types can be used as the second similarity information.

[0119] In the embodiments of this specification, domain similarity constraints can be used to dynamically adjust the preset feature extraction network for the second face attribute type, thereby compressing the preset feature extraction network. For example... Figure 4 As shown, as an example, Pearson correlation can be used to determine the first similarity information and the second similarity information.

[0120] In step S207, the preset feature extraction network is compressed based on the first similarity information and the second similarity information to obtain the third feature extraction network.

[0121] In one possible implementation, step S207 may include: determining second loss information based on first similarity information and second similarity information, for example, the sum of the first and second similarity information can be used as the second loss information. This second loss information can be calculated using L1 constraints, which ensure that the structure of the liveness detection model for the first face attribute type matches the structure of the liveness detection model for the second face attribute type.

[0122] Furthermore, a pre-defined feature extraction network can be trained based on the second loss information until the loss condition is met, resulting in a third feature extraction network. The loss condition can be a loss threshold; for example, the loss threshold can be 0, and this disclosure does not limit this. The pre-defined feature extraction network can be an N*N matrix, and the number of rows in the compressed third feature extraction network can be less than N, while the number of columns can still be N.

[0123] By designing correlation constraints for different face attribute types, the differential feature extraction network for the second face attribute type can be dynamically pruned during training based on the similarity between the second and first face attribute types.

[0124] In step S209, based on the third feature extraction network and the second feature extraction network, the face liveness detection model used for the first face image is compressed to obtain the target face liveness detection model used for liveness detection of the second face image.

[0125] In one possible implementation, the face liveness detection model of the first face image can be compressed using a reparameterization method based on the model parameters of the second and third feature extraction networks to obtain a target face liveness detection model for liveness detection of the second face image. Specifically, as... Figure 5 As shown, the following steps may be included:

[0126] The second face image is input into the face liveness detection model used for the first face image (e.g., Figure 5 The convolution shown is used to obtain liveness detection features;

[0127] The liveness detection features are multiplied by the model parameters of the second feature extraction network to obtain the first face liveness prediction features; the model parameters of the second feature extraction network can refer to the matrix of convolution kernels in the second feature extraction network.

[0128] The liveness detection features are multiplied by the model parameters of the third feature extraction network to obtain the second face liveness prediction features.

[0129] Based on the first face liveness prediction features and the second face liveness prediction features, penalty constraint information is obtained;

[0130] The second and third feature extraction networks are compressed using penalty constraint information to obtain the first general feature extraction network and the first differential feature extraction network corresponding to the second face image.

[0131] The face liveness detection model for the first face image is processed by interacting with the first general feature extraction network and the first differential feature extraction network to obtain the target face liveness detection model for the second face image. For example, the face liveness detection model for the first face image can be multiplied by the first general feature extraction network and the first differential feature extraction network to obtain the target face liveness detection model for the second face image.

[0132] like Figure 5As shown, a reparameterization method (ResRep method, Gradient Resetting, Convolutional Re-parameterization) can be used to compress the face liveness detection model corresponding to the first face attribute type. In this compression method, the model parameters of the second and third feature extraction networks can be used as additional transformation matrices in the ResRep method to retain most of the discriminative features. Specifically, for a convolutional parameter (such as the convolutional layer of the face liveness detection model corresponding to the first face attribute type), the model parameters of the second and third feature extraction networks can be learned separately. Furthermore, penalty constraints (such as L1 loss) can be used to prune the number of channels in the convolutional parameters.

[0133] Specifically, such as Figure 5 As shown, the second face image can be input into the face liveness detection model corresponding to the first face attribute type (i.e., the face liveness detection model used for the first face image) to obtain liveness detection features. These features can then be multiplied by the model parameters of the second feature extraction network to obtain the first face liveness prediction features. Furthermore, the liveness detection features can be multiplied by the model parameters of the third feature extraction network to obtain the second face liveness prediction features. Further, penalty constraint information, such as L1 loss information, can be obtained based on the first and second face liveness prediction features. This penalty constraint information can then be used to compress the model parameters of the second and third feature extraction networks. For example, gradient information can be calculated based on the penalty constraint information, and the modified SGD method in the ResRep method can be used to trim the model parameters of the second and third feature extraction networks, respectively, to obtain the first general feature extraction network and the first differential feature extraction network corresponding to the second face attribute type—that is, the compressed model parameters of the second and third feature extraction networks. Figure 5 As shown, the number of rows in the compressed second feature extraction network and the compressed third feature extraction network are reduced.

[0134] Furthermore, the face liveness detection model corresponding to the first face attribute type can be multiplied with the first general feature extraction network to obtain the general feature extraction network corresponding to the second face attribute type, which is used to identify and extract the general facial features of the second face attribute type. Similarly, the face liveness detection model corresponding to the first face attribute type can be multiplied with the first differential feature extraction network to obtain the differential feature extraction network corresponding to the second face attribute type, which is used to identify and extract the differential facial features of the second face attribute type. Thus, the general feature extraction network and the differential feature extraction network obtained here can be merged to obtain the face liveness detection model corresponding to the second face attribute type, which can then be used for face liveness detection of the second face attribute type.

[0135] By employing reparameter-based model compression, the most effective set of discriminative features can be selected to the maximum extent. Furthermore, the face liveness detection model corresponding to the first face attribute type is multiplied by the first general feature extraction network and the first differential feature extraction network to obtain the face liveness detection model corresponding to the second face attribute type. This achieves separate pruning of the domain-shared network and the domain-dissimilar network in the face liveness detection model, realizing domain-aware model compression.

[0136] In another possible implementation, step S209 above may include:

[0137] A third feature extraction network is used to prune the channels in the face liveness detection model for the first face image, resulting in a first sub-network. A second feature extraction network can then be used to prune the channels in the same model, resulting in a second sub-network. This pruning process can be a dot product operation. The first and second sub-networks can then be merged to obtain the target face liveness detection model for detecting liveness in the second face image.

[0138] By using the third feature extraction network and the second feature extraction network, the face liveness detection model is pruned separately, achieving the goal of pruning the structure that extracts general features and the structure that extracts differential features from the domain in the face liveness detection model.

[0139] Optionally, such as Figure 6 As shown, the compression method for the face liveness detection model can further include: performing principal component analysis (PCA) on the second and third feature extraction networks respectively to obtain the first principal component information corresponding to the second feature extraction network and the second principal component information corresponding to the third feature extraction network. This first and second principal component information can characterize the redundancy of general features and the redundancy of differential features (i.e.,...). Figure 6 (Shared feature redundancy and heterogeneous feature redundancy).

[0140] Furthermore, the first principal component information and the second principal component information can be balanced to obtain a balanced second general feature extraction network and a second differential feature extraction network. As an example, the first percentage of the first M principal components in the first principal component information and the second percentage of the first M principal components in the second principal component information can be obtained respectively. These first and second percentages can be adjusted so that the difference between them is less than a threshold, thus achieving a balance between the first and second percentages, i.e., achieving a balance between the first and second principal component information. Here, M can be an integer greater than 1.

[0141] Accordingly, step S209 may include: compressing the face liveness detection model used for the first face image based on the second general feature extraction network and the second differential feature extraction network to obtain a target face liveness detection model used for liveness detection of the second face image. The specific implementation here can be found in the corresponding processing method of step S209 above, except that the content upon which the compression processing is based is changed from the second and third feature extraction networks to the second general feature extraction network and the second differential feature extraction network. The specific processing method will not be elaborated further here.

[0142] By evaluating the information redundancy of the second and third feature extraction networks separately and making them compete to improve the compression ratio while ensuring the richness of network features, it can cover both the attack types of the second face attribute type and general attack types, which is quite comprehensive.

[0143] Figure 7 This is a block diagram of a compression device for a face liveness detection model according to an exemplary embodiment. (Refer to...) Figure 7 The device may include:

[0144] The acquisition module 701 is configured to acquire a first face image, a second face image, and a feature decoupling model; the face attribute type of the first face image is different from that of the second face image; the feature decoupling model is trained based on sample face images under the face attribute type of the first face image; the feature decoupling model includes a first feature extraction network for extracting face difference features and a second feature extraction network for extracting face general features.

[0145] The differential feature extraction module 703 is configured to perform facial differential feature extraction on the first face image and the second face image respectively based on the first feature extraction network, so as to obtain the first face liveness feature corresponding to the first face image and the second face liveness feature corresponding to the second face image.

[0146] The similarity determination module 705 is configured to determine first similarity information between the first face liveness feature and the second face liveness feature, and second similarity information between the first feature extraction network and a preset feature extraction network; the preset feature extraction network refers to a preset network used to extract facial difference features of the second face image;

[0147] The third feature extraction network acquisition module 707 is configured to perform compression processing on the preset feature extraction network based on the first similarity information and the second similarity information to obtain the third feature extraction network;

[0148] The face liveness detection model acquisition module 709 is configured to perform compression processing on the face liveness detection model used for the first face image based on the third feature extraction network and the second feature extraction network, so as to obtain a target face liveness detection model used for liveness detection of the second face image.

[0149] By acquiring first and second face images with different face attribute types, and a feature decoupling model corresponding to the first face image, and this feature decoupling model can separate the common features and differential features of the face, the decoupling and extraction of face liveness features are realized. Then, by combining the first similarity information between the first and second face liveness features, and the second similarity information between the first feature extraction network and the preset feature extraction network, the preset feature extraction network is compressed, and based on the third feature extraction network and the second feature extraction network, the face liveness detection model for the first face image is compressed to obtain the target face liveness detection model for the second face image. This accurately and quickly transfers the liveness detection knowledge under the face attribute type of the first face image to the liveness detection model under the face attribute type of the second face image, which can reduce the complexity of the face liveness detection model corresponding to the second face image and improve the accuracy of face liveness detection for the second face image.

[0150] In one possible implementation, the above-mentioned apparatus may further include:

[0151] The training sample acquisition module is configured to acquire the liveness label information corresponding to the face image of the sample;

[0152] The feature extraction module is configured to input the sample face image into the corresponding initial decoupling model, perform face difference feature and face general feature extraction processing, and obtain sample general features and sample difference features;

[0153] The discrimination module is configured to execute a discrimination result by inputting the general features of the sample into a domain discriminator.

[0154] The classification module is configured to input the sample difference features into the corresponding classifier to obtain the classification result;

[0155] The first training module is configured to execute a first loss information between the classification result and the liveness label information to train the differential feature extraction network in the initial decoupling model, thereby obtaining the first feature extraction network.

[0156] The second training module is configured to train the general feature extraction network in the initial decoupling model based on the discrimination result, so as to obtain the second feature extraction network.

[0157] The merging module is configured to merge the first feature extraction network and the second feature extraction network to obtain the feature decoupling model.

[0158] In one possible implementation, the third feature extraction network acquisition module 707 may include:

[0159] The loss information determination unit is configured to determine second loss information based on the first similarity information and the second similarity information;

[0160] The network training unit is configured to train the preset feature extraction network based on the second loss information until the loss condition is met, thereby obtaining the third feature extraction network.

[0161] In one possible implementation, the face liveness detection model acquisition module 709 may include:

[0162] The liveness detection unit is configured to input the second face image into the face liveness detection model used for the first face image to obtain liveness detection features;

[0163] The first face liveness prediction feature acquisition unit is configured to perform a dot product of the liveness detection feature and the model parameters of the second feature extraction network to obtain the first face liveness prediction feature.

[0164] The second face liveness prediction feature acquisition unit is configured to perform a dot product of the liveness detection features and the model parameters of the third feature extraction network to obtain the second face liveness prediction features.

[0165] The constraint unit is configured to perform a penalty constraint based on the first face liveness prediction feature and the second face liveness prediction feature.

[0166] The compression unit is configured to perform compression processing on the second feature extraction network and the third feature extraction network respectively using the penalty constraint information to obtain the first general feature extraction network and the first differential feature extraction network corresponding to the second face image;

[0167] The model parameter interaction unit is configured to perform model parameter interaction processing between the face liveness detection model for the first face image and the first general feature extraction network and the first differential feature extraction network, respectively, to obtain the target face liveness detection model for liveness detection of the second face image.

[0168] In one possible implementation, the face liveness detection model acquisition module 709 may include:

[0169] The first sub-network acquisition unit is configured to perform pruning processing on the channels in the face liveness detection model for the first face image using the third feature extraction network to obtain the first sub-network;

[0170] The second sub-network acquisition unit is configured to perform pruning processing on the channels in the face liveness detection model for the first face image using the second feature extraction network to obtain the second sub-network;

[0171] The sub-mesh merging unit is configured to merge the first sub-network and the second sub-network to obtain the target face liveness detection model for liveness detection of the second face image.

[0172] In one possible implementation, the device may further include:

[0173] The principal component analysis module is configured to perform principal component analysis on the second feature extraction network and the third feature extraction network respectively, to obtain the first principal component information corresponding to the second feature extraction network and the second principal component information corresponding to the third feature extraction network.

[0174] The equalization processing module is configured to perform equalization processing on the first principal component information and the second principal component information to obtain the equalized second general feature extraction network and the second differential feature extraction network.

[0175] Accordingly, the face liveness detection model acquisition module is further configured to perform compression processing on the face liveness detection model used for the first face image based on the second general feature extraction network and the second differential feature extraction network, so as to obtain a target face liveness detection model used for liveness detection of the second face image.

[0176] In one possible implementation, the equalization processing module may include:

[0177] The principal component percentage acquisition unit is configured to acquire the first percentage occupied by the first M principal components in the first principal component information and the second percentage occupied by the first M principal components in the second principal component information; where M is an integer greater than 1;

[0178] The equalization processing unit is configured to perform adjustments on the first percentage and the second percentage until the difference between the first percentage and the second percentage is less than a threshold, and to use the second feature extraction network when the difference is less than the threshold as the second general feature extraction network, and to use the third feature extraction network when the difference is less than the threshold as the second differential feature extraction network.

[0179] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0180] Figure 8 This is a block diagram illustrating an electronic device for compressing a face liveness detection model according to an exemplary embodiment. The electronic device may be a terminal, and its internal structure diagram may be as follows: Figure 8 As shown, the electronic device includes a processor, memory, network interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The network interface is used to communicate with external terminals via a network connection. When executed by the processor, the computer program implements a method for face liveness detection using a compressed face liveness detection model. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad mounted on the device's casing, or an external keyboard, touchpad, or mouse.

[0181] Those skilled in the art will understand that Figure 8The structure shown is merely a block diagram of a portion of the structure related to the present disclosure and does not constitute a limitation on the electronic device to which the present disclosure is applied. A specific electronic device may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0182] Figure 9 This is a block diagram illustrating an electronic device for compressing a face liveness detection model according to an exemplary embodiment. The electronic device may be a server, and its internal structure diagram may be as follows: Figure 9 As shown, the electronic device includes a processor, memory, and a network interface connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The network interface is used to communicate with external terminals via a network connection. When executed by the processor, the computer program implements a method for compressing a face liveness detection model.

[0183] Those skilled in the art will understand that Figure 9 The structure shown is merely a block diagram of a portion of the structure related to the present disclosure and does not constitute a limitation on the electronic device to which the present disclosure is applied. A specific electronic device may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0184] In an exemplary embodiment, an electronic device is also provided, including: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to execute the instructions to implement a compression method for a face liveness detection model as described in the embodiments of this disclosure.

[0185] In an exemplary embodiment, a computer-readable storage medium is also provided, which, when executed by a processor of an electronic device, enables the electronic device to perform the compression method of the face liveness detection model in this disclosure. The computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, or optical data storage device, etc.

[0186] In an exemplary embodiment, a computer program product including instructions is also provided, which, when run on a computer, causes the computer to perform a method for compressing a face liveness detection model according to embodiments of the present disclosure.

[0187] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.

[0188] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.

[0189] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.

Claims

1. A compression method for a face liveness detection model, characterized in that, include: Acquire the first face image, the second face image, and the feature decoupling model; The face attribute type of the first face image is different from that of the second face image. The feature decoupling model is trained based on sample face images under the face attribute type of the first face image. The feature decoupling model includes a first feature extraction network for extracting face difference features and a second feature extraction network for extracting face general features. Based on the first feature extraction network, facial difference features are extracted from the first face image and the second face image respectively to obtain the first face liveness feature corresponding to the first face image and the second face liveness feature corresponding to the second face image. The first similarity information between the first face liveness feature and the second face liveness feature, and the second similarity information between the first feature extraction network and the preset feature extraction network are determined; the preset feature extraction network refers to a preset network used to extract facial difference features of the second face image; Based on the first similarity information and the second similarity information, the preset feature extraction network is compressed to obtain a third feature extraction network; Based on the third feature extraction network and the second feature extraction network, the face liveness detection model used for the first face image is compressed to obtain the target face liveness detection model used for liveness detection of the second face image.

2. The method according to claim 1, characterized in that, The feature decoupling model is obtained through the following steps: Obtain the liveness tag information corresponding to the sample face image; The sample face image is input into the corresponding initial decoupling model to perform face difference feature and face general feature extraction processing to obtain sample general features and sample difference features; The general features of the samples are input into the domain discriminator to obtain the discrimination result; The sample difference features are input into the corresponding classifier to obtain the classification result; Based on the first loss information between the classification result and the liveness label information, the differential feature extraction network in the initial decoupling model is trained to obtain the first feature extraction network. Based on the discrimination result, the general feature extraction network in the initial decoupling model is trained to obtain the second feature extraction network; The first feature extraction network and the second feature extraction network are combined to obtain the feature decoupling model.

3. The method according to claim 1, characterized in that, The step of compressing the preset feature extraction network based on the first similarity information and the second similarity information to obtain the third feature extraction network includes: Based on the first similarity information and the second similarity information, determine the second loss information; The preset feature extraction network is trained based on the second loss information until the loss condition is met, thus obtaining the third feature extraction network.

4. The method according to claim 1, characterized in that, The step of compressing the face liveness detection model for the first face image based on the third feature extraction network and the second feature extraction network to obtain a target face liveness detection model for liveness detection of the second face image includes: The second face image is input into the face liveness detection model used for the first face image to obtain liveness detection features; The liveness detection features are multiplied by the model parameters of the second feature extraction network to obtain the first face liveness prediction features; The liveness detection features are multiplied by the model parameters of the third feature extraction network to obtain the second face liveness prediction features; Based on the first face liveness prediction features and the second face liveness prediction features, penalty constraint information is obtained. The second feature extraction network and the third feature extraction network are compressed using the penalty constraint information to obtain the first general feature extraction network and the first differential feature extraction network corresponding to the second face image; The face liveness detection model for the first face image is processed by interacting with the first general feature extraction network and the first differential feature extraction network to obtain the target face liveness detection model for the second face image.

5. The method according to claim 1, characterized in that, The step of compressing the face liveness detection model for the first face image based on the third feature extraction network and the second feature extraction network to obtain a target face liveness detection model for the second face image includes: The third feature extraction network is used to prune the channels in the face liveness detection model for the first face image to obtain the first sub-network; The second feature extraction network is used to prune the channels in the face liveness detection model for the first face image to obtain a second sub-network; The first sub-network and the second sub-network are merged to obtain the target face liveness detection model used for liveness detection of the second face image.

6. The method according to any one of claims 1-5, characterized in that, The method further includes: Principal component analysis is performed on the second feature extraction network and the third feature extraction network respectively to obtain the first principal component information corresponding to the second feature extraction network and the second principal component information corresponding to the third feature extraction network. The first principal component information and the second principal component information are balanced to obtain the balanced second general feature extraction network and the second differential feature extraction network. The step of compressing the face liveness detection model for the first face image based on the third feature extraction network and the second feature extraction network to obtain a target face liveness detection model for the second face image includes: Based on the second general feature extraction network and the second differential feature extraction network, the face liveness detection model used for the first face image is compressed to obtain the target face liveness detection model used for liveness detection of the second face image.

7. The method according to claim 6, characterized in that, The step of balancing the first principal component information and the second principal component information to obtain the balanced second general feature extraction network and the second differential feature extraction network includes: Obtain the first percentage occupied by the first M principal components in the first principal component information and the second percentage occupied by the first M principal components in the second principal component information; where M is an integer greater than 1; The first percentage and the second percentage are adjusted until the difference between the first percentage and the second percentage is less than a threshold. The second feature extraction network when the difference is less than the threshold is used as the second general feature extraction network, and the third feature extraction network when the difference is less than the threshold is used as the second differential feature extraction network.

8. A compression device for a face liveness detection model, characterized in that, include: The acquisition module is configured to acquire the first face image, the second face image, and the feature decoupling model; The face attribute type of the first face image is different from that of the second face image. The feature decoupling model is trained based on sample face images under the face attribute type of the first face image. The feature decoupling model includes a first feature extraction network for extracting face difference features and a second feature extraction network for extracting face general features. The differential feature extraction module is configured to perform facial differential feature extraction on the first face image and the second face image respectively based on the first feature extraction network, so as to obtain the first face liveness feature corresponding to the first face image and the second face liveness feature corresponding to the second face image; The similarity determination module is configured to determine first similarity information between the first face liveness feature and the second face liveness feature, and second similarity information between the first feature extraction network and a preset feature extraction network; the preset feature extraction network refers to a preset network used to extract facial difference features of the second face image; The third feature extraction network acquisition module is configured to perform compression processing on the preset feature extraction network based on the first similarity information and the second similarity information to obtain the third feature extraction network; The face liveness detection model acquisition module is configured to perform compression processing on the face liveness detection model used for the first face image based on the third feature extraction network and the second feature extraction network, so as to obtain the target face liveness detection model used for liveness detection of the second face image.

9. An electronic device, characterized in that, include: processor; Memory used to store the processor's executable instructions; The processor is configured to execute the instructions to implement the compression method for the face liveness detection model as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, When the instructions in the computer-readable storage medium are executed by the processor of the electronic device, the electronic device is enabled to perform the compression method of the face liveness detection model as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Image processing method and device, face replacement model processing method and device and electronic equipment

    CN114937115A

  • Gating model for video analysis

    US20200293783A1