A method, device, and medium for training a live detection model

By acquiring the first dataset and training the liveness detection model using clustering algorithms and adversarial learning, the problem of adapting the liveness attack detection model to unknown new scenarios was solved, achieving higher recognition accuracy and robustness.

CN115578796BActive Publication Date: 2026-05-29ALIPAY (HANGZHOU) INFORMATION TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
Filing Date
2022-09-20
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

Existing liveness detection models are not well-suited for deployment in unknown new scenarios and cannot accurately identify whether an attacker is alive.

Method used

By acquiring the first dataset, a clustering algorithm is used to determine the second label of the data. Based on the second dataset, the initial liveness detection model is trained using adversarial learning to obtain the trained liveness detection model.

Benefits of technology

This enables the trained liveness detection model to adapt to unknown new scenarios, improving recognition accuracy and robustness in new scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115578796B_ABST
    Figure CN115578796B_ABST
Patent Text Reader

Abstract

Embodiments of the present specification disclose a method and device for training a living body detection model, and a medium. The method can include: obtaining a first data set; data in the first data set includes a first label; the first label is used to represent living body attribute information of the data; using a clustering algorithm, determining a second label of the data in the first data set, obtaining a second data set; the data in the second data set includes the first label and the second label; the second label is used to represent domain attribute information of the data; and training an initial living body detection model in an adversarial learning manner based on the second data set, obtaining a trained living body detection model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of model training technology, and in particular to a training method, apparatus, device and medium for a liveness detection model. Background Technology

[0002] With the continuous development of facial recognition systems in recent years, "liveness detection" has become an indispensable part of these systems, effectively intercepting non-liveness attack samples. However, as facial recognition systems are increasingly applied to more fields, they encounter various scene effects with vastly different characteristics. How to ensure that a liveness detection model can adapt seamlessly to deployments in unknown new scenarios is a pressing technical problem that needs to be solved. Summary of the Invention

[0003] This specification provides a training method, apparatus, device, and medium for a liveness detection model to address the problem that existing liveness attack detection models are not suitable for deployment in unknown new scenarios.

[0004] To solve the above-mentioned technical problems, the embodiments in this specification are implemented as follows:

[0005] This specification provides an embodiment of a method for training a liveness detection model, comprising:

[0006] Obtain a first dataset; the data in the first dataset includes a first label; the first label is used to represent the liveness attribute information of the data;

[0007] A clustering algorithm is used to determine the second label of the data in the first dataset, resulting in a second dataset; the data in the second dataset includes the first label and the second label; the second label is used to represent the domain attribute information of the data.

[0008] The initial liveness detection model is trained using adversarial learning based on the second dataset to obtain the trained liveness detection model.

[0009] This specification provides an embodiment of a training device for a liveness detection model, comprising:

[0010] The data acquisition module is used to acquire a first dataset; the data in the first dataset includes a first label; the first label is used to represent the liveness attribute information of the data;

[0011] A data determination module is used to use a clustering algorithm to determine the second label of the data in the first dataset, thereby obtaining a second dataset; the data in the second dataset includes the first label and the second label; the second label is used to represent the domain attribute information of the data.

[0012] The model training module is used to train the initial liveness detection model using an adversarial learning approach based on the second dataset, thereby obtaining the trained liveness detection model.

[0013] This specification provides an embodiment of a training device for a liveness detection model, comprising:

[0014] At least one processor; and,

[0015] A memory communicatively connected to the at least one processor; wherein,

[0016] The memory stores instructions that can be executed by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to:

[0017] Obtain a first dataset; the data in the first dataset includes a first label; the first label is used to represent the liveness attribute information of the data;

[0018] A clustering algorithm is used to determine the second label of the data in the first dataset, resulting in a second dataset; the data in the second dataset includes the first label and the second label; the second label is used to represent the domain attribute information of the data.

[0019] The initial liveness detection model is trained using adversarial learning based on the second dataset to obtain the trained liveness detection model.

[0020] This specification provides an embodiment of a computer-readable medium storing computer-readable instructions that can be executed by a processor to implement a training method for a liveness detection model.

[0021] One embodiment of this specification achieves the following beneficial effects: by acquiring a first dataset, employing a clustering algorithm to determine second labels for representing the domain attribute information of the data in the first dataset, a second dataset is obtained. Based on the second dataset, an initial liveness detection model is trained using adversarial learning to obtain a trained liveness detection model. This allows the trained liveness detection model to adapt to unknown new scenarios. Attached Figure Description

[0022] To more clearly illustrate the technical solutions in the embodiments or prior art of this specification, the drawings used in the description of the embodiments or prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0023] Figure 1 This is a schematic diagram of the overall architecture of a training method for a liveness detection model provided in the embodiments of this specification;

[0024] Figure 2 This is a schematic flowchart illustrating a training method for a liveness detection model provided in the embodiments of this specification.

[0025] Figure 3 This is a training schematic diagram of a training method for a liveness detection model provided in the embodiments of this specification;

[0026] Figure 4 This is a schematic flowchart of a training device for a liveness detection model provided in the embodiments of this specification;

[0027] Figure 5 This is a schematic diagram of the structure of a training device for a liveness detection model provided in the embodiments of this specification. Detailed Implementation

[0028] To make the objectives, technical solutions, and advantages of one or more embodiments of this specification clearer, the technical solutions of one or more embodiments of this specification will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this specification, and not all of them. Based on the embodiments in this specification, all other embodiments obtained by those skilled in the art without creative effort are within the protection scope of one or more embodiments of this specification.

[0029] The technical solutions provided in the various embodiments of this specification are described in detail below with reference to the accompanying drawings.

[0030] In existing technologies, with the continuous development of facial recognition systems in recent years, "liveness attack detection" has become an indispensable part of facial recognition systems. This model can effectively intercept non-liveness attack samples. However, as facial recognition systems are increasingly applied to more fields, they encounter various scene effects with vastly different characteristics. Therefore, existing liveness attack detection models are not suitable for deployment in unknown new scenarios and cannot accurately identify whether an individual is a live person.

[0031] To address the shortcomings of existing technologies, this solution provides the following embodiments:

[0032] Figure 1 This is a schematic diagram illustrating the overall architecture of a liveness detection model training method as described in this specification, applied in a real-world scenario. Figure 1As shown, the scheme mainly includes: dataset 1, server 2, and liveness detection model 3. In practical applications, dataset 1 can be used to train the liveness detection model 3 on server 2. Specifically, the data in dataset 1 obtained by server 2 can include a first label; then, a clustering algorithm is used to determine the second label of each data point in dataset 1, resulting in a second dataset; based on the second dataset containing data labeled with both the first and second labels, the initial liveness detection model is trained using adversarial learning to obtain the trained liveness detection model 3. This allows the final liveness detection model to adapt to unknown new scenarios.

[0033] Next, a training method for a liveness detection model provided in the embodiments of the specification will be described in detail with reference to the accompanying drawings:

[0034] Figure 2 This is a flowchart illustrating a training method for a liveness detection model provided in an embodiment of this specification. From a programming perspective, the entity executing the process can be a program hosted on an application server or an application client.

[0035] like Figure 2 As shown, the process may include the following steps:

[0036] Step 202: Obtain a first dataset; the data in the first dataset includes a first label; the first label is used to represent the liveness attribute information of the data.

[0037] In the embodiments of this specification, the first dataset can be existing historical liveness detection data, such as historical images already identified by the initial liveness detection model. Liveness attribute information can indicate whether the object corresponding to the training data is live. For example, the training data can include collected images of live objects, with the first label for these images being a liveness label; it can also include collected images of non-live objects, with the first label for these images being a non-liveness or attack label. Furthermore, images identified as live by the initial liveness detection model can be used as data labeled with a liveness label, while images identified as non-live by the initial liveness detection model can be used as data labeled with a non-liveness or attack label.

[0038] In practical applications, historical liveness detection data can also include historical images identified by other liveness detection models that have already been used, in addition to the initial liveness detection model mentioned above. For example, the initial liveness detection model is the liveness detection model used in a shopping mall, while other liveness detection models can be liveness detection models used in places such as residential communities, office buildings, and parking lots, or liveness detection models used in other shopping malls, supermarkets, and other consumer settings.

[0039] Step 204: Use a clustering algorithm to determine the second label of the data in the first dataset to obtain the second dataset; the data in the second dataset includes the first label and the second label; the second label is used to represent the domain attribute information of the data.

[0040] In the embodiments of this specification, domain attribute information can be used to represent the virtual domain to which the data belongs. A virtual domain can be understood as a classification of data based on preset partitioning conditions; one category can represent one virtual domain. In practical applications, data from different sources are generally considered to be different domains, and data collected by different acquisition devices can also be considered to be different domains. As long as the model's performance differs significantly between the two data domains, they can be considered two different domains. In the embodiments of this specification, the virtual domain can represent the data domain partitioned in the feature space using a clustering algorithm.

[0041] To reduce the impact of human intervention on model training, the embodiments in this specification can use a clustering algorithm to divide the data in the first dataset into multiple different types of data. These different types of data can be considered to correspond to different virtual domains. These data are labeled with different domain attribute information, and these different domain attribute information labels can all be called second labels.

[0042] The clustering algorithm described in the embodiments of this specification may be at least one of the following algorithms to perform clustering analysis on the training data: CLARANS algorithm, BIRCH algorithm, CURE algorithm, OPTICS algorithm, CLIQUE algorithm, graph theory clustering method, and / or model algorithm.

[0043] Step 206: Train the initial liveness detection model using adversarial learning based on the second dataset to obtain the trained liveness detection model.

[0044] In the embodiments of this specification, the data used to train the liveness detection model may include a first label representing the liveness attribute information of the data and a second label representing the domain attribute information of the training data. This allows the liveness detection model to complete two recognition tasks: accurately identifying whether the object to be identified is live or not, and identifying the domain to which the object to be identified belongs. These two recognition tasks form an adversarial task during model training. By training the initial liveness detection model through adversarial learning, the robustness of the liveness detection model in domain identification can be achieved, which is beneficial to obtaining a more robust cross-domain liveness attack detection model.

[0045] Non-living objects can include identification objects in the form of photos, mobile phones, screens, masks, etc.

[0046] In practical applications, when iteratively training a model, preset conditions can be set to indicate when training can end, such as the number of iterations, the model loss value, etc. In the embodiments of this specification, the training of the model can be terminated based on the model loss value. Specifically, if the adversarial learning loss of the trained liveness detection model meets the preset conditions, such as the adversarial learning loss value being less than or equal to the preset loss value, it indicates that the trained liveness detection model meets the requirements and training can be terminated and applied. If the preset conditions are not met, such as the adversarial learning loss value being greater than the preset loss value, it indicates that the trained liveness detection model does not meet the requirements and training needs to continue. When conducting the next round of iterative training, the liveness detection model obtained after the previous round of training can be used as the initial liveness detection model for the next round of training. The clustering algorithm used in the new round of training can be the same as or different from the clustering algorithm used in the previous round. The number of clusters can also be the same as or different from the previous round. Therefore, the labels of the domain attribute information of the training data can also be the same or different. Specific settings can be made according to actual needs, and no specific limitations are made here. To improve the robustness of the trained liveness detection model, the clustering algorithm and / or number of clusters in each round of iterative training can be randomly selected.

[0047] It should be understood that the order of some steps in the methods described in one or more embodiments of this specification may be interchanged according to actual needs, or some steps may be omitted or deleted.

[0048] Figure 2 The method described above involves acquiring a first dataset, using a clustering algorithm to determine the second labels for the data in the first dataset, thus obtaining a second dataset. Based on this second dataset, an initial liveness detection model is trained using adversarial learning to obtain a trained liveness detection model. This allows the trained liveness detection model to adapt seamlessly to unknown new scenes and improves the accuracy of recognition in new scenes.

[0049] based on Figure 2 In addition to the method described herein, this specification also provides some specific implementation schemes of the method, which will be described below.

[0050] Optionally, the training of the initial liveness detection model based on the second dataset using adversarial learning as described in the embodiments of this specification may specifically include:

[0051] The initial liveness detection model is trained using meta-learning on the second dataset in an adversarial learning manner.

[0052] Meta-learning, also known as "learning to learn," utilizes prior knowledge and experience to guide the learning of new tasks, enabling the model to learn how to learn. In the embodiments of this specification, meta-learning enhances the generalization ability of the liveness detection model across multiple domains. Meta-learning requires sampling of both the domain and the data, ensuring accurate identification of data in different domains, and consequently, in domains where data is not yet encountered. Through meta-learning, the liveness detection model continuously adapts to each domain, endowing it with an abstract learning capability.

[0053] In the embodiments described in this specification, the data in the second dataset is divided into multiple groups for meta-learning, rather than performing meta-learning on the entire second dataset in the traditional sense. This is beneficial for improving the model's learning efficiency, model convergence, and training efficiency.

[0054] To better train the model using adversarial learning, the embodiments of this specification describe training the initial liveness detection model using adversarial learning on the second dataset to obtain the trained liveness detection model, which may specifically include:

[0055] Obtain several data subsets from the second dataset; each data subset contains a predetermined number of data sets from the second dataset that include both the first label and the second label;

[0056] The initial liveness detection model is trained using adversarial learning with each subset of data to obtain the trained liveness detection model.

[0057] In the embodiments described in this specification, a preset number of training data points can be selected from the second training dataset as a data subset, or the data in the second dataset can be divided into several data subsets. The preset number can be set according to actual needs. For example, if the preset number is 100, then the second training dataset is divided into several data subsets containing 100 data points each. Each subset contains 100 data points labeled with a first label and a second label, and no labels are missing due to grouping. This data can also be understood as training samples.

[0058] In the embodiments of this specification, the liveness detection model can be trained using various data subsets. Since the data in each subset also includes a first label and a second label, the liveness detection model can be trained using adversarial learning.

[0059] To make fuller use of the training data, the embodiments of this specification describe using various data subsets to train the initial liveness detection model in an adversarial learning manner to obtain a trained liveness detection model, which may specifically include:

[0060] Using any subset of data from each data subset, the initial liveness detection model is trained in an adversarial learning manner for a preset number of in-round iterations to obtain a preset number of in-round adversarial loss values ​​and the trained liveness detection model.

[0061] In the embodiments of this specification, in-round iterative training can refer to training a liveness detection model using any subset of data. Specifically, any subset of data can be selected from several subsets, and a certain number of data points are randomly selected from this subset to input into the initial liveness detection model. The initial liveness detection model is then trained iteratively multiple times. During these multiple iterative training processes, the clustering algorithm and / or the number of clusters can be different or the same, and the type and / or number of virtual domains obtained through the clustering algorithm can also be different or the same. This weakens the linear information introduced by human variables when determining the number of virtual domains.

[0062] In the embodiments of this specification, the preset number of iterations can represent the preset number of in-round iterative training sessions for the liveness detection model. For example, the second dataset is divided into 10 subsets of 100 data points each. One subset is randomly selected as the initial data for the initial liveness detection model to begin in-round iterative training. From the selected subset, 50 data points are randomly selected as the initial dataset A. A clustering algorithm is used to cluster the data in dataset A into different classes, each representing a different virtual domain. Based on dataset A, adversarial learning is used for training, resulting in an adversarial learning loss value S1 and a new liveness detection model. This new liveness detection model is then used as the initial liveness detection model. Another 50 data points are randomly selected from the selected subset as dataset B, and these datasets are used as the initial data to input into the new initial liveness detection model for training, resulting in a new adversarial loss value S2 and a new liveness detection model. If the preset number of iterations is 5, the preset number of in-round iterative training sessions is completed according to the above iterative training method, finally yielding the loss value after 5 training sessions and the final liveness detection model. The adversarial loss value can be calculated using existing loss functions.

[0063] It should be understood that the data set selected in the subsequent round of the embodiments of this specification may include the data contained in the data set selected in the previous round. That is, the data in the data subset can be selected repeatedly. Of course, during the intra-round iterative training, different data can also be selected from the data subset for training, so that different data can be used for each intra-round iterative training, which can also improve the robustness of the model. Moreover, the number of data randomly selected each time can be the same or different.

[0064] Clustering algorithms group data with similar characteristics into a single category. This differs slightly from typical classification, which usually involves assigning data to specific categories. Clustering, on the other hand, can operate without explicit categories, simply grouping data with the same characteristics together. In the embodiments described in this specification, clustering algorithms can more objectively represent different virtual domains and reduce the impact of human factors on model training.

[0065] The intra-round adversarial loss value in the embodiments of this specification can represent the adversarial learning loss value obtained after each intra-round iterative training. For example, if an intra-round iterative training is performed using an arbitrary subset of data, and assuming that the intra-round iterative training is performed three times, the adversarial loss value obtained in the first round is S1, the adversarial loss value obtained in the second round is S2, and the adversarial loss value obtained in the third round is S3.

[0066] In practical applications, during iterative training of a liveness detection model, the data can be divided into training data for training the model and test data for testing the model's accuracy. The training subset described in this embodiment may include both training data and test data. Specifically, one round of iterative training within a preset number of rounds of iterative training of the initial liveness detection model using adversarial learning may include:

[0067] Obtain training data and test data from one of the aforementioned subsets of data;

[0068] The initial liveness detection model is trained once using the training data to obtain the liveness detection model trained in the same round.

[0069] The in-round trained liveness detection model is tested using the test data to obtain the in-round adversarial loss value corresponding to the in-round trained liveness detection model.

[0070] In practical applications, new training and test data can be randomly acquired each time the data subset undergoes training iteration. The training data serves as the initial training data for the liveness detection model during in-round iterative training, while the test data is used to test the liveness detection model acquired after each training iteration. This allows the adversarial loss value for that adversarial learning iteration to be obtained after the testing. The test data can be a portion or all of the data from the data subset, and the number of test data and training data selected each time can be different or the same.

[0071] The embodiments in this specification may also include:

[0072] Calculate the average of the preset number of in-round adversarial loss values, and use the average as the adversarial learning loss value corresponding to the trained liveness detection model.

[0073] In the embodiments of this specification, the average of a preset number of intra-round adversarial loss values ​​can be used to represent the average of all adversarial loss values ​​during intra-round iterative training of a subset of data. This average value is then used as the adversarial loss value of the trained liveness detection model. Continuing with the above embodiment as an example: the adversarial loss values ​​for the corresponding three intra-round iterations are S1, S2, and S3, respectively. Therefore, the formula for calculating the adversarial loss value S of the trained model can be: S = (S1 + S2 + S3) / 2

[0074] In the embodiments of this specification, the decision to terminate the model training process can be based on the adversarial learning loss value. Specifically, the methods in the embodiments of this specification may further include:

[0075] If the adversarial learning loss value meets the preset condition, then the training of the trained liveness detection model is stopped;

[0076] If the adversarial learning loss value does not meet the preset condition, the adversarial learning loss value will be backpropagated to the trained liveness detection model for subsequent training.

[0077] In practical applications, if the adversarial learning loss value meets the preset conditions, the trained liveness detection model is considered a satisfactory model, and training stops. If the adversarial loss value does not meet the preset conditions, the obtained adversarial learning loss value can be backpropagated to the trained liveness detection model. This model then serves as the new initial liveness detection model for a new round of iterative training until the loss value meets the preset conditions. During this new round of iterative training, a new subset of data can be selected for training.

[0078] In practical applications, one implementation method is to backpropagate the adversarial learning loss value to the trained liveness detection model. The liveness detection model adjusts its parameters based on the adversarial learning loss value. After adjustment, test data is selected again for testing. If the model still does not meet the preset conditions, data can be selected again for model training until the trained model meets the preset conditions. Another implementation method is to continuously adjust the parameters using the backpropagated adversarial loss value, and then test on test data. When the adjusted parameters and the adversarial loss value of the liveness detection model meet the preset conditions, parameter adjustment stops.

[0079] The clustering algorithm described in the embodiments of this specification may include one or more clustering algorithms. Specifically, when multiple clustering algorithms are used to determine the second label of data, the step of using a clustering algorithm to determine the second label of data in the first dataset may include:

[0080] Obtain the clustering results of each clustering algorithm for the data;

[0081] Based on the weights of each clustering algorithm and the results of each clustering, the clustering category corresponding to each data point is determined.

[0082] Based on the clustering category, a second label is determined for the data.

[0083] In practical applications, a single clustering algorithm can be used to determine the second label of data in a dataset, or multiple clustering algorithms can be used. When multiple clustering algorithms are used, different algorithms may employ different clustering calculation methods, resulting in different clustering results for the same data. In the embodiments of this specification, different clustering algorithms can be assigned their own weights, and the cluster categories corresponding to the data in the dataset are determined by summing these weights. The weights assigned to each clustering algorithm can be the same or different. To reduce the influence of simple weights on the clustering results, the weights assigned to each clustering algorithm can be set to be the same or similar. For example, using three clustering algorithms—Algorithm 1, Algorithm 2, and Algorithm 3—and assuming a cluster size of 2, to determine the clustering accuracy of a dataset containing 20 data points, Algorithm 1 clusters data 1-10 into cluster 1 and data 11-20 into cluster 2. Algorithm 2 clusters data 1-9 into cluster 1 and data 10-20 into cluster 2. Algorithm 3 also clusters data 1-10 into cluster 1 and data 11-20 into cluster 2. Therefore, data 1-9 are clustered into cluster 1. If the weights of Algorithm 1, Algorithm 2, and Algorithm 3 are set to 0.3, then data 10 is indeed in cluster 1. This makes the clustering results more accurate, improving the detection accuracy of the liveness detection model. It should be understood that the two different classes are two different virtual domains.

[0084] The clustering algorithm used in the embodiments of this specification to determine the second label of the data in the first dataset specifically includes:

[0085] The data features of the data are extracted using the initial liveness detection model.

[0086] Based on the data characteristics, a clustering algorithm is used to cluster the data to determine the second label of the data.

[0087] In practical applications, during the training of a liveness detection model, the liveness detection model can extract data features from the data and train the model based on these features. In the embodiments of this specification, the data features used for clustering can be obtained from the liveness detection model. This allows for clustering of data in the dataset without the need for additional feature extraction models or tools, omitting the step of extracting data features during clustering, thus improving clustering efficiency and training model efficiency. It also reduces the use of data feature extraction models and lowers model training costs.

[0088] In practical applications, since clustering algorithms group data with the same or similar characteristics together, data with different characteristics can be understood as data from different domains. Alternatively, in the embodiments of this specification, different virtual domains are constructed through clustering algorithms.

[0089] To improve the recognition accuracy of the liveness detection model, the training data described in the embodiments of this specification includes face images acquired under at least one of different acquisition devices, acquisition times, and acquisition locations;

[0090] And / or, the training data includes adversarial data generated through GANs networks.

[0091] The datasets in the embodiments of this specification may include face images collected under different circumstances, and may also include adversarial data generated by GANs networks to increase the quantity and diversity of data, making the liveness detection model more accurate. The adversarial data generated by GANs networks can be obtained by adding various types of interference data to the original data. The original data may include face images collected under different acquisition devices, acquisition times, acquisition locations, etc.

[0092] In the embodiments of this specification, adversarial learning is performed on the initial liveness detection model based on label data containing liveness attribute labels and domain attribute information. This can be understood as the initial liveness recognition model in the embodiments of this specification including a first sub-model for liveness recognition and a second sub-model for domain recognition; the adversarial learning method is used to represent the adversarial learning between the first sub-model and the second sub-model.

[0093] The training of the initial liveness detection model based on the second dataset using adversarial learning may specifically include:

[0094] The initial liveness detection model is trained using the second dataset to obtain a first loss value corresponding to the first sub-model and a second loss value corresponding to the second sub-model.

[0095] Based on the first loss value and the second loss value, the adversarial learning loss value corresponding to the trained liveness detection model is determined.

[0096] In the embodiments of this specification, the determination of whether the trained liveness detection model meets the requirements can be based on the model's accuracy in recognizing both liveness and domain. This achieves adversarial learning between liveness recognition and domain recognition, enabling a liveness detection model that meets the requirements to accurately identify both liveness and non-liveness, as well as the domain corresponding to the identified object. In other words, for identified objects in different domains, the model can accurately identify whether the identified object is live or non-live, demonstrating stronger robustness and applicability to different scenarios.

[0097] The adversarial learning loss value L in the embodiments of this specification is L = α*L1 + β*L2; where α and β represent weights, α > β; L1 represents the first loss value, and L2 represents the second loss value.

[0098] The liveness detection model in this embodiment focuses more on liveness detection. Therefore, the weight α of the first loss value can be higher than the weight β of the second loss value. For example, if the preset condition is that the adversarial learning loss value L does not exceed 0.1, the weight α of the first loss value is 0.7, the weight β of the second loss value is 0.3, L1 is 0.05, and L2 is 0.2, then L = 0.7 * 0.05 + 0.3 * 0.2 = 0.095. The resulting liveness detection model meets the preset conditions and can be used.

[0099] The above method yields a trained liveness detection model, enabling it to match unknown new scenarios.

[0100] Based on the above training methods Figure 3 This diagram illustrates the training of a liveness detection model, as provided in the embodiments of this specification. Figure 3 As shown, the training diagram may include:

[0101] Step 302: Obtain the initial liveness detection model.

[0102] The initial liveness detection model in the embodiments of this specification may be a liveness detection model that has been used or is in use in a certain occasion or scenario. For example, a model for liveness detection in well-lit places such as shopping malls.

[0103] Step 304: Input the data labeled with a first label containing liveness attribute information and a second label containing domain attribute information into the initial liveness detection model to obtain the features extracted by the initial liveness detection model from the dataset.

[0104] Step 306: Based on the extracted data features, use a clustering algorithm to divide the virtual domain.

[0105] In practical applications, data with similar or identical characteristics are clustered into a single class, representing a virtual domain. After dividing the virtual domains, second labels are determined for the data in the dataset that can represent the attribute information of the domain. This results in a second dataset containing data labeled with both the first and second labels. The data in the second dataset can be the same as those in the first dataset; it can be understood as adding a second label to each data point in the first dataset to obtain the second dataset.

[0106] Step 308: Iteratively train the initial liveness detection model using meta-learning based on the second dataset in an adversarial learning manner.

[0107] In practical applications, the second dataset is divided into several data subsets. Adversarial learning based on meta-learning is then performed on these subsets, and adversarial loss values ​​are obtained through the adversarial learning loss function. This completes cross-domain generation training based on a virtual domain. Cross-domain generation can be achieved by assuming that the data distribution in different scenarios has different domains, and that the data often contains only a limited number of domains. Newly deployed scenarios are considered new domains, and training allows the model to better adapt to the domains of newly deployed scenarios.

[0108] Step 310: Obtain the trained liveness detection model.

[0109] In practical applications, if the trained liveness detection model does not meet the requirements, it can be used as a new initial liveness detection model for retraining. If the trained liveness detection model meets the requirements, training can be stopped, and it can be used. Meeting the requirements means it can be adapted to unknown new scenarios, such as a liveness detection model that can accurately identify live or non-live subjects even in low-light conditions.

[0110] Based on the same idea, embodiments of this specification also provide a training device for a liveness detection model. For example... Figure 4 As shown, the device may include:

[0111] The data acquisition module 402 is used to acquire a first dataset; the data in the first dataset includes a first label; the first label is used to represent the liveness attribute information of the data.

[0112] The data determination module 404 is used to use a clustering algorithm to determine the second label of the data in the first dataset to obtain a second dataset; the data in the second dataset includes the first label and the second label; the second label is used to represent the domain attribute information of the data.

[0113] The model training module 406 is used to train the initial liveness detection model based on the second dataset in an adversarial learning manner to obtain the trained liveness detection model.

[0114] Based on the same idea, this specification also provides a schematic diagram of the structure of a training device for a liveness detection model. For example... Figure 5 As shown, device 500 may include:

[0115] At least one processor 510; and,

[0116] Memory 530 communicatively connected to the at least one processor; wherein,

[0117] The memory 530 stores instructions 520 that can be executed by the at least one processor 510, the instructions being executed by the at least one processor 510 to enable the at least one processor 510 to:

[0118] Obtain a first dataset; the data in the first dataset includes a first label; the first label is used to represent the liveness attribute information of the data;

[0119] A clustering algorithm is used to determine the second label of the data in the first dataset, resulting in a second dataset; the data in the second dataset includes the first label and the second label; the second label is used to represent the domain attribute information of the data.

[0120] The initial liveness detection model is trained using adversarial learning based on the second dataset to obtain the trained liveness detection model.

[0121] Based on the same approach, embodiments of this specification also provide a computer-readable medium corresponding to the above-described method. The computer-readable medium stores computer-readable instructions, which can be executed by a processor to implement the training method for the above-described liveness detection model.

[0122] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on its differences from other embodiments. In particular, for... Figure 5 As the device shown is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.

[0123] In the 1990s, improvements to a technology could be clearly distinguished as either hardware improvements (e.g., improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the methodology). However, with technological advancements, many methodological improvements today can be considered direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved methodology into the hardware circuit. Therefore, it cannot be said that a methodological improvement cannot be implemented using hardware physical modules. For example, a Programmable Logic Device (PLD) (such as a Field Programmable Gate Array (FPGA)) is such an integrated circuit whose logic function is determined by the user programming the device. Designers can program a digital system themselves to "integrate" it onto a PLD, without needing chip manufacturers to design and manufacture dedicated integrated circuit chips. Furthermore, nowadays, instead of manually manufacturing integrated circuit chips, this programming is mostly implemented using "logic compiler" software. Similar to the software compiler used in program development, the original code before compilation must be written in a specific programming language, called a Hardware Description Language (HDL). There are many HDLs, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, and RHDL (Ruby Hardware Description Language). Currently, the most commonly used are VHDL (Very-High-Speed ​​Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should understand that by simply performing some logic programming on the method flow using one of these hardware description languages ​​and programming it into an integrated circuit, the hardware circuit implementing the logical method flow can be easily obtained.

[0124] The controller can be implemented in any suitable manner. For example, it can take the form of a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro)processor, logic gates, switches, application-specific integrated circuits (ASICs), programmable logic controllers, and embedded microcontrollers. Examples of controllers include, but are not limited to, the following microcontrollers: ARC625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicon Labs C8051F320. A memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art will also recognize that, in addition to implementing the controller in purely computer-readable program code form, the same functionality can be achieved by logically programming the method steps to make the controller take the form of logic gates, switches, ASICs, programmable logic controllers, and embedded microcontrollers. Therefore, such a controller can be considered a hardware component, and the means included therein for implementing various functions can also be considered as structures within the hardware component. Alternatively, the means for implementing various functions can be considered as both software modules implementing the method and structures within the hardware component.

[0125] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, a computer can be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or any combination of these devices.

[0126] For ease of description, the above devices are described separately by function as various units. Of course, in implementing this application, the functions of each unit can be implemented in one or more software and / or hardware.

[0127] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0128] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0129] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0130] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0131] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0132] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0133] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital character versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0134] It should also be noted that 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. Without further limitation, 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 said element.

[0135] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0136] This application can be described in the general context of computer-executable instructions, such as program modules, that are executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform a specific task or implement a specific abstract data type. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.

[0137] The above description is merely an embodiment of this application and is not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.

Claims

1. A training method for a liveness detection model, comprising: Obtain the first dataset; The data in the first dataset includes the first label; The first tag is used to represent the liveness attribute information of the data; A clustering algorithm is used to determine the second label of the data in the first dataset, thus obtaining a second dataset; the data in the second dataset includes the first label and the second label. The second label is used to represent the domain attribute information of the data; Obtain several data subsets from the second dataset; Using various data subsets, the initial liveness detection model is trained in an adversarial learning manner for a predetermined number of in-round iterations to obtain the trained liveness detection model; the clustering method used for the data used to train the initial liveness detection model may be the same or different in each in-round iteration training.

2. The method according to claim 1, wherein the step of using various data subsets to perform a preset number of in-round iterative training on the initial liveness detection model in an adversarial learning manner specifically includes: The initial liveness detection model is trained using meta-learning on the second dataset in an adversarial learning manner.

3. The method according to claim 1, wherein the step of using each data subset to perform a preset number of in-round iterative training on the initial liveness detection model in an adversarial learning manner to obtain the trained liveness detection model specifically includes: Using any subset of data from each data subset, the initial liveness detection model is trained in an adversarial learning manner for a preset number of in-round iterations to obtain a preset number of in-round adversarial loss values ​​and the trained liveness detection model.

4. The method according to claim 3, wherein one of the in-round iterative training sessions in which the initial liveness detection model is trained in an adversarial learning manner for a predetermined number of in-round iterative training sessions specifically includes: Obtain training data and test data from one of the aforementioned subsets of data; The initial liveness detection model is trained once using the training data to obtain the liveness detection model after training. Using the test data, the in-round adversarial loss value corresponding to the liveness detection model trained in the round is obtained.

5. The method according to claim 3, further comprising: Calculate the average of the preset number of in-round adversarial loss values, and use the average as the adversarial learning loss value corresponding to the trained liveness detection model.

6. The method according to claim 5, further comprising: If the adversarial learning loss value meets the preset condition, then the training of the trained liveness detection model is stopped; If the adversarial learning loss value does not meet the preset condition, the adversarial learning loss value will be backpropagated to the trained liveness detection model for subsequent training.

7. The method according to claim 1, wherein the clustering algorithm comprises one or more clustering algorithms; The step of using a clustering algorithm to determine the second label of the data in the first dataset specifically includes: Obtain the clustering results of each clustering algorithm for the data; Based on the weights of each clustering algorithm and the results of each clustering, the clustering category corresponding to each data point is determined. Based on the clustering category, a second label is determined for the training data.

8. The method according to claim 1, wherein the step of using a clustering algorithm to determine the second label of the data in the first dataset specifically includes: The data features of the data are extracted using the initial liveness detection model. Based on the data characteristics, a clustering algorithm is used to cluster the data to determine the second label of the data.

9. The method according to claim 1, wherein the data includes facial images acquired under at least one of different acquisition devices, acquisition time, and acquisition location; And / or, the data includes adversarial data generated through GANs networks.

10. The method according to claim 1, wherein the initial liveness detection model comprises a first sub-model for liveness detection and a second sub-model for domain detection; the adversarial learning method is used to represent the adversarial learning between the first sub-model and the second sub-model; The step of using various data subsets to perform a predetermined number of in-round iterative training sessions on the initial liveness detection model in an adversarial learning manner specifically includes: The initial liveness detection model is trained using the second dataset to obtain a first loss value corresponding to the first sub-model and a second loss value corresponding to the second sub-model; Based on the first loss value and the second loss value, the adversarial learning loss value corresponding to the trained liveness detection model is determined.

11. The method according to claim 10, wherein the adversarial learning loss value L = α*L1 + β*L2; where, α and β represent weights, where α > β; L1 represents the first loss value, and L2 represents the second loss value.

12. A training device for a liveness detection model, comprising: The data acquisition module is used to acquire the first dataset; The data in the first dataset includes the first label; The first tag is used to represent the liveness attribute information of the data; A data determination module is used to use a clustering algorithm to determine the second label of the data in the first dataset, thereby obtaining a second dataset; the data in the second dataset includes the first label and the second label; the second label is used to represent the domain attribute information of the data. The model training module is used to obtain several data subsets from the second dataset; Using various data subsets, the initial liveness detection model is trained in an adversarial learning manner for a predetermined number of in-round iterations to obtain the trained liveness detection model; the clustering method used for the data used to train the initial liveness detection model may be the same or different in each in-round iteration training.

13. A training device for a liveness detection model, comprising: At least one processor; as well as, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enable the at least one processor to: Obtain a first dataset; the data in the first dataset includes a first label; the first label is used to represent the liveness attribute information of the data; A clustering algorithm is used to determine the second label of the data in the first dataset, resulting in a second dataset; the data in the second dataset includes the first label and the second label; the second label is used to represent the domain attribute information of the data. Obtain several data subsets from the second dataset; Using various data subsets, the initial liveness detection model is trained in an adversarial learning manner for a predetermined number of in-round iterations to obtain the trained liveness detection model; the clustering method used for the data used to train the initial liveness detection model may be the same or different in each in-round iteration training.

14. A computer-readable medium having stored thereon computer-readable instructions that can be executed by a processor to implement the training method of the liveness detection model according to any one of claims 1 to 11.