Fingerprint presentation attack detection method and device

Through the method of combining supervised comparative learning and K nearest neighbor algorithm, the problem of difficulty in detecting unseen fake fingerprints in the prior art is solved, and more efficient fake fingerprint recognition is achieved.

CN117152800BActive Publication Date: 2025-08-19PEKING UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311233527.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-21
Publication Date
2025-08-19
Estimated Expiration
2043-09-21

AI Technical Summary

Technical Problem

The existing classification-based fingerprint detection methods are difficult to accurately detect unseen forged fingerprints, resulting in the training classification boundaries that are not accurately identified when facing unseen forged fingerprints.

Method used

The supervised contrast learning method is used to train the feature extraction model, and the K nearest neighbor algorithm is used to determine the type of fingerprint image, and the live fingerprint or forged fingerprint is judged by Euclidean distance, enhancing the generalization ability of the model.

Benefits of technology

It significantly improves the detection ability of unseen forged fingerprints and enhances the detection accuracy of the model when distribution changes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117152800B_ABST
    Figure CN117152800B_ABST
Patent Text Reader

Abstract

The present application discloses a fingerprint presentation attack detection method and device. The method comprises: obtaining a target fingerprint image to be detected; extracting target features from the target fingerprint image using a pre-trained feature extraction model, wherein the feature extraction model is obtained by training live fingerprint image samples and forged fingerprint image samples using a supervised contrastive learning method; obtaining the first feature of all live fingerprint image samples extracted by the feature extraction model during the training process, and using the K-nearest neighbor algorithm to determine the second feature with the Kth closest Euclidean distance to the target feature among multiple first features; determining the type of the target fingerprint image based on the Euclidean distance between the target feature and the second feature, wherein the type of the target fingerprint image includes: a live fingerprint image or a forged fingerprint image. The present application solves the technical problem in the related art that fingerprint detection methods based on classification are difficult to accurately detect forged fingerprints that have never been encountered.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of fingerprint recognition technology, and more specifically, to a fingerprint presentation attack detection method and device. Background Art

[0002] Automated Fingerprint Identification Systems (AFIS) are currently widely used in a variety of scenarios. However, like other biometric technologies, AFIS can be easily compromised by counterfeit replicas made from inexpensive materials such as latex, gelatin, silicone, and plasticine. This means they are highly susceptible to spoofing attacks, also known as presentation attacks. Therefore, Fingerprint Presentation Attack Detection (FPAD) plays a crucial role in AFIS, ensuring that the system only analyzes and matches authentic fingerprints, resulting in more accurate and reliable identification results. In the software field, deep learning has established FPAD as the most commonly used paradigm for fingerprint detection.

[0003] However, the main challenge of FPAD is that fraudsters continue to introduce unseen forgery techniques and materials to produce forged fingerprints. Classification-based fingerprint detection methods commonly used in related technologies mainly use training set data to establish a classification boundary between live fingerprints and forged fingerprints. However, because these classification-based methods lack constraints on the distribution of features within a class (same PAD label) and between classes (different PAD labels), the learned PAD features have a dispersed within-class distribution and a minimal between-class boundary, making the classification boundary highly sensitive to perturbations in the data distribution. When faced with unseen forged fingerprints, the distribution difference between the test set and the training set makes the trained classification boundary unable to accurately detect unseen forged fingerprints.

[0004] To address the above-mentioned problems, no effective solutions have been proposed so far. Summary of the Invention

[0005] The embodiments of the present application provide a fingerprint presentation attack detection method and apparatus to at least solve the technical problem in related arts that classification-based fingerprint detection methods are difficult to accurately detect forged fingerprints that have never been encountered.

[0006] According to one aspect of an embodiment of the present application, a fingerprint presentation attack detection method is provided, comprising: obtaining a target fingerprint image to be detected; extracting target features from the target fingerprint image using a pre-trained feature extraction model, wherein the feature extraction model is trained on live fingerprint image samples and forged fingerprint image samples using a supervised contrastive learning method; obtaining a first feature of all live fingerprint image samples extracted by the feature extraction model during the training process, and determining a second feature whose Euclidean distance to the target feature is Kth closest among the multiple first features using a K-nearest neighbor algorithm; and determining a type of the target fingerprint image based on the Euclidean distance between the target feature and the second feature, wherein the type of the target fingerprint image includes: a live fingerprint image or a forged fingerprint image.

[0007] Optionally, the training process of the feature extraction model includes: constructing an initial model, wherein the initial model includes a first encoder and a second encoder, and the first encoder and the second encoder have the same structure, both including: a backbone network and a prediction head network; obtaining training samples and sample labels corresponding to each training sample, wherein the sample labels are used to mark whether the training samples are live fingerprint images or forged fingerprint images; inputting the training samples into the initial model in sequence for iterative training, and adjusting the model parameters of the initial model using the supervised contrastive learning loss function; after the training is completed, only the second encoder of the initial model is retained to obtain the feature extraction model.

[0008] Optionally, obtaining training samples and sample labels corresponding to each training sample includes: obtaining multiple fingerprint images and determining the type of each fingerprint image, wherein the type of fingerprint image includes: a live fingerprint image or a forged fingerprint image; for each fingerprint image, using a fingerprint recognition network to determine a preset number of key points in the fingerprint image, taking each key point as the center, intercepting a local fingerprint image of a preset size, and adjusting the direction of each local fingerprint image to be the same as the direction of the key point; using the multiple local fingerprint images obtained as training samples, and determining the sample labels corresponding to the local fingerprint images based on the type of the fingerprint image.

[0009] Optionally, the training samples are sequentially input into the initial model for iterative training, and the model parameters of the initial model are adjusted using the supervised contrastive learning loss function, including: in each training batch, the training samples of the training batch are respectively subjected to data enhancement processing using two data enhancement methods to obtain a first sample set and a second sample set, wherein the data enhancement method includes at least one of the following: randomly cropping images, randomly rotating images, and horizontally flipping images; the first sample set is input into the first encoder of the initial model to obtain a third feature set output by the first encoder; the second sample set is input into the backbone network in the second encoder of the initial model to obtain an intermediate feature set output by the backbone network, and the intermediate feature set is input into the prediction head network in the second encoder of the initial model to obtain a fourth feature set output by the prediction head network; a supervised contrastive loss function is constructed based on the third feature set, the fourth feature set and the sample labels, and the model parameters of the initial model are adjusted based on the supervised contrastive loss function.

[0010] Optionally, a supervised contrast loss function is constructed based on the third feature set, the fourth feature set and the sample label, including: constructing a third feature dynamic sequence based on the third feature set of the current training batch and the third feature sets of a preset number of training batches before the current training batch; determining the presentation attack detection label of each feature in the third feature dynamic sequence and the fourth feature set, wherein the presentation attack detection label is used to reflect that the feature corresponds to a live fingerprint image or a forged fingerprint image; for each fourth feature in the fourth feature set, determining the positive set corresponding to the fourth feature, wherein the positive set includes: features in the third feature dynamic sequence and the fourth feature set whose presentation attack detection labels are the same as the sample labels of the fourth features; constructing a supervised contrast loss function based on each third feature in the third feature dynamic sequence, each fourth feature in the fourth feature set and the positive set corresponding to the fourth feature.

[0011] Optionally, adjusting the model parameters of the initial model according to the supervised contrast loss function includes: adjusting the model parameters of the second encoder of the initial model according to the supervised contrast loss function using a backpropagation method; and adjusting the model parameters of the first encoder of the initial model using an exponential moving average update method.

[0012] Optionally, determining the type of the target fingerprint image based on the Euclidean distance between the target feature and the second feature includes: determining a distance threshold based on the Euclidean distance between each first feature; if the Euclidean distance between the target feature and the second feature is greater than the distance threshold, determining that the target fingerprint image is a forged fingerprint image; if the Euclidean distance between the target feature and the second feature is not greater than the distance threshold, determining that the target fingerprint image is a live fingerprint image.

[0013] According to another aspect of an embodiment of the present application, a fingerprint presentation attack detection device is also provided, including: an acquisition module for acquiring a target fingerprint image to be detected; an extraction module for extracting target features in the target fingerprint image using a pre-trained feature extraction model, wherein the feature extraction model is obtained by training live fingerprint image samples and forged fingerprint image samples using a supervised contrastive learning method; a first determination module for acquiring the first features of all live fingerprint image samples extracted by the feature extraction model during the training process, and using a K-nearest neighbor algorithm to determine a second feature with a K-th closest Euclidean distance to the target feature among multiple first features; a second determination module for determining the type of the target fingerprint image based on the Euclidean distance between the target feature and the second feature, wherein the type of the target fingerprint image includes: a live fingerprint image or a forged fingerprint image.

[0014] According to another aspect of an embodiment of the present application, a non-volatile storage medium is provided. The non-volatile storage medium includes a stored computer program. The device where the non-volatile storage medium is located executes the above-mentioned fingerprint presentation attack detection method by running the computer program.

[0015] According to another aspect of an embodiment of the present application, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the above-mentioned fingerprint presentation attack detection method through the computer program.

[0016] In an embodiment of the present application, a target fingerprint image to be detected is first acquired; then, a pre-trained feature extraction model is used to extract target features from the target fingerprint image, wherein the feature extraction model is trained on live fingerprint image samples and forged fingerprint image samples using a supervised contrastive learning method; then, the first features of all live fingerprint image samples extracted by the feature extraction model during training are acquired, and the second feature with the Kth closest Euclidean distance to the target feature among the multiple first features is determined using a K-nearest neighbor algorithm; finally, the type of the target fingerprint image is determined to be a live fingerprint image or a forged fingerprint image based on the Euclidean distance between the target feature and the second feature. When training the feature extraction model based on supervised contrastive learning, a dynamic feature queue and a label learning feature are combined to actively mine positive samples from the queue, making the intra-class features more compact and increasing the margin between inter-class features, thereby enhancing the generalization ability of the model; during the testing phase, an out-of-distribution detection method based on the K-nearest neighbor algorithm is used to detect the extracted features instead of the conventional classification method, eliminating the need to determine the classification boundary and significantly enhancing the model's ability to detect unseen forged fingerprints. The present application solution effectively solves the technical problem in related technologies that classification-based fingerprint detection methods are difficult to accurately detect forged fingerprints that have never been encountered. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0018] Figure 1 is a schematic structural diagram of an optional computer terminal according to an embodiment of the present application;

[0019] Figure 2 is a flowchart of an optional fingerprint presentation attack detection method according to an embodiment of the present application;

[0020] Figure 3 is a schematic diagram of an optional initial model training process according to an embodiment of the present application;

[0021] Figure 4 is a schematic diagram of an optional fingerprint feature distribution according to an embodiment of the present application;

[0022] Figure 5 This is a schematic diagram of an optional method of determining the target fingerprint image type based on the Euclidean distance according to an embodiment of the present application;

[0023] Figure 6 It is a structural diagram of an optional fingerprint presentation attack detection device according to an embodiment of the present application. DETAILED DESCRIPTION

[0024] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this application.

[0025] It should be noted that the terms "first", "second", etc. in the specification, claims, and drawings of the present application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product, or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products, or devices.

[0026] In order to better understand the embodiments of the present application, some nouns or terms that appear in the description of the embodiments of the present application are first translated and explained as follows:

[0027] FPAD (Fingerprint Presentation Attack Detection): A fingerprint presentation attack is a technique used to prevent fingerprint recognition systems from being attacked by attackers who use simulated or forged fingerprint samples to deceive the fingerprint recognition system, thereby achieving illegal access or identity impersonation.

[0028] SupCon (Supervised Contrastive Learning): A deep learning method that aims to train models by comparing positive samples with negative samples. Its core idea is to compare the features of each sample with the features of other samples and learn useful features by maximizing the similarity between positive sample pairs and minimizing the difference in similarity between positive and negative sample pairs.

[0029] KNN (K-Nearest Neighbor): A nonparametric algorithm for classification and regression. It is based on a simple assumption: similar samples have similar labels. The goal of the algorithm is to classify or regress new, unknown samples based on training samples with known labels.

[0030] OOD (Out Of Distribution) detection: refers to the ability to accurately detect whether an input sample of a trained model belongs to data outside the distribution range seen by the model during training during the testing phase.

[0031] Example 1

[0032] According to an embodiment of the present application, a fingerprint presentation attack detection method is first provided. It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system, such as a set of computer-executable instructions, and that although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in a different order than shown.

[0033] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1 The hardware structure block diagram of a computer terminal (or mobile device) for implementing a fingerprint presentation attack detection method is shown. Figure 1As shown, the computer terminal 10 (or mobile device 10) may include one or more (illustrated as 102a, 102b, ..., 102n) processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. It will be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components than shown, or with Figure 1 Different configurations shown.

[0034] It should be noted that the one or more processors 102 and / or other data processing circuits described above may generally be referred to herein as "data processing circuitry". The data processing circuitry may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuitry may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computer terminal 10 (or mobile device). As described in the embodiments of the present application, the data processing circuitry serves as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).

[0035] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the fingerprint presentation attack detection method in the embodiments of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, thereby implementing the vulnerability detection method of the above-mentioned application. The memory 104 may include high-speed random access memory and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0036] The transmission device 106 is configured to receive or transmit data via a network. A specific example of the aforementioned network may include a wireless network provided by the communications provider of the computer terminal 10. In one embodiment, the transmission device 106 includes a network interface controller (NIC), which can be connected to other network devices via a base station to enable communication with the Internet. In another embodiment, the transmission device 106 may be a radio frequency (RF) module, which is configured to communicate with the Internet wirelessly.

[0037] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 10 (or mobile device).

[0038] In the above operating environment, the embodiment of the present application provides a fingerprint presentation attack detection method, such as Figure 2 As shown, the method includes the following steps:

[0039] Step S202, obtaining a target fingerprint image to be detected;

[0040] Step S204, extracting target features from the target fingerprint image using a pre-trained feature extraction model, wherein the feature extraction model is trained on live fingerprint image samples and forged fingerprint image samples using a supervised contrastive learning method;

[0041] Step S206, obtaining the first features of all live fingerprint image samples extracted by the feature extraction model during the training process, and using the K nearest neighbor algorithm to determine the second feature with the Kth closest Euclidean distance to the target feature among the multiple first features;

[0042] Step S208: determining the type of the target fingerprint image according to the Euclidean distance between the target feature and the second feature, wherein the type of the target fingerprint image includes: a live fingerprint image or a forged fingerprint image.

[0043] The following describes the steps of the fingerprint presentation attack detection method in conjunction with a specific implementation process.

[0044] As an optional implementation, the feature extraction model can be trained in the following way:

[0045] First, an initial model is constructed. The initial model includes a first encoder and a second encoder. The first encoder and the second encoder have the same structure, and both include a backbone network and a projection head network.

[0046] Afterwards, training samples and sample labels corresponding to each training sample are obtained, wherein the sample labels are used to mark whether the training sample is a live fingerprint image or a forged fingerprint image;

[0047] Then, the training samples are sequentially input into the initial model for iterative training, and the model parameters of the initial model are adjusted using the supervised contrastive learning loss function;

[0048] After training is completed, only the second encoder of the initial model is retained to obtain the final feature extraction model.

[0049] Optionally, when constructing the initial model, the backbone network of the first encoder and the second encoder can be selected to have an output dimension d f =2048 ResNet (Residual Network), the prediction head network can use the output dimension d v =256 2-layer MLP (Multi-layer perceptron).

[0050] Optionally, when obtaining training samples and sample labels corresponding to each training sample, the following method can be used: obtain multiple fingerprint images and determine the type of each fingerprint image, wherein the type of fingerprint image includes: live fingerprint image or forged fingerprint image; for each fingerprint image, use the fingerprint recognition network to determine a preset number of key points in the fingerprint image, take each key point as the center, intercept a local fingerprint image of a preset size, and adjust the direction of each local fingerprint image to be the same as the direction of the key point; use the multiple local fingerprint images obtained as training samples, and determine the sample labels corresponding to the local fingerprint images based on the type of the fingerprint image.

[0051] For example, for a fingerprint image, the fingerprint recognition network FingerNet can be used to extract k key points in the fingerprint image (the k value can be set as needed), which is recorded as M = {m1,m2,…,m k}, each key point m i ={x i ,y i ,θ i}, (x i ,y i ) represents the spatial position, θ i Represents the key point m i direction; can be expressed as (x i ,y i ) as the center to intercept the local fingerprint image p of a preset size such as 96×96 i , and the local fingerprint image p i The direction of θ i Align.

[0052] After obtaining the training samples, the training samples can be input into the initial model in sequence for iterative training, and the model parameters of the initial model can be adjusted using the supervised contrastive learning loss function. Figure 3 This is a schematic diagram of an initial model training process according to an embodiment of the present application. Figure 3 This section describes the initial model training process.

[0053] In each training batch, firstly the training samples X={x i} i=1…B Two data enhancement methods are used to perform data enhancement processing to obtain the first sample set and the second sample set The data enhancement method includes at least one of the following: randomly cropping the image, randomly rotating the image, and horizontally flipping the image;

[0054] Then the first sample set Input the first encoder F of the initial model m , get the first encoder F m The third feature set of the output

[0055] At the same time, the second sample set Input the backbone network E in the second encoder F of the initial model f , get the backbone network E f The output intermediate feature set f = {f i} i=1…B , the intermediate feature set f={f i} i=1…B Input the prediction head network E in the second encoder F of the initial model h , get the predicted head network E h The fourth feature set of the output For each sample x in the second sample set, i , input it into the backbone network E f Get intermediate features Then the intermediate feature f i Input to the prediction head network E h Get And Normalize to get the final encoding features

[0056] Finally, a supervised contrast loss function is constructed based on the third feature set, the fourth feature set and the sample labels, and the model parameters of the initial model are adjusted based on the supervised contrast loss function.

[0057] As an optional implementation, when constructing a supervised contrast loss function, the following method can be used: determine the presentation attack detection label of each feature in the third feature set and the fourth feature set, wherein the presentation attack detection label is used to reflect whether the feature corresponds to a live fingerprint image or a forged fingerprint image; for each fourth feature in the fourth feature set, determine the positive set corresponding to the fourth feature, wherein the positive set includes: features in the third feature set and the fourth feature set whose presentation attack detection label is the same as the sample label of the fourth feature; construct a supervised contrast loss function based on each third feature in the third feature dynamic sequence, each fourth feature in the fourth feature set, and the positive set corresponding to the fourth feature. The specific calculation formula is as follows:

[0058]

[0059]

[0060] Where, the fourth characteristic The symbol · represents the inner product operation, τ∈R + is a scalar temperature parameter, P(a) is the fourth characteristic The corresponding positive set, γ(v) represents the attack detection label of feature v, y a Indicates the fourth feature The sample label, V batch =V q ∪V k .

[0061] In order to make the supervised contrast loss function more suitable for fingerprint presentation attack detection, the embodiment of the present application further improves the above-mentioned supervised contrast loss function by introducing a dynamic queue to obtain more trainable sample pairs and better constrain the overall feature distribution. At the same time, by actively mining positive samples from the queue, the intra-class constraints can be further enhanced.

[0062] Specifically, when constructing a supervised contrast loss function, it can be done in the following way: construct a third feature dynamic sequence based on the third feature set of the current training batch and the third feature sets of a preset number of training batches before the current training batch; determine the presentation attack detection label of each feature in the third feature dynamic sequence and the fourth feature set, wherein the presentation attack detection label is used to reflect that the feature corresponds to a live fingerprint image or a forged fingerprint image; for each fourth feature in the fourth feature set, determine the positive set corresponding to the fourth feature, wherein the positive set includes: features in the third feature dynamic sequence and the fourth feature set whose presentation attack detection labels are the same as the sample labels of the fourth features; construct a supervised contrast loss function based on each third feature in the third feature dynamic sequence, each fourth feature in the fourth feature set, and the positive set corresponding to the fourth feature.

[0063] Among them, the third characteristic dynamic sequence can be expressed as Q v ={V k1 ,V k2 ,…,V kL}, the feature dynamic sequence length L can be set to 65536; when the third feature dynamic sequence is updated, its corresponding sample label sequence label queue Q needs to be updated synchronously label ={y k1 ,y k2 ,…,y kL}.

[0064] The final calculation formula of the supervised contrast loss function is as follows:

[0065]

[0066]

[0067] Where V = V q ∪Q v .

[0068] During training, you can use a learning rate of 1e -4 The Adam optimizer is used for 150 iterations. When adjusting the model parameters of the initial model according to the supervised contrast loss function, the model parameters of the second encoder F of the initial model are adjusted according to the supervised contrast loss function using the back propagation method, and the first encoder F of the initial model is adjusted using the Exponential Moving Average (EMA) update method. m The model parameters α is set to 0.999 and the temperature parameter τ can be set to 0.1.

[0069] After the training is completed, only the second encoder F of the initial model is retained to obtain the feature extraction model.

[0070] Figure 4 This is a schematic diagram of a fingerprint feature distribution according to an embodiment of the present application, wherein (a) is the distribution of fingerprint features extracted by a conventional classification-based model, dark colors represent live fingerprint features, and light colors represent forged fingerprint features. It can be seen that the interval between live fingerprint features and forged fingerprint features is small; (b) is the distribution of fingerprint features extracted by the feature extraction model trained in the embodiment of the present application. It can be seen that the intra-class feature distribution is more compact and the inter-class feature margin is increased, that is, the feature distribution learned by the above training method can enhance the generalization ability of the model, and can also show good detection ability even when the distribution of the test set and the training set are different.

[0071] During the testing phase, the embodiment of the present application adopts an out-of-distribution detection method based on the K-nearest neighbor algorithm to replace the conventional classification method to detect the target features of the target fingerprint image to be detected extracted by the feature extraction model. This does not require determining the classification boundaries and can significantly enhance the model's ability to detect forged fingerprints that have never been encountered.

[0072] As an optional implementation, first obtain the target fingerprint image to be detected; then use the pre-trained feature extraction model to extract the target features in the target fingerprint image, denoted as v test ; At the same time, the first feature of all live fingerprint image samples extracted by the feature extraction model during the training process is obtained, which is recorded as And use the K nearest neighbor algorithm to determine the second feature with the Kth closest Euclidean distance to the target feature among multiple first features, denoted as v (K) ; Then according to the target feature v test With the second feature v (K) The Euclidean distance d between them determines whether the target fingerprint image is a live fingerprint image or a forged fingerprint image.

[0073] Optionally, based on the target feature v test With the second feature v (K) When determining the type of the target fingerprint image, we can first determine the type of the target fingerprint image based on the first feature of each The Euclidean distance between the target feature and the second feature determines the distance threshold λ; if the Euclidean distance d between the target feature and the second feature is greater than the distance threshold λ, the target fingerprint image is determined to be a forged fingerprint image; if the Euclidean distance d between the target feature and the second feature is not greater than the distance threshold λ, the target fingerprint image is determined to be a live fingerprint image.

[0074] In actual testing, the efficient nearest neighbor search library Faiss can be used to implement the out-of-distribution detection method based on the K-nearest neighbor algorithm. The default hyperparameters can be set to K = 1000 and ratio r = 99%.

[0075] Figure 5 is a schematic diagram of determining the target fingerprint image type based on the Euclidean distance according to an embodiment of the present application, wherein: The extracted live fingerprint feature is the same as the first feature If the Euclidean distance d1 between the second features of the Kth nearest neighbor is less than the distance threshold λ, then the corresponding fingerprint image is a live fingerprint image; is the extracted forged fingerprint feature, which is consistent with the first feature If the Euclidean distance d2 between the second features of the K-th nearest neighbor is greater than the distance threshold λ, then the corresponding fingerprint image is a forged fingerprint image.

[0076] In an embodiment of the present application, a target fingerprint image to be detected is first acquired; then, a pre-trained feature extraction model is used to extract target features from the target fingerprint image, wherein the feature extraction model is trained on live fingerprint image samples and forged fingerprint image samples using a supervised contrastive learning method; then, the first features of all live fingerprint image samples extracted by the feature extraction model during training are acquired, and the second feature with the Kth closest Euclidean distance to the target feature among the multiple first features is determined using a K-nearest neighbor algorithm; finally, the type of the target fingerprint image is determined to be a live fingerprint image or a forged fingerprint image based on the Euclidean distance between the target feature and the second feature. When training the feature extraction model based on supervised contrastive learning, a dynamic feature queue and a label learning feature are combined to actively mine positive samples from the queue, making the intra-class features more compact and increasing the margin between inter-class features, thereby enhancing the generalization ability of the model; during the testing phase, an out-of-distribution detection method based on the K-nearest neighbor algorithm is used to detect the extracted features instead of the conventional classification method, eliminating the need to determine the classification boundary and significantly enhancing the model's ability to detect unseen forged fingerprints. The present application solution effectively solves the technical problem in related technologies that classification-based fingerprint detection methods are difficult to accurately detect forged fingerprints that have never been encountered.

[0077] Example 2

[0078] According to an embodiment of the present application, a fingerprint presentation attack detection device for implementing the fingerprint presentation attack detection method in embodiment 1 is also provided. Figure 6 As shown, the fingerprint presentation attack detection device at least includes: an acquisition module 61, an extraction module 62, a first determination module 63 and a second determination module 64, wherein:

[0079] An acquisition module 61 is used to acquire a target fingerprint image to be detected;

[0080] An extraction module 62 is configured to extract target features from a target fingerprint image using a pre-trained feature extraction model, wherein the feature extraction model is trained using a supervised contrastive learning method on live fingerprint image samples and forged fingerprint image samples;

[0081] A first determination module 63 is configured to obtain the first features of all live fingerprint image samples extracted by the feature extraction model during the training process, and determine the second feature having the Kth closest Euclidean distance to the target feature among the multiple first features using a K-nearest neighbor algorithm;

[0082] The second determining module 64 is configured to determine the type of the target fingerprint image according to the Euclidean distance between the target feature and the second feature, wherein the type of the target fingerprint image includes: a live fingerprint image or a forged fingerprint image.

[0083] As an optional implementation, the training process of the above-mentioned feature extraction model includes: constructing an initial model, which includes a first encoder and a second encoder, and the first encoder and the second encoder have the same structure, both of which include: a backbone network and a prediction head network; obtaining training samples and sample labels corresponding to each training sample, and the sample labels are used to mark whether the training samples are live fingerprint images or forged fingerprint images; inputting the training samples into the initial model in sequence for iterative training, and adjusting the model parameters of the initial model using the supervised contrastive learning loss function; after the training is completed, only the second encoder of the initial model is retained to obtain the feature extraction model.

[0084] Optionally, when obtaining training samples and sample labels corresponding to each training sample, multiple fingerprint images can be obtained first, and the type of each fingerprint image can be determined, where the type of fingerprint image includes: live fingerprint image or forged fingerprint image; for each fingerprint image, a fingerprint recognition network is used to determine a preset number of key points in the fingerprint image, and a local fingerprint image of a preset size is captured with each key point as the center, and the direction of each local fingerprint image is adjusted to be the same as the direction of the key point; the multiple local fingerprint images obtained are all used as training samples, and the sample labels corresponding to the local fingerprint images are determined based on the type of the fingerprint image.

[0085] Optionally, the training samples can be sequentially input into the initial model for iterative training in the following manner, and the model parameters of the initial model can be adjusted using the supervised contrastive learning loss function: in each training batch, the training samples of the training batch are respectively subjected to data enhancement processing using two data enhancement methods to obtain a first sample set and a second sample set, wherein the data enhancement method includes at least one of the following: randomly cropping images, randomly rotating images, and horizontally flipping images; the first sample set is input into the first encoder of the initial model to obtain a third feature set output by the first encoder; the second sample set is input into the backbone network in the second encoder of the initial model to obtain an intermediate feature set output by the backbone network, and the intermediate feature set is input into the prediction head network in the second encoder of the initial model to obtain a fourth feature set output by the prediction head network; a supervised contrastive loss function is constructed based on the third feature set, the fourth feature set and the sample labels, and the model parameters of the initial model are adjusted based on the supervised contrastive loss function.

[0086] Optionally, when constructing a supervised contrast loss function based on the third feature set, the fourth feature set and the sample label, a third feature dynamic sequence can be constructed based on the third feature set of the current training batch and the third feature sets of a preset number of training batches before the current training batch; the presentation attack detection label of each feature in the third feature dynamic sequence and the fourth feature set is determined, wherein the presentation attack detection label is used to reflect that the feature corresponds to a live fingerprint image or a forged fingerprint image; for each fourth feature in the fourth feature set, the positive set corresponding to the fourth feature is determined, wherein the positive set includes: features in the third feature dynamic sequence and the fourth feature set whose presentation attack detection labels are the same as the sample labels of the fourth features; a supervised contrast loss function is constructed based on each third feature in the third feature dynamic sequence, each fourth feature in the fourth feature set and the positive set corresponding to the fourth feature.

[0087] Optionally, when adjusting the model parameters of the initial model based on the supervised contrast loss function, the back propagation method can be used to adjust the model parameters of the second encoder of the initial model based on the supervised contrast loss function; and the exponential moving average update method can be used to adjust the model parameters of the first encoder of the initial model.

[0088] Optionally, when the second determination module determines the type of the target fingerprint image based on the Euclidean distance between the target feature and the second feature, it can first determine the distance threshold based on the Euclidean distance between each first feature; if the Euclidean distance between the target feature and the second feature is greater than the distance threshold, the target fingerprint image is determined to be a forged fingerprint image; if the Euclidean distance between the target feature and the second feature is not greater than the distance threshold, the target fingerprint image is determined to be a live fingerprint image.

[0089] It should be noted that the modules in the fingerprint presentation attack detection device in the embodiment of the present application correspond one-to-one to the implementation steps of the fingerprint presentation attack detection method in Example 1. Since a detailed description has been given in Example 1, some details not reflected in this embodiment can be referred to Example 1 and will not be repeated here.

[0090] Example 3

[0091] According to an embodiment of the present application, a non-volatile storage medium is further provided. The non-volatile storage medium includes a stored computer program, wherein the device where the non-volatile storage medium is located executes the fingerprint presentation attack detection method in Example 1 by running the computer program.

[0092] Specifically, the device where the non-volatile storage medium is located executes the following steps by running the computer program: obtaining a target fingerprint image to be detected; extracting target features in the target fingerprint image using a pre-trained feature extraction model, wherein the feature extraction model is obtained by training live fingerprint image samples and forged fingerprint image samples using a supervised contrastive learning method; obtaining the first features of all live fingerprint image samples extracted by the feature extraction model during the training process, and using a K-nearest neighbor algorithm to determine the second feature with the Kth closest Euclidean distance to the target feature among the multiple first features; determining the type of the target fingerprint image based on the Euclidean distance between the target feature and the second feature, wherein the type of the target fingerprint image includes: a live fingerprint image or a forged fingerprint image.

[0093] According to an embodiment of the present application, a processor is further provided, which is configured to run a computer program. When the computer program is run, the fingerprint presentation attack detection method in embodiment 1 is executed.

[0094] Specifically, the computer program executes the following steps when it is run: obtaining a target fingerprint image to be detected; extracting target features from the target fingerprint image using a pre-trained feature extraction model, wherein the feature extraction model is obtained by training live fingerprint image samples and forged fingerprint image samples using a supervised contrastive learning method; obtaining the first features of all live fingerprint image samples extracted by the feature extraction model during the training process, and determining the second feature with the Kth closest Euclidean distance to the target feature among the multiple first features using a K-nearest neighbor algorithm; determining the type of the target fingerprint image based on the Euclidean distance between the target feature and the second feature, wherein the type of the target fingerprint image includes: a live fingerprint image or a forged fingerprint image.

[0095] According to an embodiment of the present application, an electronic device is further provided, comprising: a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the fingerprint presentation attack detection method in embodiment 1 through the computer program.

[0096] Specifically, the processor is configured to execute the following steps through a computer program: obtaining a target fingerprint image to be detected; extracting target features in the target fingerprint image using a pre-trained feature extraction model, wherein the feature extraction model is obtained by training live fingerprint image samples and forged fingerprint image samples using a supervised contrastive learning method; obtaining the first feature of all live fingerprint image samples extracted by the feature extraction model during the training process, and using a K-nearest neighbor algorithm to determine the second feature with the Kth closest Euclidean distance to the target feature among multiple first features; determining the type of the target fingerprint image based on the Euclidean distance between the target feature and the second feature, wherein the type of the target fingerprint image includes: a live fingerprint image or a forged fingerprint image.

[0097] The serial numbers of the above embodiments are for description only and do not represent the advantages or disadvantages of the embodiments.

[0098] In the above embodiments of the present application, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0099] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only exemplary. For example, the division of units can be a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0100] Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple units. Some or all of the units may be selected to achieve the purpose of the present embodiment according to actual needs.

[0101] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0102] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program code.

[0103] The above is only a preferred embodiment of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A fingerprint presentation attack detection method, characterized in that: include: Obtaining the target fingerprint image to be detected; Extracting target features from the target fingerprint image using a pre-trained feature extraction model, wherein the feature extraction model is trained on live fingerprint image samples and forged fingerprint image samples using a supervised contrastive learning method; Obtaining the first features of all live fingerprint image samples extracted by the feature extraction model during the training process, and determining, using a K-nearest neighbor algorithm, a second feature having a K-th closest Euclidean distance to the target feature among the plurality of the first features; Determining the type of the target fingerprint image according to the Euclidean distance between the target feature and the second feature, wherein the type of the target fingerprint image includes: a live fingerprint image or a forged fingerprint image; The training process of the feature extraction model includes: constructing an initial model, wherein the initial model includes a first encoder and a second encoder, and the first encoder and the second encoder have the same structure, both including: a backbone network and a prediction head network; obtaining training samples and sample labels corresponding to each training sample, wherein the sample labels are used to mark the training samples as live fingerprint images or forged fingerprint images; inputting the training samples into the initial model in sequence for iterative training, and adjusting the model parameters of the initial model using the supervised contrastive learning loss function; after the training is completed, only the second encoder of the initial model is retained to obtain the feature extraction model.

2. The method according to claim 1, characterized in that Obtain training samples and the sample labels corresponding to each training sample, including: Acquire multiple fingerprint images and determine the type of each fingerprint image, wherein the type of the fingerprint image includes: a live fingerprint image or a forged fingerprint image; For each of the fingerprint images, a fingerprint recognition network is used to determine a preset number of key points in the fingerprint image, a local fingerprint image of a preset size is captured with each of the key points as the center, and the direction of each local fingerprint image is adjusted to be the same as the direction of the key point; the multiple local fingerprint images obtained are all used as training samples, and the sample labels corresponding to the local fingerprint images are determined according to the type of the fingerprint image.

3. The method according to claim 1, characterized in that The training samples are sequentially input into the initial model for iterative training, and the model parameters of the initial model are adjusted using a supervised contrastive learning loss function, including: In each training batch, two data augmentation methods are used to perform data augmentation processing on the training samples of the training batch to obtain a first sample set and a second sample set, wherein the data augmentation methods include at least one of the following: randomly cropping images, randomly rotating images, and horizontally flipping images; Inputting the first sample set into the first encoder of the initial model to obtain a third feature set output by the first encoder; Inputting the second sample set into the backbone network in the second encoder of the initial model to obtain an intermediate feature set output by the backbone network, and inputting the intermediate feature set into the prediction head network in the second encoder of the initial model to obtain a fourth feature set output by the prediction head network; The supervised contrastive learning loss function is constructed according to the third feature set, the fourth feature set, and the sample labels, and the model parameters of the initial model are adjusted according to the supervised contrastive learning loss function.

4. The method according to claim 3, characterized in that Constructing the supervised contrastive learning loss function based on the third feature set, the fourth feature set, and the sample label includes: Constructing a third feature dynamic sequence based on the third feature set of the current training batch and the third feature sets of a preset number of training batches before the current training batch; Determining a presentation attack detection tag for each feature in the third feature dynamic sequence and the fourth feature set, wherein the presentation attack detection tag is used to reflect whether the feature corresponds to a live fingerprint image or a forged fingerprint image; For each fourth feature in the fourth feature set, determining a positive set corresponding to the fourth feature, wherein the positive set includes: the third feature dynamic sequence and features in the fourth feature set whose attack detection labels are the same as the sample labels of the fourth feature; The supervised contrastive learning loss function is constructed according to each third feature in the third feature dynamic sequence, each fourth feature in the fourth feature set, and a positive set corresponding to the fourth feature.

5. The method according to claim 3, characterized in that Adjusting the model parameters of the initial model according to the supervised contrastive learning loss function includes: Adjusting the model parameters of the second encoder of the initial model according to the supervised contrastive learning loss function using a back-propagation method; The model parameters of the first encoder of the initial model are adjusted using an exponential moving average updating method.

6. The method according to claim 1, characterized in that Determining the type of the target fingerprint image according to the Euclidean distance between the target feature and the second feature includes: determining a distance threshold according to the Euclidean distance between each of the first features; If the Euclidean distance between the target feature and the second feature is greater than the distance threshold, determining that the target fingerprint image is a forged fingerprint image; If the Euclidean distance between the target feature and the second feature is not greater than the distance threshold, it is determined that the target fingerprint image is a live fingerprint image.

7. A fingerprint presentation attack detection device, characterized in that: include: An acquisition module is used to acquire the target fingerprint image to be detected; An extraction module is configured to extract target features from the target fingerprint image using a pre-trained feature extraction model, wherein the feature extraction model is obtained by training live fingerprint image samples and forged fingerprint image samples using a supervised contrastive learning method, wherein the training process of the feature extraction model includes: constructing an initial model, wherein the initial model includes a first encoder and a second encoder, and the first encoder and the second encoder have the same structure, both including: a backbone network and a prediction head network; obtaining training samples and sample labels corresponding to each training sample, wherein the sample label is used to mark the training sample as a live fingerprint image or a forged fingerprint image; inputting the training samples into the initial model in sequence for iterative training, and adjusting the model parameters of the initial model using a supervised contrastive learning loss function; after the training is completed, retaining only the second encoder of the initial model to obtain the feature extraction model; A first determination module is configured to obtain first features of all live fingerprint image samples extracted by the feature extraction model during the training process, and to determine a second feature having a K-th closest Euclidean distance to the target feature among the plurality of first features using a K-nearest neighbor algorithm; The second determining module is configured to determine the type of the target fingerprint image according to the Euclidean distance between the target feature and the second feature, wherein the type of the target fingerprint image includes: a live fingerprint image or a forged fingerprint image.

8. A non-volatile storage medium, characterized in that: The non-volatile storage medium includes a stored computer program, wherein the device where the non-volatile storage medium is located executes the fingerprint presentation attack detection method according to any one of claims 1 to 6 by running the computer program.

9. An electronic device, characterized in that: include: A memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the fingerprint presentation attack detection method according to any one of claims 1 to 6 through the computer program.

Citation Information

Patent Citations

  • Fingerprint image detection method based on deep learning

    CN110705352A

  • Model optimization method and device

    CN114037876A