CN107341485B - Face recognition method and device - Google Patents

Face recognition method and device Download PDF

Info

Publication number
CN107341485B
CN107341485B CN201710631337.6A CN201710631337A CN107341485B CN 107341485 B CN107341485 B CN 107341485B CN 201710631337 A CN201710631337 A CN 201710631337A CN 107341485 B CN107341485 B CN 107341485B
Authority
CN
China
Prior art keywords
matrix
coefficient matrix
sample set
optimal
coefficient
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.)
Active
Application number
CN201710631337.6A
Other languages
Chinese (zh)
Other versions
CN107341485A (en
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.)
Jianghan University
Original Assignee
Jianghan University
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 Jianghan University filed Critical Jianghan University
Priority to CN201710631337.6A priority Critical patent/CN107341485B/en
Publication of CN107341485A publication Critical patent/CN107341485A/en
Application granted granted Critical
Publication of CN107341485B publication Critical patent/CN107341485B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/172Classification, e.g. identification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/161Detection; Localisation; Normalisation

Landscapes

  • Engineering & Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Oral & Maxillofacial Surgery (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Image Analysis (AREA)
  • Other Investigation Or Analysis Of Materials By Electrical Means (AREA)

Abstract

The invention discloses a face recognition method and device, and belongs to the field of biological recognition. The method comprises the following steps: preprocessing a sample set to be identified to obtain a sample set matrix to be identified; processing the matrix of the sample set to be identified by adopting a new iteration sparse convex nonnegative matrix decomposition method, and solving a coefficient matrix and an optimal coefficient matrix of an optimal base matrix of the sample set to be identified; and classifying the optimal coefficient matrix of the sample set to be recognized by adopting a trained classifier to complete face recognition. The new iteration rule is adopted for iterative optimization, and the coefficient matrix of the base matrix is thinned in the iteration process, so that the coefficient matrix and the optimal coefficient matrix of the optimal base matrix of the sample set to be identified are solved in an iterative manner, the identification rate is improved, the operation amount is reduced, and finally the face identification method has higher identification rate and shorter operation time.

Description

Face recognition method and device
Technical Field
The invention relates to the field of biological recognition, in particular to a face recognition method and a face recognition device.
Background
The face recognition is a new biological recognition technology, and has the advantages of non-contact, friendliness, convenient use, intuition and the like in the aspect of application, so that the face recognition has wide application prospects and huge market potentials in the fields of criminal recognition, certificate verification, medicine and the like.
Currently, common face recognition technologies can be classified into several categories: geometric feature-based recognition techniques, mathematical model-based recognition techniques, subspace analysis-based recognition techniques, and the like. The identification technology based on subspace analysis is one of the mainstream methods in the current face identification, and the basic idea is to project a face image in a high-dimensional space into a low-dimensional subspace through mapping, and classify and identify the feature coefficients in the low-dimensional subspace. The conventional subspace Analysis method generally adopts feature dimension reduction methods such as Principal Component Analysis (PCA), Sparse Non-negative Matrix Factorization (SNMF), Convex Non-negative Matrix Factorization (Convex NMF, CNMF), and the like.
Non-negative matrix factorization is the factorization of a matrix that is implemented under the condition that all elements of the matrix are non-negative. The non-negativity of the image gray scale values makes the non-negative matrix factorization more interpretable than unconstrained principal component analysis. The method is characterized in that a non-Negative Matrix Factorization (NMF) method is directly used for extracting the face features, and the face recognition rate is low due to the fact that a coefficient matrix of a base matrix is not optimized and sparse; CNMF is the popularization of NMF, can make the data more explanatory, can improve face identification rate to a certain extent. CNMF is derived from Semi-nonnegative matrix factorization (Semi-NMF), where X ═ FGTF and X are unconstrained, requiring only G to be non-negative, Ding et al replace matrix F with the original matrix X non-negativeConvex combinations, i.e. F ═ XW, and a new decomposition form, X ═ XWG, is obtainedTWherein F and G are constrained to be non-negative matrixes, and X is not constrained, so that the CNMF mathematical model is provided. Obviously, the decomposition form expands the application range of NMF, and makes the data more explanatory. In CNMF, G is a coefficient matrix and F is a base matrix, and since F ═ XW, W is a coefficient matrix of the base matrix F.
In the process of implementing the invention, the inventor finds that the prior art has at least the following problems:
the traditional multiplicative iteration rule is adopted in the existing CNMF decomposition methods, so that the coefficient matrix of the base matrix is not optimized enough, and the recognition rate is not high; meanwhile, the conventional CNMF does not perform threshold sparsification on the coefficient matrix of the base matrix, so that the characteristic coefficients are too dispersed, the recognition rate is not high, the calculation of the coefficient matrix of the base matrix which does not adopt the threshold sparsification is complex, the calculation amount is too large, the speed is too low, and the recognition rate of the CNMF method is reduced along with the increase of K, so that the CNMF method is not beneficial to the reconstruction of the face image at the later stage.
Disclosure of Invention
In order to solve the problems that the face recognition rate of CNMF is not high, the calculation amount is large, the image reconstruction is not facilitated and the like in the prior art, the embodiment of the invention provides a face recognition method and a face recognition device. The technical scheme is as follows:
in a first aspect, an embodiment of the present invention provides a face recognition method, where the method includes: preprocessing a sample set to be identified to obtain a sample set matrix to be identified; processing the matrix of the sample set to be identified by adopting a new iteration sparse convex nonnegative matrix decomposition method, and solving a coefficient matrix and an optimal coefficient matrix of an optimal base matrix of the sample set to be identified, wherein the coefficient matrix and the optimal coefficient matrix of the optimal base matrix of the sample set to be identified are iteratively generated by adopting the following iterative formulas:
wherein S is the sample set matrix to be identified, the size is J multiplied by I, J, I are positive integers,j is the low-frequency characteristic dimension of each sample in the sample set to be identified, I is the number of samples in the sample set to be identified, and STIs a transposed matrix of S; u is a coefficient matrix of a base matrix obtained by nth iteration, Q is a coefficient matrix obtained by nth iteration, U 'is a coefficient matrix of a base matrix obtained by n-1 th iteration, Q' is a coefficient matrix obtained by n-1 th iteration, U, Q, U 'and Q' are I multiplied by K, K represents the characteristic dimension of S, K is a positive integer and is less than or equal to J, and n is a positive integer greater than 1; u'TIs a transposed matrix of U ', Q'TAs a transposed matrix of Q'. QTA transposed matrix that is Q; u shapeikElement of i-th row and k-th column of U, QikThe element in the ith row and the kth column of Q, I and K are positive integers, I is less than or equal to I, and K is less than or equal to K; u'ikElement of line i of U 'and column k, Q'ikThe element of row i and column k of Q'; when the value of J (V) is minimum, U is the coefficient matrix of the optimal base matrix, Q is the optimal coefficient matrix, and J (V) is Tr (-2V)TF+-VTE-VD) in which F+=(STS)+Q,E-=(STS)-,D=QTQ,V=U,VTA transposed matrix that is V; (S)TS)+Representation matrix (S)TS) taking the absolute value of the elements of the matrix and then summing the matrix (S)TS) matrix obtained by adding corresponding elements of (S)TS)-Representation matrix (S)TS) taking absolute value of element and subtracting matrix (S)TS) matrix obtained by corresponding elements;
and classifying the optimal coefficient matrix of the sample set to be recognized by adopting a trained classifier to complete face recognition.
In an implementation manner of the embodiment of the present invention, the processing the matrix of the sample set to be identified by using a new iteration sparse convex nonnegative matrix factorization method to obtain the coefficient matrix and the optimal coefficient matrix of the optimal basis matrix of the sample set to be identified includes: determining the value of K within a set range; and for the determined value of K, decomposing the matrix of the sample set to be identified by adopting a new iteration sparse convex-non-negative matrix decomposition method, and solving a coefficient matrix and an optimal coefficient matrix of the optimal base matrix of the sample set to be identified, which correspond to K.
In another implementation manner of the embodiment of the present invention, decomposing the matrix of the sample set to be identified by using a new iterative sparse convex-non-negative matrix decomposition method for the determined value of K to obtain a coefficient matrix and an optimal coefficient matrix of the optimal basis matrix of the sample set to be identified corresponding to K includes: determining a coefficient matrix and an initial coefficient matrix of the initial base matrix according to the K; performing iterative calculation according to the coefficient matrix of the initial basis matrix, the initial coefficient matrix and the iterative formula; substituting the coefficient matrix and the coefficient matrix of the base matrix iteratively calculated in each step into an objective function:
J(V)=Tr(-2VTF+-VTE-VD) in which F+=(STS)+Q,E-=(STS)-,D=QTQ,V=U;
When the value of the objective function reaches a stable state, ending iterative computation, and taking the coefficient matrix and the coefficient matrix of the base matrix computed by the last iterative computation as the coefficient matrix and the optimal coefficient matrix of the optimal base matrix of the sample set to be identified, wherein the stable state means that the value of the objective function is kept unchanged or the variation amplitude is smaller than a preset amplitude; or when the iteration times reach the iteration time threshold, selecting the coefficient matrix and the coefficient matrix of the base matrix calculated by the last iteration as the coefficient matrix and the optimal coefficient matrix of the optimal base matrix.
In another implementation manner of the embodiment of the present invention, decomposing the matrix of the sample set to be identified by using a new iterative sparse convex-non-negative matrix decomposition method for the determined value of K to obtain a coefficient matrix and an optimal coefficient matrix of the optimal basis matrix of the sample set to be identified corresponding to K, further includes: determining a sparsification threshold; after each step of iterative computation, judging the size of each numerical value in the coefficient matrix of the base matrix subjected to iterative computation and the sparsification threshold value; and setting the value of the coefficient matrix of the base matrix calculated by iteration, which is greater than the sparsification threshold value, as 1, and setting the value of the coefficient matrix of the base matrix calculated by iteration, which is less than or equal to the sparsification threshold value, as 0.
In another implementation manner of the embodiment of the present invention, the method further includes: preprocessing a training sample set to obtain a training sample set matrix; processing the training sample set matrix by adopting a new iteration sparse convex nonnegative matrix factorization method, and solving a coefficient matrix and an optimal coefficient matrix of an optimal base matrix of the training sample set, wherein the coefficient matrix and the optimal coefficient matrix of the optimal base matrix are generated by adopting the same iteration formula as that used for processing the sample set to be identified in an iteration mode; and training a classifier by adopting the optimal coefficient matrix of the training sample set.
In a second aspect, an embodiment of the present invention further provides a face recognition apparatus, where the apparatus includes: the preprocessing unit is used for preprocessing a sample set to be identified to obtain a sample set matrix to be identified; the decomposition unit is used for processing the matrix of the sample set to be identified by adopting a new iteration sparse convex nonnegative matrix decomposition method, solving a coefficient matrix and an optimal coefficient matrix of the optimal base matrix of the sample set to be identified, and iteratively generating the coefficient matrix and the optimal coefficient matrix of the optimal base matrix of the sample set to be identified by adopting the following iterative formulas:
wherein S is the matrix of the sample set to be identified, the size is J multiplied by I, J, I are positive integers, J is the low-frequency characteristic dimension of each sample in the sample set to be identified, I is the number of samples in the sample set to be identified, and S isTIs a transposed matrix of S; u is a coefficient matrix of a base matrix obtained by nth iteration, Q is a coefficient matrix obtained by nth iteration, U 'is a coefficient matrix of a base matrix obtained by n-1 th iteration, Q' is a coefficient matrix obtained by n-1 th iteration, U, Q, U 'and Q' are I multiplied by K, K represents the characteristic dimension of S, K is a positive integer and is less than or equal to J, and n is a positive integer greater than 1; u'TIs a transposed matrix of U ', Q'TAs a transposed matrix of Q'. QTA transposed matrix that is Q; u shapeikElement of i-th row and k-th column of U, QikIs the second of QThe I row and the K column are elements, I and K are positive integers, I is less than or equal to I, and K is less than or equal to K; u'ikElement of line i of U 'and column k, Q'ikThe element of row i and column k of Q'; when the value of J (V) is minimum, U is the coefficient matrix of the optimal base matrix, Q is the optimal coefficient matrix, and J (V) is Tr (-2V)TF+-VTE-VD), wherein F+=(STS)+Q,E-=(STS)-,D=QTQ,V=U,VTA transposed matrix that is V; (S)TS)+Representation matrix (S)TS) taking the absolute value of the elements of the matrix and then summing the matrix (S)TS) matrix obtained by adding corresponding elements of (S)TS)-Representation matrix (S)TS) taking absolute value of element and subtracting matrix (S)TS) matrix obtained by corresponding elements;
and the classification unit is used for classifying the optimal coefficient matrix of the sample set to be recognized by adopting a trained classifier to complete face recognition.
In an implementation manner of the embodiment of the present invention, the decomposition unit is configured to determine a value of K within a set range; and for the determined value of K, decomposing the matrix of the sample set to be identified by adopting a new iteration sparse convex-non-negative matrix decomposition method, and solving a coefficient matrix and an optimal coefficient matrix of the optimal base matrix of the sample set to be identified, which correspond to K.
In another implementation manner of the embodiment of the present invention, the decomposition unit is configured to determine a coefficient matrix and an initial coefficient matrix of an initial basis matrix according to K; performing iterative calculation according to the coefficient matrix of the initial basis matrix, the initial coefficient matrix and the iterative formula; substituting the coefficient matrix and the coefficient matrix of the base matrix iteratively calculated in each step into an objective function:
J(V)=Tr(-2VTF+-VTE-VD) in which F+=(STS)+Q,E-=(STS)-,D=QTQ,V=U;
When the value of the objective function reaches a stable state, ending iterative computation, and taking the coefficient matrix and the coefficient matrix of the basis matrix computed in the last iterative computation as the coefficient matrix and the optimal coefficient matrix of the optimal basis matrix of the sample set to be identified, wherein the stable state means that the value of the objective function is kept unchanged or the variation amplitude is smaller than a preset amplitude (the preset amplitude can be set according to actual needs); or when the iteration times reach the iteration time threshold, selecting the coefficient matrix and the coefficient matrix of the base matrix calculated by the last iteration as the coefficient matrix and the optimal coefficient matrix of the optimal base matrix.
In another implementation manner of the embodiment of the present invention, the decomposition unit is further configured to determine a sparsification threshold; after each step of iterative computation, judging the size of each numerical value in the coefficient matrix of the base matrix subjected to iterative computation and the sparsification threshold value; and setting the value of the coefficient matrix of the base matrix calculated by iteration, which is greater than the sparsification threshold value, as 1, and setting the value of the coefficient matrix of the base matrix calculated by iteration, which is less than or equal to the sparsification threshold value, as 0.
In another implementation manner of the embodiment of the present invention, the apparatus further includes a training unit; the preprocessing unit is also used for preprocessing the training sample set to obtain a training sample set matrix; the decomposition unit is further used for processing the training sample set matrix by adopting a new iteration sparse convex-non-negative matrix decomposition method, solving a coefficient matrix and an optimal coefficient matrix of an optimal base matrix of the training sample set, wherein the coefficient matrix and the optimal coefficient matrix of the optimal base matrix are generated by adopting the same iteration formula as that used in the processing of the sample set to be identified; and the training unit is used for training a classifier by adopting the optimal coefficient matrix of the training sample set.
In a third aspect, an embodiment of the present invention provides a face recognition apparatus, where the apparatus includes: a memory for storing software programs and modules, and a processor coupled to the memory, wherein the processor is configured to execute the method of the first aspect when the processor is configured to run or execute the software programs and modules stored in the memory.
In a fourth aspect, an embodiment of the present invention further provides a computer-readable medium for storing a program code for execution by a face recognition apparatus, where the program code includes instructions for executing the method of the first aspect.
The technical scheme provided by the embodiment of the invention has the following beneficial effects:
the new iteration rule is adopted to carry out iteration optimization to solve the coefficient matrix and the optimal coefficient matrix of the optimal base matrix, the coefficient matrix of the base matrix is thinned in the iteration process, the new iteration rule and the thinning processing are better than the traditional multiplicative iteration rule, and the obtained characteristic data of the coefficient matrix of the optimal base matrix are more concentrated, so that the weight distribution of the optimal coefficient matrix is more concentrated and easier to classify, the face recognition rate is effectively improved, the operation amount is reduced, and finally the face recognition method has higher recognition rate and shorter operation time, and the recognition rate is as high as 100%. And the method of the invention gradually increases the recognition rate with the increase of K, which is beneficial to the reconstruction of the face image in the later period.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a flowchart of a face recognition method according to an embodiment of the present invention;
FIGS. 2 a-2 d are images of basis matrices obtained by PCA and various NMF methods;
FIG. 3 is a schematic diagram of the change of face recognition rate with K of PCA and various NMF methods
FIG. 4 is a graphical representation of run time versus K for PCA and various NMF methods
Fig. 5 is a schematic structural diagram of a face recognition apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail with reference to the accompanying drawings.
Fig. 1 is a flowchart of a face recognition method according to an embodiment of the present invention, and referring to fig. 1, the method includes:
step S11: a set of training samples is obtained and represented as an initial matrix.
In the embodiment of the present invention, obtaining the training sample set includes, but is not limited to, obtaining the training sample set from an existing network gallery, or obtaining the training sample set according to an image, where the image may be obtained by shooting in advance.
For example, the faces in the orl (olivetti Research laboratory) gallery provided by cambridge university may be used as the training sample set. Face images of 40 persons with different expressions are collected in the ORL gallery, and each person has 10 images of 400 persons, and each image has 256 gray levels and is 112 × 92. The facial expression and facial details of each person vary to different degrees, such as laughing and not laughing, eyes open and close, wearing and not wearing glasses, and the like; the human face posture also changes to a considerable extent, and the maximum depth rotation and plane rotation can reach 20 degrees; the dimensions of the face also vary by as much as 10%. And randomly selecting 5 images for each person to form a training sample set. Thus, 200 face images are collected in the training sample set. Of course, the training sample set is obtained only by way of example, and may be actually obtained through other databases or images prepared by the user.
The training sample set typically includes a plurality of sample images, which form a matrix. Taking the training sample set as an example, 200 sample images, each of which includes 10304(112 × 92) pixels, the size of the initial matrix X' formed by this training sample set is 10304 × 200.
Step S12: and preprocessing the training sample set to obtain a training sample set matrix, wherein the training sample set matrix is a matrix containing the low-frequency characteristic information of each image in the training sample set.
Since step S11 has represented the training sample set as an initial matrix, step S12 is actually a pre-process performed on the initial matrix as a target.
During face recognition, the influence of external environments such as illumination conditions and camera equipment, and the change of the face such as expression, posture change, age and coverage cause the defects of noise, insufficient contrast and the like of the obtained image, the difference between data and reality is large, and the recognition rate of the algorithm is greatly influenced. In order to ensure that the extracted features have better robustness to face changes, the face images need to be preprocessed. By preprocessing the face image, certain noise and illumination influences can be removed, and the interference of high-frequency information on the recognition rate is reduced. In an embodiment of the present invention, the preprocessing the face image may include the following steps:
firstly, carrying out gray level normalization on a face image.
The gray normalization is used for compensating the uneven illumination of the original image, so that the influence of illumination change on identification is overcome, and certain robustness is achieved. The main process is as follows: given the mean and variance of the gray scale of the image, the given value is assigned to the mean and variance of the gray scale in a linear way, so that the brightness and contrast of the image can be unified, and all face images follow the same or similar gray scale distribution. By carrying out gray level normalization on the image, the influence of illumination change on the identification effect can be overcome.
And secondly, extracting low-frequency information of the face image by adopting wavelet transformation.
The wavelet transform is the local transform of time and frequency, can more effectively extract information from signals and analyze local signals, and has strong capability of representing the local characteristics of the signals in both time domain and frequency domain.
The wavelet is used for extracting the characteristics of the face image, the wavelet is mainly used for extracting the low-frequency information of the face image, and the interference of the high-frequency information of the image serving as noise in the identification and classification process is reduced. The input face image is subjected to two-dimensional discrete wavelet transform (one-layer wavelet decomposition) to generate 4 sub-images (LL, LH, HL, HH). The LL is a low-frequency component (including low-frequency information of a face image), contains most of information of an original image, can be used as an approximation of the original image, and greatly suppresses high-frequency information such as random noise. And continuously carrying out two-dimensional discrete wavelet transform on the LL low-frequency sub-image to obtain a matrix X containing a large amount of low-frequency information of the sample.
And finally obtaining a training sample set matrix X containing low-frequency information (low-frequency characteristics) through the preprocessing, wherein the size of the matrix is J multiplied by I, J is the low-frequency characteristic dimension of each sample in the training sample set, I is the number of samples in the training sample set, and J, I is a positive integer. Taking the initial matrix X 'with the size of 10304 × 200 as an example, the size of the training sample set matrix X obtained by the above preprocessing of the matrix X' is 2784 × 200.
In the embodiment of the present invention, the preprocessing method is not limited to the first step to the second step included in the step S12, and may also be implemented in other manners, such as mean filtering, median filtering, and the like. The invention is not limited in this regard.
Step S13: processing a training sample set matrix by adopting a new iteration sparse convex nonnegative matrix factorization method, solving a coefficient matrix and an optimal coefficient matrix of an optimal base matrix of the training sample set, wherein the coefficient matrix and the optimal coefficient matrix of the optimal base matrix of the training sample set are iteratively generated by adopting the following iteration formulas:
wherein X is the training sample set matrix, the size is J multiplied by I, J, I are positive integers, J is the low-frequency characteristic dimension of each sample in the training sample set, I is the sample number of the training sample set, and X isTA transposed matrix that is X; w is a coefficient matrix of a base matrix obtained by nth iteration, G is a coefficient matrix obtained by nth iteration, W 'is a coefficient matrix of a base matrix obtained by nth-1 iteration, G' is a coefficient matrix obtained by nth-1 iteration, W, G, W 'and G' are I multiplied by K, K represents the characteristic dimension of X, K is a positive integer and is less than or equal to J, and n is a positive integer greater than 1; w'TIs a transposed matrix of W ', G'TIs a transposed matrix of G', GTA transposed matrix for G; wikElement of ith row and kth column of W, GikThe element in the ith row and the kth column of G, I and K are positive integers, I is less than or equal to I, and K is less than or equal to K;W'ikis an element of line i of W ' and line k of W ', G 'ikElement of row i and column k of G'; when the value of j (H) is the minimum, W is the coefficient matrix of the optimal basis matrix, G is the optimal coefficient matrix, and j (H) is Tr (-2H)TB+-HTA-HC) in which B+=(XTX)+G,A-=(XTX)-,C=GTG,H=W,HTA transposed matrix of H.
The training sample set matrix is a matrix obtained after preprocessing of the training sample set, W is specifically a coefficient matrix of a base matrix of the training sample set matrix obtained by the nth iteration, and G is a coefficient matrix of the training sample set matrix obtained by the nth iteration.
By adopting the formula, the coefficient matrix of the base matrix and each element in the coefficient matrix can be iterated, and the elements form the coefficient matrix and the coefficient matrix of the base matrix, so that the iterative operation of the coefficient matrix and the coefficient matrix of the base matrix is completed through the iteration of the elements in the matrix.
In the above formula, [ (X)TX)+G']ikRepresentation matrix (X)TX)+Multiply by G'Obtained byTo the element of the ith row and the kth column of the matrix; other parenthetical operations are similar and will not be described herein.
That is (X)TX)+Representation matrix (X)TX) taking the absolute value of the elements of the matrix and then summing the values of the elements of the matrix (X)TX) corresponding elements are added to obtain a matrix;that is (X)TX)-Representation matrix (X)TX) is obtained by taking the absolute value of the element and subtracting the matrix (X)TX) of the corresponding elements.
For example, X is 2784 × 200, when K is 30, i.e., the feature dimension is reduced to 30, W is 200 × 30, and G is 200 × 30; alternatively, when K is 25, the feature dimension is reduced to 25, W is 200 × 25, and G is 200 × 25.
In step S13, the iterative formula is determined according to the new iterative sparse convex-non-negative matrix factorization method, and the principle is as follows:
first, the objective function of the basic CNMF is:
J′(H)=Tr(-2HTB+-HTA-HC+2HTB-+HTA+HC);
a new objective function J (H) is disclosed in the invention and is shown in formula (1), the new J (H) is simpler and easier to calculate than the traditional J' (H) expression, the convergence speed can be effectively improved, the optimization effect on W, G is better, and the face recognition rate is higher.
J(H)=Tr(-2HTB+-HTA-HC) (1)
(1) In the formula, B+=(XTX)+G′,A-=(XTX)-,C=G′TG', H ═ W, and wherein, | (X)TX)ikI represents the pair matrix XTEach element in X takes the absolute value.
A binary helper function Z (H, H ') is defined for H and H', which is required to satisfy equation (2).
Z(H,H′)≥J(H),Z(H,H)=J(H) (2)
Definition HminThe value of H at the minimum of the binary function Z (H, H ') for a given H' is given by equation (3):
therefore, the following steps are carried out:
J(H′)=Z(H′,H′)≥Z(Hmin,H′)≥J(Hmin)
therefore, as long as Z (H, H') satisfying the condition (2) is found, it is ensured that the objective function j (H) is an invariant function, i.e., the objective function converges. The equivalent objective function shown in the formula (4) is obtained from the formula (1).
J(H)=Tr(-2HTB--HTA+HC-2HTB++2HTB-+HTA+HC-HTA-HC) (4)
Wherein:
obtaining:
wherein HikAnd HilRespectively representThe elements of the ith row and the kth column of the matrix H, k and l may be equal or unequal, H'jkThe elements in the jth row and kth column of the matrix H' are represented, and j and i may or may not be equal.
Therefore, Z (H, H') satisfying the condition (2) is defined by formula (5). To satisfy equation (3), H is required when Z (H, H ') takes a minimum value, and the derivative of Z (H, H') can be made 0 to obtain equation (6).
The minimum value of Z (H, H') is calculated by the formula (6), and the H value (that is, H in the formula (3)) when Z is the minimum value can be obtainedmin) As shown in formula (7).
Is substituted into the formula (8) to the formula (7),
B+=(XTX)+G′,B-=(XTX)-G′,A=XTX,C=G′TG′,H=W (8)
the iteration rule for obtaining W is shown in formula (9).
The iterative formula for G can be obtained by the same method as shown in formula (10):
therefore, the iteration rule defined by equations (9) and (10) can ensure that J (H ') ≧ Z (H', H ') ≧ Z (H, H') ≧ J (H) so that objective function J (H) is an invariant function, i.e., equations (9) and (10) can ensure stable convergence of the objective function.
In the above formula, the coefficient matrix W and the optimal coefficient matrix G of the optimal base matrix can satisfy the objective function value j (h) minimum, so that the objective function converges stably.
In the embodiment of the present invention, step S13 may include:
determining the value of K within a set range; and decomposing the matrix by adopting a new iteration sparse convex-non-negative matrix decomposition method for the determined value of K, and solving a coefficient matrix and an optimal coefficient matrix of the optimal base matrix of the training sample set corresponding to K.
In the embodiment of the present invention, the set range is preferably 180. gtoreq.K.gtoreq.20. When the K value is too small, the dimension is reduced to be too low, so that the feature loss is serious, and with the increase of the K, main organs of each part of the human face contour are gradually exposed, and the detail part is clearer, namely the larger the value of the K is, the better the image reconstruction effect is, so that the value of the K is not too small, and when the K is less than 20, the dimension of a coefficient matrix of a base matrix is too low, so that the feature is lost too much, and the later image reconstruction distortion is serious; when K is close to J, the reconstructed face image is as clear as the original image without any visual difference. However, if K is too large, the calculation time is too long, and the recognition rate reaches the upper limit and does not increase infinitely with the increase of K, so the value of K should not be too large, and when K exceeds 180, the operation time is too long and the recognition rate remains 100%. Therefore, in the embodiment of the present invention, K is set to be 180. gtoreq.K.gtoreq.20.
Specifically, for the determined value of K, decomposing the non-negative matrix of the training sample set by using a new iteration sparse convex non-negative matrix decomposition method includes:
firstly, determining a coefficient matrix of an initial base matrix and an initial coefficient matrix according to K. In the embodiment of the invention, the first step is completed in the following way: and respectively generating random matrixes according to the coefficient matrix of the initial base matrix and the dimensionality of the initial coefficient matrix. I.e. a random matrix W of dimension I x K and a random matrix G of dimension I x K are generated with random values between 0-1.
And secondly, performing iterative computation according to the coefficient matrix of the initial basis matrix, the initial coefficient matrix and an iterative formula.
And step three, substituting the coefficient matrix and the coefficient matrix of the base matrix iteratively calculated in each step into an objective function:
J(H)=Tr(-2HTB+-HTA-HC) in which B+=(XTX)+G,A-=(XTX)-,C=GTG,H=W;
When the value of the target function reaches a stable state, finishing iterative computation, and taking the coefficient matrix and the coefficient matrix of the base matrix computed by the last iterative computation as the coefficient matrix and the optimal coefficient matrix of the optimal base matrix of the training sample set; or when the iteration times reach the iteration time threshold, selecting the coefficient matrix and the coefficient matrix of the base matrix calculated in the last iteration as the coefficient matrix and the optimal coefficient matrix of the optimal base matrix of the training sample set.
Iterative computation is carried out by using the formulas (9) and (10), and new W is obtained by each iterationikAnd GikWill be respectively composed of WikAnd GikSubstituting the formed matrix W and G into a formula (1) to calculate the value of J (H); the value of J (H) is continuously reduced along with the increase of the iteration times, when the value of J (H) reaches a stable state, the iteration is ended, and the W obtained by the last iteration isikAnd GikThe formed W and G matrixes are used as a coefficient matrix and an optimal coefficient matrix of the optimal base matrix. Here, the steady state means that the value of j (h) is considered to reach the steady state when the value of j (h) remains unchanged or the variation range is smaller than a predetermined range, for example, the value of j (h) changes by less than one thousandth. In addition, since the target functions j (h) can be kept and tend to converge and stabilize by the formulas (9) and (10), the last iteration result is directly selected as the coefficient matrix of the optimal base matrix and the optimal coefficient matrix after stabilization.
Or when the iteration times reach the preset iteration times, selecting W and G obtained by the last iteration as the coefficient matrix and the optimal coefficient matrix of the optimal base matrix. For example, the predetermined number of iterations is 500, and when 500 iterations are finished, the values of j (h) remain unchanged, and W and G obtained in the last iteration are selected as the coefficient matrix and the optimal coefficient matrix of the optimal basis matrix.
The coefficient matrix of the base matrix needs to be thinned while iteration is performed. The process of sparsifying the coefficient matrix of the base matrix includes: determining a sparsification threshold; after each step of iterative computation, judging the size of each numerical value in the coefficient matrix of the base matrix subjected to iterative computation and the sparsification threshold value; and setting the value of the coefficient matrix of the base matrix calculated by iteration, which is greater than the sparsification threshold value, as 1, and setting the value of the coefficient matrix of the base matrix calculated by iteration, which is less than or equal to the sparsification threshold value, as 0. And in the next iteration, adopting the coefficient matrix of the thinned base matrix. The thinning threshold is preset and can be given in advance according to actual needs.
In iteration, a thresholding method is used for thinning the coefficient matrix of the base matrix into 0 and 1 matrixes, so that the characteristic coefficient data in the coefficient matrix of the image base matrix is more concentrated, more sparse and more prominent in human face characteristics, the characteristic coefficient which can prominently express the human face characteristics can be effectively extracted, the weight coefficient in the corresponding coefficient matrix G is more concentrated and easier to classify, and the recognition rate is improved; meanwhile, the processed matrix is sparse, the matrix operation amount is reduced, and the calculation speed of the method is increased.
In the embodiment of the invention, the initial values of W 'and G' are random number matrixes between 0 and 1, so that the selected range of the thinning threshold is between 0 and 1. Preferably, the thinning threshold may be set to 0.05.
Step S14: and training the classifier by adopting the optimal coefficient matrix of the training sample set.
In the embodiment of the present invention, the classifier is a Support Vector Machine (SVM) classifier. The SVM is essentially a two-class classifier, and training and classifying the faces of multiple classes is a typical multi-classification problem. The SVM can adopt two strategies of one-to-one and one-to-many when processing the multi-classification problem, and the classification result of the one-to-one strategy is more accurate. Therefore, the invention adopts a one-to-one strategy, and classifies N types of samples pairwise to construct N (N-1)/2 classifiers. For example, when the total number N of classes of the face samples is 40, 780 classifiers are constructed by adopting a one-to-one method.
The dimensionality of the coefficient matrix of the optimal base matrix of the training sample set corresponding to different K values is different, the larger the dimensionality is, the more the characteristic coefficient data is kept, and the higher the classification recognition rate is. In step S14, the classifier is preferably trained using the optimal coefficient matrix of the training sample set with K180, which ensures a high recognition rate.
And taking the optimal coefficient matrix G and the class label matrix Y of the training sample set as an input training set of the SVM classifier, and training the classifier by using the training set. The class label matrix is a matrix used in classification for marking sample classes, and the data thereof has only two values such as 0 and 1, each value represents a class to which the face sample belongs, such as 1 represents one class, and 0 represents another class (binary classification).
The specific training process is as follows: the optimal coefficient matrix G of the training sample set obtained by the decomposition has a size of 200 × K. Because the face training samples of each of the 40 types of people are 5 images, when distinguishing the p-th type (39 is more than or equal to p and more than or equal to 1) sample from the q-th type (40 is more than or equal to q is more than or equal to p +1) (second classification), the total number of 5 samples belonging to the p-th type and the total number of 5 samples belonging to the q-th type in G. The class p samples form a matrix V1 of size 5 XK (180. gtoreq.K.gtoreq.20), with a class label matrix of all 1 column vectors Y1 of 5X 1, and the class q samples form a matrix V2 of size 5 XK (180. gtoreq.K.gtoreq.20), with a class label matrix of all 0 column vectors Y2. Combining the matrixes V1 and V2 into a sample matrix V with the size of 10 xK, combining the matrixes Y1 and Y2 into a class label matrix Y with the size of 10 x 1, taking the matrix V, Y as an input training set of the SVM classifier, and calculating classifier parameter information capable of correctly dividing the p-th class sample and the q-th class sample through an SVM algorithm. And continuously taking the value of p from 1 to 39, and simultaneously continuously taking the value of q from p +1 to 40, namely, 40(40-1)/2 times of SVM calculation is needed, continuously storing the correct two-classification parameters calculated each time in a file to obtain a multi-classifier parameter file, and calling the file during classification to obtain the parameter information of the multi-classifier.
Step S15: and preprocessing the sample set to be identified to obtain a sample set matrix to be identified.
In the embodiment of the present invention, the sample set to be recognized may be a set of face images that need to be classified actually, or a set of face images for testing. If the sample set to be recognized is also composed of a plurality of face images, for example, 200 sample images are composed of a plurality of face images of a plurality of people (e.g., 40 people), each sample image includes 10304(112 × 92) pixels, and the size of the initial matrix S' composed of this sample set to be recognized is 10304 × 200.
The process of preprocessing the initial matrix of the sample set to be recognized in step S15 is the same as the process of preprocessing the initial matrix of the training sample set in step S12, and is not repeated here. And finally obtaining a to-be-identified sample set matrix S containing low-frequency information through the preprocessing process of S12, wherein the size of the matrix is J multiplied by I, J is the low-frequency characteristic dimension of each sample in the to-be-identified sample set, I is the number of samples in the to-be-identified sample set, and J, I is positive integers. Taking the initial matrix S' with the size of 10304 × 200 as an example, the size of the sample set matrix S to be identified after the preprocessing is 2784 × 200.
Step S16: processing a matrix of a sample set to be identified by adopting a new iteration sparse convex nonnegative matrix decomposition method, solving a coefficient matrix and an optimal coefficient matrix of an optimal base matrix of the sample set to be identified, and iteratively generating the coefficient matrix and the optimal coefficient matrix of the optimal base matrix of the sample set to be identified by adopting the following iterative formula:
wherein S is the matrix of the sample set to be identified, the size is J multiplied by I, J, I are positive integers, J is the low-frequency characteristic dimension of each sample in the sample set to be identified, I is the number of samples in the sample set to be identified, and S isTIs a transposed matrix of S; u is a coefficient matrix of a base matrix obtained by nth iteration, Q is a coefficient matrix obtained by nth iteration, U 'is a coefficient matrix of a base matrix obtained by n-1 th iteration, Q' is a coefficient matrix obtained by n-1 th iteration, U, Q, U 'and Q' are I multiplied by K, K represents the characteristic dimension of S, K is a positive integer and is less than or equal to J, and n is a positive integer greater than 1; u'TIs a transposed matrix of U ', Q'TTransposition moment of QArray, QTA transposed matrix that is Q; u shapeikElement of i-th row and k-th column of U, QikThe element in the ith row and the kth column of Q, I and K are positive integers, I is less than or equal to I, and K is less than or equal to K; u'ikElement of line i of U 'and column k, Q'ikThe element of row i and column k of Q'; when the value of J (V) is minimum, U is the coefficient matrix of the optimal base matrix, Q is the optimal coefficient matrix, and J (V) is Tr (-2V)TF+-VTE-VD) in which F+=(STS)+Q,E-=(STS)-,D=QTQ,V=U,VTA transposed matrix that is V; (S)TS)+Representation matrix (S)TS) taking the absolute value of the elements of the matrix and then summing the matrix (S)TS) matrix obtained by adding corresponding elements of (S)TS)-Representation matrix (S)TS) taking absolute value of element and subtracting matrix (S)TS) of the corresponding elements.
The matrix of the sample set to be identified is the matrix obtained after preprocessing the sample set to be identified, U is the coefficient matrix of the base matrix of the sample set matrix to be identified obtained by the nth iteration, and Q is the coefficient matrix of the sample set matrix to be identified obtained by the nth iteration.
The process of processing the to-be-recognized sample set matrix by using the new iterative sparse convex non-negative matrix factorization method in step S16 is the same as the process of processing the training sample set matrix by using the new iterative sparse convex non-negative matrix factorization method in step S13, and is not repeated here.
The values of different K correspond to different decomposition dimensions, the larger the decomposition dimensions are, the less the characteristics are lost, and the more accurate the classification identification is. In step S16, the sample set matrix to be recognized is preferably decomposed by K180, so as to ensure a high recognition rate.
Step S17: and classifying the optimal coefficient matrix of the sample set to be recognized by adopting a trained classifier to complete face recognition.
And (3) classifying the optimal coefficient matrix of the sample set to be identified, wherein the characteristics are more concentrated and the calculation amount is smaller than the characteristics of directly classifying the optimal coefficient matrix of the sample set to be identified. In the embodiment of the present invention, classifying the optimal coefficient matrix of the sample set to be identified by using the classifier may include: and classifying the optimal coefficient matrix of the sample set to be identified by adopting a classifier.
The classification and identification process comprises the following steps: inputting the optimal coefficient matrix Q with the size of 200 xK into an SVM classifier for classification, and defining a category voting matrix for voting the category to which each sample belongs, wherein the size of the category voting matrix is mxs, m is the total number of samples 200, and s is the total number of categories 40. And calling the multi-classifier parameter file obtained by training in the S14, sequentially carrying out two-classification judgment on each sample in 200 samples, judging whether the sample belongs to the p-th class or the q-th class, continuously taking the value of p from 1 to 39, and continuously taking the value of q from p +1 to 40. If the sample is judged to belong to the pth class, adding 1 to the pth column of the category voting matrix, namely casting 1 vote on the pth column; on the contrary, if the sample is judged as the q-th class by the classifier, 1 is added to the q-th column of the class voting matrix, i.e. 1 vote is cast to the q-th column. The column number of the column with the most votes among all the columns of the statistical category voting matrix is the category number of the sample. The classification condition of 200 samples is counted, and a class number matrix with the size of 200 × 1 can be obtained. The row value of the category number matrix corresponds to the number of samples, and the column value corresponds to the category number to which the sample belongs. Experiments show that the SVM one-to-one classifier can correctly classify and recognize different expressions belonging to the same face.
If the number of the images needing to be classified and identified exceeds the number, the dimensions of the initial matrix of the training sample set and the initial matrix of the sample set to be identified can be expanded simultaneously. For example, 1600 human faces of 80 persons, 20 human faces per person, if 10 images are randomly selected by each person to form a training sample set, and the remaining 10 images of each person form a sample set to be recognized, 800 human face images are respectively in the training sample set and the sample set to be recognized, if the size of each image is 130 × 100, the dimensions of the initial matrix X 'of the expanded training sample set and the initial matrix S' of the sample set to be recognized are J '× I', wherein J '═ 13000 and I' ═ 800, and the step S12-S17 are sequentially adopted, so that the classification recognition can be completed. If the number of the images needing to be classified and identified is less than the number, the dimensions of the initial matrix of the training sample set and the initial matrix of the sample set to be identified can be reduced. For example, for 20 persons, 10 face images are obtained for each person, and the total number of the face images is 200, and if each person randomly selects 5 face images as a training sample set and the remaining 5 face images are used as a sample set to be recognized, 100 face images are respectively obtained in the training sample set and the sample set to be recognized. If the size of each image is 90 × 60, the dimensions of the initial matrix X 'of the specified training sample set and the initial matrix S' of the sample set to be recognized are J '× I': and J '5400 and I' 100, and executing steps S12-S17 to complete the classification.
When classification recognition is carried out, if the image to be recognized does not exist in the training set, the image to be recognized can be added into the training set, and a new coefficient matrix and an optimal coefficient matrix of the optimal base matrix are obtained through recalculation by adopting a new iteration sparse convex nonnegative matrix decomposition method; and the new optimal coefficient matrix is used as input to retrain the classifier.
The following describes the effect of the face recognition method provided by the embodiment of the present invention through a comparison test:
the three comparison methods adopted in the comparison test are respectively as follows: a. a PCA method; b. an SNMF method; c. the basic CNMF method. The method provided by the embodiment of the invention comprises the following steps: d. a new iterative sparse CNMF method.
Take 400 images of 10 persons in the ORL gallery, each image having 256 gray levels and a size of 112 × 92. The facial expression and facial details of each person vary to different degrees, such as laughing and not laughing, eyes open and close, wearing and not wearing glasses, and the like; the human face posture also changes to a considerable extent, and the maximum depth rotation and plane rotation can reach 20 degrees; the dimensions of the face also vary by as much as 10%. The first 5 images are randomly selected for each person to serve as training images to form a training sample set, and the remaining 5 images serve as images to be recognized to form a sample set to be recognized. Thus, 200 training samples and samples to be identified are respectively collected.
Fig. 2a to fig. 2d are respectively an optimal basis matrix image obtained from a training sample set by four methods a to d according to an embodiment of the present invention, where fig. d is an optimal basis matrix image obtained by restoring a coefficient matrix of an optimal basis matrix obtained by training in the training sample set by using an F ═ XW formula. As can be seen from fig. 2, the optimal basis matrix image obtained by the method d can accurately reflect the position feature information of the eyes and the nose of the human face, so that the human face feature data are more concentrated and sparse; however, as shown in fig. 2a, 2b, and 2c, the optimal basis matrix images obtained by the methods a, b, and c are too dispersed and blurred and are not concentrated enough in feature information. Therefore, compared with the methods a, b and c, the new iteration sparse CNMF method provided by the invention has the advantages that the calculated optimal base matrix contains more sparse characteristic data, the characteristic information is more accurate and centralized, and the classification of the corresponding optimal coefficient matrix of the human face characteristics is more accurate. In terms of face recognition rate when K takes different values and time consumed by the algorithm, comparison results of the four methods are shown in tables 1 and 2 below, and effect comparison curves of the four methods when K takes continuous values are shown in fig. 3 and 4.
TABLE 1-K compares the face recognition rates of various methods for taking different values
K 20 35 55 75 180 220
Method a 21% 16.5% 18.5% 15.5% 13.5% 12.5%
Method b 85% 88% 89% 87% 75% 70%
Method c 67% 54% 22% 16% 3% 2.5%
Method d 98.5% 99% 99% 99% 100% 100%
TABLE 2-K running time comparison of various methods for different values (units: seconds)
K 20 35 55 75 180 220
Method a 13.8 17.3 20.9 33.7 51.3 57.7
Method b 12.5 14.5 16.2 20.3 35.1 38.2
Method c 20.0 21.5 24.1 25.8 37.3 40.3
Method d 18.5 18.8 19.2 20.3 24.8 25.3
As can be seen from table 1 and fig. 3, the new iterative sparse CNMF method provided by the present invention can greatly improve the face recognition rate, which is significantly higher than the a-c methods; the new iteration rule is better than the traditional multiplicative iteration rule in the technical scheme of the invention, and the obtained optimal coefficient matrix data is more concentrated and sparser and more concentrated. As can be seen from fig. 3, the new iterative sparse CNMF method provided by the present invention has an identification rate that continuously increases with the increase of K, and when K is 180, the identification rate is as high as 100%, and when K continuously increases, the identification rate remains 100%; in the SNMF method provided by the method b, when the K is increased to 55, the recognition rate is the highest and is only 89%, and the K is continuously increased and is reduced on the contrary; the recognition rate of the method a and the method c is low, and the recognition rate is continuously reduced along with the increase of K. However, the larger K is, the more accurate the image reconstruction is, so as can be seen from fig. 3, only the new iterative CNMF method provided by the present invention can ensure that a higher K value can be obtained even at a higher recognition rate, thereby ensuring that the image can be better reconstructed.
From the calculation time required by the various methods given in table 2 and fig. 4, it can be seen that the identification speed of the new iterative CNMF method provided by the present invention is significantly faster than the other three methods when K is continuously increased. The coefficient matrix of the optimal and thinned base matrix and the optimal coefficient matrix can be obtained by combining the new iteration rule invented in the technical scheme of the invention with a threshold sparse method, so that the calculation amount is reduced.
As shown in fig. 3 and 4, the recognition rate of the existing three methods a, b, and c is continuously decreased and the time consumption is continuously increased as K is increased; with the increase of K, the operation time of the technical scheme of the invention is slowly increased, and the recognition rate is continuously increased; according to the method provided by the invention, the K value is 180 when the recognition rate is 100% at most, and the K values of other methods when the recognition rate is the highest are all smaller, and the larger the K is, the more accurate the later image reconstruction is. Therefore, the method d provided by the invention is obviously superior to the existing three methods of a, b and c by comprehensively considering the overall performance of the algorithm time and the recognition rate and the accuracy of later-stage image reconstruction.
Based on the new iteration sparse CNMF method provided by the embodiment of the invention, factors such as recognition rate, operation time, later-stage image reconstruction and the like are comprehensively considered, K is 180, face recognition software based on MATLAB is programmed, face images to be recognized of different people are randomly picked out from 200 faces with the probability of 100%, and the software is equally classified and recognized correctly under the conditions of different expressions, opening and closing of eyes and wearing of glasses. Software can pick out a person for correct recognition with 100% probability and output a front face for identifying the identity of the person, and meanwhile, the category of the face and the recognition rate of a sample set to be recognized can be correctly given in a text box of a software interface.
In conclusion, the face recognition technology based on the new iteration sparse CNMF method provided by the invention has higher theoretical value; meanwhile, the technical scheme of the invention can obtain extremely high face recognition rate, has short calculation time, can ensure higher accuracy of face reconstruction in the later period, and has high engineering application value because the technology is realized by software.
Fig. 5 is a schematic structural diagram of a face recognition apparatus according to an embodiment of the present invention, and referring to fig. 5, the apparatus includes:
the preprocessing unit 201 is configured to preprocess a sample set to be identified to obtain a sample set matrix to be identified;
the decomposition unit 202 is configured to process the matrix of the sample set to be identified by using a new iterative sparse convex-non-negative matrix decomposition method, to obtain a coefficient matrix and an optimal coefficient matrix of an optimal basis matrix of the sample set to be identified, where the coefficient matrix and the optimal coefficient matrix of the optimal basis matrix of the sample set to be identified are iteratively generated by using the following iterative formulas:
wherein S is the matrix of the sample set to be identified, the size is J multiplied by I, J, I are positive integers, J is the low-frequency characteristic dimension of each sample in the sample set to be identified, I is the number of samples in the sample set to be identified, and S isTIs a transposed matrix of S; u is a coefficient matrix of a base matrix obtained by nth iteration, Q is a coefficient matrix obtained by nth iteration, U 'is a coefficient matrix of a base matrix obtained by n-1 th iteration, Q' is a coefficient matrix obtained by n-1 th iteration, U, Q, U 'and Q' are I multiplied by K, K represents the characteristic dimension of S, K is a positive integer and is less than or equal to J, and n is a positive integer greater than 1; u'TIs a transposed matrix of U ', Q'TAs a transposed matrix of Q'. QTA transposed matrix that is Q; u shapeikElement of i-th row and k-th column of U, QikThe element in the ith row and the kth column of Q, I and K are positive integers, I is less than or equal to I, and K is less than or equal to K; u'ikElement of line i of U 'and column k, Q'ikThe element of row i and column k of Q'; when the value of J (V) is minimum, U is the coefficient matrix of the optimal base matrix, Q is the optimal coefficient matrix, and J (V) is Tr (-2V)TF+-VTE-VD) in which F+=(STS)+Q,E-=(STS)-,D=QTQ,V=U,VTA transposed matrix that is V; (S)TS)+Representation matrix (S)TS) taking the absolute value of the elements of the matrix and then summing the matrix (S)TS) matrix obtained by adding corresponding elements of (S)TS)-Representation matrix (S)TS) taking absolute value of element and subtracting matrix (S)TS) matrix obtained by corresponding elements;
and the classification unit 203 is configured to classify the optimal coefficient matrix of the sample set to be recognized by using the trained classifier, so as to complete face recognition.
In the embodiment of the present invention, the decomposition unit 202 is configured to determine a value of K within a set range; and for the determined value of K, decomposing a matrix of the sample set to be recognized by adopting a new iteration sparse convex-non-negative matrix decomposition method, and solving a coefficient matrix and an optimal coefficient matrix of the optimal base matrix of the sample set to be recognized, which correspond to K.
In the embodiment of the present invention, the set range may preferably be 180. gtoreq.K.gtoreq.20.
In the embodiment of the present invention, the decomposition unit 202 is configured to determine a coefficient matrix of the initial base matrix and an initial coefficient matrix according to K; performing iterative computation according to the coefficient matrix of the initial basis matrix, the initial coefficient matrix and an iterative formula; substituting the coefficient matrix and the coefficient matrix of the base matrix iteratively calculated in each step into an objective function:
J(V)=Tr(-2VTF+-VTE-VD) in which F+=(STS)+Q,E-=(STS)-,D=QTQ,V=U;
When the value of the target function reaches a stable state, finishing iterative computation, and taking the coefficient matrix and the coefficient matrix of the base matrix computed by the last iterative computation as the coefficient matrix and the optimal coefficient matrix of the optimal base matrix of the sample set to be identified, wherein the stable state means that the value of the target function is kept unchanged or the variation amplitude is smaller than a preset amplitude; or when the iteration times reach the iteration time threshold, selecting the coefficient matrix and the coefficient matrix of the base matrix calculated by the last iteration as the coefficient matrix and the optimal coefficient matrix of the optimal base matrix of the sample set to be identified.
In this embodiment of the present invention, the decomposition unit 202 is further configured to determine a sparsification threshold; after each step of iterative computation, judging the size of each numerical value in the coefficient matrix of the base matrix subjected to iterative computation and the sparsification threshold value; and setting the value of the coefficient matrix of the base matrix calculated by iteration, which is greater than the sparsification threshold value, as 1, and setting the value of the coefficient matrix of the base matrix calculated by iteration, which is less than or equal to the sparsification threshold value, as 0.
Further, the apparatus further comprises a training unit 204;
the preprocessing unit 201 is further configured to preprocess the training sample set to obtain a training sample set matrix;
the decomposition unit 202 is further configured to process the training sample set matrix by using a new iterative sparse convex-non-negative matrix decomposition method, and find out a coefficient matrix and an optimal coefficient matrix of an optimal basis matrix of the training sample set, where the coefficient matrix and the optimal coefficient matrix of the optimal basis matrix are iteratively generated by using the same iterative formula as that used in processing the sample set to be identified;
and the training unit 204 is configured to train a classifier by using the optimal coefficient matrix of the training sample set.
It should be noted that: in the face recognition apparatus provided in the above embodiment, only the division of the functional modules is illustrated, and in practical applications, the function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the face recognition device and the face recognition method provided by the above embodiments belong to the same concept, and specific implementation processes thereof are described in detail in the method embodiments and are not described herein again.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (6)

1. A face recognition method, comprising:
preprocessing a sample set to be identified to obtain a sample set matrix to be identified;
processing the matrix of the sample set to be identified by adopting a new iteration sparse convex nonnegative matrix decomposition method, and solving a coefficient matrix and an optimal coefficient matrix of an optimal base matrix of the sample set to be identified, wherein the coefficient matrix and the optimal coefficient matrix of the optimal base matrix of the sample set to be identified are iteratively generated by adopting the following iterative formulas:
wherein S is the matrix of the sample set to be identified, the size is J multiplied by I, J, I are positive integers, J is the low-frequency characteristic dimension of each sample in the sample set to be identified, I is the number of samples in the sample set to be identified, and S isTIs a transposed matrix of S; u is a coefficient matrix of a base matrix obtained by nth iteration, Q is a coefficient matrix obtained by nth iteration, U 'is a coefficient matrix of a base matrix obtained by n-1 th iteration, Q' is a coefficient matrix obtained by n-1 th iteration, U, Q, U 'and Q' are I multiplied by K, K represents the characteristic dimension of S, K is a positive integer and is less than or equal to J, and n is a positive integer greater than 1; u'TIs a transposed matrix of U ', Q'TAs a transposed matrix of Q'. QTA transposed matrix that is Q; u shapeikElement of i-th row and k-th column of U, QikThe element in the ith row and the kth column of Q, I and K are positive integers, I is less than or equal to I, and K is less than or equal to K; u'ikElement of line i of U 'and column k, Q'ikThe element of row i and column k of Q'; when the value of J (V) is minimum, U is the coefficient matrix of the optimal base matrix, Q is the optimal coefficient matrix, and J (V) is Tr (-2V)TF+-VTE-VD) in which F+=(STS)+Q,E-=(STS)-,D=QTQ,V=U,VTA transposed matrix that is V; (S)TS)+Representation matrix (S)TS) taking the absolute value of the elements of the matrix and then summing the matrix (S)TS) matrix obtained by adding corresponding elements of (S)TS)-Representation matrix (S)TS) taking absolute value of element and subtracting matrix (S)TS) matrix obtained by corresponding elements;
classifying the optimal coefficient matrix of the sample set to be recognized by adopting a trained classifier to complete face recognition;
processing the matrix of the sample set to be identified by adopting a new iteration sparse convex nonnegative matrix factorization method to obtain a coefficient matrix and an optimal coefficient matrix of an optimal base matrix of the sample set to be identified, wherein the method comprises the following steps:
determining the value of K within a set range;
determining a coefficient matrix and an initial coefficient matrix of the initial base matrix according to the K;
performing iterative calculation according to the coefficient matrix of the initial basis matrix, the initial coefficient matrix and the iterative formula;
substituting the coefficient matrix and the coefficient matrix of the base matrix iteratively calculated in each step into an objective function:
J(V)=Tr(-2VTF+-VTE-VD);
when the value of the objective function reaches a stable state, ending iterative computation, and taking the coefficient matrix and the coefficient matrix of the base matrix computed by the last iterative computation as the coefficient matrix and the optimal coefficient matrix of the optimal base matrix of the sample set to be identified, wherein the stable state means that the value of the objective function is kept unchanged or the variation amplitude is smaller than a preset amplitude; or when the iteration times reach the iteration time threshold, selecting the coefficient matrix and the coefficient matrix of the base matrix calculated by the last iteration as the coefficient matrix and the optimal coefficient matrix of the optimal base matrix of the sample set to be identified.
2. The method according to claim 1, wherein for the determined value of K, decomposing the matrix of the sample set to be identified by using a new iterative sparse convex-non-negative matrix decomposition method to obtain a coefficient matrix and an optimal coefficient matrix of the optimal basis matrix of the sample set to be identified corresponding to K, further comprising:
determining a sparsification threshold;
after each step of iterative computation, judging the size of each numerical value in the coefficient matrix of the base matrix subjected to iterative computation and the sparsification threshold value; and setting the value of the coefficient matrix of the base matrix calculated by iteration, which is greater than the sparsification threshold value, as 1, and setting the value of the coefficient matrix of the base matrix calculated by iteration, which is less than or equal to the sparsification threshold value, as 0.
3. The method according to claim 1 or 2, characterized in that the method further comprises:
preprocessing a training sample set to obtain a training sample set matrix;
processing the training sample set matrix by adopting a new iteration sparse convex nonnegative matrix factorization method, and solving a coefficient matrix and an optimal coefficient matrix of an optimal base matrix of the training sample set, wherein the coefficient matrix and the optimal coefficient matrix of the optimal base matrix are generated by adopting the same iteration formula as that used for processing the sample set to be identified in an iteration mode;
and training a classifier by adopting the optimal coefficient matrix of the training sample set.
4. An apparatus for face recognition, the apparatus comprising:
the preprocessing unit is used for preprocessing a sample set to be identified to obtain a sample set matrix to be identified;
the decomposition unit is used for processing the matrix of the sample set to be identified by adopting a new iteration sparse convex nonnegative matrix decomposition method, solving a coefficient matrix and an optimal coefficient matrix of the optimal base matrix of the sample set to be identified, and iteratively generating the coefficient matrix and the optimal coefficient matrix of the optimal base matrix of the sample set to be identified by adopting the following iterative formulas:
wherein S is the matrix of the sample set to be identified, the size is J multiplied by I, J, I are positive integers, J is the low-frequency characteristic dimension of each sample in the sample set to be identified, I is the number of samples in the sample set to be identified, and S isTIs a transposed matrix of S; u is the coefficient matrix of the basis matrix obtained by the nth iteration, Q is the coefficient matrix obtained by the nth iteration, U 'is the coefficient matrix of the basis matrix obtained by the (n-1) th iteration, and Q' is the (n-1) th iterationThe sizes of U, Q, U 'and Q' of the obtained coefficient matrix are I multiplied by K, K represents the characteristic dimension of S, K is a positive integer and is less than or equal to J, and n is a positive integer greater than 1; u'TIs a transposed matrix of U ', Q'TAs a transposed matrix of Q'. QTA transposed matrix that is Q; u shapeikElement of i-th row and k-th column of U, QikThe element in the ith row and the kth column of Q, I and K are positive integers, I is less than or equal to I, and K is less than or equal to K; u'ikElement of line i of U 'and column k, Q'ikThe element of row i and column k of Q'; when the value of J (V) is minimum, U is the coefficient matrix of the optimal base matrix, Q is the optimal coefficient matrix, and J (V) is Tr (-2V)TF+-VTE-VD) in which F+=(STS)+Q,E-=(STS)-,D=QTQ,V=U,VTA transposed matrix that is V; (S)TS)+Representation matrix (S)TS) taking the absolute value of the elements of the matrix and then summing the matrix (S)TS) matrix obtained by adding corresponding elements of (S)TS)-Representation matrix (S)TS) taking absolute value of element and subtracting matrix (S)TS) matrix obtained by corresponding elements;
the classification unit is used for classifying the optimal coefficient matrix of the sample set to be recognized by adopting a trained classifier to complete face recognition;
the decomposition unit is used for determining the value of K in a set range; determining a coefficient matrix and an initial coefficient matrix of the initial base matrix according to the K; performing iterative calculation according to the coefficient matrix of the initial basis matrix, the initial coefficient matrix and the iterative formula; substituting the coefficient matrix and the coefficient matrix of the base matrix iteratively calculated in each step into an objective function:
J(V)=Tr(-2VTF+-VTE-VD);
when the value of the objective function reaches a stable state, ending iterative computation, and taking the coefficient matrix and the coefficient matrix of the base matrix computed by the last iterative computation as the coefficient matrix and the optimal coefficient matrix of the optimal base matrix of the sample set to be identified, wherein the stable state means that the value of the objective function is kept unchanged or the variation amplitude is smaller than a preset amplitude; or when the iteration times reach the iteration time threshold, selecting the coefficient matrix and the coefficient matrix of the base matrix calculated by the last iteration as the coefficient matrix and the optimal coefficient matrix of the optimal base matrix of the sample set to be identified.
5. The apparatus of claim 4, wherein the decomposition unit is further configured to determine a sparsification threshold; after each step of iterative computation, judging the size of each numerical value in the coefficient matrix of the base matrix subjected to iterative computation and the sparsification threshold value; and setting the value of the coefficient matrix of the base matrix calculated by iteration, which is greater than the sparsification threshold value, as 1, and setting the value of the coefficient matrix of the base matrix calculated by iteration, which is less than or equal to the sparsification threshold value, as 0.
6. The apparatus according to claim 4 or 5, characterized in that it further comprises a training unit;
the preprocessing unit is also used for preprocessing the training sample set to obtain a training sample set matrix;
the decomposition unit is further used for processing the training sample set matrix by adopting a new iteration sparse convex-non-negative matrix decomposition method, solving a coefficient matrix and an optimal coefficient matrix of an optimal base matrix of the training sample set, wherein the coefficient matrix and the optimal coefficient matrix of the optimal base matrix are generated by adopting the same iteration formula as that used in the processing of the sample set to be identified;
and the training unit is used for training a classifier by adopting the optimal coefficient matrix of the training sample set.
CN201710631337.6A 2017-07-28 2017-07-28 Face recognition method and device Active CN107341485B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710631337.6A CN107341485B (en) 2017-07-28 2017-07-28 Face recognition method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710631337.6A CN107341485B (en) 2017-07-28 2017-07-28 Face recognition method and device

Publications (2)

Publication Number Publication Date
CN107341485A CN107341485A (en) 2017-11-10
CN107341485B true CN107341485B (en) 2019-12-31

Family

ID=60216586

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710631337.6A Active CN107341485B (en) 2017-07-28 2017-07-28 Face recognition method and device

Country Status (1)

Country Link
CN (1) CN107341485B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109508697B (en) * 2018-12-14 2022-03-08 深圳大学 Face recognition method, system and storage medium based on semi-nonnegative matrix factorization of E auxiliary function

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101719270A (en) * 2009-12-25 2010-06-02 武汉大学 Non-negative matrix factorization-based face super-resolution processing method
CN102831598A (en) * 2012-07-04 2012-12-19 西安电子科技大学 Remote sensing image change detecting method with combination of multi-resolution NMF (non-negative matrix factorization) and Treelet

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
IN2013CH01043A (en) * 2013-03-12 2015-08-14 Yahoo Inc

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101719270A (en) * 2009-12-25 2010-06-02 武汉大学 Non-negative matrix factorization-based face super-resolution processing method
CN102831598A (en) * 2012-07-04 2012-12-19 西安电子科技大学 Remote sensing image change detecting method with combination of multi-resolution NMF (non-negative matrix factorization) and Treelet

Also Published As

Publication number Publication date
CN107341485A (en) 2017-11-10

Similar Documents

Publication Publication Date Title
Gao et al. HEp-2 cell image classification with deep convolutional neural networks
Guo et al. Face recognition based on convolutional neural network and support vector machine
Stuhlsatz et al. Feature extraction with deep neural networks by a generalized discriminant analysis
CN104268593B (en) The face identification method of many rarefaction representations under a kind of Small Sample Size
CN108171318B (en) Convolution neural network integration method based on simulated annealing-Gaussian function
WO2019102005A1 (en) Object recognition using a convolutional neural network trained by principal component analysis and repeated spectral clustering
CN111611909A (en) Multi-subspace-domain self-adaptive face recognition method
CN111126169B (en) Face recognition method and system based on orthogonalization graph regular nonnegative matrix factorization
Zuobin et al. Feature regrouping for cca-based feature fusion and extraction through normalized cut
CN109948662B (en) Face image depth clustering method based on K-means and MMD
Alblushi Face recognition based on artificial neural network: A review
CN107563287B (en) Face recognition method and device
CN107341485B (en) Face recognition method and device
CN109978080B (en) Image identification method based on discrimination matrix variable limited Boltzmann machine
CN113887509B (en) Rapid multi-modal video face recognition method based on image set
Cirstea et al. Improving a deep convolutional neural network architecture for character recognition
Ali et al. A deep convolutional neural wavelet network for classification of medical images
El-Henawy et al. Muzzle Classification Using Neural Networks.
Suzuki et al. Illumination-invariant face identification using edge-based feature vectors in pseudo-2D Hidden Markov Models
Lam et al. Application of convolutional neural networks for fingerprint recognition
Dhamija et al. An approach to enhance performance of age invariant face recognition
Li et al. Face recognition based on wt, fastica and rbf neural network
Nampalle et al. Transcending Grids: Point Clouds and Surface Representations Powering Neurological Processing
Huang et al. Bark classification based on gabor filter features using rbpnn neural network
Zhang et al. Artificial Intelligence Technology in the Operation and Management of Rail Transit System

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
GR01 Patent grant
GR01 Patent grant