Liveness detection method and system
By performing initial liveness detection in the biometric recognition system, instructing the user to input authentication information, and then using a multi-stage liveness detection model for a second detection, the problem of low accuracy in liveness detection in existing technologies is solved, thus improving the system's security.
Patent Information
- Application Number
- CN202211731962.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-30
- Publication Date
- 2026-02-06
- Estimated Expiration
- 2042-12-30
AI Technical Summary
Existing biometric identification systems have low accuracy in detecting liveness, resulting in low security and vulnerability to liveness attacks.
Preliminary liveness detection is performed by acquiring biometric images. Based on the detection results, the user is instructed to input authentication information of a target length. A second liveness detection is then performed based on the actual input information. This multi-stage liveness detection model and authentication process improves detection accuracy.
It improves the accuracy of liveness detection results, enhances the security of biometric identification systems, and reduces the risk of liveness attacks.
Smart Images

Figure CN116189316B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present specification relates to the technical field of artificial intelligence, and particularly relates to a living body detection method and system. BACKGROUND
[0002] At present, biometric recognition (for example, face recognition) is widely used in multiple scenarios, for example, a payment scenario based on face recognition, an access control system based on face recognition, and the like. Biometric recognition can bring convenience to people's life, but at the same time, it can also bring some security risks. Among them, the living body attack is one of the security risks faced by the biometric recognition field, for example, an attacker uses a mobile phone screen, a photo, a printed paper, or a high-precision mask to perform a living body attack.
[0003] Therefore, after a biometric recognition system collects a biometric image, it needs to first detect whether a target user is a living body based on the biometric image, and then perform a subsequent biometric recognition process in a case where it is determined that the target user is a living body. However, it is found in actual application that the accuracy of the detection result is not high when the living body detection is performed based on the biometric image, which leads to low security in the biometric recognition field. SUMMARY
[0004] The present specification provides a living body detection method and system, which can improve the accuracy of the living body detection result, thereby improving the security in the biometric recognition field.
[0005] In a first aspect, the present specification provides a living body detection method, comprising: obtaining a biometric image, the biometric image comprising a biometric feature of a target user; performing preliminary living body detection on the target user based on the biometric image to obtain a preliminary living body detection result of the target user; and instructing the target user to input identity verification information of a target length, and performing again living body detection on the target user based on actual input information of the target user to obtain a target living body detection result of the target user, wherein the target length is related to the preliminary living body detection result.
[0006] In some embodiments, the preliminary living body detection result comprises: a first probability that the target user is a living body; and the target length and the first probability are in an inverse correlation relationship.
[0007] In some embodiments, before instructing the target user to input identity verification information of a target length, the method further comprises: determining a target identity verification type; and determining the target length based on the target identity verification type and the first probability.
[0008] In some embodiments, the determining the target length based on the target identity verification type and the first probability comprises: determining a weight coefficient based on a type of a current application scenario, the weight coefficient being in an inverse correlation relationship with a degree of demand of the current application scenario on security of the biometric recognition; performing weighting processing on the first probability based on the weight coefficient to obtain a scenario-adapted first probability; and determining the target length based on the target identity verification type and the scenario-adapted first probability.
[0009] In some embodiments, the determining the target length based on the target identity verification type and the first probability comprises: inputting the target identity verification type and the first probability into a pre-trained length mapping model to obtain the target length, wherein the length mapping model is trained by using a plurality of groups of training samples, and each group of training samples comprises a sample identity verification type, a sample probability, and a sample length.
[0010] In some embodiments, the determining the target identity verification type comprises: randomly determining the target identity verification type from a plurality of candidate identity verification types; or determining a type of a current application scenario, and selecting an identity verification type matching the type of the current application scenario from the plurality of candidate identity verification types as the target identity verification type; or taking an identity verification type specified by the target user from the plurality of candidate identity verification types as the target identity verification type.
[0011] In some embodiments, the plurality of candidate identity verification types comprise at least two of the following: identity verification by user identification; identity verification by identification of a user terminal; identity verification by registered password; and identity verification by registered account identification.
[0012] In some embodiments, the performing re-liveness detection on the target user based on the actual input information of the target user to obtain a target liveness detection result of the target user comprises: determining identity information of a first user stored in a database as target identity information, wherein the first user is a login user triggering the liveness detection, or the first user is a user obtained by performing biometric recognition on the biometric feature image; and matching the actual input information and the target identity information, and performing one of a first operation or a second operation based on a matching result, wherein the first operation comprises: determining that the matching result is a matching success, and then determining that the target user is a live body, and the second operation comprises: determining that the matching result is a matching failure, and then determining that the target user is a non-live body.
[0013] In some embodiments, the preliminary living body detection result includes: a first probability that the target user is a living body; and the preliminary living body detection on the target user based on the biological feature image includes: inputting the biological feature image into a trained living body detection model, performing living body detection processing on the biological feature image by the living body detection model to obtain a second probability that the target user is a living body and a confidence corresponding to the second probability; and determining the first probability based on the second probability and the confidence corresponding to the second probability.
[0014] In some embodiments, determining the first probability based on the second probability and the confidence corresponding to the second probability includes: determining a product of the second probability and the confidence corresponding to the second probability as the first probability.
[0015] In some embodiments, the living body detection model includes: a feature extraction network, a local living body detection network, a global living body detection network, and a confidence detection network; and the living body detection processing on the biological feature image by the living body detection model to obtain the second probability that the target user is a living body and the confidence corresponding to the second probability includes: performing feature extraction processing on the biological feature image by the feature extraction network to obtain a feature map; performing living body detection processing on a plurality of local regions of the feature map respectively by the local living body detection network to obtain living body detection results of the plurality of local regions; performing living body detection processing on the feature map and the living body detection results of the plurality of local regions by the global living body detection network to obtain the second probability that the target user is a living body; and determining the confidence corresponding to the second probability based on the living body detection results of the plurality of local regions by the confidence detection network.
[0016] In some embodiments, the training process of the living body detection model includes a first training stage and a second training stage, wherein the first training stage is configured to train the feature extraction network, the local living body detection network, and the global living body detection network, and the second training stage is configured to train the confidence detection network.
[0017] In some embodiments, the first training stage comprises: obtaining a sample biological feature image and label information corresponding to the sample biological feature image, the label information comprising a global living body label result and living body label results of a plurality of local regions; inputting the sample biological feature image into the feature extraction network to obtain a sample feature atlas, inputting the sample feature atlas into the local living body detection network to obtain first living body detection results of the plurality of local regions, and inputting the sample feature atlas and the first living body detection results of the plurality of local regions into the global living body detection network to obtain first global living body detection results; and determining a first target loss based on the first global living body detection results, the first living body detection results of the plurality of local regions, the global living body label result, and the living body label results of the plurality of local regions, and training the feature extraction network, the local living body detection network, and the global living body detection network with the goal of minimizing the first target loss.
[0018] In some embodiments, the first training stage further comprises: performing perturbation processing on the sample biological feature image to obtain a perturbed biological feature image, inputting the perturbed biological feature image into the feature extraction network to obtain a perturbed feature atlas, and inputting the perturbed feature atlas into the local living body detection network to obtain second living body detection results of the plurality of local regions; and determining the first target loss based on the first global living body detection results, the first living body detection results of the plurality of local regions, the global living body label result, and the living body label results of the plurality of local regions, comprising: determining the first target loss based on the first global living body detection results, the first living body detection results of the plurality of local regions, the second living body detection results of the plurality of local regions, the global living body label result, and the living body label results of the plurality of local regions.
[0019] In some embodiments, determining the first target loss based on the first global living body detection results, the first living body detection results of the plurality of local regions, the second living body detection results of the plurality of local regions, the global living body label result, and the living body label results of the plurality of local regions comprises: determining a first loss based on a difference between the first global living body detection results and the global living body label result; determining a second loss based on a difference between the first living body detection results of the plurality of local regions and the living body label results of the plurality of local regions; determining a third loss based on a difference between the first living body detection results of the plurality of local regions and the second living body detection results of the plurality of local regions; and determining the first target loss based on the first loss, the second loss, and the third loss.
[0020] In some embodiments, the second training stage comprises: obtaining a sample biological feature image and label information corresponding to the sample biological feature image, the label information comprising a global living body label result and living body label results of a plurality of local regions; inputting the sample biological feature image into the feature extraction network to obtain a sample feature atlas, inputting the sample feature atlas into the local living body detection network to obtain first living body detection results of the plurality of local regions, inputting the first living body detection results of the plurality of local regions into the confidence detection network to obtain detection confidences of the plurality of local regions, updating a corresponding local region of the sample feature atlas based on the detection confidences of the plurality of local regions to obtain an updated feature atlas, inputting the updated feature atlas into the local living body detection network to obtain third living body detection results of the plurality of local regions, and inputting the updated feature atlas and the third living body detection results of the plurality of local regions into the global living body detection network to obtain a second global living body detection result; and determining a second target loss based on the second global living body detection result, the third living body detection results of the plurality of local regions, the global living body label result, and the living body label results of the plurality of local regions, and training the confidence detection network with the training target of minimizing the second target loss.
[0021] In some embodiments, the re-living body detection on the target user based on the actual input information of the target user to obtain a target living body detection result of the target user comprises: performing re-living body detection on the target user based on the actual input information to obtain a re-living body detection result; and determining the target living body detection result based on the preliminary living body detection result and the re-living body detection result.
[0022] In some embodiments, the biological feature comprises at least one of the following: at least one of a face, an iris, a fingerprint, and a palm print.
[0023] In a second aspect, the present specification also provides a living body detection system, comprising: at least one storage medium and at least one processor, the at least one storage medium storing at least one instruction set for living body detection, and the at least one processor being in communication connection with the at least one storage medium, wherein when the living body detection system is running, the at least one processor reads the at least one instruction set and executes the living body detection method according to the instructions of the at least one instruction set.
[0024] According to the technical solution, the living body detection method and system provided in the specification obtains a biological feature image containing a biological feature of a target user, performs preliminary living body detection on the target user based on the biological feature image, obtains a preliminary living body detection result of the target user, then instructs the target user to input identity verification information of a target length, and performs re-living body detection on the target user based on the actual input information of the target user, to obtain a target living body detection result of the target user, wherein the target length is related to the preliminary living body detection result. The above scheme further introduces an identity verification process based on the preliminary living body detection on the target user, that is, instructing the target user to input identity verification information of a target length and performing re-living body detection on the target user based on the actual input information of the target user. Through the two-stage living body detection process, the accuracy of the living body detection result can be improved as a whole. Further, since the target length corresponding to the identity verification information is related to the preliminary living body detection result, the target length has certain variability, and compared with the identity verification information of a fixed length, the accuracy of the living body detection result can be further improved.
[0025] Other functions of the living body detection method and system provided in the specification will be partially listed in the following description. The creative aspects of the living body detection method and system provided in the specification can be fully explained by practicing or using the methods, devices and combinations described in the following detailed examples. BRIEF DESCRIPTION OF DRAWINGS
[0026] In order to more clearly illustrate the technical solutions in the embodiments of the specification, the following will briefly introduce the drawings needed to be used in the embodiment description. Obviously, the drawings in the following description are only some embodiments of the specification, and other drawings can be obtained by those skilled in the art without creative labor.
[0027] Figure 1 An application scenario schematic diagram of a living body detection system provided according to an embodiment of the specification is shown;
[0028] Figure 2 A hardware structure diagram of a computing device provided according to an embodiment of the specification is shown;
[0029] Figure 3 A flowchart of a living body detection method provided according to an embodiment of the specification is shown;
[0030] Figure 4 A structure schematic diagram of a living body detection model provided according to an embodiment of the specification is shown;
[0031] Figure 5A schematic diagram showing a training process of a first training phase of a live detection model provided according to an embodiment of the present specification is shown;
[0032] Figure 6 A schematic diagram showing a training process of a second training phase of a live detection model provided according to an embodiment of the present specification is shown; and
[0033] Figure 7 An interaction schematic diagram of a live detection process provided according to an embodiment of the present specification is shown. DETAILED DESCRIPTION
[0034] The following description provides specific applications and requirements of the present specification, in order to enable a person skilled in the art to manufacture and use the contents of the present specification. Various modifications to the disclosed embodiments are apparent to those skilled in the art, and the general principles defined herein can be applied to other embodiments and applications without departing from the spirit and scope of the present specification. Therefore, the present specification is not limited to the embodiments shown, but is consistent with the widest scope of the claims.
[0035] The terms used herein are used only for the purpose of describing specific example embodiments, and are not limiting. For example, as used herein, the singular forms "a", "an" and "the" can also include the plural forms unless the context clearly dictates otherwise. When used in the present specification, the terms "comprise", "contain" and / or "include" mean that the associated integer, step, operation, element and / or component exists, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups in the system / method.
[0036] These features of the present specification and other features, and the operation and function of related elements of the structure, and the economy of combination and manufacture of components can be significantly improved in view of the following description. Referring to the drawings, all of which form part of the present specification. However, it should be clearly understood that the drawings are for illustrative and descriptive purposes only and are not intended to limit the scope of the present specification. It should also be understood that the drawings are not drawn to scale.
[0037] The flowchart used in the present specification shows the operation of system implementation according to some embodiments of the present specification. It should be clearly understood that the operations of the flowchart can not be implemented in sequence. On the contrary, the operations can be implemented in reverse order or simultaneously. In addition, one or more other operations can be added to the flowchart. One or more operations can be removed from the flowchart.
[0038] For the convenience of description, the present specification will explain the terms appearing in the following description as follows:
[0039] Live attack: a means of attacking a human face recognition system or other biometric system, for example, a live attack can be performed through a mobile phone screen, a printed photo, a high-precision mask, etc.
[0040] Live detection: refers to an algorithm and technology used in a human face recognition or other biometric system to prevent live attack means, and can be specifically used to identify whether a target user is a live body.
[0041] Before the specific embodiments of the present specification are described, the application scenarios of the present specification are introduced as follows:
[0042] The live detection method provided by the present specification can be applied to a scenario of identity verification based on a biometric feature. The live detection method provided by the present specification can be regarded as a user classification method, which can classify a target user as a live body or a non-live body. For example, after a human face recognition (for example, human face payment, human face access control, human face attendance, etc.) system collects a human face image, the live detection method provided by the present specification can be used to perform live detection on the target user based on the human face image, so as to determine whether the target user is a live body. If the target user is a live body, a subsequent human face recognition process is continued to be performed, and if the target user is a non-live body, the subsequent human face recognition process does not need to be performed, thereby improving the security of human face recognition.
[0043] It should be noted that the human face recognition scenario described above is only one of the multiple use scenarios provided by the present specification, and the live detection method provided by the present specification can be applied not only to a human face recognition scenario, but also to all scenarios of identity verification based on other biometric features, for example, a fingerprint, a palm print, an iris, etc. It should be understood by those skilled in the art that the live detection method described in the present specification is also within the protection scope of the present specification when applied to other use scenarios.
[0044] Figure 1 An application scenario schematic diagram of a live detection system according to an embodiment of the present specification is shown. The live detection system 001 (hereinafter referred to as system 001) can be applied to live detection in any scenario, such as a human face recognition supporting scenario, a human face recognition access control scenario, a human face recognition attendance scenario, etc. As shown in Figure 1 The system 001 can include a target user 100, a client 200, a server 300, and a network 400.
[0045] The target user 100 can be a user triggering live detection, and the target user 100 can perform a preset operation on the client 200 to trigger live detection.
[0046] Client 200 may be a device that responds to a liveness detection operation by target user 100. In some embodiments, the liveness detection method described herein may be executed on client 200. In this case, client 200 may store data or instructions for executing the liveness detection method described herein, and may execute or be used to execute said data or instructions. In some embodiments, client 200 may include a hardware device with data processing capabilities and the necessary programs required to drive the hardware device. Figure 1 As shown, client 200 can communicate with server 300. In some embodiments, server 300 can communicate with multiple clients 200. In some embodiments, client 200 can interact with server 300 through network 400 to receive or send messages, such as receiving or sending biometric images. In some embodiments, client 200 may include mobile devices, tablets, laptops, built-in devices in motor vehicles, or similar content, or any combination thereof. In some embodiments, the mobile device may include smart home devices, smart mobile devices, virtual reality devices, augmented reality devices, or similar devices, or any combination thereof. In some embodiments, the smart home device may include smart TVs, desktop computers, etc., or any combination thereof. In some embodiments, the smart mobile device may include smartphones, personal digital assistants, gaming devices, navigation devices, etc., or any combination thereof. In some embodiments, the virtual reality device or augmented reality device may include virtual reality headsets, virtual reality glasses, virtual reality patches, augmented reality headsets, augmented reality glasses, augmented reality patches, or similar content, or any combination thereof. For example, the virtual reality device or the augmented reality device may include Google Glass, head-mounted displays, VR, etc. In some embodiments, the built-in device in the motor vehicle may include an in-vehicle computer, an in-vehicle TV, etc. In some embodiments, the client 200 may include an image acquisition device for acquiring video or image information of the target user, thereby obtaining a biometric image. In some embodiments, the image acquisition device may be a two-dimensional image acquisition device (such as an RGB camera), or a combination of a two-dimensional image acquisition device (such as an RGB camera) and a depth image acquisition device (such as a 3D structured light camera, a laser detector, etc.). In some embodiments, the client 200 may be a device with positioning technology for locating the position of the client 200.
[0047] In some embodiments, the client 200 can be installed with one or more applications (APPs). The APPs can provide the target user 110 with the ability to interact with the outside world through the network 400 and an interface. The APPs include, but are not limited to, web browser type APPs, search type APPs, chat type APPs, shopping type APPs, video type APPs, financial management type APPs, instant messaging tools, email clients, social platform software, and the like. In some embodiments, the client 200 can be installed with a target APP. The target APP can be used to collect video or image information of the target user for the client 200, so as to obtain a biometric image. In some embodiments, the target user 100 can also trigger a live body detection request through the target APP. The target APP can respond to the live body detection request and perform the live body detection method described in the present specification. The live body detection method will be described in detail in the following content.
[0048] The server 300 can be a server that provides various services, such as a background server that provides support for biometric images collected on the client 200. In some embodiments, the live body detection method described in the present specification can be performed on the server 300. At this time, the server 300 can store data or instructions for performing the live body detection method described in the present specification, and can execute or be used to execute the data or instructions. In some embodiments, the server 300 can include a hardware device with data information processing functions and necessary programs for driving the hardware device to work. The server 300 can be in communication connection with multiple clients 200 and receive data sent by the clients 200.
[0049] The network 400 is a medium for providing communication connection between the client 200 and the server 300. The network 400 can facilitate exchange of information or data. As Figure 1 shown, the client 200 and the server 300 can be connected to the network 400 and transmit information or data to each other through the network 400. In some embodiments, the network 400 can be any type of wired or wireless network, or a combination thereof. For example, the network 400 can include a cable network, a wired network, a fiber-optic network, a telecommunication communication network, an intranet, the Internet, a local area network (LAN), a wide area network (WAN), a wireless local area network (WLAN), a metropolitan area network (MAN), a wide area network (WAN), a public switched telephone network (PSTN), a Bluetooth network, a ZigBee network, a near field communication (NFC) network, or the like. In some embodiments, the network 400 can include one or more network access points. For example, the network 400 can include wired or wireless network access points, such as base stations or Internet exchange points, through which one or more components of the client 200 and the server 300 can connect to the network 400 to exchange data or information.
[0050] It should be understood that Figure 1 The number of clients 200, servers 300 and networks 400 in
[0051] It should be noted that the live detection method described in the specification can be completely executed on the client 200, or completely executed on the server 300, or partially executed on the client 200 and partially executed on the server 300.
[0052] Figure 2 A hardware structure diagram of a computing device 600 is shown, which is provided according to an embodiment of the specification. The computing device 600 can execute the live detection method described in the specification. The live detection method is introduced in other parts of the specification. When the live detection method is executed on the client 200, the computing device 600 can be the client 200. When the live detection method is executed on the server 300, the computing device 600 can be the server 300. When the live detection method can be partially executed on the client 200 and partially executed on the server 300, the computing device 600 can include the client 200 and the server 300.
[0053] As Figure 2 The computing device 600 can include at least one storage medium 630 and at least one processor 620, as shown. In some embodiments, the computing device 600 can also include a communication port 650 and an internal communication bus 610. At the same time, the computing device 600 can also include an I / O component 660.
[0054] The internal communication bus 610 can connect different system components, including the storage medium 630, the processor 620 and the communication port 650.
[0055] The I / O component 660 supports input / output between the computing device 600 and other components.
[0056] The communication port 650 is used for data communication between the computing device 600 and the outside world, for example, the communication port 650 can be used for data communication between the computing device 600 and the network 400. The communication port 650 can be a wired communication port or a wireless communication port.
[0057] The storage medium 630 can include a data storage device. The data storage device can be a non-transitory storage medium or a transitory storage medium. For example, the data storage device can include one or more of a disk 632, a read-only memory (ROM) 634, or a random access memory (RAM) 636. The storage medium 630 also includes at least one set of instructions stored in the data storage device. The instructions stored in the set of instructions are computer program code that can include programs, routines, objects, components, data structures, procedures, modules, and the like that perform the live detection methods provided in the present specification.
[0058] The at least one processor 620 can be communicatively connected to the at least one storage medium 630 and the communication port 650 through the internal communication bus 610. The at least one processor 620 is configured to execute the at least one set of instructions. When the computing device 600 is running, the at least one processor 620 reads the at least one set of instructions and executes the live detection methods provided in the present specification according to the instructions in the at least one set of instructions. The processor 620 can execute all steps or part of the steps of the live detection methods. The processor 620 can be in the form of one or more processors, and in some embodiments, the processor 620 can include one or more hardware processors, such as a microcontroller, a microprocessor, a reduced instruction set computer (RISC), an application-specific integrated circuit (ASIC), an application-specific instruction set processor (ASIP), a central processing unit (CPU), a graphics processing unit (GPU), a physics processing unit (PPU), a microcontroller unit, a digital signal processor (DSP), a field programmable gate array (FPGA), an advanced RISC machine (ARM), a programmable logic device (PLD), any circuit or processor capable of executing one or more functions, or the like, or any combination thereof. For the sake of illustration only, only one processor 620 is described in the computing device 600 in the present specification. However, it should be noted that the computing device 600 in the present specification can also include multiple processors, and thus, the operations and / or method steps disclosed in the present specification can be executed by one processor as described in the present specification, or jointly executed by multiple processors. For example, if the processor 620 of the computing device 600 in the present specification executes step A and step B, it should be understood that step A and step B can also be executed jointly or separately by two different processors 620 (e.g., a first processor executes step A, and a second processor executes step B, or the first and second processors jointly execute steps A and B).
[0059] Figure 3A flowchart of a living body detection method P100 according to an embodiment of the present specification is shown. As before, the computing device 600 can perform the living body detection method P100 described in the present specification. Specifically, the processor 620 can read a set of instructions stored in its local storage medium, and then perform the living body detection method P100 described in the present specification according to the provisions of the set of instructions. As shown, the method P100 can include: Figure 3
[0060] S110: Obtain a biometric image, the biometric image comprising a biometric feature of a target user.
[0061] The biometric image can refer to an image containing a biometric feature of the target user 100. With the uniqueness of the biometric feature, the biometric image can be used to identify or verify the identity information of the target user 100. The biometric feature involved in the biometric recognition described in the embodiments of the present application can include, for example, eyeprint, voiceprint, fingerprint, palmprint, heartbeat, pulse, chromosome, DNA, human tooth bite mark, etc. In some embodiments, the above-mentioned biometric features can include at least one of a human face, an eyeprint, a fingerprint, a palmprint, or an iris. The eyeprint can include biometric features such as the iris and the sclera. In other words, the above-mentioned biometric image can be at least one of a human face image, an eyeprint image, a fingerprint image, a palmprint image, or an iris image.
[0062] In some embodiments, when the computing device 600 is the client 200, the client 200 can obtain the above-mentioned biometric image by capturing the target user 100 using an image capturing module. In some embodiments, when the computing device 600 is the server 300, the server 300 can receive the biometric image from the client 200, wherein the above-mentioned biometric image can be obtained by the client 200 capturing the target user 100 using an image capturing module.
[0063] S120: Perform preliminary living body detection on the target user based on the biometric image, to obtain a preliminary living body detection result of the target user.
[0064] The preliminary living body detection result is used to preliminarily indicate whether the target user 100 is a living body. For example, the preliminary living body detection result can include a first probability that the target user 100 is a living body.
[0065] In some embodiments, the processor 620 can input the biometric feature image into a pre-trained living body detection model, where the living body detection model has the ability to identify whether the target user 100 is a living body. In this way, by performing preliminary living body detection on the target user 100 through the living body detection model, a preliminary living body detection result of the target user 100 can be obtained, i.e., a first probability that the target user 100 is a living body. It should be noted that the living body detection model can be any machine learning model with living body detection capability.
[0066] In some embodiments, in addition to the ability to identify whether the target user 100 is a living body, the living body detection model can also have the ability to detect the confidence of the model output result. Specifically, the processor 620 inputs the biometric feature image into the trained living body detection model, and performs living body detection processing on the biometric feature image through the living body detection model to obtain a second probability that the target user is a living body and a confidence corresponding to the second probability. In this case, the processor 620 can determine the preliminary living body detection result of the target user 100 based on the second probability and the confidence corresponding to the second probability, i.e., the first probability that the target user 100 is a living body. In some embodiments, assuming that the second probability output by the living body detection model is denoted as P, and the confidence corresponding to the second probability P is denoted as C, where the value ranges of P and C are both [0, 1]. The product of the second probability P and the confidence C can be determined as the first probability S, i.e.:
[0067] S=C*P formula (1)
[0068] As can be seen from the above formula (1), the first probability S is positively correlated with the second probability P and the confidence C, that is, the higher the second probability P output by the living body detection model and the higher the confidence C, the higher the first probability S. It should be understood that the above first probability S can be regarded as a probability obtained by correcting the second probability P output by the model using the confidence C, and therefore the accuracy of the first probability S relative to the second probability P is higher.
[0069] Figure 4 A structural diagram of a living body detection model according to an embodiment of the present specification is shown. As shown in Figure 4 , the living body detection model 400 can include a feature extraction network 401, a local living body detection network 402, a global living body detection network 403, and a confidence detection network 404. Referring to Figure 4 , the living body detection process of the living body detection model 400 on the target user 100 can include:
[0070] (1) inputting the biometric feature image into the feature extraction network 401, and performing feature extraction processing on the biometric feature image through the feature extraction network 401 to obtain a feature map.
[0071] (2) input the feature map into the local liveness detection network 402, and perform liveness detection processing on multiple local regions of the feature map respectively through the local liveness detection network 402 to obtain liveness detection results of the multiple local regions.
[0072] The multiple local regions refer to multiple regions obtained by region division of the feature map in a certain region division manner. For example, the feature map can be divided into 3*3=9 local regions by being divided into 3 equal parts in the height direction and being divided into 3 equal parts in the width direction. It should be understood that the embodiments of the present specification are not limited to the local region division manner, for example, the multiple local regions can also be regions obtained by random division. The liveness detection result of each local region indicates a detection result obtained by performing liveness detection on the target user based on the image content of the local region. Taking the case of dividing the feature map into 9 local regions as an example, the feature map is input into the local liveness detection network, and the liveness probabilities corresponding to the 9 local regions can be obtained.
[0073] (3) input the feature map and the liveness detection results of the multiple local regions into the global liveness detection network 403, and perform liveness detection processing on the feature map and the liveness detection results of the multiple local regions through the global liveness detection network 403 to obtain a global liveness detection result.
[0074] The global liveness detection result can include a second probability that the target user is a live body (i.e., the probability P described above). It should be understood that the global liveness detection network 403 not only considers the feature map, but also considers the liveness detection results of the multiple local regions when performing global liveness detection, so that the obtained global liveness detection result is more accurate.
[0075] (4) input the liveness detection results of the multiple local regions into the confidence detection network 404 to obtain a confidence corresponding to the global liveness detection result.
[0076] Specifically, the confidence detection network 404 can determine the confidence corresponding to the multiple local regions based on the liveness detection results of the multiple local regions. The confidence corresponding to each local region indicates the credibility of the liveness detection result of the local region. Further, the confidence detection network 404 can determine the confidence corresponding to the global liveness detection result (e.g., the confidence C described above) based on the confidence corresponding to the multiple local regions. For example, the confidence corresponding to the global liveness detection result can be obtained by performing weighted mean operation on the confidence corresponding to the multiple local regions.
[0077] It should be noted that the embodiments of the present specification are not limited to the specific network structures of the feature extraction network 401, the local liveness detection network 402, the global liveness detection network 403, and the confidence detection network 404. For example, CNN (Convolutional Neural Network), DNN (Deep Neural Network), RNN (Recurrent Neural Network), or any other feasible network structure can be used.
[0078] The training process of the liveness detection model shown in Figure 4 will be described below.
[0079] The liveness detection model can be trained in a staged manner. In some embodiments, the training process of the liveness detection model can include a first training stage and a second training stage. The first training stage is configured to train the feature extraction network 401, the local liveness detection network 402, and the global liveness detection network 403. The second training stage is configured to train the confidence detection network 404. That is, the feature extraction network 401, the local liveness detection network 402, and the global liveness detection network 403 are trained first, and then the confidence detection network 404 is trained after the three network units converge. It should be understood that by training in stages, the training computational load of each stage can be reduced, which is beneficial to improve the overall training efficiency.
[0080] Figure 5 A schematic diagram of the training process of the first training stage of the liveness detection model according to an embodiment of the present specification is shown. As Figure 5 shown, in some embodiments, the training process of the first training stage described above can include:
[0081] (1) Obtain a sample biometric feature image and annotation information corresponding to the sample biometric feature image, the annotation information including a global liveness annotation result and a plurality of local region liveness annotation results.
[0082] The annotation information corresponding to the sample biometric feature image is used to indicate whether the sample biometric feature image is obtained by collecting a living body or obtained by a living body attack.
[0083] (2) Referring to Figure 5inputting the sample biological feature image into a feature extraction network 401 to obtain a sample feature map, inputting the sample feature map into a local living body detection network 402 to obtain first living body detection results of a plurality of local regions, and inputting the sample feature map and the first living body detection results of the plurality of local regions into a global living body detection network 403 to obtain first global living body detection results.
[0084] (3) Continuing to refer to Figure 5 , determining a first target loss based on the first global living body detection results, the first living body detection results of the plurality of local regions, the global living body annotation results and the living body annotation results of the plurality of local regions, and training the feature extraction network 401, the local living body detection network 402 and the global living body detection network 403 with the target of minimizing the first target loss.
[0085] In some embodiments, the first target loss can be calculated in the following manner: determining a global loss based on the difference between the first global living body detection results and the global living body annotation results, determining a local loss based on the difference between the first living body detection results of the plurality of local regions and the living body annotation results of the plurality of local regions, and then determining the first target loss based on the global loss and the local loss. Continuing to refer to Figure 5 After the first target loss is determined, the network parameters of the feature extraction network 401, the local living body detection network 402 and the global living body detection network 403 can be adjusted with the training target of minimizing the first target loss until the above three network units reach a convergence condition or until a preset iteration number is reached.
[0086] In the above first training phase, not only the global loss but also the local loss is considered when determining the first target loss, so that the determined first target loss is more accurate. After the first training phase, the living body detection model has the ability to perform living body detection based on biological feature images.
[0087] In some embodiments, the first training phase can further include: performing disturbance processing on the sample biological feature image to obtain a disturbed biological feature image. The disturbance processing can be global disturbance or local disturbance, for example, noise can be added to all or part of the sample biological feature image to form a disturbed biological feature image. Then, the disturbed biological feature image is input into the feature extraction network to obtain a disturbed feature map, and the disturbed feature map is input into the local living body detection network to obtain second living body detection results of a plurality of local regions.
[0088] On this basis, the first target loss can be determined based on the first global living body detection result, the first living body detection results of the plurality of local regions, the second living body detection results of the plurality of local regions, the global living body annotation result, and the living body annotation results of the plurality of local regions. In some embodiments, the first target loss can be calculated as follows: based on the difference between the first global living body detection result and the global living body annotation result, a first loss is determined, based on the difference between the first living body detection results of the plurality of local regions and the living body annotation results of the plurality of local regions, a second loss is determined, based on the difference between the first living body detection results of the plurality of local regions and the second living body detection results of the plurality of local regions, a third loss is determined, and then, based on the first loss, the second loss, and the third loss, the first target loss is determined. Wherein, the first loss is used to represent the global loss, the second loss is used to represent the local loss, and the third loss is used to represent the perturbation consistency loss, i.e. the difference between the local living body detection results of the images before and after perturbation.
[0089] In the above first training stage, not only the original sample biological feature image is used, but also the perturbed biological feature image is used, and when determining the first target loss, not only the global loss (i.e. the first loss) and the local loss (i.e. the second loss) are considered, but also the perturbation consistency loss (i.e. the third loss) is considered, so that the trained living body detection model is not sensitive to perturbation, i.e. the living body detection result of the perturbed image is consistent with the living body detection result of the non-perturbed image. In this way, the living body detection result of the trained living body detection model for the perturbed image and the non-perturbed image has high accuracy.
[0090] Figure 6 A schematic diagram of a training process of a second training stage of a living body detection model according to an embodiment of the present specification is shown. As shown in Figure 6 In some embodiments, the training process of the second training stage can include:
[0091] (1) obtaining a sample biological feature image and annotation information corresponding to the sample biological feature image, the annotation information including a global living body annotation result and living body annotation results of a plurality of local regions.
[0092] (2) referring to Figure 6input the sample feature map into the local liveness detection network 402 to obtain a first liveness detection result of a plurality of local regions, input the first liveness detection result of the plurality of local regions into the confidence detection network 404 to obtain a detection confidence of the plurality of local regions, update a corresponding local region of the sample feature map based on the detection confidence of the plurality of local regions to obtain an updated sample feature map, input the updated sample feature map into the local liveness detection network 402 to obtain a third liveness detection result of the plurality of local regions, and input the updated sample feature map and the third liveness detection result of the plurality of local regions into the global liveness detection network 403 to obtain a second global liveness detection result.
[0093] The second training phase is different from the first training phase in that, after obtaining the first liveness detection result of the plurality of local regions by the local liveness detection network 402, the second training phase further obtains the detection confidence of the plurality of local regions by the confidence detection network 404, and then updates the corresponding local region of the feature map with the detection confidence of the plurality of local regions as a weight coefficient to obtain an updated feature map. Further, the updated feature map is subjected to liveness detection by the local liveness detection network 402 and the global liveness detection network 403. It should be understood that the process of liveness detection of the updated feature map by the local liveness detection network 402 and the global liveness detection network 403 is similar to that in the first training phase, which will not be repeated here.
[0094] (3) Continuing to refer to Figure 6 , the second target loss is determined based on the second global liveness detection result, the third liveness detection result of the plurality of local regions, the global liveness annotation result, and the liveness annotation result of the plurality of local regions, and the confidence detection network 404 is trained with the minimization of the second target loss as the training target.
[0095] It should be understood that the calculation method of the second target loss in the second training phase is similar to that of the first target loss in the first training phase, which will not be repeated here. After the second target loss is calculated, the network parameters of the confidence detection network 404 are adjusted with the minimization of the second target loss as the training target, until the confidence detection network 404 reaches the convergence condition, or until the preset number of iterations is reached.
[0096] After the above-mentioned first training phase and second training phase, the liveness detection model not only has the liveness detection capability, but also has the capability of detecting the confidence of the model output result, that is, the liveness detection model not only outputs the second probability P, but also outputs the confidence C.
[0097] S130: instruct the target user to input identity verification information of a target length, and perform re-liveness detection on the target user based on actual input information of the target user to obtain a target liveness detection result of the target user, wherein the target length is related to the preliminary liveness detection result.
[0098] The identity verification information refers to information used to verify the identity of the target user. For example, the identity verification information can include at least one of the following: a user identifier (such as an ID number), an identifier of a user terminal (such as a mobile phone number), a registered account identifier (such as an account registered by the user in an app), a registered password, and the like.
[0099] In the embodiments of the present specification, the preliminary liveness detection result can also be referred to as an intermediate liveness detection result, and the target liveness detection result can also be referred to as a final liveness detection result.
[0100] After obtaining the preliminary liveness detection result of the target user, the embodiments of the present specification further introduce an identity verification process, that is, instructing the target user to input identity verification information of a target length. Further, the processor 620 obtains actual input information input by the target user according to the instruction, and performs re-liveness detection on the target user based on the actual input information to obtain a target liveness detection result of the target user. It can be understood that the above scheme can improve the accuracy of the liveness detection result as a whole through the detection of the two stages of preliminary liveness detection and re-liveness detection. Further, since the target length is related to the preliminary liveness detection result, the target length has a certain variability, which can further improve the accuracy of the liveness detection result compared to the identity verification information of a fixed length.
[0101] In some embodiments, the preliminary liveness detection result includes a first probability that the target user is a live body. The target length is inversely related to the first probability. That is, the greater the first probability, the shorter the target length, and the smaller the first probability, the longer the target length. It should be understood that when the first probability is large, it means that the target user is more likely to be a live body, that is, the security of the current biometric recognition is high, and therefore, in this case, the target user can be instructed to input identity verification information of a shorter length, which can reduce the interaction time of the target user and improve the liveness detection efficiency. When the first probability is small, it means that the target user is more likely to be a non-live body, that is, the security of the current biometric recognition is low, and therefore, in this case, the target user can be instructed to input identity verification information of a longer length in order to improve the security of the current biometric recognition. As can be seen, the target length is inversely related to the first probability, which can reduce the interaction time of the target user as much as possible while ensuring the security of biometric recognition, and improve the liveness detection efficiency.
[0102] In some embodiments, before S130, there can further include: determining a target identity verification type, and determining the target length based on the target identity verification type and the first probability. The target identity verification type can be one of the following multiple candidate identity verification types: identity verification through user identification, identity verification through user terminal identification, identity verification through registered account identification, and identity verification through registered password. Different identity verification types have different security guarantees, and one of the identity verification types can be determined as the target verification type according to requirements.
[0103] In some embodiments, the target identity verification type can be determined in the multiple candidate identity verification types in one of the following ways:
[0104] Method 1: randomly determining the target identity verification type in the multiple candidate identity verification types. For example, one of the multiple candidate identity verification types can be randomly selected as the target identity verification type. The random method makes it possible to not use a certain identity verification type in different biometric identification processes, thereby further improving the security of biometric identification.
[0105] Method 2: based on the type of the current application scenario, selecting an identity verification type matching the type of the current application scenario from the multiple candidate identity verification types as the target identity verification type. Different candidate identity verification types correspond to different security levels. For example, the security level of “identity verification through registered password” is higher than that of “identity verification through user terminal identification”. Therefore, in a scenario with high security requirements, “identity verification through registered password” can be used as the target identity verification type, and in a scenario with low security requirements, “identity verification through user terminal identification” can be used as the target identity verification type. This method can meet the security requirements of different application scenarios.
[0106] Method 3: using the identity verification type specified by the target user in the multiple candidate identity verification types as the target identity verification type. For example, the target user can set the target identity verification type in the registration stage or any other stage to specify which identity verification type to use as the target identity verification type. This method can increase the verification flexibility of the target user and meet the individual verification requirements of different users.
[0107] In some embodiments, the target length can be determined by inputting the target identity verification type and the first probability into a pre-trained length mapping model to obtain the target length. The length mapping model is trained by a plurality of sets of training samples, each set of training samples including a sample identity verification type, a sample probability, and a sample length. The plurality of sets of training samples are obtained based on historical data, and the security of the biometric recognition corresponding to the historical data meets a preset requirement. It should be noted that the embodiments of the present specification do not limit the network structure of the length mapping model. For example, a neural network can be used, an MLP (Multi-Layer Perceptron) network can be used, or any other feasible network structure can be used. The trained length mapping model has the ability to map the target identity verification type and the first probability to the target length. The above embodiments determine the target length by using the pre-trained length mapping model, which has high processing efficiency on the one hand, and makes the target length have high accuracy on the other hand.
[0108] In some embodiments, the target length can also be determined by determining a weight coefficient based on the type of the current application scenario, the weight coefficient being in an inverse correlation with the security requirement degree of the current application scenario for biometric recognition; weighting the first probability based on the weight coefficient to obtain a scenario-adapted first probability; and determining the target length based on the target identity verification type and the scenario-adapted first probability.
[0109] Specifically, the higher the security requirement degree of the current application scenario for biometric recognition, the smaller the weight coefficient, and the lower the security requirement degree of the current application scenario for biometric recognition, the larger the weight coefficient. For example, the scenario can be divided into a high-security scenario, a medium-security scenario, and a low-security scenario based on the high and low of the security requirement degree. If the current application scenario is a high-security scenario, the weight coefficient is determined to be 0.8, if the current application scenario is a medium-security scenario, the weight coefficient is determined to be 1, and if the current application scenario is a low-security scenario, the weight coefficient is determined to be 1.25.
[0110] Let the determined weight coefficient be , and the first probability be S, then the scenario-adapted first probability can be obtained by the following formula:
[0111]
[0112] After the scenario-adapted first probability is determined, the target identity verification type and the scenario-adapted first probability The input trained length mapping model to obtain the target length.
[0113] After determining the target length, the target user can be instructed to input identity authentication information of the target length. For example, assuming that the target length is 4 and the target identity authentication type is “identity authentication by user terminal identification”, the target user can be instructed to input the last four characters of the terminal identification (e.g., a mobile phone number). For another example, assuming that the target length is 6 and the target identity authentication type is “identity authentication by registered password”, the target user can be instructed to input the 2nd to 7th characters of the registered password. It should be noted that the embodiments of the present specification do not limit the manner of instructing the target user, for example, the target user can be instructed to input the identity authentication information of the target length in a text manner in an interactive interface, or the target user can be instructed to input the identity authentication information of the target length in a voice manner, or the target user can be instructed to input the identity authentication information of the target length in any other manner.
[0114] After instructing the target user to input the identity authentication information of the target length, the processor 620 can obtain actual input information input by the target user based on the instruction. It should be noted that the embodiments of the present specification do not limit the input manner adopted by the target user, for example, the target user can input in a text manner, the target user can input in a voice manner, or the target user can input in any other possible manner. Further, the processor 620 can perform re-liveness detection on the target user based on the actual input information of the target user, thereby obtaining a target liveness detection result of the target user.
[0115] In some embodiments, the target liveness detection result of the target user can be determined in the following manner: determining the identity information of the first user stored in the database as the target identity information, wherein the first user is the login user triggering the liveness detection, or the first user is the user obtained by performing biometric recognition on the biometric image. For example, the current login user can be taken as the first user, and the identity information of the first user in the database can be queried as the target identity information. For another example, the biometric image can be subjected to biometric recognition, the user obtained by the recognition can be taken as the first user, and the identity information of the first user in the database can be queried as the target identity information. Further, the actual input information of the target user is matched with the target identity information to obtain a matching result, and the matching result is used to execute one of a first operation and a second operation. The first operation includes determining that the matching result is a matching success, and determining that the target user is a living body, and the second operation includes determining that the matching result is a matching failure, and determining that the target user is a non-living body.
[0116] Figure 7An interactive schematic diagram of a liveness detection process provided according to an embodiment of this specification is shown. Figure 7 As shown, taking a facial recognition payment scenario as an example, client 200 presents interface 701. In interface 701, after the target user clicks "Start Facial Recognition Payment," client 200 presents interface 702. As shown in interface 702, client 200 activates the image acquisition module to acquire the target user's facial image. After acquiring the facial image, client 200 or server 300 (e.g., client 200 sends the biometric image to server 300) inputs the facial image... Figure 4 The liveness detection model shown obtains the first probability P and confidence level C of the target user being alive, and then calculates the first probability S of the target user being alive. Further, based on the target authentication type and the first probability S, the target length of the authentication information required from the target user during the authentication phase can be determined. Assuming the determined target length is 4, client 200 can present interface 703, instructing the target user to input 4 digits of authentication information (e.g., the last 4 digits of a mobile phone number). Referring to interface 704, after the target user inputs the 4 digits of authentication information and clicks "confirm," client 200 or server 300 obtains the actual input information of the target user (e.g., "1234") and matches it with the identity information of the first user stored in the database. If the match is successful, the target user is determined to be alive; if the match fails, the target user is determined to be not alive. If the target user is determined to be alive, client 200 or server 300 can perform facial recognition on the target user based on the facial image to verify the target user's identity. If the verification is successful, payment is made, and interface 705 is displayed after successful payment. If the target user is determined to be non-live, the client 200 or server 300 will not execute the subsequent face recognition process, and the face payment will fail. The target user's identity verification will fail, and the display interface will indicate that the identity verification failed.
[0117] It should be noted that, Figure 7 This manual uses a face payment scenario as an example to illustrate the interaction process. The liveness detection solution provided in this manual is applied to other scenarios with similar interaction processes, and this manual will not provide examples for each of them.
[0118] In some embodiments, the preliminary liveness detection result includes a first probability that the target user is alive. If the first probability is determined to be greater than or equal to a preset probability, step S130 is executed. For example, the preset probability can be 30%, meaning that step S130 is only executed when the first probability is greater than or equal to 30%. This filters out cases where the target user is clearly not alive; that is, if the target user is clearly not alive, there is no need to perform an authentication process, thus improving liveness detection efficiency.
[0119] In some embodiments, after obtaining the actual input information of the target user, the target user can be subjected to re-liveness detection based on the actual input information, to obtain a re-liveness detection result, and then based on the preliminary liveness detection result and the re-liveness detection result, a target liveness detection result of the target user is determined. For example, assuming that the preliminary liveness detection result indicates that the probability of the target user being a live body is 55%, and the re-liveness detection result indicates that the probability of the target user being a live body is 90%, the average (or weighted average) of the above two probabilities can be taken as the final probability of the target user being a live body, and if the final probability is greater than or equal to a preset threshold, it is determined that the target user is a live body, and if the final probability is less than the preset probability, it is determined that the target user is a non-live body. In this embodiment, by comprehensively analyzing the preliminary liveness detection result and the re-liveness detection result to determine the target liveness detection result, the accuracy of the target liveness detection result can be further improved.
[0120] In summary, the liveness detection method P100 and system 001 provided in the present specification obtain a biological feature image containing a biological feature of a target user, perform preliminary liveness detection on the target user based on the biological feature image to obtain a preliminary liveness detection result of the target user, then instruct the target user to input identity verification information of a target length, and perform re-liveness detection on the target user based on the actual input information of the target user to obtain a target liveness detection result of the target user, wherein the target length is related to the preliminary liveness detection result. The above scheme further introduces an identity verification process based on the preliminary liveness detection of the target user based on the biological feature image, i.e., instructing the target user to input identity verification information of a target length, and performing re-liveness detection on the target user based on the actual input information of the target user. Through the above two stages of liveness detection process, the accuracy of the liveness detection result can be improved as a whole. Further, since the target length corresponding to the identity verification information is related to the preliminary liveness detection result, the target length has a certain variability, which can further improve the accuracy of the liveness detection result compared to the fixed length of the identity verification information. In addition, the above scheme based on the preliminary liveness detection result performs a variable length identity verification process, which also makes the scheme have higher application flexibility. For example, when the preliminary liveness detection result indicates that the probability of the target user being a live body is relatively high, the target user can be instructed to input identity verification information of a shorter length to save the interaction time of the target user and improve the liveness detection efficiency; when the preliminary liveness detection result indicates that the probability of the target user being a live body is relatively low, the target user can be instructed to input identity verification information of a longer length to ensure the accuracy of the liveness detection result as much as possible.
[0121] The collection, storage, use, processing, transmission, provision and disclosure of user personal information in the technical solutions provided in the specification comply with relevant laws and regulations and do not violate public order and good customs.
[0122] In another aspect of the present specification, there is provided a non-transitory storage medium storing at least one set of executable instructions for performing the living body detection. When the executable instructions are executed by a processor, the executable instructions direct the processor to implement the steps of the living body detection method P100 described in the present specification. In some possible implementations, various aspects of the present specification can also be implemented as a program product in the form of a program code. When the program product is run on the computing device 600, the program code is used to cause the computing device 600 to perform the steps of the living body detection method P100 described in the present specification. The program product for implementing the above method can include the program code in a portable compact disc read-only memory (CD-ROM) and can be run on the computing device 600. However, the program product of the present specification is not limited to this, and in the present specification, the readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system. The program product can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium may, for example, be but is not limited to an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or apparatus, or any suitable combination of the above. More specific examples of the readable storage medium include an electrical connection having one or more wires, a portable disc, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. The computer readable storage medium can include a data signal carried in a baseband or as part of a carrier wave, in which readable program code is borne. Such a propagated data signal can take on many forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The readable storage medium can also be any readable medium that is not a storage medium that can send, propagate, or transmit the program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained in the readable storage medium can be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, and the like, or any suitable combination of the above. The program code for performing the operations of the present specification can be written in any combination of one or more programming languages, including an object-oriented programming language, such as Java, C++, and the like, and a conventional procedural programming language, such as the "C" programming language or similar programming languages. The program code can be executed entirely on the computing device 600, partially on the computing device 600, as an independent software package, partially on the computing device 600 and partially on a remote computing device, or entirely on a remote computing device.
[0123] The above described embodiments of the present specification have been described. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims can be performed in a different order and still accomplish desirable results. Additionally, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order to achieve desirable results. In certain implementations, multitasking and parallel processing can be advantageous or possible.
[0124] In light of the above detailed disclosure, those skilled in the art can appreciate that the foregoing detailed disclosure can be presented only in an exemplary manner and can not be limiting. Although not explicitly described herein, those skilled in the art will appreciate that the present specification contemplates various reasonable alterations, improvements and modifications to the embodiments. These alterations, improvements and modifications are intended to be suggested by the present specification and are within the spirit and scope of the exemplary embodiments of the present specification.
[0125] In addition, certain terms have been used in the present specification to describe embodiments of the present specification. For example, "one embodiment", "an embodiment" and / or "some embodiments" means that a particular feature, structure or characteristic described in connection with the embodiment can be included in at least one embodiment of the present specification. Therefore, it can be emphasized and should be understood that two or more references to "the embodiment" or "an embodiment" or "alternative embodiments" in various portions of the specification are not necessarily all referring to the same embodiment. Furthermore, particular features, structures or characteristics can be combined in any suitable manner in one or more embodiments of the present specification.
[0126] It should be understood that in the foregoing description of embodiments of the present specification, for the purpose of brevity, various features of the specification were grouped into several embodiments, figures or descriptions of the embodiments. However, this is not to be interpreted that the grouping of these features is essential to the specification, and a person skilled in the art would be able to understand that a part of the devices can be marked as separate embodiments for understanding. That is, the embodiments of the present specification can also be understood as an integration of several sub-embodiments. And the content of each sub-embodiment is also valid when there are less than all the features of a single foregoing disclosed embodiment.
[0127] Each patent, patent application, publication of a patent application, and other material, for example articles, books, specifications, publications, documents, things, or the like which can be cited in the present document can be accorded with the scope of their respective copyrights. The contents of all such cited patents, patent applications, publications of patent applications, and other material are hereby incorporated by reference herein, except that for any and all that can be dependent on the history of prosecution of any application incorporated herein by reference, to the extent that such history can be inconsistent with the term of this document now or hereafter associated with it. In the event of any such inconsistency, the term of this document controls.
[0128] Finally, it should be understood that the embodiments of the application disclosed herein are illustrative of the principles of the present specification. Other modifications that fall within the scope of the present specification can also be made. Accordingly, the present specification discloses embodiments only as examples. One skilled in the art can readily devise many alternative configurations without departing from the application as disclosed in the present specification. The embodiments of the present specification are not limited to the embodiments precisely described in the application.
Claims
1. A method for detecting liveness, comprising: Acquire biometric images, wherein the biometric images include the biometric features of the target user; The biometric image is input into a liveness detection model for liveness detection, resulting in liveness detection results for multiple local regions and a global liveness detection result. The global liveness detection result includes a second probability that the target user is a live user. The confidence level corresponding to the second probability is obtained based on the liveness detection results of the multiple local regions; Based on the second probability and the confidence level corresponding to the second probability, a first probability is determined that the target user is a living person; as well as The system instructs the target user to input authentication information of a target length, and performs a second liveness detection on the target user based on the actual input information, thereby obtaining the target liveness detection result of the target user, wherein the target length is related to the first probability.
2. The method according to claim 1, wherein, The target length is inversely correlated with the first probability.
3. The method according to claim 2, wherein, Before instructing the target user to enter authentication information of the target length, the method also includes: Determine the target authentication type; and The target length is determined based on the target authentication type and the first probability.
4. The method according to claim 3, wherein, Determining the target length based on the target authentication type and the first probability includes: The weighting coefficients are determined based on the type of the current application scenario, and the weighting coefficients are inversely correlated with the degree of security requirement for biometric recognition in the current application scenario. The first probability is weighted based on the weighting coefficients to obtain the first probability after scene adaptation; and The target length is determined based on the target authentication type and the first probability after scenario adaptation.
5. The method according to claim 3, wherein, Determining the target length based on the target authentication type and the first probability includes: The target length is obtained by inputting the target authentication type and the first probability into a pre-trained length mapping model. The length mapping model is trained using multiple sets of training samples, each set of training samples including: sample authentication type, sample probability, and sample length.
6. The method according to claim 3, wherein, Determining the target authentication type includes: The target authentication type is randomly determined from a plurality of candidate authentication types; or Determine the type of the current application scenario, and select the authentication type that matches the type of the current application scenario from multiple candidate authentication types as the target authentication type; or The authentication type specified by the target user among multiple candidate authentication types is taken as the target authentication type.
7. The method according to claim 6, wherein, The plurality of candidate authentication types includes at least two of the following: Authentication is performed using the user's identifier; Authentication is performed using the user terminal's identifier; Authentication is performed using a registration password; and Identity verification is performed using the registered account identifier.
8. The method according to claim 1, wherein, The step of performing a second liveness detection on the target user based on the target user's actual input information to obtain the target user's target liveness detection result includes: The identity information of the first user stored in the database is determined as the target identity information, wherein the first user is the logged-in user who triggered the liveness detection, or the first user is the user obtained by performing biometric recognition on the biometric image; and The actual input information and the target identity information are matched, and based on the matching result, one of the first or second operations is executed, wherein... The first operation includes: if the matching result is determined to be a successful match, then the target user is determined to be a live user; and The second operation includes: if the matching result is determined to be a failed match, then the target user is determined to be a non-living entity.
9. The method according to claim 1, wherein, Determining the first probability based on the second probability and the confidence level corresponding to the second probability includes: The first probability is determined by multiplying the second probability and the confidence level corresponding to the second probability.
10. The method according to claim 1, wherein, The liveness detection model includes: a feature extraction network, a local liveness detection network, a global liveness detection network, and a confidence detection network; and The biometric image is input into a liveness detection model for liveness detection, yielding liveness detection results for multiple local regions and a global liveness detection result, including: The biometric image is processed by the feature extraction network to obtain a feature map; The local liveness detection network is used to perform liveness detection processing on multiple local regions of the feature map, respectively, to obtain liveness detection results for the multiple local regions; and The global liveness detection network is used to perform liveness detection processing on the feature map and the liveness detection results of the multiple local regions to obtain a second probability that the target user is a live user.
11. The method according to claim 10, wherein, The liveness detection model also includes a confidence detection network; as well as The confidence level corresponding to the second probability obtained from the liveness detection results based on multiple local regions includes: The confidence level corresponding to the second probability is determined by the confidence detection network based on the liveness detection results of the multiple local regions.
12. The method according to claim 11, wherein, The training process of the liveness detection model includes a first training phase and a second training phase, wherein, The first training phase is configured to train the feature extraction network, the local liveness detection network, and the global liveness detection network. The second training phase is configured to train the confidence detection network.
13. The method according to claim 12, wherein, The first training phase includes: Acquire sample biofeature images and corresponding annotation information for the sample biofeature images. The annotation information includes: global liveness annotation results and liveness annotation results for multiple local regions. The sample biometric image is input into the feature extraction network to obtain a sample feature map. The sample feature map is then input into the local liveness detection network to obtain first liveness detection results for multiple local regions. Finally, the sample feature map and the first liveness detection results for the multiple local regions are input into the global liveness detection network to obtain a first global liveness detection result. Based on the first global liveness detection result, the first liveness detection results of the multiple local regions, the global liveness annotation result, and the liveness annotation results of the multiple local regions, a first target loss is determined, and the feature extraction network, the local liveness detection network, and the global liveness detection network are trained with the goal of minimizing the first target loss.
14. The method of claim 13, wherein, The first training phase further includes: perturbing the sample biometric image to obtain a perturbed biometric image; inputting the perturbed biometric image into the feature extraction network to obtain a perturbed feature map; and inputting the perturbed feature map into the local liveness detection network to obtain second liveness detection results for multiple local regions; and The first target loss is determined based on the first global liveness detection result, the first liveness detection results of the multiple local regions, the global liveness annotation result, and the liveness annotation results of the multiple local regions, including: The first target loss is determined based on the first global liveness detection result, the first liveness detection result of the multiple local regions, the second liveness detection result of the multiple local regions, the global liveness annotation result, and the liveness annotation result of the multiple local regions.
15. The method according to claim 14, wherein, The first target loss is determined based on the first global liveness detection result, the first liveness detection results of the multiple local regions, the second liveness detection results of the multiple local regions, the global liveness annotation result, and the liveness annotation results of the multiple local regions, including: Based on the difference between the first global liveness detection result and the global liveness annotation result, a first loss is determined; The second loss is determined based on the difference between the first liveness detection results and the liveness annotation results of the multiple local regions; Based on the difference between the first liveness detection results and the second liveness detection results of the multiple local regions, a third loss is determined; and The first target loss is determined based on the first loss, the second loss, and the third loss.
16. The method according to claim 12, wherein, The second training phase includes: Acquire sample biofeature images and corresponding annotation information for the sample biofeature images. The annotation information includes: global liveness annotation results and liveness annotation results for multiple local regions. The sample biometric image is input into the feature extraction network to obtain a sample feature map. The sample feature map is then input into the local liveness detection network to obtain first liveness detection results for multiple local regions. These first liveness detection results are input into the confidence detection network to obtain detection confidence for the multiple local regions. Based on the detection confidence of the multiple local regions, the corresponding local regions of the sample feature map are updated to obtain an updated feature map. The updated feature map is then input into the local liveness detection network to obtain third liveness detection results for multiple local regions. Finally, the updated feature map and the third liveness detection results for the multiple local regions are input into the global liveness detection network to obtain a second global liveness detection result. The second target loss is determined based on the second global liveness detection result, the third liveness detection result of the multiple local regions, the global liveness annotation result, and the liveness annotation result of the multiple local regions. The confidence detection network is then trained with minimizing the second target loss as the training objective.
17. The method according to claim 1, wherein, Based on the actual input information of the target user, a second liveness detection is performed on the target user to obtain the target liveness detection result of the target user, including: Based on the actual input information, a second liveness detection is performed on the target user to obtain the second liveness detection result; and Based on the first probability and the result of the second liveness detection, the target liveness detection result is determined.
18. The method according to claim 1, wherein, The biometric features include at least one of the following: face, iris, fingerprint, and palm print.
19. A liveness detection system, characterized in that, include: At least one storage medium storing at least one instruction set for performing liveness detection; as well as At least one processor is communicatively connected to the at least one storage medium. When the liveness detection system is running, the at least one processor reads the at least one instruction set and executes the liveness detection method according to any one of claims 1 to 18.
Citation Information
Patent Citations
Living body detection method and device, computer device and storage medium
CN109858381A