Liveness detection method, deep learning model training method and device
By extracting guidance features from the image block sequence and matching the expert parameter matrix, combined with the static feature extraction module to adjust the deep learning model, the problem of low accuracy and efficiency of live detection in the existing technology is solved, and more efficient real image recognition and new attacks are achieved. Image recognition capabilities.
Patent Information
- Application Number
- CN202211670642.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-23
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2042-12-23
AI Technical Summary
Existing technologies are difficult to effectively identify real and fake images in live body detection, and deep learning models have insufficient recognition capabilities when faced with new attack images, resulting in low detection accuracy and efficiency.
By processing the image block sequence of the target object, the guidance features are extracted and matched with the target expert parameter matrix to determine the living body detection result. At the same time, the static feature extraction module and expert parameter matrix are used to adjust the deep learning model to improve the recognition of new attack images. ability.
It improves the accuracy and efficiency of living body detection, enhances the recognition ability of new attack images, and reduces the processing difficulty and noise impact.
Smart Images

Figure CN116363762B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence technology, in particular to the field of deep learning, image processing, and computer vision technology, and can be applied to scenarios such as liveness detection, and specifically to liveness detection methods, training methods, devices, electronic devices, storage media, and program products for deep learning models. Background Art
[0002] Deep learning is a machine learning method applied in the field of artificial intelligence technology. The deep learning model obtained by deep learning method can be applied to various scenarios such as image processing and natural semantic processing. Liveness detection is an important application branch of deep learning models. Summary of the invention
[0003] The present disclosure provides a living body detection method, a deep learning model training method, a device, an electronic device, a storage medium, and a program product.
[0004] According to one aspect of the present disclosure, a liveness detection method is provided, comprising: processing an image block sequence about a target object to obtain guiding features; determining a target expert parameter matrix that matches the guiding features, wherein the target expert parameter matrix includes knowledge information for detecting the target object; and determining a liveness detection result of the target object based on the image block sequence and the target expert parameter matrix.
[0005] According to another aspect of the present disclosure, a training method for a deep learning model is provided, wherein the deep learning model includes a static feature extraction module and at least one expert parameter matrix, and the method includes: inputting a sample image block sequence about a target object into the static feature extraction module to obtain a sample guide feature; determining a target expert parameter matrix matching the sample guide feature from the at least one expert parameter matrix, wherein the target expert parameter matrix includes knowledge information for detecting the target object; determining a sample liveness detection result of the target object based on the sample image block sequence and the target expert parameter matrix; and adjusting parameters of the target expert parameter matrix based on the sample liveness detection result and a sample label matching the sample image block sequence to obtain a trained deep learning model.
[0006] According to another aspect of the present disclosure, a liveness detection device is provided, comprising: an extraction module, used to process an image block sequence about a target object to obtain a guiding feature; a first determination module, used to determine a target expert parameter matrix that matches the guiding feature, wherein the target expert parameter matrix includes knowledge information for detecting the target object; and a second determination module, used to determine a liveness detection result of the target object based on the image block sequence and the target expert parameter matrix.
[0007] According to another aspect of the present disclosure, a training device for a deep learning model is provided, wherein the deep learning model includes a static feature extraction module and at least one expert parameter matrix, and the device includes: an input module, used to input a sample image block sequence about a target object into the static feature extraction module to obtain a sample guiding feature; a third determination module, used to determine a target expert parameter matrix matching the sample guiding feature from the at least one expert parameter matrix, wherein the target expert parameter matrix includes knowledge information for detecting the target object; a fourth determination module, used to determine a sample liveness detection result of the target object based on the sample image block sequence and the target expert parameter matrix; and a parameter adjustment module, used to adjust the parameters of the target expert parameter matrix based on the sample liveness detection result and a sample label matching the sample image block sequence to obtain a trained deep learning model.
[0008] According to another aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute a method as disclosed in the present disclosure.
[0009] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the method of the present disclosure.
[0010] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the method of the present disclosure is implemented.
[0011] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0013] Figure 1 An exemplary system architecture to which the method and device for detecting a living body according to an embodiment of the present disclosure can be applied is schematically shown;
[0014] Figure 2 The flowchart of the living body detection method according to the embodiment of the present disclosure is schematically shown;
[0015] Figure 3 The following schematically shows a flow chart of determining a target expert parameter matrix according to another embodiment of the present disclosure;
[0016] Figure 4 The following is a schematic diagram showing a flow chart of a living body detection method according to another embodiment of the present disclosure;
[0017] Figure 5 A flowchart of a deep learning model training method according to an embodiment of the present disclosure is schematically shown;
[0018] Figure 6 A schematic diagram of a process flow of a deep learning model training method according to another embodiment of the present disclosure is shown;
[0019] Figure 7 A block diagram of a living body detection device according to an embodiment of the present disclosure is schematically shown;
[0020] Figure 8 A block diagram schematically shows a training device for a deep learning model according to an embodiment of the present disclosure; and
[0021] Fig. 9 A block diagram of an electronic device suitable for implementing a living body detection method according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0022] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0023] The present disclosure provides a living body detection method, a deep learning model training method, a device, an electronic device, a storage medium, and a program product.
[0024] According to an embodiment of the present disclosure, a liveness detection method is provided, comprising: processing an image block sequence about a target object to obtain a guiding feature; determining a target expert parameter matrix that matches the guiding feature, wherein the target expert parameter matrix includes knowledge information for detecting the target object; and determining a liveness detection result of the target object based on the image block sequence and the target expert parameter matrix.
[0025] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision, disclosure and application of user personal information involved comply with the provisions of relevant laws and regulations, take necessary confidentiality measures, and do not violate public order and good morals.
[0026] In the technical solution of the present disclosure, the user's authorization or consent is obtained before obtaining or collecting the user's personal information.
[0027] Figure 1 An exemplary system architecture to which the method and apparatus for liveness detection according to an embodiment of the present disclosure can be applied is schematically shown.
[0028] It should be noted that Figure 1 The examples shown are only examples of system architectures to which the embodiments of the present disclosure can be applied, in order to help those skilled in the art understand the technical content of the present disclosure, but do not mean that the embodiments of the present disclosure cannot be used in other devices, systems, environments or scenarios. For example, in another embodiment, an exemplary system architecture to which the liveness detection method and apparatus can be applied may include a terminal device, but the terminal device may implement the liveness detection method and apparatus provided by the embodiments of the present disclosure without interacting with a server.
[0029] like Figure 1 As shown, the system architecture 100 according to this embodiment may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired and / or wireless communication links, etc.
[0030] Users can use terminal devices 101, 102, 103 to interact with server 105 through network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, 103, such as knowledge reading applications, web browser applications, search applications, instant messaging tools, email clients and / or social platform software, etc. (only as examples).
[0031] The terminal devices 101 , 102 , and 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.
[0032] The server 105 may be a server that provides various services, such as a background management server (only an example) that provides support for the content browsed by the user using the terminal devices 101, 102, and 103. The background management server may analyze and process the received data such as user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal device.
[0033] It should be noted that the liveness detection method provided in the embodiment of the present disclosure can generally be executed by the terminal device 101, 102, or 103. Accordingly, the liveness detection apparatus provided in the embodiment of the present disclosure can also be set in the terminal device 101, 102, or 103.
[0034] Alternatively, the liveness detection method provided in the embodiment of the present disclosure may also be generally performed by the server 105. Accordingly, the liveness detection device provided in the embodiment of the present disclosure may generally be arranged in the server 105. The liveness detection method provided in the embodiment of the present disclosure may also be performed by a server or server cluster that is different from the server 105 and can communicate with the terminal devices 101, 102, 103 and / or the server 105. Accordingly, the liveness detection device provided in the embodiment of the present disclosure may also be arranged in a server or server cluster that is different from the server 105 and can communicate with the terminal devices 101, 102, 103 and / or the server 105.
[0035] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to the implementation requirements.
[0036] It should be noted that the sequence numbers of the operations in the following method are only used as representations of the operations for the purpose of description, and should not be regarded as representing the execution order of the operations. Unless explicitly stated, the method does not need to be executed completely in the order shown.
[0037] Figure 2 The flowchart of the living body detection method according to the embodiment of the present disclosure is schematically shown.
[0038] like Figure 2 As shown, the method includes operations S210 to S230.
[0039] In operation S210, a sequence of image blocks related to a target object is processed to obtain a guiding feature.
[0040] In operation S220, a target expert parameter matrix matching the guided features is determined.
[0041] In operation S230 , a liveness detection result of the target object is determined based on the image block sequence and the target expert parameter matrix.
[0042] According to an embodiment of the present disclosure, multiple images taken at different times may be sorted according to the time of taking the images to obtain an image block sequence. Multiple images cropped from one image may also be sorted according to the cropping orientation to obtain an image block sequence. Any image block sequence including the target object may be used.
[0043] According to an embodiment of the present disclosure, the target object may include at least one of the following: face, limbs, or body.
[0044] According to an embodiment of the present disclosure, a liveness detection result can be used to characterize whether an image block sequence is obtained based on a real or live target object. For example, when the liveness detection result characterizes that the image block sequence is a live image, it means that the image block sequence is obtained based on a real target object. For another example, when the liveness detection result characterizes that the image block sequence is a forged image or an attack image, it means that the image block sequence is obtained based on a forged target object. A forged target object may refer to an image block sequence obtained by collecting an image, video, or three-dimensional model including a target object.
[0045] According to the embodiments of the present disclosure, the liveness detection method provided by the embodiments of the present disclosure can be applied to many application scenarios such as attendance, access control, security, financial payment, etc. to improve the security and reliability of business scenarios.
[0046] According to an embodiment of the present disclosure, a sequence of image blocks related to a target object is processed to obtain a guiding feature. The processing may refer to extracting features from the sequence of image blocks to obtain a guiding feature. However, it is not limited thereto. It may also refer to extracting features from the sequence of image blocks and combining them with other information having a guiding effect to obtain a guiding feature.
[0047] According to an embodiment of the present disclosure, the guiding feature is a feature obtained based on an image block sequence, and the guiding feature includes features in the image block sequence that are used to match the target expert parameter matrix. For example, the guiding feature includes feature information in the image block sequence for detecting whether the target object is a living body, but it is not limited to this. The guiding feature may also include feature information in the image block sequence that is unrelated to the feature information for detecting whether the target object is a living body. As long as the target expert parameter matrix can be determined based on the guiding feature, it will be sufficient.
[0048] According to an embodiment of the present disclosure, the target expert parameter matrix includes knowledge information for detecting the target object, and the liveness detection result of the target object is determined based on the image block sequence and the target expert parameter matrix. The target expert parameter matrix can be used to assist in identifying whether the image block sequence is an attack image, thereby improving the accuracy of the liveness detection result.
[0049] According to an embodiment of the present disclosure, when executing Figure 2 Before the operation S210 shown, the method may further include: performing a preprocessing operation on the initial image to obtain an image block sequence.
[0050] Performing a preprocessing operation on the initial image to obtain an image block sequence may include: performing key point alignment on the initial image including the target object to obtain an aligned image, and segmenting the aligned image to obtain an image block sequence.
[0051] According to an embodiment of the present disclosure, when the target object includes a face, aligning key points of the initial image may refer to aligning the facial features of the target object. However, it is not limited to this. When the target object includes a body and limbs, aligning key points of the initial image may refer to aligning the limbs of the target object.
[0052] According to an embodiment of the present disclosure, key point alignment is performed on an initial image including a target object to obtain an aligned image, which may include: position detection of key feature points to obtain multiple key parts; geometric correction of the multiple key parts, such as scaling, rotation, stretching and other transformations to obtain an aligned image.
[0053] According to an embodiment of the present disclosure, the position detection of key feature points may be performed using a local detector or regressor for processing images, but is not limited thereto, as long as the network structure is capable of identifying key feature points.
[0054] According to an embodiment of the present disclosure, segmenting the aligned image to obtain an image block sequence may include: segmenting the aligned image according to a predetermined segmentation size, such as an image size of 224x224, to obtain multiple images. Arranging the multiple images according to a predetermined position arrangement order to obtain an image block sequence.
[0055] According to the embodiments of the present disclosure, by aligning key points, the target object in the initial image can be made standard and regular, which is beneficial for subsequent liveness detection and thus improves the accuracy of liveness detection results.
[0056] According to the embodiments of the present disclosure, Figure 2The operation S210 shown, processing the image block sequence of the target object to obtain the guiding feature, may include: obtaining a static feature based on the image block sequence, and obtaining the guiding feature based on the static feature and a predetermined classification mark feature.
[0057] According to an embodiment of the present disclosure, obtaining static features based on an image block sequence may include: extracting features from the image block sequence to obtain static features. For example, encoding the image block sequence to obtain static features of the image block sequence. A network structure with feature extraction or encoding, such as a linear projection layer (Patch Embedding), may be used to extract features from the image block sequence to obtain static features.
[0058] According to an embodiment of the present disclosure, obtaining a guiding feature based on a static feature and a predetermined classification mark feature (e.g., Class Token) may include: splicing the static feature and the predetermined classification mark feature to obtain the guiding feature. However, it is not limited thereto. It may also include: splicing the static feature and the predetermined classification mark feature to obtain a spliced feature, and extracting features from the spliced feature to obtain the guiding feature.
[0059] According to an embodiment of the present disclosure, a visual encoder (Vision Transformer Encoder, ViTEncoder) can be used to process static features and predetermined classification mark features to obtain guiding features. However, it is not limited to this. It is also possible to use at least one stacked encoding module among multiple stacked encoding modules in a visual encoder to process static features and predetermined classification mark features to obtain guiding features.
[0060] According to an embodiment of the present disclosure, the predetermined classification mark features may include additional input features for reference, such as category features.
[0061] According to other embodiments of the present disclosure, static features may be directly used as guiding features as long as they are features extracted from an image block sequence.
[0062] Compared with directly using static features as guiding features, obtaining guiding features based on static features and predetermined classification mark features can make the guiding features contain additional input guiding features for reference, thereby making the target expert parameter matrix determined by using the guiding features fast and accurate, avoiding the problem of inaccurate target expert parameter matrix determined due to too much noise.
[0063] According to an embodiment of the present disclosure, at least one first image set may be obtained. Based on the at least one first image set, at least one expert parameter matrix may be determined. The multiple images in each first image set may be multiple images having common features. For example, multiple images acquired under the same lighting conditions, or multiple images acquired using the same attack method.
[0064] According to the embodiments of the present disclosure, features can be extracted from multiple images in the first image set to obtain multiple feature information corresponding to the multiple images one by one, and the multiple feature information can be concatenated to obtain an expert parameter matrix.
[0065] According to the embodiments of the present disclosure, Figure 2 The operation S220 shown, determining the target expert parameter matrix that matches the guide feature, may include: matching the guide feature with at least one expert parameter matrix respectively in feature similarity, obtaining at least one similarity that corresponds to the at least one expert parameter matrix one by one, and determining the expert parameter matrix with the highest similarity from the at least one similarity as the target expert parameter matrix.
[0066] According to an embodiment of the present disclosure, the target expert parameter matrix includes common features of multiple images in the first image set, and the target expert parameter matrix matches the guide features. In the process of determining the liveness detection result of the target object, the representative common features in the target expert parameter matrix can be used as auxiliary information, thereby making the determined liveness detection result accurate.
[0067] According to another embodiment of the present disclosure, the expert parameter matrix may be a matrix including adjustable parameters. The expert parameter matrix may be obtained by training using the first image set. The multiple images in each first image set may be multiple images having common features. For example, multiple images acquired under the same lighting conditions, or multiple images acquired using the same attack method. By training the expert parameter matrix using the first image set, the adjustable parameters in the expert parameter matrix may be adjusted to retain the knowledge information for liveness detection acquired by learning the first image set.
[0068] According to an embodiment of the present disclosure, multiple first image sets can be used to train an expert parameter matrix to obtain multiple expert parameter matrices corresponding to the multiple first image sets. Each expert parameter matrix retains knowledge information for detecting target objects that is specific to multiple images in the first image set that matches the expert parameter matrix. Each first image set in the multiple first image sets can be an image set obtained using different types of attack methods, and thus multiple expert parameter matrices can retain knowledge information for identifying different types of attack methods. Thus, the target expert parameter matrix that matches the guide feature is used to determine the liveness detection result of the target object, which can be accurate while improving recognition efficiency and reducing processing difficulty.
[0069] According to another embodiment of the present disclosure, Figure 2 The operation S220 shown, determining a target expert parameter matrix that matches the guiding feature, may also include: determining a target clustering parameter matrix that matches the guiding feature. Determining a target expert parameter matrix that matches the target clustering parameter matrix.
[0070] According to an embodiment of the present disclosure, the target clustering parameter matrix includes feature information that matches the image block sequence.
[0071] According to an embodiment of the present disclosure, at least one second image set may be obtained. Based on the at least one second image set, at least one clustering parameter matrix may be determined. The multiple images in each second image set may be multiple images having common features. For example, multiple images acquired under the same lighting conditions, or multiple images acquired using the same attack method.
[0072] According to the embodiments of the present disclosure, features can be extracted from multiple images in the second image set to obtain multiple feature information corresponding to the multiple images one by one, and the multiple feature information can be concatenated to obtain a clustering parameter matrix.
[0073] According to the embodiments of the present disclosure, the target clustering parameter matrix matching the guiding features can be used to establish a correlation relationship between the guiding features and the target expert parameter matrix, which can be applied to expert parameter matrices from different sources, thereby widening the scope of application of determining the target expert parameter matrix.
[0074] According to an embodiment of the present disclosure, determining a target clustering parameter matrix that matches a guide feature may include: determining a matching degree between the guide feature and at least one clustering parameter matrix to obtain at least one matching degree. The at least one matching degree corresponds to the at least one clustering parameter matrix. Based on the at least one matching degree, determining a target clustering parameter matrix that matches the guide feature from the at least one clustering parameter matrix. For example, determining a clustering parameter matrix with the highest similarity from at least one similarity as the target clustering parameter matrix.
[0075] For example, a target clustering parameter matrix matching the guide feature is determined from at least one clustering parameter matrix by formula (1).
[0076]
[0077] Among them, k means taking the kth clustering parameter matrix as the target clustering parameter matrix; z′ cls represents the guiding feature; W i represents the i-th clustering parameter matrix; argmax() represents the function of finding the maximum independent variable; |||| represents the modulus.
[0078] According to an embodiment of the present disclosure, a target clustering parameter matrix matching the guide feature is determined by using a method for determining vector similarity. The method adopted is simple and universal, and can make the determined target clustering parameter matrix accurate and efficient.
[0079] According to an embodiment of the present disclosure, determining a target expert parameter matrix that matches a target clustering parameter matrix may include: determining a matching degree between the target clustering parameter matrix and at least one expert parameter matrix to obtain at least one matching degree. The at least one matching degree corresponds to the at least one expert parameter matrix. Based on the at least one matching degree, determining a target expert parameter matrix that matches the target clustering parameter matrix from the at least one expert parameter matrix. For example, determining an expert parameter matrix with the highest similarity from the at least one similarity as the target expert parameter matrix.
[0080] According to an exemplary embodiment of the present disclosure, determining a target expert parameter matrix that matches the target clustering parameter matrix may also include: determining a target expert parameter matrix that matches the target clustering parameter matrix from at least one expert parameter matrix based on a mapping relationship between the clustering parameter matrix and the expert parameter matrix.
[0081] According to an embodiment of the present disclosure, the clustering parameter matrix may be a matrix including adjustable parameters. The clustering parameter matrix may be obtained by training using the second image set. The multiple images in each second image set may be multiple images having common features. For example, multiple images acquired under the same lighting conditions, or multiple images acquired using the same attack method. By training the clustering parameter matrix using the second image set, the adjustable parameters in the clustering parameter matrix may be adjusted to retain the feature information acquired by learning the second image set.
[0082] According to an embodiment of the present disclosure, the clustering parameter matrix and the expert parameter matrix can be matrices with adjustable parameters. For example, the clustering parameter matrix includes common feature information of multiple images in the second image set. The expert parameter matrix includes knowledge information of multiple images in the first image set for live detection target objects.
[0083] It should be noted that the multiple images in the first image set and the multiple images in the second image set may be completely the same or completely different. The information type of the common feature information of the multiple images included in the clustering parameter matrix may be the same as or different from the information type of the knowledge information for the target object of liveness detection of the multiple images included in the expert parameter matrix.
[0084] According to the embodiments of the present disclosure, by utilizing the mapping relationship between the clustering parameter matrix and the expert parameter matrix, it is possible to address the problem of inaccurate similarity matching caused by the small similarity and weak correlation between the clustering parameter matrix and the expert parameter matrix, and the matching accuracy and efficiency are improved by the mapping relationship.
[0085] According to an exemplary embodiment of the present disclosure, a clustering parameter matrix and an expert parameter matrix may be trained using multiple training sample sets. The types of sample initial images of the multiple training sample sets are different. For example, the task set is D = {D 1 , D 2 , …, D T}, a task in the task collection is the tth training sample set. There are large differences between multiple training sample sets. represents the i-th sample image block sequence or sample initial image in the Dt training sample set, is the corresponding sample label, and nt is the total number of samples in the Dt training sample set.
[0086] According to an embodiment of the present disclosure, the training sample set D can be used t Train the clustering parameter matrix and expert parameter matrix to obtain the training sample set D t Matching clustering parameter matrix Wt and expert parameter matrix P t Then we get the task set D = {D 1 , D 2 , …, D T} matches the expert parameter matrix set P = {P 1 , P 2 ,…,P T} and the clustering parameter matrix set W = {W 1 , W 2 , …, W T}.
[0087] According to the embodiments of the present disclosure, the more types and the greater the number of available training sample sets, the larger the obtained expert parameter matrix set and clustering parameter matrix set will be, and thus the higher the accuracy of the liveness detection result will be.
[0088] Figure 3 The figure schematically shows a flow chart of determining a target expert parameter matrix according to another embodiment of the present disclosure.
[0089] like Figure 3 As shown, the initial image 310 including the target object is key-point aligned to obtain an aligned image. The aligned image is segmented to obtain an image block sequence 320. The image block sequence is input into the input encoding submodule M310 of the static feature extraction module to obtain a static feature 330. The static feature 330 and a predetermined classification token feature 340 (ClsToken) are input into the static feature extraction submodule M320 of the static feature extraction module to obtain a guide feature 350.
[0090] like Figure 3 As shown, the matching degree of the guiding feature 350 and the at least one clustering parameter matrix 360 is determined to obtain at least one matching degree. Based on the at least one matching degree, a target clustering parameter feature 361 matching the guiding feature 350 is determined. Based on the mapping relationship between the clustering parameter matrix and the expert parameter matrix, a target expert parameter matrix 371 matching the target clustering parameter feature 361 is determined from the at least one expert parameter matrix 370.
[0091] According to an embodiment of the present disclosure, the input encoding submodule of the static feature extraction module may be a network structure having feature extraction or encoding, such as a linear projection layer (Patch Embedding).
[0092] According to an embodiment of the present disclosure, the static feature extraction submodule of the static feature extraction module may include a vision encoder (Vision Transformer Encoder, ViT Encoder), but is not limited thereto, and may also be at least one stacked encoding module among a plurality of stacked encoding modules in the vision encoder. As long as it is a network structure capable of encoding in combination with static features and predetermined classification mark features.
[0093] According to the embodiments of the present disclosure, Figure 2 The operation S230 shown, determining the liveness detection result of the target object based on the image block sequence and the target expert parameter matrix, may include the following operations.
[0094] For example, based on the image block sequence, static features are obtained. Based on the static features, semantic features are obtained. Based on the semantic features, the guide features and the target expert parameter matrix, the liveness detection result of the target object is determined.
[0095] According to an embodiment of the present disclosure, obtaining a semantic feature based on a static feature may include: performing feature extraction on the static feature to obtain a semantic feature.
[0096] According to the embodiments of the present disclosure, the input encoding submodule of the static feature extraction module can be used to extract static features to obtain semantic features. The network structure of the input encoding submodule of the static feature extraction module is not limited. A network structure with feature extraction or encoding, such as a linear projection layer (Patch Embedding), can be used to extract features from an image block sequence to obtain static features. As long as it is a network structure that can use static features as input data and semantic features as output data, it will be fine.
[0097] According to other embodiments of the present disclosure, the liveness detection result of the target object may be determined based on the static features, the guide features, and the target expert parameter matrix.
[0098] Compared with the method of determining liveness detection results based on static features, semantic features are features extracted from static features, which are global and denoising, and thus the liveness detection results determined using semantic features are highly accurate.
[0099] According to an exemplary embodiment of the present disclosure, determining the liveness detection result of the target object based on the semantic features, the guiding features and the target expert parameter matrix may include: obtaining the target features based on the semantic features, the guiding features and the target expert parameter matrix. Based on the target features, determining the liveness detection result of the target object.
[0100] According to an embodiment of the present disclosure, obtaining target features based on semantic features, guiding features and a target expert parameter matrix may include: inputting the semantic features, guiding features and the target expert parameter matrix into a dynamic incremental feature extraction module to obtain the target features.
[0101] According to an embodiment of the present disclosure, the dynamic incremental feature extraction module may include a vision encoder (Vision Transformer Encoder, ViT Encoder), but is not limited thereto, and may also include at least one stacked encoding module among a plurality of stacked encoding modules in the vision encoder. As long as it is a network structure that can encode in combination with semantic features, guided features, and a target expert parameter matrix.
[0102] According to an embodiment of the present disclosure, determining the liveness detection result of the target object based on the target feature may include: inputting the target feature into a classification module to obtain the liveness detection result of the target object. The classification module may be a network structure with a binary classification function, such as a fully connected layer and an activation function. However, it is not limited to this. As long as it is a network structure that can play a classification role, it can be used.
[0103] According to the embodiments of the present disclosure, the liveness detection model can be used to perform the liveness detection method provided by the embodiments of the present disclosure. The liveness detection model includes a static feature extraction module, a dynamic feature extraction module, a classification module, at least one clustering parameter matrix and at least one expert parameter matrix. The static feature extraction module includes an input encoding submodule and a static feature extraction submodule. The specific processing method can refer to Figure 4 The process shown.
[0104] Figure 4 The figure schematically shows a flow chart of a living body detection method according to another embodiment of the present disclosure.
[0105] like Figure 4 As shown, the image block sequence 410 is input into the input encoding submodule M411 of the static feature extraction module to obtain the static feature 420. The static feature 420 and the predetermined classification mark feature 430 are input into the static feature extraction submodule M412 of the static feature extraction module to obtain the guide feature 440. The static feature 420 is input into the static feature extraction submodule M412 to obtain the semantic feature 450. The target clustering parameter matrix M420 matching the guide feature 440 is determined. The target expert parameter matrix M430 matching the target clustering parameter matrix M420 is determined. The semantic feature 450, the guide feature 440 and the target expert parameter matrix M430 are input into the dynamic incremental feature extraction module M440 to obtain the target feature. The target feature is input into the classification module M450 to obtain the liveness detection result 460 of the target object.
[0106] According to the embodiments of the present disclosure, the parameters of the static feature extraction module, the dynamic feature extraction module, and the classification module in the liveness detection model may not be adjusted during the optimization training process. Instead, the knowledge information of the new attack mode in the sample image set is recorded in a new clustering parameter matrix and an expert parameter matrix by utilizing optimization training. By adjusting the adjustable parameters in the clustering parameter matrix and the expert parameter matrix, a new clustering parameter matrix and a new expert parameter matrix matching the sample image set are obtained. Thus, without affecting the knowledge information learned by the static feature extraction module, the dynamic feature extraction module, and the classification module of the original liveness detection model, a small amount of parameters in the clustering parameter matrix and the expert parameter matrix are updated to improve the recognition ability of the liveness detection model for new attack images, thereby achieving rapid optimization of the liveness detection model and improving the maintenance and optimization efficiency of the liveness detection system.
[0107] According to an embodiment of the present disclosure, when the parameters in the expert parameter matrix in the liveness detection model are adjustable parameters, the training method of the liveness detection model can be adopted as follows: Figure 5 The training method of the deep learning model shown in the figure is not limited to this. Any training method of the deep learning model including the expert parameter matrix will suffice.
[0108] Figure 5 A flowchart of a deep learning model training method according to an embodiment of the present disclosure is schematically shown.
[0109] like Figure 5 As shown, the deep learning model includes a static feature extraction module and at least one expert parameter matrix, and the method includes operations S510 to S540.
[0110] In operation S510, a sample image block sequence about a target object is input into a static feature extraction module to obtain a sample guiding feature.
[0111] In operation S520, a target expert parameter matrix matching the sample guiding feature is determined from at least one expert parameter matrix. The target expert parameter matrix includes knowledge information for detecting a target object.
[0112] In operation S530, a sample liveness detection result of the target object is determined based on the sample image block sequence and the target expert parameter matrix.
[0113] In operation S540, based on the sample liveness detection result and the sample label matching the sample image block sequence, the parameters of the target expert parameter matrix are adjusted to obtain a trained deep learning model.
[0114] According to the embodiments of the present disclosure, multiple images taken at different times may be sorted according to the time of taking the images to obtain a sample image block sequence. Multiple images cut from one image may also be sorted according to the cutting orientation to obtain a sample image block sequence. Any sample image block sequence may be used as long as it includes the target object.
[0115] According to an embodiment of the present disclosure, the target object may include at least one of the following: face, limbs, or body.
[0116] According to an embodiment of the present disclosure, a sample liveness detection result can be used to characterize whether a sample image block sequence is obtained based on a real or live target object. For example, when the sample liveness detection result characterizes that the sample image block sequence is a live image, it means that the sample image block sequence is obtained based on a real target object. For another example, when the sample liveness detection result characterizes that the sample image block sequence is a forged image or an attack image, it means that the sample image block sequence is obtained based on a forged target object. A forged target object may refer to a sample image block sequence obtained by collecting an image, video or three-dimensional model including a target object.
[0117] According to the embodiments of the present disclosure, the sample labels matched with the sample image block sequences can also be used to characterize whether the sample image block sequences are obtained based on real or living target objects. The sample liveness detection results are the prediction results obtained by using the deep learning model based on the sample image block sequences and the target expert parameter matrix. The sample labels are the real results of the annotations.
[0118] According to an embodiment of the present disclosure, based on the sample liveness detection result and the sample label matching the sample image block sequence, the parameters of the target expert parameter matrix are adjusted to obtain a trained deep learning model, which may include: the expert parameter matrix may be a matrix including adjustable parameters. The parameters of the target expert parameter matrix are adjusted so that the sample liveness detection result output by the trained deep learning model is closer and closer to the sample label, for example, so that the sample liveness detection result output by the trained deep learning model is closer to the real result.
[0119] According to the embodiments of the present disclosure, the deep learning model can be trained by incremental learning. For example, except for the adjustable parameters of the target expert parameter matrix in the deep learning model, other parameters of the deep learning model, such as the parameters in the static feature extraction module, are fixed. The deep learning model can be a pre-trained model. The pre-trained model is a model trained with open source data and has the ability to detect liveness.
[0120] According to an embodiment of the present disclosure, during the training process, the deep learning model may be trained using an incremental learning training method, for example, only adjusting the parameters of the target expert parameter matrix.
[0121] According to other embodiments of the present disclosure, during the training process, the parameters of the target expert parameter matrix and other parameters of the deep learning model, such as parameters in the static feature extraction module, may also be adjusted.
[0122] Compared with the training method that uses the parameters of the target expert parameter matrix and other parameters of the deep learning model, such as the parameters in the static feature extraction module, the training method using incremental learning can use other parameters in the deep learning model to retain the knowledge information learned from the historical training data and avoid the forgetting problem. In addition, the target expert parameter matrix can also be used to learn new attack data, thereby quickly mastering the ability to identify new attacks. This allows the trained deep learning model to be applied to the liveness detection method, improve the liveness detection performance, and improve the optimization efficiency of the liveness detection system.
[0123] According to an embodiment of the present disclosure, the static feature extraction module includes an input encoding submodule and a static feature extraction submodule.
[0124] According to the embodiments of the present disclosure, Figure 5 Operation S510 shown, inputting a sample image block sequence about a target object into a static feature extraction module, and obtaining sample guiding features may include the following operations.
[0125] For example, the sample image block sequence is input into the input encoding submodule to obtain the sample static features. The sample static features and the predetermined sample classification mark features are input into the static feature extraction submodule to obtain the sample guide features.
[0126] According to an embodiment of the present disclosure, the sample guided feature is a feature obtained based on a sample image block sequence, and the sample guided feature includes a feature in the sample image block sequence that is used to match a target expert parameter matrix.
[0127] According to an embodiment of the present disclosure, the predetermined classification mark features may include additional input features for reference, such as category features.
[0128] According to other embodiments of the present disclosure, sample static features may be directly used as sample guiding features, as long as they are features extracted from a sample image block sequence.
[0129] Compared with directly using sample static features as sample guiding features, obtaining sample guiding features based on sample static features and predetermined classification label features can make the sample guiding features contain additional input guiding features for reference, thereby making the target expert parameter matrix determined using the sample guiding features fast and accurate, avoiding the problem of inaccurate target expert parameter matrix determined due to too much noise.
[0130] According to an embodiment of the present disclosure, the deep learning model also includes at least one clustering parameter matrix.
[0131] According to the embodiments of the present disclosure, Figure 5 The operation S520 shown, determining a target expert parameter matrix that matches the sample guided features, may include the following operations.
[0132] For example, a target clustering parameter matrix matching the sample guide feature is determined from at least one clustering parameter matrix, and a target expert parameter matrix matching the target clustering parameter matrix is determined.
[0133] According to an embodiment of the present disclosure, the target clustering parameter matrix includes feature information that matches the sample image block sequence.
[0134] According to the embodiments of the present disclosure, it is possible to utilize a target clustering parameter matrix that matches the sample guiding features to establish a correlation relationship between the sample guiding features and the target expert parameter matrix, which can be applicable to expert parameter matrices from different sources, thereby widening the scope of application of determining the target expert parameter matrix.
[0135] According to an embodiment of the present disclosure, determining a target clustering parameter matrix that matches a sample guiding feature from at least one clustering parameter matrix may include the following operations.
[0136] For example, the matching degree of the sample guiding feature and at least one clustering parameter matrix is determined to obtain at least one sample matching degree. Based on the at least one sample matching degree, a target clustering parameter matrix matching the sample guiding feature is determined from at least one clustering parameter matrix. For example, the sample similarity is determined to be the highest from at least one sample similarity, and the clustering parameter matrix with the highest sample similarity is used as the target clustering parameter matrix.
[0137] According to an embodiment of the present disclosure, a target clustering parameter matrix matching the guide feature is determined by using a method for determining vector similarity. The method adopted is simple and universal, and can make the determined target clustering parameter matrix accurate and efficient.
[0138] According to an exemplary embodiment of the present disclosure, a predetermined initial clustering parameter matrix may also be directly used as a target clustering parameter matrix. For example, an initial clustering parameter matrix including initial parameters may be used as a target clustering parameter matrix.
[0139] Compared with the method of using the initial clustering parameter matrix as the target clustering parameter matrix, the method of using the clustering parameter matrix matching the guide features as the target clustering parameter matrix can reduce the number of parameters of the target clustering parameter matrix and increase the iteration speed during the training process, thereby improving the training efficiency.
[0140] According to an embodiment of the present disclosure, determining a target expert parameter matrix that matches a target clustering parameter matrix may include: determining a target expert parameter matrix that matches the target clustering parameter matrix from at least one expert parameter matrix based on a mapping relationship between clustering parameter matrices and expert parameter matrices.
[0141] According to an embodiment of the present disclosure, the clustering parameter matrix and the expert parameter matrix can be matrices with adjustable parameters respectively. The mapping relationship between the clustering parameter matrix and the expert parameter matrix can be established through a training sample set. For example, the clustering parameter matrix and the expert parameter matrix obtained by training with the same training sample set have a mapping relationship between the two.
[0142] According to an embodiment of the present disclosure, a mapping relationship between a clustering parameter matrix and an expert parameter matrix is used to determine a target expert parameter matrix, and a determination method is combined with a training method to improve matching efficiency while simplifying operations.
[0143] According to an exemplary embodiment of the present disclosure, a predetermined initial expert parameter matrix may be directly used as a target expert parameter matrix. For example, an initial expert parameter matrix including initial parameters may be used as a target expert parameter matrix.
[0144] Compared with the method of using the initial expert parameter matrix as the target expert parameter matrix, the method of using the expert parameter matrix matching the target clustering parameter matrix as the target expert parameter matrix can reduce the number of parameters of the target expert parameter matrix and increase the iteration speed during the training process, thereby improving the training efficiency.
[0145] According to the embodiments of the present disclosure, Figure 5 Operation S540 shown, using the sample liveness detection results and the sample labels matching the sample image block sequence, adjusts the parameters of the target expert parameter matrix to obtain a trained deep learning model, which may include the following operations.
[0146] For example, the sample guide feature and the target clustering parameter matrix are input into the first loss function to obtain a first loss value. The sample liveness detection result and the sample label are input into the second loss function to obtain a second loss function value. Based on the first loss value and the second loss value, the parameters of the target expert parameter matrix and the target clustering parameter matrix are adjusted to obtain a trained deep learning model.
[0147] According to an embodiment of the present disclosure, the first loss function may adopt a cosine similarity loss function, for example, as shown in formula (2). However, it is not limited thereto. Other types of loss functions may also be adopted. As long as the first loss function can be used as a reference to adjust the parameters in the clustering parameter matrix.
[0148]
[0149] Among them, L w represents the first loss value; z cls represents the sample guidance feature; W t represents the target clustering parameter matrix that matches the sample guidance features; |||| represents the modulus.
[0150] According to an embodiment of the present disclosure, the second loss function may adopt a classification loss function, for example, as shown in formula (3). However, it is not limited thereto. Other types of loss functions may also be adopted, as long as the second loss function can be used as a reference to adjust the parameters in the expert parameter matrix.
[0151]
[0152] Among them, L ce represents the second loss value; y represents the sample label; Represents the sample liveness detection result; CE() represents the cross entropy function.
[0153] According to an embodiment of the present disclosure, adjusting the parameters of the target expert parameter matrix and the target clustering parameter matrix based on the first loss value and the second loss value to obtain a trained deep learning model may include: performing weighted summation on the first loss value and the second loss value to obtain a target loss value. Adjusting the parameters of the target expert parameter matrix and the target clustering parameter matrix based on the target loss value until the model meets the training conditions, and using the model that meets the training conditions as the trained deep learning model.
[0154] According to an embodiment of the present disclosure, the training condition may refer to the training rounds reaching a predetermined round threshold or the target loss value reaching convergence.
[0155] According to an embodiment of the present disclosure, the first loss value and the second loss value may be weightedly summed according to the following formula (4) to obtain a target loss value.
[0156] L=AL w +BL ce ;Formula (4)
[0157] Among them, L w Represents the first loss value; L ce represents the second loss value; L represents the target loss value; A and B represent weights respectively.
[0158] According to an embodiment of the present disclosure, a deep learning model is trained using a first loss function and a second loss function, and respective parameters in a clustering parameter matrix and an expert parameter matrix are adjusted, so that the clustering parameter matrix can characterize characteristic cluster centers of a training sample set, and the expert parameter matrix can learn knowledge of new attacks or forgeries in the training sample set, such as knowledge of liveness detection for identifying a target object.
[0159] According to an embodiment of the present disclosure, in Figure 5 Before the operation S510 shown, the training method of the deep learning model may further include the following operations.
[0160] For example, a target training sample set is determined from multiple training sample sets. Key point alignment is performed on sample initial images in the target training sample set to obtain aligned sample images. The aligned sample images are segmented to obtain a sample image block sequence.
[0161] According to an embodiment of the present disclosure, key point alignment is performed on an initial sample image including a target object to obtain an aligned sample image, which may include: position detection of key feature points of the sample to obtain multiple key parts of the sample; geometric correction of the multiple key parts of the sample, such as scaling, rotation, stretching and other transformations to obtain an aligned sample image.
[0162] According to an embodiment of the present disclosure, the position detection of the key feature points of the sample can be performed using a local detector or regressor for processing images, but it is not limited to this, as long as the network structure can identify the key feature points of the sample.
[0163] According to an embodiment of the present disclosure, segmenting the aligned sample image to obtain a sample image block sequence may include: segmenting the aligned sample image according to a predetermined segmentation size, such as an image size of 224x224, to obtain a plurality of sample images. Arranging the plurality of sample images according to a predetermined position arrangement order to obtain a sample image block sequence.
[0164] According to the embodiments of the present disclosure, by utilizing the operation of key point alignment, the target object in the sample initial image can be made standard and regular, which is beneficial for subsequent living body detection and thus improves the training efficiency.
[0165] According to an exemplary embodiment of the present disclosure, the types of sample initial images of each of the multiple training sample sets are different. For example, the task set is D={D 1 , D 2 , …, D T}, a task in the task collection is the tth training sample set. There are large differences between multiple training sample sets. Indicates Dt The i-th sample image block sequence or sample initial image in the training sample set, is the corresponding sample label, nt is D t The total number of samples in the training sample set.
[0166] According to an embodiment of the present disclosure, the training sample set D can be used t Train the deep learning model and obtain the training sample set D t The matching clustering parameter matrix W t And the expert parameter matrix Pt. Then we get the task set D = {D 1 , D 2 , …, D T} matches the expert parameter matrix set P = {P 1 , P 2 ,…,P T} and the clustering parameter matrix set W = {W 1 , W 2 , …, W T}.
[0167] By using the incremental learning method provided by the embodiment of the present disclosure, when a new training sample set is added, the parameters in the target clustering parameter matrix can be adjusted to obtain a new clustering parameter matrix that matches the new training sample set. By adjusting the parameters in the target expert parameter matrix, a new expert parameter matrix that matches the new training sample set is obtained. The cluster feature centers that match the new training sample set are retained through the new clustering parameter matrix. The knowledge information for liveness detection that matches the new training sample set is retained through the new expert parameter matrix. This enables the deep learning model to master new attack knowledge while avoiding forgetting historical attack knowledge.
[0168] According to an embodiment of the present disclosure, the deep learning model also includes a dynamic incremental feature extraction module and a classification module.
[0169] According to the embodiments of the present disclosure, Figure 5 Operation S530 shown, determining a sample liveness detection result of a target object based on a sample image block sequence and a sample target expert parameter matrix, may include the following operations.
[0170] For example, the sample image block sequence is input into the input encoding submodule to obtain the sample static features. The sample static features are input into the static feature extraction submodule to obtain the sample semantic features. The sample semantic features, sample guide features and target expert parameter matrix are input into the dynamic incremental feature extraction module to obtain the sample target features. The sample target features are input into the classification module to obtain the sample liveness detection results of the target object.
[0171] According to an embodiment of the present disclosure, the dynamic incremental feature extraction module may include a vision encoder (Vision Transformer Encoder, ViT Encoder), but is not limited thereto, and may also include at least one stacked encoding module among a plurality of stacked encoding modules in the vision encoder. As long as it is a network structure that can encode in combination with sample semantic features, sample guided features, and target expert parameter matrices.
[0172] According to the embodiments of the present disclosure, the classification module may be a network structure having a binary classification function, such as a fully connected layer and an activation function, but is not limited thereto, as long as it is a network structure that can perform a classification function.
[0173] According to an embodiment of the present disclosure, a liveness detection model can be used to perform the liveness detection method provided by the embodiment of the present disclosure. The liveness detection model includes a static feature extraction module, a dynamic feature extraction module, a classification module, at least one clustering parameter matrix, and at least one expert parameter matrix. During the training process, the adjustable parameters of the target clustering parameter matrix and the target expert parameter matrix can be adjusted to obtain a new clustering parameter matrix and a new expert parameter matrix, so as to realize incremental learning using the new clustering parameter matrix and the new expert parameter matrix.
[0174] Figure 6 A flowchart of a method for training a deep learning model according to another embodiment of the present disclosure is schematically shown.
[0175] like Figure 6 As shown, the sample image block sequence X is input into the input encoding submodule fe to obtain the sample static feature x e . The static feature x of the sample e Input into the static feature extraction submodule fs to obtain the sample semantic feature z e . The sample static feature x e and the predetermined sample classification label feature x cls Input to the static feature extraction submodule f s In the above example, we get the sample guide feature z cls . Determine the sample bootstrap feature z cls The matching target clustering parameter matrix W t . Determine the target clustering parameter matrix W t Matching target expert parameter matrix P t . The sample semantic feature z e , sample guide feature z cls and the target expert parameter matrix P t Input to the dynamic incremental feature extraction module f dThe sample target feature is obtained. The sample target feature is input into the classification module fc to obtain the sample liveness detection result y1 of the target object. Based on the sample liveness detection result y1, sample label y2, and sample guide feature z cl s and the target clustering parameter matrix z cl s, adjust the target clustering parameter matrix W t and the target expert parameter matrix P t The respective parameters are used to obtain the trained deep learning model.
[0176] Figure 7 The block diagram of a living body detection device according to an embodiment of the present disclosure is schematically shown.
[0177] like Figure 7 As shown, the living body detection device 700 includes: an extraction module 710 , a first determination module 720 and a second determination module 730 .
[0178] The extraction module 710 is used to process the image block sequence related to the target object to obtain the guiding features.
[0179] The first determination module 720 is used to determine a target expert parameter matrix that matches the guidance feature, wherein the target expert parameter matrix includes knowledge information for detecting the target object.
[0180] The second determination module 730 is used to determine the liveness detection result of the target object based on the image block sequence and the target expert parameter matrix.
[0181] According to an embodiment of the present disclosure, the first determination module includes: a first determination submodule and a second determination submodule.
[0182] The first determination submodule is used to determine a target clustering parameter matrix that matches the guide feature, wherein the target clustering parameter matrix includes feature information that matches the image block sequence.
[0183] The second determination submodule is used to determine a target expert parameter matrix that matches the target clustering parameter matrix.
[0184] According to an embodiment of the present disclosure, the first determining submodule includes: a first determining unit and a second determining unit.
[0185] The first determination unit is used to determine the matching degree between the guiding feature and at least one clustering parameter matrix to obtain at least one matching degree.
[0186] The second determining unit is used to determine a target clustering parameter matrix matching the guiding feature from at least one clustering parameter matrix based on at least one matching degree.
[0187] According to an embodiment of the present disclosure, the second determining submodule includes: a third determining unit.
[0188] The third determining unit is used to determine a target expert parameter matrix matching the target clustering parameter matrix from at least one expert parameter matrix based on a mapping relationship between the clustering parameter matrix and the expert parameter matrix.
[0189] According to an embodiment of the present disclosure, the extraction module includes: a first extraction submodule and a second extraction submodule.
[0190] The first extraction submodule is used to obtain static features based on the image block sequence.
[0191] The second extraction submodule is used to obtain the guiding feature based on the static feature and the predetermined classification mark feature.
[0192] According to an embodiment of the present disclosure, the second determination module includes: a third extraction submodule, a fourth extraction submodule and a third determination submodule.
[0193] The third extraction submodule is used to obtain static features based on the image block sequence.
[0194] The fourth extraction submodule is used to obtain semantic features based on static features.
[0195] The third determination submodule is used to determine the liveness detection result of the target object based on the semantic features, the guide features and the target expert parameter matrix.
[0196] According to an embodiment of the present disclosure, the third determining submodule includes: a first extracting unit and a fourth determining unit.
[0197] The first extraction unit is used to obtain target features based on semantic features, guide features and a target expert parameter matrix.
[0198] The fourth determining unit is used to determine a liveness detection result of the target object based on the target feature.
[0199] According to an embodiment of the present disclosure, the living body detection device further includes: an alignment module and a segmentation module.
[0200] The alignment module is used to align key points of an initial image including a target object to obtain an aligned image.
[0201] The segmentation module is used to segment the aligned image to obtain a sequence of image blocks.
[0202] Figure 8 A block diagram of a deep learning model training device according to an embodiment of the present disclosure is schematically shown.
[0203] like Figure 8As shown, the training device 800 for the deep learning model includes: an input module 810, a third determination module 820, a fourth determination module 830 and a parameter adjustment module 840.
[0204] According to an embodiment of the present disclosure, the deep learning model includes a static feature extraction module and at least one expert parameter matrix.
[0205] The input module 810 is used to input a sample image block sequence about the target object into the static feature extraction module to obtain a sample guiding feature.
[0206] The third determination module 820 is used to determine a target expert parameter matrix that matches the sample guiding feature from at least one expert parameter matrix, wherein the target expert parameter matrix includes knowledge information for detecting the target object.
[0207] The fourth determination module 830 is used to determine the sample liveness detection result of the target object based on the sample image block sequence and the target expert parameter matrix.
[0208] The parameter adjustment module 840 is used to adjust the parameters of the target expert parameter matrix based on the sample liveness detection results and the sample labels matching the sample image block sequence to obtain a trained deep learning model.
[0209] According to an embodiment of the present disclosure, the deep learning model further includes at least one clustering parameter matrix;
[0210] According to an embodiment of the present disclosure, the third determination module includes: a fourth determination submodule and a fifth determination submodule.
[0211] The fourth determination submodule is used to determine a target clustering parameter matrix that matches the sample guiding feature from at least one clustering parameter matrix, wherein the target clustering parameter matrix includes feature information that matches the sample image block sequence.
[0212] The fifth determination submodule is used to determine a target expert parameter matrix that matches the target clustering parameter matrix.
[0213] According to an embodiment of the present disclosure, the parameter adjustment module includes: a first input submodule, a second input submodule and a parameter adjustment submodule.
[0214] The first input submodule is used to input the sample guide feature and the target clustering parameter matrix into the first loss function to obtain a first loss value.
[0215] The second input submodule is used to input the sample liveness detection result and the sample label into the second loss function to obtain the second loss function value.
[0216] The parameter adjustment submodule is used to adjust the parameters of the target expert parameter matrix and the target clustering parameter matrix based on the first loss value and the second loss value to obtain a trained deep learning model.
[0217] According to an embodiment of the present disclosure, the training device of the deep learning model also includes: a fifth determination module, a sample alignment module and a sample segmentation module.
[0218] The fifth determination module is used to determine a target training sample set from multiple training sample sets, wherein each training sample set includes multiple sample initial images and sample labels matching the sample initial images, and the sample initial images of the multiple training sample sets are of different types.
[0219] The sample alignment module is used to align key points of the sample initial images in the target training sample set to obtain aligned sample images.
[0220] The sample segmentation module is used to segment the aligned sample images to obtain a sequence of sample image blocks.
[0221] According to an embodiment of the present disclosure, the fourth determining submodule includes: a fifth determining unit and a sixth determining unit.
[0222] The fifth determination unit is used to determine the matching degree between the sample guiding feature and at least one clustering parameter matrix to obtain at least one sample matching degree.
[0223] The sixth determination unit is used to determine a target clustering parameter matrix that matches the sample guiding feature from at least one clustering parameter matrix based on at least one sample matching degree.
[0224] According to an embodiment of the present disclosure, the fifth determining submodule includes: a seventh determining unit.
[0225] A seventh determining unit is configured to determine, based on a mapping relationship between clustering parameter matrices and expert parameter matrices, a target expert parameter matrix that matches the target clustering parameter matrix from at least one expert parameter matrix.
[0226] According to an embodiment of the present disclosure, the static feature extraction module includes an input encoding submodule and a static feature extraction submodule.
[0227] According to an embodiment of the present disclosure, the input module includes: a third input submodule and a fourth input submodule.
[0228] The third input submodule is used to input the sample image block sequence into the input encoding submodule to obtain the sample static features.
[0229] The fourth input submodule is used to input the sample static features and the predetermined sample classification mark features into the static feature extraction submodule to obtain the sample guiding features.
[0230] According to an embodiment of the present disclosure, the deep learning model also includes a dynamic incremental feature extraction module and a classification module.
[0231] According to an embodiment of the present disclosure, the fourth determination module includes: a fifth input submodule, a sixth input submodule, a seventh input submodule and a sixth determination submodule.
[0232] The fifth input submodule is used to input the sample image block sequence into the input encoding submodule to obtain the sample static features.
[0233] The sixth input submodule is used to input the sample static features into the static feature extraction submodule to obtain the sample semantic features.
[0234] The seventh input submodule is used to input the sample semantic features, sample guide features and target expert parameter matrix into the dynamic incremental feature extraction module to obtain the sample target features.
[0235] The sixth determination submodule is used to input the sample target features into the classification module to obtain the sample liveness detection result of the target object.
[0236] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
[0237] According to an embodiment of the present disclosure, an electronic device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute a method as in the embodiment of the present disclosure.
[0238] According to an embodiment of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause a computer to execute a method as described in an embodiment of the present disclosure.
[0239] According to an embodiment of the present disclosure, a computer program product includes a computer program, and when the computer program is executed by a processor, the method according to the embodiment of the present disclosure is implemented.
[0240] Fig. 9A schematic block diagram of an example electronic device 900 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0241] like Fig. 9 As shown, the device 900 includes a computing unit 901, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 902 or a computer program loaded from a storage unit 908 into a random access memory (RAM) 903. In the RAM 903, various programs and data required for the operation of the device 900 can also be stored. The computing unit 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.
[0242] A number of components in the device 900 are connected to the I / O interface 905, including: an input unit 906, such as a keyboard, a mouse, etc.; an output unit 907, such as various types of displays, speakers, etc.; a storage unit 908, such as a disk, an optical disk, etc.; and a communication unit 909, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 909 allows the device 900 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0243] The computing unit 901 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 901 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 901 performs the various methods and processes described above, such as a liveness detection method. For example, in some embodiments, the liveness detection method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 908. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 900 via the ROM 902 and / or the communication unit 909. When the computer program is loaded into the RAM 903 and executed by the computing unit 901, one or more steps of the liveness detection method described above may be performed. Alternatively, in other embodiments, the computing unit 901 may be configured to perform the liveness detection method in any other appropriate manner (e.g., by means of firmware).
[0244] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0245] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0246] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0247] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0248] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0249] A computer system may include a client and a server. The client and the server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises through computer programs running on respective computers and having a client-server relationship to each other. The server may be a cloud server, a server in a distributed system, or a server combined with a blockchain.
[0250] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0251] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A method for detecting a living body, comprising: Extracting features from a sequence of image blocks related to a target object to obtain guiding features, wherein the guiding features include features in the sequence of image blocks that are used to match a target expert parameter matrix; Determining a target expert parameter matrix that matches the guide feature, wherein the target expert parameter matrix includes knowledge information for detecting the target object; and Determining a liveness detection result of the target object based on the image block sequence and the target expert parameter matrix; Wherein, determining the liveness detection result of the target object based on the image block sequence and the target expert parameter matrix includes: Extracting features from the image block sequence to obtain static features; Based on the static features, a semantic feature is obtained; Obtaining a target feature based on the semantic feature, the guide feature and the target expert parameter matrix; and The target features are classified to determine a liveness detection result of the target object.
2. The method according to claim 1, wherein: The step of determining a target expert parameter matrix matching the guiding feature comprises: Determining a target clustering parameter matrix that matches the guide feature, wherein the target clustering parameter matrix includes feature information that matches the image block sequence; and The target expert parameter matrix that matches the target clustering parameter matrix is determined.
3. The method according to claim 2, wherein: The step of determining a target clustering parameter matrix that matches the guiding feature comprises: Determining a degree of match between the guiding feature and at least one clustering parameter matrix to obtain at least one degree of match; Based on the at least one matching degree, the target clustering parameter matrix matching the guiding feature is determined from the at least one clustering parameter matrix.
4. The method according to claim 2, wherein: The determining the target expert parameter matrix that matches the target clustering parameter matrix comprises: Based on the mapping relationship between the clustering parameter matrix and the expert parameter matrix, the target expert parameter matrix matching the target clustering parameter matrix is determined from at least one expert parameter matrix.
5. The method according to claim 1, wherein: The step of extracting features from a sequence of image blocks related to the target object to obtain guiding features includes: Extracting features from the image block sequence to obtain static features; and The guiding feature is obtained based on the static feature and a predetermined classification mark feature.
6. The method according to any one of claims 1 to 5, further comprising: Performing key point alignment on an initial image including the target object to obtain an aligned image; as well as The aligned image is segmented to obtain the image block sequence.
7. A method for training a deep learning model, wherein: The deep learning model includes a static feature extraction module, a dynamic incremental feature extraction module, a classification module and at least one expert parameter matrix, and the method includes: Inputting a sample image block sequence of the target object into the static feature extraction module to obtain a sample guide feature; Determining a target expert parameter matrix that matches the sample guided feature from the at least one expert parameter matrix, wherein the target expert parameter matrix includes knowledge information for detecting the target object; Determining a sample liveness detection result of the target object based on the sample image block sequence and the target expert parameter matrix; and Based on the sample liveness detection result and the sample label matching the sample image block sequence, adjusting the parameters of the target expert parameter matrix to obtain a trained deep learning model; The step of determining the sample liveness detection result of the target object based on the sample image block sequence and the target expert parameter matrix includes: Inputting the sample image block sequence into the input encoding submodule to obtain sample static features; Inputting the sample static features into the static feature extraction submodule to obtain sample semantic features; Inputting the sample semantic features, the sample guiding features and the target expert parameter matrix into the dynamic incremental feature extraction module to obtain sample target features; and The sample target feature is input into the classification module to obtain the sample liveness detection result of the target object.
8. The method according to claim 7, wherein: The deep learning model also includes at least one clustering parameter matrix; The step of determining a target expert parameter matrix that matches the sample guide feature comprises: Determining a target clustering parameter matrix that matches the sample guiding feature from the at least one clustering parameter matrix, wherein the target clustering parameter matrix includes feature information that matches the sample image block sequence; and The target expert parameter matrix that matches the target clustering parameter matrix is determined.
9. The method according to claim 8, wherein: The adjusting the parameters of the target expert parameter matrix based on the sample liveness detection result and the sample label matching the sample image block sequence to obtain a trained deep learning model includes: Inputting the sample guide feature and the target clustering parameter matrix into a first loss function to obtain a first loss value; Inputting the sample liveness detection result and the sample label into a second loss function to obtain a second loss value; and Based on the first loss value and the second loss value, the parameters of the target expert parameter matrix and the target clustering parameter matrix are adjusted to obtain the trained deep learning model.
10. The method according to claim 7, further comprising: Determining a target training sample set from a plurality of training sample sets, wherein each of the training sample sets includes a plurality of sample initial images and sample labels matching the sample initial images, and the sample initial images of the plurality of training sample sets are of different types; Performing key point alignment on sample initial images in the target training sample set to obtain aligned sample images; and The aligned sample image is segmented to obtain the sample image block sequence.
11. The method according to claim 8, wherein: The determining the target clustering parameter matrix matching the sample guiding feature from the at least one clustering parameter matrix comprises: Determining the matching degree of the sample guiding feature and the at least one clustering parameter matrix respectively to obtain at least one sample matching degree; Based on the at least one sample matching degree, the target clustering parameter matrix matching the sample guiding feature is determined from the at least one clustering parameter matrix.
12. The method according to claim 8, wherein: The determining the target expert parameter matrix that matches the target clustering parameter matrix comprises: Based on the mapping relationship between the clustering parameter matrix and the expert parameter matrix, the target expert parameter matrix matching the target clustering parameter matrix is determined from at least one expert parameter matrix.
13. The method according to claim 7, wherein: The static feature extraction module includes an input encoding submodule and a static feature extraction submodule; The step of inputting a sample image block sequence of the target object into the static feature extraction module to obtain a sample guide feature comprises: Inputting the sample image block sequence into the input encoding submodule to obtain sample static features; and The sample static feature and the predetermined sample classification mark feature are input into the static feature extraction submodule to obtain the sample guiding feature.
14. A living body detection device, comprising: An extraction module, configured to extract features from an image block sequence of a target object to obtain guiding features, wherein the guiding features include features in the image block sequence that are used to match a target expert parameter matrix; A first determination module is used to determine a target expert parameter matrix that matches the guide feature, wherein the target expert parameter matrix includes knowledge information for detecting the target object; and A second determination module, used to determine a liveness detection result of the target object based on the image block sequence and the target expert parameter matrix; Wherein, the second determining module includes: A third extraction submodule is used to extract features from the image block sequence to obtain static features; a fourth extraction submodule, configured to obtain semantic features based on the static features; and A third determination submodule, configured to determine a liveness detection result of the target object based on the semantic feature, the guide feature and the target expert parameter matrix; Wherein, the third determination submodule includes: A first extraction unit, configured to obtain a target feature based on the semantic feature, the guide feature and the target expert parameter matrix; and The fourth determination unit is used to classify the target features and determine the liveness detection result of the target object.
15. The device according to claim 14, wherein: The first determining module comprises: a first determination submodule, configured to determine a target clustering parameter matrix that matches the guide feature, wherein the target clustering parameter matrix includes feature information that matches the image block sequence; and The second determination submodule is used to determine the target expert parameter matrix that matches the target clustering parameter matrix.
16. The device according to claim 15, wherein: The first determining submodule includes: A first determination unit is used to determine the matching degree between the guiding feature and at least one clustering parameter matrix to obtain at least one matching degree; The second determining unit is configured to determine the target clustering parameter matrix matching the guiding feature from the at least one clustering parameter matrix based on the at least one matching degree.
17. The device according to claim 15, wherein: The second determining submodule includes: The third determining unit is configured to determine the target expert parameter matrix that matches the target clustering parameter matrix from at least one expert parameter matrix based on a mapping relationship between clustering parameter matrices and expert parameter matrices.
18. The device according to claim 14, wherein: The extraction module comprises: A first extraction submodule is used to extract features from the image block sequence to obtain static features; and The second extraction submodule is used to obtain the guiding feature based on the static feature and the predetermined classification mark feature.
19. The device according to any one of claims 14 to 18, further comprising: An alignment module, used for performing key point alignment on an initial image including the target object to obtain an aligned image; as well as A segmentation module is used to segment the aligned image to obtain the image block sequence.
20. A training device for a deep learning model, wherein: The deep learning model includes a static feature extraction module, a dynamic incremental feature extraction module, a classification module and at least one expert parameter matrix, and the device includes: An input module, used for inputting a sample image block sequence of a target object into the static feature extraction module to obtain a sample guide feature; A third determination module is used to determine a target expert parameter matrix that matches the sample guide feature from the at least one expert parameter matrix, wherein the target expert parameter matrix includes knowledge information for detecting the target object; a fourth determination module, configured to determine a sample liveness detection result of the target object based on the sample image block sequence and the target expert parameter matrix; and A parameter adjustment module, used to adjust the parameters of the target expert parameter matrix based on the sample liveness detection result and the sample label matching the sample image block sequence to obtain a trained deep learning model; Wherein, the fourth determination module includes: A fifth input submodule, used for inputting the sample image block sequence into the input encoding submodule to obtain sample static features; A sixth input submodule, used for inputting the sample static features into the static feature extraction submodule to obtain sample semantic features; a seventh input submodule, configured to input the sample semantic features, the sample guide features and the target expert parameter matrix into the dynamic incremental feature extraction module to obtain sample target features; and The sixth determination submodule is used to input the sample target feature into the classification module to obtain the sample liveness detection result of the target object.
21. The device according to claim 20, wherein: The deep learning model also includes at least one clustering parameter matrix; The third determination module comprises: a fourth determination submodule, configured to determine a target clustering parameter matrix matching the sample guiding feature from the at least one clustering parameter matrix, wherein the target clustering parameter matrix includes feature information matching the sample image block sequence; and The fifth determination submodule is used to determine the target expert parameter matrix that matches the target clustering parameter matrix.
22. The device according to claim 21, wherein The parameter adjustment module includes: A first input submodule, used for inputting the sample guide feature and the target clustering parameter matrix into a first loss function to obtain a first loss value; A second input submodule, configured to input the sample liveness detection result and the sample label into a second loss function to obtain a second loss value; and A parameter adjustment submodule is used to adjust the parameters of the target expert parameter matrix and the target clustering parameter matrix based on the first loss value and the second loss value to obtain the trained deep learning model.
23. The apparatus according to claim 20, further comprising: a fifth determination module, configured to determine a target training sample set from a plurality of training sample sets, wherein each of the training sample sets comprises a plurality of sample initial images and sample labels matching the sample initial images, and the sample initial images of the plurality of training sample sets are of different types; A sample alignment module, used to perform key point alignment on the sample initial images in the target training sample set to obtain aligned sample images; and The sample segmentation module is used to segment the aligned sample image to obtain the sample image block sequence.
24. The device according to claim 21, wherein The fourth determining submodule includes: a fifth determination unit, configured to determine a matching degree between the sample guiding feature and the at least one clustering parameter matrix, to obtain at least one sample matching degree; A sixth determination unit is used to determine the target clustering parameter matrix matching the sample guiding feature from the at least one clustering parameter matrix based on the at least one sample matching degree.
25. The device according to claim 21, wherein The fifth determining submodule comprises: A seventh determining unit is configured to determine, based on a mapping relationship between clustering parameter matrices and expert parameter matrices, the target expert parameter matrix that matches the target clustering parameter matrix from at least one expert parameter matrix.
26. The device according to claim 20, wherein: The static feature extraction module includes an input encoding submodule and a static feature extraction submodule; The input module comprises: A third input submodule, used for inputting the sample image block sequence into the input encoding submodule to obtain sample static features; and The fourth input submodule is used to input the sample static feature and the predetermined sample classification mark feature into the static feature extraction submodule to obtain the sample guiding feature.
27. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 13.
28. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 13.
