A face recognition method based on sparse coding and dictionary learning

Through sparse coding and dictionary learning technology, combined with multimodal feature fusion and dynamic parameter adjustment, the problem of insufficient computational complexity and recognition accuracy of high-dimensional data processing in the existing technology is solved, and efficient and accurate people are achieved in complex environments Face recognition.

CN118675212BActive Publication Date: 2024-11-22SHANGHAI JIANGXIN INTERACTIVE ENTERTAINMENT NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411140727.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-20
Publication Date
2024-11-22
Estimated Expiration
2044-08-20

AI Technical Summary

Technical Problem

The existing face recognition technology is complex in computing and is susceptible to noise when processing high-dimensional images, has low recognition accuracy, and a fixed dictionary cannot adapt to the diversity and complexity of face images. Adaptive dictionary learning has limitations and sparse representations The calculation overhead is large and it is difficult to meet real-time applications, especially in complex environments to identify the accuracy rate.

Method used

Using a face recognition method based on sparse encoding and dictionary learning, the dictionary is constructed and optimized through image enhancement and normalization processing, sparse feature vectors are generated, multimodal features are fused, and the recognition performance is optimized using support vector machines and parallel computing. Dynamically adjust the identification parameters to adapt to environmental changes.

Benefits of technology

It realizes efficient feature extraction, adaptive dictionary construction, handles image deformation and occlusion, and quickly sparse representation solution, improves recognition accuracy and calculation efficiency, meets real-time application needs, and especially shows high recognition accuracy and Adaptability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118675212B_ABST
    Figure CN118675212B_ABST
Patent Text Reader

Abstract

The invention discloses a face recognition method based on sparse coding and dictionary learning, comprising the following steps: S1, obtaining a color face image from a camera and an image library, converting it into a grayscale image, and performing enhancement, normalization processing and three-dimensional alignment; S2, collecting labeled training data from a public face image database, initializing a dictionary through hierarchical clustering, and optimizing the dictionary by adopting a multi-level dictionary learning mechanism; S3, using the learned dictionary, representing the grayscale face image as a sparse linear combination, using an orthogonal matching pursuit algorithm to generate a sparse feature vector, and fusing it with infrared and visible light image features; S4, training a support vector machine classifier using the multimodal feature vector and training data, and improving real-time performance by optimizing kernel functions and parallel computing; S5, performing sparse coding and classification on a new image, and outputting a recognition result; S6, constructing an autonomous correction mechanism to dynamically adjust preprocessing, sparse coding and classification parameters.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of biometric identification technology, and in particular to a face recognition method based on sparse coding and dictionary learning. Background Art

[0002] As an important part of biometric technology, face recognition technology is widely used in many fields such as security monitoring, identity authentication, public safety and financial payment. With the development of information technology and artificial intelligence, traditional face recognition methods mainly rely on high-dimensional image data for feature extraction and matching. However, since face images usually contain a lot of redundant information and noise, directly using these high-dimensional data for recognition will result in high computational complexity and be easily affected by noise, thereby reducing recognition accuracy. In order to solve these problems, sparse coding and dictionary learning techniques have been introduced into the field of face recognition.

[0003] Most existing face recognition technologies rely on directly processing high-dimensional face image data, which is not only computationally complex but also easily affected by noise and redundant information, resulting in reduced recognition accuracy. Although some methods try to reduce data dimensions through dimensionality reduction techniques, these methods often fail to retain key information and remove redundant information.

[0004] Traditional dictionary learning methods usually use a pre-set fixed dictionary to represent face images. However, fixed dictionaries cannot adapt to the diversity and complexity of different face images, resulting in insufficient representation capabilities and affecting recognition performance. Although adaptive dictionary learning technology has proposed a solution, it still has certain limitations in dealing with diversity and complexity.

[0005] In practical applications, face images are often affected by factors such as expression changes, posture changes, and occlusion. Existing methods perform poorly in dealing with these deformation and occlusion problems, resulting in reduced recognition performance. Although some methods try to deal with these problems through robustness enhancement techniques, the results are still not ideal.

[0006] Solving sparse representations usually involves complex optimization problems, which are computationally expensive and not suitable for real-time applications. Although some methods have proposed efficient sparse coding algorithms, such as OMP (Orthogonal Matching Pursuit) and Lasso (Least Absolute Shrinkage and Selection Operator), the computational speed still needs to be optimized while ensuring sparsity and minimizing reconstruction errors.

[0007] In complex environments, the recognition accuracy of existing face recognition methods is easily affected by factors such as lighting changes and noise interference. Although some methods try to combine multiple feature extraction techniques and powerful classifiers to improve recognition accuracy, their performance in complex environments still needs to be improved.

[0008] Therefore, how to provide a face recognition method based on sparse coding and dictionary learning is a problem that those skilled in the art need to solve urgently. Summary of the invention

[0009] One object of the present invention is to propose a face recognition method based on sparse coding and dictionary learning. The present invention makes full use of sparse coding, dictionary learning and multimodal feature fusion technology, and describes in detail an efficient and robust algorithm for realizing face recognition. The method includes acquiring images from a camera and an image library, performing image enhancement and normalization processing, building and optimizing dictionaries, generating sparse feature vectors, fusing multimodal features, training classifiers, and dynamically adjusting recognition parameters. It has the advantages of high recognition accuracy, high computational efficiency, adaptability to complex environments, and strong real-time performance.

[0010] A face recognition method based on sparse coding and dictionary learning according to an embodiment of the present invention comprises the following steps:

[0011] S1, obtain color face images from real-time cameras and local image libraries, convert color face images into grayscale face images, use image enhancement technology to perform enhancement processing, normalize the grayscale face images, align them based on a three-dimensional face model, and handle facial posture changes;

[0012] S2. Collect the initial training data with labels from the public face image database, initialize the dictionary through the hierarchical clustering method, divide the training data into several clusters, and use each cluster center as the initial element of the dictionary. Use a multi-level dictionary learning mechanism to continuously optimize the dictionary through alternating iterations of sparse coding and dictionary update.

[0013] S3, using the learned dictionary, the grayscale face image to be recognized is represented as a sparse linear combination of dictionary atoms, the orthogonal matching pursuit sparse coding algorithm is used to solve the sparse representation, and the sparse coefficient vector obtained by sparse coding is used as a sparse feature vector, and the sparse feature vector of the grayscale face image is fused with the features of the infrared image and the visible light image to generate a multimodal feature vector;

[0014] S4, using multimodal feature vectors and initial training data to train the classifier, using support vector machine, designing a new kernel function through kernel function optimization, and using parallel computing to optimize real-time performance;

[0015] S5, sparsely encode the new grayscale face image to be recognized, extract the feature vector, classify it using the trained classifier and output the recognition result;

[0016] S6. During the entire recognition process, an autonomous correction mechanism is built to dynamically adjust preprocessing, sparse coding, and classification parameters based on real-time recognition results and environmental changes.

[0017] Optionally, the S1 includes the following steps:

[0018] S11, obtaining color face images from the real-time camera and the local image library;

[0019] S12, converting the color face image into a grayscale face image:

[0020] ;

[0021] in, Respectively represent the red, green, and blue channel pixel values ​​of the color image. Represents the pixel value of a grayscale image;

[0022] S13. Use image enhancement technology to enhance the grayscale face image, and use histogram equalization technology to calculate the cumulative distribution function of each pixel:

[0023] ;

[0024] in, Indicates the gray level is The number of pixels, Indicates the total number of pixels in the image;

[0025] Use contrast-limited adaptive histogram equalization technology to set contrast-limited thresholds and perform local contrast enhancement;

[0026] S14, normalize the grayscale face image and normalize the pixel value of the grayscale image to \left [ {0,1} \right ] scope;

[0027] S15. Align based on the 3D face model, process facial posture changes, use a multi-task cascade convolutional neural network to detect facial key points, and determine the key point positions of the eyes, nose and mouth; align the detected key points with the standard 3D model through the 3D face model alignment algorithm, and use the affine transformation matrix for alignment.

[0028] Optionally, S2 includes the following steps:

[0029] S21, collect labeled initial training data from a public face image database;

[0030] S22, initializing the dictionary by hierarchical clustering method, dividing the training data into several clusters, and each cluster center is used as the initial element of the dictionary;

[0031] S23, introduce a multi-level dictionary learning mechanism, divide the dictionary learning process into multiple levels, and optimize the dictionary layer by layer:

[0032] S24. In the process of updating the dictionary, the non-negative matrix decomposition algorithm is combined to perform non-negative matrix decomposition on the initial dictionary to obtain the base matrix and the coefficient matrix. In each iteration, the non-negative constraint condition is maintained to update the base matrix and the coefficient matrix:

[0033] ;

[0034] ;

[0035] in, and Respectively represent The dictionary matrix and sparse coefficient matrix of the iteration, is the learning rate, Represents the logarithm of each element of the dictionary matrix;

[0036] S25. Through alternating iterations of sparse coding and dictionary updating, the dictionary is continuously adjusted until the dictionary and sparse representation converge to generate the final learned dictionary.

[0037] Optionally, the S23 includes the following steps:

[0038] S231, performing hierarchical clustering on the initial training data to divide it into several subsets, each subset represents a level, and using the cluster center as the initial element of the dictionary;

[0039] S232, at the first level, using a sparse coding algorithm to encode each training sample, represented as a linear combination of dictionaries, and optimizing a sparse coefficient vector;

[0040] S233. Update the dictionary at each level, iterate alternately between sparse coding and dictionary updating, and optimize the dictionary matrix:

[0041] ;

[0042] in, Indicates The dictionary matrix of the layer, is the learning rate, express norm;

[0043] S234, introduce a multi-level dictionary learning mechanism, divide the dictionary learning process into multiple levels, optimize the dictionary layer by layer, and at each level, use the output of the previous level as the input of the current level to continue sparse coding and dictionary update;

[0044] S235, introduce an adaptive sparsity adjustment mechanism at each level, dynamically adjust the sparsity control parameters according to the feature complexity and reconstruction error of the current level :

[0045] ;

[0046] in, is the learning rate adjusted for sparsity, is the regularization parameter for sparsity adjustment, and They represent the partial derivatives of reconstruction error and sparsity with respect to the sparsity control parameter respectively;

[0047] S236. Adopt a gradient-based adaptive dictionary update strategy at each level, and dynamically adjust the dictionary update step size and direction by monitoring the reconstruction error of each iteration:

[0048] ;

[0049] in, is the dynamic step size of dictionary update, Regularization parameter updated for the dictionary;

[0050] S237. Through multi-level dictionary learning and optimization, features are extracted at different granularities, the expression and discrimination capabilities of the dictionary are gradually improved, and finally a learned dictionary is generated.

[0051] Optionally, S3 includes the following steps:

[0052] S31, using the learned dictionary, representing the grayscale face image to be recognized as a sparse linear combination of dictionary atoms;

[0053] S32, using orthogonal matching pursuit sparse coding algorithm to quickly solve sparse representation:

[0054] ;

[0055] in, express norm, represents the zero norm, is the sparsity control parameter;

[0056] S33, using the sparse coefficient vector obtained by sparse coding as a sparse feature vector;

[0057] S34, the sparse feature vector of the grayscale face image is fused with the features of the infrared image and the visible light image to generate a multimodal feature vector:

[0058] ;

[0059] in, represents the multimodal feature vector, represents the sparse feature vector of the grayscale face image, represents the feature vector of the infrared image, A feature vector representing a visible light image.

[0060] Optionally, S4 includes the following steps:

[0061] S41, combining the multimodal feature vector with the label in the initial training data, wherein the label is the identity or category information of each face image;

[0062] S42. Design a new kernel function through kernel function optimization:

[0063] ;

[0064] The optimized kernel function formula is:

[0065] ;

[0066] in, represents the original kernel function, and are the vectors after feature mapping, is the kernel function parameter, represents the optimized kernel function;

[0067] S43, use support vector machine to train the classifier, using the optimized kernel function:

[0068] ;

[0069] ;

[0070] Among them, w is the weight vector, b is the bias, is the slack variable, c is the penalty parameter, For labels, is the optimized kernel function;

[0071] S44. Divide the training data and multimodal feature vectors into multiple subsets, perform support vector machine training and prediction in parallel on a multi-core processor, and use parallel computing to perform kernel function calculation and model parameter update.

[0072] Optionally, the S6 comprises the following steps:

[0073] S61. Monitoring recognition performance based on real-time recognition results:

[0074] ;

[0075] ;

[0076] Among them, TP is the true positive class, TN is the true negative class, FP is the false positive class, and FN is the false negative class;

[0077] S62, dynamically adjust the preprocessing parameters according to the recognition performance, and dynamically adjust the weight coefficient of the grayscale conversion formula

[0078] ;

[0079] in, is the weight coefficient;

[0080] Adjust according to ambient lighting conditions:

[0081] ;

[0082] in, is the adjustment amount based on the current lighting conditions, obtained through the real-time lighting detection algorithm;

[0083] S63, dynamically adjust the sparse coding parameters according to the recognition performance, and adjust the sparsity control parameter T to optimize the sparse representation:

[0084] ;

[0085] in, is the initial sparsity control parameter, is the adjustment amount based on the current recognition performance:

[0086] ;

[0087] Where k is the adjustment coefficient, It is the partial derivative of recognition accuracy with respect to the sparsity control parameter;

[0088] S64, dynamically adjust the classification parameters according to the recognition performance, adjust the penalty parameter c and the kernel function parameter Optimizing classification performance:

[0089] ;

[0090] ;

[0091] in, and is the initial parameter, and is the adjustment amount based on the current recognition performance;

[0092] ;

[0093] ;

[0094] in, and is the adjustment factor, and It is the partial derivative of the recognition accuracy with respect to the penalty parameter and the kernel function parameter;

[0095] S65, adjusting the preprocessing steps in real time based on environmental changes, and dynamically adjusting the threshold of contrast-limited adaptive histogram equalization under different lighting conditions:

[0096] ;

[0097] in, is the initial threshold, is the adjustment amount based on current lighting conditions:

[0098] ;

[0099] in, is the adjustment factor, The image contrast Partial derivative of the threshold.

[0100] The beneficial effects of the present invention are:

[0101] The present invention proposes a face recognition method based on sparse coding and dictionary learning, which combines sparse coding, dictionary learning and multimodal feature fusion technology and has the following beneficial effects:

[0102] (1) Efficient feature extraction: Through sparse coding technology, high-dimensional facial image data is converted into low-dimensional and sparse feature vectors. These feature vectors can effectively retain the key information of the face, reduce redundancy, and improve recognition efficiency and accuracy.

[0103] (2) Adaptive dictionary construction: A multi-level dictionary learning mechanism is used to adaptively construct a dictionary from the training data, so that the atoms in the dictionary can better represent the face image. Through iterative optimization, the dictionary is gradually adjusted to best adapt to the characteristics of the training data, improving the representation ability and recognition performance.

[0104] (3) Processing image deformation and occlusion: Sparse coding and dictionary learning methods are highly robust and can maintain high recognition accuracy in the case of image deformation and occlusion. Sparse representation can better capture the local features of the image and resist the effects of deformation and occlusion.

[0105] (4) Fast sparse representation solution: Using efficient sparse coding algorithms, such as orthogonal matching pursuit (OMP) and Lasso, through iteration and greedy strategies, the sparse representation is quickly solved. While ensuring sparsity and minimizing reconstruction errors, the calculation speed is accelerated to meet the needs of real-time applications.

[0106] (5) Improve recognition accuracy: By integrating multiple feature extraction methods (such as HOG, LBP) and sparse coding, a more robust feature representation is constructed. Combined with powerful classifiers (such as support vector machines (SVMs), and through kernel function optimization and parallel computing, high recognition accuracy can be maintained in complex environments.

[0107] (6) Autonomous correction mechanism: During the entire recognition process, an autonomous correction mechanism is constructed to dynamically adjust the preprocessing, sparse coding, and classification parameters based on real-time recognition results and environmental changes to further improve the recognition accuracy and adaptability. BRIEF DESCRIPTION OF THE DRAWINGS

[0108] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:

[0109] Figure 1 A flow chart of a face recognition method based on sparse coding and dictionary learning proposed by the present invention;

[0110] Figure 2 Schematic diagram of adaptive dictionary construction and multi-level dictionary learning mechanism;

[0111] Figure 3 Schematic diagram of the steps for processing image deformation and occlusion and fast sparse representation solution; DETAILED DESCRIPTION

[0112] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, which only illustrate the basic structure of the present invention in a schematic manner, and therefore only show the components related to the present invention.

[0113] refer to Figure 1-3 , a face recognition method based on sparse coding and dictionary learning, comprising the following steps:

[0114] S1, obtain color face images from real-time cameras and local image libraries, convert color face images into grayscale face images, use image enhancement technology to perform enhancement processing, normalize the grayscale face images, align them based on a three-dimensional face model, and handle facial posture changes;

[0115] S2. Collect the initial training data with labels from the public face image database, initialize the dictionary through the hierarchical clustering method, divide the training data into several clusters, and use each cluster center as the initial element of the dictionary. Use a multi-level dictionary learning mechanism to continuously optimize the dictionary through alternating iterations of sparse coding and dictionary update.

[0116] S3, using the learned dictionary, the grayscale face image to be recognized is represented as a sparse linear combination of dictionary atoms, the orthogonal matching pursuit sparse coding algorithm is used to solve the sparse representation, and the sparse coefficient vector obtained by sparse coding is used as a sparse feature vector, and the sparse feature vector of the grayscale face image is fused with the features of the infrared image and the visible light image to generate a multimodal feature vector;

[0117] S4, using multimodal feature vectors and initial training data to train the classifier, using support vector machine, designing a new kernel function through kernel function optimization, and using parallel computing to optimize real-time performance;

[0118] S5, sparsely encode the new grayscale face image to be recognized, extract the feature vector, classify it using the trained classifier and output the recognition result;

[0119] S6. During the entire recognition process, an autonomous correction mechanism is built to dynamically adjust preprocessing, sparse coding, and classification parameters based on real-time recognition results and environmental changes.

[0120] In this implementation, S1 includes the following steps:

[0121] S11, obtaining color face images from the real-time camera and the local image library;

[0122] S12, converting the color face image into a grayscale face image:

[0123] ;

[0124] in, Respectively represent the red, green, and blue channel pixel values ​​of the color image. Represents the pixel value of a grayscale image;

[0125] S13. Use image enhancement technology to enhance the grayscale face image, and use histogram equalization technology to calculate the cumulative distribution function of each pixel:

[0126] ;

[0127] in, Indicates the gray level is The number of pixels, Indicates the total number of pixels in the image;

[0128] Use contrast-limited adaptive histogram equalization technology to set contrast-limited thresholds and perform local contrast enhancement;

[0129] S14, normalize the grayscale face image and normalize the pixel value of the grayscale image to \left [ {0,1} \right ] scope;

[0130] S15. Align based on the 3D face model, process facial posture changes, use a multi-task cascade convolutional neural network to detect facial key points, and determine the key point positions of the eyes, nose and mouth; align the detected key points with the standard 3D model through the 3D face model alignment algorithm, and use the affine transformation matrix for alignment.

[0131] In this implementation, S2 includes the following steps:

[0132] S21, collect labeled initial training data from a public face image database;

[0133] S22, initializing the dictionary by hierarchical clustering method, dividing the training data into several clusters, and each cluster center is used as the initial element of the dictionary;

[0134] S23, introduce a multi-level dictionary learning mechanism, divide the dictionary learning process into multiple levels, and optimize the dictionary layer by layer:

[0135] S24. In the process of updating the dictionary, the non-negative matrix decomposition algorithm is combined to perform non-negative matrix decomposition on the initial dictionary to obtain the base matrix and the coefficient matrix. In each iteration, the non-negative constraint condition is maintained to update the base matrix and the coefficient matrix:

[0136] ;

[0137] ;

[0138] in, and Respectively represent The dictionary matrix and sparse coefficient matrix of the iteration, is the learning rate, Represents the logarithm of each element of the dictionary matrix;

[0139] S25. Through alternating iterations of sparse coding and dictionary updating, the dictionary is continuously adjusted until the dictionary and sparse representation converge to generate the final learned dictionary.

[0140] In this implementation, S23 includes the following steps:

[0141] S231, performing hierarchical clustering on the initial training data to divide it into several subsets, each subset represents a level, and using the cluster center as the initial element of the dictionary;

[0142] S232, at the first level, using a sparse coding algorithm to encode each training sample, represented as a linear combination of dictionaries, and optimizing a sparse coefficient vector;

[0143] S233. Update the dictionary at each level, iterate alternately between sparse coding and dictionary updating, and optimize the dictionary matrix:

[0144] ;

[0145] in, Indicates The dictionary matrix of the layer, is the learning rate, express norm;

[0146] S234, introduce a multi-level dictionary learning mechanism, divide the dictionary learning process into multiple levels, optimize the dictionary layer by layer, and at each level, use the output of the previous level as the input of the current level to continue sparse coding and dictionary update;

[0147] S235, introduce an adaptive sparsity adjustment mechanism at each level, dynamically adjust the sparsity control parameters according to the feature complexity and reconstruction error of the current level :

[0148] ;

[0149] in, is the learning rate adjusted for sparsity, is the regularization parameter for sparsity adjustment, and They represent the partial derivatives of reconstruction error and sparsity with respect to the sparsity control parameter respectively;

[0150] S236. Adopt a gradient-based adaptive dictionary update strategy at each level, and dynamically adjust the dictionary update step size and direction by monitoring the reconstruction error of each iteration:

[0151] ;

[0152] in, is the dynamic step size of dictionary update, Regularization parameter updated for the dictionary;

[0153] S237. Through multi-level dictionary learning and optimization, features are extracted at different granularities, the expression and discrimination capabilities of the dictionary are gradually improved, and finally a learned dictionary is generated.

[0154] In this implementation, S3 includes the following steps:

[0155] S31, using the learned dictionary, representing the grayscale face image to be recognized as a sparse linear combination of dictionary atoms;

[0156] S32, using orthogonal matching pursuit sparse coding algorithm to quickly solve sparse representation:

[0157] ;

[0158] in, express norm, represents the zero norm, is the sparsity control parameter;

[0159] S33, using the sparse coefficient vector obtained by sparse coding as a sparse feature vector;

[0160] S34, the sparse feature vector of the grayscale face image is fused with the features of the infrared image and the visible light image to generate a multimodal feature vector:

[0161] ;

[0162] in, represents the multimodal feature vector, represents the sparse feature vector of the grayscale face image, represents the feature vector of the infrared image, A feature vector representing a visible light image.

[0163] In this implementation, S4 includes the following steps:

[0164] S41, combining the multimodal feature vector with the label in the initial training data, wherein the label is the identity or category information of each face image;

[0165] S42. Design a new kernel function through kernel function optimization:

[0166] ;

[0167] The optimized kernel function formula is:

[0168] ;

[0169] in, represents the original kernel function, and are the vectors after feature mapping, is the kernel function parameter, represents the optimized kernel function;

[0170] S43, use support vector machine to train the classifier, using the optimized kernel function:

[0171] ;

[0172] ;

[0173] Among them, w is the weight vector, b is the bias, is the slack variable, c is the penalty parameter, For labels, is the optimized kernel function;

[0174] S44. Divide the training data and multimodal feature vectors into multiple subsets, perform support vector machine training and prediction in parallel on a multi-core processor, and use parallel computing to perform kernel function calculation and model parameter update.

[0175] In this implementation, S6 includes the following steps:

[0176] S61. Monitoring recognition performance based on real-time recognition results:

[0177] ;

[0178] ;

[0179] Among them, TP is the true positive class, TN is the true negative class, FP is the false positive class, and FN is the false negative class;

[0180] S62, dynamically adjust the preprocessing parameters according to the recognition performance, and dynamically adjust the weight coefficient of the grayscale conversion formula

[0181] ;

[0182] in, is the weight coefficient;

[0183] Adjust according to ambient lighting conditions:

[0184] ;

[0185] in, is the adjustment amount based on the current lighting conditions, obtained through the real-time lighting detection algorithm;

[0186] S63, dynamically adjust the sparse coding parameters according to the recognition performance, and adjust the sparsity control parameter T to optimize the sparse representation:

[0187] ;

[0188] in, is the initial sparsity control parameter, is the adjustment amount based on the current recognition performance:

[0189] ;

[0190] Where k is the adjustment coefficient, It is the partial derivative of recognition accuracy with respect to the sparsity control parameter;

[0191] S64, dynamically adjust the classification parameters according to the recognition performance, adjust the penalty parameter c and the kernel function parameter Optimizing classification performance:

[0192] ;

[0193] ;

[0194] in, and is the initial parameter, and is the adjustment amount based on the current recognition performance;

[0195] ;

[0196] ;

[0197] in, and is the adjustment factor, and It is the partial derivative of the recognition accuracy with respect to the penalty parameter and the kernel function parameter;

[0198] S65, adjusting the preprocessing steps in real time based on environmental changes, and dynamically adjusting the threshold of contrast-limited adaptive histogram equalization under different lighting conditions:

[0199] ;

[0200] in, is the initial threshold, is the adjustment amount based on current lighting conditions:

[0201] ;

[0202] in, is the adjustment factor, The image contrast Partial derivative of the threshold.

[0203] Embodiment 1:

[0204] This embodiment describes the application of a face recognition method based on sparse coding and dictionary learning in a campus security monitoring system. The campus security monitoring system needs to identify people entering and leaving the campus in real time and accurately to ensure campus safety. When processing a large number of high-dimensional face images, the system needs to have the capabilities of efficient feature extraction, adaptive dictionary construction, image deformation and occlusion processing, and fast sparse representation solution to cope with complex actual environments.

[0205] In the campus security monitoring system, the system camera captures color facial images of people entering and leaving the campus 24 hours a day. These images are transmitted to the server in real time via the network, and the server processes them according to the method of the present invention. First, the system obtains the color facial image from the camera and converts it into a grayscale image. The converted grayscale image is processed by image enhancement technology to improve the image quality. Then, the grayscale image is normalized so that the pixel values ​​are within a uniform range and eliminate the influence of illumination changes. Next, the system aligns the grayscale image based on the three-dimensional face model to handle facial posture changes and ensure that the facial features are in the same position and scale.

[0206] The labeled initial training data collected from the public face image database is initialized by the hierarchical clustering method. The system divides the training data into several clusters, and each cluster center is used as the initial element of the dictionary. A multi-level dictionary learning mechanism is adopted, and the dictionary is continuously optimized through the alternating iteration of sparse coding and dictionary update, so that the atoms in the dictionary can better represent the face image. Based on the optimized dictionary, the system uses the learned dictionary to represent the grayscale face image to be recognized as a sparse linear combination of dictionary atoms, and uses the orthogonal matching pursuit sparse coding algorithm to solve the sparse representation, and the sparse coefficient vector obtained by sparse coding is used as a sparse feature vector. The sparse feature vector of the grayscale face image is fused with the features of the infrared image and the visible light image to generate a multimodal feature vector.

[0207] The multimodal feature vectors and initial training data are used to train the support vector machine classifier. New kernel functions are designed through kernel function optimization, and parallel computing is used to optimize real-time performance. The system sparsely encodes the new grayscale face image to be recognized, extracts the feature vector, uses the trained classifier to classify and outputs the recognition result. During the entire recognition process, the system builds an autonomous correction mechanism to dynamically adjust the preprocessing, sparse coding and classification parameters based on real-time recognition results and environmental changes to further improve the accuracy and adaptability of recognition.

[0208] In order to verify the effectiveness of the method of the present invention, we conducted a one-month test on a university campus. The test system was deployed at the main entrance of the campus and collected more than 500,000 face images. The test data included normal lighting, cloudy days, rainy days, and complex scenes where some people wore masks and hats. During this period, we compared the performance of traditional face recognition methods and the method of the present invention.

[0209] The specific data are as follows: the recognition accuracy of the traditional method is 86.5%, while the recognition accuracy of the method of the present invention is 95.8%. The average processing time per image of the traditional method is 1.2 seconds, while the average processing time per image of the method of the present invention is 0.8 seconds. In terms of the ability to handle image deformation and occlusion, the recognition accuracy of the traditional method drops to 60%, while the recognition accuracy of the method of the present invention is maintained at more than 85%. Under different lighting conditions, under normal lighting conditions, the recognition accuracy of the traditional method is 89.2%, and the recognition accuracy of the method of the present invention is 97.0%; under low lighting conditions, the recognition accuracy of the traditional method is 72.3%, and the recognition accuracy of the method of the present invention is 90.5%. In terms of recognition accuracy when wearing masks and hats, the traditional method is 50.7%, and the method of the present invention is 78.6%. In terms of real-time performance, the traditional method has obvious delays and cannot meet the needs of real-time monitoring, while the processing delay of the method of the present invention is significantly reduced, which can meet the needs of real-time monitoring.

[0210] Table 1 Test data table

[0211]

[0212] Table 2 Performance comparison table

[0213]

[0214] The method of the present invention is superior to the traditional method in multiple key indicators, as shown below: In terms of average recognition accuracy, the traditional method is 81.8%, while the method of the present invention is 92.7%, an increase of 10.9%. Under normal lighting conditions, the recognition accuracy of the traditional method is 89.2%, while that of the method of the present invention is 97.0%. Under low light conditions, the recognition accuracy of the traditional method is 72.3%, while that of the method of the present invention is 90.5%. When wearing masks and hats, the recognition accuracy of the traditional method is 50.7%, while that of the method of the present invention is 78.6%. In terms of processing speed, the average processing time per image of the traditional method is 1.3 seconds, while that of the method of the present invention is 0.85 seconds, and the processing speed is increased by about 34.6%. In terms of the ability to handle image deformation and occlusion, the recognition accuracy of the traditional method is 60.0%, while that of the method of the present invention can be maintained above 85.0%. In terms of real-time performance, the traditional method has obvious delays and cannot meet the real-time monitoring requirements, while the processing delay of the method of the present invention is significantly reduced, and can meet the real-time monitoring requirements without obvious delay.

[0215] It can be seen from the above data that the method of the present invention is significantly superior to the traditional method in terms of recognition accuracy, processing speed, ability to handle image deformation and occlusion, and adaptability to different lighting conditions. At the same time, the method of the present invention is more stable in handling complex environments, can significantly improve the overall performance of the face recognition system, and meet the actual needs of the campus security monitoring system. The present invention achieves efficient and accurate recognition of facial images in complex environments through technical means such as efficient feature extraction, adaptive dictionary construction, image deformation and occlusion processing, and fast sparse representation solution. Through the autonomous correction mechanism, the system can dynamically adjust according to real-time recognition results and environmental changes, improve the accuracy and adaptability of recognition, and ensure the reliable operation of the campus security monitoring system.

[0216] The present invention proposes a face recognition method based on sparse coding and dictionary learning, aiming to solve the deficiencies in the prior art in terms of high-dimensional data feature extraction, adaptability of dictionary construction, processing of image deformation and occlusion, computational efficiency of sparse representation solution, and recognition accuracy. Through sparse coding and dictionary learning technology, high-dimensional face image data is converted into low-dimensional and sparse feature vectors, and through a multi-level dictionary learning mechanism and an adaptive sparsity adjustment mechanism, the dictionary is adaptively constructed and optimized, thereby improving the efficiency and accuracy of recognition.

[0217] In summary, the method of the present invention has significant advantages in recognition accuracy, processing speed, image deformation and occlusion processing capabilities, and real-time performance. In particular, it can maintain efficient and accurate recognition effects in complex environments, and is suitable for face recognition application scenarios that require high precision and high efficiency, such as campus security monitoring, identity authentication, and crime investigation. Through efficient feature extraction, adaptive dictionary construction, and processing of image deformation and occlusion problems in complex environments, the present invention significantly improves the overall performance of the face recognition system, ensuring its reliability and stability in practical applications.

[0218] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical scheme and inventive concept of the present invention within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.

Claims

1. A face recognition method based on sparse coding and dictionary learning, characterized in that: The steps include: S1, obtain color face images from real-time cameras and local image libraries, convert color face images into grayscale face images, use image enhancement technology to perform enhancement processing, normalize the grayscale face images, align them based on a three-dimensional face model, and handle facial posture changes; S2. Collect labeled initial training data from a public face image database, initialize the dictionary using a hierarchical clustering method, divide the initial training data into several clusters, use each cluster center as the initial dictionary element, and use a multi-level dictionary learning mechanism to continuously optimize the dictionary through alternating iterations of sparse coding and dictionary updates; The S2 comprises the following steps: S21, collect labeled initial training data from a public face image database; S22, initializing the dictionary by a hierarchical clustering method, dividing the initial training data into several clusters, and using each cluster center as an initial element of the dictionary; S23, introduce a multi-level dictionary learning mechanism, divide the dictionary learning process into multiple levels, and optimize the dictionary layer by layer: S24. In the process of updating the dictionary, the non-negative matrix decomposition algorithm is combined to perform non-negative matrix decomposition on the initial dictionary to obtain the base matrix and the coefficient matrix. In each iteration, the non-negative constraint condition is maintained to update the base matrix and the coefficient matrix: ; ; in, and Respectively represent The dictionary matrix and sparse coefficient matrix of the iteration, is the learning rate, Represents the logarithm of each element of the dictionary matrix; S25, through the alternating iterations of sparse coding and dictionary updating, the dictionary is continuously adjusted until the dictionary and the sparse representation converge to generate the final learned dictionary; The S23 comprises the following steps: S231, performing hierarchical clustering on the initial training data to divide it into several subsets, each subset represents a level, and using the cluster center as the initial element of the dictionary; S232, at the first level, using a sparse coding algorithm to encode each training sample, represented as a linear combination of dictionaries, and optimizing a sparse coefficient vector; S233. Update the dictionary at each level, iterate alternately between sparse coding and dictionary updating, and optimize the dictionary matrix: ; in, Indicates The dictionary matrix of the layer, is the learning rate, express norm; S234, introduce a multi-level dictionary learning mechanism, divide the dictionary learning process into multiple levels, optimize the dictionary layer by layer, and at each level, use the output of the previous level as the input of the current level to continue sparse coding and dictionary updating; S235, introduce an adaptive sparsity adjustment mechanism at each level, dynamically adjust the sparsity control parameters according to the feature complexity and reconstruction error of the current level : ; in, is the learning rate adjusted for sparsity, is the regularization parameter for sparsity adjustment, and They represent the partial derivatives of reconstruction error and sparsity with respect to the sparsity control parameter respectively; S236. Adopt a gradient-based adaptive dictionary update strategy at each level, and dynamically adjust the dictionary update step size and direction by monitoring the reconstruction error of each iteration: ; in, is the dynamic step size of dictionary update, Regularization parameter updated for the dictionary; S237, through multi-level dictionary learning and optimization, extract features at different granularities, gradually improve the expression and distinction capabilities of the dictionary, and finally generate a learned dictionary; S3, using the learned dictionary, the grayscale face image to be recognized is represented as a sparse linear combination of dictionary atoms, the orthogonal matching pursuit sparse coding algorithm is used to solve the sparse representation, and the sparse coefficient vector obtained by sparse coding is used as a sparse feature vector, and the sparse feature vector of the grayscale face image is fused with the features of the infrared image and the color face image to generate a multimodal feature vector; S4, using multimodal feature vectors and initial training data to train the classifier, using support vector machine, designing a new kernel function through kernel function optimization, and using parallel computing to optimize real-time performance; S5, sparsely encode the new grayscale face image to be recognized, extract the feature vector, classify it using the trained classifier and output the recognition result; S6. During the entire recognition process, an autonomous correction mechanism is built to dynamically adjust preprocessing, sparse coding, and classification parameters based on real-time recognition results and environmental changes.

2. A face recognition method based on sparse coding and dictionary learning according to claim 1, characterized in that: The S1 comprises the following steps: S11, obtaining color face images from the real-time camera and the local image library; S12. Convert the color face image into a grayscale face image: ; in, Respectively represent the red, green, and blue channel pixel values ​​of the color image. Represents the pixel value of a grayscale image; S13. Use image enhancement technology to enhance the grayscale face image, and use histogram equalization technology to calculate the cumulative distribution function of each pixel: ; in, Indicates the gray level is The number of pixels, Indicates the total number of pixels in the image; Use contrast-limited adaptive histogram equalization technology to set contrast-limited thresholds and perform local contrast enhancement; S14, normalize the grayscale face image to normalize the pixel value of the grayscale image to scope; S15. Align based on the 3D face model, process facial posture changes, use a multi-task cascade convolutional neural network to detect facial key points, and determine the key point positions of the eyes, nose and mouth; align the detected key points with the standard 3D model through the 3D face model alignment algorithm, and use the affine transformation matrix for alignment.

3. A face recognition method based on sparse coding and dictionary learning according to claim 1, characterized in that: The S3 comprises the following steps: S31, using the learned dictionary, representing the grayscale face image to be recognized as a sparse linear combination of dictionary atoms; S32, using orthogonal matching pursuit sparse coding algorithm to quickly solve sparse representation: ; in, express norm, represents the zero norm, is the sparsity control parameter; S33, using the sparse coefficient vector obtained by sparse coding as a sparse feature vector; S34, the sparse feature vector of the grayscale face image is fused with the features of the infrared image and the color face image to generate a multimodal feature vector: ; in, represents the multimodal feature vector, represents the sparse feature vector of the grayscale face image, represents the feature vector of the infrared image, A feature vector representing a color face image.

4. The face recognition method based on sparse coding and dictionary learning according to claim 1, characterized in that: The S4 comprises the following steps: S41, combining the multimodal feature vector with the label in the initial training data, wherein the label is the identity or category information of each face image; S42. Design a new kernel function through kernel function optimization: ; The optimized kernel function formula is: ; in, represents the original kernel function, and are the vectors after feature mapping, is the kernel function parameter, represents the optimized kernel function; S43, use support vector machine to train the classifier, using the optimized kernel function: ; Among them, w is the weight vector, b is the bias, is the slack variable, c is the penalty parameter, For labels, is the optimized kernel function; S44, dividing the initial training data and the multimodal feature vector into multiple subsets, performing support vector machine training and prediction in parallel on a multi-core processor, and using parallel computing to perform kernel function calculations and model parameter updates.

5. The face recognition method based on sparse coding and dictionary learning according to claim 1, characterized in that: The S6 comprises the following steps: S61. Monitoring recognition performance based on real-time recognition results: ; ; Among them, TP is the true positive class, TN is the true negative class, FP is the false positive class, and FN is the false negative class; S62, dynamically adjust the preprocessing parameters according to the recognition performance, and dynamically adjust the weight coefficient of the grayscale conversion formula ; in, is the weight coefficient; Adjust according to ambient lighting conditions: ; in, is the adjustment amount based on the current lighting conditions, obtained through the real-time lighting detection algorithm; S63, dynamically adjust the sparse coding parameters according to the recognition performance, and adjust the sparsity control parameter T to optimize the sparse representation: ; in, is the initial sparsity control parameter, is the adjustment amount based on the current recognition performance: ; Where k is the adjustment coefficient, It is the partial derivative of recognition accuracy with respect to the sparsity control parameter; S64, dynamically adjust the classification parameters according to the recognition performance, adjust the penalty parameter c and the kernel function parameter Optimizing classification performance: ; ; in, and is the initial parameter, and is the adjustment amount based on the current recognition performance; ; ; in, and is the adjustment factor, and It is the partial derivative of the recognition accuracy with respect to the penalty parameter and the kernel function parameter; S65, adjusting the preprocessing steps in real time based on environmental changes, and dynamically adjusting the threshold of contrast-limited adaptive histogram equalization under different lighting conditions: ; in, is the initial threshold, is the adjustment amount based on current lighting conditions: ; in, is the adjustment factor, The image contrast Partial derivative of the threshold.