Model iteration method based on incremental data and living body detection method and device

By using the loss calculation and iterative update methods of the first and second data sets in the live detection model, the overfitting phenomenon is reduced, the training effect and generalization ability of the model are improved, and the model is solved in the existing technology. The fitting problem.

CN118898735AActive Publication Date: 2024-11-05BEIJING ZITIAO NETWORK TECH CO LTD

Patent Information

Application Number
CN202310499189.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-05-05
Publication Date
2024-11-05
Estimated Expiration
2043-05-05

AI Technical Summary

Technical Problem

Existing live detection models are prone to overfitting during data iteration, resulting in insufficient training effect and generalization ability.

Method used

By acquiring the first data set and the second data set, the first live detection model is used to detect and classify the two, calculate the corresponding losses, and update the model iteratively according to the losses, and set the tag loss that is not related to the live detection task. Larger, the tag loss related to the live detection task is smaller to reduce overfitting.

Benefits of technology

It effectively alleviates the overfitting problem during data iteration and improves the training effect and generalization ability of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118898735A_ABST
    Figure CN118898735A_ABST
Patent Text Reader

Abstract

A model iteration method based on incremental data includes the steps that a first data set and a second data set are obtained, samples in the first data set are provided with first labels and second labels, samples in the second data set are provided with third labels, the first labels and the third labels are both related to a living body detection task, and the second labels are irrelevant to the living body detection task; detecting samples in the first data set and the second data set by using a living body detection model to obtain a first detection result, and performing loss calculation based on the first detection result, the first label and the third label to obtain first loss, the living body detection model being obtained by training based on the first data set; performing classification processing on samples in the first data set at least through a living body detection model to obtain a first classification result, and performing loss calculation based on the first classification result and a second label to obtain second loss; and performing iterative updating on the living body detection model based on the first loss and the second loss. The method can improve the training effect of the model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a model iteration method based on incremental data, a living body detection method and a device. Background Art

[0002] Liveness detection is a technology that uses portrait recognition technology to determine whether the user in front of the camera lens is a real person. At present, the training of liveness detection models composed of neural networks (NN) and the like is generally achieved through deep learning algorithms. During the training process, training data is the determining factor that determines the upper limit of the performance of the trained liveness detection model. Training data is generally collected or purchased in batches, which makes the training data more and more complex. At present, different batches of data are often directly mixed according to a certain ratio, and the liveness detection model is trained with the mixed data. However, this often causes the trained model to overfit to a certain batch of data, affecting the training effect of the model. Summary of the invention

[0003] The present application provides a model iteration method based on incremental data, a liveness detection method, an apparatus, an electronic device, a computer storage medium, and a computer program product containing instructions, which can alleviate the phenomenon of overfitting of certain data in the data iteration process, improve the training effect of the model, and the generalization ability of the model.

[0004] In a first aspect, the present application provides a model iteration method based on incremental data, comprising: obtaining a first data set and a second data set, the samples in the second data set are incremental data, the samples in the first data set have a first label and a second label, the samples in the second data set have a third label, the first label and the third label are both related to a liveness detection task, and the second label is not related to the liveness detection task; using a first liveness detection model to detect and process the samples in the first data set and the second data set to obtain a first detection result, and, based on the first detection result, the first label and the third label, performing a loss calculation to obtain a first loss, wherein the first liveness detection model is trained based on the first data set and the first label; at least using the first liveness detection model, classifying and processing the samples in the first data set to obtain a first classification result, and, based on the first classification result and the second label, performing a loss calculation to obtain a second loss; based on the first loss and the second loss, iteratively updating the first liveness detection model to obtain a second liveness detection model.

[0005] In this way, by setting labels in the training data that are not related to the liveness detection task and increasing the loss corresponding to the label, the model is forced to ignore the negative impact of different data distributions on the training task, thereby reducing the model's overfitting to features that are not related to the liveness detection task; and by reducing the loss corresponding to the label related to the liveness detection task, the model can pay more attention to features related to the liveness detection task. In this way, while alleviating the phenomenon of some data overfitting in the data iteration process, the model's training effect and generalization ability are improved.

[0006] In a possible implementation, the first data set includes a first sample. Classifying the sample in the first data set at least by using a first liveness detection model to obtain a first classification result includes: extracting features of the first sample by using the first liveness detection model to obtain first sample features; and classifying the first sample features to obtain a classification result of the first sample.

[0007] Calculating the loss based on the first classification result and the second label to obtain the second loss includes: calculating the loss based on the classification result of the first sample and the second label of the first sample to obtain the second loss.

[0008] Based on the first loss and the second loss, the first liveness detection model is iteratively updated to obtain the second liveness detection model, including: with the goal of reducing the first loss and increasing the second loss, the first liveness detection model is iteratively updated.

[0009] In a possible implementation, the first data set includes a first sample, and the second data set includes a second sample. Using the first liveness detection model to detect and process samples in the first data set and the second data set to obtain a first detection result includes: using the first liveness detection model to extract features of the first sample and the second sample, respectively, to obtain a first sample feature of the first sample and a second sample feature of the second sample; and using the first liveness detection model to detect the first sample feature and the second sample feature, respectively, to obtain a detection result of the first sample and a detection result of the second sample.

[0010] The first loss is obtained by performing a loss calculation based on the first detection result, the first label, and the third label, including: performing a loss calculation based on the detection result of the first sample and the first label of the first sample to obtain a first sub-loss, and performing a loss calculation based on the detection result of the second sample and the third label of the second sample to obtain a second sub-loss; and performing a weighted calculation on the first sub-loss and the second sub-loss to obtain the first loss.

[0011] In a possible implementation, before performing weighted calculation on the first sub-loss and the second sub-loss, the method further includes: setting weights of the first sub-loss and the second sub-loss so that the first sub-loss is greater than the second sub-loss.

[0012] In a possible implementation, the second label includes labels of multiple categories, and the multiple categories include at least two of the categories of sample acquisition equipment, sample acquisition lighting, attribute categories of target objects in the sample, and sample image quality categories.

[0013] In a possible implementation, the label corresponding to at least one category in the second label includes a first sub-label and a second sub-label, and the proportion of samples with the first sub-label and the proportion of samples with the second sub-label in the first data set are both greater than a preset threshold.

[0014] In a possible implementation, the samples in the second data set also have a fourth label that is unrelated to the liveness detection task, and the category corresponding to the fourth label is consistent with the category corresponding to the second label. The method also includes: classifying the samples in the second data set at least by the first liveness detection model to obtain a second classification result, and calculating the loss based on the second classification result and the fourth label to obtain a third loss; iteratively updating the first liveness detection model with the goal of increasing the third loss.

[0015] In a second aspect, the present application provides a liveness detection method, comprising: acquiring an image to be detected; processing the image to be detected by a liveness detection model, wherein the liveness detection model is iteratively obtained by the method provided in the first aspect; and outputting a detection result of whether the image to be detected is live.

[0016] In a third aspect, the present application provides a model iteration device based on incremental data, comprising: an acquisition module and a processing module. The acquisition module is used to acquire a first data set and a second data set, wherein the samples in the second data set are incremental data, the samples in the first data set have a first label and a second label, and the samples in the second data set have a third label, the first label and the third label are both related to the liveness detection task, and the second label is irrelevant to the liveness detection task. The processing module is used to detect and process the samples in the first data set and the second data set using a first liveness detection model to obtain a first detection result, and to calculate the loss based on the first detection result, the first label and the third label to obtain a first loss, wherein the first liveness detection model is trained based on the first data set and the first label. The processing module is also used to classify the samples in the first data set at least through the first liveness detection model to obtain a first classification result, and to calculate the loss based on the first classification result and the second label to obtain a second loss. The processing module is also used to iteratively update the first liveness detection model based on the first loss and the second loss to obtain a second liveness detection model.

[0017] In a possible implementation, the first data set includes a first sample. When the processing module classifies the sample in the first data set at least through the first liveness detection model to obtain a first classification result, the processing module is specifically configured to: extract features from the first sample using the first liveness detection model to obtain first sample features; and classify the first sample features to obtain a classification result of the first sample.

[0018] When the processing module performs loss calculation based on the first classification result and the second label to obtain the second loss, it is specifically used to: perform loss calculation based on the classification result of the first sample and the second label of the first sample to obtain the second loss.

[0019] When the processing module iteratively updates the first liveness detection model based on the first loss and the second loss to obtain the second liveness detection model, it is specifically used to iteratively update the first liveness detection model with the goal of reducing the first loss and increasing the second loss.

[0020] In a possible implementation, the first data set includes a first sample, and the second data set includes a second sample. When the processing module uses the first liveness detection model to detect and process samples in the first data set and the second data set to obtain a first detection result, it is specifically used to: use the first liveness detection model to extract features of the first sample and the second sample respectively to obtain a first sample feature of the first sample and a second sample feature of the second sample; and use the first liveness detection model to detect the first sample feature and the second sample feature respectively to obtain a detection result of the first sample and a detection result of the second sample.

[0021] When the processing module performs loss calculation based on the first detection result, the first label and the third label to obtain the first loss, the processing module is specifically used to: perform loss calculation based on the detection result of the first sample and the first label of the first sample to obtain a first sub-loss, and perform loss calculation based on the detection result of the second sample and the third label of the second sample to obtain a second sub-loss; and perform weighted calculation on the first sub-loss and the second sub-loss to obtain the first loss.

[0022] In a possible implementation, before performing weighted calculation on the first sub-loss and the second sub-loss, the processing module is further configured to: set weights of the first sub-loss and the second sub-loss so that the first sub-loss is greater than the second sub-loss.

[0023] In a possible implementation, the second label includes labels of multiple categories, and the multiple categories include at least two of the categories of sample acquisition equipment, sample acquisition lighting, attribute categories of target objects in the sample, and sample image quality categories.

[0024] In a possible implementation, the label corresponding to at least one category in the second label includes a first sub-label and a second sub-label, and the proportion of samples with the first sub-label and the proportion of samples with the second sub-label in the first data set are both greater than a preset threshold.

[0025] In a possible implementation, the samples in the second data set also have a fourth label that is irrelevant to the liveness detection task, and the category corresponding to the fourth label is consistent with the category corresponding to the second label. In this case, the processing module is also used to: classify the samples in the second data set at least by the first liveness detection model to obtain a second classification result, and calculate the loss based on the second classification result and the fourth label to obtain a third loss; and iteratively update the first liveness detection model with the goal of increasing the third loss.

[0026] In a fourth aspect, the present application provides a liveness detection device, comprising: an acquisition module and a processing module. The acquisition module is used to acquire an image to be detected. The processing module is used to process the image to be detected by a liveness detection model, and the liveness detection model is iteratively obtained by the method provided in the first aspect. The processing module is also used to output a detection result of whether the image to be detected is a live body.

[0027] In a fifth aspect, the present application provides an electronic device, comprising: one or more processors; and a memory for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method provided in the first aspect or the second aspect.

[0028] In a sixth aspect, the present application provides a computer storage medium, in which instructions are stored. When the instructions are executed on a computer, the computer executes the method provided in the first aspect or the second aspect above.

[0029] In a seventh aspect, the present application provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute the method provided in the first or second aspect above.

[0030] It can be understood that the beneficial effects of the second to seventh aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1 It is a flowchart of a model iteration method based on incremental data provided in an embodiment of the present application;

[0032] Figure 2 It is a flow chart of a living body detection method provided in an embodiment of the present application;

[0033] Figure 3 It is a structural schematic diagram of a model iteration device based on incremental data provided in an embodiment of the present application;

[0034] Figure 4 is a structural schematic diagram of a living body detection device provided in an embodiment of the present application;

[0035] Figure 5 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0036] The term "and / or" in this article is a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The symbol " / " in this article indicates that the associated objects are in an or relationship, for example, A / B means A or B.

[0037] The terms "first" and "second" in the specification and claims herein are used to distinguish different objects rather than to describe a specific order of the objects. For example, a first response message and a second response message are used to distinguish different response messages rather than to describe a specific order of the response messages.

[0038] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0039] In the description of the embodiments of the present application, unless otherwise specified, "multiple" means two or more than two. For example, multiple processing units refer to two or more processing units, etc.; multiple elements refer to two or more elements, etc.

[0040] For example, Figure 1 A flow chart of a model iteration method based on incremental data provided in an embodiment of the present application. The method can be executed by a model iteration device based on incremental data, wherein the device can be implemented by software and / or hardware and can be configured in an electronic device, typically, in a computing device such as a computer. Figure 1 As shown, the incremental data-based model iteration method may include the following steps:

[0041] S101. Acquire a first data set and a second data set, where samples in the second data set are incremental data, samples in the first data set have a first label and a second label, and samples in the second data set have a third label, both the first label and the third label are related to a liveness detection task, and the second label is irrelevant to the liveness detection task.

[0042] In this embodiment, the first data set may be a set of original training data. The second data set may be a set of newly added data, that is, incremental data, such as newly purchased data, etc. The samples in the first data set and the second data set may be, but are not limited to, pictures.

[0043] The samples in the first data set may have a first label and a second label. The first label is a label related to the liveness detection task, and the second label is a label unrelated to the liveness detection task. The samples in the second data set may have a third label. The third label is also a label related to the liveness detection task.

[0044] In some embodiments, the second label may include labels of multiple categories. The categories here refer to categories that are not related to the liveness detection task. The categories that are not related to the liveness detection task are possessed by the samples in the training data set themselves, but are not related to the liveness detection task. The category includes at least two of the categories of the sample acquisition device, the category of the sample acquisition illumination, the attribute category of the target object in the sample, and the category of the sample image quality. Among them, the category of the sample acquisition device can be directly obtained from the device information carried by the sample. The category of the sample acquisition illumination can be determined by performing illumination estimation on the sample, and the category of the sample acquisition illumination can be determined based on the sample estimation result and a preset threshold. The attribute category of the target object in the sample can use the target object recognition model to identify the attribute category of the target object, such as whether the target object wears glasses, etc. The category of the sample image quality can be determined by performing quality estimation on the sample, and the category of the sample image quality can be determined based on the estimation result and a preset threshold.

[0045] In other embodiments, the label corresponding to at least one category in the second label includes a first sub-label and a second sub-label, and the proportion of samples with the first sub-label and the proportion of samples with the second sub-label in the first data set are both greater than a preset threshold. For example, when the second label is the category of the sample acquisition device, the first sub-label can be acquisition device X, and the second sub-label can be acquisition device Y. Thus, the proportion of samples with different attributes (such as acquisition device X and acquisition device Y) under the same category in the first data set is greater than the preset threshold, that is, the distribution of samples with different sub-labels under the same category is relatively uniform, thereby ensuring that the model can first learn the ability to distinguish different attributes (such as acquisition device X and acquisition device Y) under the corresponding category through these samples, and then iterate in the direction of ignoring such category attributes that are not related to the liveness detection task. For example: if 99% of the samples are acquisition device X and 1% of the samples are acquisition device Y, it is difficult for the model to learn the ability to distinguish the categories of acquisition devices from these samples; and if 51% of the samples are acquisition device X and 49% of the samples are acquisition device Y, then the model can easily learn the ability to distinguish X and Y from these samples.

[0046] S102. Detect and process samples in the first data set and the second data set using a first liveness detection model to obtain a first detection result, and calculate a loss based on the first detection result, the first label, and the third label to obtain a first loss, wherein the first liveness detection model is trained based on the first data set and the first label.

[0047] In this embodiment, the samples in the first data set and the second data set can be input into the first liveness detection model trained based on the first data set and the first label at the same time or in different time periods. For example, the samples in the first data set can be input into the first liveness detection model first, and then the samples in the second data set can be input into the first liveness detection model, or the samples in the second data set can be input into the first liveness detection model first, and then the samples in the first data set can be input into the first liveness detection model, or the samples in the first data set and the samples in the second data set can be input into the first liveness detection model at the same time, or the samples can be randomly selected from the first data set and the second data set and input into the first liveness detection model. Exemplarily, the first liveness detection model can be, but is not limited to, a convolutional neural network (CNN). Then, the samples in the first data set and the second data set can be detected and processed by the first liveness detection model to obtain a first detection result. The first detection result can be a collection of detection results of each sample in the first data set and the second data set. Further, a pre-configured loss function can be used to calculate the loss of the detection results of each sample and the corresponding sample and the label related to the liveness detection task to obtain a first loss.

[0048] In some embodiments, the first liveness detection model may be mainly composed of a feature extraction module and a feature detection module. At this time, when the first data set includes a first sample and the second data set includes a second sample, the feature extraction module may be used to extract features of the first sample and the second sample respectively to obtain a first sample feature of the first sample and a second sample feature of the second sample. Then, the feature detection module may be used to detect the first sample feature and the second sample feature respectively to obtain a detection result of the first sample and a detection result of the second sample. Further, the loss function may be used to calculate the loss of the detection result of the first sample and the first label of the first sample to obtain a first sub-loss; and the loss function may be used to calculate the loss of the detection result of the second sample and the third label of the second sample to obtain a second sub-loss. Finally, the first sub-loss and the second sub-loss may be weighted to obtain a first loss. In this embodiment, the loss function is not limited. For example, a cross entropy loss function or an L2 loss function may be used.

[0049] In addition, considering that the first liveness detection model is trained using samples in the first data set, and it is found in the research process that the incremental data (i.e., the data in the second data set) is often uncontrollable. Therefore, the weights of the first sub-loss and the second sub-loss can be set so that the first sub-loss is greater than the second sub-loss, thereby reducing the impact of the incremental data, and then after the incremental data is introduced, the model is iterated in a positive direction, such as improving the detection ability and generalization ability.

[0050] S103. Classify the samples in the first data set at least by using the first living body detection model to obtain a first classification result, and calculate the loss based on the first classification result and the second label to obtain a second loss.

[0051] In this embodiment, the samples in the first data set can be input into the first liveness detection model simultaneously or in different time periods, so as to classify the samples at least through the first liveness detection model, thereby obtaining the categories of each sample, that is, obtaining the first classification result. In some embodiments, when the first data set includes the first sample, the first sample can be first input into the first liveness detection model to extract features through the model to obtain the first sample feature. The first sample feature can be an intermediate output of the first liveness detection model. For example, when the first liveness detection model is mainly composed of a feature extraction module and a feature detection module, the first sample feature can be the output of the feature extraction module. After obtaining the first sample feature, the first sample feature can be classified to obtain the classification result of the first sample. For example, a data domain alignment module used in conjunction with the first liveness detection model can be set, and the data domain alignment module can include a classification module, which can be used to implement the classification of sample data and perform feature alignment on different data based on the classification result. The input of the data domain alignment module can be the sample feature extracted by the feature extraction module in the first liveness detection model. The data domain alignment module can process sample features by, but is not limited to, comparing domain descriptions, correlation alignment, maximum mean discrepancy (MMD), Wasserstein and other algorithms. In addition, when the iterative update of the liveness detection model is completed and the iteratively updated model is put into use, the data domain alignment module can be abandoned, so that the detection ability and generalization ability of the model can be improved by using incremental data while maintaining the original model architecture, avoiding increasing the difficulty of model deployment.

[0052] Furthermore, a pre-configured loss function may be used to calculate the loss of the classification results of each sample and the labels of the corresponding sample that are irrelevant to the liveness detection task, so as to obtain a second loss.

[0053] S104: Iteratively update the first liveness detection model based on the first loss and the second loss to obtain a second liveness detection model.

[0054] In this embodiment, after obtaining the first loss and the second loss, the first liveness detection model may be iteratively updated with the goal of reducing the first loss and increasing the second loss to obtain the second liveness detection model, but is not limited to.

[0055] In this way, by setting labels in the training data that are not related to the liveness detection task and increasing the loss corresponding to the label, the model is forced to ignore the negative impact of different data distributions on the training task, thereby reducing the model's overfitting to features that are not related to the liveness detection task; and by reducing the loss corresponding to the label related to the liveness detection task, the model can pay more attention to the features related to the liveness detection task in the incremental data. In this way, while alleviating the phenomenon of some data overfitting in the data iteration process, the model's training effect and generalization ability are improved.

[0056] In some embodiments, the samples in the second data set may also have a fourth label. The fourth label is also a label that is not related to the liveness detection task. In addition, the category corresponding to the fourth label is consistent with the category corresponding to the aforementioned second label, for example, both are the category of the sample acquisition device or the category of the sample acquisition illumination, that is, if the second label includes the label corresponding to the acquisition device category, the fourth label also includes the label corresponding to the acquisition device category. At this time, the first liveness detection model can also be used to extract features of the samples in the second data set to obtain sample features of the samples in the second data set. Then, the sample features of the samples in the second data set can be classified to obtain the classification results of the samples in the second data set. Then, the loss function can be used to calculate the loss of the fourth label of the samples in the second data set and the classification results of the samples to obtain the third loss. Finally, the first liveness detection model can be iteratively updated with the goal of increasing the third loss. In this way, the model can be reduced from overfitting to the features in the second data set that are not related to the liveness detection task, thereby improving the training effect of the model. For example, considering that the incremental data is less than the original training data, only the second label can be marked on the original training data; when the incremental data is also large, you can consider marking the incremental data with a fourth label. The specific details can be determined according to the actual situation and are not limited here.

[0057] Furthermore, when the samples in the second data set have a fourth label, the fourth label may also have a first sub-label and a second sub-label. At the same time, in the union of the first data set and the second data set, the proportion of samples with the first sub-label and the proportion of samples with the second sub-label are both greater than a preset threshold. For example, when the second label and the fourth label are both categories of sample acquisition devices, the first sub-label may be acquisition device X, and the second sub-label may be acquisition device Y. Thus, the proportion of samples with different attributes under the same category in the data set (such as acquisition device X and acquisition device Y) is greater than the preset threshold, that is, the distribution of samples with different sub-labels under the same category is relatively uniform, thereby ensuring that the model can first learn the ability to distinguish different attributes under the corresponding category (such as acquisition device X and acquisition device Y) through these samples, and then iterate in the direction of ignoring such category attributes that are not related to the liveness detection task.

[0058] The above is an introduction to the model iteration method based on incremental data provided in the embodiment of the present application. Next, a liveness detection method provided in the embodiment of the present application is introduced.

[0059] For example, Figure 2 The present invention provides a flow chart of a method for detecting a living body provided in an embodiment of the present invention. The method can be performed by a living body detection device, wherein the device can be implemented by software and / or hardware, and can be configured in an electronic device, typically, in a computing device such as a computer. Figure 2 As shown, the living body detection method provided in this embodiment may include:

[0060] S201, obtaining an image to be detected.

[0061] In this embodiment, the image to be detected can be collected in real time or stored in advance, which is not limited here. Exemplarily, the image to be detected can be a face image, which is an image collected in a scenario where identity recognition and authentication are required. For example: in scenarios such as account login or determination of transaction information, facial recognition verification is required, and the facial image of the target object is collected in real time through the image acquisition function module of the terminal device where the application client is located. Of course, the image to be detected may also be a non-living face image, such as a face image pre-stored in the terminal device, or an image of an existing face image collected. It can be understood that before using the technical solution disclosed in the embodiment of the present disclosure, the type, scope of use, and use scenario of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations. For example, in response to receiving an active request from the user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require the acquisition and use of the user's personal information. Thereby, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message. As an optional but non-limiting implementation, in response to receiving an active request from the user, the method of sending a prompt message to the user may be, for example, a pop-up window, in which the prompt message may be presented in text. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device. It is understandable that the above notification and the process of obtaining user authorization are only illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet relevant laws and regulations may also be applied to the implementation of the present disclosure.

[0062] S202: Process the image to be detected by using a living body detection model.

[0063] In this embodiment, the image to be detected can be input into the living body detection model iteratively obtained in the above-mentioned embodiment, so as to be processed by the living body detection model to obtain a detection result of whether the image to be detected is a living body.

[0064] S203: Output the detection result of whether the image to be detected is a living body.

[0065] In this embodiment, after obtaining the detection result of whether the image to be detected is a living body, the result can be output, for example, displayed on a display screen of an electronic device.

[0066] In this way, since the detection effect of the aforementioned liveness detection model is improved, the detection result obtained by the liveness detection model is also more accurate, thereby improving the accuracy of the detection result.

[0067] Based on the method in the above embodiment, the embodiment of the present application also provides a model iteration device based on incremental data. Figure 3 As shown, the incremental data-based model iteration device 300 includes: an acquisition module 301 and a processing module 302. The acquisition module 301 is used to acquire a first data set and a second data set, wherein the samples in the second data set are incremental data, the samples in the first data set have a first label and a second label, and the samples in the second data set have a third label, wherein the first label and the third label are both related to the liveness detection task, and the second label is irrelevant to the liveness detection task. The processing module 302 is used to detect and process the samples in the first data set and the second data set using a first liveness detection model to obtain a first detection result, and to calculate the loss based on the first detection result, the first label and the third label to obtain a first loss, wherein the first liveness detection model is trained based on the first data set and the first label. The processing module 302 is also used to classify the samples in the first data set at least by the first liveness detection model to obtain a first classification result, and to calculate the loss based on the first classification result and the second label to obtain a second loss. The processing module 302 is also used to iteratively update the first liveness detection model based on the first loss and the second loss to obtain a second liveness detection model.

[0068] In a possible implementation, the first data set includes a first sample. When the processing module 302 classifies the sample in the first data set at least by the first liveness detection model to obtain a first classification result, it is specifically configured to: extract features from the first sample by using the first liveness detection model to obtain first sample features; and classify the first sample features to obtain a classification result of the first sample.

[0069] When the processing module 302 performs loss calculation based on the first classification result and the second label to obtain the second loss, it is specifically used to: perform loss calculation based on the classification result of the first sample and the second label of the first sample to obtain the second loss.

[0070] When the processing module 302 iteratively updates the first liveness detection model based on the first loss and the second loss to obtain the second liveness detection model, it is specifically used to iteratively update the first liveness detection model with the goal of reducing the first loss and increasing the second loss.

[0071] In a possible implementation, the first data set includes a first sample, and the second data set includes a second sample. When the processing module 302 detects and processes the samples in the first data set and the second data set using the first liveness detection model to obtain the first detection result, it is specifically used to: extract features from the first sample and the second sample using the first liveness detection model to obtain a first sample feature of the first sample and a second sample feature of the second sample; and detect the first sample feature and the second sample feature using the first liveness detection model to obtain the detection result of the first sample and the detection result of the second sample.

[0072] When the processing module 302 performs loss calculation based on the first detection result, the first label and the third label to obtain the first loss, it is specifically used to: perform loss calculation based on the detection result of the first sample and the first label of the first sample to obtain a first sub-loss, and perform loss calculation based on the detection result of the second sample and the third label of the second sample to obtain a second sub-loss; and perform weighted calculation on the first sub-loss and the second sub-loss to obtain the first loss.

[0073] In a possible implementation, before performing weighted calculation on the first sub-loss and the second sub-loss, the processing module 302 is further configured to: set weights of the first sub-loss and the second sub-loss so that the first sub-loss is greater than the second sub-loss.

[0074] In a possible implementation, the second label includes labels of multiple categories, and the multiple categories include at least two of the categories of sample acquisition equipment, sample acquisition lighting, attribute categories of target objects in the sample, and sample image quality categories.

[0075] In a possible implementation, the label corresponding to at least one category in the second label includes a first sub-label and a second sub-label, and the proportion of samples with the first sub-label and the proportion of samples with the second sub-label in the first data set are both greater than a preset threshold.

[0076] In a possible implementation, the samples in the second data set also have a fourth label that is irrelevant to the liveness detection task, and the category corresponding to the fourth label is consistent with the category corresponding to the second label. At this time, the processing module 302 is also used to: classify the samples in the second data set at least by the first liveness detection model to obtain a second classification result, and calculate the loss based on the second classification result and the fourth label to obtain a third loss; and iteratively update the first liveness detection model with the goal of increasing the third loss.

[0077] It should be understood that the above-mentioned device is used to execute the method in the above-mentioned embodiment. The implementation principle and technical effect of the corresponding program module in the device are similar to those described in the above-mentioned method. The working process of the device can refer to the corresponding process in the above-mentioned method, which will not be repeated here.

[0078] Based on the method in the above embodiment, the present application embodiment also provides a living body detection device. Figure 4 As shown, the liveness detection device 400 includes: an acquisition module 401 and a processing module 402. The acquisition module 401 is used to acquire the image to be detected. The processing module 402 is used to process the image to be detected by using a liveness detection model, and the liveness detection model is iteratively obtained by the aforementioned model iteration method based on incremental data. The processing module 402 is also used to output a detection result of whether the image to be detected is a live body.

[0079] It should be understood that the above-mentioned device is used to execute the method in the above-mentioned embodiment. The implementation principle and technical effect of the corresponding program module in the device are similar to those described in the above-mentioned method. The working process of the device can refer to the corresponding process in the above-mentioned method, which will not be repeated here.

[0080] Reference below Figure 5 , which shows a structural schematic diagram of an electronic device 500 suitable for implementing an embodiment of the present application. Figure 5 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0081] like Figure 5 As shown, the electronic device 500 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage device 506 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the electronic device 500 are also stored. The processing device 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0082] Typically, the following devices may be connected to the I / O interface 505: an input device 506 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 507 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 506 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 509. The communication device 509 may allow the electronic device 500 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 5The electronic device 500 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.

[0083] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 509, or installed from the storage device 506, or installed from the ROM 502. When the computer program is executed by the processing device 501, the above-mentioned functions defined in the method of the embodiment of the present application are executed.

[0084] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0085] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

[0086] The computer-readable medium may be included in the electronic device, or may exist independently without being installed in the electronic device.

[0087] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device executes the method in the aforementioned embodiment.

[0088] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0089] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0090] The units involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0091] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0092] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0093] It is understood that the processor in the embodiments of the present application may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. The general-purpose processor may be a microprocessor or any conventional processor.

[0094] The method steps in the embodiments of the present application can be implemented by hardware or by a processor executing software instructions. The software instructions can be composed of corresponding software modules, and the software modules can be stored in random access memory (RAM), flash memory, read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disks, mobile hard disks, CD-ROMs, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an ASIC.

[0095] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions may be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state disk (SSD)), etc.

[0096] It should be understood that the various numerical numbers involved in the embodiments of the present application are only used for the convenience of description and are not used to limit the scope of the embodiments of the present application.

Claims

1. A model iteration method based on incremental data, include: Acquire a first data set and a second data set, where samples in the second data set are incremental data, the samples in the first data set have a first label and a second label, and the samples in the second data set have a third label, both the first label and the third label are related to a liveness detection task, and the second label is irrelevant to the liveness detection task; Using a first liveness detection model to detect samples in the first data set and the second data set to obtain a first detection result, and performing a loss calculation based on the first detection result, the first label, and the third label to obtain a first loss, wherein the first liveness detection model is trained based on the first data set and the first label; At least using the first liveness detection model, classify the samples in the first data set to obtain a first classification result, and perform loss calculation based on the first classification result and the second label to obtain a second loss; Based on the first loss and the second loss, the first living body detection model is iteratively updated to obtain a second living body detection model.

2. The method according to claim 1, in, The first data set includes a first sample; The classifying and processing the samples in the first data set at least by the first liveness detection model to obtain a first classification result includes: Using the first liveness detection model to extract features from the first sample to obtain first sample features; performing classification processing on the first sample features to obtain a classification result of the first sample; The performing loss calculation based on the first classification result and the second label to obtain a second loss includes: Performing loss calculation based on the classification result of the first sample and the second label of the first sample to obtain the second loss; The iterative updating of the first living body detection model based on the first loss and the second loss to obtain a second living body detection model includes: The first living body detection model is iteratively updated with the goal of reducing the first loss and increasing the second loss.

3. The method according to claim 1, in, The first data set includes a first sample, and the second data set includes a second sample; The using the first liveness detection model to detect and process the samples in the first data set and the second data set to obtain a first detection result includes: Using the first liveness detection model, respectively extracting features from the first sample and the second sample to obtain a first sample feature of the first sample and a second sample feature of the second sample; and using the first liveness detection model, respectively detecting the first sample feature and the second sample feature to obtain a detection result of the first sample and a detection result of the second sample; The performing loss calculation based on the first detection result, the first label, and the third label to obtain a first loss includes: A loss is calculated based on the detection result of the first sample and the first label of the first sample to obtain a first sub-loss, and a loss is calculated based on the detection result of the second sample and the third label of the second sample to obtain a second sub-loss; and a weighted calculation is performed on the first sub-loss and the second sub-loss to obtain the first loss.

4. The method according to claim 3, in, Before weighted calculation of the first sub-loss and the second sub-loss is performed, the method further includes: The weights of the first sub-loss and the second sub-loss are set so that the first sub-loss is greater than the second sub-loss.

5. The method according to claim 1, in, The second label includes labels of multiple categories, and the multiple categories include at least two of the categories of sample acquisition equipment, the categories of sample acquisition illumination, the attribute categories of target objects in the sample, and the categories of sample image quality.

6. The method according to claim 1, in, The label corresponding to at least one category in the second label includes a first sub-label and a second sub-label, and the proportion of samples with the first sub-label and the proportion of samples with the second sub-label in the first data set are both greater than a preset threshold.

7. The method according to claim 1, in, The samples in the second data set further have a fourth label that is irrelevant to the liveness detection task, and the category corresponding to the fourth label is consistent with the category corresponding to the second label; The method further comprises: At least using the first liveness detection model, classify the samples in the second data set to obtain a second classification result, and perform loss calculation based on the second classification result and the fourth label to obtain a third loss; The first living body detection model is iteratively updated with the goal of increasing the third loss.

8. A method for detecting liveness, in, include: Acquire the image to be detected; Processing the image to be detected by using a liveness detection model, wherein the liveness detection model is iteratively obtained by any method described in claims 1 to 7; Output the detection result of whether the image to be detected is a living body.

9. A model iteration device based on incremental data, include: an acquisition module, configured to acquire a first data set and a second data set, wherein samples in the second data set are incremental data, the samples in the first data set have a first label and a second label, and the samples in the second data set have a third label, the first label and the third label are both related to a liveness detection task, and the second label is irrelevant to the liveness detection task; a processing module, configured to perform detection processing on samples in the first data set and the second data set using a first liveness detection model to obtain a first detection result, and to perform loss calculation based on the first detection result, the first label, and the third label to obtain a first loss, wherein the first liveness detection model is trained based on the first data set and the first label; The processing module is further configured to classify the samples in the first data set at least by using the first liveness detection model to obtain a first classification result, and to perform loss calculation based on the first classification result and the second label to obtain a second loss; The processing module is further used to iteratively update the first living body detection model based on the first loss and the second loss to obtain a second living body detection model.

10. A living body detection device, in, include: An acquisition module, used for acquiring an image to be detected; A processing module, used for processing the image to be detected by using a liveness detection model, wherein the liveness detection model is obtained by iteratively obtaining the method according to any one of claims 1 to 7; The processing module is further used to output a detection result of whether the image to be detected is a living body.

11. An electronic device, include: one or more processors; A memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 7, or implement the method according to claim 7.

12. A computer storage medium, wherein instructions are stored in the computer storage medium, and when the instructions are executed on a computer, the computer executes the method according to any one of claims 1 to 7, or the method according to claim 7.

13. A computer program product comprising instructions, which, when executed on a computer, enables the computer to execute the method according to any one of claims 1 to 7, or the method according to claim 7.

Citation Information

Patent Citations

  • Living body detection model training method and device, electronic equipment and storage medium

    CN114120454A

  • Detection model training method, living body detection method, device, equipment and medium

    CN114360074A

  • Method and device for training target image retrieval model

    CN114565807A

  • Detection model training method and device, detection method and device, equipment and storage medium

    CN115131600A

  • Face in-vivo detection model training method and device and computer program product

    CN115147902A

Cited By

  • Data set detection method and device, electronic equipment, storage medium and program product

    CN121188610A