A method and system for improving the generalization ability of living body detection algorithm
By learning the imaging characteristics of different hardware devices in the live detection algorithm and using the fit relationship optimization algorithm, the problem of poor generalization ability after the device is replaced is solved, and efficient live detection on new devices is achieved.
Patent Information
- Application Number
- CN202211018464.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-24
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2042-08-24
AI Technical Summary
The existing live detection algorithm has poor generalization capabilities after hardware equipment replacement, and requires a large number of repeated collection of training data to optimize, which is time-consuming and labor-intensive.
By training the first feature extraction algorithm based on the first training data set, learning the inherent features of imaging of different hardware devices, using the fitting relationship to combine the feature vectors of the new hardware device with the original feature vectors, and optimizing the live detection algorithm.
The generalization ability of live detection algorithms on new devices has been improved, the dependence on new device training data has been reduced, and time and resources have been saved.
Smart Images

Figure CN115294663B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of pattern recognition, and in particular to a method and system for improving the generalization capability of a living body detection algorithm. Background Art
[0002] As facial recognition technology matures, it's becoming increasingly ubiquitous in everyday life, from access control and clocking in, to commuting and checking in at hotels. While we enjoy the convenience of this technology, we must also address its potential risks. A successful fake face attack could potentially cause significant losses to users, making the performance of liveness detection algorithms crucial.
[0003] Current liveness detection algorithms, depending on the device, are primarily categorized as those based on two-dimensional RGB cameras, infrared (IR) cameras, and three-dimensional depth cameras. Currently, fake faces primarily come in the form of photos, videos, and masks. The diversity of attack methods and scenarios can result in very small differences between the images of attack faces on devices and those of real people, even making them indistinguishable to the naked eye. To improve performance, liveness detection algorithms learn subtle distinguishing features. Hardware upgrades, such as the ISP chip and camera module, can alter the overall image quality and quality. When these changes are significant, the subtle distinguishing features learned by the algorithm on the original real-person and attack data may no longer be applicable to the new device, resulting in poor generalization. In this case, it is often necessary to collect a large amount of real-person and attack training data on the new device to optimize the algorithm. If there are many new devices, repeated training data collection and optimization are necessary, which is time-consuming and labor-intensive. Summary of the Invention
[0004] In view of this, embodiments of the present disclosure provide a method and system for improving the generalization capability of a liveness detection algorithm, which at least partially solve the problems existing in the prior art.
[0005] In a first aspect, embodiments of the present disclosure provide a method for improving the generalization capability of a liveness detection algorithm, comprising the following steps:
[0006] Training a first feature extraction algorithm based on the first training data set to learn inherent features of imaging of different hardware devices;
[0007] In the first data set, a number of first sample images collected by each hardware device are randomly selected, and the images are input into a first feature extraction algorithm to calculate feature vectors to obtain a central feature vector of the hardware device, i.e., a first central feature vector. The first central feature vectors of all hardware devices are combined into a first feature vector group.
[0008] Collect a small batch of second sample images of real people and attackers based on the new hardware device;
[0009] Inputting the second sample image into the first feature extraction algorithm to calculate the feature vector to obtain a second feature vector group;
[0010] Randomly selecting a random eigenvector from the first eigenvector group, fitting the random eigenvector with the second eigenvector group to obtain a fitting relationship between the two;
[0011] Calculate the central eigenvector of the new hardware device based on the second eigenvector group, that is, the second central eigenvector, and add it to the first eigenvector group;
[0012] Randomly extract a part of the pictures corresponding to the random feature vectors and perform fitting relationship transformation. Add the transformed pictures to the training set, train and optimize the original liveness algorithm to obtain a new liveness algorithm.
[0013] Furthermore, the first central eigenvector is obtained by averaging the eigenvectors.
[0014] Furthermore, the first feature extraction algorithm inputs images captured by different hardware devices, the feature extraction label is the hardware device number, and the output is a one-dimensional feature vector.
[0015] Optionally, the feature vector length may be 512.
[0016] Optionally, the first sample pictures may be 1000-5000 pictures.
[0017] Furthermore, the second sample images include multiple real people in different environments and multiple attack body images in different environments and different attack methods.
[0018] Furthermore, the fitting relationship may be a quadratic polynomial.
[0019] Optionally, the fitting relationship expression is:
[0020]
[0021] Where B={B1,B2,…,B n},a={a1,a2,…,a n}, B is the second eigenvector group, a is the eigenvector, r1, r2, r3 are fitting parameters.
[0022] In a second aspect, embodiments of the present disclosure provide a system for improving the generalization capability of a liveness detection algorithm, including:
[0023] A first sample image acquisition module, a first feature extraction module, a first feature vector group acquisition module, a second sample image acquisition module, a second feature vector group acquisition module, a fitting module, and a training optimization module, wherein:
[0024] The first sample image acquisition module is used to acquire the first sample image based on different hardware devices;
[0025] A first feature extraction module, configured to train a first feature extraction algorithm based on a first training data set to learn inherent features of imaging from different hardware devices;
[0026] The first feature vector group acquisition module is configured to randomly select a number of first sample images collected by each hardware device from the first data set, input the first feature extraction algorithm to calculate feature vectors, average the obtained feature vectors to obtain a central feature vector of the hardware device, i.e., a first central feature vector, and form the first central feature vectors of all hardware devices into a first feature vector group;
[0027] The second sample image acquisition module is used to collect small batches of images of real people and attackers based on new hardware devices;
[0028] The second feature vector group acquisition module is used to input the second sample image into the first feature extraction algorithm to calculate the feature vector to obtain a second feature vector group; calculate the central feature vector of the new hardware device based on the second feature vector group, that is, the second central feature vector, and add it to the first feature vector group;
[0029] The fitting module is used to randomly select a random feature vector from the first feature vector group, fit the random feature vector with the second feature vector group, and obtain a fitting relationship between the two;
[0030] The training optimization module is used to randomly extract a portion of pictures corresponding to random feature vectors for fitting relationship transformation, add the transformed pictures to the training set, and train and optimize the original live algorithm to obtain a new live algorithm.
[0031] In a third aspect, an embodiment of the present disclosure further provides a non-transitory computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable the computer to execute the method for improving the generalization ability of the living body detection algorithm in the aforementioned first aspect or any implementation of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0033] Figure 1 A flowchart of a method for improving the generalization capability of a liveness detection algorithm provided by an embodiment of the present disclosure;
[0034] Figure 2 A schematic diagram of a system for improving the generalization capability of a liveness detection algorithm provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0035] The embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.
[0036] The following describes the embodiments of the present disclosure through specific examples, and those skilled in the art can easily understand other advantages and effects of the present disclosure from the contents disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, rather than all of the embodiments. The present disclosure can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present disclosure. It should be noted that, in the absence of conflict, the following embodiments and features in the embodiments can be combined with each other. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present disclosure.
[0037] It should be noted that various aspects of the embodiments within the scope of the appended claims are described below. It should be apparent that the aspects described herein can be embodied in a wide variety of forms, and any specific structure and / or function described herein is merely illustrative. Based on this disclosure, it should be understood by those skilled in the art that an aspect described herein can be implemented independently of any other aspect, and two or more of these aspects can be combined in various ways. For example, any number of aspects described herein can be used to implement an apparatus and / or practice a method. In addition, other structures and / or functionalities other than one or more of the aspects described herein can be used to implement this apparatus and / or practice this method.
[0038] It should also be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present disclosure. The illustrations only show components related to the present disclosure and are not drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component can be changed at will, and the component layout type may also be more complicated.
[0039] Additionally, in the following description, specific details are provided to provide a thorough understanding of the examples. However, one skilled in the art will appreciate that the aspects described can be practiced without these specific details.
[0040] Figure 1 A schematic diagram of a method 100 for improving the generalization capability of a living body detection algorithm according to the present invention is shown.
[0041] like Figure 1As shown, at step S102, a first feature extraction algorithm is trained based on a first training data set to learn inherent features of imaging of different hardware devices.
[0042] Specifically, the first feature extraction algorithm may input images captured by different hardware devices, the feature extraction label may be the hardware device number, and the output may be a one-dimensional feature vector.
[0043] Next, go to step S104, randomly select several sample images collected by each hardware device in the first data set, i.e., the first sample images, input the first feature extraction algorithm to calculate the feature vector, average the obtained feature vectors to obtain the central feature vector of the hardware device, i.e., the first central feature vector, and form the first central feature vectors of all hardware devices into a first feature vector group.
[0044] Specifically, for example, in some aspects of the embodiments of the present disclosure, the first sample images may be 1000-5000 images.
[0045] Next, go to step S106. At step S106, a small batch of images of real people and attackers, i.e., second sample images, are collected based on the new hardware device.
[0046] Furthermore, the second sample images include multiple real people in different environments and multiple attacking body images in different environments and different attacking methods;
[0047] The number of the second sample image samples is 1000-5000.
[0048] Next, the process goes to step S108 . In step S108 , the second sample image is input into the first feature extraction algorithm to calculate the feature vector, thereby obtaining a second feature vector group.
[0049] Next, the process goes to step S110 . In step S110 , a random eigenvector a is randomly selected from the first eigenvector group, and the random eigenvector a is fitted with the second eigenvector group to obtain a fitting relationship f between the two.
[0050] Specifically, for example, in some aspects of the embodiments of the present disclosure, the fitting relationship f may be a quadratic polynomial; the expression is:
[0051]
[0052] Where B={B1,B2,…,B n},a={a1,a2,…,a n}, B is the second eigenvector group, a is a random eigenvector, r1, r2, r3 are fitting parameters.
[0053] Next, the process goes to step S112 . In step S112 , a central eigenvector of the new hardware device, ie, a second central eigenvector, is calculated based on the second eigenvector group and added to the first eigenvector group.
[0054] Next, go to step S114. In step S114, randomly select a portion of pictures corresponding to the feature vector a and perform fitting relationship f transformation. The transformed pictures are added to the training set, and the original live algorithm is trained and optimized to obtain a new live algorithm.
[0055] As described above with reference to steps S102-S114, this embodiment constructs a training algorithm F to find the mapping relationship between images collected on the new hardware device and images collected on the original hardware device, and performs data transformation on part of the data in the original data set, which is equivalent to data augmentation of the original data set. In this way, the living algorithm trained can also perform well on the new device, thereby avoiding the need to collect a large number of new device images to optimize the algorithm model.
[0056] Figure 2 A system 300 for improving the generalization capability of a living body detection algorithm according to the present invention is shown.
[0057] like Figure 2 As shown, the apparatus 300 includes a first sample image acquisition module 302 , a first feature extraction module 304 , a first feature vector group acquisition module 306 , a second sample image acquisition module 308 , a second feature vector group acquisition module 310 , a fitting module 312 , and a training optimization module 314 .
[0058] The first sample image acquisition module 302 is used to acquire first sample images based on different hardware devices;
[0059] A first feature extraction module 304 is configured to train a first feature extraction algorithm based on a first training data set to learn inherent features of imaging from different hardware devices;
[0060] The first feature extraction algorithm inputs images collected by different hardware devices, the feature extraction label is the hardware device number, and the output is a one-dimensional feature vector.
[0061] Optionally, the feature vector length may be 512.
[0062] The first feature vector group acquisition module 306 is used to randomly select a number of first sample images collected by each hardware device in the first data set, input the first feature extraction algorithm to calculate the feature vector, average the obtained feature vectors to obtain the central feature vector of the hardware device, that is, the first central feature vector, and form the first central feature vectors of all hardware devices into a first feature vector group.
[0063] The second sample image collection module 308 is used to collect small batches of images of real people and attackers based on the new hardware device;
[0064] Furthermore, the second sample images include multiple real people in different environments and multiple attacking body images in different environments and different attacking methods;
[0065] The second feature vector group acquisition module 310 is used to input the second sample image into the first feature extraction algorithm to calculate the feature vector to obtain the second feature vector group; calculate the central feature vector of the new hardware device based on the second feature vector group, that is, the second central feature vector, and add it to the first feature vector group.
[0066] The fitting module 312 is configured to randomly select a random eigenvector a from the first eigenvector group, fit the eigenvector a with the second eigenvector group, and obtain a fitting relationship f between the two.
[0067] Optionally, the fitting relationship f may be a quadratic polynomial; the expression is:
[0068]
[0069] Where B={B1,B2,…,B n},a={a1,a2,…,a n}, B is the second eigenvector group, a is a random eigenvector, r1, r2, r3 are fitting parameters.
[0070] The training optimization module 314 is used to randomly extract a portion of pictures corresponding to the feature vector a and perform fitting relationship f transformation, add the transformed pictures to the training set, and train and optimize the original live body algorithm to obtain a new live body algorithm.
[0071] In another aspect of the present invention, a non-transitory computer-readable storage medium is also provided, which stores computer instructions. When executed by one or more processors, the computer instructions enable the one or more processors to execute the aforementioned method for improving the generalization capability of the living body detection algorithm.
[0072] The above description is merely a specific embodiment of the present disclosure, but the scope of protection of the present disclosure is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this disclosure should be included in the scope of protection of the present disclosure. Therefore, the scope of protection of the present disclosure should be based on the scope of protection of the claims.
Claims
1. A method for improving the generalization ability of a liveness detection algorithm, characterized in that: include: Training a first feature extraction algorithm based on the first training data set to learn inherent features of imaging of different hardware devices; In the first data set, a number of first sample images collected by each hardware device are randomly selected and input into a first feature extraction algorithm to calculate a feature vector, thereby obtaining a central feature vector of the hardware device, i.e., a first central feature vector. The first central feature vectors of all hardware devices are combined into a first feature vector group. Collect a second sample of images of real people and attackers based on the new hardware device; Inputting the second sample image into the first feature extraction algorithm to calculate the feature vector to obtain a second feature vector group; Randomly selecting a random eigenvector from the first eigenvector group, fitting the random eigenvector with the second eigenvector group to obtain a fitting relationship between the two; Calculating a central eigenvector of the new hardware device based on the second eigenvector group, that is, a second central eigenvector, and adding it to the first eigenvector group; Randomly extract a part of the pictures corresponding to the random feature vectors and perform fitting relationship transformation. Add the transformed pictures to the training set, train and optimize the original liveness algorithm to obtain a new liveness algorithm.
2. The method for improving the generalization ability of a living body detection algorithm according to claim 1, characterized in that: The first central eigenvector is obtained by averaging the eigenvectors.
3. The method for improving the generalization ability of a living body detection algorithm according to claim 1, characterized in that: The first feature extraction algorithm inputs images collected by different hardware devices, the feature extraction label is the hardware device number, and the output is a one-dimensional feature vector.
4. The method for improving the generalization ability of a living body detection algorithm according to claim 3, characterized in that: The feature vector length is 512.
5. The method for improving the algorithmic capability of liveness detection according to claim 1, characterized in that: The first sample images are 1000-5000 images.
6. The method for improving the generalization ability of a living body detection algorithm according to claim 1, characterized in that: The second sample images include multiple real people in different environments and multiple attack body images in different environments and different attack methods.
7. The method for improving the generalization ability of a living body detection algorithm according to claim 1, characterized in that: The fitting relationship is a quadratic polynomial.
8. The method for improving the generalization ability of a living body detection algorithm according to claim 7, characterized in that: The expression is: Where B={B1,B2,…,B n },a={a1,a2,…,a n }, B is the second eigenvector group, a is a random eigenvector, r1, r2, r3 are fitting parameters.
9. A system for improving the generalization ability of a liveness detection algorithm, characterized in that: include: A first sample image acquisition module, a first feature extraction module, a first feature vector group acquisition module, a second sample image acquisition module, a second feature vector group acquisition module, a fitting module, and a training optimization module, wherein: The first sample image acquisition module is used to acquire the first sample image based on different hardware devices; A first feature extraction module, configured to train a first feature extraction algorithm based on a first training data set to learn inherent features of imaging from different hardware devices; The first feature vector group acquisition module is configured to randomly select a number of first sample images collected by each hardware device from the first data set, input the first feature extraction algorithm to calculate feature vectors, average the obtained feature vectors to obtain a central feature vector of the hardware device, i.e., a first central feature vector, and form the first central feature vectors of all hardware devices into a first feature vector group; The second sample image acquisition module is used to collect small batches of images of real people and attackers based on new hardware devices; The second feature vector group acquisition module is used to input the second sample image into the first feature extraction algorithm to calculate the feature vector to obtain a second feature vector group; calculate the central feature vector of the new hardware device based on the second feature vector group, that is, the second central feature vector, and add it to the first feature vector group; The fitting module is used to randomly select a random feature vector from the first feature vector group, fit the random feature vector with the second feature vector group, and obtain a fitting relationship between the two; The training optimization module is used to randomly extract a portion of pictures corresponding to random feature vectors for fitting relationship transformation, add the transformed pictures to the training set, and train and optimize the original live algorithm to obtain a new live algorithm.
10. A non-transitory computer-readable storage medium storing computer instructions, which, when executed by one or more processors, enable the one or more processors to execute the method for improving the generalization capability of a liveness detection algorithm as described in any one of claims 1-8.
Citation Information
Patent Citations
Human face living body detection method, system and device, computer equipment and storage medium
CN111680675A
Image processing method and device, electronic equipment and computer readable storage medium
CN112258579A