An image classification method based on sparse discriminative least squares regression

By using the sparse discriminative least squares regression method, combined with sparsity constraints and PCA dimensionality reduction, and optimizing the projection matrix, the overfitting and class confusion problems of existing image classification methods are solved, achieving higher classification accuracy and data structure preservation.

CN117876743BActive Publication Date: 2026-11-10NANJING AUDIT UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311672679.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-07
Publication Date
2026-11-10
Estimated Expiration
2043-12-07

AI Technical Summary

Technical Problem

Existing LSR-based image classification methods have shortcomings in handling sample relationships, leading to overfitting and class confusion, making it difficult to effectively distinguish similar categories.

Method used

We employ a sparse discriminative least squares regression method, which introduces L2,1 norm inter-class sparsity constraints, relaxation matrix sparsity constraints, and noise matrix sparsity constraints. We combine PCA dimensionality reduction and the Lagrange multiplier method to optimize the projection matrix and construct an objective function to enhance classification performance.

Benefits of technology

By effectively utilizing sample relationships, suppressing outliers, preserving data structure, improving classification accuracy, reducing class overlap, and enhancing regression performance in image classification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117876743B_ABST
    Figure CN117876743B_ABST
Patent Text Reader

Abstract

This invention discloses an image classification method based on sparse discriminative least squares regression, which combines three sparsity constraints: inter-class sparsity constraints to amplify the increase in distance between similar classes; sparsity constraints on the relaxation matrix to capture more local structure; and sparsity constraints on the noise matrix to minimize the impact of outliers. Furthermore, a matrix factorization step is strategically positioned in the label space to enhance denoising capabilities, protect it from potential degradation, and preserve its underlying manifold structure. This invention effectively solves the distance reduction problem between similar but not identical classes in discriminative least squares regression models. By combining the three sparsity constraints—inter-class sparsity, sparsity constraints on the relaxation matrix, and sparsity constraints on the noise matrix—and denoising in the label space into a coordinated framework, the model becomes more discriminative, thus enhancing its feature representation ability to a certain extent.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image classification technology, and in particular to an image classification method based on sparse discriminative least squares regression. Background Technology

[0002] In the field of pattern classification, LSR (Least Squares Regression) is a particularly effective method that has been widely applied, especially in face recognition, cancer classification, and image retrieval. The essence of least squares regression is to learn a correlation matrix that perfectly connects the source and target data. Over the past few decades, researchers have proposed many extensions to least squares regression. Furthermore, some representation-based classification methods that use LSR techniques to obtain representation coefficients for classification also fall within the framework of least squares regression, such as linear regression classification, sparse representation classification, and cooperative representation classification.

[0003] The extended regression framework offers greater flexibility in incorporating meaningful regularization items and improves recognition performance. Compared to some traditional representation-based methods, the extended regression framework offers greater flexibility in incorporating meaningful regularization items and improves recognition performance, further enhancing computational efficiency. For example, the LSR model can also easily combine Lasso constraints (L1 norm) and row sparsity constraints (L... 2,1 Sparse techniques such as norms are used to learn the transformation matrix to select the most distinctive features for classification, which helps improve performance.

[0004] However, the aforementioned LSR-based methods still have many problems. First, the target matrix, also known as the zero-label matrix, is unsuitable for classification; the 0-1 label matrix is ​​too strict, and the Euclidean distance between samples of different classes is constant. Second, these LSR-based techniques ignore sample relationships and tend to fit samples only to the correct labels. This can disrupt the inherent data structure and lead to overfitting problems. Many solutions have been devised over the years to address these issues. For example, many researchers have proposed regressions that relax the label matrix instead of a strict one, the most representative being DLSR (Discriminative Least Squares Regression) and LRDLSR (Low-rank Discriminative LSR). DLSR introduces ε-dragging techniques as a means to increase the distance between regression targets of different classes. Based on DLSR, the LRDLSR model adds low-rank constraints to DLSR, emphasizing the correlation between samples and learning a more compact representation. However, relaxing the label matrix by introducing ε-dragging techniques or marginal constraints may produce unintended results, namely reducing the regression response distance between similar classes. This phenomenon can lead to overlap and confusion between similar but different categories, which is detrimental to the classification process. Summary of the Invention

[0005] The problem to be solved by this invention is to provide an image classification method based on sparse discriminative least squares regression to enhance the regression performance in image classification problems and to solve image classification problems.

[0006] This invention adopts the following technical solution: an image classification method based on sparse discriminative least squares regression, comprising the following steps:

[0007] Step 1: Obtain the face image training sample set X, and process each training sample x in the sample set. i The training samples and the sample to be identified y are normalized, and the dimensionality of the training samples and the sample to be identified y is reduced by using the dimensionality reduction method of PCA (Principal Component Analysis).

[0008] Step 2: Based on the sample set X, add sparse constraints to the relaxation matrix, noise matrix, and inter-class distance, and add matrix decomposition in the label space to construct the objective function model;

[0009] Step 3: Solve the objective function using the Lagrange multiplier method and calculate the optimal projection matrix Q;

[0010] Step 4: Calculate the features of the sample to be identified y in the label space and obtain the optimal projection matrix Q. Then, multiply the sample to be identified y by the projection matrix Q to obtain the product Qy. Transform the sample to be identified into its label space and obtain its features in the label space. Identify the label according to the nearest neighbor principle and determine the category of the sample to be identified y.

[0011] The present invention also provides: an electronic device, comprising:

[0012] One or more processors;

[0013] A storage device on which one or more programs are stored;

[0014] When the one or more programs are executed by the one or more processors, the one or more processors implement any of the above-described image classification methods based on sparse discriminative least squares regression.

[0015] The present invention also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of any of the above-mentioned image classification methods based on sparse discriminative least squares regression.

[0016] Compared with the prior art, the present invention, employing the above technical solution, has the following technical effects:

[0017] 1. The image classification method of this invention will classify L 2,1 Norm-based inter-class sparsity constraints are added to DLSR to fully leverage the relationships between samples to learn more compact transformations.

[0018] 2. The image classification method of this invention introduces L into the noise matrix. 2,1 Norm sparsity constraints, due to their rotation invariance, provide a good description of the geometric structure of the samples and effectively suppress outliers.

[0019] 3. The image classification method of the present invention introduces a simple L1 norm sparsity constraint in the relaxation matrix, which can comprehensively capture the local structure around each sample.

[0020] 4. The image classification method of the present invention places a denoising stage in the label space, which helps to preserve the inherent structure of the original data and ensure its familiarity and integrity. Attached Figure Description

[0021] Figure 1 This is a flowchart of the image classification method based on sparse discriminative least squares regression of the present invention.

[0022] Figure 2 These are sample images from the face database in this embodiment of the invention. Detailed Implementation

[0023] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of the application will be further described in detail below with reference to the accompanying drawings. The described embodiments are only a part of the embodiments involved in this invention. All non-innovative embodiments based on these embodiments by other researchers in the art are within the protection scope of this invention. Furthermore, the step numbers in the embodiments of this invention are only set for ease of explanation and do not limit the order of the steps. The execution order of each step in the embodiments can be adaptively adjusted according to the understanding of those skilled in the art.

[0024] In one embodiment of the present invention, an image classification method based on sparse discriminative least squares regression, such as... Figure 1 As shown, the details are as follows:

[0025] Step 1: Obtain the face image training sample set X, normalize each training sample and the sample to be identified in the sample set, and use the PCA dimensionality reduction method to reduce the data dimensionality of the training samples and the sample to be identified y.

[0026] Given a training sample set X = [X1, X2, ..., X...] c ] = [x1,x2,...,x n ]∈R d×n Where d represents the dimension of the sample, c represents the class, n represents the number of samples, y represents the sample to be identified, and R d×n It represents the set of real numbers with dimension d×n.

[0027] H = [h1, h2, ..., h n ]∈R c×n Let X be a heat matrix, and let h be a vector. i =[0,...,0,1,0,...,0] T ∈R c Let represent the class from sample i, and T represent the transpose operation.

[0028] For each training sample x i Perform normalization operation with modulus 1:

[0029] x i =x i / ||x i ||2, (i = 1, 2, ..., n)

[0030] Similarly, normalization is also required for the sample y to be identified:

[0031] y = y / ||y||2

[0032] The PCA dimensionality reduction method is used to preprocess the normalized samples to reduce the data dimensionality. For convenience, in this embodiment, X = [x1, x2, ..., x...] is still used. n ] and y represent the training sample set and the sample to be identified after PCA preprocessing.

[0033] Step 2: Based on the sample set X, add sparse constraints to the relaxation matrix, noise matrix, and inter-class distance, and add matrix decomposition in the label space to construct the objective function model;

[0034] The DLSR method introduces ε-dragging techniques, enabling inter-class labels to move in opposite directions. The transformation matrix is ​​learned using the following model:

[0035]

[0036] stM≥0

[0037] Where B∈R c×n Let M be a non-negative constant matrix, and let M be the tag relaxation matrix used for ε-drag. is the Frobenius norm of the matrix, ⊙ is the Hadamard operator, and β is the regularization parameter;

[0038] However, it should be noted that if the two categories are similar, DLSR cannot distinguish them well, which will make the two related classes more closely linked, leading to overlap and misunderstanding between them.

[0039] In this embodiment, an improved model based on sparse discriminative least squares regression is proposed to enhance the discriminative power of the transformation matrix:

[0040]

[0041] stL≥0,M≥0,QX=L+E

[0042] Where, L∈R c×n Let Q represent the relaxation matrix, Q∈R c×m Let X ∈ R be the projection matrix. m×n Let E represent the sample matrix, E∈R c×n It is a noise matrix, and the correlation terms are measured by the regularization parameters λ1>0, λ2>0, λ3>0, λ4>0.

[0043] Step 3: Solve the objective function using the Lagrange multiplier method and calculate the optimal projection matrix Q;

[0044] As can be seen from the objective function model, this model has multiple unknown parameters. Therefore, the Lagrange multiplier method is used iteratively to find the approximate solution of the model, and F is introduced as an auxiliary variable to ensure that it has a closed solution, allowing it to be differentiated into independent subproblems. The objective function is equivalent to:

[0045]

[0046] stM≥0, L≥0, QX=L+E, QX=F

[0047] The above optimization problem can be transformed into the following augmented Lagrangian function:

[0048]

[0049] stM≥0,L≥0

[0050] Where μ is the penalty parameter, and R1 and R2 are Lagrange multipliers.

[0051] In this embodiment, the variables are solved one by one for the above-mentioned augmented Lagrange function model, as follows.

[0052] Step 3.1, Solve for matrix L; with Q, E, F, and M fixed, the optimization function for matrix L is expressed as follows:

[0053]

[0054] stL≥0

[0055] The solution for L is obtained by solving the following formula:

[0056]

[0057] Among them, S ε (x) = sgn(x) × max(|x|-ε,0) is a soft threshold operator, and the function sgn(x) is expressed as:

[0058]

[0059] Step 3.2, Update matrix Q: Fix L, E, F, and M to obtain the optimization function for matrix Q:

[0060]

[0061] Let the partial differential of the above equation The solution to the projection matrix Q is obtained as follows:

[0062] Q=(2(H+B⊙M)+μ(L+F+E)-R1-R2)X T (2μXX T +2λ2I+2XXT ) -1 Where I represents the identity matrix, with all diagonal elements being 1 and all other elements being 0;

[0063] Step 3.3, Update matrix M: With L, Q, E, and F fixed, the optimization function for matrix M is expressed as follows:

[0064]

[0065] stM≥0

[0066] Minimizing the above function is equivalent to minimizing c×n subproblems, and the following operations can be performed to update M:

[0067] M = max(B⊙(QX-H), 0).

[0068] Step 3.4, Update matrix E: Fix L, Q, F, and M to obtain the optimization function for matrix E:

[0069]

[0070] Taking the partial derivative of the above expression, we can obtain:

[0071]

[0072] Where Λ is a diagonal matrix, and its diagonal components can be represented in the following form:

[0073]

[0074] Among them, e ij Let d represent the i-th row and j-th column of matrix E, and d represent the dimension.

[0075] Step 3.5, Update variable F: Fix L, Q, E, and M to obtain the optimized function for variable F:

[0076]

[0077] definition The optimization function for variable F is transformed into the following minimization problem:

[0078]

[0079] Among them, F i and G 3i Let F and G3 represent samples of the i-th class, respectively;

[0080] It is clear from the above formula that solving for F essentially involves solving for each subset Fi, and the optimal solution Fi can be obtained through the following process:

[0081]

[0082] Among them, F i and G 3i The j-th row is composed of [F i ] j,: and [G] 3i ] j,: express.

[0083] Step 3.6: Update the Lagrange multipliers R1, R2 and the penalty parameter μ.

[0084] R1=R1+μ(E-(QX-T))

[0085] R² = R² + μ(QX - F)

[0086] μ = min(μ max ,ρμ)

[0087] Where ρ is the parameter for updating μ;

[0088] Step 3.7, Meet condition ‖QX-LE‖ ∞ <ε1&‖QX-F‖ ∞ When ε<2, the iteration stops and the optimal projection matrix Q is output. ε<1 and ε<2 are the iteration stopping parameters.

[0089] Through the above process, a more discriminative transformation projection matrix Q can be obtained, which can be used to extract the features most conducive to classification, and on this basis, better classification results can be obtained.

[0090] Step 4: Calculate the features of the sample y to be identified in the label space, identify the label according to the nearest neighbor principle, and determine the category of the sample to be identified.

[0091] After obtaining the ideal projection matrix Q, for any sample y to be identified, the sample is transformed into its label space by calculating Qy to obtain its features in the label space.

[0092] Let d i Let d represent the distance between the feature Qy of the sample y to be identified in the label space and the sample of the i-th class. i The calculation formula is:

[0093]

[0094] Where x ij Let ||Qy-x| represent the j-th sample of class i. ij ||2 represents Qy and x ij The Euclidean distance, where n represents the number of face samples in each class.

[0095] In this embodiment, the decision rule of the proposed invention is based on the nearest neighbor principle, selecting d i The category of the smallest point is used as the predicted classification of the sample data to be identified, that is:

[0096] If Label(y) = min i (d i ), and classify the sample y to be identified into the i-th class.

[0097] In summary, this invention combines three sparsity constraints: sparsity constraints between classes to amplify the growth of distance between similar classes; sparsity constraints on the relaxation matrix to capture more local structure; and sparsity constraints on the noise matrix to minimize the impact of outliers. Furthermore, the matrix factorization step is strategically positioned in the label space to enhance denoising capabilities, protect it from potential degradation, and preserve its underlying manifold structure.

[0098] These features greatly improve upon the shortcomings of DLSR and perform better in multi-classification tasks.

[0099] To verify the effectiveness of the image classification method in this embodiment, experiments were conducted on a commonly used AR face dataset. This dataset contains 3120 images of 120 people, with each image having a resolution of 50×40. Examples of 22 images of a single person from this face dataset are provided below. Figure 2 As shown.

[0100] In the experiment, 1, 2, 3, 10, 15, and 20 images were selected as training samples, and the remaining images were used as samples to be identified for testing.

[0101] In the experiment, the training images and the images to be recognized were first normalized using step 1, and the image dimensions were compressed to different dimensions using the PCA method. Then, the recognition rate was output according to steps 2-4.

[0102] First, a training sample set of face images is obtained and normalized and subjected to PCA dimensionality reduction. Second, sparsity constraints are added to the relaxation matrix, noise matrix, and inter-class distance, and a matrix factorization step in the label space is added to construct the objective function. Then, the representation coefficients are solved using the Lagrange multiplier method, and the optimal projection matrix is ​​iteratively updated to finally output the optimal projection matrix. Finally, after obtaining the ideal projection matrix, neural network technology is used to find the column closest to the given test sample, and the sample is assigned to the neighboring class closest to it, so as to make accurate predictions by effectively utilizing the proximity of data points.

[0103] The following table lists the face recognition rates of this invention:

[0104] Number of training samples Dimension Recognition rate (%) ± standard deviation 1 100 57.90±1.99 2 200 78.54±1.21 3 300 86.00±0.74 10 500 96.85±0.21 15 500 98.40±0.31 20 500 99.08±0.28

[0105] As the number of training samples increases, the accuracy of the model also increases, which can significantly improve the classification accuracy. It can be seen that the image classification method of the present invention effectively enhances the regression performance in image classification problems and suppresses outliers. It can fully capture the local structure around each sample and ensure the familiarity and integrity of the label space, thereby improving the classification accuracy.

[0106] In this embodiment of the invention, an electronic device is also provided, comprising: one or more processors; a storage device storing one or more programs thereon; when the one or more programs are executed by the one or more processors, the one or more processors implement the image classification method based on sparse discriminative least squares regression described in any of the above embodiments.

[0107] In this embodiment of the invention, a computer-readable storage medium is also provided, on which a computer program is stored. When the program is executed by a processor, it implements the steps of any of the image classification methods based on sparse discriminative least squares regression in the above embodiments.

[0108] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. An image classification method based on sparse discriminative least squares regression, characterized in that, Includes the following steps: Step 1: Obtain the face image training sample set X, normalize each training sample and the sample to be identified in the sample set, and use the dimensionality reduction method of principal component analysis to reduce the data dimensionality of the training sample and the sample to be identified y. Obtain the face image sample set X, and the single-hot label matrix H of sample set X, as shown in the following formula: ; ; Wherein, the sample set X includes n training samples from c classes, d is the dimension of the samples, and x i This represents the i-th training sample. Represents the set of real numbers with dimension d×n; vector , used to represent the class of the i-th sample, and T represents the transpose operation; Step 2: Based on the sample set X, add sparse constraints to the relaxation matrix, noise matrix, and inter-class distance, and add matrix decomposition in the label space to construct the objective function model; Constructing the objective function model includes the following sub-steps: Step 2.1: Introduce via DLSR method This allows labels between classes to move in opposite directions, and the transformation matrix is ​​learned through the following model: ; in, Let M be a nonnegative constant matrix, and M be used for - Drag-and-drop tag relaxation matrix, It is the Frobenius norm of the matrix. For the Hadama operator, For regularization parameters; Step 2.2: Add sparse constraints to the relaxation matrix, noise matrix, and inter-class distance to construct an objective function model based on sparse discriminative least squares regression, as shown below: ; in, Represents the relaxation matrix. Represents the projection matrix. Represents the sample matrix, It is a noise matrix, composed of regularization parameters. Measurement; Step 3: Solve the objective function using the Lagrange multiplier method and calculate the optimal projection matrix Q. The method is as follows: Introducing variable F as an auxiliary variable makes the objective function have a closed-form solution, and the objective function is equivalent to: ; The augmented Lagrangian function of the objective function is constructed as follows: ; Where µ is the penalty parameter, and R1 and R2 are Lagrange multipliers; Step 4: Calculate the features of the sample y to be identified in the label space, identify the label according to the nearest neighbor principle, and determine the category of the sample to be identified.

2. The image classification method based on sparse discriminative least squares regression according to claim 1, characterized in that, In step 1, for each training sample x i Perform normalization operation modulo 1: ; For the sample y to be identified, perform row normalization: ; Principal component analysis is used to reduce the dimensionality of the data by preprocessing the normalized training samples and the samples to be identified.

3. The image classification method based on sparse discriminative least squares regression according to claim 2, characterized in that, Step 3 involves calculating the optimal projection matrix Q, which includes the following sub-steps: Step 3.1, Solve for matrix L; with Q, E, F, and M fixed, the optimization function for matrix L is expressed as follows: ; The solution for L is obtained by solving the following formula: ; in, It is a soft threshold operator, a function Represented as: ; Step 3.2, Update matrix Q: Fix L, E, F, and M to obtain the optimization function for matrix Q: ; Let partial differential The solution for the projection matrix Q is obtained as follows: ; Where I represents the identity matrix, with all diagonal elements being 1 and all other elements being 0; Step 3.3, Update matrix M: With L, Q, E, and F fixed, the optimization function for matrix M is expressed as follows: ; Minimizing the optimization function of matrix M is equivalent to Minimize the subproblems and update M using the following formula: ; Step 3.4, Update matrix E: Fix L, Q, F, and M to obtain the optimization function for matrix E: ; Taking the partial derivative of the above equation, we get: ; in, It is a diagonal matrix. The diagonal components of the matrix are represented as follows: ; in, Let d represent the i-th row and j-th column of matrix E, and let d represent the dimension. Step 3.5, Update variable F: Fix L, Q, E, and M to obtain the optimized function for variable F: ; definition The optimization function for variable F is transformed into the following minimization problem: ; in, and Let F and G3 represent samples of the i-th class, respectively; Solving for the variable F includes solving for each subset F. i The optimal solution F i Obtained through the following formula: ; in, and The j-th row is respectively composed of and express; Step 3.6: Update the Lagrange multipliers R1, R2 and the penalty parameter µ. ; ; ; in, For updates µ Parameters; Step 3.7, meet the conditions When the iteration stops, the optimal projection matrix Q is output. , This is the parameter for stopping the iteration.

4. The image classification method based on sparse discriminative least squares regression according to claim 3, characterized in that, In step 4, the features of the sample to be identified y in the label space are calculated: after obtaining the optimal projection matrix Q, the sample to be identified y is multiplied by the projection matrix Q to obtain the product Qy, and the sample to be identified is transformed into its label space to obtain its features in the label space.

5. The image classification method based on sparse discriminative least squares regression according to claim 4, characterized in that, In step 4, the label is identified based on the nearest neighbor principle to determine the category of the sample to be identified, including the following sub-steps: Step 4.1, let d i d represents the distance between the feature Qy of the sample y to be identified in the label space and the sample of the i-th class. i The calculation formula is: ; Where, x ij This represents the j-th sample of the i-th class. for and European distance, This represents the number of face samples in each category; Step 4.2: Make a decision based on the nearest neighbor principle and select d. i The category of the smallest point is used as the predicted classification of the sample data to be identified. The sample y to be identified is classified into the i-th class.

6. An electronic device, characterized in that, include: One or more processors; A storage device on which one or more programs are stored; When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1 to 5.

7. A computer-readable storage medium, characterized in that, It stores a computer program that, when executed by a processor, implements the steps of the image classification method based on sparse discriminative least squares regression as described in any one of claims 1 to 5.