Living body detection model training method, living body detection method and system
By incorporating image information from different receptive fields and classification confidence into the training of the liveness detection model, and optimizing the loss weights, the problem of existing models being unable to take into account different image information is solved, thereby improving detection accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
- Filing Date
- 2022-12-27
- Publication Date
- 2026-05-29
AI Technical Summary
Existing liveness detection models suffer from low detection accuracy because their receptive fields are fixed during training and they cannot take into account different image information.
By acquiring facial image samples under different receptive fields, a pre-set liveness detection model is used for feature extraction and classification. The loss weight is determined by combining the classification confidence, and the model training process is optimized.
It improves the detection accuracy of the liveness detection model, enabling more comprehensive extraction of background and detail information from facial images, thus enhancing the model's performance.
Smart Images

Figure CN116206371B_ABST
Abstract
Description
Technical Field
[0001] This specification relates to the field of image processing, and in particular to a method for training a liveness detection model, 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-live attack samples. To ensure the accuracy of liveness detection, it is often necessary to train the liveness detection model. Existing liveness detection models use specific receptive fields extracted from facial images for training.
[0003] In the process of researching and practicing existing technologies, the inventors of this invention discovered that because different receptive fields can correspond to different image information (such as background information and facial detail information), and a specific receptive field is often of a fixed size, the liveness detection model cannot simultaneously take into account different image information during training. As a result, the detection accuracy of the trained liveness detection model is low. 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] Firstly, this specification provides a method for training a liveness detection model, comprising: acquiring facial image samples of facial samples under different receptive fields, wherein the different receptive fields include a first receptive field and a second receptive field; extracting features from the facial image samples using a preset liveness detection model, and classifying the facial samples for liveness based on the extracted image features to obtain a classification result corresponding to a target receptive field, wherein the target receptive field includes the first receptive field, the second receptive field, and a fused receptive field, wherein the fused receptive field includes the receptive field corresponding to the feature information obtained by fusing the feature information of the first receptive field and the feature information of the second receptive field, and the classification result includes a classification confidence score; and determining a loss weight corresponding to the target receptive field based on the classification confidence score, and converging the preset liveness detection model based on the loss weight to obtain a trained target liveness detection model.
[0006] In some embodiments, the facial image sample includes a facial region corresponding to the facial sample, and the facial region has a different area proportion in the facial image sample corresponding to different receptive fields.
[0007] In some embodiments, the image features include a first image feature corresponding to a first receptive field and a second image feature corresponding to a second receptive field; and the step of performing liveness classification on the facial sample based on the extracted image features to obtain a classification result corresponding to the target receptive field includes: determining a first classification result corresponding to the first receptive field based on the first image features, and determining a second classification result corresponding to the second receptive field based on the second image features, concatenating the first image features and the second image features to obtain a fused image feature corresponding to the fused receptive field, determining a third classification result corresponding to the fused receptive field based on the fused image features, and using the first classification result, the second classification result, and the third classification result as the classification result corresponding to the target receptive field.
[0008] In some embodiments, determining the first classification result corresponding to the first receptive field based on the first image features includes: extracting liveness classification features from the first image features; and performing liveness classification on the facial sample based on the liveness classification features to obtain the first classification result.
[0009] In some embodiments, determining the loss weight corresponding to the target receptive field based on the classification confidence score includes: extracting a first classification confidence score corresponding to the first receptive field and a second classification confidence score corresponding to the second receptive field from the classification confidence score; and determining the loss weight corresponding to the target receptive field based on the first classification confidence score and the second classification confidence score.
[0010] In some embodiments, determining the loss weight corresponding to the target receptive field based on the first classification confidence and the second classification confidence includes: obtaining the sum between the first classification confidence and the second classification confidence to obtain a classification confidence sum value, and determining the current loss weight corresponding to the different receptive fields based on the classification confidence sum value; obtaining the difference between the first classification confidence and the second classification confidence to obtain a classification confidence difference value, and determining the fusion loss weight corresponding to the fusion receptive field based on the classification confidence difference value; and using the current loss weight and the fusion loss weight as the loss weight corresponding to the target receptive field.
[0011] In some embodiments, determining the current loss weights corresponding to the different receptive fields based on the classification confidence scores includes: comparing the first classification confidence score with the classification confidence scores to obtain a first loss weight corresponding to the first receptive field; comparing the second classification confidence score with the classification confidence scores to obtain a second loss weight corresponding to the second receptive field; and using the first loss weight and the second loss weight as the current loss weights corresponding to the different receptive fields.
[0012] In some embodiments, comparing the first classification confidence score with the sum of classification confidence scores to obtain the first loss weight corresponding to the first receptive field includes: obtaining the squared value of the first classification confidence score; obtaining the confidence ratio of the squared value to the sum of classification confidence scores; and using the confidence ratio as the first loss weight corresponding to the first receptive field.
[0013] In some embodiments, the fusion loss weight is positively correlated with the absolute value of the difference in classification confidence.
[0014] In some embodiments, the step of converging the preset liveness detection model based on the loss weights to obtain the trained target liveness detection model includes: determining the liveness loss information corresponding to the target receptive field based on the classification result; performing weighted fusion of the liveness loss information based on the loss weights to obtain the target liveness loss information corresponding to the facial sample; and converging the preset liveness detection model based on the target liveness loss information to obtain the trained target liveness detection model.
[0015] In some embodiments, determining the liveness loss information corresponding to the target receptive field based on the classification result includes: obtaining liveness annotation information of the facial sample, the liveness annotation information including the labeled liveness category of the facial sample; and comparing the labeled liveness category with the classification result corresponding to the target receptive field to obtain the liveness loss information corresponding to the target receptive field.
[0016] Secondly, this specification also provides a liveness detection method, comprising: acquiring facial images of a target face under different receptive fields, the different receptive fields including a first receptive field and a second receptive field; and using a target liveness detection model to detect the liveness category of the target face in the facial images, the target liveness detection model being trained according to the liveness detection model training method described in the first aspect.
[0017] In some embodiments, the step of using a target liveness detection model to detect the liveness category of the target face in the facial image includes: using the target liveness detection model to extract features from the facial image to obtain a first current image feature corresponding to the first receptive field and a second current image feature corresponding to the second receptive field; concatenating the first current image feature and the second current image feature to obtain target image features, and extracting target liveness classification features from the target image features; and performing liveness classification on the target face based on the target liveness classification features to obtain the liveness category of the target face.
[0018] Thirdly, 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 a target liveness detection model and implements the liveness detection method described in the second aspect of this specification, wherein the target liveness detection model is trained according to the liveness detection model training method described in the first aspect of this specification.
[0019] 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 acquiring facial image samples under different receptive fields (including a first receptive field and a second receptive field), use a preset liveness detection model to extract features from the facial image samples, and perform liveness classification on the facial samples based on the extracted image features to obtain the classification result corresponding to the target receptive field. The target receptive field includes a first receptive field, a second receptive field, and a fused receptive field. The fused receptive field includes the receptive field corresponding to the feature information fused from the feature information of the first receptive field and the feature information of the second receptive field. The classification result includes classification confidence and, based on the classification confidence, a loss weight corresponding to the target receptive field is determined. The preset liveness detection model is then converged based on the loss weight to obtain the trained target liveness detection model. Since this solution introduces receptive fields of different sizes, the liveness detection model can fully extract background information and facial region information from the facial image. In addition, different loss weights are assigned to the liveness detection model based on the classification confidence corresponding to different receptive fields, further optimizing the performance of the liveness algorithm. Therefore, the detection accuracy of the liveness detection model can be improved.
[0020] 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
[0021] 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.
[0022] Figure 1 A schematic diagram illustrating an application scenario of a liveness detection system provided according to an embodiment of this specification is shown.
[0023] Figure 2 A hardware structure diagram of a computing device provided according to an embodiment of this specification is shown;
[0024] Figure 3 A flowchart of a liveness detection model training method according to an embodiment of this specification is shown;
[0025] Figure 4 A schematic diagram of a facial image sample corresponding to different receptive fields is shown according to an embodiment of this specification;
[0026] Figure 5 A schematic diagram illustrating the overall training process of a preset liveness detection model provided according to an embodiment of this specification is shown; and
[0027] Figure 6 A schematic flowchart of a liveness detection method provided according to an embodiment of this specification is shown. Detailed Implementation
[0028] 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.
[0029] 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.
[0030] 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.
[0031] 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.
[0032] For ease of description, the terms that will appear in the following descriptions will be explained as follows:
[0033] Liveness detection: Determining whether the person being captured by the camera is a real person or an attacker based on the facial region in an image. Attack types mainly include techniques such as attacks using photos, mobile phones, screens, and masks.
[0034] Uneven lighting on a person's face: This refers to a situation where the lighting on a person's face is uneven due to external light. If there is a light source in a certain direction on the face, it will result in an uneven lighting on the face.
[0035] Receptive field: The receptive field can be understood as the size of the region on the input image that maps the pixels on the feature map output by each layer of a convolutional neural network back to the input image. The larger the receptive field, the more background information there is in the facial image, but the less facial detail there is; conversely, the smaller the receptive field, the less background information there is in the facial image, but the more facial detail there is.
[0036] Before describing the specific embodiments in this specification, the application scenarios of this specification will be introduced as follows:
[0037] 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.
[0038] 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.
[0039] Figure 1 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 1 As shown, system 001 may include target user 100, client 200, server 300 and network 400.
[0040] The target user 100 can be the user who triggers the liveness detection of the target facial image, and the target user 100 can perform the liveness detection operation on the client 200.
[0041] Client 200 can be a device for performing liveness detection on a target facial image in response to a liveness detection operation by target 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 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 1As 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 via network 400 to receive or send messages, etc. 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 a target facial image or other modal facial images. In some embodiments, the image acquisition device may be a two-dimensional image acquisition device (such as an RGB camera), or 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.
[0042] In some embodiments, the client 200 may have one or more applications (APPs) installed. The APPs provide the target 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 acquire at least one modality of facial image for the client 200, thereby obtaining a facial image sample set or a target facial image. In some embodiments, the target object 100 can also trigger a liveness detection request through the target APP. The target APP can respond to the liveness detection request by executing the liveness detection method described in this specification. In some embodiments, the target object 100 can also trigger a liveness detection model training request through the target APP. The target APP can respond to the liveness detection model training request by executing the liveness detection model training method described in this specification. The liveness detection model training method and the liveness detection method will be described in detail later.
[0043] Server 300 may be a server providing various services, such as a backend server supporting target facial image samples and target facial images acquired on client 200. 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.
[0044] 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 1As 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), Bluetooth networks, ZigBee networks, near field communication (NFC) networks, or similar networks. 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 switching points, through which one or more components of client 200 and server 300 can connect to network 400 to exchange data or information.
[0045] It should be understood that Figure 1 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.
[0046] 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.
[0047] Figure 2 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.
[0048] like Figure 2As 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.
[0049] The internal communication bus 610 can connect different system components, including storage medium 630, processor 620 and communication port 650.
[0050] I / O component 660 supports input / output between computing device 600 and other components.
[0051] 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.
[0052] 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.
[0053] 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).
[0054] Figure 3 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 3 As shown, method P100 may include:
[0055] S110: Obtain facial image samples under different receptive fields.
[0056] Here, the facial sample can be the face of the object being sampled. Taking a user as an example, the face can be a human face, and the facial sample can be a facial sample. This facial sample can be a live human face sample or an attack face sample. The attack face sample can include images or videos of the user's face, or samples of faces simulated by other types of artificial attack methods, etc.
[0057] The different receptive fields include a first receptive field and a second receptive field. The first and second receptive fields are different in size. A facial image sample includes the facial region and the background region corresponding to the facial sample. It should be noted that the facial region in the facial image samples corresponding to different receptive fields refers to the same object's face; for example, it could be the face of the same person, or the face of the same organism. The proportion of the facial region in the facial image samples corresponding to different receptive fields varies. The proportion of the facial region in the corresponding facial image sample is smaller in a larger receptive field than in a smaller receptive field. Therefore, facial image samples corresponding to larger receptive fields contain more background regions and thus more background information. Conversely, facial image samples corresponding to smaller receptive fields contain more facial regions and thus more facial detail information. The facial information can include various information about the face, such as the position of each component of the face, illumination, color and reflection, contours, etc. The background information can be various information about the background regions in the facial image sample other than the facial region, such as environmental information, illumination information, weather information, temperature information, or other background information, etc. Taking the first receptive field as the large receptive field and the second receptive field as the small receptive field, and the facial sample as the user's face as an example, the facial image samples corresponding to the first and second receptive fields can be as follows: Figure 4 As shown, facial image samples with larger receptive fields have more background information but less facial detail, while facial image samples with smaller receptive fields have less background information but more facial detail. It should be noted that the first and second receptive fields can be either large or small. The first and second receptive fields can be different; for example, if the first receptive field is large, the second receptive field can be small, or vice versa. The size of the receptive field can be distinguished directly by comparing the proportion of the facial region in facial image samples under different receptive fields. Alternatively, the proportion of the facial region in a facial image sample can be compared with a preset region proportion threshold. If it exceeds the preset threshold, it can be considered a small receptive field; if it does not exceed the preset region proportion threshold, it can be considered a large receptive field. The preset region proportion threshold can be set according to the actual application, and so on.
[0058] There are several ways to obtain facial image samples under different receptive fields, as follows:
[0059] For example, the processor 620 can use an image acquisition device to acquire multiple images of the same facial sample by setting different acquisition parameters or using different acquisition positions, thereby obtaining facial images under different receptive fields. It can then perform liveness labeling on these facial images. If the facial sample is a user or other real living being, it can be labeled as live; if the facial sample is an image or other attack sample, it can be labeled as an attack or non-live, thus obtaining facial image samples under different receptive fields. Alternatively, it can directly obtain facial image samples of the same facial sample under different receptive fields from the network or a labeling server. It can also receive facial image samples of the same facial sample uploaded by the target user 100 or other users through a terminal under different receptive fields. Furthermore, it can receive a liveness detection model training request, which carries the storage address of the facial image samples under different receptive fields, and obtain the facial image samples based on that storage address, and so on.
[0060] S120: Use a preset liveness detection model to extract features from facial image samples, and perform liveness classification on the facial samples based on the extracted image features to obtain the classification result corresponding to the target receptive field.
[0061] Image features can be features that characterize image information in a facial image sample, which may include background information and facial information, etc. Taking different receptive fields, including a first receptive field and a second receptive field, as an example, image features may include first image features of the first receptive field and second image features of the second receptive field.
[0062] The target receptive field includes a first receptive field, a second receptive field, and a fusion receptive field. The fusion receptive field includes the receptive field corresponding to the feature information obtained by fusing the feature information from the first and second receptive fields. Taking image features as an example, the fusion receptive field can be the receptive field corresponding to the image features obtained by fusing the first and second image features. This fusion receptive field is not a directly existing receptive field; it is mainly used to specifically refer to the receptive field corresponding to the feature information after image feature fusion, and can also be used to refer to the branch of liveness classification based on the fused image features. Correspondingly, the first receptive field can be used to refer to the branch of liveness classification based on the first image features, the second receptive field can be used to refer to the branch of liveness classification based on the second image features, and so on.
[0063] The classification result can be obtained after performing liveness classification on the facial sample. This result can include the classification confidence of either the liveness category (live sample) or the liveness category (attack sample) corresponding to that category, or it can include the classification confidence of each of the two categories respectively. The classification confidence represents the degree of truthfulness of classifying a sample into that category; a higher classification confidence indicates a more accurate classification.
[0064] There are several ways to extract features from facial image samples using a pre-set liveness detection model, as follows:
[0065] For example, the processor 620 can use the image feature extraction network in the preset liveness detection model to extract features from facial image samples under the first receptive field to obtain first image features, and use the image feature extraction network to extract features from facial image samples under the second receptive field to obtain second image features, and use the first image features and the second image features as image features extracted under different receptive fields.
[0066] The network structure of the image feature extraction network can be any network structure that can extract image features, such as CNN, RNN or other feature extraction networks, etc.
[0067] After extracting image features from facial image samples under different receptive fields, the processor 620 can perform liveness classification on the facial samples based on the extracted image features to obtain the classification result corresponding to the target receptive field. The processor 620 can perform liveness classification on facial samples in several ways. For example, the processor 620 can determine a first classification result corresponding to a first receptive field based on a first image feature, and determine a second classification result corresponding to a second receptive field based on a second image feature. It can then concatenate the first and second image features to obtain fused image features corresponding to a fused receptive field, determine a third classification result corresponding to the fused receptive field based on the fused image features, and use the first, second, and third classification results as the classification result corresponding to the target receptive field.
[0068] There are multiple ways to determine the first classification result corresponding to the first receptive field based on the first image features. For example, the processor 620 can extract the liveness classification features from the first image features and perform liveness classification on the facial image sample based on the liveness classification features to obtain the first classification result.
[0069] Among them, the liveness classification feature can be the feature in the image feature used for liveness classification. There are multiple ways to extract the liveness classification feature from the first image feature. For example, the preset liveness detection model can also include a classification coding network. The processor 620 can use the classification coding network to classify and encode the first image feature to obtain the liveness classification feature.
[0070] After extracting the liveness classification features, the processor 620 can perform liveness classification on the facial samples based on these features to obtain a first classification result. There are various ways to perform liveness classification on facial samples based on liveness classification features. For example, the processor 620 can use a classification network to classify the liveness classification features, thereby obtaining a first classification result for the facial samples.
[0071] The network structure of a classification network can be varied. For example, it can be a softmax network (a type of classification network), or it can be other binary or multi-class classification networks, and so on.
[0072] The method for determining the second classification result corresponding to the second receptive field based on the second image features is similar to that for determining the first classification result, as detailed above, and will not be repeated here.
[0073] There are several ways to stitch the first image features and the second image features together. For example, the processor 620 can directly stitch the first image features and the second image features together to obtain the fused image features corresponding to the fused receptive field. Alternatively, it can obtain the fusion weight corresponding to the receptive field, and weight the first image features and the second image features based on the fusion weight respectively, and stitch the weighted first image features and the weighted second image features together to obtain the fused image features corresponding to the fused receptive field.
[0074] After concatenating the first image features and the second image features, the processor 620 can determine the third classification result corresponding to the fused receptive field based on the fused image features. The method for determining the third classification result based on the fused image features is similar to that for determining the first classification result, as detailed above, and will not be repeated here.
[0075] It should be noted that the first, second, and third classification results can be obtained using the same classification coding network and the same classifier for liveness classification, or they can be obtained using separate classification coding networks and classifiers for each receptive field. If multiple classification coding networks and classifiers are used for liveness classification, these coding networks can share weights and parameters, and these classifiers can also share weights and parameters. Furthermore, the execution order for determining the first, second, and third classification results can be simultaneous; for example, two classification results or three secondary classification results can be determined simultaneously. The execution order can also be sequential. Sequential execution could mean first determining one classification result, and then sequentially determining the remaining classification results. The order can be set based on the actual application, and so on.
[0076] S130: Based on the classification confidence, determine the loss weight corresponding to the target receptive field, and converge the preset liveness detection model based on the loss weight to obtain the trained target liveness detection model.
[0077] The loss weights can be the weights of the loss information corresponding to each receptive field. These weights can include the current loss weights corresponding to different receptive fields and the fusion loss weights corresponding to the fused receptive field. The fusion loss weights are positively correlated with the absolute value of the difference in classification confidence. For the first and second receptive fields, higher weights indicate that more loss information from the corresponding receptive fields can be used to converge the pre-defined liveness detection model during training, thus improving the detection accuracy of the trained model. For the fused receptive field, higher weights indicate a significant difference in predictions between different facial image samples, suggesting that the sample is a difficult sample. Therefore, difficult samples can be selected from the training dataset, and training the pre-defined liveness detection model with these difficult samples can improve the detection accuracy of the trained model.
[0078] There are several ways to determine the loss weight corresponding to the target receptive field based on classification confidence, as follows:
[0079] For example, the processor 620 can extract the first classification confidence corresponding to the first receptive field and the second classification confidence corresponding to the second receptive field from the classification confidence, and determine the loss weight corresponding to the target receptive field based on the first classification confidence and the second classification confidence.
[0080] There are several ways to determine the loss weight corresponding to the target receptive field based on the first classification confidence and the second classification confidence. For example, the processor 620 can obtain the sum between the first classification confidence and the second classification confidence to get the classification confidence sum value, and determine the current loss weight corresponding to different receptive fields based on the classification confidence sum value, obtain the difference between the first classification confidence and the second classification confidence to get the classification confidence difference value, and determine the fusion loss weight corresponding to the fusion receptive field based on the classification confidence difference value, and use the current loss weight and the fusion loss weight as the loss weight corresponding to the target receptive field.
[0081] There are several ways to determine the current loss weight corresponding to different receptive fields based on the classification confidence score and the sum of classification confidence scores. For example, the processor 620 can compare the first classification confidence score with the sum of classification confidence scores to obtain the first loss weight corresponding to the first receptive field, compare the second classification confidence score with the sum of classification confidence scores to obtain the second loss weight corresponding to the second receptive field, and use the first loss weight and the second loss weight as the current loss weight corresponding to different receptive fields.
[0082] There are several ways to compare the first classification confidence with the sum of classification confidence to obtain the first loss weight corresponding to the first receptive field. For example, the processor 620 can obtain the squared value of the first classification confidence, obtain the confidence ratio of the squared value to the sum of classification confidence, and use the confidence ratio as the first loss weight corresponding to the first receptive field, as shown in formula (1).
[0083]
[0084] Where W1 is the first loss weight, logit1 is the first classification confidence, and logit2 is the second classification confidence.
[0085] The second classification confidence score is compared with the sum of classification confidence scores to obtain the second loss weight corresponding to the second receptive field. The method for obtaining the first loss weight is similar to that for obtaining the second loss weight, as shown in formula (2).
[0086]
[0087] Where W2 is the second loss weight, logit1 is the first classification confidence, and logit2 is the second classification confidence.
[0088] After determining the first loss weight and the second loss weight, the processor 620 can use the first loss weight and the second loss weight as the current loss weight corresponding to different receptive fields.
[0089] There are several ways to determine the fusion loss weights corresponding to the fusion receptive fields based on the difference in classification confidence. For example, the processor 620 can obtain the absolute value of the difference in classification confidence and determine the fusion loss weights based on this absolute value, as shown in formula (3).
[0090]
[0091] Among them, W F For the fusion loss weights, logit1 represents the first classification confidence score, and logit2 represents the second classification confidence score. The larger the absolute value of the difference in classification confidence scores, the larger the fusion loss weight, indicating a greater difference between the first and second classification results. In this case, the facial sample can be considered a difficult sample, thus allowing the selection of difficult samples from the sample dataset. Using difficult samples during training of the preset liveness detection model can improve the detection accuracy of the trained target liveness detection model.
[0092] After determining the fusion loss weight, the processor 620 can use the fusion loss weight and the current loss weight as the loss weight corresponding to the target receptive field.
[0093] After determining the loss weights corresponding to the target receptive field, the processor 620 can converge the preset liveness detection model based on these loss weights to obtain the trained target liveness detection model. There are several ways to converge the preset liveness detection model based on these loss weights. For example, the processor 620 can determine the liveness loss information corresponding to the target receptive field based on the classification results, perform weighted fusion of the liveness loss information based on the loss weights to obtain the target liveness loss information corresponding to the facial sample, and then converge the preset liveness detection model based on the target liveness loss information to obtain the trained target liveness detection model. Specifically, this can be done as follows:
[0094] (1) Based on the classification results, determine the live loss information corresponding to the target receptive field.
[0095] Among them, the liveness loss information can be the loss information generated when performing liveness detection on facial samples using a preset liveness detection model.
[0096] There are several ways to determine the liveness loss information corresponding to the target receptive field based on the classification results, as follows:
[0097] For example, the processor 620 can acquire liveness annotation information of a facial sample, which includes the labeled liveness category of the facial sample. The labeled liveness category is compared with the classification result corresponding to the target receptive field to obtain liveness loss information corresponding to the target receptive field.
[0098] The labeled liveness category can be a liveness category labeled for facial samples, or it can be considered a liveness label. The category can mainly include either a liveness category or an attack category. There are multiple ways to compare the labeled liveness category with the classification result corresponding to the target receptive field to obtain the liveness loss corresponding to the target receptive field. For example, the processor 620 can use a first preset loss function to compare the first classification result with the labeled liveness category to obtain the first liveness loss information corresponding to the first receptive field, use a second preset loss function to compare the second classification result with the labeled liveness category to obtain the second liveness loss information corresponding to the second receptive field, use a third preset loss function to compare the third classification result with the labeled liveness category to obtain the third liveness loss information corresponding to the fused receptive field, and use the first liveness loss information, the second liveness loss information, and the third liveness loss information as the liveness loss information corresponding to the target receptive field.
[0099] It should be noted that the first, second, and third preset loss functions can be the same loss function or different loss functions. Taking the first, second, and third preset loss functions as an example, the type of preset loss function can be various, such as the cross-entropy loss function (CEloss), or other types of loss functions.
[0100] (2) Based on the loss weight, the live loss information is weighted and fused to obtain the target live loss information corresponding to the face sample.
[0101] For example, the processor 620 can weight the first liveness loss information, the second liveness loss information, and the third liveness loss information based on the loss weights, and then sum the weighted first liveness loss information, the weighted second liveness loss information, and the weighted third liveness loss information to obtain the target liveness loss information corresponding to the facial sample, as shown in formula (4):
[0102] CCMLoss = W1 * ELoss1 + 2 * ELoss2 + F *ELosS F (4)
[0103] Where CCMLoss represents the target liveness loss information, W1 is the first loss weight, W2 is the second loss weight, and W... F To fuse the loss weights, CELouss1 is the first liveness loss information, CELouss2 is the second liveness loss information, and CELouss... F This is information about the loss of a third living organism.
[0104] (3) The preset liveness detection model is converged based on the target liveness loss information to obtain the trained target liveness detection model.
[0105] For example, the processor 620 can update the network parameters of the preset liveness detection model based on the target liveness loss information, and return to iteratively execute the training process of the preset liveness detection model until the preset liveness detection model converges, thereby obtaining the trained target liveness detection model.
[0106] There are several ways to update the network parameters of the preset liveness detection model based on the target liveness loss information. For example, the processor 620 can use the gradient descent algorithm to update the network parameters of the preset liveness detection model based on the target liveness loss information, or it can use other network parameter update algorithms to update the network parameters of the preset liveness detection model based on the target liveness loss information.
[0107] In this scheme, the overall training process for training the preset liveness detection model can be as follows: Figure 5 As shown, the image feature extraction networks (branch_1 and branch_2) in the preset liveness detection model are used to extract features from different receptive fields, respectively, and output the first image feature (fp1) and the second image feature (fp2). Then, the two image features are fused to obtain the fused image feature (fp). Three classification and coding networks are used to classify and encode fp1, fp2 and fp to obtain the corresponding liveness classification features. Then, classification is performed based on the liveness classification features to obtain the first classification confidence (logit_1) of the first classification result corresponding to the first receptive field, the second classification confidence (logit_2) of the second classification result corresponding to the second receptive field, and the third classification confidence (logit_F) of the third classification result corresponding to the fused receptive field. Based on logit_1 and logit_2 respectively, the loss weights of the relative branches of each receptive field (first receptive field, second receptive field, and fused receptive field) are determined. Based on the loss weights, the preset liveness detection model is trained using the cross-entropy loss function (CEloss). During the training process, the calculation of the loss function can refer to formulas (1)-(4) until the preset liveness detection model converges, thus obtaining the trained target liveness detection model. In the training of the liveness detection model, multi-receptive field fusion is introduced, which can fully extract background and facial information. At the same time, the confidence consistency loss function is introduced to optimize the allocation of different weights for the preset liveness detection model, further optimizing the liveness performance of the face system.
[0108] After the processor 620 trains the preset liveness detection model to obtain the target liveness detection model, it can perform liveness detection based on the liveness detection model.
[0109] 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 5 As shown, method P200 may include:
[0110] S210: Acquire facial images of the target face under different receptive fields.
[0111] The different receptive fields include the first receptive field and the second receptive field, as detailed above, and will not be repeated here.
[0112] The target face can be the face of the object to be detected for liveness detection. Taking a user as an example, the target face can be the user's face. The user's face can be a live face or an attack face. The attack face can be a fake face created using various attack methods, such as an image or video containing the user's face, or a face simulated by other types of artificial attacks, etc.
[0113] There are several ways to acquire facial images of the target face under different receptive fields, as follows:
[0114] For example, the processor 620 can acquire multiple images of the same target face through an image acquisition device by setting different acquisition parameters or using different acquisition positions to obtain facial images under different receptive fields. Alternatively, it can directly obtain facial images of the same target face under different receptive fields from a network or image database. Or, it can receive facial images of the target face under different receptive fields uploaded by the target user 100 or other users through a terminal. Alternatively, it can also receive a liveness detection request, which carries the storage address of the facial images of the target face under different receptive fields, and acquire the facial image based on the storage address, and so on.
[0115] S220: Use a target liveness detection model to detect the liveness category of the target face in the facial image.
[0116] Among them, the target liveness detection model can be used to... Figure 3 The liveness detection model was trained using the training method described above.
[0117] There are several ways to use a target liveness detection model to detect the liveness category of a target face in a facial image, as follows:
[0118] For example, the processor 620 can use a target liveness detection model to extract features from a facial image, obtain a first current image feature corresponding to a first receptive field and a second current image feature corresponding to a second receptive field, concatenate the first current image feature and the second current image feature to obtain target image features, extract target liveness classification features from the target image features, and perform liveness classification on the target face based on the target liveness classification features to obtain the liveness category of the target face.
[0119] The method of detecting the liveness category of a target face in a facial image using a target liveness detection model is similar to the method of liveness classification based on facial image samples, as detailed above, and will not be repeated here.
[0120] It should be noted that when training the preset liveness detection model, a first receptive field branch, a second receptive field branch, and a fused receptive field branch were used to classify facial samples for liveness. The loss weight for each branch was determined based on the classification confidence score. The liveness loss information from each branch was then weighted and fused based on this weight. Finally, the fused target liveness loss information was used to converge the preset liveness detection model, resulting in the trained target liveness detection model. In applying the target liveness detection model, the first and second receptive field branches are no longer needed for liveness classification; only the fused receptive field branch is required. Furthermore, by fusing image features from different receptive fields during liveness detection, the resulting target image features fully incorporate both background and facial information from the facial image, thereby increasing the accuracy of liveness detection.
[0121] In summary, the liveness detection model training method P100, liveness detection method P200, and system 001 provided in this specification, after acquiring facial image samples under different receptive fields (including a first receptive field and a second receptive field), use a preset liveness detection model to extract features from the facial image samples, and perform liveness classification on the facial samples based on the extracted image features to obtain the classification result corresponding to the target receptive field. The target receptive field includes a first receptive field, a second receptive field, and a fused receptive field. The fused receptive field includes a fusion of feature information from the first receptive field and feature information from the second receptive field. The receptive field corresponding to the feature information is defined. The classification result includes classification confidence and loss weights corresponding to the target receptive field determined based on the classification confidence. The preset liveness detection model is then converged based on the loss weights to obtain the trained target liveness detection model. Since this scheme introduces receptive fields of different sizes, the liveness detection model can fully extract background information and facial region information from facial images. In addition, different loss weights are assigned to optimize the liveness detection model based on the classification confidence corresponding to different receptive fields, which further optimizes the performance of the liveness algorithm. Therefore, the detection accuracy of the liveness detection model can be improved.
[0122] 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.
[0123] 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.
[0124] 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.
[0125] 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.
[0126] 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.
[0127] 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.
[0128] 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: Acquire facial image samples under different receptive fields, wherein the different receptive fields include a first receptive field and a second receptive field; A preset liveness detection model is used to extract features from the facial image samples, and liveness classification is performed on the facial samples based on the extracted image features to obtain the classification result corresponding to the target receptive field. The target receptive field includes a first receptive field, a second receptive field, and a fused receptive field. The fused receptive field includes the receptive field corresponding to the feature information obtained by fusing the feature information of the first receptive field and the feature information of the second receptive field. The classification result includes classification confidence. Extract the first classification confidence corresponding to the first receptive field and the second classification confidence corresponding to the second receptive field from the classification confidence. The sum of the first classification confidence and the second classification confidence is obtained to get the classification confidence sum value, and the current loss weight corresponding to the different receptive fields is determined based on the classification confidence sum value; Obtain the difference between the first classification confidence and the second classification confidence to obtain the classification confidence difference, and determine the fusion loss weight corresponding to the fusion receptive field based on the classification confidence difference; as well as The current loss weight and the fusion loss weight are used as the loss weights corresponding to the target receptive field, and the preset liveness detection model is converged based on the loss weights to obtain the trained target liveness detection model.
2. The liveness detection model training method according to claim 1, wherein, The facial image sample includes the facial region corresponding to the facial sample, and the proportion of the facial region in the facial image sample corresponding to different receptive fields is different.
3. The liveness detection model training method according to claim 1, wherein, The image features include a first image feature corresponding to the first receptive field and a second image feature corresponding to the second receptive field; as well as The step of performing liveness classification on the facial samples based on the extracted image features to obtain the classification result corresponding to the target receptive field includes: Based on the first image features, a first classification result corresponding to the first receptive field is determined, and based on the second image features, a second classification result corresponding to the second receptive field is determined. The first image features and the second image features are concatenated to obtain the fused image features corresponding to the fused receptive field. Based on the fused image features, the third classification result corresponding to the fused receptive field is determined. The first classification result, the second classification result, and the third classification result are used as the classification results corresponding to the target receptive field.
4. The liveness detection model training method according to claim 3, wherein, The step of determining the first classification result corresponding to the first receptive field based on the first image features includes: Extract liveness classification features from the first image features; and Based on the liveness classification features, the facial sample is classified as a liveness sample to obtain a first classification result.
5. The liveness detection model training method according to claim 1, wherein, The step of determining the current loss weights corresponding to different receptive fields based on the classification confidence scores and values includes: The first classification confidence score is compared with the sum of the classification confidence scores to obtain the first loss weight corresponding to the first receptive field. The second classification confidence score is compared with the sum of the classification confidence scores to obtain the second loss weight corresponding to the second receptive field; and The first loss weight and the second loss weight are used as the current loss weights corresponding to the different receptive fields.
6. The liveness detection model training method according to claim 5, wherein, The step of comparing the first classification confidence score with the sum of the classification confidence scores to obtain the first loss weight corresponding to the first receptive field includes: Obtain the squared value of the confidence score for the first category; Obtain the confidence ratio of the squared value to the sum of the classification confidence scores; and The confidence ratio is used as the first loss weight corresponding to the first receptive field.
7. The liveness detection model training method according to claim 1, wherein, The fusion loss weight is positively correlated with the absolute value of the difference in classification confidence.
8. The liveness detection model training method according to claim 1, wherein, The step of converging the preset liveness detection model based on the loss weights to obtain the trained target liveness detection model includes: Based on the classification results, determine the liveness loss information corresponding to the target receptive field; Based on the aforementioned loss weights, the liveness loss information is weighted and fused to obtain the target liveness loss information corresponding to the facial sample; and The preset liveness detection model is converged based on the target liveness loss information to obtain the trained target liveness detection model.
9. The liveness detection model training method according to claim 8, wherein, The step of determining the liveness loss information corresponding to the target receptive field based on the classification result includes: Obtain the liveness annotation information of the facial sample, wherein the liveness annotation information includes the labeled liveness category of the facial sample; and The labeled liveness category is compared with the classification result corresponding to the target receptive field to obtain the liveness loss information corresponding to the target receptive field.
10. A method for detecting liveness, comprising: Acquire facial images of the target face under different receptive fields, wherein the different receptive fields include a first receptive field and a second receptive field; as well as The target liveness detection model is used to detect the liveness category of the target face in the facial image, and the target liveness detection model is trained according to the liveness detection model training method according to any one of claims 1 to 9.
11. The liveness detection method according to claim 10, wherein, The step of using a target liveness detection model to detect the liveness category of the target face in the facial image includes: The target liveness detection model is used to extract features from the facial image to obtain the first current image feature corresponding to the first receptive field and the second current image feature corresponding to the second receptive field. The first current image feature and the second current image feature are concatenated to obtain the target image feature, and the target liveness classification feature is extracted from the target image feature; and Based on the target liveness classification features, the target face is classified as a liveness type to obtain the liveness category of the target face.
12. 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 target liveness detection model and implements the liveness detection method according to any one of claims 10 to 11, wherein the target liveness detection model is trained according to the liveness detection model training method according to any one of claims 1 to 9.