A multi-layer dictionary learning method for image classification tasks
By defining the dependency relationship between multi-layer dictionaries as residual learning and adopting a multi-layer residual discriminant dictionary learning framework, the problem of limitations of multiple dictionary relationship definitions in the existing technology is solved, and the accuracy of image classification tasks is improved.
Patent Information
- Application Number
- CN202010377838.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-05-07
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2040-05-07
AI Technical Summary
Existing multi-layer dictionary learning methods have limitations in defining relationships between multiple dictionaries in image classification tasks, which affects classification accuracy.
By defining the dependency relationship between multi-layer dictionaries as residual learning, a multi-layer residual discriminant dictionary learning framework is adopted to jointly train multiple dictionaries and classifiers. Each dictionary and classifier continuously fits the reconstructed residuals of the previous round. difference, thus improving the recognition accuracy.
It effectively improves the accuracy of image classification tasks, approaches the fitting target through multiple rounds of iteration, and improves the application effect of dictionary learning in classification problems.
Smart Images

Figure CN111709442B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer vision, and in particular to a multi-layer dictionary learning method for image classification tasks. Background Art
[0002] In recent years, dictionary learning algorithms have received extensive attention in the fields of image classification and signal processing. Dictionary learning is essentially about finding a suitable sparse subspace (whose basis function is usually called a dictionary) to represent the features of data in order to achieve high-precision reconstruction or classification. Dictionary learning methods have been widely used in image reconstruction problems (such as image denoising, image restoration, image super-resolution reconstruction, etc.) and have achieved good results, which has promoted the development of dictionary learning in image classification problems. Unlike image reconstruction problems, the goal of image classification is to make correct predictions about the labels of samples, so how to effectively extract category information from samples becomes the key to solving image classification problems. Although multi-layer dictionary learning is effective, most multi-layer dictionary learning methods have certain limitations in defining the relationship between multiple dictionaries. Summary of the invention
[0003] In order to overcome the defects of the prior art, the technical problem to be solved by the present invention is to provide a multi-layer dictionary learning method for image classification tasks, which can remove the limitations of the relationship definition between multiple dictionaries and improve the accuracy of dictionary learning applied to classification problems.
[0004] The technical solution of the present invention is: this multi-layer dictionary learning method for image classification tasks is used to extract category information from image samples, comprising the following steps:
[0005] (1) The dependency relationship between multi-layer dictionaries is defined as residual learning, and multi-layer dictionaries and classifiers are learned based on the multi-layer residual discriminant dictionary learning framework;
[0006] (2) Based on the multi-layer dictionary learned in step (1), multiple rounds of encoding vectors of the data to be classified are calculated in sequence, and then the corresponding classifiers are used for classification, and the prediction values of each classifier are added to obtain the final recognition result.
[0007] The present invention defines the dependency relationship between multi-layer dictionaries as residual learning, learns multi-layer dictionaries and classifiers based on a multi-layer residual discriminant dictionary learning framework, calculates multiple rounds of encoding vectors of the data to be classified in turn based on the learned multi-layer dictionary, and then uses the corresponding classifier to classify, and adds up the prediction values of each classifier to obtain the final recognition result. During the training process, multiple dictionaries and classifiers are jointly trained, and each dictionary and classifier continuously fits the reconstructed residual of the previous round of dictionaries and classifiers to continuously approach the fitting target, thereby improving the recognition accuracy, thereby being able to remove the limitations of the relationship definition between multiple dictionaries and improve the accuracy of dictionary learning applied to classification problems. BRIEF DESCRIPTION OF THE DRAWINGS
[0008] Figure 1 The relationship between the objective function value and the number of iterations on the Scene15 dataset is shown.
[0009] Figure 2 It is a flowchart of a multi-layer dictionary learning method for image classification tasks according to the present invention. DETAILED DESCRIPTION
[0010] The present invention combines the gradient boosting method in ensemble learning, defines the dependency relationship between dictionaries as residual learning, and proposes a new multi-layer discriminant dictionary learning model for classification tasks.
[0011] Ensemble learning is a learning method that completes learning tasks by building and combining multiple learners. Ensemble learning can be divided into two categories based on whether there is a dependency relationship between individual learners. One is a serialization method that can be generated serially, such as the Boosting family algorithm, where there is no strong dependency between individual learners and can be generated simultaneously, such as random forests, bagging, etc. Gradient Boosting Decision Tree (GBDT) is an iterative decision tree algorithm based on the Boosting idea in ensemble learning. GBDT integrates multiple decision trees obtained through multiple iterations to approach the target, where each iteration builds a decision tree in the direction of reducing the gradient of the residual, that is, the target of each learning is the residual of the tree built by the previous iteration, making the optimization of each step simpler. As an ensemble learning method, GBDT is widely welcomed by researchers for its good generalization performance. The XGBoost model uses parallel distributed computing based on GBDT to speed up the operation of the gradient boosting tree, so that the model can calculate large-scale data more efficiently. The introduction of XGBoost provides a time efficiency guarantee for the widespread application of the gradient boosting algorithm.
[0012] Based on the research idea of gradient boosting and integrating the classification advantages of discriminant dictionaries, this paper proposes a multi-layer residual discriminant dictionary learning method for image classification tasks.
[0013] like Figure 2 As shown in the figure, this multi-layer dictionary learning method for image classification tasks is used to extract category information from image samples, including the following steps:
[0014] (1) The dependency relationship between multi-layer dictionaries is defined as residual learning, and multi-layer dictionaries and classifiers are learned based on the multi-layer residual discriminant dictionary learning framework;
[0015] (2) Based on the multi-layer dictionary learned in step (1), multiple rounds of encoding vectors of the data to be classified are calculated in sequence, and then the corresponding classifiers are used for classification, and the prediction values of each classifier are added to obtain the final recognition result.
[0016] The present invention defines the dependency relationship between multi-layer dictionaries as residual learning, learns multi-layer dictionaries and classifiers based on a multi-layer residual discriminant dictionary learning framework, calculates multiple rounds of encoding vectors of the data to be classified in turn based on the learned multi-layer dictionary, and then uses the corresponding classifier to classify, and adds up the prediction values of each classifier to obtain the final recognition result. During the training process, multiple dictionaries and classifiers are jointly trained, and each dictionary and classifier continuously fits the reconstructed residual of the previous round of dictionaries and classifiers to continuously approach the fitting target, thereby improving the recognition accuracy, thereby being able to remove the limitations of the relationship definition between multiple dictionaries and improve the accuracy of dictionary learning applied to classification problems.
[0017] Preferably, in step (1), a multi-layer dictionary and its associated multi-layer classifier are trained serially in an iterative manner, wherein there is a strong dependency between the layers, and the target of fitting the dictionary and classifier of each layer is the reconstructed residual of the dictionary and classifier of the previous layer; wherein the reconstructed residual of the dictionary of the t-th layer refers to the difference between the sum of t reconstructed samples calculated based on the dictionary of the first t layers and the original sample, and the reconstructed residual of the classifier of the t-th layer refers to the difference between the sum of t estimated labels calculated based on the classifier of the first t layers and the true label. During the iteration process, the combination of dictionary atoms and sparse coefficients continuously fits the samples, and the combination of classifiers and sparse coefficients continuously approaches the labels. Through multiple rounds of iterations, the fitting target is continuously approached, thereby improving the accuracy of dictionary learning applied to classification problems. Experiments show that the multi-layer residual discriminant dictionary learning method for classification tasks proposed in the present invention can effectively improve the accuracy of classification tasks. Preferably, in step (1), for a given set of N samples Minimize the objective function shown in equation (1) by jointly learning the dictionary and the classifier,
[0018]
[0019] Among them, the first term is the reconstruction error term, x i For real samples, is the reconstructed sample based on dictionary and sparse coding; the second term is the classification error term, y i is the true label of the sample, is the sample label predicted based on the classifier sparse coding; l represents the error function;
[0020] This method uses T rounds of learning to make the reconstructed samples and reconstructed sample labels approach the real samples and labels. Specifically, in the tth round of iteration, formula (1) is expanded into the following form:
[0021]
[0022] Preferably, in step (1),
[0023] The objective function of formula (2) is written into a solvable form, and formula (3) is obtained:
[0024]
[0025] in is the fitting target of the i-th training sample in the t-th iteration; S is the sample dimension; t is the iteration index, 1≤t≤T; represents the tth dictionary, K is the number of dictionary atoms; represents the tth classifier, C is the number of categories; is the target label vector of the i-th sample in the t-th iteration; is the sparse representation vector of the i-th sample in the t-th iteration, and the sparse representation matrix of the training set is recorded as θ is the sparsity constraint parameter.
[0026] The model is prone to overfitting when training using the gradient boosting method. In step (1), regularization terms for the dictionary and classifier are introduced to obtain the optimization problem of the tth iteration as shown in formula (4):
[0027]
[0028]
[0029] Preferably, in step (1), the optimization problem (4) is solved by using an alternating direction method, and the specific solution process of the tth round is described as follows:
[0030] (a) Initialize dictionary D t and the sparse representation matrix A t ;
[0031] Using the KSVD method, the training sample set is used as input, and the trained dictionary and sparse coefficients are used as the initial dictionary and sparse coefficients;
[0032] (b) Fixed dictionary D t and the sparse representation matrix A t , we get the solution classifier Q as shown in formula (5) t Sub-questions:
[0033]
[0034] Written in matrix form, as shown in formula (6):
[0035]
[0036] According to the first-order necessary conditions of the optimization problem, the classifier Q is obtained t :
[0037]
[0038] (c) Fixed classifier Q t and dictionary D t , we get the sparse representation matrix A shown in formula (7) t Sub-questions:
[0039]
[0040] Written in matrix form, as shown in formula (8):
[0041]
[0042] Use the OMP algorithm to solve equation (8) and get the sparse representation matrix A t ;
[0043] (d) Fixed classifier Q t and the sparse representation matrix A t , we get the solution dictionary D shown in formula (9) t Sub-questions:
[0044]
[0045] Written in matrix form, as shown in formula (10):
[0046]
[0047] According to the first-order necessary conditions of the optimization problem, the dictionary D is obtained t :
[0048]
[0049] Preferably, in step (2),
[0050] For the sample x to be classified, the specific calculation process of the tth test label vector is as follows:
[0051] (e) Use the tth dictionary obtained in step (1) to obtain the sparse code a t
[0052]
[0053] where x t is the learning target of the t-th dictionary, which is the difference between the sample to be classified x and the reconstruction result of the previous t-1 rounds, that is, at is a sparse coding vector;
[0054] Use the OMP algorithm to solve equation (11) and get the tth sparse code a t ;
[0055] (f) Use the tth classifier obtained in step (1) to classify the sparse code a t Projection is performed, and the predicted label vector P of the tth round is obtained as shown in formula (12): t
[0056] P t =Q t a t (12)
[0057] Repeat steps (e) and (f) T times to obtain T predicted label vectors; sum the prediction results of T classifiers to obtain the final predicted label vector P of the sample x to be classified final :
[0058]
[0059] The present invention conducts experiments on three image datasets based on classification tasks, and compares the classification accuracy with the current mainstream dictionary learning models and other mainstream classification models, including discriminative dictionary models DKSVD, LC-KSVD, SRC, FDDL and SVGDL, and non-discriminative dictionary learning models including HMP, MHMP, DeepSCNet and neural network model Places-CNN.
[0060] from Figure 1 It can be seen that as the number of iterations increases, the objective function value gradually decreases and eventually tends to be stable, proving that the objective function defined in the present invention is convergent.
[0061] The present invention uses three datasets (Caltech101 image classification database, Scene15 scene image classification database and MIT) to test the effectiveness of the proposed method.
[0062] The Caltech101 image dataset includes 101 semantic categories and one other category, with about 100 images in each category, for a total of 9144 images. 30 samples are selected from each category to form a training set, and the remaining samples form a test set, so that the training set contains 3060 images and the test set contains 6084 images. The present invention uses the spatial pyramid SPF method to extract image features with a feature dimension of 3000 dimensions. The training process learns two rounds of dictionaries T=2, with a dictionary dimension of 3030, sparse constraint parameters θ=100, parameter γ=1, parameter β=2, and parameter μ=2. The recognition accuracy of the method proposed in the present invention and the comparative method is shown in Table 1. It can be seen that on this data set, the method proposed in the present invention obtains the highest accuracy.
[0063] Table 1
[0064]
[0065] The Scene15 scene image dataset contains 15 semantic categories of indoor and outdoor scenes, each category contains 210 to 410 images. The average image size is 250*300. 100 images are randomly selected from each category to form a training set, and the rest form a test set, so that the training set contains 1500 images and the test set contains 2985 images. The present invention uses the spatial pyramid method SPF to extract image features, and the feature dimension is 3000 dimensions. The training process learns 4 rounds of dictionaries T=4, the dictionary dimension is 450, the sparse constraint parameter θ=50, the parameter γ=2, the parameter β=2, and the parameter μ=2. The recognition accuracy of the method proposed in the present invention and the comparative method is shown in Table 2. It can be seen that on this data set, the method proposed in the present invention obtains the highest accuracy.
[0066] Table 2
[0067]
[0068] The MIT scene image dataset contains 67 semantic categories of indoor scenes, a total of 6700 RGB images. The present invention selects 5360 samples as the training set and 1340 samples as the test set. The spatial pyramid method SPF is used to extract image features, and the feature dimension is 3000 dimensions. The training process learns 4 rounds of dictionaries T=4, the first round of dictionary dimension is 3350, and the dictionary dimensions of the next three rounds are all 2010. The sparse constraint parameter θ=100, the parameter γ=2, the parameter β=2, and the parameter μ=2. The recognition accuracy of the method proposed in the present invention and the comparative method is shown in Table 3. It can be seen that on this dataset, the method proposed in the present invention obtains the highest accuracy.
[0069] Table 3
[0070]
[0071] The above description is only a preferred embodiment of the present invention and does not limit the present invention in any form. Any simple modification, equivalent changes and modifications made to the above embodiments based on the technical essence of the present invention are still within the protection scope of the technical solution of the present invention.
Claims
1. A multi-layer dictionary learning method for image classification tasks, characterized by: The method is used to extract category information from an image and includes the following steps: (1) The dependency relationship between multi-layer dictionaries is defined as residual learning, and multi-layer dictionaries and classifiers are learned based on the multi-layer residual discriminant dictionary learning framework; (2) Based on the multi-layer dictionary learned in step (1), multiple rounds of encoding vectors of the image data to be classified are calculated in sequence, and then the corresponding classifier is used for classification, and the prediction values of each classifier are added to obtain the final recognition result; In the step (1), a multi-layer dictionary and a multi-layer classifier associated therewith are serially trained in an iterative manner, wherein there is a strong dependency between the layers, and the target of fitting the dictionary and classifier of each layer is the reconstructed residual of the dictionary and classifier of the previous layer; wherein the reconstructed residual of the dictionary of the t-th layer refers to the difference between t reconstructed image samples calculated based on the dictionary of the first t layers and the original image samples, and the reconstructed residual of the classifier of the t-th layer refers to the difference between t estimated labels calculated based on the classifier of the first t layers and the true labels; In step (1), for a given set of N image samples Minimize the objective function shown in equation (1) by jointly learning the dictionary and the classifier, Among them, the first term is the reconstruction error term, x i is a real image sample, is the reconstructed image sample based on dictionary and sparse coding; the second term is the classification error term, y i is the true label of the sample, is the sample label predicted by the classifier sparse coding; l represents the error function; This method uses T rounds of learning to make the reconstructed image samples and reconstructed image sample labels approach the real image samples and labels. Specifically, in the tth round of iteration, formula (1) is expanded into the following form: The objective function of formula (2) is written into a solvable form, and formula (3) is obtained: in is the fitting target of the i-th training sample in the t-th iteration; S is the sample dimension; t is the iteration index, 1≤t≤T; represents the tth dictionary, K is the number of dictionary atoms; represents the tth classifier, C is the number of categories; is the target label vector of the i-th sample in the t-th iteration; is the sparse representation vector of the i-th sample in the t-th iteration, and the sparse representation matrix of the training set is recorded as θ is the sparse constraint parameter; In step (2), for the image to be classified x, the specific calculation process of the t-th measured label vector is as follows: (e) Use the tth dictionary obtained in step (1) to obtain the sparse code a t where x t is the learning target of the t-th dictionary, which is the difference between the image to be classified x and the reconstruction result of the previous t-1 rounds, that is, a t is a sparse coding vector; Use the OMP algorithm to solve equation (11) and get the tth sparse code a t ; (f) Use the tth classifier obtained in step (1) to classify the sparse code a t Projection is performed, and the predicted label vector P of the tth round is obtained as shown in formula (12): t P t =Q t a t (12) Repeat steps (e) and (f) T times to obtain T predicted label vectors; sum the prediction results of T classifiers to obtain the final predicted label vector P of the image to be classified x final :
2. The multi-layer dictionary learning method for image classification tasks according to claim 1, characterized in that: In step (1), regularization terms for the dictionary and the classifier are introduced, and the optimization problem for the t-th iteration is obtained as formula (4):
3. The multi-layer dictionary learning method for image classification tasks according to claim 2, characterized in that: In the step (1), the optimization problem (4) is solved by the alternating direction method. The specific solution process of the tth round is described as follows: (a) Initialize dictionary D t and the sparse representation matrix A t ; Using the KSVD method, the training image sample set is used as input, and the trained dictionary and sparse coefficients are used as the initial dictionary and sparse coefficients; (b) Fixed dictionary D t and the sparse representation matrix A t , solve the classifier Q t The sub-problem is obtained as shown in formula (5): Written in matrix form, as shown in formula (6): According to the first-order necessary conditions of the optimization problem, the classifier Q is obtained t : (c) Fixed classifier Q t and dictionary D t , solve the sparse representation matrix A t The sub-problem is obtained as shown in formula (7): Written in matrix form, as shown in formula (8): Use the OMP algorithm to solve equation (8) and get the sparse representation matrix A t ; (d) Fixed classifier Q t and the sparse representation matrix A t , solve dictionary D t The sub-problem is obtained as shown in formula (9): Written in matrix form, as shown in formula (10): According to the first-order necessary conditions of the optimization problem, the dictionary D is obtained t : D t =X t A tΤ (A t A tΤ +βI) -1 。
