Clustering-based robust support vector machine image classification method
Through the robust support vector machine image classification method based on clustering, noise and outliers are processed using clustering and optimization techniques to extract more discriminant feature representations, solving the problem of degradation of image classification effect in the prior art, and achieving efficient and robust image recognition and classification.
Patent Information
- Application Number
- CN202510109840.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-23
- Publication Date
- 2025-06-03
AI Technical Summary
When existing image classification methods process noise, outliers or category imbalanced data, the classification effect is significantly reduced and is not robust enough to noise interference.
A robust support vector machine image classification method based on clustering is proposed. By constructing support vector machine and optimizing the solution, the optimal parameters are obtained, new data samples are constructed using neighborhood samples, data representation is enhanced, and optimized through Lagrangian multipliers and auxiliary variables to achieve efficient automatic recognition and classification of images.
This method can extract more discriminant feature representations, improve the accuracy and robustness of image classification, solve the problems of noise interference and data imbalance in the prior art, and realize efficient automatic identification and classification of images.
Smart Images

Figure BDA0005256399990000011 
Figure BDA0005256399990000023 
Figure BDA0005256399990000025
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image recognition. Specifically, it is a clustering-based robust support vector machine image classification method. Background Art
[0002] With the rapid development of computer vision and artificial intelligence technologies, image classification has become one of the key technologies in fields such as information processing, medical image analysis, security monitoring, and autonomous driving. The purpose of image classification is to classify and label images according to their content to assist the system in subsequent decision-making and analysis. In image classification tasks, the support vector machine (SVM) has become one of the commonly used classification algorithms due to its good generalization ability and advantages in processing high-dimensional data.
[0003] However, image classification is often interfered by noise in practical applications. Noise may come from multiple aspects, including sensor errors, environmental interference, image quality, weather conditions, and other factors. These noise factors may cause unclear, distorted, or confused image information, thus affecting the accuracy and stability of image classification. Traditional SVM methods have certain limitations when dealing with large-scale and complex image data. Especially when there are noise, outliers, or class imbalance in the dataset, the classification effect of SVM will significantly decline. Summary of the Invention
[0004] To solve the deficiencies in the prior art, this application proposes a clustering-based robust support vector machine image classification method, which can efficiently and automatically identify and classify images to solve the limitations of existing classification methods.
[0005] The technical solution adopted by the present invention is as follows:
[0006] A clustering-based robust support vector machine image classification method, comprising the following steps:
[0007] Step 1, construct a clustering-based robust support vector machine, and obtain the optimal parameters by optimizing and solving the constructed clustering-based robust support vector machine;
[0008] Step 1, construct an objective function for optimizing the support vector machine margin, denoted as:
[0009]
[0010] diag(S)=0,S≥0,S T 1 = 1
[0011] where w is the weight vector, C is the penalty parameter, ξ i is the i-th slack variable, x i is the i-th sample, x jis the j-th sample, S ij is the distance weight from the i-th data point to the j-th data point, S is the affinity matrix, b is the bias term in the support vector machine, y i is the class label of the i-th sample;
[0012] Step 2, construct new data samples through neighborhood samples to enhance the representation of data, denoted as
[0013] Step 3, substitute the enhanced data into the constraint conditions of the objective function in Step 1 to obtain a clustering-based robust support vector machine, expressed as follows:
[0014]
[0015]
[0016] Step 4, solve the clustering-based robust support vector machine to determine the optimal parameters;
[0017] Step 5, complete the construction of the clustering-based robust support vector machine based on the optimal parameters;
[0018] Step 2, use the clustering-based robust support vector machine with updated parameters for image classification work and output the classification results.
[0019] Furthermore, the new data samples constructed through neighborhood samples in Step 2 are denoted as:
[0020]
[0021] where, is the obtained enhanced data.
[0022] Furthermore, the method for solving the clustering-based robust support vector machine in Step 4 is as follows:
[0023] Step 4.1, introduce Lagrange multipliers to update the weight vector w, denoted as:
[0024]
[0025] where, w * is the updated weight vector, α i is the i-th term in the Lagrange multiplier α, and the Lagrange multiplier α is denoted as α = (α 1 , α 2 , …, α n ), and n is the number of terms in the Lagrange multiplier;
[0026] Step 4.2, substitute the updated weight vector w * into the objective function in Step 3 to obtain the updated objective function, denoted as:
[0027]
[0028] where α j is the j-th term in the Lagrange multiplier α, y j is the class label of the j-th sample, is the j-th term for constructing the new data sample, is the transpose of, and the term in the constraint is a non-convex constraint;
[0029] Step 4.3, approximate the non-convex constraint as a convex function and introduce an auxiliary variable H = S to decouple the objective function L(α, w * , S), obtaining the augmented Lagrangian function L(α, w * , S, H, M 1 , M 2 ); solve L(α, w * , S, H, M 1 , M 2 ) using to optimize each parameter in L(α, w * , S, H, M 1 , M 2 ).
[0030] Furthermore, the augmented Lagrangian function of the objective function is denoted as:
[0031]
[0032] s.t. diag(S) = 0, S ≥ 0, S T 1 = 1
[0033] where u is the regularization parameter, M 1 , M 2 are both Lagrange multipliers, X is the original data sample in matrix form, is the new data sample in constructed matrix form.
[0034] Furthermore, solve L(α, w * , S, H, M 1 , M 2 ) using the ALM method to optimize each parameter in L(α, w * , S, H, M 1 , M 2 ).
[0035] Further, calculate and update the affinity matrix S:
[0036] S ij = (η - (λ 2 G ij - 2uN ij )) / (u + λ 3 )) +
[0037] S = {S ij}
[0038] where η is the regularization parameter,
[0039] Further, calculate and update the auxiliary variable H:
[0040]
[0041] where 1 is a constant, and X T is the transpose of X.
[0042] An electronic device includes a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the above-mentioned image classification method based on clustering robust support vector machine is implemented.
[0043] A computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the above-mentioned image classification method based on clustering robust support vector machine is implemented.
[0044] Advantages of the present invention:
[0045] (1) The present invention proposes an image classification method based on clustering robust support vector machine. By mining the potential structure and similarity information in data samples, more discriminative feature representations are extracted, making the classification of images more accurate and robust. Therefore, the present invention can solve the limitations of existing classification methods and achieve efficient automatic recognition and classification of images.
[0046] (2) The present invention constructs a clustering-based robust support vector machine to obtain a robust structure similarity graph for image data learning, and then realizes the clustering processing of images and enhances the images. Description of the Drawings
[0047] Figure 1 is a flowchart of the training of a clustering-based robust support vector machine in the present invention.
[0048] Figure 2 is a flowchart of an image classification method based on clustering robust support vector machine in the present invention. Detailed implementation manners
[0049] In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0050] A clustering-based robust support vector machine image classification method includes the following steps:
[0051] Step 1, construct a clustering-based robust support vector machine, and obtain optimal parameters by optimizing and solving the constructed clustering-based robust support vector machine, including the following steps:
[0052] Step 1, construct an objective function for optimizing the support vector machine margin, and the mathematical expression is as follows:
[0053]
[0054] diag(S)=0, S≥0, S T 1=1
[0055] Wherein, w is a weight vector, C is a penalty parameter, ξ i is a slack variable, x i is the i-th sample, x j is the j-th sample, S ij is the distance weight from the i-th data point to the j-th data point, S is an affinity matrix, b is a bias term in the support vector machine, y i is the class label of the i-th sample;; in the above objective function, is used to describe the distance relationship between samples, that is, similarity. λ 1 , λ 2 , λ 3 , λ 4 is the regularization parameter in each term, and the last term of the objective function is to avoid trivial solutions through regularization.
[0056] Step 2, construct new data samples through neighborhood samples to enhance the data representation, which is expressed as:
[0057]
[0058] Wherein, is the enhanced data obtained.
[0059] Step 3, substitute the enhanced data into the constraint conditions of the objective function in Step 1 to obtain a clustering-based robust support vector machine, which is expressed as follows:
[0060]
[0061] Step 4. Solve the clustering-based robust support vector machine to determine the optimal parameters.
[0062] Step 4.1. Introduce the Lagrange multiplier and update the weight vector w, denoted as:
[0063]
[0064] where w * is the updated weight vector, α i is the i-th term in the Lagrange multiplier α, and the Lagrange multiplier α is denoted as α = (α 1 , α 2 , …, α n ), and n is the number of terms in the Lagrange multiplier.
[0065] Step 4.2. Substitute the updated weight vector w * into the objective function in Step 3 to obtain the updated objective function, denoted as:
[0066]
[0067] where α j is the j-th term in the Lagrange multiplier α, y j is the class label of the j-th sample, is the j-th term of the constructed new data sample, is the transpose of, and the term in the constraint is a non-convex constraint.
[0068] Step 4.3. Approximate the non-convex constraint as a convex function and introduce the auxiliary variable H = S to decouple the objective function L(α, w * , S) to obtain the augmented Lagrangian function L(α, w * , S, H, M 1 , M 2 ); use the ALM method to solve L(α, w * , S, H, M 1 , M 2 ) to optimize each parameter in L(α, w * , S, H, M 1 , M 2 ).
[0069] In this embodiment, the augmented Lagrangian function of the objective function is denoted as:
[0070]
[0071] such that diag(S)=0, S≥0, S T 1 = 1
[0072] where u is the regularization parameter, M 1 , M 2 are both Lagrange multipliers, X is the original data sample matrix form, is the constructed new data sample matrix form.
[0073] Calculate and update the affinity matrix S:
[0074] S ij =(η-(λ2G ij -2uN ij ) / (u + λ 3 )) +
[0075] S = {S ij}
[0076] where η is the regularization parameter,
[0077] Calculate and update the auxiliary variable H:
[0078]
[0079] where 1 is a constant, X T is the transpose of X.
[0080] Step 5, based on the optimal parameters (weight vector w * , S, H), complete the construction of the clustering-based robust support vector machine.
[0081] In this embodiment, during the solution process, when the norm of H - S and the norm of gradually converge, it indicates that the currently solved parameters are the optimal parameters.
[0082] In this embodiment, use the image data set to train and test the clustering-based robust support vector machine; the specific process is as follows: Prepare the image data set and divide the image data set into a training set and a test set; Collect 1000 data samples containing images of different categories, including 10 sample categories. Among them, 900 data samples are used as the training set for training, and 100 data samples are used as the test set for testing.
[0083] Step 2, use the clustering-based robust support vector machine with updated parameters to perform image classification work and output the classification results.
[0084] In this embodiment, the clustering-based robust support vector machine of the present application can achieve "one-versus-one" classification, and according to the "one-versus-one" multi-classification strategy, the class with the most votes is selected as the predicted class of the image x new of the prediction category.
[0085] For the "one-versus-one" classification strategy, the decision function of the binary support vector machine between the i-th class and the j-th class is:
[0086] y new = sign(w i,j Tφ(x new ) + b i,j ) = sign(∑y t α t k(x t , x new + b i,j ))
[0087] Among them, sign is the sign function, which means that if the value of the expression is greater than zero, +1 is returned, and if it is less than zero, -1 is returned. This is used to determine the category of the new data point x new of the category. w i,j is the weight vector, x new is the new input sample, that is, the new data point for which the category is to be predicted, φ(x new ) is the feature mapping function, which represents the transformation function that maps the input sample x new to the high-dimensional feature space, b i,j is the bias term, y t is the category label of the t-th training sample, α t is the Lagrange multiplier, which represents the weight of each support vector during the training process, k is the kernel function, which is used to calculate the similarity between the training sample x t and the new test sample x new , x t is the t-th sample in the training dataset.
[0088] This embodiment also proposes an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the above-mentioned clustering-based robust support vector machine image classification method is implemented.
[0089] This embodiment also proposes a computer-readable storage medium. A computer program is stored on the computer-readable storage medium. When the computer program is executed by the processor, the above-mentioned clustering-based robust support vector machine image classification method is implemented.
[0090] The above embodiments are only used to illustrate the design concept and features of the present invention, and the purpose is to enable those skilled in the art to understand the content of the present invention and implement it accordingly. The protection scope of the present invention is not limited to the above embodiments. Therefore, all equivalent changes or modifications made based on the principles and design concepts disclosed by the present invention are within the protection scope of the present invention.
Claims
1. A clustering-based robust support vector machine image classification method, characterized in that: The steps include: Step 1, constructing a clustering-based robust support vector machine, and obtaining optimal parameters by optimizing and solving the constructed clustering-based robust support vector machine; Step 1, construct the objective function of support vector machine edge optimization, denoted as: diag(S)=0,S≥0,S T 1=1 Among them, w is the weight vector, C is the penalty parameter, ξ i is the ith slack variable, x i is the i-th sample, x j is the jth sample, S ij is the distance weight from the i-th data point to the j-th data point, S is the affinity matrix, b is the bias term in the support vector machine, and y i is the category label of the i-th sample; Step 2: Construct new data samples through neighborhood samples to enhance the data representation, denoted as Step 3: Enhance the data Substitute into the constraints of the objective function in Step 1 to obtain the clustering-based robust support vector machine, which is expressed as follows: Step 4, solve the clustering-based robust support vector machine and determine the optimal parameters; Step 5, complete the construction of clustering-based robust support vector machine based on the optimal parameters; Step 2: Use the clustering-based robust support vector machine with updated parameters to perform image classification and output the classification results.
2. The clustering-based robust support vector machine image classification method according to claim 1, characterized in that: In Step 2, new data samples are constructed through neighborhood samples as follows: in, To obtain enhanced data.
3. The clustering-based robust support vector machine image classification method according to claim 2, characterized in that: Step 4 The method for solving the clustering-based robust support vector machine is as follows: Step 4.1, introduce the Lagrange multiplier and update the weight vector w, which is recorded as: Among them, w * is the updated weight vector, α i is the i-th term in the Lagrange multiplier α, which is denoted by α=(α1,α2,…,α n ), n is the number of terms in the Lagrange multiplier; Step 4.2, update the weight vector w * Substitute the objective function of Step 3 to obtain the updated objective function, which is recorded as: Among them, α j is the jth term in the Lagrange multiplier α, y j is the category label of the jth sample, To construct the jth item of the new data sample, for The transpose of The term is a non-convex constraint; Step 4.3, approximate the non-convex constraint as a convex function, and introduce the auxiliary variable H = S to the objective function L(α,w * ,S) to decouple and obtain the augmented Lagrangian function L(α,w * ,S,H,M1,M2); for L(α,w * ,S,H,M1,M2) is solved to realize L(α,w * ,S,H,M1,M2) are optimized.
4. The clustering-based robust support vector machine image classification method according to claim 3, characterized in that: The augmented Lagrangian function of the objective function is recorded as: s.t.diag(S)=0,S≥0,S T 1=1 Among them, u is the regularization parameter, M1 and M2 are Lagrange multipliers, and X is the matrix form of the original data sample. The new data sample matrix form is constructed.
5. The clustering-based robust support vector machine image classification method according to claim 4, characterized in that: For L(α,w * ,S,H,M1,M2) is solved using the ALM method to achieve L(α,w * ,S,H,M1,M2) are optimized.
6. The clustering-based robust support vector machine image classification method according to claim 5, characterized in that: Calculate and update the affinity matrix S: S ij =(η-(λ2G ij -2uN ij ) / (u+λ3)) + S={S ij } Among them, η is the regularization parameter, 7. The clustering-based robust support vector machine image classification method according to claim 5, characterized in that: Calculate and update the auxiliary variable H: Among them, 1 is a constant, X T is the transpose of X.
8. An electronic device, characterized in that: The invention comprises a memory, a processor and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the robust support vector machine image classification method based on clustering as claimed in claim 1 is implemented.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, the clustering-based robust support vector machine image classification method according to claim 1 is implemented.