Living body detection model training method, living body detection method and system
By generating target attack image samples by replacing the attack region in live image samples, and training the liveness detection model, the problems of time-consuming and labor-intensive manual sampling and weak model generalization ability in existing technologies are solved, and higher accuracy liveness detection is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
- Filing Date
- 2023-02-16
- Publication Date
- 2026-04-17
AI Technical Summary
The training of existing liveness detection models requires a lot of manpower through manual sampling, and the collected samples are relatively homogeneous, resulting in weak generalization ability and low detection accuracy.
By replacing the attack region of the original attack image sample in the live image sample, a target attack image sample is generated and used to train a preset liveness detection model. This includes identifying the attack region, generating a set of region mask images, and performing region replacement. The model is trained by combining feature extraction, liveness classification, and mask prediction networks.
It improves the detection accuracy and generalization ability of the liveness detection model, eliminates the need for manual sampling, increases the diversity of biometric substitution samples, and enhances the model's detection performance.
Smart Images

Figure CN116152935B_ABST
Abstract
Description
Technical Field
[0001] This specification relates to the field of liveness detection, and in particular to a liveness detection model training method, a liveness detection method, and a system. Background Technology
[0002] In recent years, with the rapid development of internet technology, liveness detection has become an indispensable part of facial recognition systems, effectively intercepting non-liveness attack samples. To ensure the accuracy of liveness detection, it is often necessary to train the liveness detection model. For attacks targeting user biometric substitution (such as facial feature replacement or other biometric feature replacement), existing liveness detection models are often trained by manually sampling these types of attack samples.
[0003] In the process of researching and practicing existing technologies, the inventors of this application found that manual sampling often requires a lot of human resources, and the collected samples are relatively homogeneous. As a result, the generalization ability of the model is very weak during the training process, which leads to low detection accuracy of the trained liveness detection model. Summary of the Invention
[0004] This specification provides a training method for a liveness detection model, a liveness detection method, and a system that offer higher detection accuracy.
[0005] In a first aspect, this specification provides a method for training a liveness detection model, comprising obtaining an initial training sample set, the initial training sample set including liveness image samples and original attack image samples; performing region replacement on the liveness image samples based on at least one attack region in the original attack image samples to obtain at least one target attack image sample; and training a preset liveness detection model based on the at least one target attack image sample and the initial training sample set to obtain a trained target liveness detection model.
[0006] In some embodiments, the at least one attack region includes an image region corresponding to at least one biometric feature of the attacking user in the original attack image sample.
[0007] In some embodiments, performing region replacement on the live image sample to obtain at least one target attack image sample includes: identifying at least one attack region in the original attack image sample; generating a set of region mask images based on the at least one attack region; and performing region replacement on the live image sample based on the set of region mask images to obtain the at least one target attack image sample.
[0008] In some embodiments, identifying at least one attack region in the original attack image sample includes: identifying at least one region identifier corresponding to a biometric feature in the original attack image sample; and selecting the image region corresponding to the region identifier in the original attack image sample to obtain at least one attack region.
[0009] In some embodiments, generating a set of region mask images based on the at least one attack region includes: combining the at least one attack region to obtain at least one target attack region; obtaining the region location of the at least one target attack region and the image size of the live image sample; and generating at least one region mask image based on the region location and the image size to obtain a set of region mask images, wherein the image size of the at least one region mask image is the same as the image size of the live image sample.
[0010] In some embodiments, performing region replacement on the live image sample to obtain the at least one target attack image sample includes: identifying at least one live region corresponding to a biometric feature in the live image sample; selecting at least one candidate region mask image from the region mask image set based on the type of the live region; and overlaying the at least one candidate region mask image with the live image sample to obtain the at least one target attack image sample.
[0011] In some embodiments, each of the at least one target attack image samples includes at least one living region and at least one attack region.
[0012] In some embodiments, training a preset liveness detection model to obtain a trained target liveness detection model includes: adding the at least one target attack image sample to the initial training sample set to obtain a target training sample set; inputting the target training sample set into the preset liveness detection model to obtain a predicted liveness category for each image sample in the target training sample set and a predicted region mask image for the at least one target attack image sample; and converging the preset liveness detection model based on the predicted liveness category and the predicted region mask image to obtain the target liveness detection model.
[0013] In some embodiments, the preset liveness detection model includes a feature extraction network, a liveness classification network, and a mask prediction network; and the step of inputting the target training sample set into the preset liveness detection model to obtain the predicted liveness category of each image sample in the target training sample set and the predicted region mask image corresponding to the at least one target attack image sample includes: inputting the target training sample set into the feature extraction network to obtain the sample image features of each image sample, inputting the sample image features into the liveness classification network to obtain the predicted liveness category of each image sample, selecting the target sample image features of each target attack image sample in the at least one target attack image sample from the sample image features, and inputting the target sample image features into the mask prediction network to obtain the predicted region mask image corresponding to each target attack image sample.
[0014] In some embodiments, the mask prediction network includes a feature transformation subnetwork; and the step of inputting the target sample image features into the mask prediction network to obtain a prediction region mask image corresponding to each target attack image sample includes: inputting the target sample image features into the feature transformation subnetwork to obtain sample material features of each target attack image sample, wherein the size of the sample material features is the same as the size of each target attack image sample; determining the prediction region material of each region in each target attack image sample based on the sample material features; and generating a prediction region mask image corresponding to each target attack image sample based on the prediction region material.
[0015] In some embodiments, the step of converging the preset liveness detection model to obtain the target liveness detection model includes: obtaining the labeled liveness category of each image sample and comparing the labeled liveness category with the predicted liveness category to obtain classification loss information; determining the material recognition loss information corresponding to the at least one target attack image sample based on the predicted region mask image; and fusing the classification loss information and the material recognition loss information, and converging the preset liveness detection model based on the fused liveness detection loss information to obtain the target liveness detection model.
[0016] In some embodiments, determining the material recognition loss information corresponding to the at least one target attack image sample includes: obtaining a target region mask image corresponding to each target attack image sample in the at least one target attack image sample, wherein the target region mask image and the corresponding prediction region mask image have the same size; and comparing the target region mask image with the corresponding prediction region mask image to obtain the material recognition loss information.
[0017] In some embodiments, comparing the target region mask image with the corresponding predicted mask image to obtain the material recognition loss information includes: identifying the current attack region in the target region mask image and identifying the predicted attack region in the predicted region mask image; comparing the current attack region with the predicted attack region to obtain initial material loss information corresponding to each target attack image sample; and fusing the initial material loss information to obtain the material recognition loss information.
[0018] In some embodiments, comparing the target region mask image with the corresponding predicted mask image to obtain the material recognition loss information includes: when the image size of the target region mask image is greater than a preset size threshold, identifying candidate detection regions in the target region mask image and the predicted region mask image respectively; cropping the target region mask image and the predicted region mask image based on the candidate detection regions; and comparing the cropped target region mask image with the cropped predicted region mask image to obtain the material recognition loss information.
[0019] Secondly, this specification also provides a liveness detection method, comprising: obtaining a target user image of a target user; inputting the target user image into a target liveness detection model to obtain a liveness detection result of the target user, wherein the target liveness detection model is trained according to the liveness detection model training method described in the first aspect; and outputting the liveness detection result of the target user.
[0020] Thirdly, this specification also provides a liveness detection model training system, comprising: at least one storage medium storing at least one instruction set for training a liveness detection model; and at least one processor communicatively connected to the at least one storage medium, wherein, when the liveness detection model training system is running, the at least one processor reads the at least one instruction set and executes the liveness detection model training method described in the first aspect of this specification according to the instructions of the at least one instruction set.
[0021] Fourthly, this specification also provides a liveness detection system, comprising: at least one storage medium storing at least one instruction set for performing liveness detection; and at least one processor communicatively connected to the at least one storage medium, wherein, 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 described in the second aspect of this specification according to the instructions of the at least one instruction set.
[0022] As can be seen from the above technical solutions, the liveness detection model training method, liveness detection method, and system provided in this specification, after obtaining an initial training sample set (which includes liveness image samples and original attack image samples), perform region replacement on the liveness image samples based on at least one attack region of the original image samples to obtain at least one target attack image sample, and train a preset liveness detection model based on at least one target attack image sample and the initial training sample set to obtain a trained target liveness detection model. Because this solution replaces at least one attack region of the original attack image sample with a liveness image sample during the training process of the liveness detection model, manual sampling is unnecessary. Moreover, during the region replacement process, at least one attack region can be freely combined and replaced with a liveness image sample, greatly increasing the diversity of this type of biometric replacement sample, thereby improving the generalization ability of the trained liveness detection model and thus improving the detection accuracy of the liveness detection model.
[0023] Other functions of the liveness detection model training method, liveness detection method, and system provided in this specification will be partially listed in the following description. The figures and examples described below will be readily apparent to those skilled in the art. The inventive aspects of the liveness detection model training method, liveness detection method, and system provided in this specification can be fully understood through practice or use of the methods, apparatus, and combinations described in the detailed examples below. Attached Figure Description
[0024] To more clearly illustrate the technical solutions in the embodiments of this specification, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this specification. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0025] Figure 1 A schematic diagram of a facial feature replacement attack provided according to an embodiment of this specification is shown;
[0026] Figure 2 A schematic diagram illustrating an application scenario of a liveness detection system provided according to an embodiment of this specification is shown.
[0027] Figure 3 A hardware structure diagram of a computing device provided according to an embodiment of this specification is shown;
[0028] Figure 4 A flowchart of a liveness detection model training method provided according to an embodiment of this specification is shown;
[0029] Figure 5A flowchart illustrating a liveness detection model training method for facial feature substitution attacks, according to embodiments of this specification, is shown; and
[0030] Figure 6 A flowchart of a liveness detection method provided according to an embodiment of this specification is shown. Detailed Implementation
[0031] The following description provides specific application scenarios and requirements for this specification, intended to enable those skilled in the art to make and use the contents of this specification. Various partial modifications to the disclosed embodiments will be 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 this specification. Therefore, this specification is not limited to the embodiments shown, but rather to the widest scope consistent with the claims.
[0032] The terminology used herein is for the purpose of describing particular exemplary embodiments only and is not restrictive. For example, unless the context clearly indicates otherwise, the singular forms “a,” “an,” and “the” used herein may also include the plural forms. When used in this specification, the terms “comprising,” “including,” and / or “containing” mean that the associated integers, steps, operations, elements, and / or components are present, but do not exclude the presence of one or more other features, integers, steps, operations, elements, components, and / or groups, or that other features, integers, steps, operations, elements, components, and / or groups may be added to the system / method.
[0033] Considering the following description, these and other features of this specification, as well as the operation and function of the related components of the structure, and the economy of assembly and manufacture of the parts, can be significantly improved. All of these form part of this specification with reference to the accompanying drawings. 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 this specification. It should also be understood that the drawings are not drawn to scale.
[0034] The flowcharts used in this specification illustrate operations implemented according to some embodiments of this specification. It should be clearly understood that the operations in the flowcharts may not be implemented in a sequential order. Instead, the operations may be implemented in reverse order or simultaneously. Furthermore, one or more additional operations may be added to the flowcharts. One or more operations may be removed from the flowcharts.
[0035] For ease of description, the terms that will appear in the following descriptions will be explained as follows:
[0036] Live Face Detection: Based on the facial region in an image, it determines whether the user being captured is a real person or an attack. Attack types mainly include attacks using photos, mobile phones, screens, masks, etc.
[0037] Facial feature substitution attack: A common attack method in live human face attacks, this involves obscuring the facial features of a real person's face with corresponding target areas of paper and attempting to attack them; facial features generally refer to the eyes, nose, mouth, and various combinations thereof, specifically as follows... Figure 1 As shown.
[0038] Before describing the specific embodiments in this specification, the application scenarios of this specification will be introduced as follows:
[0039] The liveness detection model provided in this manual can be applied to any liveness detection scenario. For example, in a face payment scenario, the liveness detection model in this manual can be used to perform liveness detection on the collected face image of the user to be paid; in an identity verification scenario, the liveness detection model in this manual can be used to perform liveness detection on the collected identity image of the user; it can also be applied to any face recognition scenario, which will not be elaborated on here.
[0040] Those skilled in the art should understand that the liveness detection model training method, liveness detection method, and system described in this specification are also within the scope of protection of this specification when applied to other application scenarios.
[0041] Figure 2 This diagram illustrates an application scenario of a liveness detection system 001 provided according to an embodiment of this specification. The liveness detection system 001 (hereinafter referred to as System 001) can be applied to liveness detection in any scenario, such as liveness detection in face payment scenarios, liveness detection in identity verification scenarios, liveness detection in other face recognition scenarios, etc. Figure 2 As shown, system 001 may include user 100, client 200, server 300, and network 400, with client 200 and server 300 connected via network 400. The application scenario of the liveness detection model training system can be similar to system 001, and may also include user 100, client 200, server 300, and network 400.
[0042] User 100 can be the user who triggers liveness detection on the target user's image or trains a preset liveness detection model. User 100 can perform liveness detection or liveness detection model training operations on client 200. User 100 can be the target user or any other user.
[0043] Client 200 can be a device for performing liveness detection on a target user image in response to a liveness detection operation by user 100, or for training a preset liveness detection model in response to a liveness detection model training operation by user 100. In some embodiments, the liveness detection model training method and the liveness detection method can be executed on client 200. In this case, client 200 may store data or instructions for executing the liveness detection model training method and the liveness detection method described in this specification, and may execute or be used to execute said data or instructions. In some embodiments, client 200 may include a hardware device with data information processing capabilities and the necessary programs required to drive the hardware device to work. Figure 2 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 target user images or target training sample sets. 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 controllers, augmented reality headsets, augmented reality glasses, augmented reality controllers, 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 images of the target user or an initial training sample set. In some embodiments, the image acquisition device may be a two-dimensional image acquisition device (e.g., an RGB camera), or a combination of a two-dimensional image acquisition device (e.g., an RGB camera) and a depth image acquisition device (e.g., 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.
[0044] In some embodiments, the client 200 may have one or more applications (APPs) installed. The APPs provide the user 100 with the ability and interface to interact with the outside world via the network 400. The APPs include, but are not limited to: web browser APPs, search APPs, chat APPs, shopping APPs, video APPs, financial management APPs, instant messaging tools, email clients, social media platform software, etc. In some embodiments, the client 200 may have a target APP installed. The target APP can collect at least one user image of the target user for the client 200, thereby obtaining a target user image; or, it can collect or obtain at least one image sample, thereby obtaining an initial training sample set. In some embodiments, the user 100 can also trigger a liveness detection request or a liveness detection model training request through the target APP. The target APP can respond to the liveness detection model training request or the liveness detection request by executing the liveness detection model training method and the liveness detection method described in this specification. The liveness detection model training method and the liveness detection method will be described in detail later.
[0045] Server 300 may be a server providing various services, such as a backend server supporting liveness detection of target user images acquired on client 200 or training of a preset liveness detection model. In some embodiments, the liveness detection model training method and the liveness detection method may be executed on server 300. In this case, server 300 may store data or instructions for executing the liveness detection model training method and the liveness detection method described herein, and may execute or be used to execute said data or instructions. In some embodiments, server 300 may include hardware devices with data processing capabilities and the necessary programs required to drive the hardware devices. Server 300 may communicate with multiple clients 200 and receive data sent by clients 200.
[0046] Network 400 serves as a medium to provide a communication connection between client 200 and server 300. Network 400 facilitates the exchange of information or data. For example... Figure 2 As shown, client 200 and server 300 can connect to network 400 and transmit information or data to each other through network 400. In some embodiments, network 400 can be any type of wired or wireless network, or a combination thereof. For example, network 400 may include cable networks, wired networks, fiber optic networks, telecommunications networks, intranets, the Internet, local area networks (LANs), wide area networks (WANs), wireless local area networks (WLANs), metropolitan area networks (MANs), public switched telephone networks (PSTNs), and Bluetooth networks. TM ZigBeeTM A network, a near-field communication (NFC) network, or a similar network. In some embodiments, network 400 may include one or more network access points. For example, network 400 may include wired or wireless network access points, such as base stations or internet exchange points, through which one or more components of client 200 and server 300 can connect to network 400 to exchange data or information.
[0047] It should be understood that Figure 2 The number of clients 200, servers 300, and networks 400 shown is merely illustrative. Depending on implementation needs, there can be any number of clients 200, servers 300, and networks 400.
[0048] It should be noted that the liveness detection model training method and the liveness detection method can be executed entirely on the client 200, entirely on the server 300, or partially on the client 200 and partially on the server 300.
[0049] Figure 3 A hardware structure diagram of a computing device 600 provided according to an embodiment of this specification is shown. The computing device 600 can execute the liveness detection model training method and the liveness detection method described in this specification. The liveness detection model training method and the liveness detection method are described in other parts of this specification. When the liveness detection model training method and the liveness detection method are executed on a client 200, the computing device 600 can be the client 200. When the liveness detection model training method and the liveness detection method are executed on a server 300, the computing device 600 can be the server 300. When the liveness detection model training method and the liveness detection method can be executed partly on the client 200 and partly on the server 300, the computing device 600 can be both the client 200 and the server 300.
[0050] like Figure 3 As shown, the computing device 600 may include at least one storage medium 630 and at least one processor 620. In some embodiments, the computing device 600 may also include a communication port 650 and an internal communication bus 610. Additionally, the computing device 600 may include I / O components 660.
[0051] The internal communication bus 610 can connect different system components, including storage medium 630, processor 620 and communication port 650.
[0052] I / O component 660 supports input / output between computing device 600 and other components.
[0053] Communication port 650 is used for data communication between computing device 600 and external sources. For example, communication port 650 can be used for data communication between computing device 600 and network 400. Communication port 650 can be a wired communication port or a wireless communication port.
[0054] Storage medium 630 may include a data storage device. The data storage device may be a non-transitory storage medium or a temporary storage medium. For example, the data storage device may include one or more of a disk 632, a read-only storage medium (ROM) 634, or a random access storage medium (RAM) 636. Storage medium 630 also includes at least one instruction set stored in the data storage device. The instructions are computer program code, which may include programs, routines, objects, components, data structures, procedures, modules, etc., that execute the liveness detection model training method and liveness detection method provided in this specification.
[0055] At least one processor 620 can be communicatively connected to at least one storage medium 630 and a communication port 650 via an internal communication bus 610. At least one processor 620 is used to execute the at least one instruction set described above. When the computing device 600 is running, at least one processor 620 reads the at least one instruction set and, according to the instructions of the at least one instruction set, executes the liveness detection model training method and the liveness detection method provided in this specification. Processor 620 can execute all the steps included in the liveness detection model training method and the liveness detection method. Processor 620 can be in the form of one or more processors. In some embodiments, processor 620 may include one or more hardware processors, such as a microcontroller, microprocessor, reduced instruction set computer (RISC), application-specific integrated circuit (ASIC), application-specific instruction set processor (ASIP), central processing unit (CPU), graphics processing unit (GPU), physical processing unit (PPU), microcontroller unit, digital signal processor (DSP), field-programmable gate array (FPGA), advanced RISC machine (ARM), programmable logic device (PLD), any circuit or processor capable of performing one or more functions, or any combination thereof. For illustrative purposes only, only one processor 620 is described in this specification for the computing device 600. However, it should be noted that the computing device 600 may also include multiple processors. Therefore, the operation and / or method steps disclosed in this specification may be executed by one processor as described herein, or they may be executed jointly by multiple processors. For example, if processor 620 of the computing device 600 in this specification executes steps A and B, it should be understood that steps A and B may also be executed jointly or separately by two different processors 620 (e.g., a first processor executes step A, a second processor executes step B, or the first and second processors jointly execute steps A and B).
[0056] Figure 4 A flowchart of a liveness detection model training method P100 according to an embodiment of this specification is shown. As previously described, computing device 600 can execute the liveness detection model training method P100 of this specification. Specifically, processor 620 can read an instruction set stored in its local storage medium and then execute the liveness detection model training method P100 of this specification according to the instructions in the instruction set. Figure 4 As shown, method P100 may include:
[0057] S110: Obtain the initial training sample set.
[0058] The initial training sample set includes live image samples and original attack image samples. The live image samples can be image samples obtained after collecting biometric data from a live user, such as human body images, facial images, or other types of user images. The original attack image samples can be image samples obtained after collecting biometric data from an attacking user, such as image samples obtained after capturing images of photos containing user biometric data, or image samples obtained after capturing images of content displayed on a screen or terminal displaying user biometric data, or image samples obtained after capturing images of a user wearing a mask or other attack methods. The biometric data can include at least one of the following: face, torso, iris, sclera, fingerprint, palm print, voiceprint, or skeletal projection. The face can include various facial elements, such as facial features (eyes, mouth, nose, ears, eyebrows) or other facial elements (e.g., forehead, hair, or others), etc.
[0059] There are several ways to obtain the initial training sample set, including the following:
[0060] For example, the processor 620 can directly receive the initial training sample set uploaded by the user 100 through the client 200 or terminal; or, it can obtain live image samples and original attack image samples from the network or image database to obtain the initial training sample set; or, it can acquire user images of at least one live user through an image acquisition device to obtain live image samples, and acquire user images of at least one attack method through the image acquisition device to obtain original attack image samples, thus obtaining the initial training sample set; or, it can also receive a liveness detection model training request sent by the client 200 or terminal, which includes the storage address of the initial training sample set, and obtain the initial training sample set based on the storage address, and so on.
[0061] S120: Based on at least one attack region in the original attack image sample, perform region replacement on the live image sample to obtain at least one target attack image sample.
[0062] At least one attack region includes an image region corresponding to at least one biometric feature of the attacking user in the original attack image sample. For example, if the original attack image sample is a face image sample, then at least one attack region could include the region corresponding to the eyes, the region corresponding to the ears, the region corresponding to the mouth, the region corresponding to the ears, or the region corresponding to other facial elements, and so on.
[0063] Among them, the target attack image sample can be an attack image sample that replaces the user's biometric features. For example, if the biometric feature is the eye, then the target attack image sample can be an attack image sample obtained by replacing the image region corresponding to the eye in the live image sample with the attack region corresponding to the eye in the original attack image sample.
[0064] There are several ways to perform region replacement on a live image sample based on at least one attack region in the original attack image sample, as shown below:
[0065] For example, the processor 620 can identify at least one attack region in the original attack image sample, generate a set of region mask images based on the at least one attack region, and perform region replacement on the live image sample based on the set of region mask images to obtain at least one target attack image sample.
[0066] There are several ways to identify at least one attack region in the original attack image sample. For example, the processor 620 can identify at least one biometric landmark in the original attack image sample and select the image region corresponding to the landmark in the original attack image sample to obtain at least one attack region.
[0067] The region identifier can be a key point of a biometric feature. Each biometric feature can correspond to one region identifier or multiple region identifiers. After identifying the region identifier, the image region corresponding to the region identifier can be selected from the original attack image to obtain at least one attack region. There are several ways to select the image region corresponding to the region identifier. For example, when a biometric feature corresponds to one region identifier, the processor 620 can generate an image region of a preset size corresponding to the biometric feature with the region identifier as the center point, thereby obtaining the attack region corresponding to the biometric feature. Alternatively, when a biometric feature corresponds to multiple region identifiers, the processor 620 can directly use the closed region composed of multiple region identifiers as the attack region corresponding to the biometric feature, and so on.
[0068] After identifying at least one attack region, the processor 620 can generate a set of region mask images based on that region. The set of region mask images includes multiple region mask images, which can be mask images containing at least one attack region. A mask image can also be understood as an image mask. This mask image can also be a binary image composed of 0s and 1s, where the value corresponding to the attack region is 1, and the value corresponding to image regions outside the attack region is 0; alternatively, it can be composed of different colors, for example, the attack region can be set to white, and other regions to black, etc. There are multiple ways to generate the set of region mask images based on at least one attack region. For example, the processor 620 can combine at least one attack region to obtain at least one target attack region, obtain the region location of at least one target attack region and the image size of the liveness image sample, and generate at least one region mask image based on the region location and image size, thus obtaining the set of region mask images.
[0069] There are several ways to combine at least one attack region. For example, the processor 620 can randomly combine at least one attack region to obtain at least one target attack region, or it can treat an attack region as a single target attack region, and so on.
[0070] There are many ways to freely combine them. For example, taking the image regions corresponding to the facial features as an example, the image regions corresponding to the facial features can be freely combined. For instance, the image regions corresponding to the eyes and the nose can be combined to obtain a target attack region. Alternatively, the image regions corresponding to the eyes, the nose, and the mouth can be combined to obtain a target attack region. Or, other methods can be used to combine the facial features into an image region that includes at least two types, thereby obtaining at least one target attack region, and so on.
[0071] After combining at least one attack region, the processor 620 can obtain the region location of at least one target attack region and the image size of the live image sample. Then, based on the region location and image size, it generates at least one region mask image, resulting in a set of region mask images. The image size of the region mask image is the same as the image size of the live image sample. There are several ways to generate at least one region mask image based on the region location and image size. For example, the processor 620 can generate a blank image corresponding to the image size, mark the location of the corresponding target attack region on the blank image based on the region location of at least one target attack region, obtain at least one attack region image, convert the attack region image into a mask image, and use the mask image as a region mask image corresponding to a target attack region, thereby obtaining a set of region mask images.
[0072] After obtaining the set of region mask images, the processor 620 can perform region replacement on the live image sample based on the set of region mask images to obtain at least one target attack image sample. There are several ways to perform region replacement on the live image sample. For example, the processor 620 can identify at least one live region corresponding to at least one biometric feature in the live image sample, select at least one candidate region mask image from the set of region mask images based on the type of live region, and overlay the at least one candidate region mask image with the live image sample to obtain at least one target attack image sample.
[0073] The live region can be the image region corresponding to the biometric features in a live image sample. The identification method is similar to that for identifying attack regions, as detailed above, and will not be repeated here.
[0074] After identifying a live region, the processor 620 can select at least one candidate region mask image from the set of region mask images based on the type of the live region. There are several ways to select at least one candidate region mask image. For example, assuming the live region type includes facial features, the processor 620 can select attack regions corresponding to at least one biometric feature from the set of region mask images, thus obtaining at least one candidate region mask image. It should be noted that the number of live regions corresponding to biometric features in the live image sample must be greater than or equal to the number of attack regions corresponding to biometric features in the region mask image to achieve region replacement of the image region containing the corresponding biometric feature. For example, if the region mask image contains an attack region corresponding to a hand, but the live image sample does not contain a live region corresponding to a hand, then obviously, region replacement of the image region containing the hand in the live image sample cannot be completed.
[0075] After selecting at least one candidate region mask image, the processor 620 can superimpose the at least one candidate region mask image with a live image sample to obtain at least one target attack image sample. There are several ways to superimpose the at least one candidate region mask image with the live image sample. For example, the processor 620 can use Fogely Synthesis (an image synthesis algorithm) to superimpose each candidate region mask image with the live image sample to obtain at least one target attack image sample. Alternatively, other image superimposition algorithms can be used to superimpose each candidate region mask image with the live image sample to obtain at least one target attack image sample, and so on.
[0076] It should be noted that each target attack image sample obtained after overlay includes at least one live region and at least one attack region. This means that only some of the live regions corresponding to biometric features are replaced by the corresponding attack regions in the overlay target attack image sample. For example, replacing the eyes and nose in a face image will result in a target attack image sample that includes the attacked eyes and nose, as well as the live mouth, ears, and other facial elements besides the eyes and nose. Furthermore, it should be noted that during the overlay process, image regions in the candidate region mask image other than the attack regions will not affect the image content of the live image sample. In other words, during the overlay process, image regions in the candidate region mask image other than the attack regions can be made transparent, or the content of the attack regions in the candidate region mask image can be directly copied to the live image sample, while the content of the image regions other than the attack regions is discarded and copied to the live image sample.
[0077] Compared to existing manual data collection, this method replaces at least one attack region in the original attack image sample with a region of the liveness image sample to obtain a target attack image sample with replaced biometric features. This eliminates the need for additional image sample collection. Furthermore, the freely combinable replacement methods can generate a wider variety of target attack image samples, thereby increasing the generalization ability of the liveness detection model during training and ultimately improving its detection accuracy or performance.
[0078] S130: Based on at least one target attack image sample and an initial training sample set, train the preset liveness detection model to obtain the trained target liveness detection model.
[0079] For example, the processor 620 can add at least one target attack image sample to the initial training sample set to obtain a target training sample set, input the target training sample set into a preset liveness detection model to obtain the predicted liveness category of each image sample in the target training sample set and the predicted region mask image of at least one target attack image sample, and converge the preset liveness detection model based on the predicted liveness category and the predicted region mask image to obtain the target liveness detection model.
[0080] The preset liveness detection model includes a feature extraction network, a liveness classification network, and a mask prediction network. The feature extraction network is a network that extracts features from image samples. The network structure of the feature extraction network can be varied, including residual networks, convolutional networks, or other network structures. The liveness classification network is a network that classifies liveness in image samples. The mask prediction network is a network that predicts the mask image superimposed on the target attack image sample. There are various ways to input the target training sample set into the preset liveness detection model to obtain the predicted liveness category of each image sample in the target training sample set and the predicted region mask image corresponding to at least one target attack image sample. For example, the processor 620 can input the target training sample set into the feature extraction network to obtain the sample image features of each image sample, input the sample image features into the liveness classification network to obtain the predicted liveness category of each image sample, extract the target sample image features of each target attack image sample from the sample image features, and input the target sample image features into the mask prediction network to obtain the predicted region mask image corresponding to each target attack image sample.
[0081] The mask prediction network may include a feature transformation subnetwork. There are several ways to input the target sample image features into the mask prediction network to obtain the predicted region mask image for each target attack image sample. For example, the processor 620 can input the target sample image features into the feature transformation subnetwork to obtain the sample material features of each target attack image sample. The size of the sample material features is the same as the size of each target attack image sample. Based on the sample material features, the predicted region material of each region in each target attack image sample is determined, and based on the predicted region material, the predicted region mask image corresponding to each target attack image sample is generated.
[0082] The feature transformation subnetwork can have various network structures, such as FeatureTransformer (a feature transformation network) or other types of feature transformation networks. Taking FeatureTransformer as an example, the processor 620 can extract candidate image features of different types or dimensions from the target sample image features, determine the attention weights corresponding to the candidate image features, and weight the candidate image features based on the attention weights to obtain the initial sample material features. Based on the image size of the target attack image sample, the initial sample material features are upsampled to obtain the sample material features.
[0083] After performing feature transformation on the target sample image features, the processor 620 can determine the predicted region material of each area in each target attack image sample based on the sample material features. This region can be a preset region or a pixel region in the target attack image sample. The predicted region material can include either a live object material (real person) or an attack material. After determining the predicted region material for each area, a predicted region mask image corresponding to each target attack image sample is generated based on the predicted region material. There are various ways to generate the predicted region mask image. For example, the processor 620 can identify regions in the target attack image sample whose predicted region material is an attack material, thereby obtaining a mask region. Based on the mask region and the image size of the target attack image sample, the processor 620 generates the predicted region mask image corresponding to that target attack image sample.
[0084] After obtaining the predicted liveness category and the predicted region mask image, the processor 620 can converge the preset liveness detection model based on the predicted liveness category and the predicted region mask image to obtain the target liveness detection model. There are several ways to converge the preset liveness detection model. For example, the processor 620 can obtain the labeled liveness category of each image sample and compare the labeled liveness category with the predicted liveness category to obtain classification loss information. Based on the predicted region mask image, it can determine the material recognition loss information corresponding to at least one target attack image sample, fuse the classification loss information and the material recognition loss information, and converge the preset liveness detection model based on the fused liveness detection loss information to obtain the target liveness detection model.
[0085] The classification loss information can be the loss information generated when classifying liveness samples. There are several ways to compare the labeled liveness category with the predicted liveness category to obtain the classification loss information. For example, the processor 620 can use the cross-entropy loss function to compare the labeled liveness category with the predicted liveness category to obtain the initial classification loss information for each image sample. This initial classification loss information is then accumulated to obtain the classification loss information for the target training sample set. Alternatively, other types of loss functions can be used to compare the labeled liveness category with the predicted liveness category to obtain the initial classification loss information for each image sample. This initial classification loss information is then accumulated to obtain the classification loss information for the target training sample set, and so on.
[0086] The material recognition loss information can be the loss information generated by the liveness detection model when perceiving the differences between different materials in the target attack image samples. There are several ways to determine the material recognition loss information corresponding to at least one target attack image sample based on the predicted region mask image. For example, the processor 620 can obtain the target region mask image corresponding to each target attack image sample in at least one target attack image sample, and compare the target region mask image with the corresponding predicted region mask image to obtain the material recognition loss information.
[0087] In this model, the target region mask image and the corresponding predicted region mask image have the same size. There are several ways to compare the target region mask image with the corresponding predicted region mask image. For example, the processor 620 can identify the current attack region in the target region mask image and the predicted attack region in the predicted region mask image. By comparing the current attack region and the predicted attack region, it can obtain the initial material loss information corresponding to each target attack image sample, and then fuse the initial material loss information to obtain material recognition loss information. Alternatively, it can extract features from both the target region mask image and the predicted region mask image separately to obtain the current image mask features corresponding to the target region mask image and the predicted image mask features corresponding to the predicted region mask image. It can then obtain the feature similarity between the current image mask features and the predicted image mask features, and based on the feature similarity, determine the initial material loss information corresponding to each target attack image sample, and fuse the initial material loss information to obtain material recognition loss information, and so on.
[0088] There are several ways to compare the current attack region with the predicted attack region. For example, the processor 620 can obtain the current region position and current region size of the current attack region, obtain the predicted region position and predicted region size of the predicted attack region, compare the current region position with the predicted region position to obtain the region position difference, compare the current region size with the predicted region size to obtain the region size difference, and determine the initial material loss information corresponding to each target attack image sample based on the region position difference and region size difference. Alternatively, it can extract features from the first region image corresponding to the current attack region to obtain the first region image features, extract features from the second region image corresponding to the predicted attack region to obtain the second region image features, obtain the feature similarity or feature distance between the first region image features and the second region image features, and determine the initial material loss information corresponding to each target attack image sample based on the feature similarity or feature distance, and so on.
[0089] In some embodiments, comparing the target region mask image with the corresponding predicted region mask image may further include: when the image size of the target region mask image is greater than a preset size threshold, the processor 620 identifies candidate detection regions in the target region mask image and the predicted region mask image respectively; based on the candidate detection regions, the processor 620 crops the target region mask image and the predicted region mask image respectively; and compares the cropped target region mask image with the cropped predicted region mask image to obtain material recognition loss information.
[0090] When the target region mask image size exceeds a preset size threshold, it means the image samples in the target training sample set are large-sized images. These large-sized images may contain background images that are irrelevant to liveness detection. Since the region mask image and the image samples are the same size, it indicates that the non-attack regions constitute a large proportion of the region mask images (target region mask image and predicted region mask image). This often increases computational power during image comparison, affecting the training efficiency of the liveness detection model. To improve training efficiency, candidate detection regions can be identified in the target region mask image and the predicted region mask image. Then, the target region mask image and the predicted region mask image are cropped based on the candidate detection regions. Taking a face image as an example, this cropping can be understood as cropping out the region containing the user's facial features, thereby reducing the computational resource consumption when calculating material recognition loss information.
[0091] After identifying candidate detection regions and cropping the target region mask image and the predicted region mask image based on the candidate detection regions, the processor 620 can compare the cropped target region mask image with the cropped predicted region mask image to obtain material recognition loss information. The comparison method is detailed above, as described in the section on comparing the target region mask image and the predicted region mask image, and will not be repeated here.
[0092] Among them, the material recognition loss information is used to characterize different materials. Taking the black area as the non-attack area and the white area as the attack area in the region mask image as an example, the black area can represent the live material (real person), and the white area can represent the replaced attack area (for example, the facial features area of paper, etc.). By predicting the region mask image, the liveness detection model can better perceive the differences between different materials, thereby improving the detection accuracy and detection performance of the trained liveness detection model.
[0093] After determining the classification loss information and the material recognition loss information, the processor 620 can fuse them. There are several ways to fuse them. For example, the processor 620 can directly add the classification loss information and the material recognition loss information; alternatively, it can obtain the liveness detection weights and, based on these weights, weight the classification loss information and the material recognition loss information separately, then add the weighted classification loss information and the weighted material recognition loss information together to obtain the liveness detection loss information, and so on.
[0094] After fusing classification loss information and material recognition loss information, the processor 620 can converge a preset liveness detection model based on the fused liveness detection loss information to obtain the target liveness detection model. There are several ways to converge the preset liveness detection model. For example, the processor 620 can use a gradient descent algorithm to update the network parameters of the preset liveness detection model based on the liveness detection loss information, obtaining an updated liveness detection model. This updated liveness detection model is then used as the preset liveness detection model, and the process returns to the step of obtaining the initial training sample set until the preset liveness detection model converges, thus obtaining the trained target liveness detection model. Alternatively, other network parameter update methods can be used to update the network parameters of the preset liveness detection model based on the liveness detection loss information, obtaining an updated liveness detection model. This updated liveness detection model is then used as the preset liveness detection model, and the process returns to the step of obtaining the initial training sample set until the preset liveness detection model converges, thus obtaining the trained target liveness detection model, and so on.
[0095] Taking face images as an example from the initial training sample set, specifically targeting liveness detection attacks involving facial feature replacement, the overall training process for the liveness detection model can be as follows: Figure 5 As shown, the main processes can include generating region mask images, generating prostheses (generating target attack samples), feature extraction, liveness classification, mask prediction, determining classification loss information, and determining material recognition loss information, etc., specifically as follows:
[0096] (1) Generate region mask image: Based on the landmark of the face, identify the facial features region in the attack sample, and freely combine the identified facial features region. Then, based on at least one region in the combined facial features region, generate a face replacement mask (region mask image).
[0097] (2) Prosthetic generation: The Fogely Synthesis algorithm is used to superimpose the face replacement mask with the real person sample, thereby replacing the facial features of the attack sample with the real person sample, and using the real person sample after replacing the facial features as the target attack sample.
[0098] (3) Feature extraction: A feature extraction network (backbone) is used to extract features from real human samples, attack samples and target attack samples to obtain sample image features;
[0099] (4) Liveness classification: Based on the extracted sample image features, liveness classification is performed on each image sample to obtain the predicted liveness category of each image sample.
[0100] (5) Mask Prediction: The Feature Transformer network is used to transform and upsample the features of the target sample image corresponding to the target attack sample to obtain the sample material features. The sample material features are the features related to the image material in the target sample image features. The size of the sample material features is the same as the size of the corresponding original image. Based on the sample material features, the mask of the superimposed face replacement in the target attack sample is predicted, thus obtaining the predicted face replacement mask. In addition, when the target attack image sample or region mask image is a large image, AOI can be added to the predicted face replacement mask to crop or annotate the face region, so as to reduce the amount of computation when determining the material loss information;
[0101] (6) Determine classification loss information: Compare the predicted liveness category with the labeled liveness category of the corresponding image sample to obtain classification loss information;
[0102] (7) Determine Material Recognition Loss Information (MSELoss): Material recognition loss information is obtained by comparing the predicted face replacement mask with the actual face replacement mask superimposed in the target attack sample. MSELoss is used to perceive different materials; it solves the interception of this type of attack in a more fundamental way, without negatively affecting the recognition ability of the original liveness detection model.
[0103] It's worth noting that during the training of the liveness detection model, a sample generation method is used to generate region mask predictions. This addresses the lack of richness in manually sampled data for face replacement, significantly improving the diversity of target attack samples for face replacement. Furthermore, in the training process of the pre-defined liveness detection model, in addition to the commonly used classification loss, mask prediction loss information can be added to address the liveness detection problem by perceiving the material of the real person and the material corresponding to the attack type (paper, display screen, mask).
[0104] After obtaining the target liveness detection model from the preset liveness detection, the processor 620 can perform liveness detection based on the target liveness detection model.
[0105] Figure 6 A flowchart of a liveness detection method P200 according to some embodiments of this specification is shown. As previously described, computing device 600 can execute the liveness detection method P200 described herein. Specifically, processor 620 can read an instruction set stored in its local storage medium and then execute the liveness detection method P200 described herein according to the instructions in the instruction set. Figure 6 As shown, method P200 may include:
[0106] S210: Obtain the target user image of the target user.
[0107] The target user image can be an image containing the target user's biometric features. These biometric features may include at least one of the following: face, torso, iris, sclera, fingerprint, palm print, voiceprint, or skeletal projection.
[0108] There are several ways to obtain the target user's image, including the following:
[0109] For example, the processor 620 can directly receive at least one user image of the target user uploaded by user 100 or the target user through a client, terminal or server to obtain the target user image; or, it can obtain an image containing the biometric features of the target user from a network or image database to obtain the target user image; or, it can acquire at least one user image containing biometric features of the target user through an image acquisition device to obtain the target user image; or, when there are many target user images or a large amount of memory, it can also receive a liveness detection request, which includes the storage address of the target user image of the target user, and obtain the target user image of the target user based on the storage address, and so on.
[0110] S220: Input the target user image into the target liveness detection model to obtain the liveness detection result of the target user.
[0111] Among them, the target liveness detection can be achieved through Figure 4 The liveness detection model was trained using the training method described above.
[0112] The liveness detection result can include either a live user (normal user) or an attacking user.
[0113] There are several ways to input the target user image into the target liveness detection model to obtain the liveness detection result of the target user, as follows:
[0114] For example, the processor 620 inputs the target user image into the feature extraction network of the target liveness detection model to obtain the image features of the target user image. Based on the image features, the target user is classified as a liveness, thereby obtaining the liveness detection result of the target user.
[0115] S230: Output the liveness detection results for the target user.
[0116] For example, the processor 620 can directly send the liveness detection result to the user 100 or the client 200, terminal or server corresponding to the target user, so that the client 200, terminal or server can respond to the request of the target user or the target user based on the liveness detection result, or it can directly visualize the liveness detection result, and so on.
[0117] There are several ways to visualize the liveness detection results. For example, the processor 620 can directly display the liveness detection result, or it can display the liveness detection result through sound and light (for example, by broadcasting the liveness detection result by voice, or by displaying different types of liveness detection results by displaying different colored lights, or by displaying the liveness detection result through sound and light linkage), or it can display the liveness detection result for specific types of liveness detection results (for example, only displaying the liveness detection result for the attacking user type, or only displaying the liveness detection result for the live user type, etc.), and so on.
[0118] In some embodiments, after determining or outputting the liveness detection result of the target user, the processor 620 may respond to the target user or the request corresponding to the target user based on the liveness detection result. There may be various ways to respond. For example, the processor 620 may directly intercept the target user or the request corresponding to the target user, or the processor 620 may directly perform secondary verification on the target user and, based on the secondary verification result, provide a final response to the target user or the request corresponding to the target user, and so on.
[0119] In summary, the liveness detection model training method P100, liveness detection method P200, and system 001 / 002 provided in this specification, after obtaining an initial training sample set (which includes liveness image samples and original attack image samples), perform region replacement on the liveness image samples based on at least one attack region of the original image samples to obtain at least one target attack image sample. Furthermore, based on at least one target attack image sample and the initial training sample set, a preset liveness detection model is trained to obtain a trained target liveness detection model. Because this scheme replaces at least one attack region of the original attack image sample with a liveness image sample during the training process of the liveness detection model, manual sampling is eliminated. Moreover, during the region replacement process, at least one attack region can be freely combined and replaced with a liveness image sample, greatly increasing the diversity of this type of biometric replacement sample. This improves the generalization ability of the trained liveness detection model and thus enhances the detection accuracy of the liveness detection model.
[0120] This specification, in another aspect, provides a non-transitory storage medium storing at least one set of executable instructions for performing liveness detection model training and liveness detection. When the executable instructions are executed by a processor, they instruct the processor to implement the steps of the liveness detection model training method P100 and the liveness detection method P200 described in this specification. In some possible embodiments, various aspects of this specification can also be implemented as a program product comprising program code. When the program product is run on a computing device 600, the program code causes the computing device 600 to perform the steps of the liveness detection model training method P100 and the liveness detection method P200 described in this specification. The program product for implementing the above methods may employ a portable compact disk read-only memory (CD-ROM) containing program code and may run on the computing device 600. However, the program product of this specification is not limited thereto. In this specification, a readable storage medium may 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 may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. The computer-readable storage medium may include a data signal propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable storage medium can also be any readable medium other than a readable storage medium that can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the readable storage medium can be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof. Program code for performing the operations described herein may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java and C++, and conventional procedural programming languages such as the "C" language or similar programming languages.The program code can be executed entirely on computing device 600, partially on computing device 600, as a standalone software package, partially on computing device 600 and partially on a remote computing device, or entirely on a remote computing device.
[0121] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.
[0122] In summary, after reading this detailed disclosure, those skilled in the art will understand that the foregoing detailed disclosure is presented by way of example only and is not restrictive. Although not explicitly stated herein, those skilled in the art will understand that this specification requires various reasonable changes, improvements, and modifications to the embodiments. These changes, improvements, and modifications are intended to be made by this specification and are within the spirit and scope of the exemplary embodiments described herein.
[0123] Furthermore, certain terms in this specification have been used to describe embodiments of this specification. For example, "an embodiment," "an embodiment," and / or "some embodiments" mean that a particular feature, structure, or characteristic described in connection with that embodiment may be included in at least one embodiment of this specification. Therefore, it is to be emphasized and understood that two or more references to "an embodiment" or "an embodiment" or "alternative embodiment" in various parts of this specification do not necessarily refer to the same embodiment. Moreover, specific features, structures, or characteristics may be suitably combined in one or more embodiments of this specification.
[0124] It should be understood that in the foregoing description of the embodiments in this specification, various features are combined in a single embodiment, drawing, or description for the purpose of simplifying the description and aiding in the understanding of a feature. However, this does not mean that the combination of these features is necessary, and those skilled in the art may readily identify some of the devices as separate embodiments when reading this specification. That is, the embodiments in this specification can also be understood as an integration of multiple secondary embodiments. It is also valid when each secondary embodiment contains fewer than all the features of a single foregoing disclosed embodiment.
[0125] Each patent, patent application, publication of the patent application, and other materials such as articles, books, specifications, publications, documents, articles, etc., cited herein may be incorporated by reference. All contents used for all purposes, except for any history of prosecution documents relating to it, that may be inconsistent with or conflict with this document, or any such history of prosecution documents that may have a limiting effect on the widest extent of the claims, are now or hereafter associated with this document. For example, in the event of any inconsistency or conflict between the description, definition, and / or use of terms associated with any of the included materials and the terms, description, definition, and / or used in connection with this document, the terms used herein shall prevail.
[0126] Finally, it should be understood that the embodiments disclosed herein are illustrative of the principles of the embodiments described in this specification. Other modified embodiments are also within the scope of this specification. Therefore, the embodiments disclosed in this specification are merely examples and not limitations. Those skilled in the art can implement the applications described in this specification using alternative configurations based on the embodiments in this specification. Therefore, the embodiments in this specification are not limited to the embodiments precisely described in the applications.
Claims
1. A method for training a liveness detection model, comprising: Obtain an initial training sample set, which includes live image samples and original attack image samples; Based on at least one attack region in the original attack image sample, a set of region mask images is generated, and the live image sample is replaced with regions to obtain at least one target attack image sample. as well as Training the pre-defined liveness detection model includes: The target training sample set is input into a preset liveness detection model to obtain the classification loss information of each image sample in the target training sample set and the predicted region mask image corresponding to the at least one target attack image sample. The target training sample set includes the at least one target attack image sample and the initial training sample set. The predicted region mask image is compared with the target region mask image corresponding to the at least one target attack image sample to determine the material recognition loss information corresponding to the at least one target attack image sample. This material recognition loss information is configured to guide the preset liveness detection model to perceive the attack region of the at least one target attack image sample. The preset liveness detection model is converged based on the classification loss information and the material recognition loss information to obtain the trained target liveness detection model.
2. The living body detection model training method according to claim 1, wherein The at least one attack region includes the image region corresponding to at least one biometric feature of the attacking user in the original attack image sample.
3. The living body detection model training method according to claim 1, wherein The process of generating the region mask image set based on at least one attack region in the original attack image sample, and performing region replacement on the liveness image sample to obtain at least one target attack image sample includes: The at least one attack region was identified in the original attack image sample; Based on the at least one attack region, generate the set of region mask images; and Based on the set of region mask images, the liveness image samples are replaced with regions to obtain at least one target attack image sample.
4. The liveness detection model training method according to claim 3, wherein, The process of identifying at least one attack region in the original attack image sample includes: At least one biometric region identifier was identified in the original attack image sample; and The image region corresponding to the region identifier is selected from the original attack image sample to obtain the at least one attack region.
5. The liveness detection model training method according to claim 3, wherein, The step of generating the set of region mask images based on the at least one attack region includes: The at least one attack area is combined to obtain at least one target attack area; Obtain the regional location of the at least one target attack area and the image size of the live image sample; and Based on the region location and the image size, at least one region mask image is generated to obtain the region mask image set, wherein the image size of the at least one region mask image is the same as the image size of the live image sample.
6. The liveness detection model training method according to claim 3, wherein, The step of performing region replacement on the live image sample to obtain the at least one target attack image sample includes: Identify at least one live region corresponding to a biological feature in the live image sample; Based on the type of the live region, at least one candidate region mask image is selected from the set of region mask images; and The at least one candidate region mask image is superimposed with the liveness image sample to obtain the at least one target attack image sample.
7. The liveness detection model training method according to claim 6, wherein, Each of the at least one target attack image samples includes at least one live area and at least one attack area.
8. The liveness detection model training method according to claim 1, wherein, The training of the preset liveness detection model also includes: The at least one target attack image sample is added to the initial training sample set to obtain the target training sample set.
9. The liveness detection model training method according to claim 1, wherein, The preset liveness detection model includes a feature extraction network, a liveness classification network, and a mask prediction network; as well as The target training sample set is input into the preset liveness detection model to obtain the classification loss information of each image sample in the target training sample set and the predicted region mask image corresponding to the at least one target attack image sample, including: The target training sample set is input into the feature extraction network to obtain the sample image features of each image sample. The sample image features are input into the liveness classification network to obtain the predicted liveness category for each image sample. The labeled liveness category of each image sample is obtained, and the labeled liveness category is compared with the predicted liveness category to obtain the classification loss information. Select the target sample image features of each target attack image sample from the at least one target attack image sample, and The target sample image features are input into the mask prediction network to obtain the prediction region mask image corresponding to each target attack image sample.
10. The liveness detection model training method according to claim 9, wherein, The mask prediction network includes a feature transformation subnetwork; as well as The step of inputting the target sample image features into the mask prediction network to obtain the predicted region mask image corresponding to each target attack image sample includes: The target sample image features are input into the feature transformation subnetwork to obtain the sample material features of each target attack image sample. The size of the sample material features is the same as the size of each target attack image sample. Based on the sample material characteristics, the predicted region material of each region in each target attack image sample is determined, and Based on the predicted region material, a predicted region mask image is generated for each target attack image sample.
11. The liveness detection model training method according to claim 1, wherein, The step of converging the preset liveness detection model to obtain the target liveness detection model includes: The classification loss information and the material recognition loss information are fused together, and the preset liveness detection model is converged based on the fused liveness detection loss information to obtain the target liveness detection model.
12. The liveness detection model training method according to claim 1, wherein, The step of comparing the predicted region mask image with the target region mask image corresponding to the at least one target attack image sample to determine the material recognition loss information corresponding to the at least one target attack image sample includes: Obtain a target region mask image corresponding to each target attack image sample in the at least one target attack image sample, wherein the target region mask image has the same size as the corresponding prediction region mask image; The target region mask image is compared with the corresponding predicted region mask image to obtain the material recognition loss information.
13. The liveness detection model training method according to claim 12, wherein, The step of comparing the target region mask image with the corresponding predicted region mask image to obtain the material recognition loss information includes: The current attack region is identified in the target region mask image, and the predicted attack region is identified in the predicted region mask image; The current attack region is compared with the predicted attack region to obtain the initial material loss information corresponding to each target attack image sample; and The initial material loss information is fused to obtain the material recognition loss information.
14. The liveness detection model training method according to claim 12, wherein, The step of comparing the target region mask image with the corresponding predicted region mask image to obtain the material recognition loss information includes: When the image size of the target region mask image is greater than a preset size threshold, candidate detection regions are identified in both the target region mask image and the predicted region mask image. Based on the candidate detection regions, the target region mask image and the predicted region mask image are cropped respectively; and The cropped target region mask image is compared with the cropped prediction region mask image to obtain the material recognition loss information.
15. A method for detecting liveness, comprising: Obtain the target user image of the target user; The target user image is input into the target liveness detection model to obtain the liveness detection result of the target user, and the target liveness detection model is trained according to the liveness detection model training method according to any one of claims 1 to 14; as well as Output the liveness detection results for the target user.
16. A liveness detection model training system, comprising: At least one storage medium storing at least one instruction set for training a liveness detection model; as well as At least one processor is communicatively connected to the at least one storage medium. When the liveness detection model training system is running, the at least one processor reads the at least one instruction set and executes the liveness detection model training method according to any one of claims 1-14.
17. A liveness detection system, comprising: 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 of claim 15 according to the instructions of the at least one instruction set.
Citation Information
Patent Citations
A model determination method and system
CN111027628A
Living body detection method and device, training method and device, electronic equipment and medium
CN113869253A
Neural network training method and apparatus, computer device, and storage medium
WO2022262209A1