An image classification method based on machine learning and granulocyte spectrum clustering
By using machine learning and sphere clustering methods to dynamically adjust sphere size and similarity calculation, the problems of low image classification accuracy and high computational complexity in existing technologies are solved, achieving efficient and accurate image classification.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHONGQING UNIV OF POSTS & TELECOMM
- Filing Date
- 2025-05-07
- Publication Date
- 2026-06-19
AI Technical Summary
Existing image classification techniques have low accuracy in handling complex scenes, deep learning models require high computational resources, traditional clustering methods are computationally inefficient and sensitive to noise, and particle-sphere clustering has difficulty effectively capturing local features in sparse and dense regions, resulting in poor classification performance.
We employ a machine learning and spectral clustering approach, dynamically adjusting the particle size using a variable sparsity measure (VSM). By combining 2-means clustering and spectral clustering, we generate a more compact and adaptive particle partition. We then use the particle center feature vector and radius to calculate similarity and construct a graph structure for spectral clustering.
It improves the accuracy and robustness of image classification, reduces sensitivity to noise, reduces computational complexity, adapts to complex image data environments, and enhances classification efficiency and stability.
Smart Images

Figure CN120543910B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of computer technology, and in particular relates to an image classification method based on machine learning and particle-sphere clustering. Background Technology
[0002] In the field of image classification, with the rapid development of information technology, the amount of image data is growing exponentially, making the demand for efficient and accurate image classification technology increasingly urgent. However, current image classification technologies face many challenges.
[0003] Traditional image classification methods based on handcrafted features, such as HOG, rely on human experience to extract features. These methods have limited ability to represent features in complex images and are ill-suited for image classification tasks in complex scenes. Their classification accuracy drops significantly when faced with changes in lighting or object pose.
[0004] While deep learning methods have achieved remarkable results in image classification, they also have significant drawbacks. Training these models requires a large amount of labeled data, which is not only time-consuming and labor-intensive but also prone to inaccuracies. Furthermore, deep learning models have complex structures, and the training process demands extremely high computational resources, resulting in long training times and high costs, making them difficult to apply on resource-constrained devices.
[0005] Clustering algorithms play a crucial role in image classification, with traditional methods including partitioning clustering and hierarchical clustering. However, with the continuous increase in the scale and complexity of image data, especially the emergence of high-dimensional sparse data, traditional clustering methods have encountered bottlenecks in terms of computational efficiency and clustering accuracy.
[0006] Spectral clustering algorithms capture complex relationships by constructing similarity graphs between data points, offering advantages in the clustering stage of image classification. However, they are sensitive to data noise and computationally inefficient when processing large-scale image datasets, limiting their widespread application. Although some improved algorithms have been developed, these problems have not yet been completely resolved.
[0007] Granular computation and its derivative, granular sphere computation, offer novel approaches to image classification. Granular sphere computation simplifies data representation and facilitates integration with other models. However, existing granular sphere clustering methods have limitations when applied to complex image datasets. Faced with image data exhibiting both sparse and dense regions, they struggle to effectively capture local features, leading to imbalanced sphere partitioning and impacting clustering performance. Furthermore, static generation strategies based on fixed metrics lack flexibility and exhibit poor stability in high-dimensional sparse or noisy image data scenarios. Summary of the Invention
[0008] To address the problems existing in the background art, one aspect of the present invention provides an image classification method based on machine learning and particle-sphere spectral clustering, comprising:
[0009] S1: Obtain the image dataset and extract the feature vector of each image in the image dataset using a feature extraction model;
[0010] S2: Treat the feature vectors of all images in the image dataset as a whole to create an initial sphere, and calculate the variable sparsity measure (VSM) value of the initial sphere; if the VSM value is lower than a preset threshold, use the 2-means clustering algorithm to divide the sphere into two smaller spheres; if the VSM value is greater than or equal to the preset threshold, no further subdivision is required.
[0011] S3: Repeat the above VSM value calculation and segmentation operations for the newly generated spheres until the VSM values of all spheres meet the conditions;
[0012] S4: Calculate the similarity between the generated spheres based on the center feature vector of the sphere and the radius of the sphere;
[0013] S5: Based on the similarity between particles, the generated particles are divided into multiple clusters by spectral clustering, where each cluster represents a category;
[0014] S6: Calculate the similarity between the feature vector of the image sample to be tested and the central feature vector of each particle, and take the category of the cluster to which the most similar particle belongs as the classification result of the image sample to be tested.
[0015] Another aspect of the present invention provides an image classification system based on machine learning and particle-sphere spectral clustering, the system comprising a memory and a processor; the memory is used to store an application program; the processor is used to run the application program and execute the image classification method based on machine learning and particle-sphere spectral clustering.
[0016] Another aspect of the present invention provides a computer storage medium storing a remote monitoring program, which, when executed by a processor, implements the aforementioned image classification method based on machine learning and particle-sphere clustering.
[0017] The present invention has at least the following beneficial effects
[0018] Compared to traditional clustering algorithms, this invention overcomes the problems of existing particle sphere clustering methods, which rely on global data distribution and struggle to capture local features, by employing a particle sphere partitioning strategy based on Variable Sparsity Measure (VSM). By dynamically adjusting the particle size, it better adapts to the local characteristics of the data, avoids imbalanced particle sphere partitioning, and improves clustering performance. Compared to traditional spectral clustering algorithms, this invention reduces sensitivity to data noise. When processing large-scale image datasets, it simplifies data representation through particle spheres, reducing computational complexity and improving computational efficiency. Overall, this method improves the accuracy and robustness of image classification, can operate efficiently in complex image data environments, and provides more reliable and efficient technical support for the field of image classification. Attached Figure Description
[0019] Figure 1 This is a schematic diagram of the method flow of the present invention. Detailed Implementation
[0020] The following specific examples illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. Unless otherwise specified, the following embodiments and features can be combined with each other.
[0021] Please see Figure 1 This invention provides an image classification method based on machine learning and particle-sphere spectral clustering, comprising:
[0022] S1: Obtain the image dataset and extract the feature vector of each image in the image dataset using a feature extraction model;
[0023] Preferably, the feature extraction model includes: a manual feature extraction model or a deep learning feature extraction model, wherein the manual feature extraction model includes HOG and HOG; and the deep learning feature extraction model includes: convolutional neural network, VGG, autoencoder and ResNet.
[0024] In this embodiment, a feature extraction model is used to extract the feature vector of each image in the dataset. Feature extraction models are divided into two categories: manual feature extraction models and deep learning feature extraction models. HOG (Histogram of Oriented Gradients), a manual feature extraction model, describes the edge and shape features of an image by calculating the gradient direction and magnitude distribution of local regions. It is computationally simple and has a certain robustness to changes in illumination. Deep learning feature extraction models, such as Convolutional Neural Networks (CNNs), can automatically learn multi-level abstract features of images; VGG networks have a relatively regular structure and extract image features by stacking convolutional layers, exhibiting good feature representation capabilities; autoencoders can learn the latent representation of images, achieving data dimensionality reduction and feature extraction; ResNet introduces a residual structure, effectively solving the gradient vanishing problem in deep network training and better extracting complex image features.
[0025] S2: Treat the feature vectors of all images in the image dataset as a whole to create an initial sphere, and calculate the variable sparsity measure (VSM) value of the initial sphere; if the VSM value is lower than a preset threshold, use the 2-means clustering algorithm to divide the sphere into two smaller spheres; if the VSM value is greater than or equal to the preset threshold, no further subdivision is required.
[0026] Preferably, the variable sparsity measure (VSM) value of the granules includes:
[0027]
[0028]
[0029]
[0030]
[0031] in, Indicates granules The variable sparsity measure VSM value; and They represent granules and balls respectively. The feature vector of data point i and the eigenvector of data point j eigenvectors to the center of the grain Normalized membership degree; and Indicates an indicator function, if , If the value is 1, then its value is 1; otherwise, it is 0. Represents an exponential function; The feature vector representing data point i and the eigenvector of data point j Similarity between them; This indicates the set threshold parameter.
[0032] S3: Repeat the above VSM value calculation and segmentation operations for the newly generated spheres until the VSM values of all spheres meet the conditions;
[0033] In this embodiment, the feature vectors of all images in the image dataset are first integrated to construct an initial sphere. Next, the Variable Sparsity Measure (VSM) value of this sphere is calculated. The formula for calculating the VSM value is complex, involving multiple factors such as the normalized membership degree between the feature vectors of data points in the sphere and the feature vector of the sphere center, the indicator function, the similarity between data points, and a threshold parameter. The normalized membership degree reflects the closeness between the data points and the sphere center; calculating the similarity and membership degree of all data points may lead to high computational costs. To improve computational efficiency and reduce the impact of low-membership data points on similarity calculation, a threshold is introduced. and indicator functions. Only when the membership degree of the data point... and The similarity calculation of these data point pairs will only be considered when certain conditions are met. The indicator function is based on specific conditions. Determine the value; this ensures that data points with low membership degrees are relevant to the sphere. The computational impact is relatively small, thus focusing on calculating the similarity of "important" data points within the sphere; the similarity between data points is used to measure the similarity of the feature vectors of two data points; the threshold parameter is a standard set by humans.
[0034] The calculated VSM value is compared with a preset threshold. If the VSM value is lower than the preset threshold, it means that the data distribution within the current grain is relatively loose. In this case, the 2-means clustering algorithm is used to divide it into two smaller grains, making the data distribution more compact and reasonable. If the VSM value is greater than or equal to the preset threshold, it indicates that the data distribution within the grain is reasonable, and further subdivision is unnecessary. The advantages of supervised grain generation are introduced into the unsupervised grain generation framework. By integrating the local distribution features of the data, the proposed method achieves a more reasonable and adaptive partitioning strategy. This method flexibly combines the local distribution features of the data with the dynamic adjustment of the sparsity measure during grain generation, thereby generating more accurate and adaptive grains. This grain segmentation strategy based on VSM value and 2-means clustering algorithm can adaptively partition image data. By continuously adjusting the size and number of grains, the data features within each grain are made more similar and compact, effectively avoiding the problem of uneven data distribution. This not only improves the clustering quality of the data but also better captures the local features of the image data. In subsequent image classification processes, this optimized data partitioning method helps improve classification accuracy and efficiency, enhancing the performance and stability of the entire image classification system.
[0035] S4: Calculate the similarity between the generated spheres based on the center feature vector of the sphere and the radius of the sphere;
[0036] Preferably, the similarity between the granules includes:
[0037]
[0038] in, Indicates granules and pellets The similarity between them; Represents an exponential function; and They represent granules and balls respectively. and pellets The central eigenvector; and They represent granules and balls respectively. and pellets The radius.
[0039] Preferably, the radius of the sphere includes: the average distance from the feature vectors of all data points in the sphere to the central feature vector as the radius of the sphere.
[0040] In this embodiment, after completing the sphere partitioning (steps S2 and S3), step S4 focuses on calculating the similarity between different spheres. The calculation primarily relies on two key attributes of the sphere: the central feature vector and the radius. The radius of the sphere is obtained by averaging the distances from the feature vectors of all data points within the sphere to the central feature vector. This calculation method comprehensively reflects the dispersion of data points around the center within the sphere; a larger radius indicates that the data points are more dispersed relative to the center, and vice versa. In the similarity calculation formula between spheres, an exponential function is used to perform a non-linear transformation on the calculation results, enhancing the discriminative power between different similarity values. The central feature vector represents the core features of two spheres; by operating on them, the similarity between the two spheres at the feature level can be measured. The radius is also included in the calculation, taking into account the influence of the sphere size and data dispersion on the similarity. Combining these factors, the final result comprehensively and accurately reflects the similarity between spheres. In the subsequent spectral clustering (step S5), this similarity is used as the weight of the edges between nodes in the sphere to construct the graph structure, providing a reliable basis for clustering. By considering the center feature vector and radius of the sphere to calculate the similarity, the data feature information obtained in the sphere partitioning stage can be fully utilized, making the constructed graph structure more consistent with the inherent distribution pattern of the data. This helps improve the accuracy of spectral clustering, more reasonably classifying similar spheres into the same cluster, thus providing a more accurate basis for image classification, and ultimately improving the accuracy and reliability of image classification.
[0041] S5: Based on the similarity between particles, the generated particles are divided into multiple clusters by spectral clustering, where each cluster represents a category;
[0042] Step S5 includes:
[0043] S51: Treat each particle as a node and use the similarity between particles as the weight of the edges between particle nodes to construct a graph structure;
[0044] S52: Perform eigenvalue decomposition on the Laplacian matrix of the graph structure to map the particles to a low-dimensional space, and then use the K-means clustering algorithm in the low-dimensional space to cluster the particles into multiple clusters.
[0045] Preferably, step S52 includes:
[0046] S521: Construct the normalized Laplacian matrix of the graph structure, and use the QR algorithm to perform eigenvalue decomposition on the normalized Laplacian matrix of the graph structure. After multiple iterations, the Laplacian matrix in approximately diagonal form is obtained.
[0047] S522: Extract the eigenvalues on the diagonal of the Laplacian matrix in approximate diagonal form, sort them in ascending order, and select the k smallest eigenvalues.
[0048] S523: For each selected minimum eigenvalue, solve the homogeneous linear equation system: Obtain the eigenvector corresponding to each minimum eigenvalue. ,in, The normalized Laplacian matrix representing the graph structure; This represents the selected i-th eigenvalue; I represents the identity matrix;
[0049] S524: Form a matrix V by eigenvectors corresponding to the k smallest eigenvalues. By taking the central eigenvector of the sphere as the eigenvector of the sphere, and mapping the eigenvector of the sphere to a k-dimensional space according to matrix V, the K-means clustering algorithm is used to cluster the spheres to obtain the clustering result.
[0050] S6: Calculate the similarity between the feature vector of the image sample to be tested and the central feature vector of each particle, and take the category of the cluster to which the most similar particle belongs as the classification result of the image sample to be tested.
[0051] In this embodiment, step S5 aims to classify the generated particles using spectral clustering, forming different clusters, each representing an image category. In S51, each particle is treated as a node, and the similarity between particles is used as the weight of the edges to construct a graph structure. This structure can intuitively show the closeness of the relationships between particles. S52 maps the particles to a low-dimensional space by performing eigenvalue decomposition on the Laplacian matrix of the graph structure, and then uses the K-means clustering algorithm to complete the clustering of particles. Specifically, S521 first constructs a normalized Laplacian matrix, and then uses the QR algorithm iteratively multiple times to obtain a Laplacian matrix in approximate diagonal form. This step is the basis for subsequent calculations. S522 extracts and sorts the eigenvalues from the approximate diagonal matrix, selecting the top k smallest eigenvalues. These eigenvalues contain key structural information of the data. S523 solves a homogeneous linear equation system for each smallest eigenvalue to obtain the corresponding eigenvector. Step S524 involves assembling these feature vectors into matrix V, which is then used to map the central feature vectors of the spheres into a k-dimensional space. Finally, the clustering result is obtained using the K-means clustering algorithm. Step S6 classifies the image samples to be tested. By calculating the similarity between the feature vectors of the image samples to be tested and the central feature vectors of each sphere, the cluster to which the sphere with the highest similarity belongs is determined as the category of the image sample to be tested.
[0052] This series of steps realizes a complete process from particle sphere construction to image classification, with significant results. In the clustering stage, the spectral clustering method, combined with the graph structure constructed from particle sphere similarity, can effectively handle complex data distributions. Compared with traditional clustering algorithms, it has better clustering results for data with irregular shapes and uneven density, improving the accuracy and stability of clustering. In the classification stage, similarity is calculated with the feature vector of the particle center as a reference, making full use of the results of previous data processing and clustering, enhancing the reliability of classification, and more accurately determining the category of the image to be tested, thereby improving the performance of the entire image classification system and meeting the needs of various image classification application scenarios.
[0053] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0054] In summary, compared to traditional clustering algorithms, this invention overcomes the problems of existing particle sphere clustering methods relying on global data distribution and failing to capture local features through a particle sphere partitioning strategy based on Variable Sparsity Measure (VSM). By dynamically adjusting the particle size, it can better adapt to the local characteristics of the data, avoid imbalanced particle sphere partitioning, and improve clustering performance. Compared to traditional spectral clustering algorithms, this invention reduces sensitivity to data noise. When processing large-scale image datasets, it simplifies data representation through particle spheres, reducing computational complexity and improving computational efficiency. Overall, this method improves the accuracy and robustness of image classification, can operate efficiently in complex image data environments, and provides more reliable and efficient technical support for the field of image classification.
[0055] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. An image classification method based on machine learning and granulocyte spectrum clustering, characterized in that, include: S1: Obtain the image dataset and extract the feature vector of each image in the image dataset using a feature extraction model; S2: Treat the feature vectors of all images in the image dataset as a whole to create an initial sphere, and calculate the variable sparsity measure (VSM) value of the initial sphere; if the VSM value is lower than a preset threshold, use the 2-means clustering algorithm to divide the sphere into two smaller spheres; if the VSM value is greater than or equal to the preset threshold, no further subdivision is required. The variable sparsity measure (VSM) of granules includes: in, Indicates granules The variable sparsity measure VSM value; and They represent granules and balls respectively. The feature vector of data point i and the eigenvector of data point j eigenvectors to the center of the grain Normalized membership degree; Indicates an indicator function, if If the value is 1, then its value is 1; otherwise, it is 0. Indicates an indicator function, if If the value is 1, then its value is 1; otherwise, it is 0. Represents an exponential function; The feature vector representing data point i and the eigenvector of data point j Similarity between them; This represents the set threshold parameter; n represents the number of data points. S3: Repeat the above VSM value calculation and segmentation operations for the newly generated spheres until the VSM values of all spheres meet the conditions; S4: Calculate the similarity between the generated spheres based on the center feature vector of the sphere and the radius of the sphere; S5: Based on the similarity between particles, the generated particles are divided into multiple clusters by spectral clustering, where each cluster represents a category; Step S5 includes: S51: Treat each particle as a node and use the similarity between particles as the weight of the edges between particle nodes to construct a graph structure; S52: Perform eigenvalue decomposition on the Laplacian matrix of the graph structure to map the particles to a low-dimensional space, and then use the K-means clustering algorithm in the low-dimensional space to cluster the particles into multiple clusters; S6: Calculate the similarity between the feature vector of the image sample to be tested and the central feature vector of each particle, and take the category of the cluster to which the most similar particle belongs as the classification result of the image sample to be tested.
2. The image classification method based on machine learning and granulocyte spectrum clustering according to claim 1, characterized in that, The feature extraction models include: manual feature extraction models or deep learning feature extraction models, wherein manual feature extraction models include HOG and HOG; and deep learning feature extraction models include: convolutional neural networks, VGG, autoencoders, and ResNet. 3.The method of claim 1, wherein, The similarity between the granules includes: in, Indicates granules and pellets The similarity between them; Represents an exponential function; and They represent granules and balls respectively. and pellets The central eigenvector; and They represent granules and balls respectively. and pellets The radius.
4. The image classification method based on machine learning and granulocyte spectrum clustering according to claim 1, characterized in that, The radius of the sphere is defined as the average distance from the feature vectors of all data points in the sphere to the central feature vector.
5. The method of claim 1, wherein the method is based on machine learning and granulocyte spectrum clustering. Step S52 includes: S521: Construct the normalized Laplacian matrix of the graph structure, and use the QR algorithm to perform eigenvalue decomposition on the normalized Laplacian matrix of the graph structure. After multiple iterations, the Laplacian matrix in approximately diagonal form is obtained. S522: Extract the eigenvalues on the diagonal of the Laplacian matrix in approximate diagonal form, sort them in ascending order, and select the k smallest eigenvalues. S523: For each selected minimum eigenvalue, solve the homogeneous linear equation system: Obtain the eigenvector corresponding to each minimum eigenvalue. ,in, The normalized Laplacian matrix representing the graph structure; This represents the selected i-th eigenvalue; I represents the identity matrix; S524: Form a matrix V by eigenvectors corresponding to the k smallest eigenvalues. By taking the central eigenvector of the sphere as the eigenvector of the sphere, and mapping the eigenvector of the sphere to a k-dimensional space according to matrix V, the K-means clustering algorithm is used to cluster the spheres to obtain the clustering result.
6. An image classification system based on machine learning and granulocyte spectral clustering, characterized by, The system includes a memory and a processor; the memory is used to store an application program; the processor is used to run the application program and execute an image classification method based on machine learning and particle spheroid clustering as described in any one of claims 1 to 5.
7. A computer storage medium, characterized in that The computer storage medium stores a remote monitoring program, which, when executed by a processor, implements an image classification method based on machine learning and particle-sphere clustering as described in any one of claims 1 to 5.