Facial recognition quality testing methods, systems, equipment and media
By using a quantized unit learning framework and energy function to identify abnormal face images, the problem of low recognition rate of abnormal face images in existing technologies is solved, and efficient passenger identification in railway passenger transport systems is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-21
- Publication Date
- 2026-04-03
AI Technical Summary
Existing technologies are unable to effectively identify and process abnormal facial images that occur infrequently, resulting in a low recognition rate for facial recognition systems in railway passenger transport systems, and making it impossible to predict and model abnormal facial images in advance.
A discrete quantization unit-based method is adopted to identify abnormal face images through a quantization unit learning framework and energy function. The energy distribution parameters of the face image are calculated using an encoder, a quantization unit library, and a decoder to determine whether the image is abnormal.
It improves the accuracy of passenger identification in the railway passenger transport system, reduces the difficulty of data collection and model training, and can effectively identify abnormal facial images.
Smart Images

Figure CN115761837B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of facial recognition technology, and in particular to a facial recognition quality detection method and system. Background Technology
[0002] Currently, facial recognition technology is maturing and is being widely applied across various industries. In railway passenger transport systems, facial recognition systems primarily utilize two technologies: 1:1 identity verification algorithms and 1:N face retrieval algorithms. Identity verification algorithms are used in scenarios such as real-name verification gates, 12306 APP identity verification, public security document issuance, and temporary ID cards. Face retrieval algorithms are used in scenarios such as face query machines. Both identity verification and face retrieval require facial recognition algorithms to extract relevant facial features for comparison. When the quality of the facial image is low, especially for severely blurred or artifact-ridden images, the facial features extracted by the facial recognition algorithm are often far from the features corresponding to a clear face, making it impossible to correctly identify the face. This invention refers to images where facial features cannot be extracted normally as abnormal facial images.
[0003] The existing abnormal image recognition models based on classification algorithms cannot be well applied to this scenario for the following reasons: (1) There are many reasons for the blurring of face images, which are difficult to model; (2) Abnormalities in face images are not only blurry, but also include abnormalities that cannot be predicted in advance; (3) The probability of abnormal face images is very low, making it difficult to accumulate enough representative samples for training in a short period of time.
[0004] Therefore, there is an urgent need to propose a novel abnormal face image detection method based on discrete quantization units to detect these abnormal face images, thereby improving the correct recognition rate of passengers in passenger transport scenarios. In particular, it solves the problem that abnormal face images cannot be modeled and trained, and that abnormalities cannot be identified in advance. Summary of the Invention
[0005] This application provides an abnormal face image detection method based on discrete quantization units, which is used to detect these abnormal face images, thereby improving the correct recognition rate of passengers in passenger transport scenarios. In particular, it solves the problem that abnormal face images cannot be modeled and trained, and that abnormalities cannot be identified in advance.
[0006] In a first aspect, embodiments of this application provide a face recognition quality detection method, including:
[0007] Pre-construction steps of the quantization unit learning framework: Pre-construct the quantization unit learning framework, which includes: encoder, quantization unit library and decoder, and define the number and feature dimensions of encoder, decoder and quantization unit library;
[0008] Training steps for a normal face feature quantization model: The input normal face image training data is encoded based on the encoder to obtain the encoded normal face feature map. Based on the normal face feature map and the quantization unit library, the extracted face features are discretized into multiple representative quantization units using a discrete sampling function to obtain the quantized normal face feature map. The training quantization unit learning framework is obtained by iteratively reconstructing damage.
[0009] Abnormal face image recognition steps: Based on the trained encoder and quantization unit library, for the face image to be detected, the energy of each image to the corresponding quantization unit is calculated in the quantization unit library through the energy function, and the energy distribution parameters are estimated. If the distribution parameters are greater than the preset threshold, the face image to be detected is identified as an abnormal face image.
[0010] In some embodiments of the present invention, the pre-construction step of the above-mentioned quantization unit learning framework includes:
[0011] Encoder initialization steps: Initialize the encoder, which is used to encode normal face images into the discrete space of the quantization unit library;
[0012] Steps to define a quantization cell library: Pre-determine the number of quantization cells and the dimensions of the quantization cells;
[0013] Decoder initialization steps: Initialize the decoder, which is used to restore the quantized feature map to the original image.
[0014] In some embodiments of the present invention, the training steps of the above-mentioned normal facial feature quantification model include:
[0015] Feature map calculation steps: Input normal face image training data, and calculate the feature map of the normal face image;
[0016] Steps for obtaining quantized feature maps: Input the feature map of a normal face image, query it in the quantization unit library, and obtain the quantized feature map after querying through a predefined query function;
[0017] Decoding steps: Input the quantized feature map and use the decoder to obtain the decoded image;
[0018] Damage compensation steps: Calculate the reconstruction loss and query the damage of the decoded image. The reconstruction damage is used to ensure that the features extracted by the model have the ability to represent the image, and the query damage is used to verify the consistency of the feature maps before and after quantization.
[0019] Iterative steps: Calculate the sum of the reconstruction loss and query loss of the decoded image, and obtain the trained encoder, quantization unit and decoder through repeated iterations.
[0020] In some embodiments of the present invention, the above-mentioned abnormal face image recognition steps include:
[0021] Similarity matrix calculation steps: Based on the encoder, the face image to be detected is mapped to the feature map of the face image, and the similarity matrix is calculated between the feature map and all quantization units;
[0022] Energy vector calculation steps: Calculate the energy vector of the similarity matrix through the similarity matrix, and identify abnormal face images based on the energy vector.
[0023] In some embodiments of the present invention, the above-mentioned quantization feature map acquisition step includes:
[0024] Cosine similarity calculation steps: Calculate the cosine similarity between the feature map and all elements in the quantization unit library, and calculate the similarity matrix;
[0025] The steps for obtaining the index number are as follows: Based on the shape range of the feature map, find the highest similarity value in each row of the similarity matrix, and obtain the index number of the highest similarity value. The index number corresponds to multiple quantization units.
[0026] Quantization unit extraction steps: Based on the index number, extract the corresponding number of quantization units from the quantization unit library according to the shape range of the feature map, and combine them into a quantized feature map.
[0027] In some embodiments of the present invention, the above-mentioned damage compensation step includes:
[0028] Image reconstruction loss step: Calculate the reconstruction loss based on the difference between the normal face image and the decoded image;
[0029] Query loss steps: Calculate query loss based on the feature map and the quantized feature map.
[0030] In some embodiments of the present invention, the above-mentioned energy vector calculation steps include:
[0031] Steps for calculating the energy vector of a normal face: Calculate the energy vector corresponding to all normal face images. The energy vector distribution of all normal face images follows a multi-dimensional Gaussian mixture distribution. Calculate the mean and covariance matrix of the Gaussian mixture distribution. The dimension is determined according to the outer size of the feature map.
[0032] The Mahalanobis distance calculation steps are as follows: Calculate the energy vector corresponding to the face image to be detected, and calculate the Mahalanobis distance based on the mean and covariance matrix of the Gaussian mixture distribution. If the Mahalanobis distance is greater than a predetermined threshold, the face image to be detected is determined to be an abnormal image; otherwise, it is identified as a normal image.
[0033] Secondly, embodiments of this application provide a face recognition quality detection system, employing the face recognition quality detection method described above, including:
[0034] Pre-built module for quantization unit learning framework: Pre-built quantization unit learning framework, which includes: encoder, quantization unit library and decoder, and defines the number and feature dimensions of encoder, decoder and quantization unit library;
[0035] Normal face feature quantization model training module: Based on the encoder, the input normal face image training data is encoded to obtain the encoded normal face feature map. Based on the normal face feature map and the quantization unit library, the extracted face features are discretized into multiple representative quantization units using a discrete sampling function to obtain the quantized normal face feature map. Through damage reconstruction, the model is iterated repeatedly to obtain the trained quantization unit learning framework.
[0036] Abnormal face image recognition module: Based on a trained encoder and quantization unit library, for the face image to be detected, the energy of each image to the corresponding quantization unit is calculated in the quantization unit library through the energy function, and the distribution parameters of the energy are estimated. If the distribution parameters are greater than a preset threshold, the face image to be detected is identified as an abnormal face image.
[0037] Thirdly, embodiments of this application provide a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the face recognition quality detection method as described above.
[0038] Fourthly, embodiments of this application provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the face recognition quality detection method described above.
[0039] Compared with existing technologies, it has the following outstanding advantages:
[0040] 1. This invention is an abnormal face image detection method based on discrete quantization units. It learns the quantization units corresponding to multiple normal faces, calculates the energy of each image to its corresponding quantization unit in discrete space using an energy function, estimates the energy distribution parameters, and determines whether the image is an abnormal sample based on the different positions of the energy corresponding to the face image in the distribution. If the image is determined to be abnormal, the passenger is required to re-authenticate their face.
[0041] 2. The method of the present invention does not require data collection, classification and modeling of specific abnormal face image data. It only needs to collect normal samples and calculate the energy distribution between them and normal samples to determine whether they are abnormal, which greatly reduces the difficulty of data collection and model training. Attached Figure Description
[0042] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0043] Figure 1 This is a flowchart of the facial recognition quality detection method for railway passenger transport according to the present invention;
[0044] Figure 2 This is a flowchart of the quantization unit learning framework in a specific embodiment of the present invention;
[0045] Figure 3 This is a flowchart illustrating the calculation of the face image energy vector in a specific embodiment of the present invention.
[0046] Figure 4 This is a schematic diagram of the facial recognition quality inspection system for railway passenger transport according to the present invention;
[0047] Figure 5 This is a schematic diagram of the hardware structure of a computer device according to an embodiment of this application.
[0048] In the above image:
[0049] 10 Quantization Unit Learning Framework Pre-built Modules; 20 Normal Face Feature Quantization Model Training Modules
[0050] 30 Abnormal face image recognition module. Detailed Implementation
[0051] To make the objectives, technical solutions, and advantages of this application clearer, the application is described and illustrated below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application. All other embodiments obtained by those skilled in the art based on the embodiments provided in this application without inventive effort are within the scope of protection of this application.
[0052] Obviously, the accompanying drawings described below are merely some examples or embodiments of this application. Those skilled in the art can apply this application to other similar scenarios based on these drawings without any inventive effort. Furthermore, it is understood that although the efforts made in this development process may be complex and lengthy, for those skilled in the art related to the content disclosed in this application, any changes to design, manufacturing, or production based on the technical content disclosed in this application are merely conventional technical means and should not be construed as insufficient disclosure of the content of this application.
[0053] Details of one or more embodiments of this application are set forth in the following drawings and description to make other features, objects and advantages of this application more readily apparent.
[0054] In this application, the reference to "embodiment" means that a specific feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment that is mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described in this application may be combined with other embodiments without conflict.
[0055] Unless otherwise defined, the technical or scientific terms used in this application shall have the ordinary meaning understood by one of ordinary skill in the art to which this application pertains. The terms “a,” “an,” “an,” “the,” and similar words used in this application do not indicate quantity limitation and may indicate singular or plural. The terms “comprising,” “including,” “having,” and any variations thereof used in this application are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or device that includes a series of steps or modules (units) is not limited to the listed steps or units, but may also include steps or units not listed, or may include other steps or units inherent to these processes, methods, products, or devices. The terms “connected,” “linked,” “coupled,” and similar words used in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. “Multiple” used in this application refers to two or more. “And / or” describes the relationship between related objects, indicating that three relationships may exist; for example, “A and / or B” can represent: A alone, A and B simultaneously, and B alone. The character " / " generally indicates that the preceding and following objects are in an "or" relationship. The terms "first," "second," and "third" used in this application are merely to distinguish similar objects and do not represent a specific ordering of the objects.
[0056] This invention aims to endow existing railway passenger transport system equipment with the ability to identify abnormal face samples by defining quantization units of normal face features and using these units as the basis for identifying abnormal face images. The method described in this invention is a specific implementation of the above process, including (1) acquiring quantization units of normal face features; and (2) how to use these quantization units to identify abnormal face images.
[0057] This invention is an abnormal face image detection method based on discrete quantization units. By learning the quantization units corresponding to multiple normal faces, it uses an energy function to calculate the energy of each image to its corresponding quantization unit in discrete space, estimates the energy distribution parameters, and determines whether the image is an abnormal sample based on the different positions of the energy corresponding to the face image in the distribution. If an image is determined to be abnormal, the passenger is required to re-authenticate their face.
[0058] like Figure 1 As shown in the figure, this application provides a face recognition quality detection method, including:
[0059] Quantization unit learning framework pre-construction step S10: Pre-construct the quantization unit learning framework, which includes: encoder, quantization unit library and decoder, and defines the number and feature dimensions of encoder, decoder and quantization unit library;
[0060] Normal face feature quantization model training step S20: The input normal face image training data is encoded based on the encoder to obtain the encoded normal face feature map. Based on the normal face feature map and the quantization unit library, the extracted face features are discretized into multiple representative quantization units using a discrete sampling function to obtain the quantized normal face feature map. The training quantization unit learning framework is obtained by iteratively reconstructing damage.
[0061] Abnormal face image recognition step S30: Based on the trained encoder and quantization unit library, for the face image to be detected, the energy of each image to the corresponding quantization unit is calculated in the quantization unit library through the energy function, and the distribution parameters of the energy are estimated. If the distribution parameters are greater than the preset threshold, the face image to be detected is identified as an abnormal face image.
[0062] In some embodiments of the present invention, the pre-construction step S10 of the quantization unit learning framework includes:
[0063] Encoder initialization steps: Initialize the encoder, which is used to encode normal face images into the discrete space of the quantization unit library;
[0064] Steps to define a quantization cell library: Pre-determine the number of quantization cells and the dimensions of the quantization cells;
[0065] Decoder initialization steps: Initialize the decoder, which is used to restore the quantized feature map to the original image.
[0066] In some embodiments of the present invention, the above-mentioned normal face feature quantization model training step S20 includes:
[0067] Feature map calculation steps: Input normal face image training data, and calculate the feature map of the normal face image;
[0068] Steps for obtaining quantized feature maps: Input the feature map of a normal face image, query it in the quantization unit library, and obtain the quantized feature map after querying through a predefined query function;
[0069] Decoding steps: Input the quantized feature map and use the decoder to obtain the decoded image;
[0070] Damage compensation steps: Calculate the reconstruction loss and query the damage of the decoded image. The reconstruction damage is used to ensure that the features extracted by the model have the ability to represent the image, and the query damage is used to verify the consistency of the feature maps before and after quantization.
[0071] Iterative steps: Calculate the sum of the reconstruction loss and query loss of the decoded image, and obtain the trained encoder, quantization unit and decoder through repeated iterations.
[0072] In some embodiments of the present invention, the above-mentioned abnormal face image recognition step S30 includes:
[0073] Similarity matrix calculation steps: Based on the encoder, the face image to be detected is mapped to the feature map of the face image, and the similarity matrix is calculated between the feature map and all quantization units;
[0074] Energy vector calculation steps: Calculate the energy vector of the similarity matrix through the similarity matrix, and identify abnormal face images based on the energy vector.
[0075] In some embodiments of the present invention, the above-mentioned quantization feature map acquisition step includes:
[0076] Cosine similarity calculation steps: Calculate the cosine similarity between the feature map and all elements in the quantization unit library, and calculate the similarity matrix;
[0077] The steps for obtaining the index number are as follows: Based on the shape range of the feature map, find the highest similarity value in each row of the similarity matrix, and obtain the index number of the highest similarity value. The index number corresponds to multiple quantization units.
[0078] Quantization unit extraction steps: Based on the index number, extract the corresponding number of quantization units from the quantization unit library according to the shape range of the feature map, and combine them into a quantized feature map.
[0079] In some embodiments of the present invention, the above-mentioned damage compensation step includes:
[0080] Image reconstruction loss step: Calculate the reconstruction loss based on the difference between the normal face image and the decoded image;
[0081] Query loss steps: Calculate query loss based on the feature map and the quantized feature map.
[0082] In some embodiments of the present invention, the above-mentioned energy vector calculation steps include:
[0083] Steps for calculating the energy vector of a normal face: Calculate the energy vector corresponding to all normal face images. The energy vector distribution of all normal face images follows a multi-dimensional Gaussian mixture distribution. Calculate the mean and covariance matrix of the Gaussian mixture distribution. The dimension is determined according to the outer size of the feature map.
[0084] The Mahalanobis distance calculation steps are as follows: Calculate the energy vector corresponding to the face image to be detected, and calculate the Mahalanobis distance based on the mean and covariance matrix of the Gaussian mixture distribution. If the Mahalanobis distance is greater than a predetermined threshold, the face image to be detected is determined to be an abnormal image; otherwise, it is identified as a normal image.
[0085] The specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings:
[0086] like Figure 2 As shown, the specific steps of a specific embodiment of the present invention are as follows:
[0087] Specifically, the implementation of the present invention is divided into two steps: (1) constructing normal facial feature quantization units; and (2) using these quantization units to identify abnormal facial images.
[0088] 1. Constructing a normal facial feature quantization unit
[0089] Compared to rare anomaly samples, there are often many normal face samples available for identification. Therefore, this invention extracts features from normal faces and discretizes these features into multiple representative quantization units, which are then used as representations of normal faces. This invention employs a learning method to obtain these quantization units, and its learning framework is as follows: Figure 2 As shown.
[0090] This framework uses a pre-defined quantization unit Q∈R N×D Where N is the number of quantization units and D is the dimension of the quantization unit. In particular, we stipulate that the modulus of the quantization unit is 1 (hence the name "unit").
[0091] An encoder is used to encode a face image into the space of quantization units. This process is F = Enc(I), where I ∈ R. H×W×3 Given an input image, F∈R hw×D The encoded feature map is represented by the encoder Enc, which can be any learnable neural network. H and W represent the length and width of the face image, while h and w represent the length and width of the feature map. Generally, h... <H,w<W。
[0092] Here, R represents the set of real numbers and indicates the domain of values for image I. Images are generally represented in computers as matrices with a shape of H x W x 3. Similarly, the values in the quantization unit Q are also real numbers, and its matrix shape is N x D.
[0093] To uniquely determine the quantization unit corresponding to the feature map F, this invention uses Gumbel-SoftMax to discretely sample the categories of feature vectors in the feature map and map them to a specific quantization unit. This process is supervised by the cross-entropy function.
[0094] To ensure the representativeness of the quantized units, we simultaneously train a corresponding decoder to reconstruct the original face image from the sampled quantized units. The decoder can be any learnable neural network corresponding to the encoder. This process is supervised using reconstruction loss; simply, the Euclidean distance between the original and reconstructed images can be calculated.
[0095] The specific model definition and training process are as follows:
[0096] I. Model Definition
[0097] Initialize the encoder Enc, which can use common neural network models such as ResNet or VGG. The process of the encoder encoding an image is F = Enc(I), where I ∈ R. H×W×3 Given an input image, F∈R hw×D The encoded feature map is shown below, where H and W represent the length and width of the face image, and h and w represent the length and width of the feature map. Generally, h... <H,w<W。
[0098] Define the number of quantization units and the feature dimensions to obtain the quantization unit library Q∈R. N×D Where N is the number of quantization units (which can be any integer, such as 100, 1000, 2000, etc.), and D is the dimension of the quantization units (generally matched with the feature dimension extracted by the selected neural network; for example, if ResNet18 is used, the dimension is 256). The feature vector at each position on the feature map F is compared with each feature unit in the quantization unit Q, and the feature unit with the highest cosine similarity is extracted to form the quantized feature map.
[0099] Initialize the decoder Dnc, its function is to convert the quantized feature map Restore to the original image, The selection of Dnc should correspond to that of the encoder Enc, constructing a codec structure similar to U-Net.
[0100] II. Model Training Process
[0101] (1) Using image I∈R H×W×3 As input, first calculate the feature map F = Enc(I) of the image;
[0102] (2) Using feature map F∈R hw×D As input, in the quantization unit library Q∈R N×D Perform a query and define a query function. The quantized feature map obtained after the query has the same structure as the feature map F, that is... The specific implementation of the query function is as follows:
[0103] <1> The cosine similarity between all elements in the feature map F and the quantization unit library Q can be calculated quickly using matrix multiplication: S = F × Q, S ∈ R hw×N .
[0104] <2> Based on the similarity matrix S, find the value with the highest similarity in each row (hw rows in total), and obtain its index number idx = argmax(S), idx∈Z hw The value of idx is an integer between 0 and N-1 (denoted by Z for the integer field), corresponding to N quantization units.
[0105] <3> Based on the index number idx, hw corresponding quantization units are extracted from Q and combined to form a new feature map, which is called the quantized feature map.
[0106] (3) Using the quantized feature map The decoder takes the input as input and uses it to obtain the decoded image.
[0107] (4) The selection of the loss function consists of two parts:
[0108] <1> Image reconstruction loss: Its purpose is to ensure that the features extracted by the model have the ability to represent the image. The implementation here is only one optional solution; other common solutions include... (Absolute value) and perceived loss (where f represents a CNN that has been pre-trained on ImageNet) etc.
[0109] <2> Query loss: Its function is to ensure a high degree of consistency between the feature maps before and after quantization. Note that... The loss is obtained by maximizing sampling in Q and cannot be directly backpropagated. To ensure that the loss can be backpropagated during training, here... The calculation can be obtained in two ways: First, directly copy the gradient from to Q, thus avoiding the problem that discrete sampling cannot backpropagate; Second, use the Gumbel-SoftMax trick to sample discrete quantization units. Any one of these methods can be adopted in the present invention. The present invention is not limited to this, and other discrete sampling functions can also be adopted.
[0110] (5) By combining the reconstruction loss and the query loss of the image L = L qry +L rec , iteratively obtain the trained encoder, quantization unit, and decoder on the training data. Finally, retain the learned encoder and quantization unit for subsequent abnormal face image detection.
[0111] 2. Identify abnormal face images
[0112] When identifying abnormal face images, first calculate the energy matrix corresponding to all normal face samples according to the process shown in Figure 3 :
[0113] (1) Use the encoder Enc to map the input image I to F: F = Enc(I), where F ∈ R hw×D
[0114] (2) Calculate the similarity between the feature map F and all quantization units, and calculate the similarity matrix S = F × Q (matrix multiplication), S ∈ R hw×N ;
[0115] (3) Through the similarity matrix, calculate the energy vector E of the similarity matrix: E = -log∑e S , E ∈ R hw , where ∑ is the summation symbol.
[0116] For clarity, <00OO286>the feature map shown in
[0117] (1) Calculate the energy vectors corresponding to all normal face images through the process of Figure 2 . Assume that the energy vector distribution of all normal face images follows a hw-dimensional mixture Gaussian distribution, and its mean value m and covariance matrix C can be calculated; <000OO290>
[0118] (2) For a given input image, calculate the energy vector E corresponding to the image and its Mahalanobis distance Δ. 2 =(Em) T C -1 (Em), when the Mahalanobis distance is too large, the image is determined to be an abnormal image; otherwise, it is accepted as a normal image, where T represents matrix transpose, C -1 This represents matrix inversion. The Mahalanobis distance is calculated as a numerical value, not a matrix or vector, and can be directly used for numerical comparison. If the Mahalanobis distance is greater than a predetermined threshold, the face image to be detected is determined to be an abnormal image; otherwise, it is identified as a normal image. The predetermined threshold can be selected as the optimal value based on the actual situation and test results according to the specific embodiments of the present invention.
[0119] Through the above process, the method described in this invention does not require data collection, classification, and modeling of specific anomalies. It only requires collecting normal samples and calculating the energy distribution between them and normal samples to determine whether an anomaly is present, which greatly reduces the difficulty of data collection and model training.
[0120] Secondly, embodiments of this application provide a face recognition quality detection system, employing the face recognition quality detection method described above, such as... Figure 4 As shown, it includes:
[0121] Quantization Unit Learning Framework Pre-built Module 10: Pre-built quantization unit learning framework, which includes: encoder, quantization unit library and decoder, and defines the number and feature dimensions of encoder, decoder and quantization unit library;
[0122] Normal face feature quantization model training module 20: Based on the encoder, the input normal face image training data is encoded to obtain the encoded normal face feature map. Based on the normal face feature map and the quantization unit library, the extracted face features are discretized into multiple representative quantization units using a discrete sampling function to obtain the quantized normal face feature map. Through damage reconstruction, the training quantization unit learning framework is obtained through repeated iterations.
[0123] Abnormal face image recognition module 30: Based on the trained encoder and quantization unit library, for the face image to be detected, the energy of each image to the corresponding quantization unit is calculated in the quantization unit library through the energy function, and the distribution parameters of the energy are estimated. If the distribution parameters are greater than the preset threshold, the face image to be detected is identified as an abnormal face image.
[0124] Thirdly, embodiments of this application provide a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that the processor executes the computer program to implement the face recognition quality detection method as described above.
[0125] Fourthly, embodiments of this application provide a computer-readable storage medium having a computer program stored thereon, characterized in that the program, when executed by a processor, implements the face recognition quality detection method as described above.
[0126] In addition, combined Figure 1 The face recognition quality detection method described in this application embodiment can be implemented by a computer device. Figure 5 This is a schematic diagram of the hardware structure of a computer device according to an embodiment of this application.
[0127] The computer device may include a processor 81 and a memory 82 storing computer program instructions.
[0128] Specifically, the processor 81 may include a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.
[0129] The memory 82 may include a mass storage device for data or instructions. For example, and not limitingly, the memory 82 may include a hard disk drive (HDD), a floppy disk drive, a solid-state drive (SSD), flash memory, an optical disk drive, a magneto-optical disk drive, magnetic tape, or a Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, the memory 82 may include removable or non-removable (or fixed) media. Where appropriate, the memory 82 may be internal or external to a data processing device. In a particular embodiment, the memory 82 is non-volatile memory. In a particular embodiment, the memory 82 includes read-only memory (ROM) and random access memory (RAM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), an electrically alterable read-only memory (EAROM), or flash memory, or a combination of two or more of these. Where appropriate, the RAM can be Static Random-Access Memory (SRAM) or Dynamic Random-Access Memory (DRAM). DRAM can be Fast Page Mode Dynamic Random-Access Memory (FPMDRAM), Extended Data Out Dynamic Random-Access Memory (EDODRAM), Synchronous Dynamic Random-Access Memory (SDRAM), etc.
[0130] The memory 82 can be used to store or cache various data files that need to be processed and / or communicated, as well as possible computer program instructions executed by the processor 81.
[0131] The processor 81 reads and executes computer program instructions stored in the memory 82 to implement any of the face recognition quality detection methods in the above embodiments.
[0132] In some embodiments, the computer device may further include a communication interface 83 and a bus 80. For example, Figure 5 As shown, the processor 81, memory 82, and communication interface 83 are connected through bus 80 and complete communication with each other.
[0133] The communication interface 83 is used to enable communication between the various modules, devices, units, and / or equipment in the embodiments of this application. The communication port 83 can also enable data communication with other components such as external devices, image / data acquisition devices, databases, external storage, and image / data processing workstations.
[0134] Bus 80 includes hardware, software, or both, that couples components of a computer device together. Bus 80 includes, but is not limited to, at least one of the following: data bus, address bus, control bus, expansion bus, and local bus. For example, and not as a limitation, bus 80 may include an Accelerated Graphics Port (AGP) or other graphics bus, an Extended Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an InfiniBand interconnect, a Low Pin Count (LPC) bus, a memory bus, a Micro Channel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local Bus (VLB) bus, or other suitable buses, or a combination of two or more of these. Where appropriate, bus 80 may include one or more buses. Although specific buses are described and illustrated in the embodiments of this application, this application considers any suitable bus or interconnection.
[0135] Compared with the prior art, the method of the present invention does not require data collection, classification and modeling of specific abnormal face image data. It only needs to collect normal samples and calculate the energy distribution between them and normal samples to determine whether they are abnormal, which greatly reduces the difficulty of data collection and model training.
[0136] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0137] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A method for detecting the quality of face recognition, characterized in that, include: Pre-construction steps of the quantization unit learning framework: Pre-construct the quantization unit learning framework, which includes: encoder, quantization unit library and decoder, and defines the number and feature dimensions of the encoder, decoder and quantization unit library; Training steps for a normal face feature quantization model: The input normal face image training data is encoded based on the encoder to obtain the encoded normal face feature map. Based on the normal face feature map and the quantization unit library, the extracted face features are discretized into multiple representative quantization units using a discrete sampling function to obtain the quantized normal face feature map. The quantization unit learning framework is obtained by iteratively applying reconstruction loss and query loss. Abnormal face image recognition steps: Based on the trained encoder and quantization unit library, for the face image to be detected, the energy of each image to the corresponding quantization unit is calculated in the quantization unit library through the energy function, and the energy distribution parameter is estimated. If the distribution parameter is greater than a preset threshold, the face image to be detected is identified as an abnormal face image, thereby realizing the detection of face recognition quality.
2. The face recognition quality detection method according to claim 1, characterized in that, The pre-construction steps of the quantization unit learning framework include: Initialize encoder step: Initialize the encoder, which is used to encode the normal face image into the discrete space of the quantization unit library; Defining the quantization unit library involves: pre-setting the number of quantization units and the dimensions of the quantization units; Decoder initialization step: Initialize the decoder, which is used to restore the quantized feature map to the original image.
3. The face recognition quality detection method according to claim 1, characterized in that, The training steps for the normal facial feature quantification model include: Feature map calculation steps: Input the normal face image training data, and calculate the feature map of the normal face image; Quantization feature map acquisition steps: Input the feature map of the normal face image, query it in the quantization unit library, and obtain the quantized feature map after querying through a predefined query function; Decoding steps: Input the quantized feature map and use the decoder to obtain the decoded image; Loss calculation steps: Calculate the reconstruction loss and query loss of the decoded image. The reconstruction loss is used to ensure that the features extracted by the model have the ability to represent the image, and the query loss is used to verify the consistency of the feature maps before and after quantization. Iterative steps: Calculate the sum of the reconstruction loss and the query loss of the decoded image, and obtain the trained encoder, quantization unit and decoder through repeated iterations.
4. The face recognition quality detection method according to claim 1, characterized in that, The abnormal face image recognition steps include: Similarity matrix calculation steps: Based on the encoder, the face image to be detected is mapped to the feature map of the face image, and the similarity matrix is calculated for the feature map and all quantization units; Energy vector calculation steps: Calculate the energy vector of the similarity matrix using the similarity matrix, and identify abnormal face images based on the energy vector.
5. The face recognition quality detection method according to claim 3, characterized in that, The steps for obtaining the quantized feature map include: Cosine similarity calculation steps: Calculate the cosine similarity between the feature map and all elements in the quantization unit library, and calculate the similarity matrix; Index number acquisition steps: Based on the shape range of the feature map, find the highest similarity value in each row of the similarity matrix, and obtain the index number of the highest similarity value. The index number corresponds to multiple quantization units. Quantization unit extraction step: Based on the index number, extract the corresponding number of quantization units from the quantization unit library according to the shape range of the feature map, and combine them to form the quantized feature map.
6. The face recognition quality detection method according to claim 3, characterized in that, The loss calculation steps include: Image reconstruction loss step: Calculate the reconstruction loss based on the difference between the normal face image and the decoded image; Query loss step: Calculate the query loss based on the feature map and the quantized feature map.
7. The face recognition quality detection method according to claim 4, characterized in that, The energy vector calculation steps include: The steps for calculating the energy vector of a normal face are as follows: Calculate the energy vector corresponding to all normal face images, and ensure that the energy vector distribution of all normal face images follows a multi-dimensional Gaussian mixture distribution. Calculate the mean and covariance matrix of the Gaussian mixture distribution. The dimensions are determined based on the external dimensions of the feature map. The Mahalanobis distance calculation steps are as follows: Calculate the energy vector corresponding to the face image to be detected, and calculate the Mahalanobis distance based on the average value of the Gaussian mixture distribution and the covariance matrix. If the Mahalanobis distance is greater than a predetermined threshold, the face image to be detected is determined to be an abnormal image; otherwise, it is identified as a normal image.
8. A face recognition quality detection system, employing the face recognition quality detection method as described in any one of claims 1-7, characterized in that, include: Quantization Unit Learning Framework Pre-construction Module: Pre-constructs a quantization unit learning framework, which includes an encoder, a quantization unit library, and a decoder, defining the number and feature dimensions of the encoder, decoder, and quantization unit library; Normal face feature quantization model training module: Based on the encoder, the input normal face image training data is encoded to obtain the encoded normal face feature map. Based on the normal face feature map and the quantization unit library, the extracted face features are discretized into multiple representative quantization units using a discrete sampling function to obtain the quantized normal face feature map. The quantization unit learning framework is obtained by iteratively using reconstruction loss and query loss. Abnormal face image recognition module: Based on the trained encoder and quantization unit library, for the face image to be detected, the energy of each image to the corresponding quantization unit is calculated in the quantization unit library through the energy function, and the distribution parameters of the energy are estimated. If the distribution parameters are greater than a preset threshold, the face image to be detected is identified as an abnormal face image.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the face recognition quality detection method as described in any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the face recognition quality detection method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Face recognition method
CN103902964A
Facial recognition method and apparatus, terminal, and computer readable storage medium
WO2020037937A1