CN115761837A - Face recognition quality detection method, system, device and medium - Google Patents

Face recognition quality detection method, system, device and medium Download PDF

Info

Publication number
CN115761837A
CN115761837A CN202211294517.7A CN202211294517A CN115761837A CN 115761837 A CN115761837 A CN 115761837A CN 202211294517 A CN202211294517 A CN 202211294517A CN 115761837 A CN115761837 A CN 115761837A
Authority
CN
China
Prior art keywords
quantization unit
face
quantization
feature map
face image
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211294517.7A
Other languages
Chinese (zh)
Inventor
朱宇豪
戴琳琳
景辉
董兴芝
衣帅
李贝贝
李杨
王智为
刘相坤
梅巧玲
祝红光
刘卓华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Institute Of Electronic Information Technology Of China Academy Of Railway Sciences Group Co ltd
China Academy of Railway Sciences Corp Ltd CARS
Beijing Jingwei Information Technology Co Ltd
Original Assignee
Institute Of Electronic Information Technology Of China Academy Of Railway Sciences Group Co ltd
China Academy of Railway Sciences Corp Ltd CARS
Beijing Jingwei Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Institute Of Electronic Information Technology Of China Academy Of Railway Sciences Group Co ltd, China Academy of Railway Sciences Corp Ltd CARS, Beijing Jingwei Information Technology Co Ltd filed Critical Institute Of Electronic Information Technology Of China Academy Of Railway Sciences Group Co ltd
Priority to CN202211294517.7A priority Critical patent/CN115761837A/en
Publication of CN115761837A publication Critical patent/CN115761837A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Image Analysis (AREA)

Abstract

The application discloses a face recognition quality detection method, which comprises the following steps: a quantization unit learning frame pre-construction step, a normal human face feature quantization model training step and an abnormal human face image identification step, wherein the quantization unit learning frame comprising an encoder, a quantization unit library and a decoder is pre-constructed; based on the coded normal face feature map and the quantization unit library, the extracted face features are discretized into a plurality of representative quantization units by adopting a discrete sampling function, the quantized normal face feature map is obtained, repeated iteration is carried out through damage reconstruction, a trained coder and a quantization unit library are obtained, for the face image to be detected, the energy from each picture to the corresponding quantization unit is calculated in the quantization unit library through an energy function, the distribution parameter of the energy is estimated, and if the distribution parameter is larger than a preset threshold value, the face image to be detected is identified as an abnormal face image. The application also discloses a face recognition quality detection system.

Description

Face recognition quality detection method, system, device and medium
Technical Field
The present application relates to the field of face recognition technology, and in particular, to a method and system for detecting face recognition quality.
Background
Currently, face recognition technology is gradually mature, and a large number of face recognition applications appear in multiple industries. The face recognition system in the railway passenger transport system mainly applies two technologies of 1. The application of the testimony comparison algorithm comprises business scenes such as a real-name system verification gate machine, 12306APP identity verification, public security system certificate, temporary identity card and the like, and the face retrieval algorithm comprises business scenes such as a face inquiry machine and the like. When the human face image quality is not high, especially for the human face image which is seriously blurred or generates artifacts, the human face feature extracted by the human face recognition algorithm is often far away from the feature corresponding to a clear human face, so that the human face can not be correctly recognized. The invention refers to the images which can not extract the face features normally as abnormal face images.
In the prior art, an abnormal image recognition model directly based on a classification algorithm cannot be well applied to the scene, and the reasons are as follows: (1) The fuzzy reasons of the face images are various, and the face images are difficult to model; (2) The abnormity of the face image is not only fuzzy, but also unpredictable abnormity exists; (3) The probability of the abnormal face image is low, and it is difficult to accumulate enough representative samples in a short time for training.
Therefore, it is necessary to provide a novel abnormal face image detection method based on a discrete quantization unit, so as to detect these abnormal face images, thereby improving the correct recognition rate of passengers in a passenger traffic scene, and particularly solving the problems that the abnormal face images cannot be modeled and trained, and the recognition abnormality cannot be predicted in advance.
Disclosure of Invention
The embodiment of the application provides an abnormal face image detection method based on a discrete quantization unit, which is used for detecting the abnormal face images, so that the correct recognition rate of passengers in a passenger traffic scene is improved, and the problems that the abnormal face images cannot be modeled and trained, and the abnormality cannot be recognized in advance are particularly solved.
In a first aspect, an embodiment of the present application provides a method for detecting a face recognition quality, including:
a quantization unit learning framework pre-construction step: pre-constructing a quantization unit learning framework, wherein the quantization unit learning framework comprises: the system comprises an encoder, a quantization unit library and a decoder, wherein the number and the characteristic dimension of the encoder, the decoder and the quantization unit library are defined;
training a normal face feature quantization model: the method comprises the steps of coding input normal face image training data based on a coder to obtain a coded normal face feature map, discretizing extracted face features into a plurality of representative quantization units by adopting a discrete sampling function based on the normal face feature map and a quantization unit library to obtain a quantized normal face feature map, and performing repeated iteration through damage reconstruction to obtain a trained quantization unit learning frame;
an abnormal face image identification step: based on the trained encoder and the quantization unit library, aiming at the face image to be detected, calculating the energy from each picture to the corresponding quantization unit in the quantization unit library through an energy function, estimating the distribution parameter of the energy, and if the distribution parameter is larger than a preset threshold value, identifying the face image to be detected as an abnormal face image.
In some embodiments of the present invention, the step of pre-constructing the quantization unit learning framework includes:
initializing an encoder: initializing an encoder, wherein the encoder is used for encoding the normal face image into a discrete space of a quantization unit library;
defining a quantization cell library step: presetting the quantity of quantization unit libraries and the dimensionality of quantization units;
initializing a decoder: and initializing a decoder, wherein the decoder is used for restoring the quantized feature map into an original image.
In some embodiments of the present invention, the training step of the normal face feature quantization model includes:
calculating a characteristic diagram: inputting normal face image training data and calculating a feature map of a normal face image;
a quantization characteristic diagram obtaining step: inputting a feature map of a normal face image, inquiring in a quantization unit library, and inquiring through a predefined inquiry function to obtain a quantized feature map;
and (3) decoding: inputting the quantized feature map, and obtaining a decoded image by using a decoder;
a damage compensation step: calculating the reconstruction loss and the query damage of the decoded image, wherein the reconstruction damage is used for ensuring that the features extracted by the model have the capability of expressing the image, and the query damage is used for verifying the consistency of the feature maps before and after quantization;
an iteration step: and calculating the sum of reconstruction loss and query loss of the decoded image, and obtaining the trained encoder, quantization unit and decoder through repeated iteration.
In some embodiments of the present invention, the step of recognizing the abnormal face image includes:
calculating a similarity matrix: mapping the face image to be detected to a feature map of the face image based on an encoder, and calculating a similarity matrix of the feature map and all quantization units;
and an energy vector calculation step: and calculating an energy vector of the similarity matrix through the similarity matrix, and identifying the abnormal face image based on the energy vector.
In some embodiments of the present invention, the step of obtaining the quantized feature map includes:
and cosine similarity calculation: calculating cosine similarity between all elements in the characteristic diagram and the quantization unit library, and calculating a similarity matrix;
an index number obtaining step: finding out the highest similarity value in each row of the similarity matrix according to the appearance range of the characteristic diagram to obtain an index number of the highest similarity value, wherein the index number corresponds to a plurality of quantization units;
a quantization unit extraction step: and extracting a corresponding number of quantization units from the quantization unit library according to the appearance range of the feature graph based on the index number to combine the quantization units into a quantized feature graph.
In some embodiments of the present invention, the damage compensation step includes:
image reconstruction loss step: calculating a reconstruction loss based on a difference between the normal face image and the decoded image;
and (3) inquiring loss steps: and calculating the query damage based on the feature map and the quantized feature map.
In some embodiments of the present invention, the energy vector calculating step includes:
and a normal face energy vector calculation step: calculating energy vectors corresponding to all normal face images, subjecting the energy vector distribution of all normal face images to multi-dimensional Gaussian mixture distribution, and calculating an average value and a covariance matrix of the Gaussian mixture distribution, wherein the dimension is determined according to the external dimension of the feature map;
and a Mahalanobis distance calculation step: and calculating an energy vector corresponding to the face image to be detected, calculating the Mahalanobis distance according to the average value and the covariance matrix of the Gaussian mixture distribution, if the Mahalanobis distance is greater than a preset threshold value, judging the face image to be detected as an abnormal image, and if not, identifying the face image to be detected as a normal image.
In a second aspect, an embodiment of the present application provides a face recognition quality detection system, which adopts the above face recognition quality detection method, and includes:
the quantization unit learning framework pre-construction module: pre-constructing a quantization unit learning framework, wherein the quantization unit learning framework comprises: the system comprises an encoder, a quantization unit library and a decoder, wherein the number and the characteristic dimension of the encoder, the decoder and the quantization unit library are defined;
a normal face feature quantization model training module: the method comprises the steps of coding input normal face image training data based on a coder to obtain a coded normal face feature map, discretizing extracted face features into a plurality of representative quantization units by adopting a discrete sampling function based on the normal face feature map and a quantization unit library to obtain a quantized normal face feature map, and performing repeated iteration through damage reconstruction to obtain a trained quantization unit learning frame;
an abnormal face image recognition module: based on the trained encoder and the quantization unit library, aiming at the face image to be detected, calculating the energy from each picture to the corresponding quantization unit in the quantization unit library through an energy function, estimating the distribution parameter of the energy, and if the distribution parameter is larger than a preset threshold value, identifying the face image to be detected as an abnormal face image.
In a third aspect, an embodiment of the present application provides a computer device, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, and when the processor executes the computer program, the processor implements the face recognition quality detection method as described above.
In a fourth aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to implement the face recognition quality detection method as described above.
Compared with the related prior art, the method has the following outstanding advantages:
1. the method is an abnormal face image detection method based on a discrete quantization unit, which comprises the steps of learning quantization units corresponding to a plurality of normal faces, calculating the energy from each picture to the corresponding quantization unit in a discrete space by using an energy function, estimating distribution parameters of the energy, and judging whether the image is an abnormal sample according to different positions of the energy corresponding to the face image on the distribution. If the image is judged to be an abnormal image, the passenger is required to perform face authentication again;
2. the method does not need to carry out data acquisition, classification and modeling on specific abnormal face image data, only needs to collect normal samples and calculate the energy distribution between the normal samples to judge whether the abnormal face image data is abnormal or not, and greatly reduces the difficulty of data collection and model training.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
FIG. 1 is a flow chart of the method for detecting the face recognition quality of railway passenger transportation according to the invention;
FIG. 2 is a flow diagram of a quantization unit learning framework in accordance with an embodiment of the present invention;
FIG. 3 is a flowchart illustrating a process of computing energy vectors of face images according to an embodiment of the present invention;
FIG. 4 is a schematic view of a face recognition quality detection system for railway passenger transportation according to the present invention;
fig. 5 is a schematic hardware structure diagram of a computer device according to an embodiment of the present application.
In the above figures:
10 quantization unit learning frame pre-construction module 20 normal face feature quantization model training module
And 30 an abnormal human face image recognition module.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be 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 of the present application and are not intended to limit the present application. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments provided in the present application without any inventive step are within the scope of protection of the present application.
It is obvious that the drawings in the following description are only examples or embodiments of the application, and that it is also possible for a person skilled in the art to apply the application to other similar contexts on the basis of these drawings without inventive effort. Moreover, it should be appreciated that in the development of any such actual implementation, as in any engineering or design project, numerous implementation-specific decisions must be made to achieve the developers' specific goals, such as compliance with system-related and business-related constraints, which may vary from one implementation to another.
The details of one or more embodiments of the application are set forth in the accompanying drawings and the description below to provide a more thorough understanding of the application.
Reference in the specification to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the specification. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those of ordinary skill in the art will explicitly and implicitly appreciate that the embodiments described herein may be combined with other embodiments without conflict.
Unless otherwise defined, technical or scientific terms referred to herein should have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. Reference to "a," "an," "the," and similar words throughout this application are not to be construed as limiting in number, and may refer to the singular or the plural. The use of the terms "including," "comprising," "having," and any variations thereof herein, is meant to cover a non-exclusive inclusion; for example, a process, method, system, article, or apparatus that comprises a list of steps or modules (elements) is not limited to only those steps or elements but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus. Reference to "connected," "coupled," and the like in this application is not intended to be limited to physical or mechanical connections, but rather can include electrical connections, whether direct or indirect. The term "plurality" as referred to herein means two or more. "and/or" describes an association relationship of associated objects, meaning that three relationships may exist, for example, "A and/or B" may mean: a exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship. Reference herein to the terms "first," "second," "third," and the like, are merely to distinguish similar objects and do not denote a particular ordering for the objects.
The invention aims to endow the existing railway passenger transport system equipment with the capability of identifying abnormal face samples, and identify abnormal face images by defining a quantization unit of normal face characteristics according to the quantization unit. The method is a concrete realization of the process, and comprises (1) obtaining a normal human face characteristic quantization unit; and (2) how to perform abnormal face image recognition using these quantization units.
The invention relates to an abnormal human face image detection method based on a discrete quantization unit, which comprises the steps of learning quantization units corresponding to a plurality of normal human faces, calculating the energy from each image to the corresponding quantization unit in a discrete space by using an energy function, estimating distribution parameters of the energy, and judging whether the image is an abnormal sample or not according to different positions of the energy corresponding to the human face image on the distribution. If the image is judged to be an abnormal image, the passenger is required to perform face authentication again.
As shown in fig. 1, an embodiment of the present application provides a face recognition quality detection method, including:
quantization unit learning framework pre-construction step S10: pre-constructing a quantization unit learning framework, wherein the quantization unit learning framework comprises: the system comprises an encoder, a quantization unit library and a decoder, wherein the number and the characteristic dimension of the encoder, the decoder and the quantization unit library are defined;
a step S20 of training a normal face feature quantization model: coding input normal face image training data based on a coder to obtain a coded normal face feature map, discretizing the extracted face features into a plurality of representative quantization units by adopting a discrete sampling function based on the normal face feature map and a quantization unit library to obtain a quantized normal face feature map, and repeatedly iterating through damage reconstruction to obtain a trained quantization unit learning frame;
an abnormal face image recognition step S30: based on the trained encoder and the quantization unit library, aiming at the face image to be detected, the energy from each picture to the corresponding quantization unit is calculated in the quantization unit library through an energy function, the distribution parameter of the energy is estimated, and if the distribution parameter is larger than a preset threshold value, the face image to be detected is identified as an abnormal face image.
In some embodiments of the present invention, the step S10 of pre-constructing the quantization unit learning framework includes:
initializing an encoder: initializing an encoder, wherein the encoder is used for encoding a normal face image into a discrete space of a quantization unit library;
defining a quantization cell library step: presetting the quantity of quantization unit libraries and the dimensionality of quantization units;
initializing a decoder: and initializing a decoder, wherein the decoder is used for restoring the quantized feature map into an original image.
In some embodiments of the present invention, the step S20 of training the normal face feature quantization model includes:
and (3) calculating a characteristic diagram: inputting normal face image training data and calculating a feature map of a normal face image;
a quantization characteristic diagram obtaining step: inputting a feature map of a normal face image, inquiring in a quantization unit library, and inquiring through a predefined inquiry function to obtain a quantized feature map;
and a decoding step: inputting the quantized feature map, and obtaining a decoded image by using a decoder;
a damage compensation step: calculating the reconstruction loss and the query damage of the decoded image, wherein the reconstruction damage is used for ensuring that the features extracted by the model have the capability of expressing the image, and the query damage is used for verifying the consistency of the feature maps before and after quantization;
iteration step: and calculating the sum of reconstruction loss and query loss of the decoded image, and obtaining the trained encoder, quantization unit and decoder through repeated iteration.
In some embodiments of the present invention, the step S30 of recognizing the abnormal face image includes:
calculating a similarity matrix: mapping the face image to be detected to a feature map of the face image based on an encoder, and calculating a similarity matrix of the feature map and all quantization units;
and an energy vector calculation step: and calculating an energy vector of the similarity matrix through the similarity matrix, and identifying the abnormal face image based on the energy vector.
In some embodiments of the present invention, the step of obtaining the quantized feature map includes:
and cosine similarity calculation step: calculating cosine similarity between all elements in the characteristic diagram and the quantization unit library, and calculating a similarity matrix;
an index number obtaining step: finding out the highest similarity value in each row of the similarity matrix according to the appearance range of the characteristic diagram to obtain an index number of the highest similarity value, wherein the index number corresponds to a plurality of quantization units;
a quantization unit extraction step: and extracting a corresponding number of quantization units from the quantization unit library according to the appearance range of the feature graph based on the index number to combine the quantization units into a quantized feature graph.
In some embodiments of the present invention, the damage compensation step includes:
image reconstruction loss step: calculating a reconstruction loss based on a difference between the normal face image and the decoded image;
and (3) inquiring loss steps: and calculating the query damage based on the feature map and the quantized feature map.
In some embodiments of the present invention, the energy vector calculating step includes:
and a normal face energy vector calculation step: calculating energy vectors corresponding to all normal face images, subjecting the energy vector distribution of all normal face images to multi-dimensional Gaussian mixture distribution, and calculating an average value and a covariance matrix of the Gaussian mixture distribution, wherein the dimension is determined according to the external dimension of the feature map;
and a Mahalanobis distance calculation step: and calculating an energy vector corresponding to the face image to be detected, calculating the Mahalanobis distance according to the average value and the covariance matrix of the mixed Gaussian distribution, if the Mahalanobis distance is greater than a preset threshold value, judging that the face image to be detected is an abnormal image, and otherwise, identifying the face image to be detected as a normal image.
The following detailed description of specific embodiments of the invention refers to the accompanying drawings in which:
as shown in fig. 2, the specific steps of the embodiment of the present invention are as follows:
specifically, the implementation of the invention is divided into two steps: constructing a normal human face feature quantization unit; and (2) carrying out identification of abnormal face images by using the quantization units.
1. Constructing a normal face feature quantization unit
Compared with abnormal samples with low occurrence frequency, normal face samples which can be used for recognition are often many. Therefore, the invention extracts the features of the normal face, disperses the extracted features into a plurality of representative quantization units and takes the quantization units as the representation of the normal face. The invention adopts a learning method to obtain quantization units, and the learning framework of the quantization units is shown in FIG. 2.
The frame is formed by presetting a quantization unit Q E R N×D Where N is the number of quantization units and D is the dimension of a quantization unit, in particular, we agree that the modulus of a quantization unit is 1 (hence "unit").
The face image is coded into the space of the quantization unit by adopting a coder, and the process is F = Enc (I), wherein I is equal to R H×W×3 For an input image, F ∈ R hw×D The encoder Enc may be any learnable neural network for the encoded feature map. H, W represents the length and width of the face image, H, W represents the length and width of the feature map, and generally, H<H,w<W。
Where R represents a set of real numbers representing a domain of values of the image I, which is typically represented in a computer in the form of a matrix having the shape HxWx3. Similarly, the value in the quantization unit Q is also real, and the matrix shape is NxD.
In order to uniquely determine the quantization unit corresponding to the feature map F, the invention uses Gumbel-SoftMax to carry out discrete sampling on the category of the feature vector in the feature map, the feature vector is corresponding to a determined quantization unit, and the process uses a cross entropy function to supervise.
In order to ensure the representativeness of the quantization units, a corresponding decoder is trained at the same time, and the sampled quantization units are restored into the original face image, wherein the decoder can be any learnable neural network corresponding to the encoder. The process uses reconstruction loss for supervision and simply the Euclidean distance (Euclidean distance) between the original and reconstructed images can be calculated.
The specific model definition and the training process are as follows:
model definition
An encoder Enc is initialized, which may employ common neural network models, such as ResNet, VGG, etc. The process of the encoder encoding the picture is F = Enc (I), where I ∈ R H×W×3 For an input image, F ∈ R hw×D For the encoded feature map, H, W represents the length and width of the face image, and H, W represents the length and width of the feature map, and generally, H<H,w<W。
Defining the quantity and the characteristic dimension of the quantization units to obtain a quantization unit library Q epsilon R N×D Where N is the number of quantization units (which can be arbitrarily set to an integer, e.g., 100, 1000, 2000, etc.), and D is the dimension of the quantization units (which generally matches the feature dimension extracted by the selected neural network, e.g., 256 is selected using ResNet 18). Comparing the feature vector of each position on the feature map F with each feature unit in the quantization unit Q, and extracting the feature unit with the highest cosine similarity to form the quantized feature map
Figure BDA0003902497980000081
Initializing the decoder Dnc, the effect of which is to map the quantized feature map
Figure BDA0003902497980000082
Is restored to the original image to
Figure BDA0003902497980000083
Figure BDA0003902497980000084
And (4) showing. Dnc is selected to correspond to encoder Enc, resulting in a codec structure similar to U-Net.
Model training process
(1) With the image I ∈ R H×W×3 For input, first, a feature map F = Enc (I) of the image is calculated;
(2) Using characteristic diagram F epsilon R hw×D For input, in the quantization unit library Q ∈ R N×D In the query, defining a query function
Figure BDA0003902497980000085
Figure BDA0003902497980000086
The structure of the quantized feature map obtained after query is consistent with the feature map F, i.e.
Figure BDA0003902497980000087
The specific implementation of the query function is as follows:
<1>and calculating cosine similarity between all elements in the feature map F and the quantization unit library Q, and performing quick calculation by using matrix multiplication: s = F × Q, S ∈ R hw×N
<2>According to the similarity matrix S, finding the value with the highest similarity in each row (total hw rows) to obtain the index number idx = argmax (S), wherein idx belongs to Z hw The idx has a value of an integer between 0 and N-1 (the integer field is denoted by Z), corresponding to N quantization units.
<3>Extracting corresponding hw quantization units from Q according to the index idx, and combining into a new characteristic diagram called as a quantized characteristic diagram
Figure BDA0003902497980000088
(3) By means of quantized feature maps
Figure BDA0003902497980000089
For input, a decoder is used to obtain decoded images
Figure BDA00039024979800000810
Figure BDA00039024979800000811
(4) The selection of the loss function comprises two parts:
<1>reconstruction loss of image:
Figure BDA00039024979800000812
the function of the method is to ensure that the features extracted by the model have the capability of expressing images, the implementation is only an optional scheme, and common schemes also comprise
Figure BDA00039024979800000813
Figure BDA00039024979800000814
(Absolute value) and perceptual loss
Figure BDA00039024979800000815
(where f represents a CNN that has been pre-trained on imagenet), and the like.
<2>Loss of inquiry:
Figure BDA00039024979800000816
the function of the method is to ensure that the feature maps before and after quantization keep high consistency. It is noted that
Figure BDA00039024979800000817
Is obtained using maximum sampling in Q and cannot be directly counter-propagated. To ensure that losses during training can be propagated backwards, the method is described
Figure BDA00039024979800000818
The calculation of (c) can be obtained in two ways: the first is to directly get the gradient from
Figure BDA00039024979800000819
Copying to Q, thereby avoiding the problem that discrete samples cannot be propagated backwards; the second is to sample the discrete quantization units using the Gumbel-SoftMax technique. Any of these methods can be employed in the present invention. The invention is not limited in this regard and other discrete sampling functions may be employed.
(5) By combining the reconstruction loss and the query loss of the image L = L qry +L rec And repeatedly iterating on the training data to obtain the trained encoder, quantization unit and decoder. Finally, the encoder and quantization sheet will be learnedAnd preserving the elements for subsequent abnormal face image detection.
2. Identifying abnormal face images
When an abnormal face image is identified, firstly, energy matrixes corresponding to all normal face samples are calculated according to the flow shown in fig. 3:
(1) Mapping the input image I to F with the encoder Enc: f = Enc (I), where F ∈ R hw×D
(2) Calculating the similarity of the characteristic diagram F and all quantization units, and calculating a similarity matrix S = F multiplied by Q, wherein S belongs to R hw×N
(3) Calculating an energy vector E = -log E of the similarity matrix through the similarity matrix S ,E∈R hw Where Σ is the sign of the summation.
For clarity of illustration, the feature map shown in fig. 3 is only represented by one feature vector contained therein, but the present invention is not limited thereto, and any integer number of feature vectors may be taken under the condition of H < H, W < W, where hw =1 is a special case, and hw may be taken under the condition of H < H, W < W, but H = W is generally considered. Based on the calculation process of the energy vector, the process of identifying the abnormal face image comprises the following two steps:
(1) Calculating energy vectors corresponding to all normal face images through the process of fig. 2, assuming that the energy vector distribution of all normal face images obeys hw-dimensional mixed gaussian distribution, and calculating an average value m and a covariance matrix C thereof;
(2) For a given input image, calculating an energy vector E corresponding to the image, and calculating the Mahalanobis distance (Mahalanobis distance) delta of the energy vector E 2 =(E-m) T C -1 (E-m), when the Mahalanobis distance is too large, the image is judged to be an abnormal image, and the image is received as a normal image by the anti-regularization, wherein T represents matrix transposition, C represents a matrix transposition, and C represents a matrix transposition number -1 Representing the matrix inversion. The result of the mahalanobis distance calculation is a numerical value, rather than a matrix or vector, that can be used directly for numerical comparison. And if the Mahalanobis distance is larger than a preset threshold value, judging that the face image to be detected is an abnormal image, and otherwise, identifying the face image to be detected as a normal image. Wherein is scheduledThe threshold value may be selected to be an optimum value according to the actual conditions and test results of the specific embodiment of the present invention.
Through the process, the method does not need to carry out data acquisition, classification and modeling on specific abnormity, only needs to collect normal samples and calculate the energy distribution between the normal samples to judge whether the abnormity is detected, and greatly reduces the difficulty of data collection and model training.
In a second aspect, an embodiment of the present application provides a face recognition quality detection system, which uses the above face recognition quality detection method, as shown in fig. 4, and includes:
quantization unit learning framework pre-construction module 10: pre-constructing a quantization unit learning framework, wherein the quantization unit learning framework comprises: the system comprises an encoder, a quantization unit library and a decoder, wherein the number and the characteristic dimension of the encoder, the decoder and the quantization unit library are defined;
the normal face feature quantization model training module 20: the method comprises the steps of coding input normal face image training data based on a coder to obtain a coded normal face feature map, discretizing extracted face features into a plurality of representative quantization units by adopting a discrete sampling function based on the normal face feature map and a quantization unit library to obtain a quantized normal face feature map, and performing repeated iteration through damage reconstruction to obtain a trained quantization unit learning frame;
the abnormal face image recognition module 30: based on the trained encoder and the quantization unit library, aiming at the face image to be detected, the energy from each picture to the corresponding quantization unit is calculated in the quantization unit library through an energy function, the distribution parameter of the energy is estimated, and if the distribution parameter is larger than a preset threshold value, the face image to be detected is identified as an abnormal face image.
In a third aspect, an embodiment of the present application provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the face recognition quality detection method as described above when executing the computer program.
In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, where the computer program is configured to, when executed by a processor, implement the face recognition quality detection method as described above.
In addition, the face recognition quality detection method described in the embodiment of the present application with reference to fig. 1 may be implemented by a computer device. Fig. 5 is a hardware structure diagram of a computer device according to an embodiment of the present application.
The computer device may comprise a processor 81 and a memory 82 in which computer program instructions are stored.
Specifically, the processor 81 may include a Central Processing Unit (CPU), or A Specific Integrated Circuit (ASIC), or may be configured to implement one or more Integrated circuits of the embodiments of the present Application.
Memory 82 may include, among other things, mass storage for data or instructions. By way of example, and not limitation, the memory 82 may include a Hard Disk Drive (Hard Disk Drive, abbreviated HDD), a floppy Disk Drive, a Solid State Drive (SSD), flash memory, an optical Disk, a magneto-optical Disk, tape, or a Universal Serial Bus (USB) Drive or a combination of two or more of these. Memory 82 may include removable or non-removable (or fixed) media, where appropriate. The memory 82 may be internal or external to the data processing apparatus, where appropriate. In a particular embodiment, the memory 82 is a Non-Volatile (Non-Volatile) memory. In particular embodiments, memory 82 includes Read-Only Memory (ROM) and Random Access Memory (RAM). Where appropriate, the ROM may be mask-programmed ROM, programmable ROM (PROM), erasable PROM (EPROM), electrically Erasable PROM (EEPROM), electrically Alterable ROM (EAROM), or FLASH Memory (FLASH), or a combination of two or more of these. The RAM may be a Static Random-Access Memory (SRAM) or a Dynamic Random-Access Memory (DRAM), where the DRAM may be a Fast Page Mode Dynamic Random-Access Memory (FPMDRAM), an Extended data output Dynamic Random-Access Memory (EDODRAM), a Synchronous Dynamic Random-Access Memory (SDRAM), and the like.
The memory 82 may be used to store or cache various data files that need to be processed and/or used for communication, as well as possible computer program instructions executed by the processor 81.
The processor 81 implements any one of the face recognition quality detection methods in the above embodiments by reading and executing computer program instructions stored in the memory 82.
In some of these embodiments, the computer device may also include a communication interface 83 and a bus 80. As shown in fig. 5, the processor 81, the memory 82, and the communication interface 83 are connected via the bus 80 to complete communication therebetween.
The communication interface 83 is used for implementing communication between modules, devices, units and/or equipment in the embodiment of the present application. The communication port 83 may also be implemented with other components such as: the data communication is carried out among external equipment, image/data acquisition equipment, a database, external storage, an image/data processing workstation and the like.
Bus 80 includes hardware, software, or both coupling the components of the computer device to each other. Bus 80 includes, but is not limited to, at least one of the following: data Bus (Data Bus), address Bus (Address Bus), control Bus (Control Bus), expansion Bus (Expansion Bus), and Local Bus (Local Bus). By way of example and not limitation, bus 80 may include an Accelerated Graphics Port (AGP) or other Graphics Bus, an Enhanced Industry Standard Architecture (EISA) Bus, a Front-Side Bus (FSB), a Hyper Transport (HT) Interconnect, an ISA (ISA) Bus, an InfiniBand (InfiniBand) Interconnect, a Low Pin Count (LPC) Bus, a memory Bus, a microchannel Architecture (MCA) Bus, a PCI (Peripheral Component Interconnect) Bus, a PCI-Express (PCI-X) Bus, a Serial Advanced Technology Attachment (SATA) Bus, a vlslave Bus, a Video Bus, or a combination of two or more of these suitable electronic buses. Bus 80 may include one or more buses, where appropriate. Although specific buses are described and shown in the embodiments of the application, any suitable buses or interconnects are contemplated by the application.
Compared with the prior art, the method does not need to carry out data acquisition, classification and modeling on specific abnormal face image data, only needs to collect normal samples and calculate the energy distribution between the normal samples to judge whether the abnormal face image data is abnormal or not, and greatly reduces the difficulty of data collection and model training.
The technical features of the embodiments described above may be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the embodiments described above are not described, but should be considered as being within the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, and these are all within the scope of protection of the present application. Therefore, the protection scope of the present patent application shall be subject to the appended claims.

Claims (10)

1. A face recognition quality detection method is characterized by comprising the following steps:
a quantization unit learning framework pre-construction step: pre-constructing a quantization unit learning framework, the quantization unit learning framework comprising: an encoder, a quantization unit library and a decoder, the number and the characteristic dimension of the encoder, the decoder and the quantization unit library are defined;
training a normal face feature quantization model: coding input normal face image training data based on the coder to obtain a coded normal face feature map, discretizing the extracted face features into a plurality of representative quantization units by adopting a discrete sampling function based on the normal face feature map and the quantization unit library to obtain a quantized normal face feature map, and performing repeated iteration through damage reconstruction to obtain a trained quantization unit learning frame;
an abnormal face image identification step: based on the trained encoder and the quantization unit library, aiming at the face image to be detected, calculating the energy from each picture to the corresponding quantization unit in the quantization unit library through an energy function, estimating the distribution parameter of the energy, and if the distribution parameter is greater than a preset threshold value, identifying the face image to be detected as an abnormal face image, thereby realizing the detection of the face identification quality.
2. The face recognition quality detection method according to claim 1, wherein the quantization unit learning framework pre-construction step comprises:
initializing an encoder: initializing an encoder for encoding the normal face image into a discrete space of the quantization cell bank;
defining a quantization cell library step: presetting the quantity of the quantization unit libraries and the dimension of the quantization units;
initializing a decoder: and initializing a decoder, wherein the decoder is used for restoring the quantized feature map into an original image.
3. The method for detecting the face recognition quality according to claim 1, wherein the training step of the normal face feature quantization model comprises the following steps:
and (3) calculating a characteristic diagram: inputting the training data of the normal face image and calculating a feature map of the normal face image;
a quantization characteristic diagram obtaining step: inputting the feature map of the normal face image, inquiring in the quantization unit library, and obtaining a quantized feature map after inquiring through a predefined inquiry function;
and (3) decoding: inputting the quantized feature map, and obtaining a decoded image by using the decoder;
a damage compensation step: calculating reconstruction loss and query damage of the decoded image, wherein the reconstruction damage is used for ensuring that the features extracted by the model have the capability of expressing the image, and the query damage is used for verifying the consistency of the feature maps before and after quantization;
iteration step: and calculating the sum of the reconstruction loss and the query loss of the decoded image, and obtaining the trained encoder, quantization unit and decoder through repeated iteration.
4. The face recognition quality detection method according to claim 1, wherein the abnormal face image recognition step includes:
calculating a similarity matrix: mapping the face image to be detected to a feature map of the face image based on the encoder, and calculating a similarity matrix of the feature map and all quantization units;
an energy vector calculation step: and calculating an energy vector of the similarity matrix through the similarity matrix, and identifying an abnormal face image based on the energy vector.
5. The face recognition quality detection method according to claim 3, wherein the quantized feature map obtaining step includes:
and cosine similarity calculation: calculating cosine similarity between the feature map and all elements in the quantization unit library, and calculating a similarity matrix;
an index number obtaining step: finding out the highest similarity value in each row of the similarity matrix according to the shape range of the feature map to obtain an index number of the highest similarity value, wherein the index number corresponds to a plurality of quantization units;
a quantization unit extraction step: and extracting the corresponding number of quantization units from the quantization unit library according to the appearance range of the feature graph based on the index number to combine the quantization unit library into the quantized feature graph.
6. The face recognition quality detection method according to claim 3, wherein the impairment compensation step comprises:
image reconstruction loss step: calculating the reconstruction loss based on a difference between the normal face image and the decoded image;
and (3) inquiring loss steps: and calculating the query damage based on the feature map and the quantized feature map.
7. The face recognition quality detection method of claim 4, wherein the energy vector calculation step comprises:
and a normal face energy vector calculation step: calculating energy vectors corresponding to all normal face images, subjecting the energy vector distribution of all normal face images to multi-dimensional Gaussian mixture distribution, and calculating an average value and a covariance matrix of the Gaussian mixture distribution, wherein the dimension is determined according to the external dimension of the feature map;
and a Mahalanobis distance calculation step: and calculating an energy vector corresponding to the face image to be detected, calculating the Mahalanobis distance according to the average value of the Gaussian mixture distribution and the covariance matrix, if the Mahalanobis distance is greater than a preset threshold value, judging the face image to be detected as an abnormal image, and otherwise, identifying the face image to be detected as a normal image.
8. A face recognition quality detection system using the face recognition quality detection method according to any one of claims 1 to 7, comprising:
the quantization unit learning framework pre-construction module: pre-constructing a quantization unit learning framework, the quantization unit learning framework comprising: the device comprises an encoder, a quantization unit library and a decoder, wherein the number and the characteristic dimension of the encoder, the decoder and the quantization unit library are defined;
a normal face feature quantization model training module: coding input normal face image training data based on the coder to obtain a coded normal face feature map, discretizing the extracted face features into a plurality of representative quantization units by adopting a discrete sampling function based on the normal face feature map and the quantization unit library to obtain a quantized normal face feature map, and performing repeated iteration through damage reconstruction to obtain a trained quantization unit learning frame;
an abnormal face image recognition module: based on the trained encoder and the quantization unit library, aiming at the face image to be detected, calculating the energy from each picture to the corresponding quantization unit in the quantization unit library through an energy function, estimating the distribution parameter of the energy, and if the distribution parameter is greater than a preset threshold value, identifying the face image to be detected as an abnormal face image.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the face recognition quality detection method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out a face recognition quality detection method according to any one of claims 1 to 7.
CN202211294517.7A 2022-10-21 2022-10-21 Face recognition quality detection method, system, device and medium Pending CN115761837A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211294517.7A CN115761837A (en) 2022-10-21 2022-10-21 Face recognition quality detection method, system, device and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211294517.7A CN115761837A (en) 2022-10-21 2022-10-21 Face recognition quality detection method, system, device and medium

Publications (1)

Publication Number Publication Date
CN115761837A true CN115761837A (en) 2023-03-07

Family

ID=85352626

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211294517.7A Pending CN115761837A (en) 2022-10-21 2022-10-21 Face recognition quality detection method, system, device and medium

Country Status (1)

Country Link
CN (1) CN115761837A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116844198A (en) * 2023-05-24 2023-10-03 北京优创新港科技股份有限公司 Method and system for detecting face attack

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116844198A (en) * 2023-05-24 2023-10-03 北京优创新港科技股份有限公司 Method and system for detecting face attack
CN116844198B (en) * 2023-05-24 2024-03-19 北京优创新港科技股份有限公司 Method and system for detecting face attack

Similar Documents

Publication Publication Date Title
CN108846355B (en) Image processing method, face recognition device and computer equipment
CN111160313B (en) Face representation attack detection method based on LBP-VAE anomaly detection model
US20130039588A1 (en) Image processing method and apparatus for tamper proofing
Le et al. An improved algorithm for digital image authentication and forgery localization using demosaicing artifacts
CN111311595B (en) No-reference quality evaluation method for image quality and computer readable storage medium
Goh et al. A hybrid evolutionary algorithm for feature and ensemble selection in image tampering detection
CN110457996B (en) Video moving object tampering evidence obtaining method based on VGG-11 convolutional neural network
Tang et al. Structural feature-based image hashing and similarity metric for tampering detection
Samanta et al. Analysis of perceptual hashing algorithms in image manipulation detection
Stokkenes et al. Multi-biometric template protection—A security analysis of binarized statistical features for bloom filters on smartphones
CN114332500A (en) Image processing model training method and device, computer equipment and storage medium
CN115761837A (en) Face recognition quality detection method, system, device and medium
CN112163114A (en) Image retrieval method based on feature fusion
Shankar et al. Result Analysis of Cross-Validation on low embedding Feature-based Blind Steganalysis of 25 percent on JPEG images using SVM
CN111967331B (en) Face representation attack detection method and system based on fusion feature and dictionary learning
CN116188439A (en) False face-changing image detection method and device based on identity recognition probability distribution
Christaline et al. Critical review of image steganalysis techniques
Thai et al. Steganalysis of Jsteg algorithm based on a novel statistical model of quantized DCT coefficients
Cho et al. Block-based image steganalysis for a multi-classifier
Chen et al. Alpha-trimmed image estimation for JPEG steganography detection
Sufyanu et al. Choice of illumination normalization algorithm for preprocessing efficiency of discrete cosine transform
Wang et al. A nonparametric Bayesian method of structural saliency dictionary learning for image compression
Baleanu et al. Image splicing detection using generalized Whittaker function descriptor
CN113177487B (en) Pedestrian re-recognition method, device, computer equipment and storage medium
Yu et al. Cumulant-based image fingerprints

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination