Image classification method based on adaptive regularization dictionary learning

Through the adaptive regularized dictionary learning method, combined with the classification loss function of the support vector machine, dictionary learning in image classification is optimized, which solves the problem of insufficient distinction ability in the existing technology, improves classification accuracy and generalization ability, and optimizes the Computational efficiency.

CN119169375APending Publication Date: 2024-12-20YANGZHOU UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411314623.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-20
Publication Date
2024-12-20

AI Technical Summary

Technical Problem

The prior art is difficult to effectively distinguish the characteristics of target categories and non-target categories in image classification, resulting in insufficient classification accuracy and lack of direct correlation between the label consistency terms and classification matrix during training, limiting discriminant power.

Method used

Adaptive regularization dictionary learning method is adopted to reduce the activity of non-target class atoms through basic penalties and additional penalties, and combine the classification loss function of the support vector machine to optimize the weight parameters of the encoding coefficients to promote the aggregation of similar coefficient vectors. .

Benefits of technology

It improves the accuracy and generalization ability of image classification, reduces misclassification, enhances the adaptability and robustness of the model, and optimizes the computing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119169375A_ABST
    Figure CN119169375A_ABST
Patent Text Reader

Abstract

The invention discloses an image classification method based on adaptive regularization dictionary learning in the technical field of image processing, and the method comprises the steps: initializing a dictionary, a weight constraint matrix, sample coding and SVM parameters, constructing a coding optimization model containing an adaptive coding penalty term and an SVM guide term, and forming a new data feature matrix and dictionary through employing the terms; sparse coding is completed by using a block orthogonal matching pursuit algorithm, and a dictionary is optimized to improve classification accuracy; performing classification according to the codes of the test samples in combination with an SVM (Support Vector Machine) classifier; according to the method, an adaptive regularization item and an SVM guide learning item are introduced, and a unified objective function is formed in combination with reconstruction errors; under the constraint condition, different coefficients are endowed with different degrees of freedom, and key parameter information in the SVM is effectively utilized to guide discriminative dictionary learning, so that the discriminability of the dictionary and the generalization ability of the model are enhanced, different types of coding coefficient matrixes have higher discrimination, and the accuracy of image classification is 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 processing, and in particular to a discriminative dictionary representation learning method. Background Art

[0002] Sparse representation has shown its strong application potential in many signal processing fields, including the latest applications such as compressed sensing, signal denoising, image restoration, and signal classification.

[0003] In classification tasks, most existing dictionary learning methods aim to learn discriminative class-specific dictionaries by imposing block diagonal constraints on the coefficient matrix X or promoting incoherence of the inter-class dictionary. Jiang et al. associate label information with each dictionary item (column of the dictionary matrix) to enforce discriminability in sparse codes during dictionary learning. Yang et al. proposed a structured dictionary learning method using the Fisher discriminant criterion to constrain the encoding coefficient vectors to reduce the intra-class scattering of the same coefficient vectors and increase the inter-class scattering, thereby optimizing the classification effect. In FDDL, the weight of the discriminant term is mainly determined by the number of samples in each class. In contrast, Wang et al. proposed a parameterization technique that allows the model to adaptively adjust the weight of each pair of encoding vectors to enhance the generalization ability of pattern recognition tasks. Kong et al. pointed out that although objects in images have class-specific features, objects of different categories often share some common patterns that do not contribute much to distinguishing between categories. Based on this, they proposed a new method for explicitly learning a shared dictionary and multiple class-specific dictionaries. Furthermore, Yu et al. used a shared and specific dictionary approach similar to that described in DL-COPAR, but they emphasized that the subspace constituted by the shared dictionary should have a lower rank, and thus imposed a low-rank constraint on the shared dictionary, aiming to reduce the possibility of class-specific features being covered by the shared dictionary.

[0004] Whether it is the Fisher criterion or the distinction between shared dictionaries and class-specific dictionaries, the purpose is to achieve the ideal state of sparse coding, or to suppress the value of sample encoding on atoms of other classes of dictionaries. In order to reduce the influence of similar features in samples of different classes on the learning of discriminative dictionaries, in addition to the method described in DL-COPAR, the l0 norm constraint encoding coefficient can also be used, because in order to ensure sparsity, it does not use all atoms in the dictionary, but uses a greedy algorithm to select more suitable atoms according to the contribution of the overall features of atoms to reconstruction during the encoding process, which means that it can effectively reduce the influence of similar features in different classes, thereby making the learned dictionary more discriminative. Although the LC-KSVD model uses the l0 norm constraint to encourage sample encoding to mainly select atoms of related classes, this method does not directly punish the encoding activities of samples on atoms of other classes. In addition, there is a lack of direct connection between the label consistency term in the model and the classification matrix during training, which may limit its discriminative power in complex scenarios. Summary of the invention

[0005] In view of the shortcomings in the prior art, the present invention provides an image classification method based on adaptive regularized dictionary learning, which solves the shortcomings in the background technology; the adaptive regularization is divided into two parts: a basic penalty term and an additional penalty term; the basic penalty term is calculated based on the coding coefficient matrix of the previous round of iteration, which can cooperate with the classification loss function to better guide the dictionary learning process; and the additional penalty term adds additional constraints to atoms of non-target categories to reduce the activity of these atoms in coding; the present invention also integrates the classification loss function of the support vector machine (SVM) into the objective function, so that the coding coefficients are closer in the weight parameters of the corresponding categories, thereby promoting the clustering effect of similar coefficient vectors.

[0006] The object of the present invention is achieved by: an image classification method based on adaptive regularized dictionary learning, comprising the following steps:

[0007] Step 1) Divide the data set, extract features from the image, and complete the division of the training set and the test set according to the set ratio;

[0008] Step 2) Setting the dictionary learning objective function;

[0009] Step 3) Data initialization: including: data preprocessing, dictionary initialization, label consistency constraint matrix initialization, sample encoding initialization, SVM classification parameter initialization;

[0010] Step 4) sparse coding; according to the objective function set in step 2), the dictionary model is constructed and optimized through the sample matrix and sample coding; at the same time, the SVM parameters are updated according to the preset update conditions;

[0011] Step 5) Dictionary optimization and SVM update: construct an optimized dictionary model according to the objective function set in step 2), and complete dictionary optimization according to the sample matrix and sample encoding; complete SVM parameter optimization according to the set update conditions;

[0012] Step 6) Test sample classification: The dictionary D obtained through training is used to encode the test sample using the BOMP algorithm to obtain the sample encoding vector x, and then the values ​​of various parameters of the encoding vector x in the SVM and the reconstruction errors on various atoms of the dictionary are combined to obtain the scores of the test sample encoding in all categories. According to the size of the score, the category with the highest score is the final predicted image category.

[0013] Furthermore, the dictionary learning objective function in step 2) is:

[0014]

[0015] in, To reconstruct the error term, a linear combination of the basic elements in the dictionary is used to reconstruct the original data; the data set is represented as X = [X1, X2, ..., X C ]=[x1,x2,...,x n ], C is the total number of sample categories, x i is the i-th training sample, X i is the set of data vectors of all categories i. D=[D1,D2,...,D C ]=[d1,d2,...,d K ]∈R m×K (K>n) is a dictionary, d i is the i-th atom in the dictionary, D i is a dictionary consisting of atoms of the i-th type, and K is the number of atoms in the dictionary. C ]=[z1,z2,...,z n ] is the coding coefficient matrix linearly represented by the basic elements, z i is the sparse coding vector of the i-th sample, and each row in Z corresponds to each column in the dictionary; j It can be written as in The length of the dictionary D i The number of atoms in the is the square of the norm of the matrix F;

[0016] is an adaptive regularization term, which imposes different degrees of penalty constraints on the encoding coefficients according to the sample category and dictionary atom category. Is for The coefficients in are assigned different degrees of freedom. In the previous round, Zi The larger the sum of the coefficients in the rth row, the stronger the constraint on the coefficients in the next round. is the coefficient encoding of the i-th sample in the previous round, mean() is the average value, and abs() is the absolute value; Q∈R K×C ,Q={q1,q2,...,q C} is an additional penalty constraint matrix, which is defined by additional restriction coefficient vector Both i and j represent categories, and i is not equal to j, so that it tends to 0, minimizing the reconstruction error When , thus making Smaller; in q i In the middle, corresponding to b i to b i +n i Position is 0, where b i is the starting position of the i-th type atom in the dictionary, n i is the number of atoms of type i, and the remaining positions are additional constraint values ​​a; ⊙ is the multiplication of the values ​​of the corresponding positions of the vectors, Can be converted into the following form: Where diag(l) creates a diagonal matrix, the elements on the main diagonal are the values ​​of vector l, and the rest of the elements are 0. λ1 is a weight parameter, the larger the λ1, the greater the penalty for the coefficients in the encoding vector;

[0017] is the SVM guide item, the purpose is to guide the learning of the discriminative dictionary; where n i is the number of data sets of the i-th category, w∈R K×c , b∈R c are the weight parameters and offset terms obtained by training SVM on the sparse coding coefficient matrix in a one-to-many manner, m i Z i In the parameter w i and b i The average value on; λ2 is a weight parameter. The larger λ2 is, the more the objective function focuses on the fitting of the SVM guide term.

[0018] Furthermore, the data processing in step 3) specifically includes:

[0019] Step 3-1) Data preprocessing: Dimensionality reduction and normalization of training samples;

[0020] Step 3-2) Dictionary initialization: The atoms in the dictionary come from the training set. The number of samples in each category is selected to enter the dictionary, and the corresponding number of samples from each category of data are selected and put into the dictionary;

[0021] Step 3-3) Initialize the label consistency constraint matrix Q: Q∈R K×C , where C is the number of sample categories, a is the additional constraint value, and the specific form of Q is given in the manual;

[0022] Step 3-4) Sample encoding initialization: Based on the training sample and the initialized dictionary, the sample encoding is initialized using the BOMP algorithm;

[0023] Step 3-5) Initialization of SVM classification parameters: Based on the initialized encoding, the LBFGS algorithm is used to solve the following objective function:

[0024]

[0025]

[0026] w k is the kth type bias parameter, C is a constant, z i is the i-th sparse coding vector, When z i Belongs to the kth category, otherwise

[0027] Furthermore, the steps of solving the above objective function by the LBFGS algorithm in step 3-5) are as follows:

[0028] Step 3-5-1) Initialize the weight parameter w k , select the parameters of LBFGS;

[0029] Step 3-5-2) Calculate the value and gradient of the objective function and calculate the current w k The objective function value J(w k ), calculate the gradient of the objective function

[0030] Step 3-5-3) Update direction, using historical gradient information to calculate the update direction;

[0031] Step 3-5-4) Line search: perform a line search in the update direction to determine the optimal step size;

[0032] Step 3-5-5) Update variables, update w k Value: w k+1 =w k +α·p k , where α is the step size determined by the line search, p k is the search direction;

[0033] Step 3-5-6) Update historical information, update historical gradient and position change information required by L-BFGS;

[0034] Step 3-5-7) Check convergence and whether the stopping criteria are met.

[0035] Further, step 4) specifically includes: according to the objective function described in step 2) and the sparse coding optimization solution provided in LC-KSVD, the following dictionary model is obtained:

[0036]

[0037] Among them, O∈R K×ni is a zero matrix, p=(m i -b i )*ones(1,n i ), ones(1,n i ) is used to generate a dimension of n i A vector whose values ​​are all 1, Other At this point, optimizing the above formula is equivalent to solving the following problem: To solve this problem, the BOMP algorithm in initialization is also used to complete sparse coding.

[0038] Further, step 5) specifically includes:

[0039] Step 5-1) Dictionary update;

[0040] Remove the irrelevant items in the model and the dictionary update model is as follows:

[0041]

[0042] The optimal dictionary D = (XZ T )(ZZ T +λI) -1 .

[0043] Step 5-2) SVM parameter update;

[0044] The degree of dictionary fit is evaluated by monitoring the change range of the coding coefficient matrix. When the change range tends to be stable, the SVM parameters are updated.

[0045] Furthermore, the objective function for obtaining the test sample encoding in step 6) is as follows:

[0046]

[0047] Where Y is the test sample, D is the dictionary obtained in step 5-1, and Z is the sparse coding vector of the test sample;

[0048] The above objective function is transformed using the coding model in step 4), and then the BOM algorithm is used to obtain sample sparse coding. The transformed objective function is as follows:

[0049]

[0050] Where E is the K-order unit matrix;

[0051] The specific scoring formula in step 6) is as follows:

[0052]

[0053] where z i Represents the encoding z and the dictionary subset D i The corresponding part (the code z is divided into categories, which can be divided into the following forms: z = [z 1 ,z 2 ,...,z c ]), ω is a weight coefficient. The larger ω is, the more attention is paid to the reconstruction error. For any test sample, it will have a score in each category, and the category with the highest score is selected as the final prediction result.

[0054] Compared with the prior art, the present invention has the following beneficial effects:

[0055] 1. Enhanced classification accuracy:

[0056] Through adaptive regularization technology, this method can effectively distinguish the characteristics of target and non-target categories and reduce the possibility of misclassification. The classification loss function of the integrated support vector machine (SVM) optimizes the intra-class aggregation and inter-class separation, further improving the accuracy of classification.

[0057] 2. Enhanced generalization ability:

[0058] The additional penalty term helps the model reduce overfitting when facing unknown samples and enhances the model's adaptability and robustness to new data. The adaptive adjustment mechanism in the dictionary learning process enables the model to automatically adjust the weights of dictionary atoms to adapt to classification needs in various complex environments.

[0059] 3. Optimized computing efficiency:

[0060] The adaptive regularization strategy optimizes the use of computing resources and improves processing speed by reducing unnecessary feature calculations. The more efficient BOMP algorithm is used to optimize the encoding, which uses a pre-computation step to speed up the selection of dictionary atoms and uses Choleskey to speed up the inversion operation in the encoding, thereby reducing the memory and computing burden during encoding optimization. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0062] Figure 1 It is a flow chart of the present invention.

[0063] Figure 2 is the additional constraint value a in the present invention impact.

[0064] Figure 3 It is the impact of different parameters on the accuracy of the model. DETAILED DESCRIPTION

[0065] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0066] like Figure 1 An image classification method based on adaptive regularized dictionary learning is shown, comprising the following steps:

[0067] Step 1) Divide the dataset.

[0068] Select an appropriate ratio of training set to test set, randomly extract a corresponding number of samples from the data set as the training set, and the rest as the test set. When selecting face data samples, images with different lighting conditions and expressions should be selected as the training set.

[0069] If the feature dimension of the sample is too large, the principal component analysis method can be used to extract the more important parts of the features and replace the original high-dimensional features with them. The data after dimensionality reduction is normalized to facilitate the subsequent steps.

[0070] Step 2) Set the dictionary learning objective function:

[0071]

[0072] To reconstruct the error term, a linear combination of the basic elements in the dictionary is used to reconstruct the original data. The data set is represented as X = [X1, X2, ..., X C ]=[x1,x2,...,x n], where x i is the i-th training sample, X i is the set of data vectors of all categories i; X i represents the set of data vectors of all categories i; D = [D1, D2, ..., D C ]=[d1,d2,...,d K ]∈R m×K (K>n) is a dictionary, d i is the i-th atom in the dictionary, D i is the dictionary composed of atoms of the i-th category, C is the total number of sample categories, K is the number of atoms in the dictionary, Z = [Z1, Z2, ..., Z C ]=[z1,z2,...,z n ] is the coding coefficient matrix linearly represented by the basic elements, z i is the sparse coding vector of the i-th sample, and each row in Z corresponds to each column in the dictionary. Because atoms have label information, z j It can also be written as in The length of the dictionary D i The number of atoms in the is the square of the norm of the matrix F.

[0073] is an adaptive regularization term, which imposes different degrees of penalty constraints on the coding coefficients according to the sample category and dictionary atom category, while avoiding trivial solutions and reducing the value of the code on other types of atoms, so that the code tends to the ideal state expected by the present invention. Is for The coefficients in are assigned different degrees of freedom. In the previous round, Z i The larger the sum of the coefficients in the rth row, the stronger the constraint on the coefficients in the next round, thus adaptively adjusting the regularization term, where is the coefficient encoding of the i-th sample in the previous round, mean() is the average value, and abs() is its absolute value (the present invention takes the absolute value of the coefficient in Z as its contribution to the reconstruction of feature x, so the absolute value is taken). Q∈R K×C ,Q={q1,q2,...,q C} is an additional penalty constraint matrix, which is defined by additional restriction coefficient vector (i and j both represent categories, and i is not equal to j), so that it tends to 0, minimizing the reconstruction error When , thus making Smaller. i In the middle, corresponding to b i to b i+n i Position is 0, where b i is the starting position of the i-th type atom in the dictionary, n i is the number of atoms in the i-th type, and the remaining positions are additional constraint values ​​a. The specific form of Q is given in step 3. The impact of Figure 2 ⊙ is the multiplication of the values ​​at the corresponding positions of the vectors. According to the knowledge of matrix multiplication, the second term can be transformed into the following form:

[0074]

[0075] Where diag(l) creates a diagonal matrix with the elements on the main diagonal being the values ​​of vector l and the rest being 0.

[0076] is the SVM guide item, which aims to guide the learning of the discriminative dictionary. i is the number of data sets of the i-th category, w∈R K×c , b∈R c are the weight parameters and offset terms obtained by training SVM on the sparse coding coefficient matrix in a one-to-many manner, m i Z i In the parameter w i and b i The average value on the i This is to better balance the reconstruction error term and the SVM guided term; λ2 is a weight parameter. The larger λ2 is, the more the objective function focuses on the fitting of the SVM guided term.

[0077] Step 3) Data initialization.

[0078] Step 3-1) Data preprocessing: Perform dimensionality reduction and normalization on the training samples.

[0079] Step 3-2) Dictionary initialization: The atoms in the dictionary come from the data set. The number of samples in each category is selected to enter the dictionary. The corresponding number of samples from each category of data is selected and put into the dictionary. The sample selection method is as follows:

[0080] ① Calculate the center point of each category based on the label information of the sample.

[0081] ② The present invention defines that the sample with a smaller Euclidean distance to the center point is an excellent sample, and conversely, the sample with a larger Euclidean distance to the center point is a poor sample.

[0082] ③ Select an appropriate ratio of good and bad samples. The ratio used in this invention is 2:1. According to the Euclidean distance obtained in step ②, select the specified sample and put it into the dictionary. The initialized dictionary D∈R m×K, where m is the dimension of the sample, K is the size of the dictionary, each column is an atom, and each atom corresponds to a certain category of the sample.

[0083] Step 3-3) Initialize the label consistency constraint matrix Q: Q∈R K×C , where C is the number of sample categories and a is the additional constraint value. Here, it is assumed that there are 4 types of atoms, each with 2 atoms. The form of Q is as follows:

[0084]

[0085] Step 3-4) Sample encoding initialization: Based on the training samples and the initialized dictionary, the sample encoding is initialized using the BOMP (Batch Orthogonal Matching Pursuit) algorithm.

[0086] Step 3-5) Initialization of SVM classification parameters: Based on the initialized encoding, the LBFGS (Limited-memory Broyden-Fletcher-Goldfarb-Shanno) algorithm is used to solve the following objective function:

[0087]

[0088] w k is the kth type bias parameter, C is a constant, z i is the i-th sparse coding vector, When z i Belongs to the kth category, otherwise The steps of LBFGS algorithm to solve the above objective function are as follows:

[0089] 1. Initialize the weight parameter w k (can be set to zero or a random number), select the parameters of LBFGS;

[0090] 2. Calculate the value and gradient of the objective function and calculate the current w k The objective function value J(w k ), calculate the gradient of the objective function

[0091]

[0092] 3. Update the direction, first calculate the gradient difference Δg k =g k+1 -g k and the variable difference Δx k =x k+1 -x k , where g k The gradient of the kth iteration, x kis the variable value of the kth iteration; then initialize the search direction p0 to the current negative gradient direction, and backpropagate from the records of the most recent m iterations: Where i = 1, 2, ..., m (m is the number of historical records); update direction,

[0093] 4. Line search: First, select a step size strategy, such as exact line search, Wilson line search or other common strategies to select candidate step sizes; k Calculate the objective function value on each of the above: J(w k+1 )=J(w k +α k p k ); Update the step size and use Armijo's rule (make sure the step size reduces the objective function enough) to determine the optimal step size α.

[0094] 5. Update variables, update w k Value: w k+1 =w k +α·p k , where α is the step size determined by the line search, p k is the search direction;

[0095] 6. Update historical information, update historical gradient and position change information required by L-BFGS;

[0096] 7. Check convergence and check whether the stopping criteria are met (for example, whether the norm of the gradient is small enough or the change in the objective function value is small).

[0097] Step 4) Build an optimized sparse coding model and obtain sample codes.

[0098] According to the model described in step 2), and the sparse coding scheme provided in LC-KSVD, the following coding model is obtained:

[0099]

[0100] where O∈R K×ni is a zero matrix, p=(m i -b i )*ones(1,n i )(ones(1,n i ) is used to generate a dimension of n i A vector with all 1 values), The remaining parameters have been explained in step 2 (note that the encoding in the present invention is performed according to the sample category, and the encoding of a class of samples is obtained each time using the BOMP algorithm). At this point, optimizing the above formula is equivalent to solving the following problem:

[0101]

[0102] To solve this problem, the BOMP algorithm in initialization is also used to complete sparse coding (note that in the process of matrix splicing, the regularization term is spliced ​​first, and the new atoms need to be normalized for each splicing item, in order to reduce the impact between the coefficients of different items).

[0103] Step 5) Dictionary update and SVM parameter update.

[0104] ① Dictionary update

[0105] Removing the irrelevant items in the model related to the dictionary D, the dictionary update model used in the present invention is as follows:

[0106]

[0107] Here we can use the Lagrange dual algorithm to solve:

[0108] 1. First, construct the Lagrangian function, which combines the objective function and the constraints. The Lagrangian function is Where tr(.) represents the trace of the matrix and I is the identity matrix

[0109] 2. Optimize the Lagrangian function, the gradient of D is Let the gradient be zero, we get Λ=-2(X-DZ)Z T , construct the Lagrangian dual function

[0110] 3. Using the KKT conditions and the solution steps of the dual problem, we finally get the optimal dictionary D = (XZ T )(ZZ T +λI) -1 .

[0111] ②SVM parameter update

[0112] In the LC-KSVD method, the discriminant dictionary and the classification matrix are updated together, and the goal is to make the classification matrix better fit the coefficient vector generated on the discriminant dictionary. Different from this, the purpose of SVM in the present invention is to guide the dictionary learning process. The goal of dictionary updating is to better fit the SVM parameters. By monitoring the variation range of the coding coefficient matrix, the present invention can evaluate the degree of fit of the dictionary. When the variation range tends to be stable, the SVM parameters are updated again.

[0113] Step 6) Test sample encoding and classification

[0114] The objective function for obtaining the test sample encoding is as follows:

[0115]

[0116] Where Y is the test sample, D is the dictionary obtained in step 5-1, and Z is the sparse coding vector of the test sample. To solve the above problem, first use the coding model in step 4) to transform the above objective function, and then use the BOM algorithm to obtain the sample sparse coding. The transformed objective function is as follows (where E is the K-order unit matrix):

[0117]

[0118] Wherein, E is a K-order unit matrix; the sample classification method provided by the present invention is mainly composed of SVM, class dictionary reconstruction minimum composition (the class dictionary here refers to a dictionary subset composed of atoms of a certain category, and the atoms in the dictionary can be divided into D = {D1, D2, ..., D C}). At the same time, considering the values ​​of sample encoding on various parameters in SVM and the reconstruction error encoded on each type of dictionary, the specific formula is as follows:

[0119]

[0120] where z i Represents the code i and the dictionary subset D i The corresponding part (dividing the code according to the category, z can be divided into the following forms: z = [z 1 ,z 2 ,...,z c ]), ω is a weight coefficient. The larger ω is, the more emphasis is placed on reconstruction error. For any test sample, it will have a score in each category, and the category with the highest score is selected as the final prediction result.

[0121] The present invention will be further described below in conjunction with specific implementations.

[0122] Embodiment 1:

[0123] ExtendedYaleB contains 2414 face images from 38 different people, each person’s image is taken under different lighting conditions, with a total of 64 lighting conditions (64 images per person).

[0124] The present invention is compared with other dictionary learning methods under the same experimental facilities. The compared dictionary learning methods are as follows: low-level shared dictionary learning (LRSDL), dictionary learning for distinguishing particularity and commonality (COPAR), support vector guided dictionary learning (SVGDL), and label consistent dictionary learning (LC-KSVD).

[0125] For the ExtendedYaleB dataset, this experiment randomly selected half of each category as the training set. In order to make the results more convincing, each dictionary learning method was repeated 10 times and the average value was taken as the final result.

[0126] Table 1 Classification results of different methods on the Extended_YaleB dataset

[0127]

[0128] The experimental results show that the accuracy of the present invention on the Extended YaleB dataset is significantly higher than that of the other five methods, and is 2.08% higher than that of LC-KSVD. It can be found that as the size of the dictionary increases, the accuracy will also increase. The two parameters used in the present invention in this experiment are lambda1=4 and lambda2=0.3.

[0129] Embodiment 2:

[0130] The AR database contains 4,000 face images of 126 different people. Each person's image includes 26 different angles (from front to side) and 3 different expressions (normal, smiling, sticking out tongue), as well as different lighting conditions (shadow, indoors, outdoors). The present invention uses a subset of this database, which consists of 2,600 images from 50 male subjects and 50 female subjects.

[0131] For the AR data set, this experiment randomly selects 20 pictures from each category as training sets, and the rest as test sets. The two parameters used in this experiment by the present invention are lambda1=1 and lambda2=0.5.

[0132] Table 2 Classification results of different methods on AR dataset

[0133]

[0134] From the experimental results, the present invention is superior to most dictionary learning methods. When the dictionary size is 1000, the accuracy of the present invention is 0.46% higher than that of LC-KSVD, and the gap with the best performing SVGDL is large. However, when the dictionary size is 1500 and 2000, the accuracy exceeds that of SVGDL. It can also be found that as the size of the dictionary increases, the accuracy will also increase.

[0135] Embodiment 3:

[0136] The Caltech-101 database contains 102 different object categories, each containing dozens to hundreds of images, totaling more than 9114 images. Most of these images are from daily life scenes, including various object categories such as animals, plants, food, electronic devices, etc.

[0137] For the Caltech-101 dataset, this experiment randomly selects 30 images from each category as the training set, and the rest as the test set. This experiment reduces the feature dimension of the dataset to 3000. The two parameters used in this experiment are lambda1=2 and lambda2=0.1.

[0138] Table 3 Classification results of different methods on the Caltech-101 dataset

[0139]

[0140] From the experimental results, the present invention achieves similar accuracy as the better performing methods, and is 1.88% higher than LC-KSVD. From the time point of view, although the dictionary selected by the present invention is larger, the time spent is less than that of the better performing methods.

[0141] Embodiment 4:

[0142] The Scene15 database contains 15 object categories from different scenes, each category contains 400 images, totaling 6000 images. These images represent various common scenes in daily life, such as beaches, city streets, offices, mountains, etc.

[0143] For the Scene15 dataset, this experiment randomly selects 100 images from each category as the training set, and the rest as the test set. The two parameters used in this experiment are lambda1=4 and lambda2=0.1.

[0144] Table 4 Classification results of different methods on the Scene15 dataset

[0145]

[0146] The dictionary size used in this experiment is 225. From the experimental results, the results of the present invention are better than most methods, and the accuracy rate is only 0.06% lower than that of the best performing method.

[0147] The above embodiments are only used to help understand the method and core idea of ​​the present invention. It should be noted that, for those skilled in the art, several improvements and modifications can be made to the present invention without departing from the principles of the present invention, and these improvements and modifications also fall within the scope of protection of the claims of the present invention.

Claims

1. An image classification method based on adaptive regularized dictionary learning, It is characterized in that The following steps are involved: Step 1) Divide the data set, extract features from the image, and complete the division of the training set and the test set according to the set ratio; Step 2) Setting the dictionary learning objective function; Step 3) Data initialization: including: data preprocessing, dictionary initialization, label consistency constraint matrix initialization, sample encoding initialization, SVM classification parameter initialization; Step 4) sparse coding; according to the objective function set in step 2), the dictionary model is constructed and optimized through the sample matrix and sample coding; at the same time, the SVM parameters are updated according to the preset update conditions; Step 5) Dictionary optimization and SVM update: construct an optimized dictionary model according to the objective function set in step 2), and complete dictionary optimization according to the sample matrix and sample encoding; complete SVM parameter optimization according to the set update conditions; Step 6) Test sample classification: The dictionary D obtained through training is used to encode the test sample using the BOMP algorithm to obtain the sample encoding vector x, and then the values ​​of various parameters of the encoding vector x in the SVM and the reconstruction errors on various atoms of the dictionary are combined to obtain the scores of the test sample encoding in all categories. According to the size of the score, the category with the highest score is the final predicted image category.

2. The image classification method based on adaptive regularized dictionary learning according to claim 1, It is characterized in that The dictionary learning objective function in step 2) is: in, To reconstruct the error term, a linear combination of the basic elements in the dictionary is used to reconstruct the original data; the data set is represented as X = [X 1 ,X 2 ,...,X C ]=[x 1 ,x 2 ,...,x n ], C is the total number of sample categories, x i is the i-th training sample, X i is the set of data vectors of all categories i. 1 ,D 2 ,...,D C ]=[d 1 ,d 2 ,...,d K ]∈R m×K (K>n) is a dictionary, d i is the i-th atom in the dictionary, D i is a dictionary consisting of atoms of the i-th type, and K is the number of atoms in the dictionary. 1 ,Z 2 ,...,Z C ]=[z 1 ,z 2 ,...,z n ] is the coding coefficient matrix linearly represented by the basic elements, z i is the sparse coding vector of the i-th sample, and each row in Z corresponds to each column in the dictionary; j It can be written as in The length of the dictionary D i The number of atoms in the is the square of the norm of the matrix F; is an adaptive regularization term, which imposes different degrees of penalty constraints on the encoding coefficients according to the sample category and dictionary atom category. Is for The coefficients in are assigned different degrees of freedom. In the previous round, Z i The larger the sum of the coefficients in the rth row, the stronger the constraint on the coefficients in the next round. is the coefficient encoding of the i-th sample in the previous round, mean() is the average value, and abs() is the absolute value; Q∈R K×C ,Q={q 1 ,q 2 ,...,q C } is an additional penalty constraint matrix, which is defined by additional restriction coefficient vector Both i and j represent categories, and i is not equal to j, so that it tends to 0, minimizing the reconstruction error When , thus making Smaller; in q i In the middle, corresponding to b i to b i +n i Position is 0, where b i is the starting position of the i-th type atom in the dictionary, n i is the number of atoms of type i, and the remaining positions are additional constraint values ​​a; ⊙ is the multiplication of the values ​​of the corresponding positions of the vectors, Can be converted into the following form: Where diag(l) creates a diagonal matrix, the elements on the main diagonal are the values ​​of vector l, and the remaining elements are 0. 1 is a weight parameter, λ 1 The larger the value, the greater the penalty for the coefficients in the encoding vector; is the SVM guide item, the purpose is to guide the learning of the discriminative dictionary; where n i is the number of data sets of the i-th category, w∈R K×c , b∈R c are the weight parameters and offset terms obtained by training SVM on the sparse coding coefficient matrix in a one-to-many manner, m i Z i In the parameter w i and b i The average value on 2 is a weight parameter, λ 2 The larger the objective function is, the more emphasis is placed on the fitting of the SVM guide term.

3. The image classification method based on adaptive regularized dictionary learning according to claim 2, It is characterized in that The data processing in step 3) specifically includes: Step 3-1) Data preprocessing: Dimensionality reduction and normalization of training samples; Step 3-2) Dictionary initialization: The atoms in the dictionary come from the training set. The number of samples in each category is selected to enter the dictionary, and the corresponding number of samples from each category of data are selected and put into the dictionary; Step 3-3) Initialize the label consistency constraint matrix Q: Q∈R K×C , where C is the number of sample categories, a is the additional constraint value, and the specific form of Q is given in the manual; Step 3-4) Sample encoding initialization: Based on the training sample and the initialized dictionary, the sample encoding is initialized using the BOMP algorithm; Step 3-5) Initialization of SVM classification parameters: Based on the initialized encoding, the LBFGS algorithm is used to solve the following objective function: w k is the kth type bias parameter, C is a constant, z i is the i-th sparse coding vector, When z i Belongs to the kth category, otherwise 4. The image classification method based on adaptive regularized dictionary learning according to claim 3, It is characterized in that In step 3-5), the steps of LBFGS algorithm to solve the above objective function are as follows: Step 3-5-1) Initialize the weight parameter w k , select the parameters of LBFGS; Step 3-5-2) Calculate the value and gradient of the objective function and calculate the current w k The objective function value J(w k ), calculate the gradient of the objective function Step 3-5-3) Update direction, using historical gradient information to calculate the update direction; Step 3-5-4) Line search: perform a line search in the update direction to determine the optimal step size; Step 3-5-5) Update variables, update w k Value: w k+1 =w k +α·p k , where α is the step size determined by the line search, p k is the search direction; Step 3-5-6) Update historical information, update historical gradient and position change information required by L-BFGS; Step 3-5-7) Check convergence and whether the stopping criteria are met.

5. The image classification method based on adaptive regularized dictionary learning according to claim 4, It is characterized in that Step 4) specifically includes: according to the objective function described in step 2) and the sparse coding optimization scheme provided in LC-KSVD, the following dictionary model is obtained: Among them, O∈R K×ni is a zero matrix, p=(m i -b i )*ones(1,n i ), ones(1,n i ) is used to generate a dimension of n i A vector whose values ​​are all 1, Other At this time, optimizing the above formula is equivalent to solving the following problem: To solve this problem, the BOMP algorithm in initialization is also used to complete sparse coding.

6. The image classification method based on adaptive regularized dictionary learning according to claim 5, It is characterized in that Step 5) specifically includes: Step 5-1) Dictionary update; Remove the irrelevant items in the model and the dictionary update model is as follows: The optimal dictionary D = (XZ T )(ZZ T +λI) -1 . Step 5-2) SVM parameter update; The degree of dictionary fit is evaluated by monitoring the change range of the coding coefficient matrix. When the change range tends to be stable, the SVM parameters are updated.

7. The image classification method based on adaptive regularized dictionary learning according to claim 6, It is characterized in that The objective function for obtaining the test sample encoding in step 6) is as follows: Where Y is the test sample, D is the dictionary obtained in step 5-1, and Z is the sparse coding vector of the test sample; The coding model in step 4) is used to transform the objective function in step 2), and then the BOM algorithm is used to obtain sample sparse coding. The transformed objective function is as follows: Where E is the K-order unit matrix; The specific scoring formula in step 6) is as follows: where z i Represents the encoding z and the dictionary subset D i The corresponding part (the code z is divided into categories, which can be divided into the following forms: z = [z 1 ,z 2 ,...,z c ]), ω is a weight coefficient. The larger ω is, the more attention is paid to the reconstruction error. For any test sample, it will have a score in each category, and the category with the highest score is selected as the final prediction result.