Image clustering method based on complex subspace
By using a composite subspace-based image clustering method, which combines a pre-trained convolutional autoencoder and a composite subspace image clustering network with a spectral clustering algorithm, the problem of insufficient image clustering accuracy in existing technologies is solved, and more efficient unsupervised learning and clustering results are achieved.
Patent Information
- Application Number
- CN202310753855.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-25
- Publication Date
- 2025-12-05
- Estimated Expiration
- 2043-06-25
AI Technical Summary
Existing subspace clustering methods have limited ability to capture the subspace structure of image data and require a large amount of labeled data, resulting in insufficient clustering accuracy.
A composite subspace-based image clustering method is adopted. By pre-training a convolutional autoencoder, training a composite subspace image clustering network, and combining it with a spectral clustering algorithm, a self-expression matrix is constructed to achieve unsupervised learning and capture the self-expression relationship between the input and the latent space.
It improves the accuracy of image clustering, better captures subspace structure, reduces dependence on labeled data, and achieves more efficient clustering results.
Smart Images

Figure CN116758320B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of image clustering method, and particularly relates to an image clustering method based on composite subspace. BACKGROUND
[0002] With the progress of data acquisition, storage and processing technology, images in the Internet are growing explosively. Although the development of modern machine learning technology has achieved great success in data mining, these methods usually require a large amount of labeled data to achieve high-performance model training, and these labeled data are often expensive and time-consuming, requiring a lot of manpower and professional knowledge, so extracting patterns and clustering from unlabeled big data has become an important open problem.
[0003] Subspace clustering is an effective technique for solving unsupervised clustering problems, with a solid theoretical foundation and excellent clustering performance. This technique is widely used in many machine learning application fields, including motion segmentation, face clustering, movie recommendation, etc. Its main goal is to divide a set of data samples extracted from a low-dimensional subspace into disjoint clusters, so that the samples in each cluster belong to the same subspace. This kind of algorithm can mine the internal structure of data and discover potential patterns and relationships from it.
[0004] The previous subspace clustering method usually obtains the latent representation of the original data using an autoencoder first, then uses a fully connected layer to simulate the self-representation characteristics of the data, obtains a self-representation matrix, and finally applies a spectral clustering algorithm to obtain the clustering result. However, these methods only focus on learning the self-representation coefficients in the input space or the latent space, and ignore the embedding of the samples, so their ability to capture subspace structure is limited. SUMMARY
[0005] The purpose of the application is to provide an image clustering method based on composite subspace, which can better capture the subspace structure and improve the clustering accuracy.
[0006] The technical solution adopted by the application is an image clustering method based on composite subspace, which is implemented according to the following steps:
[0007] Step 1, pre-training a convolutional autoencoder;
[0008] Step 2, training a composite subspace image clustering network;
[0009] Step 3, applying spectral clustering to obtain the clustering result.
[0010] The application has the following characteristics:
[0011] The step 1 is specifically: pre-processing the read image data, taking data reconstruction as a target, using the ADAM algorithm to optimize the convolutional auto-encoder, ending the training when the decoder can well reconstruct the input data, and saving the network parameters of the convolutional auto-encoder.
[0012] The image data pre-processing is a normalization processing of the image data, if the image is too large, PCA is also needed for dimension reduction processing, and X = [x1, x2,..., x n ] represents a set of pre-processed image data, Y = [y1, y2,..., y n ] represents a label set corresponding to X, wherein x i ∈R D represents that x i is in a D-dimensional feature space, y i is a scalar representing the label of the data x i .
[0013] The pre-training of the convolutional auto-encoder is specifically implemented according to the following steps:
[0014] Step 1, randomly initializing the network parameters of the convolutional auto-encoder;
[0015] Step 2, setting the batch size to 100, using the ADAM optimizer, taking reconstruction as a target, and training the convolutional auto-encoder on the GPU;
[0016] Step 3, after the training reaches the termination condition, ending the training, and saving the network parameters of the convolutional auto-encoder.
[0017] Step 2 is specifically: constructing a composite subspace image clustering network, loading the network parameters saved in the step 1 into the composite subspace image clustering network as initial values, randomly initializing other parameters in the network, taking the loss function as a target for training, training the composite subspace image clustering network, and obtaining the trained composite subspace image clustering network.
[0018] The composite subspace image clustering network includes a feature extraction module and a self-expression module, wherein the feature extraction module is the convolutional auto-encoder in step 1, and the self-expression module adopts a full connection layer without bias and activation function, the input of the layer has n neurons which are the outputs of the encoder, and the output of the layer is the input of the decoder, U = [u1, u2,..., u n ] is the output of the encoder, representing the latent representation corresponding to X, u i ∈R P represents that u i is in a P-dimensional feature space, C ∈ R n×n is the network parameter of the full connection layer, and the size is n by n.
[0019] The loss function of the composite subspace image clustering network is L, which includes four loss terms. The first loss term L1 is the reconstruction error of the entire network, which is represented by formula (1):
[0020]
[0021] Where X is the input data, is the output data, and ||.|| is the Frobenius norm. F The second loss term L2 is the self-representation reconstruction error of the input space, which is represented by formula (2):
[0022]
[0023] Where X is the input data, XC is the self-representation reconstruction of the input space, and α is the balance coefficient.
[0024]
[0025] Where U is the latent representation, UC is the self-representation reconstruction of the input space, and β is the balance coefficient.
[0026]
[0027] Where C is the self-representation coefficient matrix, λ is the balance coefficient, and the total loss L = L1 + L2 + L3 + L4.
[0028] The training process of the composite subspace image clustering network is implemented according to the following steps:
[0029] Step 1, load the network parameters saved in step 1, and randomly initialize the parameters of the fully connected neural network;
[0030] Step 2, set the batch size to 100, use the ADAM optimizer, and train the composite subspace image clustering network on the GPU to minimize the total loss L;
[0031] Step 3, when the training reaches the termination condition, end the training and obtain the trained composite subspace image clustering network.
[0032] Step 3 is: input the input data into the trained composite subspace image clustering network to obtain the self-representation matrix, construct a similarity matrix according to the self-representation matrix, and apply spectral clustering to the similarity matrix to obtain the final clustering result.
[0033] The calculation process of constructing the similarity matrix from the self-expression matrix is represented by formula (5):
[0034]
[0035] Where C is the self-expression matrix and S is the similarity matrix.
[0036] The specific process of spectral clustering on the similarity matrix is as follows: use S to calculate the degree matrix D, which is the sum of the elements of each row of the similarity matrix, and then calculate the Laplacian matrix L: L = DW. Arrange the eigenvalues in the Laplacian matrix from largest to smallest, calculate the eigenvectors corresponding to the first K eigenvalues, and use the K-means algorithm to cluster them to obtain K clusters, which are the clustering results.
[0037] The beneficial effects of this invention are as follows:
[0038] This invention is an image clustering method based on composite subspaces. It uses unsupervised learning to achieve image clustering. By simultaneously learning the self-expression coefficients in the input space and the latent space, a clear nonlinear mapping is obtained. The input samples are then embedded into the corresponding deep representation, thereby better capturing the subspace structure and improving the clustering accuracy. Attached Figure Description
[0039] Figure 1 This is a flowchart of the image clustering method based on composite subspace of the present invention;
[0040] Figure 2 This is a network structure diagram of the image clustering method based on composite subspace of the present invention. Detailed Implementation
[0041] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments.
[0042] This invention relates to an image clustering method based on composite subspaces, the process of which is as follows: Figure 1 As shown, please follow these steps:
[0043] Step 1, Pre-training the convolutional autoencoder
[0044] Step 1 specifically involves: preprocessing the image dataset, aiming to minimize the data reconstruction error, using the preprocessed image data as input data, optimizing the convolutional autoencoder using the ADAM algorithm, ending the training when the decoder can reconstruct the input data well, and saving the network parameters of the convolutional autoencoder.
[0045] Step 2: Train the composite subspace image clustering network;
[0046] Step 2 specifically involves: Figure 2As shown, a composite subspace image clustering network is constructed. The network parameters saved in step 1 are loaded into the composite subspace image clustering network as initial values. Other parameters in the network are randomly initialized. The composite subspace image clustering network is trained with the loss function objective to obtain the trained composite subspace image clustering network.
[0047] Step 3: Apply spectral clustering to obtain the clustering results;
[0048] Step 3 specifically involves: inputting the input data into the trained composite subspace image clustering network to obtain the self-expression matrix, constructing a similarity matrix based on the self-expression matrix, and applying spectral clustering to the similarity matrix to obtain the final clustering result.
[0049] Example 1
[0050] In step 1, image data preprocessing involves normalizing the image data. If the image is too large, PCA (Potentially Arithmetic Aspect-Oriented Analysis) is also needed for dimensionality reduction. Using X = [x1, x2, ..., x...] n [] represents the set of preprocessed image data, Y = [y1, y2, ..., y] n ] represents the set of labels corresponding to X, where x i ∈R D x represents i Located in a D-dimensional feature space, y i It is a scalar representation of data x i Tags;
[0051] The convolutional autoencoder consists of two parts: a three-layer convolutional encoder and a three-layer convolutional decoder. The encoder and decoder have symmetrical structures, which ensures that the input and output have the same structure.
[0052] The pre-training of a convolutional autoencoder is carried out according to the following steps:
[0053] Step 1: Randomly initialize the network parameters of the convolutional autoencoder;
[0054] Step 2: Set the batch size to 100, use the ADAM optimizer, and train the convolutional autoencoder on the GPU with reconstruction as the goal.
[0055] Step 3: Once the training reaches the termination condition, end the training and save the network parameters of the convolutional autoencoder.
[0056] Example 2
[0057] The composite subspace image clustering network in step 2 comprises two modules: a feature extraction module and a self-expression module. The feature extraction module is the convolutional autoencoder from step 1. The self-expression module is implemented using a single fully connected layer without bias or activation functions. The input of this layer has n neurons, which are the output of the encoder, and the output of this layer is the input of the decoder. U = [u1, u2, ..., u...] n ] is the encoder output, representing the latent representation corresponding to X, u i ∈R P Indicate u i Located in a P-dimensional feature space, C∈R n×n These are the network parameters of the fully connected layer, with a size of n by n.
[0058] The loss function of the composite subspace image clustering network is L, which contains four loss terms. The first loss term, L1, is the reconstruction error of the entire network, expressed by formula (1):
[0059]
[0060] Where X represents the input data. For output data, ||.|| F Let L be the Frobenius norm; the second loss term L2 is the self-representation reconstruction error of the input space, expressed by formula (2):
[0061]
[0062] Where X is the input data, XC is the self-representation reconstruction of the input space, and α is the balance coefficient; the third loss term L3 is the self-representation reconstruction error of the latent space, expressed by formula (3):
[0063]
[0064] Where U is the latent representation, UC is the self-representation reconstruction of the input space, and β is the balance coefficient; the fourth loss term L4 is the sparse loss of the self-representation coefficient matrix, expressed by formula (4):
[0065]
[0066] Where C is the self-expression coefficient matrix, λ is the balance coefficient, and the total loss is L = L1 + L2 + L3 + L4.
[0067] It can be observed that the image clustering network based on composite subspaces not only mines the self-expression relationship of samples in the latent space but also learns the self-expression relationship of samples in the input space. Furthermore, the self-expression of both parts uses the same self-expression matrix, which helps to learn better nonlinear mappings, thereby better capturing the subspace structure of samples and improving clustering accuracy.
[0068] The training process of the composite subspace image clustering network is carried out according to the following steps:
[0069] Step 1: Load the network parameters saved in Step 1 and randomly initialize the parameters of the fully connected neural network;
[0070] Step 2: Set the batch size to 100, use the ADAM optimizer, and train the composite subspace image clustering network on the GPU with the goal of minimizing the total loss L.
[0071] Step 3: After the training reaches the termination condition, end the training and obtain the trained composite subspace image clustering network.
[0072] Example 3
[0073] In step 3, the calculation process of constructing the similarity matrix based on the self-expression matrix is expressed by formula (5):
[0074]
[0075] In the above formula, C is the self-expression matrix and S is the similarity matrix.
[0076] The specific process of performing spectral clustering on the similarity matrix is as follows:
[0077] Calculate the degree matrix D using S, which is the sum of the elements in each row of the similarity matrix. Then calculate the Laplacian matrix L: L = DW. Arrange the eigenvalues in the Laplacian matrix from largest to smallest, calculate the eigenvectors corresponding to the first K eigenvalues, and use the K-means algorithm to cluster them to obtain K clusters, which are the clustering results.
[0078] This invention employs unsupervised learning to achieve image clustering. By simultaneously learning the self-expression coefficients in the input space and the latent space, a clear nonlinear mapping is obtained, embedding the input samples into the corresponding deep representation, thereby better capturing the subspace structure and improving the clustering accuracy.
Claims
1. A method of image clustering based on compound subspaces, characterized in that: Specifically, the following steps are implemented: Step 1, pre-training a convolutional autoencoder; Step 2, training a composite subspace image clustering network; Step 3, applying spectral clustering to obtain clustering results; The step 2 is specifically: constructing a composite subspace image clustering network, loading the network parameters saved in the step 1 into the composite subspace image clustering network as initial values, randomly initializing other parameters in the network, training the composite subspace image clustering network with a loss function target, and obtaining the trained composite subspace image clustering network; The composite subspace image clustering network comprises a feature extraction module and a self-expression module, wherein the feature extraction module is the convolutional autoencoder in step 1, and the self-expression module is realized by using a full connection layer without bias and an activation function, the input of the layer has n neurons which are the outputs of the encoder, and the output of the layer is the input of the decoder, is the output of the encoder, represents the corresponding latent representation, represents is in P a feature space of dimension, is the network parameter of the full connection layer, and the size is n times n ; The loss function of the composite subspace image clustering network is L, which includes four loss terms, the first loss term The reconstruction error of the entire network is represented by formula (1): (1) where, is the input data, is the output data, is the Frobenius norm; the second loss term is the self-representation reconstruction error in the input space, which is expressed by equation (2): (2) wherein, is the input data, is the self-reconstruction of the input space, is the balancing coefficient; the third loss term is the self-reconstruction error of the latent space, expressed by equation (3): (3) wherein, is a latent representation, is a self-representation reconstruction of the input space, is a balancing coefficient; a fourth loss term is a sparsity loss for the self-representation coefficient matrix, expressed by equation (4): (4) wherein, is a self-expression matrix, is a balance coefficient, total loss ; The step 3 is specifically: inputting the input data into the trained composite subspace image clustering network to obtain a self-expression matrix, constructing a similarity matrix according to the self-expression matrix, and applying spectral clustering to the similarity matrix to obtain the final clustering results.
2. The composite subspace-based image clustering method of claim 1, wherein: The step 1 is specifically: preprocessing the read image data, taking data reconstruction as the target, using the preprocessed image data as the input data, using the ADAM algorithm to optimize the convolutional autoencoder, ending the training when the decoder can well reconstruct the input data, and saving the network parameters of the convolutional autoencoder; The image data preprocessing is a normalization processing of the image data. If the image is too large, PCA is used for dimension reduction processing, and the image data is represented by a set of preprocessed image data, a set of labels, a corresponding label set, wherein, a set of labels, in a dimensional feature space, is a scalar representing the label of the data .
3. The composite subspace-based image clustering method of claim 2, wherein: The pre-training of the convolutional autoencoder is specifically implemented according to the following steps: Step 1, randomly initializing the network parameters of the convolutional autoencoder; Step 2, setting the batch size to 100, using the ADAM optimizer, and training the convolutional autoencoder on the GPU with reconstruction as the target; Step 3, after the training reaches the termination condition, ending the training, and saving the network parameters of the convolutional autoencoder.
4. The composite subspace-based image clustering method of claim 1, wherein: The training process of the composite subspace image clustering network is specifically implemented according to the following steps: Step 1, load the saved network parameters, and randomly initialize the parameters of the fully connected neural network; Step 2, set batch size to 100, use ADAM optimizer to minimize total loss To target, train the compound subspace image clustering network on the GPU; Step 3, after the training reaches the termination condition, ending the training, and obtaining the trained composite subspace image clustering network.
5. The composite subspace based image clustering method of claim 1, wherein: The calculation process of constructing a similarity matrix from a self-expression matrix is represented by formula (5): (5) wherein, is a self-expression matrix, is a similarity matrix.
6. The composite subspace-based image clustering method of claim 1, wherein: The specific process of spectral clustering on the similarity matrix is as follows: using calculating the degree matrix , that is, the sum of each row element of the similarity matrix, then calculating the Laplacian matrix : L = D-S, arranging the eigenvalues in the Laplacian matrix from large to small, calculating the eigenvectors corresponding to the first K eigenvalues, clustering the eigenvectors by using the K-means algorithm, and obtaining K clustering clusters, that is, the clustering result.