A robust semi-supervised image classification method based on sparse representation

A robust semi-supervised image classification method using sparse representation and PCA dimensionality reduction solves the problems of high computational complexity and low classification efficiency in existing technologies, achieving efficient and accurate image classification.

CN119091202BActive Publication Date: 2025-11-07NORTHWESTERN POLYTECHNICAL UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411130214.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-16
Publication Date
2025-11-07
Estimated Expiration
2044-08-16

AI Technical Summary

Technical Problem

Existing semi-supervised learning methods have high computational complexity in image classification and are difficult to effectively utilize unlabeled data, resulting in low classification efficiency and insufficient accuracy.

Method used

A robust semi-supervised image classification method based on sparse representation is adopted. By constructing a graph to mine the internal relationships of the data, sparse representation and PCA dimensionality reduction are used to optimize the objective function to improve classification efficiency and accuracy.

Benefits of technology

It improves the computational efficiency and accuracy of image classification, reduces the impact on boundary points, enhances the robustness of the algorithm, and is suitable for practical engineering applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119091202B_ABST
    Figure CN119091202B_ABST
Patent Text Reader

Abstract

The application relates to a kind of robust semi-supervised image classification methods based on sparse representation, data set is divided into training set and test set, respectively each lengthening is image data matrix and normalizing processing;After setting target function, training is carried out to training set, and the data classification of training set and test set is obtained using the obtained classifier and classification bias of training.The application proposes a semi-supervised learning framework for mining implicit information of unlabeled data using norm, which suppresses the influence of outliers in data on classification and improves the robustness of the algorithm.The norm is introduced, so that the matrix in the algorithm operation process is more sparse, and the image data processing efficiency is significantly improved.Therefore, the application has stronger practicability in actual engineering application.The application uses membership degree to represent the category to which the sample belongs, is less affected by boundary points, and has strong robustness.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the field of image classification and pattern recognition, and relates to a robust semi-supervised image classification method based on sparse representation. BACKGROUND

[0002] In most image applications, a large amount of image data is relatively easy to obtain, but the labels of these data need to be manually annotated, and large-scale acquisition is time-consuming and laborious. In this case, how to make full use of rich unlabeled data is particularly important. Semi-supervised learning using labeled data and unlabeled data to learn a prediction model is a learning method suitable for this situation. Semi-supervised learning models are divided into transduction learning models and inductive learning models. Transductive semi-supervised learning methods learn the labels of unlabeled data by propagating labels from labeled data to unlabeled data. The disadvantage of this method is that they cannot be used for out-of-sample testing, and new test data are not included in the unlabeled data. Therefore, when new data need to be labeled, transductive semi-supervised learning methods need to merge these new test data into existing data, and then reconstruct the entire model based on the merged data. This method is very inefficient for out-of-sample data testing. Inductive semi-supervised learning methods use labeled data and unlabeled data to learn a classifier, and the learned classifier can be used for unlabeled data and new out-of-sample test data. The present application is a joint model of transductive semi-supervised and inductive semi-supervised, which can complete label propagation and induce a classifier for new test data classification during the learning process.

[0003] Amin (Semi-supervised learning and clustering algorithm based on hypergraph cuts[J]. Computer Measurement and Control: 1-9 [2024-03-26]) proposed a semi-supervised learning based on hypergraph cuts. This method introduces the total variation on the hypergraph as the Lovasz extension of hypergraph cuts, and proposes a set of regularization functions based on this. Based on the regularization function family, a semi-supervised learning method is proposed. Although this algorithm takes into account the simultaneity of graph construction and label propagation and the adverse effect of high-frequency information in data on classification, this model needs to construct a graph to mine the implicit information in the data, which makes the algorithm time complexity high, runs slowly, and is difficult to apply in engineering practice.

[0004] At present, in the field of image classification, the image processing process is often limited by high label annotation cost, thereby leading to the decline of processing efficiency. The semi-supervised classification method can mine important classification information contained in the unlabeled data, and use the information of the labeled data to classify the unlabeled data. Among many semi-supervised classification methods, the research based on the graph method is one of the research hotspots in the field of machine learning and data mining in recent years, however, on large sample data, the construction of the graph will lead to slow calculation. Therefore, how to improve the classification efficiency and the classification accuracy is still a challenge for the semi-supervised classification method. SUMMARY

[0005] Technical problems to be solved

[0006] In order to avoid the shortcomings of the prior art, the present application provides a robust semi-supervised image classification method based on sparse representation. The semi-supervised learning based on the graph mines the internal relationship of the data by constructing the graph, and uses the graph to induce the model, however, the semi-supervised classification algorithm based on the graph will lead to slow calculation. In view of the above problems, the present application provides a semi-supervised classification method-robust semi-supervised image classification method based on sparse representation.

[0007] Technical scheme

[0008] A robust semi-supervised image classification method based on sparse representation, characterized in that the steps are as follows:

[0009] Step 1: divide the data set containing n a x b pixel scale images into a training set and a test set; lengthen the training set into an image data matrix Wherein Lengthen the test set into an image data matrix Wherein

[0010] Step 2: normalize the image data matrix by row respectively, and obtain the original data matrix after normalization And Finally, the image data matrix after normalization is processed by PCA according to the contribution rate, and the dimension after dimension reduction is d, and the processed image matrix is And

[0011] Step 3: set the objective function, that is, the robust semi-supervised image classification model based on sparse representation, and then train the training set:

[0012] On the basis of the image data matrix X, the membership matrix is randomly initialized It is required to satisfy the row sum of 1, f ij is the element of the i-th row and the j-th column of the matrix F, which represents the i-th data point x iMembership degree of the jth category, for labeled data, the membership degree is 1 in the column corresponding to the label, and 0 in the other columns; random initialization Given parameters p, r;

[0013] The objective function, i.e., the robust semi-supervised image classification model based on sparse representation, is:

[0014]

[0015] s.t.F l = Y l , F1 = 1

[0016] Where W is the classifier, b is the classification bias; x i is the ith column of matrix X, representing the ith sample; c is the number of classification categories; F l = Y l represents that there are l labels in F, and the remaining n-l are unlabeled; r is a parameter; t j is the jth column vector of matrix T, t j is 0 except for the jth row which is 1, and p is a parameter greater than 0;

[0017] Step 4, initialize the indicator matrix T:

[0018]

[0019] Step 5, fix W, b, and update matrix F by the following expression element by element:

[0020]

[0021] Calculate the intermediate matrix M element by element,

[0022] Step 6, fix F, b, and update matrix W by the following expression:

[0023]

[0024] Step 7, fix F, W, and update vector b by the following expression:

[0025]

[0026] Step 8: loop steps 5-7 until the value of the objective function converges, output the classifier W, bias b and classification membership matrix F, where each row of F corresponds to a sample, and the column number of the maximum value in each row represents the category to which the sample belongs;

[0027] Step 9: use the trained W and b to substitute into the formula The square of the distance between each sample in the test set and the category vector in the classification space is obtained, and the column number of the minimum value is the category to which the sample belongs, thereby completing the classification of the test set data.

[0028] In step 2, the image data matrix is normalized by row, and the mean of each row is zero and the standard deviation is 1.

[0029] In step 2, the contribution rate is selected to be 85% to 95%.

[0030] In step 3, the membership degree of the labeled sample needs to be given in advance.

[0031] In step 3, the classification class number c is given by the data set.

[0032] The ratio of the training set and the test set is determined according to the actual situation according to the data set.

[0033] An electronic device, characterized by comprising a processor and a memory, wherein the processor is configured to execute a computer program stored in the memory to realize the steps of the method for data migration of the robust semi-supervised image classification method based on sparse representation.

[0034] A readable storage medium, characterized in that the readable storage medium stores a computer program, and the computer program is executed by a processor to realize the steps of the method for data migration of the robust semi-supervised image classification method based on sparse representation.

[0035] A computer program product, characterized by comprising computer executable instructions, wherein the instructions are executed to realize the method of the robust semi-supervised image classification method based on sparse representation.

[0036] Advantages

[0037] The robust semi-supervised image classification method based on sparse representation provided by the application divides the data set into a training set and a test set, respectively, and respectively elongates into an image data matrix and normalizes the processing; after setting the objective function, the training set is trained, and the data classification of the training set and the test set is obtained by using the obtained classifier and classification bias.

[0038] Advantages of the application include:

[0039] (1) The application provides a semi-supervised learning framework for mining implicit information of unlabeled data by using norm, which suppresses the influence of outliers in data on classification and improves the robustness of the algorithm.

[0040] (2) The application introduces The norm makes the matrix in the algorithm operation process more sparse, and the image data processing efficiency is significantly improved. Therefore, the practicability of the application in actual engineering application is stronger.

[0041] (3) The application adopts membership degree to represent the category to which the sample belongs, is less affected by boundary points, and has strong robustness. BRIEF DESCRIPTION OF DRAWINGS

[0042] Figure 1 Method flowchart of the application

[0043] Figure 2 Specific implementation flowchart of the application on the COIL20 object data set

[0044] Figure 3 Result graph of the application on the COIL20 data set and the comparison algorithms LGC and ASL DETAILED DESCRIPTION

[0045] The application will be further described in combination with embodiments and drawings:

[0046] The basic flowchart of data processing of the application is shown at the end of the text Figure 1 The specific steps are as follows:

[0047] Step 1: divide the data set containing n a x b pixel scale images into a training set and a test set; lengthen the training set into an image data matrix Wherein Lengthen the test set into an image data matrix Wherein

[0048] Step 2: normalize the image data matrix by row respectively, to obtain the original data matrix after normalization And Finally, the normalized image data matrix is processed by PCA according to the contribution rate, and the dimensionality after dimensionality reduction is d, and the processed image matrix is And

[0049] The contribution rate is selected according to data and experimental results, generally selected from 85% to 95%. The dimensionality after dimensionality reduction is d, and the processed image matrix is

[0050] Step 3: on the basis of the image data matrix X, randomly initialize the membership matrix It is required that the row sum is 1, and f ij is the element of the i-th row and j-th column of the matrix F, indicating the i-th data point x iMembership degree of the jth class, for labeled data, the membership degree is 1 in the column corresponding to the label, and 0 in the other columns; random initialization Given parameters p, r. The objective function of the algorithm is

[0051]

[0052] Where W is the classifier, b is the classification bias; x i is the ith column of matrix X, representing the ith sample; c is the number of classification classes, which needs to be given in advance according to the data set; F l = Y l represents that there are l labels in F, and the remaining n-l are unlabeled, and the membership degree of the labeled sample needs to be given in advance; r is a parameter; t j is the jth column vector of matrix T, t j Except for the jth row, which is 1, all rows are 0, and p is a parameter greater than 0.

[0053] Step 4: Initialize the indicator matrix T

[0054]

[0055] Step 5: Fix W, b, update matrix F element by element according to the following expression

[0056]

[0057] Step 6: Calculate the intermediate matrix M element by element

[0058] Step 7: Fix F, b, update matrix W according to the following expression

[0059]

[0060] Step 8: Fix F, W, update vector b according to the following expression

[0061]

[0062] Step 9: Loop steps 5-8 until the value of the objective function (1) converges, output the classifier W, bias b and classification membership matrix F, where each row of F corresponds to a sample, and the column number of the maximum value in each row represents the class to which the sample belongs.

[0063] Step 10: Use the trained W and b to substitute into the formula Get the square of the distance between each sample in the test set and the class vector in the classification space, and the column number of the minimum value is the class to which the sample belongs, thereby completing the classification of the test set data.

[0064] The following will take the object image data set COIL20 as an example to illustrate the specific implementation steps of the classification method proposed by the present application, but the technical content of the present application is not limited to the range described. The object image data set COIL20 contains 1440 object images with a pixel size of 32x32, which have a total of 20 objects. The data set is obtained by taking a picture every 5 degrees for each object and then horizontally wrapping around one circle, i.e. 72 images for each object, a total of 1440 images.

[0065] Implementation step 1: 64 images of each object are taken as the training set, and the remaining 8 images are taken as the test set; the 1280 images are stretched into an image data matrix wherein 1024 = 32x32 is the total number of pixels of a single image of COIL20; since the data collected is not uniform in scale, the image data matrix needs to be normalized by row before operation, so that the mean of each row is zero and the standard deviation is 1, to obtain the original data matrix after normalization Considering that the data in the image is relatively sparse, it is not convenient for subsequent inverse operation, and at the same time in order to improve the operation speed, the normalized image data matrix needs to be processed by PCA for dimension reduction, and the dimension reduction is performed in a manner of retaining a certain contribution rate, and the dimension after dimension reduction is d = 88, and the processed image matrix is

[0066] At the same time, the test set is stretched into an image data matrix wherein

[0067] Implementation step 2: on the basis of the data matrix X, the following robust semi-supervised image classification model based on sparse representation is proposed

[0068]

[0069] Before solving, some variables need to be initialized, here a random initialization method is adopted. The membership matrix is randomly initialized which satisfies that the row sum is 1, and for the labeled data, the membership is the corresponding label; the is randomly initialized Given parameters p = 1.5, r = 2. At this time, the problem to be solved is

[0070]

[0071] Implementation step 3: the target function (7) constructed in step 3 is alternately iterated and optimized, the model is trained, and thus the classifier W, b and the membership F of the unlabeled data are obtained.

[0072] ①Initialize the indicator matrix T

[0073]

[0074] 2. Fix W, b, solve F

[0075] When W and b are fixed, problem (7) is equivalent to

[0076]

[0077] The above optimization problem is a constrained optimization problem, which can be solved by constructing a Lagrange function. Let d ij = ||W T x i + b - t j ||2, the Lagrange function is constructed as follows

[0078]

[0079] In order to obtain the optimal F, the partial derivative of the function L1(F) with respect to F must be zero, that is

[0080]

[0081] Note that The solution is

[0082]

[0083] 3. Fix F, solve W, b

[0084] When F is fixed, problem (7) is equivalent to

[0085]

[0086] Since it is difficult to directly optimize the norm, an approximate approximation method is used to optimize the objective function (13) here. Considering Let be a fixed value, and the objective function is

[0087]

[0088] At this time, W and b are easier to solve, and m ij is updated after each optimization of W and b. W and b are also optimized alternately.

[0089] When W is updated by fixing b, the optimization problem (7) is transformed into

[0090]

[0091] The above problem is an unconstrained optimization problem, which can be solved by using partial derivative. Rewrite the above formula as a function

[0092]

[0093] To find the optimal W, the partial derivative of the function L2(W) with respect to W must be zero.

[0094]

[0095] Solving

[0096]

[0097] When W is fixed and b is updated, the optimization problem (7) is transformed into

[0098]

[0099] This is an unconstrained optimization problem, which can be solved by using partial derivatives, and the above equation can be rewritten in functional form.

[0100]

[0101] To find the optimal value of b, the partial derivative of the function L3(b) with respect to b must be zero.

[0102]

[0103] Solving

[0104]

[0105] ④ Repeat steps ②-③. After convergence, we obtain W, b, and F. F represents the membership degree of each sample in the training set to each class. The column number containing the maximum membership degree of each sample is the class to which that sample belongs.

[0106] Implementation step 4: Substitute the obtained W from training into the formula. The minimum value of the distance between each sample in the test set and the category vector in the classification space is obtained. The column number of the minimum value is the category to which the sample belongs, thus completing the classification of the test set data. Specific implementation examples:

[0108] like Figure 3 As shown in the figure, the proposed method, compared with the contrasting algorithms LGC (Local and Global Consistency Learning) and ASL (Large-Scale Adaptive Semi-Supervised Learning with Joint Inductive and Transductive Models), achieves the same results on the COIL20 dataset. The overall classification accuracy is used as the evaluation metric by comparing the classified labels with the actual labels of the samples. The overall classification accuracy ranges from 0 to 1; a higher value indicates a better classification method. As shown in the figure below, the proposed method significantly outperforms the contrasting algorithms in terms of classification accuracy when the proportion of given labeled data is high. This experimental evidence demonstrates the effectiveness of the proposed method.

[0109] The above merely illustrates the specific embodiments of the present application, but the protection scope of the present application is not limited thereto, and any skilled person in the art can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present application, and these modifications or replacements shall be covered within the protection scope of the present application.

Claims

1. A robust semi-supervised image classification method based on sparse representation, characterized in that The steps are as follows: Step 1 : Split a dataset containing n a x b pixel scale images into a training set and a test set; elongate the training set into an image data matrix wherein elongate the test set into an image data matrix wherein Step 2: Normalize the image data matrix by row respectively, and obtain the normalized original data matrix and Finally, the normalized image data matrix is processed by PCA according to the contribution rate, and the dimension after dimension reduction is d, and the processed image matrix is and Step 3: setting a target function, i.e., a robust semi-supervised image classification model based on sparse representation, and then training the training set: On the basis of the image data matrix X, the membership matrix is randomly initialized It is required to satisfy the row sum of 1, f ij is the element of the i-th row and j-th column of the matrix F, indicating the i-th data point x i The membership of the j-th class classification, for the labeled data, its membership is set to 1 in the label corresponding column, and the rest of the columns are set to 0; it is randomly initialized Given parameters p, r; The target function is set as a robust semi-supervised image classification model based on sparse representation: s.t.F l = Y l F ≥ 0, F1 = 1 where W is the classifier and b is the classification bias; x i is the i-th column of matrix X, representing the i-th sample; c is the number of classification classes; F l l represents that there are l labels in F and the remaining n-l are unlabeled; r is a parameter; t j is the j-th column vector of matrix T, t j is 1 except for the j-th row, and p is a parameter greater than 0;​ Step 4, initializing the indication matrix T: Step 5, fixing W and b, updating the matrix F by the following expression: intermediate quantity matrix M is calculated element-wise, Step 6, fixing F and b, updating the matrix W by the following expression: Step 7, fixing F and W, updating the vector b by the following expression: Step 8: repeating steps 5-7 until the value of the target function converges, outputting the classifier W, the bias b and the classification membership matrix F, wherein each row of F corresponds to a sample, and the column number of the maximum value in each row represents the class to which the sample belongs; Step 9: Using the trained W and b, substitute into the formula The square of the distance between each sample in the test set and the category vector in the classification space is obtained, and the column number of the minimum value is the category to which the sample belongs, thereby completing the classification of the test set data.

2. The method of claim 1, wherein the method is a robust semi-supervised image classification method based on sparse representation. In step 2, the image data matrix is normalized by row, so that the mean of each row is zero and the standard deviation is 1.

3. The method of claim 1, wherein the method is a robust semi-supervised image classification method based on sparse representation. The contribution rate is selected to be 85%-95%.

4. The method of claim 1, wherein the method is a robust semi-supervised image classification method based on sparse representation. In step 3, the membership of the labeled sample needs to be given in advance.

5. The method of claim 1, wherein the method is a robust semi-supervised image classification method based on sparse representation. In step 3, the number of classification classes c is given by the data set.

6. The method of claim 1, wherein the method is a robust semi-supervised image classification method based on sparse representation. The ratio of the training set and the test set is determined according to the actual situation according to the data set.

7. An electronic device, comprising: The processor is used to execute the computer program stored in the memory to realize the steps of the data migration method according to any one of claims 1-6.

8. A readable storage medium, characterized by, The computer program stored on the readable storage medium is executed by the processor to realize the steps of the data migration method according to any one of claims 1-6.

9. A computer program product, characterised in that The computer executable instructions are used to realize the method according to any one of claims 1-6 when executed.

Citation Information

Patent Citations

  • Robust semi-supervised image classification method based on data mining

    CN115131610A

  • Latent low-rank projection learning based unsupervised feature extraction method for hyperspectral image

    WO2022001159A1