A face recognition method based on discriminative competitive collaborative representation
Through the face recognition method based on discriminative competition collaborative representation, the problem of low recognition rate of face images under interference is solved. Through the design and weight setting of discriminative terms and competition terms, the recognition rate and robustness are improved, especially the recognition effect under noisy interference.
Patent Information
- Application Number
- CN202211605044.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-14
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2042-12-14
AI Technical Summary
The existing facial recognition technology has low recognition rate when facing interference such as occlusion, lighting, and pixel destruction. When the apparent characteristics of the same person are very different, it is easy to misclassify. When the apparent characteristics of different people are small, it is easy to misclassify, resulting in low recognition rate.
A face recognition method based on discriminative competition collaborative representation is adopted, and a face recognition term is included, and a weight is added before the representation vector is used. Class information is used to improve the discriminative and competitive ability of each class. Algorithm models are proposed for noiseless and noisy interference, and the model robustness is enhanced by using L1 norm for noise interference.
It improves the recognition rate of face images, enhances the recognition effect of the model under noise interference, and improves the accuracy and robustness of the recognition.
Smart Images

Figure CN116343283B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of face recognition technology, and in particular to a face recognition method based on discriminative competitive collaborative representation. Background Art
[0002] With the rapid development of internet technology, image recognition technology has garnered widespread attention across numerous fields, and some recognition technologies have already been applied in our daily lives. Image recognition is the process by which computers process, analyze, and interpret images to identify various patterns of objects and targets. Image recognition is a crucial technology in the information age, designed to enable computers to process large amounts of physical information on behalf of humans. Simply put, image recognition involves teaching computers how to interpret the content of images like humans. With the advancement of computer technology, our understanding of image recognition technology has become increasingly profound.
[0003] Despite the tremendous success of image recognition to date, we still face many challenges before it can be widely applied. Generally speaking, the difficulties and challenges faced by image recognition technology generally come from three aspects: first, large intra-class disparity, that is, the apparent characteristics of objects belonging to the same class vary greatly (the difference between different instances within the class); second, small inter-class disparity, that is, object instances of different classes have certain similarities (the similarity between different instances between classes); and third, environmental interference. In real-world scenarios, objects are unlikely to appear against a perfectly clean background. On the contrary, the background may be very complex and interfere with the object of interest, making the recognition problem much more difficult.
[0004] Current face recognition still has the following shortcomings: when the face image is disturbed by occlusion, lighting, pixel destruction, etc., the recognition rate will be low; when the facial images show that the appearance features of the same person are quite different, misclassification will occur, resulting in a low recognition rate; when the facial images show that the appearance features of different people are relatively small, misclassification will occur, resulting in a low recognition rate. Summary of the Invention
[0005] The present invention discloses a face recognition method based on discriminative competitive collaborative representation, which aims to solve the technical problems raised in the background technology that when the face image is disturbed by occlusion, lighting, pixel destruction, etc., the recognition rate will be low; when the apparent features of the same person in the face image are relatively different, misclassification and low recognition rate will occur; when the apparent features of different people in the face image are relatively small, misclassification and low recognition rate will occur.
[0006] In order to achieve the above object, the present invention adopts the following technical solutions:
[0007] A face recognition method based on discriminative competitive collaborative representation is proposed. Its design includes discriminative and competitive terms, and weights are added before the representation vector. This fully utilizes class information while improving the discriminative and competitive capabilities of each class, thereby enhancing the recognition rate of facial images. Algorithmic models are proposed for face recognition in the absence of noise interference and in the presence of noise interference. The difference between the two is that for face recognition in the presence of noise interference, the accuracy term is set to the L1 norm, which can enhance the robustness of the model.
[0008] For noise-free interference:
[0009]
[0010] For noise interference:
[0011]
[0012] Where y is the test sample vector (i.e., a face image); X is the training set matrix, which contains all face images of C people (i.e., a total of C classes); X i is all the face images of the i-th person (i.e., all the face images of the i-th category); α is the representation vector; α i is the representation vector of the i-th category; γ, μ, β, and λ are all constants greater than 0 used to balance each term; w i is the weight used to constrain the representation vector of the i-th class.
[0013] In a preferred solution, for the algorithm models under the two different conditions, the second term is minimized This is equivalent to making the reconstruction vector constructed by each class as close as possible to the test sample, which improves the competitiveness of each class; minimizing the third term It is equivalent to minimizing the error between the vector reconstructed by all classes and the vector reconstructed by each class, so that the vector reconstructed by all classes can be as close as possible to the vector reconstructed by each class, thereby improving the competitiveness of each class; minimizing the fourth item This is equivalent to reducing the correlation between the reconstructed vectors of class i and class j. By reducing the correlation between different classes, the distinction between them is improved, which means that the discriminative ability of each class is improved. By minimizing the sum of the above items, the competitiveness and discriminative ability of each class can be improved, thereby improving the face image recognition rate.
[0014] In a preferred solution, for the model with noise interference, the L1 norm is used in the accuracy term, which is a non-smooth convex problem. Therefore, the present invention uses the reweighted least squares method to transform the non-smooth convex problem into a smooth convex problem for solution, and it is necessary to introduce a reweighted matrix A; the calculation method of the reweighted matrix A is:
[0015]
[0016] In a preferred solution, the face image recognition without noise interference specifically includes the following implementation steps:
[0017] Step 1: Obtain a face dataset, such as GT or ORL face dataset;
[0018] Step 2: Dataset partitioning: Divide the dataset into a training set and a test set. The training set is used to train the data so that the generated classification model can fit the test sample well, that is, any face image. The test set is used to test the data, thereby reflecting the performance of the classification model, thereby improving the model and increasing the accuracy.
[0019] Step 3: Perform feature preprocessing on the divided training set and test set, such as feature normalization and standardization;
[0020] Step 4: Perform feature extraction on the training set and test set at this time, using the spatial pyramid feature extraction method;
[0021] Step 5: training the classifier and identifying the test samples. Step 5 specifically includes the following process:
[0022] S51: Input training set X, test sample y, γ, μ, β, λ;
[0023] S52: Calculate the weight matrix W: There are two methods for calculating the weight matrix;
[0024] S53: Calculate the representation vector α. The calculation formula is:
[0025]
[0026] S54: After obtaining the above α, calculate the test sample y and the reconstructed sample X of each class i α i The error r i , and then get C errors, take the minimum value of these C errors, the class to which this minimum value belongs is the class of the test sample predicted by the classifier. The calculation method of the weight matrix specifically includes the following two methods:
[0027] 1) Distance-based weight calculation method:
[0028] Input X, y; loop the total number of classes C times, and in each loop calculate the distance s of each sample x from the test sample y of each class, and the weight w of each class i It is the distance sum s of the class divided by the number of samples n of the class i , in order to facilitate the calculation of the representation vector α, here W is set to: W = diag (W1, W2, ..., W C ), where W i The settings are as follows:
[0029]
[0030] 2) Representation-based weight calculation method:
[0031] Input X, y; loop the total number of classes C times, and calculate the representation vector α of each class in each loop i , the calculation method is: And calculate the reconstruction vector X of this representation vector i α i The error r from y i , and the error r calculated in each cycle i Accumulate and assign to variable s. After the loop ends, let w i =r i / s, so that the weight of each class can be obtained. In order to facilitate the calculation of the representation vector α later, W is set to: W = diag (W1, W2, ..., W C ), where W i The settings are as follows:
[0032]
[0033] In a preferred solution, for the facial image recognition under noise interference, the detailed steps are as follows:
[0034] Step 1: Obtain face dataset;
[0035] Step 2: Dataset division: Divide the dataset into a training set and a test set. The training set is used to train the data so that the generated classification model can fit the test sample well, that is, any face image. The test set is used to test the data, which reflects the performance of the classification model, thereby improving the model and increasing the accuracy.
[0036] Step 3: Perform feature preprocessing on the divided training set and test set;
[0037] Step 4: Extract features from the training set and test set using a spatial pyramid feature extraction method.
[0038] Step 5: Training the classifier and identifying test samples. Step 5 specifically includes the following process:
[0039] S1: Input training set X, test sample y, γ, μ, β, λ;
[0040] S2: Calculate the weight matrix W;
[0041] S3: Initialize the representation vector α 0 :
[0042]
[0043] S4: Initialize the number of iterations t = 0;
[0044] S5: Initialize the reweight matrix A 0 :
[0045]
[0046] S6: The reweighting matrix is continuously updated in a loop, and the representation vector is updated afterwards, until the number of iterations t is less than a fixed threshold. The update rule of the reweighting matrix is:
[0047]
[0048] Represents vector α t The update rule is:
[0049]
[0050] Among them, X(1,:) represents the first row vector of matrix X, y i Represents the i-th element of the test sample y, A t represents the reweighting matrix at the tth iteration, α t-1 represents the representation vector at the t-1th iteration;
[0051] S7: After stopping the iteration in step 6, the algorithm will obtain the final representation vector α;
[0052] S8: After obtaining the above α, calculate the test sample y and the reconstructed sample X of each class i α i The error r i , and then get C errors, take the minimum value of these C errors, the class to which this minimum value belongs is the class of the test sample predicted by the classifier. The calculation method of the weight matrix includes the following two methods:
[0053] A: Distance-based weight calculation method:
[0054] Input X, y; loop the total number of classes C times, and in each loop calculate the distance s of each sample x from the test sample y of each class, and the weight w of each class i It is the distance sum s of the class divided by the number of samples n of the class i , in order to facilitate the calculation of the representation vector α, here W is set to: W = diag (W1, W2, ..., W C ), where W i The settings are as follows:
[0055]
[0056] B: Representation-based weight calculation method:
[0057] Input X, y; loop the total number of classes C times, and calculate the representation vector α of each class in each loop i , the calculation method is: And calculate the reconstruction vector X of this representation vector i α i The error r from y i , and the error r calculated in each cycle i Accumulate and assign to variable s. After the loop ends, let w i =r i / s, so that the weight of each class can be obtained. In order to facilitate the calculation of the representation vector α later, W is set to: W = diag (W1, W2, ..., W C ), where W i The settings are as follows:
[0058]
[0059] From the above, it can be seen that a face recognition method based on discriminant competitive collaborative representation includes a discriminant term and a competitive term, and a weight setting is added before the representation vector, which makes full use of the class information and improves the discriminant ability and competitive ability of each class. Algorithm models are proposed for face recognition without noise interference and face recognition with noise interference respectively. The difference between the two is that for face recognition with noise interference, the precision term is set to the L1 norm, which can enhance the robustness of the model. The present invention proposes an algorithm that includes a discriminant term, a competitive term, a weight constraint and a collaborative representation to increase the recognition rate of face images. And by using the L1 norm for the precision term, the recognition effect of face images containing noise is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] Figure 1 This is a flowchart of the overall steps of a face recognition method based on discriminative competitive collaborative representation proposed by the present invention.
[0061] Figure 2This is a flowchart of a face recognition method based on discriminative competitive collaborative representation in the absence of noise interference proposed by the present invention.
[0062] Figure 3 This is a flowchart of a face recognition method based on discriminative competitive collaborative representation in the presence of noise interference proposed by the present invention. DETAILED DESCRIPTION
[0063] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments.
[0064] A face recognition method based on discriminative competitive collaborative representation is proposed. Its design includes discriminative and competitive terms, with weights added to the representation vector. This method fully utilizes class information while improving both the discriminative and competitive capabilities of each class. Algorithmic models are proposed for face recognition in the absence of noise interference and in the presence of noise interference. The difference between the two is that for face recognition in the presence of noise interference, the accuracy term is set to the L1 norm, which can enhance the robustness of the model.
[0065] For noise-free interference:
[0066]
[0067] For noise interference:
[0068]
[0069] Where y is the test sample vector (i.e., a face image); X is the training set matrix, which contains all face images of C people (i.e., a total of C classes); X i is all the face images of the i-th person (i.e., all the face images of the i-th category); α is the representation vector; α i is the representation vector of the i-th category; γ, μ, β, and λ are all constants greater than 0 used to balance each term; w i is the weight used to constrain the representation vector of the i-th class.
[0070] In a preferred solution, for the algorithm models under the two different conditions, the second term is minimized This is equivalent to making the reconstruction vector constructed by each class as close as possible to the test sample, which improves the competitiveness of each class; minimizing the third term It is equivalent to minimizing the error between the vector reconstructed by all classes and the vector reconstructed by each class, so that the vector reconstructed by all classes can be as close as possible to the vector reconstructed by each class, thereby improving the competitiveness of each class; minimizing the fourth item This is equivalent to reducing the correlation between the reconstructed vectors of class i and class j. By reducing the correlation between different classes, the distinction between them is improved, which means that the discriminative ability of each class is improved. By minimizing the sum of the above items, the competitiveness and discriminative ability of each class can be improved, thereby improving the face image recognition rate.
[0071] In a preferred embodiment, for the model with noise interference, the L1 norm is used in the accuracy term, which is a non-smooth convex problem. Therefore, the present invention uses the reweighted least squares method to transform the non-smooth convex problem into a smooth convex problem for solution, and it is necessary to introduce a reweighted matrix A; the calculation method of the reweighted matrix A is:
[0072]
[0073] In a preferred embodiment, the face image recognition without noise interference specifically includes the following implementation steps:
[0074] Step 1: Obtain a face dataset, such as GT or ORL face dataset;
[0075] Step 2: Dataset Partitioning. The dataset is divided into a training set and a test set. The training set is used to train the data so that the generated classification model can fit the test sample well, that is, any face image. The test set is used to test the data, which in turn reflects the performance of the classification model, thereby improving the model and increasing the accuracy.
[0076] Step 3: Perform feature preprocessing on the divided training set and test set, such as feature normalization and standardization;
[0077] Step 4: Perform feature extraction on the training set and test set at this time, using the spatial pyramid feature extraction method;
[0078] Step 5: Train the classifier and identify test samples.
[0079] In a preferred embodiment, step 5 specifically includes the following process:
[0080] S51: Input training set X, test sample y, γ, μ, β, λ;
[0081] S52: Calculate the weight matrix W: There are two methods for calculating the weight matrix;
[0082] S53: Calculate the representation vector α. The calculation formula is:
[0083]
[0084] S54: After obtaining the above α, calculate the test sample y and the reconstructed sample X of each class i α i The error r i , and then get C errors, take the minimum value of these C errors, and the class to which this minimum value belongs is the category of the test sample predicted by the classifier.
[0085] In a preferred embodiment, for the facial image recognition under noise interference, the detailed steps are as follows:
[0086] Step 1: Obtain face dataset;
[0087] Step 2: Dataset division. The dataset is divided into a training set and a test set. The training set is used to train the data so that the generated classification model can fit the test sample well, that is, any face image. The test set is used to test the data, which reflects the performance of the classification model, thereby improving the model and increasing the accuracy.
[0088] Step 3: Perform feature preprocessing on the divided training set and test set;
[0089] Step 4: Extract features from the training set and test set using a spatial pyramid feature extraction method.
[0090] Step 5: Train the classifier and identify test samples.
[0091] In a preferred embodiment, the step 5 specifically includes the following process:
[0092] S1: Input training set X, test sample y, γ, μ, β, λ;
[0093] S2: Calculate the weight matrix W;
[0094] S3: Initialize the representation vector α 0 :
[0095]
[0096] S4: Initialize the number of iterations t = 0;
[0097] S5: Initialize the reweight matrix A 0 :
[0098]
[0099] S6: The reweighting matrix is continuously updated in a loop, and the representation vector is updated afterwards, until the number of iterations t is less than a fixed threshold. The update rule of the reweighting matrix is:
[0100]
[0101] Represents vector α t The update rule is:
[0102]
[0103] Among them, X(1,:) represents the first row vector of matrix X, y i Represents the i-th element of the test sample y, A t represents the reweighting matrix at the tth iteration, α t-1 represents the representation vector at the t-1th iteration;
[0104] S7: After stopping the iteration in step 6, the algorithm will obtain the final representation vector α;
[0105] S8: After obtaining the above α, calculate the test sample y and the reconstructed sample X of each class i α i The error r i , and then get C errors, take the minimum value of these C errors, and the class to which this minimum value belongs is the category of the test sample predicted by the classifier.
[0106] In a preferred embodiment, the calculation method of the weight matrix specifically includes the following two methods:
[0107] 1) Distance-based weight calculation method:
[0108] Input X, y; loop the total number of classes C times, and in each loop calculate the distance s of each sample x from the test sample y of each class, and the weight w of each class i It is the distance sum s of the class divided by the number of samples n of the class i , in order to facilitate the calculation of the representation vector α, here W is set to: W = diag (W1, W2, ..., W C ), where W i The settings are as follows:
[0109]
[0110] 2) Representation-based weight calculation method:
[0111] Input X, y; loop the total number of classes C times, and calculate the representation vector α of each class in each loop i , the calculation method is: And calculate the reconstruction vector X of this representation vector i α i The error r from y i , and the error r calculated in each cycle i Accumulate and assign to variable s. After the loop ends, let wi =r i / s, so that the weight of each class can be obtained. In order to facilitate the calculation of the representation vector α later, W is set to: W = diag (W1, W2, ..., W C ), where W i The settings are as follows:
[0112]
[0113] The above description is only a preferred specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any technician familiar with the technical field, within the technical scope disclosed by the present invention, who makes equivalent replacements or changes based on the technical solution and inventive concept of the present invention, should be covered by the scope of protection of the present invention.
Claims
1. A face recognition method based on discriminative competitive collaborative representation, characterized in that: Algorithm models are proposed for face recognition without noise interference and face recognition with noise interference. For face recognition with noise interference, the accuracy term is set to L1 norm; For noise-free interference: For noise interference: Where y is the test sample vector, i.e. a face image; X is the training set matrix, which contains all face images of C people, i.e. a total of C classes; X i is all the face images of the i-th person, that is, all the face images of the i-th category; α is the representation vector; α i is the representation vector of the i-th category; γ, μ, β, and λ are all constants greater than 0 used to balance each term; ω i is the weight used to constrain the representation vector of the i-th class; The face image recognition without noise interference specifically includes the following implementation steps: Step 1: Obtain face dataset; Step 2: Dataset partitioning: Divide the dataset into a training set and a test set. The training set is used to train the data so that the generated classification model can fit the test sample well, that is, any face image. The test set is used to test the data, thereby reflecting the performance of the classification model. Step 3: Perform feature preprocessing on the divided training set and test set; Step 4: Perform feature extraction on the training set and test set at this time, using the spatial pyramid feature extraction method; Step 5: Train the classifier and identify test samples; The step 5 specifically includes the following process: S51: Input training set X, test sample y, γ, μ, β, λ; S52: Calculate the weight matrix W: There are two methods for calculating the weight matrix; S53: Calculate the representation vector α. The calculation formula is: S54: After obtaining the above α, calculate the test sample y and the reconstructed sample X of each class i α i The error r i , and then get C errors, take the minimum value of these C errors, and the class to which this minimum value belongs is the category of the test sample predicted by the classifier.
2. The face recognition method based on discriminative competitive collaborative representation according to claim 1, characterized in that: The calculation method of the weight matrix specifically includes the following two methods: 1) Distance-based weight calculation method: Input X, y; loop the total number of classes C times, and in each loop calculate the distance s of each sample x from the test sample y of each class, and the weight w of each class i It is the distance sum s of the class divided by the number of samples n of the class i , in order to facilitate the calculation of the representation vector α, here W is set to: W=diag(W1,W2,…,W C ), where W i The settings are as follows: 2) Representation-based weight calculation method: Input X, y; loop the total number of classes C times, and calculate the representation vector α of each class in each loop i , the calculation method is: And calculate the reconstruction vector X of this representation vector i α i The error r from y i , and the error r calculated in each cycle i Accumulate and assign to variable s. After the loop ends, let w i =r i / s, thereby obtaining the weight of each class. In order to facilitate the calculation of the representation vector α later, W is set to: W=diag(W1,W2,…,W C ), where W i The settings are as follows:
3. The face recognition method based on discriminative competitive collaborative representation according to claim 2, characterized in that: For the face image recognition under noise interference, step 5 specifically includes the following process: S1: Input training set X, test sample y, γ, β, μ, λ; S2: Calculate the weight matrix W; S3: Initialize the representation vector α 0 : S4: Initialize the number of iterations t = 0; S5: Initialize the reweight matrix A 0 : S6: The reweighting matrix is continuously updated in a loop, and the representation vector is updated afterwards, until the number of iterations t is less than a fixed threshold. The update rule of the reweighting matrix is: Represents vector α t The update rule is: Among them, X(1,:) represents the first row vector of matrix X, y i Represents the i-th element of the test sample y, A t represents the reweighting matrix at the tth iteration, α t-1 represents the representation vector at the t-1th iteration; S7: After stopping the iteration in step 6, the algorithm will obtain the final representation vector α; S8: After obtaining the above α, calculate the test sample y and the reconstructed sample X of each class i α i The error r i , and then get C errors, take the minimum value of these C errors, and the class to which this minimum value belongs is the category of the test sample predicted by the classifier.
4. The face recognition method based on discriminative competitive collaborative representation according to claim 3, characterized in that: The calculation method of the weight matrix includes the following two methods: A: Distance-based weight calculation method: Input X, y; loop the total number of classes C times, and in each loop calculate the distance s of each sample x from the test sample y of each class, and the weight w of each class i It is the distance sum s of the class divided by the number of samples n of the class i , in order to facilitate the calculation of the representation vector α, here W is set to: W=diag(W1,W2,…,W C ), where W i The settings are as follows: B: Representation-based weight calculation method: Input X, y; loop the total number of classes C times, and calculate the representation vector α of each class in each loop i , the calculation method is: And calculate the reconstruction vector X of this representation vector i α i The error r from y i , and the error r calculated in each cycle i Accumulate and assign to variable s. After the loop ends, let w i =r i / s, thereby obtaining the weight of each class. In order to facilitate the calculation of the representation vector α later, W is set to: W=diag(W1,W2,…,W C ), where W i The settings are as follows: