Image classification method based on double-flexible competition non-negative representation

By introducing mean competition and inter-class competition terms and combining them with the flexible factor optimization representation process, the problem of insufficient category differentiation penalty in non-negative representation classification is solved, and the accuracy of image classification is improved.

CN120673452APending Publication Date: 2025-09-19WUXI UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510469881.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-15
Publication Date
2025-09-19

AI Technical Summary

Technical Problem

Existing non-negative representation classification methods fail to effectively consider the differential penalties of coefficients of different categories, resulting in limited performance in image classification tasks.

Method used

Mean competition and inter-class competition terms are introduced, and the double flexible competition non-negative representation classifier is solved by the alternating direction multiplier method. The variable splitting method and augmented Lagrangian function are used to iteratively solve the representation coefficient, and the flexible factor is combined to optimize the representation process.

Benefits of technology

It improves the discriminability of representation vectors, reduces the interference of wrong categories, and significantly improves the accuracy of image classification, which is better than existing methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120673452A_ABST
    Figure CN120673452A_ABST
Patent Text Reader

Abstract

The invention discloses a double-flexible competition non-negative representation image classification method, which relates to the technical field of image classification, and is characterized in that on the basis of non-negative representation, mean value competition and inter-class competition are introduced, so that the representation capability of a model is remarkably improved; in mean value competition, the mean value of each category of training samples is used as a competition target, so that a representation coefficient can accurately capture unique features of each category, and the distinction degree between representation vectors is enhanced; the inter-class competition fully considers the internal relation between the overall representation and the class representation, the competitive representation between the correct class and other classes is enhanced, and the classification accuracy can be improved; besides, flexible factors are introduced into the two competition items, and training samples of error categories are no longer forced to participate in competition, so that representation coefficient weights of the categories are remarkably reduced, interference of the representation coefficient weights in classification decision making is reduced, and the classification performance of the model is integrally improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image classification, and in particular to an image classification method using dual flexible competitive non-negative representation. Background Art

[0002] Image classification has always been a hot research topic in the field of pattern recognition. In the field of representation classification, its core goal is to improve the distinguishability of representation coefficients. Sparse Representation Based Classification (SRC), as a pioneering achievement in this field, has laid a solid theoretical foundation and practical framework for subsequent representation classification methods. The SRC method cleverly uses the l1 norm, similar to the l0 norm, to constrain the representation coefficients in order to obtain sparse representation coefficients. This strategy significantly enhances the robustness of the model. In particular, when dealing with images in complex situations such as occlusion and corrosion, the SRC method has demonstrated excellent performance, demonstrating its great potential in applications.

[0003] Collaborative Representation-based Classification (CRC) abandons the l1-norm constraint commonly used in sparse representation classification and instead regularizes the representation coefficients using the l2-norm. This simplifies the complex and difficult sparsity problem into a tractable least-squares problem, significantly reducing computational complexity. While maintaining comparable classification accuracy to SRC, the CRC method offers significant advantages in computational speed and resource consumption.

[0004] Neither SRC nor CRC considers the possibility of negative values ​​in the representation coefficients. These methods are essentially based on the assumption that similar samples are positively correlated, while dissimilar samples are negatively correlated. However, this simple addition and subtraction explanation, while mathematically feasible, does not conform to the actual physical world. The nonnegative representation-based classification (NRC) method imposes a non-negative constraint on the representation coefficients, ensuring that dissimilar samples do not have any correlation, not just a negative correlation. Extensive experiments have shown that NRC significantly improves model performance.

[0005] While NRC demonstrates impressive performance, it still overlooks some key information. Traditional non-negative representation methods only impose a global non-negative constraint on the representation coefficients, without penalizing the degree of differentiation between the coefficients of different categories. In reality, competitive representations between different categories can positively complement the overall collaborative representation, which, to some extent, limits the performance of non-negative representations in classification tasks. Summary of the Invention

[0006] In order to solve the above technical problems, the present invention provides an image classification method based on dual flexible competitive non-negative representation, comprising the following steps:

[0007] S1. Obtain a test sample and a training sample set of C categories and n samples;

[0008] S2, perform l2 norm normalization on the samples in the training sample set;

[0009] S3. Using the alternating direction multiplier method, the representation coefficient of the test sample on the training sample set is obtained by solving the objective function of the dual flexible competitive non-negative representation classifier;

[0010] S4, calculating the residual of the test sample in each category of the training sample set;

[0011] S5. Classification is performed based on the residuals, and the test sample is identified as the category corresponding to the minimum residual.

[0012] The technical solution further defined in the present invention is:

[0013] Furthermore, in step S1, the training sample set is expressed as:

[0014]

[0015] in, n i is the training sample X of the i-th category i C is the total number of sample categories, n is the total number of training samples, and m is the feature dimension of each sample.

[0016] As described above, in the image classification method of dual flexible competitive non-negative representation, in step S3, the objective function of the dual flexible competitive non-negative representation classifier is:

[0017]

[0018] Among them, the first term is the collaborative representation term, the second term is the mean competition term, and the third term is the inter-class competition term; λ1 and λ2 represent the regularization parameters of the two competition representation terms, respectively, and control the importance of the two terms; mi is the mean of the training samples of the i-th class; F1 = [f 11 , f12 ,…,f 1C ],F2=[f 21 , f 22 ,…,f 2C ] are the flexibility factors of mean competition item and inter-class competition item respectively.

[0019] As described above, in the image classification method of dual flexible competitive non-negative representation, in step S3, the dual flexible competitive non-negative representation is a non-negative least squares problem. The variable splitting method is used to solve the representation coefficient. By introducing the auxiliary variable z, the dual flexible competitive non-negative representation problem is rewritten as follows:

[0020]

[0021] The above formula is iteratively solved by the alternating direction multiplier method, and its augmented Lagrangian function is:

[0022]

[0023] Among them, δ and μ are the Lagrange multiplier and penalty coefficient respectively, and μ is used to control the severity of punishment.

[0024] As described above, in the image classification method of dual flexible competitive non-negative representation, in step S3, the optimal solution of the dual flexible competitive non-negative representation problem is obtained by continuously iteratively solving the sub-problems of the augmented Lagrangian function with respect to the variables α, z, F1, F2, and δ. Specifically, the method includes the following sub-steps:

[0025] S3.1. Update the variable α and obtain the analytical solution of α;

[0026] S3.2. Update variables F1 and F2 and obtain their analytical solutions;

[0027] S3.3. Update the variable z and obtain the analytical solution of z;

[0028] S3.4, update the variable δ;

[0029] S3.5. Repeat steps S3.1 to S3.4 until the convergence condition is met or the number of iterations exceeds a preset threshold T.

[0030] As described above, in the image classification method of dual flexible competitive non-negative representation, in step S3.1, z, F1, F2 and δ are fixed and α is updated:

[0031]

[0032] Introducing the matrix H i=diag(0,...,1,...,1,...,0), where the element of the i-th category is 1 and the rest of the elements are 0; therefore, in the original problem, Convert the above formula into the following formula:

[0033]

[0034] Taking the partial derivative of the objective function of this problem with respect to α and setting it to zero, we get:

[0035]

[0036] After finishing, we can get:

[0037]

[0038] Therefore, the analytical solution of α is:

[0039]

[0040] Where P is in the form of:

[0041]

[0042] As described above, in the image classification method of dual flexible competitive non-negative representation, in step S3.2, α, z, and δ are fixed and F1 and F2 are updated:

[0043]

[0044] The objective function of this problem is respectively 1i Taking the partial derivative and setting it to zero, we get:

[0045]

[0046] Therefore, we get f 1i The analytical solution is:

[0047] f 1i =m i -XH i α

[0048] Get f 2j The analytical solution is:

[0049] f 2j =Xα-XH j α.

[0050] As described above, in the image classification method of dual flexible competitive non-negative representation, in step S3.3, α, F1, F2 and δ are fixed and z is updated:

[0051]

[0052] The analytical solution of z is:

[0053]

[0054] In step S3.4, update δ:

[0055] δ=δ+μ(z-α).

[0056] As described above, in the image classification method of dual flexible competitive non-negative representation, in step S3.5, the convergence condition is: simultaneously satisfying ||α t -z t ||2≤η,||α t+1 -α t ||2≤η and ||z t+1 -z t ||2≤η, where η is the preset threshold, t i represents the i-th iteration.

[0057] As described above, in the image classification method of dual flexible competitive non-negative representation, in step S4, the residual of the test sample in each category of the training sample set is calculated as:

[0058] r i =||yX i α i ||2

[0059] In step 5, classification is performed based on the residuals, and the test sample is identified as the category corresponding to the minimum residual:

[0060]

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

[0062] (1) In this invention, based on NRC, mean competition and inter-class competition are introduced to enhance the discriminability of representation vectors;

[0063] (2) In this invention, a flexible factor is cleverly introduced into the two competition items, which no longer requires samples of the wrong category to participate in the competition. This significantly reduces the weight of the representation coefficient of the wrong category, reducing their interference in the classification decision, thereby improving the classification performance overall.

[0064] (3) In this invention, the ADMM algorithm is used for efficient solution, and a large number of experiments are carried out on three public face recognition benchmark datasets. The results are better than many current mainstream representation and classification methods. BRIEF DESCRIPTION OF THE DRAWINGS

[0065] Figure 1 Schematic diagram of the DFCNR image classification method according to an embodiment of the present invention;

[0066] Figure 2 It is a schematic diagram of the overall process of the present invention;

[0067] Figure 3 is a representative schematic diagram of an AR dataset in an embodiment of the present invention;

[0068] Figure 4 is a representative schematic diagram of the Extended Yale B dataset in an embodiment of the present invention;

[0069] Figure 5 Schematic diagram of a representative GT dataset in an embodiment of the present invention. DETAILED DESCRIPTION

[0070] This embodiment provides a dual flexible competitive nonnegative representation (DFCNR) image classification method, such as Figure 1 As shown in Figure 2, the representation classification method can be mainly divided into two stages: the representation stage and the classification stage; the representation coefficient is obtained in the representation stage, and the label of the test sample is determined by the representation coefficient in the classification stage.

[0071] In the representation stage, DFCNR introduces mean competition and inter-class competition flexibility factors into NRC, and solves the representation coefficient of the test sample with respect to the training sample through the alternating direction method of multipliers (ADMM) algorithm.

[0072] In the classification stage, the test sample is reconstructed by combining the representation coefficients with the training samples of each category to obtain C reconstruction residuals; finally, by comparing the sizes of the reconstruction residuals, the predicted label of the test sample is determined to be the category with the smallest reconstruction residual.

[0073] This embodiment provides a dual flexible competitive non-negative representation image classification method, such as Figure 2 As shown, the following steps are included:

[0074] S1. Obtain a test sample and a training sample set of C categories and n samples; the training sample set is expressed as:

[0075]

[0076] in, n i is the training sample X of the i-th category i C is the total number of sample categories, n is the total number of training samples, and m is the feature dimension of each sample.

[0077] S2. Perform l2 norm normalization on the samples in the training sample set.

[0078] S3. Use the alternating direction multiplier method to obtain the representation coefficient of the test sample on the training sample set by solving the objective function of DFCNR; the objective function of DFCNR is:

[0079]

[0080] Among them, the first term is the collaborative representation term, the second term is the mean competition term, and the third term is the inter-class competition term; λ1 and λ2 represent the regularization parameters of the two competition representation terms, respectively, and control the importance of the two terms; mi is the mean of the training samples of the i-th class; F1 = [f 11 , f 12 ,…,f 1C ],F2=[f 21 , f 22 ,…,f 2C ] are the flexibility factors of mean competition item and inter-class competition item respectively.

[0081] DFCNR is a non-negative least squares problem, which requires the variable splitting method to solve the representation coefficient. By introducing the auxiliary variable z, the DFCNR problem can be rewritten as follows:

[0082]

[0083] The above formula is iteratively solved by the alternating direction multiplier method, and its augmented Lagrangian function is:

[0084]

[0085] Among them, δ and μ are the Lagrange multiplier and penalty coefficient respectively, and μ is used to control the severity of punishment.

[0086] By continuously iteratively solving the subproblems of the augmented Lagrangian function with respect to the variables α, z, F1, F2, and δ, the optimal solution to the double-flexible competition non-negative representation problem is obtained. Specifically, the following sub-steps are included:

[0087] S3.1. Fix z, F1, F2, and δ, and update α:

[0088]

[0089] Introducing the matrix H i =diag(0,...,1,...,1,...,0), where the element of the i-th category is 1 and the rest of the elements are 0; therefore, in the original problem, Convert the above formula into the following formula:

[0090]

[0091] Taking the partial derivative of the objective function of this problem with respect to α and setting it to zero, we get:

[0092]

[0093] After finishing, we can get:

[0094]

[0095] Therefore, the analytical solution of α is:

[0096]

[0097] Where P is in the form of:

[0098]

[0099] S3.2, fix α, z and δ, update F1 and F2:

[0100]

[0101] The objective function of this problem is respectively 1i Taking the partial derivative and setting it to zero, we get:

[0102]

[0103] Therefore, we get f 1i The analytical solution is:

[0104] f 1i =m i -XH i α

[0105] Get f 2j The analytical solution is:

[0106] f 2j =Xα-XH j α.

[0107] S3.3. Fix α, F1, F2 and δ and update z:

[0108]

[0109] The analytical solution of z is:

[0110]

[0111] S3.4. Update variable δ:

[0112] δ=δ+μ(z-α)

[0113] S3.5, repeat iterative steps S3.1 to S3.4 until the convergence condition is met or the number of iterations exceeds the preset threshold T; the ADMM convergence condition is: simultaneously meet ||α t -z t ||2≤η,||α t+1 -α t ||2≤η and ||z t+1 -z t ||2≤η, where η is the preset threshold, t i represents the i-th iteration.

[0114] S4. Calculate the residual of the test sample in each category of the training sample set:

[0115] r i =||yX i α i ||2.

[0116] S5. Classify based on the residuals. The test sample is identified as the category corresponding to the minimum residual:

[0117]

[0118] Example 1:

[0119] like Figure 3 As shown in the figure, the AR dataset, as a landmark dataset in the field of face recognition, covers more than 4,000 images of more than 126 individuals, each of which captures unique facial expressions and lighting conditions. 50 men and 50 women were selected from the AR dataset, with 14 images per person, for training and testing. The first 7 images of each person were used as training samples to train the face recognition model; and the remaining 7 images were used as test samples to evaluate the performance of the model.

[0120] All images were cropped to a uniform size of 60×34 pixels and normalized using the l2 norm. Furthermore, the PCA method was used to reduce the image data to 54, 120, and 300 dimensions, respectively. Table 1 below compares the classification performance of the method in this embodiment with that of other methods on the AR dataset.

[0121] Table 1

[0122]

[0123] As can be clearly seen in Table 1 above, the DFCNR method demonstrates excellent classification performance. In 54 dimensions, DFCNR surpasses NRC by 0.1% and DRC by 4.8%. In 120 dimensions, DFCNR's classification accuracy is on par with NRC, but still surpasses DRC by 1.2%. Notably, in 300 dimensions, DFCNR achieves an accuracy of 94.7%, significantly exceeding the 93.3% accuracy achieved by NRC and surpassing DRC by 0.9%.

[0124] Example 2:

[0125] like Figure 4 As shown in the figure, the Extended Yale B dataset, a classic dataset in the field of face recognition, contains facial images of 38 different individuals. These images were taken under diverse expressions and complex lighting conditions, totaling 2414 grayscale images, each with a resolution of 192×168 pixels. 32 images of each individual were set as the training set for building and optimizing the face recognition model; the remaining images were used as the test set for objectively evaluating the recognition performance of the model.

[0126] All images were cropped to a uniform size of 54×48 pixels and normalized using the l2 norm. Furthermore, PCA was used to reduce the image data to 84, 150, and 300 dimensions, respectively. Table 2 below compares the classification performance of this embodiment's method with other methods on the Extended Yale B dataset.

[0127] Table 2

[0128]

[0129] As shown in Table 2 above, DFCNR achieves the highest classification accuracy in all dimensions, surpassing NRC by 0.4% in 84 dimensions, 0.6% in 150 dimensions, and 0.7% in 300 dimensions. These experimental results strongly demonstrate that the DFCNR method exhibits excellent face recognition performance on the Extended Yale B face dataset.

[0130] Example 3:

[0131] like Figure 5 As shown in Figure 2, GT is a very challenging dataset in the field of face recognition. The dataset contains 750 face images from 50 different people, with an average of 15 images per person. These images show rich diversity in facial expressions, backgrounds, and lighting conditions.

[0132] The first eight images of each person were selected as training samples, and the remaining images were used as test samples. In addition, all images were downsampled to a resolution of 32×32 pixels and normalized using the l2 norm. Table 3 below compares the classification performance of the method of this embodiment with that of other methods on the GT dataset.

[0133] Table 3

[0134]

[0135] It can be clearly observed from Table 3 above that DFCNR achieved the same classification accuracy as DRC and surpassed NRC by 0.3%. By testing on three extremely challenging face datasets, DFCNR demonstrated excellent classification performance.

[0136] Based on non-negative representation, the method of this embodiment significantly improves the representation ability of the model by introducing mean competition and inter-class competition. Mean competition uses the mean of the training samples of each category as the competition target, which enables the representation coefficient to accurately capture the unique characteristics of each category and enhances the discrimination between representation vectors. Inter-class competition fully considers the intrinsic connection between the overall representation and the category representation, strengthens the competitive representation between the correct category and other categories, and helps to improve the classification accuracy. In addition, a flexible factor is introduced in the two competition items. Training samples of the wrong category are no longer forced to participate in the competition, which significantly reduces the weight of the representation coefficient of the category, reducing their interference in classification decisions, thereby improving the overall classification performance of the model.

[0137] In addition to the above embodiments, the present invention may also have other implementations. Any technical solution formed by equivalent replacement or equivalent transformation falls within the protection scope of the present invention.

Claims

1. A dual flexible competitive non-negative representation image classification method, characterized by: The following steps are involved: S1. Obtain a test sample and a training sample set of C categories and n samples; S2, perform l2 norm normalization on the samples in the training sample set; S3. Using the alternating direction multiplier method, the representation coefficient of the test sample on the training sample set is obtained by solving the objective function of the dual flexible competitive non-negative representation classifier; S4, calculating the residual of the test sample in each category of the training sample set; S5. Classification is performed based on the residuals, and the test sample is identified as the category corresponding to the minimum residual.

2. The image classification method based on dual flexible competitive non-negative representation according to claim 1, characterized in that: In step S1, the training sample set is represented as: in, n i is the training sample X of the i-th category i C is the total number of sample categories, n is the total number of training samples, and m is the feature dimension of each sample.

3. The image classification method based on dual flexible competitive non-negative representation according to claim 1, characterized in that: In step S3, the objective function of the dual flexible competitive non-negative representation classifier is: Among them, the first term is the collaborative representation term, the second term is the mean competition term, and the third term is the inter-class competition term; λ1 and λ2 represent the regularization parameters of the two competition representation terms, respectively, controlling the importance of the two terms; m i is the mean of the training samples of the i-th category; F1=[f 11 , f 12 ,…,f 1C ],F2=[f 21 , f 22 ,…,f 2C ] are the flexibility factors of mean competition item and inter-class competition item respectively.

4. The image classification method based on dual flexible competitive non-negative representation according to claim 3, characterized in that: In step S3, the dual-flexible competitive non-negative representation is a non-negative least squares problem. The variable splitting method is used to solve the representation coefficient. By introducing the auxiliary variable z, the dual-flexible competitive non-negative representation problem is rewritten as follows: The above formula is iteratively solved by the alternating direction multiplier method, and its augmented Lagrangian function is: Among them, δ and μ are the Lagrange multiplier and penalty coefficient respectively, and μ is used to control the severity of punishment.

5. The image classification method based on dual flexible competitive non-negative representation according to claim 4, characterized in that: In step S3, the optimal solution to the dual flexible competition non-negative representation problem is obtained by continuously iteratively solving the sub-problems of the augmented Lagrangian function with respect to the variables α, z, F1, F2, and δ, which specifically includes the following sub-steps: S3.

1. Update the variable α and obtain the analytical solution of α; S3.

2. Update variables F1 and F2 and obtain their analytical solutions; S3.

3. Update the variable z and obtain the analytical solution of z; S3.4, update the variable δ; S3.

5. Repeat iterative steps S3.1 to S3.4 until the convergence condition is met or the number of iterations exceeds a preset threshold T.

6. The image classification method based on dual flexible competitive non-negative representation according to claim 5, characterized in that: In step S3.1, z, F1, F2 and δ are fixed, and α is updated: Introducing the matrix H i =diag(0,...,1,...,1,...,0), where the element of the i-th category is 1 and the rest of the elements are 0; therefore, in the original problem, Convert the above formula into the following formula: Taking the partial derivative of the objective function of this problem with respect to α and setting it to zero, we get: After finishing, we can get: Therefore, the analytical solution of α is: Where P is in the form of:

7. The image classification method based on dual flexible competitive non-negative representation according to claim 6, characterized in that: In step S3.2, α, z and δ are fixed, and F1 and F2 are updated: The objective function of this problem is respectively 1i Taking the partial derivative and setting it to zero, we get: Therefore, we get f 1i The analytical solution is: f 1i =m i -XH i α Get f 2j The analytical solution is: f 2j =Xα-XH j a.

8. The image classification method based on dual flexible competitive non-negative representation according to claim 7, characterized in that: In step S3.3, α, F1, F2 and δ are fixed and z is updated: The analytical solution of z is: In step S3.4, update δ: δ=δ+μ(z-α).

9. The image classification method based on dual flexible competitive non-negative representation according to claim 8, characterized in that: In step S3.5, the convergence condition is: satisfying ||α t -z t ||2≤η,||α t+1 -α t ||2≤η and ||z t+1 -z t ||2≤η, where η is the preset threshold, t i represents the i-th iteration.

10. The image classification method based on dual flexible competitive non-negative representation according to claim 1, characterized in that: In step S4, the residual of the test sample in each category of the training sample set is calculated as: r i =||yX i a i ||2 In step 5, classification is performed based on the residuals, and the test sample is identified as the category corresponding to the minimum residual: