Sample type labeling method and device, electronic equipment and computer storage medium
The sample type annotation model is used to detect inanimate and in vivo samples to be detected in the facial recognition system. The preset detection dimensions and confidence thresholds are used to determine the sample type. The detection accuracy is improved through model training, which solves the problem of manual annotation in the existing technology. The problem of time-consuming, labor-intensive and low labeling efficiency is achieved, and efficient and accurate sample type labeling is achieved.
Patent Information
- Application Number
- CN202410455109.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-15
- Publication Date
- 2024-08-23
AI Technical Summary
In the existing technology, facial recognition systems rely on manual labor to annotate live detection data, resulting in huge consumption of time and human resources. Moreover, algorithm-based annotation tools are difficult to process complex data, resulting in low annotation efficiency and poor accuracy.
A sample type labeling method is provided. The sample to be detected is input into the non-living and living labeling models for detection through the sample type labeling model. The sample type is determined based on the preset detection dimensions and confidence threshold, and the detection accuracy is improved through model training.
It improves the efficiency and accuracy of sample type labeling, reduces the waste of human resources, improves the accuracy of complex sample detection, and reduces the need for manual participation.
Smart Images

Figure CN118537931A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a sample type labeling method, a sample type labeling device, an electronic device, and a computer-readable storage medium. Background Art
[0002] With the development and progress of artificial intelligence, facial recognition has also made significant progress. However, when the system performs facial recognition, it is vulnerable to live attacks, which may cause damage to the user's property and information security. Therefore, before performing facial recognition, the system needs to learn a large amount of labeled data to achieve the ability of autonomous recognition. Among them, the quality of the labeled data directly affects the accuracy and generalization ability of the system. Label data can be obtained by annotating the data. Data annotation is used to identify the original data (pictures, text files, videos, etc.) and add one or more meaningful information tags to provide context, so that the system can continuously learn the characteristics of these data, and finally realize that the system can autonomously identify living and non-living objects.
[0003] At present, the labeling of liveness detection data mainly relies on manual participation. However, the amount of data to be labeled is huge, which requires a lot of time and human resources, which is costly and time-consuming. In addition, in order to reduce manpower, some algorithm-based labeling tools are provided to improve labeling efficiency, but it is difficult to handle complex data, and the quality of the labeling effect is low, which affects the subsequent application of the system. Summary of the invention
[0004] The main technical problem solved by the present application is to provide a sample type labeling method, a sample type labeling device, an electronic device and a computer-readable storage medium, which can improve the efficiency and accuracy of sample type labeling.
[0005] In order to solve the above technical problems, a technical solution adopted in the present application is: a sample type labeling method is provided, the method comprising: inputting the sample to be detected into a sample type labeling model for sample type detection to obtain the initial sample type of the sample to be detected; in response to the initial sample type of the sample to be detected being a non-living type, performing sample type detection on the sample to be detected according to a preset detection dimension to obtain the target sample type of the sample to be detected.
[0006] In some embodiments, the sample type annotation model includes a non-living annotation model and a living annotation model. The step of inputting the sample to be detected into the sample type annotation model for sample type detection to obtain the initial sample type of the sample to be detected includes: inputting the sample to be detected into the non-living annotation model for non-living detection to obtain a sample type detection result; in response to the sample type detection result characterizing that the sample type of the sample to be detected is a living type, inputting the sample to be detected into the living annotation model to obtain the initial sample type of the sample to be detected output by the living annotation model.
[0007] In some embodiments, the sample type detection result includes a living type and a non-living type, and the step of inputting the sample to be detected into the non-living annotation model for non-living detection to obtain the sample type detection result includes: performing confidence calculation on the sample to be detected through the non-living annotation model to obtain a first target confidence that the sample type of the sample to be detected is the non-living type; in response to the first target confidence being greater than or equal to a first preset confidence threshold, determining that the sample type of the sample to be detected is a non-living type; in response to the first target confidence being less than the first preset confidence threshold, determining that the sample type of the sample to be detected is a living type.
[0008] In some embodiments, the initial sample type includes a non-living type and a living type, and the step of inputting the sample to be detected into the living body annotation model to obtain the initial sample type of the sample to be detected output by the living body annotation model includes: performing confidence calculation on the sample to be detected through the living body annotation model to obtain a second target confidence that the sample type of the sample to be detected is the living body type; in response to the second target confidence being greater than or equal to a second preset confidence threshold, determining that the sample type of the sample to be detected is a living body type; in response to the second target confidence being less than the second preset confidence threshold, determining that the sample type of the sample to be detected is a non-living type
[0009] In some embodiments, the living body labeling model includes a first living body labeling sub-model and a second living body labeling sub-model, and the step of performing confidence calculation on the sample to be detected through the living body labeling model to obtain a second target confidence that the sample type of the sample to be detected is the living body type includes: performing confidence calculation on the sample to be detected through the first living body labeling sub-model to obtain a first confidence that the sample type of the sample to be detected is the living body type; performing confidence calculation on the sample to be detected through the second living body labeling sub-model to obtain a second confidence that the sample type of the sample to be detected is the living body type; and determining the second target confidence that the sample type of the sample to be detected is the living body type based on the first confidence and the second confidence.
[0010] In some embodiments, the step of determining the second target confidence that the sample type of the sample to be detected is the living type based on the first confidence and the second confidence includes: weighting the first confidence and the second confidence to obtain a weighted first confidence and a weighted second confidence; calculating the average value between the weighted first confidence and the weighted second confidence to obtain the second target confidence that the sample type of the sample to be detected is the living type.
[0011] In some embodiments, after performing sample type detection on the sample to be detected and obtaining the target sample type of the sample to be detected, the method further includes: inputting the sample to be detected corresponding to the target sample type into the living body annotation model for model training to obtain a trained living body annotation model; wherein the trained living body annotation model is used to perform sample type detection on the sample to be detected input next time.
[0012] To solve the above technical problems, another technical solution adopted in the present application is: a sample type labeling device is provided, the device comprising a first sample type detection module and a second sample type detection model, the first sample type detection module is used to input the sample to be detected into the sample type labeling model for sample type detection, and obtain the initial sample type of the sample to be detected; the second sample type detection module is used to perform sample type detection on the sample to be detected according to a preset detection dimension when the initial sample type of the sample to be detected is a non-living type, and obtain the target sample type of the sample to be detected.
[0013] To solve the above technical problems, another technical solution adopted in the present application is: to provide an electronic device, including a memory and a processor, wherein the memory stores program instructions, and the processor retrieves the program instructions from the memory to execute the above sample type labeling method.
[0014] In order to solve the above technical problems, another technical solution adopted by the present application is: providing a computer-readable storage medium including program data stored therein, and the program data is used to implement the above sample type labeling method when executed by a processor.
[0015] Compared with the current method of manually labeling sample types, which takes a lot of time and human resources, the above method provides a sample type labeling method, in which the sample to be detected is input into the sample type labeling model for sample type detection to obtain the initial sample type of the sample to be detected; in response to the initial sample type of the sample to be detected being a non-living type, the sample to be detected is subjected to sample type detection according to a preset detection dimension to obtain the target sample type of the sample to be detected. Thus, the sample to be detected, whose initial sample type is a non-living type obtained by the sample type labeling model, is subjected to a second sample type detection according to the preset detection dimension, which can not only improve the efficiency and accuracy of sample type detection, but also reduce the waste of human resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work, among which:
[0017] Figure 1 is a flowchart of an exemplary embodiment of a sample type labeling method shown in the present application;
[0018] Figure 2 yes Figure 1 A schematic flow chart of an exemplary embodiment of step S110 in the sample type labeling method is shown;
[0019] Figure 3 yes Figure 2 A schematic flow chart of an exemplary embodiment of step S210 in the sample type labeling method is shown;
[0020] Figure 4 yes Figure 2 A schematic flow chart of an exemplary embodiment of step S220 in the sample type labeling method is shown;
[0021] Figure 5 yes Figure 1 A schematic flow chart of an exemplary embodiment of the sample type labeling method after step S120 is shown;
[0022] Figure 6It is a specific flow chart of an exemplary embodiment of the sample type labeling method shown in the present application;
[0023] Figure 7 is a schematic structural diagram of an exemplary embodiment of a sample type labeling device shown in the present application;
[0024] Figure 8 It is a structural schematic diagram of an embodiment of an electronic device provided by the present application;
[0025] Fig. 9 It is a structural schematic diagram of an embodiment of a computer-readable storage medium provided by the present application. DETAILED DESCRIPTION
[0026] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It will be appreciated that the specific embodiments described herein are only used to explain the present application, rather than to limit the present application. It should also be noted that, for ease of description, only some but not all structures related to the present application are shown in the drawings. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the art without making creative work are within the scope of protection of the present application.
[0027] First of all, it should be noted that with the widespread application of facial recognition technology, the risks it faces are also increasing, especially from non-living attacks. If the facial recognition system is attacked, it is very likely to cause property loss and privacy leakage of users. Therefore, before performing facial recognition, the facial recognition system needs to learn a large number of labeled samples. The quality and quantity of labeled samples directly affect the recognition accuracy of the facial recognition system when it is applied.
[0028] Currently, labeling samples mainly relies on manual work, which requires a lot of time and human resources. Especially when labeling large sample sets, a large number of labelers need to be hired, which is costly, time-consuming and labor-intensive. In addition, manual labeling may be affected by factors such as the personal experience and cognitive bias of the labelers, resulting in certain deviations in the sample set. The accuracy of model-based sample type labeling is low, and for some complex samples, the model may not provide enough flexibility and functionality to meet the needs.
[0029] Based on this, this application proposes a sample type annotation method, which can be found in Figure 1 , Figure 1 It is a flowchart of an exemplary embodiment of a sample type labeling method shown in the present application.
[0030] The execution subject of the sample type labeling method may be a terminal device or a server or other processing device, wherein the terminal device may be a user equipment (UE), a computer, a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, etc. The execution subject of the sample type labeling method may also be a sample type labeling device. In some possible implementations, the sample type labeling method may be implemented by a processor calling a computer-readable instruction stored in a memory.
[0031] Specifically, the sample type labeling method of this embodiment includes the following steps:
[0032] S110: Input the sample to be detected into the sample type annotation model to perform sample type detection, and obtain the initial sample type of the sample to be detected.
[0033] The sample to be detected refers to the sample that needs to be tested for sample type. Exemplarily, the sample to be detected can be an image or video containing the target object. By identifying the target object in the image or video, it is determined whether the target object is a living type or a non-living type. The sample to be detected can be obtained by photographing a front-end device, etc., where the photographed image may be the real facial information of the target object, or may be a photo or video containing the target object, the facial information of the target object printed on paper, the face of the target object made of 3D silicone, etc.
[0034] The sample type labeling model refers to a model that performs sample type detection on samples to be detected.
[0035] The initial sample type refers to the result obtained by the sample type detection model performing sample type detection on the sample to be detected. Exemplarily, the initial sample type includes a non-living type and a living type.
[0036] The sample type labeling device inputs a large number of samples to be detected that need to be labeled with sample types into the sample type labeling model to perform sample type detection, and obtains the initial sample types of the samples to be detected output by the sample type labeling model.
[0037] S120: In response to the initial sample type of the sample to be detected being a non-living type, performing sample type detection on the sample to be detected according to a preset detection dimension to obtain a target sample type of the sample to be detected.
[0038] The non-living type refers to distinguishing between real facial information and non-real facial information such as forgery, static images, and videos. Exemplarily, the sample type annotation model performs sample type detection on the input sample to be detected, and can determine whether the sample to be detected is a non-living type by analyzing the biometric features and dynamic information in the image or video. For example, the non-living type can be a photo or video containing the target object, the facial information of the target object printed on paper, or the face of the target object made of 3D silicone.
[0039] The preset detection dimension refers to the dimension for judging the sample type of the sample to be detected. Exemplarily, the preset detection dimension may include multiple dimensions, such as attack flaws, imaging characteristics, image edge information, image background information and other dimensions. At this stage, judgment can be made by manual participation, and each dimension is judged and processed manually to obtain the judgment results of the sample to be detected in each dimension whose initial sample type is a non-living type. In some application scenarios, if the sample to be detected is judged to have a non-living risk in each dimension, the sample type of the sample to be detected is determined to be a non-living type, otherwise the sample type of the sample to be detected is determined to be a living type. In other application scenarios, if one dimension of the sample to be detected is judged to have a non-living risk in each dimension, the sample type of the sample to be detected is determined to be a non-living type, otherwise the sample type of the sample to be detected is determined to be a living type.
[0040] The target sample type includes a living type and a non-living type. Exemplarily, the target sample type of the sample to be detected can be obtained by performing sample type detection on the sample to be detected according to a preset detection dimension.
[0041] After the sample type labeling device obtains the sample to be tested that is detected as a non-living type in the sample type labeling model, it can provide it to the labeling personnel for manual labeling. The sample to be tested is manually judged according to the preset detection dimensions to obtain the non-living risk of the sample to be tested in each dimension; the target sample type of the sample to be tested is obtained according to the non-living risk of the sample to be tested in each dimension. In this way, the sample to be tested that cannot be accurately detected by the sample type labeling model can be manually processed to improve the accuracy of sample type detection of complex samples.
[0042] It can be seen that the sample type labeling method of the embodiment of the present application inputs the sample to be detected into the sample type labeling model to perform sample type detection, and obtains the initial sample type of the sample to be detected; in response to the initial sample type of the sample to be detected being a non-living type, the sample to be detected is subjected to sample type detection according to a preset detection dimension to obtain the target sample type of the sample to be detected. Thus, the sample to be detected whose initial sample type is a non-living type obtained by the sample type labeling model is subjected to a second sample type detection according to the preset detection dimension, which can not only improve the accuracy of sample type detection, but also reduce the waste of human resources.
[0043] Based on the above embodiments, the embodiments of the present application adopt Figure 2 The flowchart details how to obtain the initial sample type of the sample to be tested through the sample type annotation model. Figure 2 , Figure 2 yes Figure 1 The flow chart of an exemplary embodiment of step S110 in the sample type labeling method is shown. Specifically, in step S110, the sample to be detected is input into the sample type labeling model to perform sample type detection, and the process of obtaining the initial sample type of the sample to be detected specifically includes the following steps:
[0044] S210: Input the sample to be detected into the non-living body annotation model for non-living body detection to obtain a sample type detection result.
[0045] The non-live annotation model refers to a model that detects that the sample type of the sample to be detected is a non-live type. Exemplarily, the non-live annotation model can be a pre-trained model with a low false rejection rate for live annotation, and the false rejection rate refers to the error rate when the non-live type in the sample to be detected is detected by the non-live annotation model. In some application scenarios, the LPFRR (Liveness Presentation False Rejection Rate false rejection rate of live detection) of the non-live annotation model can be lower than 0.5%, for example, it can be 0.1%, 0.2%, 0.3%, 0.4%, etc. In other application scenarios, the LPFRR (Liveness Presentation False Rejection Rate false rejection rate of live detection) of the non-live annotation model can be lower than 1%, for example, it can be 0.6%, 0.7%, 0.8%, 0.9%, which is not specifically limited here and can be adjusted according to actual conditions. Among them, the lower the false rejection rate, the purer the non-live type detected, and the more non-live types are contained in the live type.
[0046] The sample type detection result refers to the output result obtained by detecting the sample to be detected by the non-living annotation model. Exemplarily, the sample type detection result includes a living type and a non-living type.
[0047] The sample type labeling device first inputs the sample to be detected into the non-living body labeling model for non-living body detection, and obtains the sample type detection result of the sample to be detected output by the non-living body labeling model.
[0048] S220: In response to the sample type detection result indicating that the sample type of the sample to be detected is a living body type, the sample to be detected is input into a living body labeling model to obtain an initial sample type of the sample to be detected output by the living body labeling model.
[0049] The liveness type refers to the real facial information of the target object, as opposed to the static, inactive or simulated state. Since the selected non-liveness annotation model has a low false rejection rate, the non-liveness type output by the non-liveness annotation model is relatively pure, while there are more non-liveness types in the output liveness type. The liveness type output by the non-liveness annotation model needs to be input into the liveness annotation model for further processing.
[0050] The liveness labeling model refers to a model that detects that the sample type of the sample to be detected is a non-liveness type. Exemplarily, the liveness labeling model can be a machine learning model, such as a generative adversarial network model, a random forest model, etc. The liveness labeling model can be a model with a low false acceptance rate, and the false acceptance rate refers to the error rate when the liveness type in the sample to be detected is detected by the liveness labeling model. In some application scenarios, the LPFAR (Liveness Detection Attack False Aceeptancet Rate liveness detection false acceptance rate) of the liveness labeling model can be lower than 0.01%, for example, it can be 0.01%, 0.002%, 0.003%, 0.004%, etc., which is not specifically limited here and can be adjusted according to actual conditions. Among them, the lower the false acceptance rate, the purer the detected liveness type, and the more liveness types will be included in the non-liveness type.
[0051] The sample type labeling device first inputs the sample to be detected into a non-living labeling model with a low false rejection rate for non-living detection to obtain a sample type detection result. When the sample type detection result indicates that the sample type of the sample to be detected is a living type, the sample to be detected is input into the initial sample type of the sample to be detected output by the living labeling model with a low false acceptance rate. In other embodiments, the sample type labeling device may also first input the sample to be detected into a living labeling model for living detection to obtain a sample type detection result of the sample to be detected output by the living labeling model. When the sample detection result indicates that the sample type of the sample to be detected is a non-living type, the sample to be detected is input into the non-living labeling model for sample type detection to obtain the initial sample type of the sample to be detected.
[0052] It can be seen that the sample type labeling method of the embodiment of the present application inputs the sample to be detected into the non-live labeling model for non-liveness detection to obtain the sample type detection result; in response to the sample type detection result characterizing that the sample type of the sample to be detected is a liveness type, the sample to be detected is input into the liveness labeling model to obtain the initial sample type of the sample to be detected output by the liveness labeling model. Thus, by performing sample type detection on the sample to be detected by the non-liveness labeling model and the liveness labeling model, samples with obvious non-liveness characteristics and obvious liveness characteristics can be preliminarily screened out, reducing the amount of subsequent samples and improving the efficiency of sample type detection.
[0053] Based on the above embodiments, the embodiments of the present application adopt Figure 3 The flowchart details how to obtain the sample type detection results of the sample to be tested through the non-living annotation model. Please refer to Figure 3 , Figure 3 yes Figure 2 The flow chart of an exemplary embodiment of step S210 in the sample type labeling method is shown. Specifically, in step S210, the sample to be detected is input into the non-living body labeling model for non-living body detection, and the process of obtaining the sample type detection result specifically includes the following steps:
[0054] S310: Calculate the confidence of the sample to be detected by using the non-living body annotation model to obtain a first target confidence that the sample type of the sample to be detected is a non-living body type.
[0055] Confidence is used to measure the degree of certainty of the non-living annotation model in its output results. Generally, the higher the confidence, the more accurate the output results. For example, the sample to be detected can be input into the non-living annotation model to calculate the confidence of the sample to be detected, and the confidence of the non-living annotation model for the sample to be detected can be obtained.
[0056] The first target confidence refers to the confidence obtained by inputting the sample to be detected into the non-living body annotation model. The main function of the non-living body annotation model is to detect whether the sample to be detected is a non-living body type, so the first target confidence can be the confidence that the sample type of the sample to be detected is a non-living body type.
[0057] The sample type labeling device inputs the sample to be detected into the non-living body labeling model to perform confidence calculation, and obtains a first target confidence that the sample type of the sample to be detected is a non-living body type.
[0058] S320: In response to the first target confidence being greater than or equal to a first preset confidence threshold, determining that the sample type of the sample to be detected is a non-living type.
[0059] The first preset confidence threshold refers to the confidence boundary value between the non-living type and the living type. Exemplarily, the first preset confidence threshold can be preset by a technician. For example, the first preset confidence threshold can be set to 0.9, 0.85, 0.8, etc. The larger the first preset confidence threshold is set, the higher the accuracy of the sample to be detected being judged as a non-living type, but the greater the probability of being judged as a living type, resulting in more samples to be detected flowing to the living annotation model. Therefore, the first preset confidence threshold needs to be set in combination with actual needs.
[0060] The sample type labeling device determines the size relationship between the first target confidence and the first preset confidence threshold that the sample type of the sample to be detected is a non-living type. If the first target confidence is greater than or equal to the first preset confidence threshold, it is determined that the sample type of the sample to be detected is a non-living type.
[0061] S330: In response to the first target confidence being less than a first preset confidence threshold, determining that the sample type of the sample to be detected is a living body type.
[0062] The sample type labeling device determines the size relationship between the first target confidence and the first preset confidence threshold that the sample type of the sample to be detected is a non-living type. If the first target confidence is less than the first preset confidence threshold, it is determined that the sample type of the sample to be detected is a living type.
[0063] In other embodiments, the sample to be detected may be input into a non-living body annotation model for non-living body detection, and a sample type detection result of the sample to be detected output by the non-living body annotation model may be obtained.
[0064] In other embodiments, the sample to be detected can be input into a non-living body annotation model for non-living body detection to obtain the probability that the sample type of the sample to be detected is a non-living body type. In response to the probability of the sample to be detected being greater than a preset probability value, it is determined that the sample type of the sample to be detected is a non-living body type.
[0065] It can be seen that the sample type labeling method of the embodiment of the present application calculates the confidence of the sample to be detected through the non-living body labeling model, and obtains the first target confidence that the sample type of the sample to be detected is a non-living body type; in response to the first target confidence being greater than or equal to the first preset confidence threshold, the sample type of the sample to be detected is determined to be a non-living body type; in response to the first target confidence being less than the first preset confidence threshold, the sample type of the sample to be detected is determined to be a living body type. In this way, not only can the relatively pure non-living body type in the sample to be detected be filtered out through the non-living body labeling model, but also the number of samples to be detected flowing to the next stage can be reduced, thereby improving the efficiency of sample type detection.
[0066] Based on the above embodiments, the embodiments of the present application adopt Figure 4 The flowchart details how to obtain the initial sample type of the sample to be tested through the in vivo annotation model. Figure 4 , Figure 4 yes Figure 2 The flow chart of an exemplary embodiment of step S220 in the sample type labeling method shown in FIG. Specifically, in step S220, the sample to be detected is input into the living body labeling model, and the process of obtaining the initial sample type of the sample to be detected output by the living body labeling model specifically includes the following steps:
[0067] S410: Calculate the confidence of the sample to be detected by using the living body labeling model to obtain a second target confidence that the sample type of the sample to be detected is a living body type.
[0068] The second target confidence refers to the confidence obtained by inputting the sample to be detected into the living body labeling model. The main function of the living body labeling model is to detect whether the sample to be detected is a living body type, so the second target confidence can be the confidence that the sample type of the sample to be detected is a living body type.
[0069] The sample type labeling device inputs the sample to be detected into the non-living body labeling model for non-living body detection, obtains the sample type detection result indicating that the sample type of the sample to be detected is a living body type, inputs the sample to be detected corresponding to the living body type into the living body labeling model, performs confidence calculation on the sample to be detected, and obtains the second target confidence that the sample type of the sample to be detected is a living body type.
[0070] Specifically, the live body annotation model can be a combined model of multiple models. Exemplarily, the live body annotation model may include multiple deep learning models, such as CNN (Convolutional Neural Networks) model, RNN (Recurrent Neural Network) model, etc.; it may also include multiple traditional machine learning models, such as random forest model, support vector machine model, etc. The number of deep learning models may be greater than the number of traditional machine learning models, and the sum of the confidences calculated by the deep learning models is greater than the sum of the confidences calculated by the traditional machine learning models. This embodiment is described by taking the live body annotation model including the first live body annotation sub-model and the second live body annotation sub-model as an example. Of course, this does not limit the number of live body annotation sub-models in the live body annotation model to be greater than two. For example, the live body annotation model may include 5, 10, 20, etc. live body annotation sub-models.
[0071] The confidence of the sample to be detected is calculated by the first live body annotation submodel, and the first confidence that the sample type of the sample to be detected is the live body type is obtained; the confidence of the sample to be detected is calculated by the second live body annotation submodel, and the second confidence that the sample type of the sample to be detected is the live body type is obtained; based on the first confidence and the second confidence, the second target confidence that the sample type of the sample to be detected is the live body type is determined. Among them, the first confidence refers to the confidence obtained by inputting the sample to be detected into the first live body annotation submodel. The second confidence refers to the confidence obtained by inputting the sample to be detected into the second live body annotation submodel. In some application scenarios, the first live body annotation submodel can be a traditional machine learning model, and the traditional machine learning model obtains the distance value by performing sample type detection on the sample to be detected, and the distance value is normalized as the first confidence of the first live body annotation submodel. In other application scenarios, the first live body annotation submodel is a deep learning model, and the first confidence that the sample type of the sample to be detected is the live body type is obtained by inputting the sample to be detected into the first live body annotation submodel. The second living body labeling sub-model can also be a traditional machine learning model or a deep learning model, which is not specifically limited here.
[0072] In other embodiments, the live body annotation model includes multiple live body annotation sub-models, and the sample to be detected is input into each live body annotation sub-model to obtain the confidence that the sample type of the sample to be detected output by each live body annotation sub-model is the live body type, and the confidence less than the third preset confidence threshold is eliminated, and the remaining confidences are weighted averaged to obtain the second target confidence that the sample type of the sample to be detected is the live body type. Exemplarily, the third preset confidence threshold can be less than 0.4, such as 0.1, 0.2, 0.3, etc.
[0073] Specifically, determining the second target confidence that the sample type of the sample to be detected is a living type based on the first confidence and the second confidence may include the following steps: weighting the first confidence and the second confidence to obtain the weighted first confidence and the weighted second confidence; calculating the average value between the weighted first confidence and the weighted second confidence to obtain the second target confidence that the sample type of the sample to be detected is a living type. Among them, the weights corresponding to each living body labeling sub-model in the living body labeling model can be preset. Exemplarily, the weight of the living body labeling sub-model belonging to the traditional machine learning model can be greater than the weight of the living body labeling sub-model belonging to the deep learning model, which can improve the generalization ability of the living body labeling sub-model.
[0074] The calculation of the second target confidence satisfies the following formula:
[0075] Conf all =(w1conf1+w2conf2+…+w n conf n ) / n
[0076] Among them, Conf all represents the second target confidence, w1 represents the weight of the first living body annotation sub-model, conf1 represents the first confidence, w2 represents the weight of the second living body annotation sub-model, conf2 represents the second confidence, w n represents the weight of the nth living body annotation sub-model, conf n Represents the nth confidence level.
[0077] Exemplarily, when the living body annotation model includes a first living body annotation sub-model and a second living body annotation sub-model, the calculation of the second target confidence satisfies the following formula:
[0078] Conf all =(w1conf1+w2conf2) / 2
[0079] Among them, Conf all represents the second target confidence, w1 represents the weight of the first living body labeling sub-model, conf1 represents the first confidence, w2 represents the weight of the second living body labeling sub-model, and conf2 represents the second confidence.
[0080] In some other embodiments, the second target confidence level that the sample type of the sample to be detected is a living body type may also use the average value between the first confidence level and the second confidence level as the second confidence level.
[0081] In other embodiments, the first confidence and the second confidence may be weighted to obtain a weighted first confidence and a weighted second confidence, and the sum of the weighted first confidence and the weighted second confidence may be calculated to obtain a second target confidence that the sample type of the sample to be detected is a living type.
[0082] The sample type labeling device calculates the confidence of the sample to be detected through the first living body labeling sub-model to obtain the first confidence that the sample type of the sample to be detected is the living body type, calculates the confidence of the sample to be detected through the second living body labeling sub-model to obtain the second confidence that the sample type of the sample to be detected is the living body type, weights the first confidence and the second confidence to obtain the weighted first confidence and the weighted second confidence, calculates the average value between the weighted first confidence and the weighted second confidence, and obtains the second target confidence that the sample type of the sample to be detected is the living body type.
[0083] S420: In response to the second target confidence being greater than or equal to the second preset confidence threshold, determining that the sample type of the sample to be detected is a living body type.
[0084] The second preset confidence threshold refers to the confidence boundary value between the living body type and the non-living body type. Exemplarily, the second preset confidence threshold can be preset by a technician. For example, the second preset confidence threshold can be set to 0.9, 0.85, 0.8, etc. The larger the second preset confidence threshold is set, the higher the accuracy of the sample to be detected being judged as a living body type, but the greater the probability of being judged as a non-living body type, resulting in more samples to be detected flowing to the next step for sample type detection according to the preset detection dimension. Therefore, the second preset confidence threshold needs to be set in combination with actual needs.
[0085] The sample type labeling device obtains a size relationship between the second target confidence that the sample type of the sample to be detected is a living type and the second preset confidence threshold. If the second target confidence is greater than or equal to the second preset confidence threshold, it is determined that the sample type of the sample to be detected is a living type.
[0086] S430: In response to the second target confidence being less than a second preset confidence threshold, determining that the sample type of the sample to be detected is a non-living type.
[0087] The sample type labeling device obtains a size relationship between the second target confidence that the sample type of the sample to be detected is a living type and a second preset confidence threshold. If the second target confidence is less than the second preset confidence threshold, it is determined that the sample type of the sample to be detected is a non-living type.
[0088] In other embodiments, the sample to be detected is input into a liveness labeling model to obtain a probability value that the sample type of the sample to be detected is a liveness type. In response to the probability value being greater than or equal to a preset liveness probability value, the sample type of the sample to be detected is determined to be a liveness type. In response to the probability value being less than the preset liveness probability value, the sample type of the sample to be detected is determined to be a non-liveness type.
[0089] It can be seen that the sample type labeling method of the embodiment of the present application calculates the confidence of the sample to be detected through the living body labeling model, and obtains the second target confidence that the sample type of the sample to be detected is a living body type; in response to the second target confidence being greater than or equal to the second preset confidence threshold, the sample type of the sample to be detected is determined to be a living body type; in response to the second target confidence being less than the second preset confidence threshold, the sample type of the sample to be detected is determined to be a non-living body type. In this way, the living body type of the sample to be detected output by the non-living body labeling model is re-detected to obtain a relatively pure living body type, and the number of samples to be detected that flow to the next step for sample type detection according to the preset detection dimension is reduced.
[0090] Based on the above embodiments, the embodiments of the present application adopt Figure 5 The flowchart details how to obtain the initial sample type of the sample to be tested through the in vivo annotation model. Figure 5 , Figure 5 yes Figure 1 The flow chart of an exemplary embodiment after step S120 in the sample type labeling method shown in FIG. Specifically, in step S120, the sample type of the sample to be detected is detected according to the preset detection dimension, and the process after obtaining the target sample type of the sample to be detected specifically includes the following steps:
[0091] S510: Input the sample to be detected corresponding to the target sample type into the living body labeling model for model training to obtain a trained living body labeling model; wherein the trained living body labeling model is used to perform sample type detection on the sample to be detected input next time.
[0092] The target sample type belongs to the sample type of complex and difficult samples to be detected, and the sample type annotation model is easily confused when detecting such samples. Therefore, the samples to be detected corresponding to the target sample type can be input into the in vivo annotation model for model training, and the parameters in the in vivo annotation model can be updated. Exemplarily, the in vivo annotation model can be a combined model, including a traditional machine learning model and a deep learning model. The samples to be detected corresponding to the target sample type can be input into the traditional machine learning model in the in vivo annotation model for model training to obtain a trained traditional machine learning model.
[0093] The sample type labeling device inputs the sample to be detected corresponding to the target sample type into the live body labeling model for model training, and obtains the trained live body labeling model. The sample to be detected input next time is detected by the trained live body labeling model. After the sample type labeling device continuously trains the live body labeling model so that the accuracy of the live body labeling model reaches the preset requirements, the subsequent manual participation and model training can be eliminated, and the sample type detection of the sample to be detected can be completed with only the live body labeling model and the non-live body labeling model.
[0094] It can be seen that the sample type labeling method of the embodiment of the present application inputs the sample to be detected corresponding to the target sample type into the live body labeling model for model training to obtain the trained live body labeling model; wherein the trained live body labeling model is used to perform sample type detection on the sample to be detected input next time. Thus, the complex and difficult samples that require manual participation in judgment are used to train the live body labeling model, thereby improving the detection accuracy of the live body labeling model for the samples to be detected, and finally gradually reducing the degree of manual participation until manual participation is eliminated, thereby improving the efficiency of sample type labeling.
[0095] In order to elaborate on the sample type labeling method of the present application, Figure 6 The flowchart shown further illustrates it, and the details are as follows:
[0096] The sample to be labeled is input into the non-live labeling model for non-live detection. If the sample type detection result is a non-live type, the sample to be detected is directly determined as a non-live type; if the sample type detection result is a live type, the sample to be detected is input into the live labeling model for live detection to obtain the initial sample type of the sample to be detected. The live labeling model includes multiple live labeling sub-models. If the initial sample type is a live type, the sample to be detected is directly determined as a live type; if the initial sample type is a non-live type, the sample to be detected is detected according to the preset detection dimension to obtain the target sample type of the sample to be detected, including obtaining manual judgments on the sample to be detected in various dimensions; the sample to be detected corresponding to the target sample type is input into the live labeling model for model training to obtain the trained live labeling model, and the sample to be detected input next time can be tested for sample type through the trained live labeling model. After the live labeling model training meets the preset requirements, the manual multi-dimensional judgment in the third stage and the model training stage in the fourth stage can be removed, thereby improving the efficiency and accuracy of sample type labeling.
[0097] See also Figure 7 , Figure 7It is a structural schematic diagram of an exemplary embodiment of the sample type labeling device shown in the present application. The sample type labeling device 7 includes a first sample type detection module 710 and a second sample type detection module 720. The first sample type detection module 710 is used to input the sample to be detected into the sample type labeling model to perform sample type detection to obtain the initial sample type of the sample to be detected; the second sample type detection module 720 is used to perform sample type detection on the sample to be detected according to a preset detection dimension when the initial sample type of the sample to be detected is a non-living type, and obtain the target sample type of the sample to be detected.
[0098] In the above scheme, the sample type labeling device of the embodiment of the present application inputs the sample to be detected into the sample type labeling model to perform sample type detection, and obtains the initial sample type of the sample to be detected; in response to the initial sample type of the sample to be detected being a non-living type, the sample to be detected is subjected to sample type detection according to a preset detection dimension, and the target sample type of the sample to be detected is obtained. Thus, the sample to be detected whose initial sample type is a non-living type obtained by the sample type labeling model is subjected to a second sample type detection according to the preset detection dimension, which can not only improve the efficiency and accuracy of sample type detection, but also reduce the waste of human resources.
[0099] The functions of each module can be found in the sample type labeling method implementation example, and will not be described in detail here.
[0100] In order to implement the sample type labeling method of the above embodiment, this application proposes another electronic device, which is specifically referred to as Figure 8 , Figure 8 It is a structural schematic diagram of an embodiment of an electronic device provided by the present application.
[0101] The electronic device 8 includes a memory 810 and a processor 820 , wherein the memory 810 and the processor 820 are coupled.
[0102] The memory 810 is used to store program data, and the processor 820 is used to execute the program data to implement the sample type labeling method of the above embodiment.
[0103] In this embodiment, the processor 820 may also be referred to as a CPU (Central Processing Unit). The processor 820 may be an integrated circuit chip having signal processing capabilities. The processor 820 may also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. A general-purpose processor may be a microprocessor or the processor 820 may also be any conventional processor, etc.
[0104] The present application also provides a computer readable storage medium 9, such as Fig. 9 As shown, the computer-readable storage medium 9 is used to store program data 910. When the program data 910 is executed by the processor, it is used to implement the sample type labeling method in the method embodiment of the present application.
[0105] The method involved in the sample type labeling method embodiment of the present application, when implemented in the form of a software functional unit and sold or used as an independent product, can be stored in a device, such as a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or part of the contribution to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.
[0106] If the technical solution of this application involves personal information, the product using the technical solution of this application has clearly informed the personal information processing rules and obtained the individual's voluntary consent before processing the personal information. If the technical solution of this application involves sensitive personal information, the product using the technical solution of this application has obtained the individual's separate consent before processing the sensitive personal information, and at the same time meets the "explicit consent" requirement. For example, on personal information collection devices such as cameras, clear and prominent signs are set to inform that the personal information collection scope has been entered and personal information will be collected. If the individual voluntarily enters the collection scope, it is deemed that he or she agrees to the collection of his or her personal information; or on the device that processes personal information, the personal information processing rules are notified by obvious signs / information, and the individual's authorization is obtained through pop-up information or by asking the individual to upload his or her personal information; among them, the personal information processing rules may include information such as the personal information processor, the purpose of personal information processing, the processing method, and the type of personal information processed.
[0107] The above description is only an implementation method of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly used in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A sample type labeling method, It is characterized in that The method comprises: Inputting the sample to be detected into the sample type annotation model to perform sample type detection, and obtaining the initial sample type of the sample to be detected; In response to the initial sample type of the sample to be detected being a non-living type, a sample type detection is performed on the sample to be detected according to a preset detection dimension to obtain a target sample type of the sample to be detected.
2. The sample type labeling method according to claim 1, It is characterized in that The sample type annotation model includes a non-living annotation model and a living annotation model. The step of inputting the sample to be detected into the sample type annotation model to perform sample type detection and obtain the initial sample type of the sample to be detected includes: Inputting the sample to be detected into the non-living body annotation model to perform non-living body detection, and obtaining a sample type detection result; In response to the sample type detection result indicating that the sample type of the sample to be detected is a living body type, the sample to be detected is input into the living body annotation model to obtain an initial sample type of the sample to be detected output by the living body annotation model.
3. The sample type labeling method according to claim 2, It is characterized in that The sample type detection result includes a living type and a non-living type, and the step of inputting the sample to be detected into the non-living annotation model for non-living detection to obtain the sample type detection result includes: Calculating the confidence of the sample to be detected by using the non-living body annotation model to obtain a first target confidence that the sample type of the sample to be detected is the non-living body type; In response to the first target confidence being greater than or equal to a first preset confidence threshold, determining that the sample type of the sample to be detected is a non-living type; In response to the first target confidence being less than the first preset confidence threshold, it is determined that the sample type of the to-be-detected sample is a living body type.
4. The sample type labeling method according to claim 2, It is characterized in that The initial sample type includes a non-living type and a living type. The step of inputting the sample to be detected into the living body annotation model to obtain the initial sample type of the sample to be detected output by the living body annotation model includes: Calculating the confidence of the sample to be detected by using the living body annotation model to obtain a second target confidence that the sample type of the sample to be detected is the living body type; In response to the second target confidence being greater than or equal to a second preset confidence threshold, determining that the sample type of the sample to be detected is a living body type; In response to the second target confidence being less than the second preset confidence threshold, it is determined that the sample type of the to-be-detected sample is a non-living type.
5. The sample type labeling method according to claim 4, It is characterized in that The living body annotation model includes a first living body annotation sub-model and a second living body annotation sub-model. The step of calculating the confidence of the sample to be detected by using the living body annotation model to obtain a second target confidence that the sample type of the sample to be detected is the living body type includes: Calculating the confidence of the sample to be detected by using the first living body annotation sub-model to obtain a first confidence that the sample type of the sample to be detected is the living body type; Calculating the confidence of the sample to be detected by using the second living body annotation sub-model to obtain a second confidence that the sample type of the sample to be detected is the living body type; A second target confidence level that the sample type of the sample to be detected is the living body type is determined based on the first confidence level and the second confidence level.
6. The sample type labeling method according to claim 5, It is characterized in that The step of determining the second target confidence level that the sample type of the sample to be detected is the living body type based on the first confidence level and the second confidence level comprises: Performing weighted processing on the first confidence level and the second confidence level to obtain a weighted first confidence level and a weighted second confidence level; An average value between the weighted first confidence and the weighted second confidence is calculated to obtain a second target confidence that the sample type of the sample to be detected is the living body type.
7. The sample type labeling method according to claim 2, It is characterized in that The sample type annotation model includes a living body annotation model. After the step of performing sample type detection on the sample to be detected according to the preset detection dimension to obtain the target sample type of the sample to be detected, the method further includes: Inputting the sample to be detected corresponding to the target sample type into the living body annotation model for model training to obtain a trained living body annotation model; The trained living body labeling model is used to perform sample type detection on the sample to be detected that is input next time.
8. A sample type labeling device, It is characterized in that The device comprises: A first sample type detection module, used to input the sample to be detected into the sample type annotation model to perform sample type detection, and obtain the initial sample type of the sample to be detected; The second sample type detection module is used to perform sample type detection on the sample to be detected according to a preset detection dimension to obtain a target sample type of the sample to be detected when the initial sample type of the sample to be detected is a non-living type.
9. An electronic device, It is characterized in that include: A memory and a processor, wherein the memory stores program instructions, and the processor retrieves the program instructions from the memory to execute the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, It is characterized in that include: Program data is stored, and when the program data is executed by a processor, it is used to implement the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Living body detection and model training method and device
CN111597938A
Depth map prediction-based living body detection method and related equipment
CN113128428A
Model training method, living body detection method, electronic equipment and storage medium
CN114299567A
Living body detection method, device and equipment
CN114550244A
Living body detection model training method, human face living body detection method and electronic equipment
CN116071791A
