Image generation model training method, image generation method, anti-counterfeiting method and product
By training the fingerprint afterimage image generation model, using real fingerprint and afterimage image samples, a dual-branch model is used to generate high-quality fingerprint afterimage images, solving the data acquisition difficulties and style consistency problems in the fingerprint recognition model, and improving the performance and security of the model.
Patent Information
- Application Number
- CN202411513774.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-28
- Publication Date
- 2025-07-18
AI Technical Summary
The prior art is difficult to obtain high-quality fingerprint afterimage image data, resulting in unstable performance of fingerprint recognition models when preventing afterimage attacks, high acquisition costs and insufficient style consistency.
By training the fingerprint afterimage image generation model, using the real fingerprint image and afterimage image sample pair of the same finger, the dual-branch model is used to learn the fingerprint afterimage features and real fingerprint feature distribution to generate high-quality fingerprint afterimage images to maintain the consistency of image content and style.
High-quality fingerprint afterimage images are generated, which improves the generalization ability and stability of the fingerprint recognition model, reduces the acquisition cost, and enhances the security and economic benefits of the fingerprint unlocking system.
Smart Images

Figure CN120340072A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to an image generation model training method, an image generation method, an anti-counterfeiting method and a product. Background Art
[0002] Currently, fingerprint recognition technology faces security threats such as ghost attack. Ghost attack means that after a real finger presses the screen for fingerprint collection, a fingerprint ghost will be left on the screen, and there is a risk that the degree of line consistency between the fingerprint ghost image and the real finger fingerprint image collected can be exploited for fingerprint forgery and cracking.
[0003] To prevent such attacks, a large amount of fingerprint ghost image data needs to be obtained to develop relevant technologies and improve the defense ability against ghost attacks. However, the manual data collection process of ghost data is too complex, and it is difficult to obtain a large number of high-quality fingerprint ghost images. Summary of the Invention
[0004] In view of the above problems, embodiments of the present application provide an image generation model training method, an image generation method, an anti-counterfeiting method and a product to generate high-quality fingerprint ghost images.
[0005] The first aspect of the embodiments of the present application provides a fingerprint ghost image generation model training method, including: Obtaining a plurality of fingerprint image sample pairs, each fingerprint image sample pair including: a real fingerprint image sample of the same finger and a corresponding fingerprint ghost image sample; Training a model to be trained based on the plurality of fingerprint image sample pairs to obtain a fingerprint ghost image generation model; The fingerprint ghost image generation model learns a generation method for generating a fingerprint ghost image according to the real fingerprint image sample and the corresponding fingerprint ghost image sample.
[0006] In a possible implementation manner, the model to be trained includes a first branch and a second branch; the training the model to be trained based on the plurality of fingerprint image sample pairs to obtain a fingerprint ghost image generation model includes: Training the first branch and the second branch based on the plurality of fingerprint image sample pairs; Determining the trained second branch as the fingerprint ghost image generation model.
[0007] In a possible implementation manner, the training the first branch and the second branch based on the plurality of fingerprint image sample pairs includes: Adding noise to the fingerprint ghost image sample in each fingerprint image sample pair to obtain a noisy fingerprint ghost image sample; Input the noisy fingerprint ghost image sample into the first branch, and input the corresponding real fingerprint image sample into the second branch; Through the first branch, predict the ghost feature distribution of the fingerprint ghost image sample to learn the first generation method for generating fingerprint ghost images; Through the second branch, based on the first generation method, predict the ghost feature distribution of the fingerprint ghost image sample to learn the second generation method for generating fingerprint ghost images.
[0008] In a possible implementation manner, training the first branch and the second branch based on multiple pairs of fingerprint image samples includes: Add noise to the fingerprint ghost image sample in each pair of fingerprint image samples to obtain a noisy fingerprint ghost image sample, and add noise to the corresponding real fingerprint image sample to obtain a noisy real fingerprint image sample; Input the noisy fingerprint ghost image sample into the first branch, and input the corresponding real fingerprint image sample and the noisy real fingerprint image sample into the second branch; Through the first branch, predict the ghost feature distribution of the fingerprint ghost image sample to learn the first generation method for generating fingerprint ghost images; Through the second branch, based on the first generation method, predict the ghost feature distribution of the fingerprint ghost image sample to learn the second generation method for generating fingerprint ghost images.
[0009] In a possible implementation manner, the training stage of the model parameters of the to-be-trained model includes: multiple updates of the model parameters of the to-be-trained model; one update process of the model parameters of the to-be-trained model includes: Obtain the first fingerprint ghost generation map output by the first branch based on the noisy fingerprint ghost image sample; Update the model parameters of the first branch based on the first fingerprint ghost generation map and the fingerprint ghost image sample; Share the updated model parameters of the first branch with the second branch to obtain the second branch with updated model parameters; Obtain the second fingerprint ghost generation map output by the second branch with updated model parameters based on the real fingerprint image sample; Based on the second fingerprint ghost generation map and the fingerprint ghost image sample, update the model parameters of the second branch again.
[0010] In a possible implementation manner, the training stage of the model parameters of the to-be-trained model includes: the stage of training the first branch and the stage of training the second branch; The training process of the first branch includes: Obtaining a first fingerprint afterimage generation map output by the first branch based on the noisy fingerprint afterimage image samples; Based on the first fingerprint afterimage generation map and the fingerprint afterimage image samples, iteratively updating the model parameters of the first branch until the first branch is trained; The training process of the second branch includes: Using the model parameters of the trained first branch to initialize the model parameters of the second branch to obtain the second branch after initializing the model parameters; Obtaining a second fingerprint afterimage generation map output by the second branch after initializing the model parameters based on the real fingerprint image samples; Based on the second fingerprint afterimage generation map and the fingerprint afterimage image samples, iteratively updating the model parameters of the second branch until the second branch is trained.
[0011] The second aspect of the embodiments of the present application further provides a method for generating a fingerprint afterimage image, including: Inputting a real fingerprint image into a fingerprint afterimage image generation model to obtain a fingerprint afterimage image; Wherein, the fingerprint afterimage image generation model is obtained according to the model training method described in the first aspect of the embodiments of the present application.
[0012] The third aspect of the embodiments of the present application further provides a fingerprint anti-counterfeiting method, including: Inputting a to-be-detected image into a fingerprint anti-counterfeiting model to obtain an anti-counterfeiting detection result; the anti-counterfeiting detection result indicates whether the to-be-detected image is a real fingerprint image; Wherein, the training samples of the fingerprint anti-counterfeiting model at least include: fingerprint afterimage images generated by a fingerprint afterimage image generation model, and the fingerprint afterimage image generation model is obtained according to the fingerprint afterimage image generation model training method described in the first aspect of the embodiments of the present application.
[0013] The fourth aspect of the embodiments of the present application further provides a fingerprint afterimage image generation model training device, including: A fingerprint image sample pair acquisition module, configured to obtain a plurality of fingerprint image sample pairs, and each fingerprint image sample pair includes: a real fingerprint image sample of the same finger and a corresponding fingerprint afterimage image sample; A training module, configured to train a model to be trained based on a plurality of fingerprint image sample pairs to obtain a fingerprint afterimage image generation model; The fingerprint afterimage image generation model learns a generation method for generating a fingerprint afterimage image according to a real fingerprint image sample and a corresponding fingerprint afterimage image sample.
[0014] The fifth aspect of the embodiments of the present application further provides a fingerprint afterimage image generation device, including: A generation module, configured to input a real fingerprint image into a fingerprint afterimage image generation model to obtain a fingerprint afterimage image; wherein, the fingerprint afterimage image generation model is obtained according to the model training method described in the first aspect of the embodiments of the present application.
[0015] The sixth aspect of the embodiments of the present application further provides a fingerprint anti-counterfeiting device, including: An anti-counterfeiting detection module, configured to input an image to be detected into a fingerprint anti-counterfeiting model to obtain an anti-counterfeiting detection result; the anti-counterfeiting detection result indicates whether the image to be detected is a real fingerprint image; wherein, the training samples of the fingerprint anti-counterfeiting model at least include: fingerprint afterimage images generated by a fingerprint afterimage image generation model, and the fingerprint afterimage image generation model is obtained according to the fingerprint afterimage image generation model training method described in the first aspect of the embodiments of the present application.
[0016] The seventh aspect of the embodiments of the present application provides an electronic device, including a memory and a processor, where a computer program capable of running on the processor is stored on the memory, and when the processor executes the computer program, the steps of the fingerprint afterimage image generation model training method described in the first aspect of the embodiments of the present application are implemented, or, the steps of the fingerprint afterimage image generation method described in the second aspect of the embodiments of the present application are implemented, or, the steps of the fingerprint anti-counterfeiting method described in the third aspect of the embodiments of the present application are implemented.
[0017] The eighth aspect of the embodiments of the present application provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the fingerprint afterimage image generation model training method described in the first aspect of the embodiments of the present application are implemented, or, the steps of the fingerprint afterimage image generation method described in the second aspect of the embodiments of the present application are implemented, or, the steps of the fingerprint anti-counterfeiting method described in the third aspect of the embodiments of the present application are implemented.
[0018] The embodiments of the present application provide a fingerprint afterimage image generation model training method, the method includes: obtaining a plurality of fingerprint image sample pairs, each fingerprint image sample pair includes: a real fingerprint image sample of the same finger and a corresponding fingerprint afterimage image sample; based on the plurality of fingerprint image sample pairs, training a model to be trained to obtain a fingerprint afterimage image generation model; the fingerprint afterimage image generation model learns a generation method of generating a fingerprint afterimage image according to the real fingerprint image sample and the corresponding fingerprint afterimage image sample.
[0019] The specific beneficial effects are as follows: In the embodiments of the present application, a fingerprint ghost image generation model is trained using a pair of fingerprint image samples (the real fingerprint image sample and the corresponding fingerprint ghost image sample of the same finger). On the one hand, based on the fingerprint ghost image sample, the feature distribution of the fingerprint ghost image is learned to generate a fingerprint ghost image with accurate fingerprint ghost image content. On the other hand, based on the real fingerprint image sample, the feature distribution of the real fingerprint image is learned, and the image style of the real fingerprint image is transferred to the image style of the fingerprint ghost image, maintaining the consistency of the style (generating a fingerprint ghost image with a consistent style based on the input real fingerprint image). Therefore, the embodiments of the present application achieve the balance between maintaining the image content and style transfer tasks and can generate high-quality fingerprint ghost images. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments of the present application. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0021] Figure 1 is a flowchart of the steps of a method for training a fingerprint ghost image generation model provided by an embodiment of the present application; Figure 2 is a schematic flowchart of a model training process provided by an embodiment of the present application; Figure 3 is a schematic flowchart of another model training process provided by an embodiment of the present application; Figure 4 is a flowchart of the steps of a method for generating a fingerprint ghost image provided by an embodiment of the present application; Figure 5 is a flowchart of the steps of a fingerprint anti-counterfeiting method provided by an embodiment of the present application; Figure 6 is a schematic structural diagram of a device for training a fingerprint ghost image generation model provided by an embodiment of the present application; Figure 7 is a schematic structural diagram of a device for generating a fingerprint ghost image provided by an embodiment of the present application; Figure 8 is a schematic structural diagram of a fingerprint anti-counterfeiting device provided by an embodiment of the present application; Figure 9 is a schematic structural diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0022] The exemplary embodiments of the present application will be described in more detail below with reference to the accompanying drawings in the embodiments of the present application. Although the exemplary embodiments of the present application are shown in the drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided so that the present application can be more thoroughly understood and the scope of the present application can be fully conveyed to those skilled in the art.
[0023] Currently, fingerprint unlocking technology has become a common means of authentication. However, fingerprint unlocking technology also faces security threats such as ghost attack. Ghost attack means that after a real finger presses the screen for fingerprint collection, a fingerprint ghost will be left on the screen, and there is a risk that the degree of line consistency between the fingerprint ghost image and the real finger fingerprint image collected can be exploited for fingerprint forgery and cracking.
[0024] The prior art mainly collects a large number of ghost images for training an image recognition model to detect and prevent such attacks. Although the above method can improve the defense ability against ghost attacks to a certain extent, there are still the following several significant defects: 1) Difficulty in collecting ghost data: The process of collecting high-quality ghost image data is complex and involves various collection techniques and material types. Due to the particularity of ghost data, it is very difficult to obtain high-quality ghost data. 2) Insufficient diversity of ghost data: Due to the high collection difficulty, it is often difficult for the prior art to obtain sufficiently diverse ghost data. This limits the generalization ability of the image recognition model in different scenarios, resulting in unstable model performance. 3) Unsatisfactory model training effect: Due to the finiteness and insufficient diversity of ghost data, the trained image recognition model is easily broken in actual applications and cannot provide reliable security protection. 4) High cost: The collection of a large amount of ghost data not only takes time but also requires a large amount of human and material resources, increasing the overall cost. 5) Insufficient style consistency: Existing ghost image generation models need to adjust relevant weight coefficients to achieve balance in the two tasks of maintaining image content and realizing style transfer, resulting in poor style consistency and making it impossible to make good use of the image generation model to generate ghost data.
[0025] To solve the above problems and obtain a large number of high-quality fingerprint ghost images, the embodiments of the present application propose an image generation model training method, referring to Figure 1 , Figure 1The following is a flowchart of the steps of a method for training a fingerprint afterimage generation model provided by an embodiment of the present application. This method uses fingerprint image samples to train a model, enabling the model to learn the feature distribution of real fingerprints from real fingerprint image samples and the feature distribution of fingerprint afterimages from fingerprint afterimage samples. By fusing these two feature distributions, an accurate and reliable fingerprint afterimage can be generated. Below, in conjunction with the accompanying drawings, a method for training an image generation model, an image generation method, an anti-counterfeiting method, and a product provided by an embodiment of the present application will be described in detail through some embodiments and their application scenarios.
[0026] In the first aspect of the embodiments of the present application, a method for training a fingerprint afterimage generation model is provided. Below, the method for training the fingerprint afterimage generation model in the first aspect will be introduced respectively in Sections 1.1, 1.2, and 1.3.
[0027] 1.1 Brief overview of the model training process: As Figure 1 shown, the method includes: Step S101, obtain a plurality of fingerprint image sample pairs, where each fingerprint image sample pair includes: a real fingerprint image sample of the same finger and a corresponding fingerprint afterimage sample.
[0028] Specifically, a real fingerprint image sample refers to a fingerprint image obtained by using a fingerprint acquisition device (such as an optical fingerprint module, an ultrasonic fingerprint module) to acquire an image of a real person's finger above the screen. The fingerprint afterimage sample that together with the real fingerprint image sample forms a fingerprint image sample pair refers to an afterimage image obtained by the fingerprint acquisition device after acquiring the real fingerprint image sample and then acquiring the trace left by the real person's finger touching the fingerprint acquisition screen. Therefore, the real fingerprint image sample and the fingerprint afterimage sample in each fingerprint image sample pair belong to the same finger.
[0029] Exemplarily, after obtaining the real fingerprint image sample 1 through finger A, then the afterimage trace left by finger A touching the fingerprint acquisition screen is acquired to obtain the fingerprint afterimage sample 2, thereby forming a pair of fingerprint image samples (including the real fingerprint image sample 1 and the fingerprint afterimage sample 2 belonging to finger A).
[0030] In the embodiments of the present application, the type of the fingerprint acquisition device is not limited, and the acquisition method of the fingerprint afterimage image sample is not limited. In order to improve the diversity of the obtained fingerprint image sample pairs, multiple types of fingerprint acquisition devices can be selected for fingerprint acquisition, such as an optical fingerprint module or an ultrasonic fingerprint module. Multiple afterimage image acquisition methods can also be selected to obtain multiple fingerprint afterimage image samples. Moreover, the obtained multiple fingerprint image sample pairs can include: fingerprint image sample pairs of fingers belonging to different people, fingerprint image sample pairs of fingers of different colors; fingerprint image sample pairs of different angles (such as side fingerprints and front fingerprints) of the same finger.
[0031] In a possible implementation manner, the method further includes: performing a normalization process on the obtained multiple fingerprint image sample pairs.
[0032] In this embodiment, the normalization process can be to perform a process of subtracting the mean and dividing by the variance on the image, so that the mean of the image is distributed within a relatively stable value range, which is convenient for the model to understand and speeds up the model convergence speed.
[0033] Step S102: Based on multiple fingerprint image sample pairs, train the model to be trained to obtain a fingerprint afterimage image generation model. The fingerprint afterimage image generation model learns a generation method for generating a fingerprint afterimage image according to a real fingerprint image sample and the corresponding fingerprint afterimage image sample.
[0034] Specifically, in each round of training of the model, a fingerprint image sample pair is input, so that the model learns the real fingerprint feature distribution based on the real fingerprint image sample and the fingerprint afterimage feature distribution of the corresponding fingerprint afterimage image sample, and generates a fingerprint afterimage image based on the fused feature distribution (the corresponding relationship from the real fingerprint feature distribution to the fingerprint afterimage feature distribution), so that the model can generate the corresponding fingerprint afterimage image based on the input real fingerprint image (that is, the fingerprint afterimage image generation model learns the generation method for generating a fingerprint afterimage image). In this embodiment, the model to be trained can be a diffusion model.
[0035] The embodiments of the present application use multiple fingerprint image sample pairs to train the model to be trained, optimize the model parameters, and obtain a trained fingerprint afterimage image generation model, so that it can accurately convert real human fingerprint data (the input real fingerprint image) into afterimage fingerprint data with afterimage features (fingerprint afterimage image), and then a rich afterimage training data set can be obtained, so that the generalization ability and stability of the anti-counterfeiting recognition model can be improved by using diverse high-quality afterimage data.
[0036] 1.2 Training process when the model to be trained is a two-branch model: In a possible implementation, the model to be trained includes a first branch and a second branch. Training the model to be trained based on multiple pairs of fingerprint image samples to obtain a fingerprint ghost image generation model includes: Training the first branch and the second branch based on multiple pairs of fingerprint image samples.
[0037] Determining the trained second branch as the fingerprint ghost image generation model.
[0038] In order to enable the model to simultaneously learn the fingerprint ghost feature distribution and the real fingerprint feature distribution during model training, the embodiments of the present application propose to use a dual-branch model as the model architecture of the model to be trained. That is, the model to be trained includes two branches, and the model to be trained is a dual-branch model, including a first branch and a second branch. Among them, the first branch and the second branch are diffusion models with the same architecture. Among them, the first branch is used to learn the fingerprint ghost feature distribution and maintain the ghost image content in the generated image. The other second branch is used to learn the real fingerprint feature distribution and perform style transfer, transferring the image style of the input real fingerprint image to the image style of the fingerprint ghost image to maintain style consistency. By fusing the feature distributions learned by the two branches, the finally trained second branch is determined as the fingerprint ghost image generation model. This model is equivalent to a style converter from real human fingerprints to ghost fingerprints, which can achieve the balance of maintaining the ghost image content in the generated image and maintaining style consistency, and improve the image quality of the generated fingerprint ghost images (improve the authenticity and diversity of fingerprint ghost images).
[0039] Next, according to the differences in the data of the input branches, the training process of the fingerprint ghost image generation model will be introduced in Sections 1.2.1 and 1.2.2 respectively.
[0040] 1.2.1 The specific process of training with the noisy fingerprint ghost image sample as the input of the first branch and the corresponding real fingerprint image sample as the input of the second branch: In a possible implementation, referring to Figure 2 , Figure 2 shows a schematic flowchart of a model training process. As Figure 2 shown, training the first branch and the second branch based on multiple pairs of fingerprint image samples includes: Step S201, adding noise to the fingerprint ghost image sample in each pair of fingerprint image samples to obtain a noisy fingerprint ghost image sample.
[0041] Step S202, inputting the noisy fingerprint ghost image sample into the first branch, and inputting the corresponding real fingerprint image sample into the second branch.
[0042] Step S203: Through the first branch, predict the residual feature distribution of the fingerprint residual image sample to learn and generate a first generation method for the fingerprint residual image.
[0043] Step S204: Through the second branch, based on the first generation method, predict the residual feature distribution of the fingerprint residual image sample to learn and generate a second generation method for the fingerprint residual image.
[0044] Specifically, as Figure 2 shown, during each round of model training, the input of the first branch is the noisy fingerprint residual image sample (obtained through Step S201). The present application embodiment does not limit the method of adding noise to the fingerprint residual image sample, and it can be any one of the existing noise addition methods; the output of the first branch is the fingerprint residual image generated based on the input (i.e., Figure 2 the first fingerprint residual generation map shown). Using the original fingerprint residual image sample in the fingerprint image sample pair before adding noise as the label of the first branch, calculate the loss function value according to the label and the first fingerprint residual generation map, and then update the model parameters of the first branch (for example, update the attention weight) according to the loss function value, so that the first branch learns and generates a first generation method for the fingerprint residual image. This first generation method refers to a method of learning the fingerprint residual feature distribution based on the input noisy fingerprint residual image sample to generate the corresponding fingerprint residual image.
[0045] As Figure 2 shown, during each round of model training, the input of the second branch is the real fingerprint image sample, and the output of the second branch is the fingerprint residual image obtained after performing style transfer (transferring to the image style of the fingerprint residual) on the real fingerprint image sample (i.e., Figure 2 the second fingerprint residual generation map shown). In addition, share the training result of the first branch with the second branch, so that the second branch can simultaneously learn the first generation method (and the corresponding fingerprint residual feature distribution) of the first branch. In each round of model training, the second branch uses the original fingerprint residual image sample in the fingerprint image sample pair as the label of the second branch, calculates the loss function value according to the label and the second fingerprint residual generation map, and then updates the model parameters of the second branch (for example, update the attention weight) according to the loss function value, so that the second branch learns and generates a second generation method for the fingerprint residual image. This second generation method refers to a method of learning the real fingerprint feature distribution based on the first generation method to generate a fingerprint residual image corresponding to the input real fingerprint image.
[0046] In this embodiment, the model to be trained is a dual-branch model. The first branch is used to learn the fingerprint afterimage feature distribution (corresponding to the first generation method), and the second branch is used to learn the real fingerprint feature distribution. The training result of the first branch is shared with the second branch (such as updated model parameters, such as attention weights), so that the second branch can learn the correspondence from the real fingerprint feature distribution to the fingerprint afterimage feature distribution, that is, learn the second generation method for generating fingerprint afterimage images. Using the trained second branch as the fingerprint afterimage image generation model achieves a balance between maintaining the afterimage image content in the generated image and maintaining style consistency, and improves the image quality of the generated fingerprint afterimage images.
[0047] 1.2.2 The specific process of training with the noisy fingerprint afterimage image sample as the input of the first branch and the corresponding real fingerprint image sample and noisy real fingerprint image sample as the input of the second branch: In a possible implementation, referring to Figure 3 , Figure 3 shows a schematic flow diagram of another model training process. As shown in Figure 3 , training the first branch and the second branch based on multiple pairs of fingerprint image samples includes: Step S301: Add noise to the fingerprint afterimage image sample in each pair of fingerprint image samples to obtain a noisy fingerprint afterimage image sample, and add noise to the corresponding real fingerprint image sample to obtain a noisy real fingerprint image sample.
[0048] Step S302: Input the noisy fingerprint afterimage image sample into the first branch, and input the corresponding real fingerprint image sample and noisy real fingerprint image sample into the second branch.
[0049] Step S303: Through the first branch, predict the afterimage feature distribution of the fingerprint afterimage image sample to learn the first generation method for generating fingerprint afterimage images.
[0050] Step S304: Through the second branch, based on the first generation method, predict the afterimage feature distribution of the fingerprint afterimage image sample to learn the second generation method for generating fingerprint afterimage images.
[0051] Specifically, as shown in Figure 3 , during each round of model training, the input of the first branch is the noisy fingerprint afterimage image sample (obtained through step S301). The present application embodiment does not limit the method of adding noise to the fingerprint afterimage image sample, and it can be any one of the existing noise addition methods; the output of the first branch is the fingerprint afterimage image generated based on the input (that is, Figure 3The first fingerprint ghost image generation diagram shown). Using the original fingerprint ghost image sample in the fingerprint image sample pair before adding noise as the label of the first branch, calculating the loss function value based on the label and the first fingerprint ghost image generation diagram, and then updating the model parameters of the first branch (such as updating the attention weight) according to the loss function value, so that the first branch learns the first generation method of generating fingerprint ghost images. This first generation method refers to a method of learning the fingerprint ghost feature distribution based on the input noisy fingerprint ghost image sample to generate the corresponding fingerprint ghost image.
[0052] As Figure 3 shown, during each round of model training, the second branch has a dual-channel input, including: a real fingerprint image sample and a noisy real fingerprint image sample (obtained through step S301). In step S301, the method of adding noise to the real fingerprint image sample is the same as the method of adding noise to the fingerprint ghost image sample, and it can be any one of the existing noise addition methods. The output of the second branch is a fingerprint ghost image obtained by performing style transfer (transferring to the image style of the fingerprint ghost) on the real fingerprint image sample (i.e., Figure 3 the second fingerprint ghost image generation diagram shown). In addition, the training result of the first branch is shared with the second branch, so that the second branch can simultaneously learn the first generation method of the first branch (and the corresponding fingerprint ghost feature distribution). In each round of model training, the second branch uses the original fingerprint ghost image sample in the fingerprint image sample pair as the label of the second branch, calculates the loss function value based on the label and the second fingerprint ghost image, and then updates the model parameters of the second branch (such as updating the attention weight) according to the loss function value, so that the second branch learns the second generation method of generating fingerprint ghost images. This second generation method refers to a method of learning the real fingerprint feature distribution based on the first generation method to generate the corresponding fingerprint ghost image.
[0053] In this embodiment, the model to be trained is a two-branch model. The first branch is used to learn the fingerprint ghost feature distribution (corresponding to the first generation method), and the second branch is used to learn the real fingerprint feature distribution. The training result of the first branch (such as the updated model parameters, such as the attention weights) is shared with the second branch, so that the second branch can learn the correspondence from the real fingerprint feature distribution to the fingerprint ghost feature distribution, that is, learn the second generation method of generating fingerprint ghost images. The trained second branch is used as the fingerprint ghost image generation model, which realizes the balance of the two tasks of maintaining the ghost image content in the generated image and maintaining the style consistency, and improves the image quality of the generated fingerprint ghost images. Moreover, in the embodiment of the present application, the second branch is used as the style transfer model to learn to transfer the image style of the input real fingerprint image to the image style of the fingerprint ghost image. Through the style conversion technology, diverse ghost data is generated, significantly improving the diversity and style consistency of the training data, and enhancing the adaptability of the fingerprint ghost image generation model in different scenarios.
[0054] 1.3 Explain the process of updating the model parameters: When the model to be trained is a two-branch model, in order to obtain the fingerprint ghost image generation model after training the second branch, the fingerprint ghost feature distribution learned by the first branch and the real fingerprint feature distribution learned by itself can be fused. During the model training process, the model parameters of the first branch need to be shared with the second branch for the second branch to perform corresponding parameter updates. Specifically, there are two methods for the first branch and the second branch to share model parameters: one is that for each round of model training of the first branch, the updated model parameters after this round of model training are shared with the second branch, and then the second branch performs another round of model training to complete the update of its own model parameters; the other is that after the first branch completes all rounds of model training, the finally obtained model parameters are shared with the second branch, and then the second branch starts model training. Next, according to the different parameter update methods, the model training process is introduced in Sections 1.3.1 and 1.3.2 respectively.
[0055] 1.3.1 The first method of updating the model parameters: In a possible implementation manner, the training stage of the model parameters of the model to be trained includes: multiple updates of the model parameters of the model to be trained; a single update process of the model parameters of the model to be trained includes: Step S401, obtain the first fingerprint ghost generation map output by the first branch based on the noisy fingerprint ghost image samples.
[0056] Specifically, corresponding to steps S201 - S203 or steps S301 - S303, each time a round of model training is executed, the first branch outputs the generated fingerprint afterimage (the first fingerprint afterimage generation map) based on the input.
[0057] Step S402: Update the model parameters of the first branch based on the first fingerprint afterimage generation map and the fingerprint afterimage sample.
[0058] Specifically, using the fingerprint afterimage sample as a label, calculate the loss function (such as mean square error) based on the output result (the first fingerprint afterimage generation map) of the first branch in this round of training and the label. Then, based on the calculated loss function value, with the goal of making the generated first fingerprint afterimage generation map similar to the label, update the model parameters of the first branch.
[0059] Step S403: Share the updated model parameters of the first branch with the second branch to obtain the second branch with updated model parameters.
[0060] Specifically, after completing a round of model training for the first branch, share the updated model parameters of the first branch with the second branch (update the model parameters of the second branch to the updated model parameters of the first branch), so that the second branch can learn the training result of the first branch (the learned fingerprint afterimage feature distribution). Optionally, the updated model parameters of the first branch are the updated attention weights in the first branch.
[0061] Step S404: Obtain the second fingerprint afterimage generation map output by the second branch with updated model parameters based on the real fingerprint image sample.
[0062] Specifically, after the first branch completes a round of model training, it shares the updated model parameters with the second branch. After the second branch updates its model parameters, it executes another round of model training. That is, corresponding to the content of step S204 or step S304, the second branch outputs the generated fingerprint afterimage (the second fingerprint afterimage generation map) based on the input.
[0063] Step S405: Update the model parameters of the second branch again based on the second fingerprint afterimage generation map and the fingerprint afterimage sample.
[0064] Specifically, using the fingerprint afterimage image sample as a label, based on the output result (the second fingerprint afterimage generation map) of the second branch in this round of training and the label, calculate the loss function (such as mean square error), so that according to the calculated loss function value, with the goal of making the generated second fingerprint afterimage generation map similar to the label, update the model parameters of the second branch. In the embodiment of the present application, every time the first branch executes a round of model training, it outputs the first fingerprint afterimage generation map, calculates the loss function according to the output result, and after updating the model parameters of the first branch, shares the updated model parameters with the second branch (replaces the model parameters of the second branch), and then uses the second branch to execute a round of model training, so that the second branch calculates the loss function according to the output result and completes another update of its own model parameters based on the loss function. Perform multiple rounds of model training in this way until the loss function converges or reaches the preset number of training times, then end the training, and determine the trained second branch as the fingerprint afterimage image generation model. Through the above training process, the fingerprint afterimage image generation model can learn the fingerprint afterimage feature distribution of the first branch and also learn the real fingerprint feature distribution, achieving the balance of the two tasks of maintaining the afterimage image content in the generated image and maintaining the style consistency, and improving the image quality of the generated fingerprint afterimage image.
[0065] 1.3.2 Model parameter update method 2: In a possible implementation manner, the training stage of the model parameters of the to-be-trained model includes: the stage of training the first branch and the stage of training the second branch; The training process of the first branch includes: Step S501, obtain the first fingerprint afterimage generation map output by the first branch based on the noisy fingerprint afterimage image sample.
[0066] Specifically, corresponding to steps S201 - S203, or steps S301 - S303, every time a round of model training is executed, the first branch outputs the generated fingerprint afterimage image (the first fingerprint afterimage generation map) based on the input.
[0067] Step S502, iteratively update the model parameters of the first branch based on the first fingerprint afterimage generation map and the fingerprint afterimage image sample until the first branch is trained.
[0068] Specifically, using the fingerprint afterimage image sample as the label, based on the output result (the first fingerprint afterimage generation map) of the first branch in this round of training and the label, calculate the loss function (such as mean squared error), so as to update the model parameters of the first branch with the goal of making the generated first fingerprint afterimage generation map similar to the label according to the calculated loss function value, which is regarded as the first branch completing one round of model training. By repeating the above steps, the first branch is trained for multiple rounds until the loss function value converges or reaches the preset number of training times, and the training process of the first branch is ended.
[0069] The training process of the second branch includes: Step S503, use the model parameters of the first branch that have been trained to initialize the model parameters of the second branch, and obtain the second branch after the model parameters are initialized.
[0070] Specifically, after completing the model training of the first branch, share the finally determined model parameters of the first branch with the second branch (update the model parameters of the second branch to the model parameters of the first branch), so that the second branch can learn the training result of the first branch (the fingerprint afterimage feature distribution learned), that is, initialize the model parameters of the second branch to obtain the second branch after the model parameters are initialized. Optionally, the updated model parameters of the first branch are the updated attention weights in the first branch.
[0071] Step S504, obtain the second fingerprint afterimage generation map output by the second branch after the model parameters are initialized based on the real fingerprint image sample.
[0072] Specifically, use the second branch after the model parameters are initialized for model training. In each round of training process, according to the corresponding step S204 or step S304, the second branch outputs the generated fingerprint afterimage image (the second fingerprint afterimage generation map) based on the input.
[0073] Step S505, based on the second fingerprint afterimage generation map and the fingerprint afterimage image sample, iteratively update the model parameters of the second branch until the second branch is trained.
[0074] Specifically, using the fingerprint afterimage image sample as a label, based on the output result (the second fingerprint afterimage generation map) of the second branch in this round of training and the label, calculate the loss function (such as mean square error), so as to update the model parameters of the second branch with the goal of making the generated second fingerprint afterimage generation map similar to the label according to the calculated loss function value, which is regarded as the second branch completing one round of model training. By repeating the above steps (obtaining the output second fingerprint afterimage generation map and updating the model parameters of the second branch), the second branch is trained for multiple rounds until the loss function value converges or reaches the preset number of training times, and the training of the second branch is ended to obtain the trained second branch, that is, the fingerprint afterimage image generation model.
[0075] In the embodiment of the present application, first, the first branch is trained. After completing the training process of the first branch, the finally determined model parameters of the first branch are shared with the second branch (replacing the model parameters of the second branch), and then the second branch is trained for multiple rounds (calculating the loss function according to the output second fingerprint afterimage generation map and the label, and completing an update of its own model parameters based on the loss function) until the loss function converges or reaches the preset number of training times, and then the training is ended, and the trained second branch is determined as the fingerprint afterimage image generation model. Through the above training process, the fingerprint afterimage image generation model can learn the fingerprint afterimage feature distribution of the first branch and also learn the real fingerprint feature distribution, achieving the balance of the two tasks of maintaining the afterimage image content in the generated image and maintaining the style consistency, and improving the image quality of the generated fingerprint afterimage image. The embodiment of the present application obtains the fingerprint afterimage image generation model through training, realizes the efficient conversion from real fingerprints to afterimage fingerprints, and generates diverse afterimage data; and through the style conversion technology, the afterimage data generated by the model has high diversity and authenticity.
[0076] In the second aspect of the embodiment of the present application, a fingerprint afterimage image generation method is further proposed. Refer to Figure 4 , Figure 4 shows a step flowchart of a fingerprint afterimage image generation method. As Figure 4 shown, it includes: Step S601, input the real fingerprint image into the fingerprint afterimage image generation model to obtain the fingerprint afterimage image; Among them, the fingerprint afterimage image generation model is obtained according to the model training method described in the first aspect of the embodiment of the present application.
[0077] In the embodiment of the present application, based on the fingerprint afterimage image generation model trained in the first aspect, a real fingerprint image collected from a real human finger is input into the model, so that the fingerprint afterimage image generation model can generate a corresponding fingerprint afterimage image with fingerprint afterimage features and afterimage styles based on the input. The embodiment of the present application uses easily collectible real human fingerprint data (real fingerprint images) to generate fingerprint afterimage images through the model, solves the problem of difficult acquisition of high-quality afterimage data, and makes the acquisition of afterimage data more convenient.
[0078] The third aspect of the embodiment of the present application also proposes a fingerprint anti-counterfeiting method. Refer to Figure 5 , Figure 5 which shows a flowchart of the steps of a fingerprint anti-counterfeiting method. As Figure 5 shown, it includes: Step S701, input the image to be detected into the fingerprint anti-counterfeiting model to obtain an anti-counterfeiting detection result; the anti-counterfeiting detection result indicates whether the image to be detected is a real fingerprint image; wherein, the training samples of the fingerprint anti-counterfeiting model at least include: fingerprint afterimage images generated by the fingerprint afterimage image generation model, and the fingerprint afterimage image generation model is obtained according to the fingerprint afterimage image generation model training method described in the first aspect of the embodiment of the present application.
[0079] In the embodiment of the present application, the fingerprint afterimage image generation model trained in the first aspect is used to obtain a rich afterimage data set as training samples for training the fingerprint anti-counterfeiting model, so that the trained fingerprint anti-counterfeiting model can identify whether the image to be detected is a real fingerprint image or a fingerprint afterimage image. If the detection result determines that the image to be detected belongs to a fingerprint afterimage image, it means that the fingerprint in the currently input image to be detected is a forged fingerprint. If the detection result determines that the image to be detected belongs to a real fingerprint image, it means that the fingerprint in the currently input image to be detected is a real fingerprint. Further, the training samples can be training sample pairs including fingerprint afterimage images and real fingerprint images. When the input training sample is a fingerprint afterimage image generated by the fingerprint afterimage image generation model, the label of this training sample is set as a negative sample (indicating that the detection result should be "belongs to a forged fingerprint"). When the input training sample is a real fingerprint image, the label of this training sample is set as a positive sample (indicating that the detection result should be "belongs to a real human finger fingerprint"). Or, the fingerprint afterimage image generated by the fingerprint afterimage image generation model and the corresponding real fingerprint image can be used as a pair of training samples to train the fingerprint anti-counterfeiting model at the same time. Exemplarily, the real fingerprint image A is input into the fingerprint afterimage image generation model to obtain the generated fingerprint afterimage image B, and the real fingerprint image A and the fingerprint afterimage image B are used as a pair of training samples and input into the fingerprint anti-counterfeiting model for training. The generated training samples can also be used to verify and optimize the trained anti-counterfeiting model to ensure its stability and anti-attack ability in actual applications.
[0080] In the embodiment of the present application, a fingerprint afterimage generation model trained by the first aspect is used to obtain a rich afterimage dataset as training samples to train the model, which solves the problem of difficult acquisition of afterimage data, makes the trained fingerprint anti-counterfeiting model more stable in practical applications, difficult to be broken, and improves the security of the fingerprint unlocking system. And by using the fingerprint afterimage generation model to obtain training samples, the dependence on the acquisition of high-cost afterimage data is reduced, the overall data acquisition and model training costs are lowered, and the economic benefits are improved. In summary, through the fingerprint afterimage generation model trained in the present application, an effective fingerprint afterimage attack data augmentation scheme is provided, and the anti-counterfeiting model is trained with diversified high-quality afterimage data, significantly improving the performance and stability of the fingerprint afterimage anti-counterfeiting model and making it more reliable in practical applications.
[0081] In the fourth aspect of the embodiment of the present application, a fingerprint afterimage generation model training device is further provided. Refer to Figure 6 , Figure 6 which shows a schematic structural diagram of a fingerprint afterimage generation model training device. As Figure 6 shown, it includes: A fingerprint image sample pair acquisition module, configured to obtain a plurality of fingerprint image sample pairs, and each fingerprint image sample pair includes: a real fingerprint image sample of the same finger and a corresponding fingerprint afterimage sample; A training module, configured to train a model to be trained based on a plurality of fingerprint image sample pairs to obtain a fingerprint afterimage generation model; The fingerprint afterimage generation model learns a generation method for generating fingerprint afterimage images according to real fingerprint image samples and corresponding fingerprint afterimage samples.
[0082] In a possible implementation manner, the model to be trained includes a first branch and a second branch; the training of the model to be trained based on a plurality of fingerprint image sample pairs to obtain a fingerprint afterimage generation model includes: Training the first branch and the second branch based on a plurality of fingerprint image sample pairs; Determining the trained second branch as the fingerprint afterimage generation model.
[0083] In a possible implementation manner, the training of the first branch and the second branch based on a plurality of fingerprint image sample pairs includes: Adding noise to the fingerprint afterimage samples in each fingerprint image sample pair to obtain noisy fingerprint afterimage samples; Inputting the noisy fingerprint afterimage samples into the first branch, and inputting the corresponding real fingerprint image samples into the second branch; Through the first branch, predict the residual feature distribution of the fingerprint residual image sample to learn and generate the first generation method of the fingerprint residual image; Through the second branch, based on the first generation method, predict the residual feature distribution of the fingerprint residual image sample to learn and generate the second generation method of the fingerprint residual image.
[0084] In a possible implementation manner, training the first branch and the second branch based on multiple pairs of fingerprint image samples includes: Add noise to the fingerprint residual image sample in each pair of fingerprint image samples to obtain a noisy fingerprint residual image sample, and add noise to the corresponding real fingerprint image sample to obtain a noisy real fingerprint image sample; Input the noisy fingerprint residual image sample into the first branch, and input the corresponding real fingerprint image sample and the noisy real fingerprint image sample into the second branch; Through the first branch, predict the residual feature distribution of the fingerprint residual image sample to learn and generate the first generation method of the fingerprint residual image; Through the second branch, based on the first generation method, predict the residual feature distribution of the fingerprint residual image sample to learn and generate the second generation method of the fingerprint residual image.
[0085] In a possible implementation manner, the training stage of the model parameters of the to-be-trained model includes: multiple updates of the model parameters of the to-be-trained model; one update process of the model parameters of the to-be-trained model includes: Obtain the first fingerprint residual generation map output by the first branch based on the noisy fingerprint residual image sample; Update the model parameters of the first branch based on the first fingerprint residual generation map and the fingerprint residual image sample; Share the updated model parameters of the first branch with the second branch to obtain the second branch with updated model parameters; Obtain the second fingerprint residual generation map output by the second branch with updated model parameters based on the real fingerprint image sample; Based on the second fingerprint residual generation map and the fingerprint residual image sample, update the model parameters of the second branch again.
[0086] In a possible implementation manner, the training stage of the model parameters of the to-be-trained model includes: the training stage of the first branch and the training stage of the second branch; The training process of the first branch includes: Obtain the first fingerprint afterimage generation map output by the first branch based on the noisy fingerprint afterimage image sample; Based on the first fingerprint afterimage generation map and the fingerprint afterimage image sample, iteratively update the model parameters of the first branch until the first branch is trained; The training process of the second branch includes: Use the model parameters of the trained first branch to initialize the model parameters of the second branch to obtain the second branch after initializing the model parameters; Obtain the second fingerprint afterimage generation map output by the second branch after initializing the model parameters based on the real fingerprint image sample; Based on the second fingerprint afterimage generation map and the fingerprint afterimage image sample, iteratively update the model parameters of the second branch until the second branch is trained.
[0087] The fifth aspect of the embodiments of the present application also provides a fingerprint afterimage image generation device. Refer to Figure 7 , Figure 7 shows a schematic structural diagram of a fingerprint afterimage image generation device, as Figure 7 shown, including: A fingerprint afterimage image generation module, configured to input a real fingerprint image into a fingerprint afterimage image generation model to obtain a fingerprint afterimage image; Wherein, the fingerprint afterimage image generation model is obtained according to the model training method described in the first aspect of the embodiments of the present application.
[0088] The sixth aspect of the embodiments of the present application also provides a fingerprint anti-counterfeiting device. Refer to Figure 8 , Figure 8 shows a schematic structural diagram of a fingerprint anti-counterfeiting device, as Figure 8 shown, including: An anti-counterfeiting detection module, configured to input a to-be-detected image into a fingerprint anti-counterfeiting model to obtain an anti-counterfeiting detection result; the anti-counterfeiting detection result indicates whether the to-be-detected image is a real fingerprint image; Wherein, the training samples of the fingerprint anti-counterfeiting model at least include: fingerprint afterimage images generated by a fingerprint afterimage image generation model, and the fingerprint afterimage image generation model is obtained according to the fingerprint afterimage image generation model training method described in the first aspect of the embodiments of the present application.
[0089] The embodiments of the present application also provide an electronic device. Refer to Figure 9 , Figure 9 is a schematic structural diagram of the electronic device proposed in the embodiments of the present application. As Figure 9As shown in the figure, the electronic device 100 includes: a memory 110 and a processor 120. The memory 110 and the processor 120 are communicatively connected via a bus. A computer program is stored in the memory 110, and the computer program can run on the processor 120, thereby implementing the steps of the fingerprint afterimage image generation model training method described in the first aspect of the embodiments of the present application, or implementing the steps of the fingerprint afterimage image generation method described in the second aspect of the embodiments of the present application, or implementing the steps of the fingerprint anti-counterfeiting method described in the third aspect of the embodiments of the present application.
[0090] The embodiments of the present application also provide a computer-readable storage medium, on which a computer program / instruction is stored. When the computer program / instruction is executed by a processor, it implements the steps of the fingerprint afterimage image generation model training method described in the first aspect of the embodiments of the present application, or implements the steps of the fingerprint afterimage image generation method described in the second aspect of the embodiments of the present application, or implements the steps of the fingerprint anti-counterfeiting method described in the third aspect of the embodiments of the present application.
[0091] The various embodiments in this specification are all described in a progressive manner. Each embodiment focuses on the differences from other embodiments. For the same or similar parts among the various embodiments, reference can be made to each other.
[0092] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of methods, apparatuses, electronic devices, and computer program products according to the embodiments of the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal devices generate a device for implementing the specified function in Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.
[0093] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal device to work in a specific manner, so that the instructions stored in the computer-readable memory generate a manufactured article including an instruction device, and the instruction device implements the specified function in Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.
[0094] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device, so that a series of operation steps are executed on the computer or other programmable terminal device to generate a computer-implemented process, and thus the instructions executed on the computer or other programmable terminal device provide for implementing the process Figure 1 in one process or multiple processes and / or boxes Figure 1 the steps of the functions specified in one box or multiple boxes.
[0095] Although the preferred embodiments of the embodiments of the present application have been described, those skilled in the art can make additional changes and modifications once they learn the basic creative concepts. Therefore, the appended claims are intended to be construed to include the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present application.
[0096] Finally, it should also be noted that in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or terminal device comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or terminal device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or terminal device comprising the element.
[0097] The above has introduced in detail a method for training an image generation model, an image generation method, an anti-counterfeiting method and product provided by the present application. Specific examples are used in this article to elaborate on the principle and implementation manner of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application; at the same time, for those of ordinary skill in the art, according to the idea of the present application, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present application.
Claims
1. A method for training a fingerprint afterimage generation model, characterized in that, Including: Obtaining a plurality of fingerprint image sample pairs, each fingerprint image sample pair including: a real fingerprint image sample of the same finger and a corresponding fingerprint ghost image sample; Training a model to be trained based on the plurality of fingerprint image sample pairs to obtain a fingerprint ghost image generation model; the fingerprint ghost image generation model learns a generation method for generating a fingerprint ghost image according to the real fingerprint image sample and the corresponding fingerprint ghost image sample.
2. The method for training a fingerprint afterimage generation model according to claim 1, wherein The model to be trained includes a first branch and a second branch; the training the model to be trained based on the plurality of fingerprint image sample pairs to obtain a fingerprint ghost image generation model includes: Training the first branch and the second branch based on the plurality of fingerprint image sample pairs; Determining the trained second branch as the fingerprint ghost image generation model.
3. The fingerprint afterimage image generation model training method according to claim 2, wherein The training the first branch and the second branch based on the plurality of fingerprint image sample pairs includes: Adding noise to the fingerprint ghost image sample in each fingerprint image sample pair to obtain a noisy fingerprint ghost image sample; Inputting the noisy fingerprint ghost image sample into the first branch, and inputting the corresponding real fingerprint image sample into the second branch; Predicting the ghost feature distribution of the fingerprint ghost image sample through the first branch to learn a first generation method for generating a fingerprint ghost image; Predicting the ghost feature distribution of the fingerprint ghost image sample through the second branch based on the first generation method to learn a second generation method for generating a fingerprint ghost image.
4. The fingerprint afterimage image generation model training method according to claim 2, wherein; The training the first branch and the second branch based on the plurality of fingerprint image sample pairs includes: Adding noise to the fingerprint ghost image sample in each fingerprint image sample pair to obtain a noisy fingerprint ghost image sample, and adding noise to the corresponding real fingerprint image sample to obtain a noisy real fingerprint image sample; Inputting the noisy fingerprint ghost image sample into the first branch, and inputting the corresponding real fingerprint image sample and the noisy real fingerprint image sample into the second branch; Predicting the ghost feature distribution of the fingerprint ghost image sample through the first branch to learn a first generation method for generating a fingerprint ghost image; Predicting the ghost feature distribution of the fingerprint ghost image sample through the second branch based on the first generation method to learn a second generation method for generating a fingerprint ghost image.
5. The method for training a fingerprint afterimage generation model according to any one of claims 2-4, characterized in that, The training stage of the model parameters of the model to be trained includes: multiple updates of the model parameters of the model to be trained; one update process of the model parameters of the model to be trained includes: Obtaining a first fingerprint ghost generation map output by the first branch based on the noisy fingerprint ghost image sample; Updating the model parameters of the first branch based on the first fingerprint ghost generation map and the fingerprint ghost image sample; Sharing the updated model parameters of the first branch with the second branch to obtain a second branch with updated model parameters; Obtaining a second fingerprint ghost generation map output by the second branch with updated model parameters based on the real fingerprint image sample; Based on the second fingerprint afterimage generation map and the fingerprint afterimage image samples, the model parameters of the second branch are updated again.
6. The fingerprint afterimage image generation model training method according to any one of claims 2-4, characterized in that, The training stage of the model parameters of the model to be trained includes: the stage of training the first branch and the stage of training the second branch; The training process of the first branch includes: Obtaining a first fingerprint afterimage generation map output by the first branch based on the noisy fingerprint afterimage image samples; Based on the first fingerprint afterimage generation map and the fingerprint afterimage image samples, iteratively update the model parameters of the first branch until the first branch is trained; The training process of the second branch includes: Initializing the model parameters of the second branch by using the model parameters of the trained first branch to obtain the second branch after the model parameters are initialized; Obtaining a second fingerprint afterimage generation map output by the second branch after the model parameters are initialized based on the real fingerprint image samples; Based on the second fingerprint afterimage generation map and the fingerprint afterimage image samples, iteratively update the model parameters of the second branch until the second branch is trained.
7. A method for generating a fingerprint afterimage, characterized in that, Including: Inputting a real fingerprint image into a fingerprint afterimage image generation model to obtain a fingerprint afterimage image; Wherein, the fingerprint afterimage image generation model is obtained by the model training method according to any one of claims 1-6.
8. A fingerprint anti-counterfeiting method, characterized in that, Including: Inputting an image to be detected into a fingerprint anti-counterfeiting model to obtain an anti-counterfeiting detection result; The anti-counterfeiting detection result indicates whether the image to be detected is a real fingerprint image; Wherein, the training samples of the fingerprint anti-counterfeiting model at least include: fingerprint afterimage images generated by the fingerprint afterimage image generation model, and the fingerprint afterimage image generation model is obtained by the fingerprint afterimage image generation model training method according to any one of claims 1-6.
9. A training device for a fingerprint afterimage generation model, characterized in that, Including: A fingerprint image sample pair acquisition module, configured to obtain a plurality of fingerprint image sample pairs, and each fingerprint image sample pair includes: a real fingerprint image sample of the same finger and a corresponding fingerprint afterimage image sample; A training module, configured to train a model to be trained based on a plurality of fingerprint image sample pairs to obtain a fingerprint afterimage image generation model; The fingerprint afterimage image generation model learns a generation method of generating a fingerprint afterimage image according to a real fingerprint image sample and a corresponding fingerprint afterimage image sample.
10. An electronic device, comprising a memory and a processor, wherein a computer program capable of running on the processor is stored on the memory, characterized in that, When the processor executes the computer program, it implements the steps of the fingerprint afterimage image generation model training method according to any one of claims 1 to 6 above, or implements the steps of the fingerprint afterimage image generation method according to claim 7 above, or implements the steps of the fingerprint anti-counterfeiting method according to claim 8 above.
11. A computer-readable storage medium, characterized in that, Stored thereon is a computer program, which when executed by a processor implements the steps of the fingerprint afterimage image generation model training method according to any one of claims 1 to 6 above, or implements the steps of the fingerprint afterimage image generation method according to claim 7 above, or implements the steps of the fingerprint anti-counterfeiting method according to claim 8 above.