Adaptive clustering method and system for large scale image classification

CN122220919BActive Publication Date: 2026-09-18CHANGSHU INSTITUTE OF TECHNOLOGY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202610670713.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-05-15
Publication Date
2026-09-18
Estimated Expiration
2046-05-15

AI Technical Summary

Technical Problem

[0003]现有的多数聚类算法存在以下明显缺陷:1)需要提前将聚类算法的类别数设置成大规模图像中的实际类别数,而在实际应用场景中,大规模图像中的类别数往往是一个未知数

Benefits of technology

本申请实施例通过计算随机样本的平均距离,为整个聚类过程提供了一个自适应的距离尺度,使算法能自动适应不同数据集的内在分布,避免了手动设定邻域半径的困扰。本申请实施例通过步骤S2的初始化与步骤S3的候选对生成,共同构建了一个基于局部吸引力的动态筛选机制,通过物理属性和吸引力阈值,算法能有效识别出空间邻近且关联紧密的样本对,为高质量融合奠定基础,同时大幅减少了需要全局评估的候选对数量,提升了计算效率。本申请实施例通过步骤S4的评估与步骤S5的判定是整个方法的核心创新,通过引入表面能变化与内部压强双重类物理判据,算法模拟了类似液滴融合的物理过程,确保每次融合都能使簇的结构更为紧凑且内部密度不至于过高,从而能自然地发现任意形状的簇,并避免了将差异过大的样本或噪声强行合并。本申请实施例通过步骤S6的融合与更新操作,以及步骤S7的后处理,共同保证了结果的稳定与纯净,步骤S6在每次融合后动态更新簇和候选集合,使得聚类过程能迭代式、层次化地演进,类别数在此过程中自动产生,无需预先设定,步骤S7则通过删除单样本簇和合并小簇,有效剔除了噪声和离群点,显著增强了算法在真实含噪数据上的鲁棒性,最终输出更准确的分类结果。综上,本申请实施例实现了无需预设类别数、能识别任意形状簇且对噪声鲁棒的自适应图像聚类。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122220919B_ABST
    Figure CN122220919B_ABST
Patent Text Reader

Abstract

This application discloses an adaptive clustering method and system for large-scale image classification, relating to the technical fields of artificial intelligence, machine learning, and image processing. The method includes: randomly selecting a portion of samples from a set of image samples to be classified and calculating the average distance between the selected samples; initializing each sample in the image sample set as a corresponding single independent cluster; adding cluster pairs whose attraction between each current independent cluster and other clusters falling within its average distance range is greater than the attraction threshold to a cluster candidate pair set; calculating the actual cluster surface energy of the target cluster candidate pair before fusion, the virtual cluster surface energy of the virtual cluster generated after virtual fusion, and the internal pressure of the virtual cluster; screening the target cluster candidate pairs that meet the conditions for actual fusion; generating an actual new cluster until the cluster candidate pair set is empty; and outputting all current clusters as the clustering result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the fields of artificial intelligence, machine learning and image processing, and in particular to adaptive clustering methods and systems for large-scale image classification. Background Technology

[0002] In the field of image classification, deep neural networks (such as convolutional neural networks) are often used to train and classify large-scale images, which is essentially a supervised learning problem. However, on the one hand, manual annotation of large-scale images is very expensive; on the other hand, deep modeling on large-scale images often requires learning a huge number of parameters, resulting in significant model complexity and demanding hardware resources. Therefore, it has become possible to achieve large-scale image classification using clustering algorithms based on unsupervised learning, such as k-means clustering, AP clustering, and DBSCAN clustering.

[0003] Most existing clustering algorithms suffer from the following significant drawbacks: 1) The number of clusters in the clustering algorithm needs to be pre-set to match the actual number of clusters in a large-scale image. However, in real-world applications, the number of clusters in a large-scale image is often unknown. The optimal solution is for the clustering algorithm to adaptively identify the clusters. 2) Samples belonging to the same category in a large-scale image set will form clusters of varying shapes. Due to certain assumptions in the clustering process, such as distance metrics, most existing clustering algorithms cannot effectively identify these irregularly shaped clusters, resulting in poor clustering performance. 3) Large-scale image sets are prone to noise, and the performance of clustering algorithms is easily affected by noise, leading to poor generalization performance.

[0004] Therefore, there is an urgent need for an adaptive clustering scheme that can be effectively used for fast and accurate classification of large-scale images. Summary of the Invention

[0005] This application proposes an adaptive clustering method and system for large-scale image classification to address the shortcomings of the prior art.

[0006] According to a first aspect of the embodiments of this application, an adaptive clustering method for large-scale image classification is provided, comprising: Step S1: Randomly select a portion of the samples from the image sample set to be classified, and calculate the average distance between the selected samples; Step S2: Initialize each sample in the image sample set as a corresponding single independent cluster, and configure the initialized physical properties for each independent cluster; set an attraction threshold for determining whether independent clusters can form cluster candidate pairs, and an internal maximum pressure threshold for constraining the tightness of independent clusters; Step S3: Calculate the attraction between each current independent cluster and other clusters falling within its average distance range, and add cluster pairs with attraction greater than the attraction threshold to the cluster candidate pair set; Step S4: Select the target cluster candidate pair with the greatest attraction from the set of cluster candidate pairs, and calculate the actual cluster surface energy of the target cluster candidate pair before fusion, the virtual cluster surface energy of the virtual cluster generated after virtual fusion, and the internal pressure of the virtual cluster. Step S5: Based on the actual cluster surface energy and the change in surface energy between the actual cluster surface energy and the virtual cluster surface energy, as well as the internal pressure of the virtual cluster, select the target cluster candidate pairs that meet the conditions for actual fusion. Step S6: Merge two clusters in the target cluster candidate pair that meet the actual fusion conditions to generate a new actual cluster and replace the original two clusters with the new actual cluster. Update the cluster list and delete the cluster candidate pair set that contains the merged cluster. Iterate through steps S4 to S6 until the cluster candidate pair set is empty. Step S7: Delete clusters containing only a single sample from the updated cluster list, merge small clusters with fewer than a predetermined threshold of samples into the nearest cluster based on the nearest distance between the cluster centers of the small clusters, and output all current clusters as the clustering result.

[0007] In some implementations, the step of randomly selecting a subset of samples from the image sample set to be classified and calculating the average distance between the selected samples includes: From the set of image samples to be classified, which contains N samples, N / 5 samples are randomly and uniformly selected to form a sample subset; The average Euclidean distance between all pairs of samples within the sample subset is calculated as the average distance between the samples.

[0008] In some implementations, the initial physical properties include initial mass, initial radius, and center, each independent cluster contains a single sample, and each independent cluster has an initial mass of 1 and an initial radius of 10. -3 The initial center is the feature vector of the corresponding sample; the attraction threshold is set to 10. -3 The maximum internal pressure threshold is set to 1.

[0009] In some implementations, the calculation of the attraction between each current independent cluster and other clusters falling within the average distance range, and the addition of cluster pairs with attraction greater than the attraction threshold to the cluster candidate pair set, is obtained through the following mathematical expression: ; in, Indicates the current number Independent clusters and falling in the first The attraction between other clusters within the average distance range of an independent cluster; The center of the cluster is represented by the mean of the feature vectors of all samples within the cluster. Representative cluster candidate pair set The first in Each cluster, the Distance cluster The set of all clusters within the said average distance range, Represents the set of candidate cluster pairs The total number of clusters; Represented by natural numbers An exponential function with base 0. , Representing clusters ,cluster The center.

[0010] In some implementations, the calculation of the actual cluster surface energy of the target cluster candidate pair before fusion is obtained by the following mathematical expression: ; The virtual cluster surface energy of the virtual cluster generated after virtual fusion of the target cluster candidate pairs is calculated using the following mathematical expression: ; The internal pressure of the virtual cluster generated after the target cluster candidate pair is virtually fused is calculated using the following mathematical expression: ; in, Candidate pairs of target clusters with the maximum attraction value between clusters are denoted as... ; This represents the actual cluster surface energy of the target cluster candidate pair; This represents the virtual cluster surface energy of the target cluster candidate pair; , Representing clusters , Surface energy coefficient; , Representing clusters , Surface area; This represents the surface area of ​​the virtual cluster generated after virtual fusion; This represents the balance coefficient, with a value of 0.01. This indicates the internal pressure of the virtual cluster; This represents the radius of the virtual cluster.

[0011] In some implementations, the screening of candidate pairs of target clusters that meet the conditions for actual fusion includes: When the surface energy change is negative and the internal pressure of the virtual cluster is less than the maximum internal pressure threshold, the target cluster candidate pair is determined to meet the conditions for actual fusion. Otherwise, if the target cluster candidate pair is determined not to meet the conditions for actual fusion, the current target cluster candidate pair is deleted and the process returns to step S4 to select a new target cluster candidate pair.

[0012] In some implementations, replacing the two existing clusters with the actual new cluster includes: The quality of the actual new cluster is the sum of the qualities of the two independent clusters that are fused; the center of the actual new cluster is the mean of the feature vectors of all samples within the cluster; the radius of the actual new cluster is the maximum Euclidean distance between the sample pairs that constitute the actual new cluster.

[0013] In some implementations, the predetermined number threshold is 10, and merging small clusters with fewer than the predetermined number threshold into the nearest cluster based on the nearest distance between the cluster centers of the small clusters includes: Clusters with a sample size greater than or equal to 2 but less than 10 are defined as the small clusters, and the operation of merging the small clusters into the nearest clusters based on the nearest distance from their cluster centers is performed.

[0014] In some implementations, the method further includes, before randomly selecting a subset of samples from the image sample set to be classified: The original images are used to extract features using a convolutional neural network, and each image is converted into a feature vector. Based on the set of all feature vectors, construct the image sample set to be classified.

[0015] According to a second aspect of this application, an adaptive clustering system for large-scale image classification includes: The sample selection module is used to randomly select a portion of the images from the set of images to be classified and to calculate the average distance between the selected samples. The independent cluster configuration module is used to initialize each sample in the image sample set as a corresponding single independent cluster, and configure the initialized physical attributes for each independent cluster; it sets an attraction threshold for determining whether independent clusters can form cluster candidate pairs, and an internal maximum pressure threshold for constraining the tightness of independent clusters. An attraction determination module is used to calculate the attraction between each current independent cluster and other clusters falling within its average distance range, and to add cluster pairs with attraction greater than the attraction threshold to a cluster candidate pair set; The surface energy determination module is used to select the most attractive target cluster candidate pair from the cluster candidate pair set, and calculate the actual cluster surface energy of the target cluster candidate pair before fusion, the virtual cluster surface energy of the virtual cluster generated after virtual fusion, and the internal pressure of the virtual cluster. The target cluster candidate pair screening module is used to screen the target cluster candidate pairs that meet the actual fusion conditions based on the actual cluster surface energy and the change in surface energy between the actual cluster surface energy and the virtual cluster surface energy, as well as the internal pressure of the virtual cluster. The new cluster fusion module is used to actually merge two clusters in the target cluster candidate pair that meet the actual fusion conditions, generate an actual new cluster, replace the original two clusters with the actual new cluster, update the cluster list, and delete the cluster candidate pair set that contains the merged cluster. Iteratively execute the execution operations of the surface energy determination module, the target cluster candidate pair screening module, and the new cluster fusion module until the cluster candidate pair set is empty. The clustering result output module is used to delete clusters containing only a single sample from the updated cluster list, merge small clusters with fewer than a predetermined threshold of samples into the nearest cluster according to the nearest distance between the cluster centers of the small clusters, and output all current clusters as clustering results.

[0016] The beneficial effects of the adaptive clustering method and system for large-scale image classification in the embodiments of this application include at least the following: This application embodiment provides an adaptive distance scale for the entire clustering process by calculating the average distance of random samples, enabling the algorithm to automatically adapt to the inherent distribution of different datasets and avoiding the hassle of manually setting the neighborhood radius. This application embodiment constructs a dynamic screening mechanism based on local attraction through initialization in step S2 and candidate pair generation in step S3. Using physical properties and attraction thresholds, the algorithm effectively identifies spatially adjacent and closely related sample pairs, laying the foundation for high-quality fusion, while significantly reducing the number of candidate pairs requiring global evaluation and improving computational efficiency. The evaluation in step S4 and the determination in step S5 are the core innovations of this application embodiment. By introducing dual physical criteria of surface energy change and internal pressure, the algorithm simulates a physical process similar to droplet fusion, ensuring that each fusion results in a more compact cluster structure without excessive internal density. This allows for the natural discovery of clusters of arbitrary shapes and avoids forcibly merging samples with excessive differences or noise. This embodiment of the application ensures the stability and purity of the results through the fusion and update operations in step S6 and the post-processing in step S7. Step S6 dynamically updates the clusters and candidate sets after each fusion, enabling the clustering process to evolve iteratively and hierarchically. The number of categories is automatically generated during this process without the need for pre-setting. Step S7 effectively removes noise and outliers by deleting single-sample clusters and merging small clusters, significantly enhancing the robustness of the algorithm on real noisy data and ultimately outputting more accurate classification results. In summary, this embodiment of the application achieves adaptive image clustering that does not require pre-setting the number of categories, can identify clusters of arbitrary shapes, and is robust to noise. Attached Figure Description

[0017] Figure 1 This is a flowchart illustrating an adaptive clustering method for large-scale image classification according to an embodiment of this application. Figure 2 This is a diagram showing the actual data distribution of the sample set in the embodiments of this application; Figure 3 This is a diagram illustrating how each sample is treated as a cluster containing a single sample, according to an embodiment of this application. Figure 4 This is a diagram illustrating the fusion result of the t=1th iteration in an embodiment of this application. Figure 5 This is a diagram illustrating the fusion result of the t=2th iteration in an embodiment of this application. Figure 6 This is a diagram illustrating the fusion result of the t=3rd fusion iteration in an embodiment of this application. Figure 7 This is a diagram illustrating the fusion result of the t=4th iteration in an embodiment of this application. Figure 8 This is a diagram illustrating the fusion result at t=5 in an embodiment of this application. Figure 9This is a diagram illustrating the fusion result at t=6 in an embodiment of this application. Figure 10 This is a diagram illustrating the fusion result at t=7 in an embodiment of this application. Figure 11 This is a diagram illustrating the fusion result at t=8 in an embodiment of this application. Figure 12 This is a diagram illustrating the fusion result at t=9 in an embodiment of this application. Figure 13 The figure shows the results of verifying the performance of the embodiments of this application using the CIFAR10 dataset. Detailed Implementation

[0018] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the various embodiments of this disclosure will be described in detail below with reference to the accompanying drawings. However, those skilled in the art will understand that many technical details have been provided in the various embodiments of this disclosure to facilitate a better understanding of the disclosure. However, the technical solutions claimed in this disclosure can be implemented even without these technical details and with various variations and modifications based on the following embodiments. The division of the various embodiments below is for ease of description and should not constitute any limitation on the specific implementation of this disclosure. The various embodiments can be combined with and referenced by each other without contradiction.

[0019] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the claimed embodiments of the present application, but merely to illustrate selected embodiments of the present application. Other embodiments obtained by those skilled in the art based on the embodiments of the present application without inventive effort are all within the scope of protection of the embodiments of the present application.

[0020] This application discloses an adaptive clustering method and system for large-scale image classification. The adaptive clustering method for large-scale image classification is applied to the adaptive clustering system for large-scale image classification, with the aim of providing an effective adaptive clustering scheme for fast and accurate classification of large-scale images.

[0021] See attached document Figure 1 The diagram illustrates a flowchart of an adaptive clustering method for large-scale image classification according to an embodiment of this application. This adaptive clustering method for large-scale image classification includes the following steps S1 to S7.

[0022] Step S1: Randomly select a portion of the images from the set of images to be classified, and calculate the average distance between the selected samples.

[0023] In some implementations, the random selection of a subset of samples from the image sample set to be classified and the calculation of the average distance between the selected samples include: randomly and uniformly selecting N / 5 samples from the image sample set to be classified, which contains N samples, to form a sample subset; and calculating the average Euclidean distance between all sample pairs within the sample subset as the average distance between the samples.

[0024] In some implementations, before randomly selecting a subset of samples from the image sample set to be classified, the method further includes: using a convolutional neural network to extract features from the original images and converting each image into a feature vector; and constructing the image sample set to be classified based on the set of all feature vectors.

[0025] For example, step S1 includes the following sub-steps S11 to S12.

[0026] Sub-step S11: Use a convolutional neural network to extract features from a given large-scale image to form a large-scale image sample set. ,in, This represents a sample after feature extraction from each image in a large-scale image dataset using a convolutional neural network. This represents the number of images contained in a large-scale image.

[0027] Sub-step S12: From this large-scale image sample set One-fifth of the samples are randomly and uniformly selected to form the image sample set. And calculate the average distance between the selected samples, the formula of which is expressed as: ; in, , represent , belong , It represents the L2 norm.

[0028] Step S2: Initialize each sample in the image sample set as a corresponding single independent cluster, and configure the initial physical properties for each independent cluster; set the attraction threshold for determining whether independent clusters can form cluster candidate pairs, and the internal maximum pressure threshold for constraining the tightness of independent clusters.

[0029] For example, the initialized physical properties include the initialized mass, the initialized radius, and the center.

[0030] For example, each of these independent clusters contains a single sample, and each independent cluster has an initial quality of 1 and an initial radius of 10. -3 And the initial center is the feature vector of the corresponding sample.

[0031] For example, the attraction threshold is set to 10. -3 The maximum internal pressure threshold is set to 1.

[0032] In some implementations, the method further includes initializing each sample in the image sample set as a corresponding single independent cluster and numbering it.

[0033] For example, step S2 includes the following sub-steps S21 to S23.

[0034] Sub-step 21: Set the cluster candidate pair iterative fusion sequence number .

[0035] Sub-step 22: This large-scale image sample set Each sample in the dataset is considered as a cluster containing a single sample, and each cluster is numbered to form a cluster. And form a cluster set ,in, , Representing the The total number of clusters in the wheel, when hour, .

[0036] Sub-step 23: For this cluster Initialize its physical properties and set the inter-cluster attraction threshold. And the maximum intra-cluster pressure threshold generated during each cluster candidate pair iteration fusion process This initialization cluster Physical properties include mass ,radius ,center The inter-cluster attraction threshold And the maximum pressure threshold within the cluster generated during each iteration of cluster candidate pair fusion. .

[0037] Sub-step S3: Calculate the attraction between each current independent cluster and other clusters falling within its average distance range, and add cluster pairs with attraction greater than the attraction threshold to the cluster candidate pair set.

[0038] For example, the calculation of the attraction between each current independent cluster and other clusters falling within the average distance range, and the addition of cluster pairs with attraction greater than the attraction threshold to the cluster candidate pair set, is obtained through the following mathematical expression: ; in, Indicates the current number Independent clusters and falling in the first The attraction between other clusters within this average distance range of an independent cluster; The center of the cluster is represented by the mean of the feature vectors of all samples within the cluster. Representative cluster candidate pair set The first in A cluster, the Distance cluster The set of all clusters within this average distance range, Represents the set of candidate cluster pairs The total number of clusters; Represented by natural numbers An exponential function with base 0. , Representing clusters ,cluster The center.

[0039] For example, , The results are obtained by calculating the following mathematical expressions: ; ; in, , Representing clusters and cluster The samples in; , Representing clusters and cluster The quality of , whose values ​​are respectively equal to the cluster and cluster The number of samples in the sample.

[0040] For example, if the Greater than the inter-cluster attraction threshold in step S23 Then the cluster can be determined. and cluster as potential fusionable cluster candidate pairs All of the clusters in step S22 All cluster candidate pairs form a cluster candidate pair set, denoted as .

[0041] Step S4: Select the most attractive target cluster candidate pair from the set of cluster candidate pairs, and calculate the actual cluster surface energy of the target cluster candidate pair before fusion, the virtual cluster surface energy of the virtual cluster generated after virtual fusion, and the internal pressure of the virtual cluster.

[0042] In some implementations, the actual cluster surface energy of the target cluster candidate pair before fusion is calculated using the following mathematical expression: ; The virtual cluster surface energy of the virtual cluster generated after virtual fusion of the target cluster candidate pair is calculated using the following mathematical expression: ; The internal pressure of the virtual cluster generated after virtual fusion of the target cluster candidate pair is calculated using the following mathematical expression: ; in, Candidate pairs of target clusters with the maximum attraction value between clusters are denoted as... ; This represents the actual cluster surface energy of the target cluster candidate pair; This represents the virtual cluster surface energy of the candidate target cluster pair; , Representing clusters , Surface energy coefficient; , Representing clusters , Surface area; This represents the surface area of ​​the virtual cluster generated after virtual fusion; This represents the balance coefficient, with a value of 0.01. This indicates the internal pressure of the virtual cluster; This represents the radius of the virtual cluster.

[0043] For example, step S4 includes the following sub-steps S41 to S42.

[0044] Sub-step S41: From the set of candidate pairs for this cluster Select candidate cluster pairs with the highest inter-cluster attraction value, and denote them as... .

[0045] Sub-step S42: For the part in step S41 Calculate the cluster surface energy before and after fusion, where the The surface energy of the cluster before fusion is calculated using the following mathematical expression: ; The virtual cluster surface energy of the virtual cluster generated after virtual fusion of the target cluster candidate pair is calculated using the following mathematical expression: ; The internal pressure of the virtual cluster generated after virtual fusion of the target cluster candidate pair is calculated using the following mathematical expression: ; in, Candidate pairs of target clusters with the maximum attraction value between clusters are denoted as... ; This represents the actual cluster surface energy of the target cluster candidate pair; This represents the virtual cluster surface energy of the candidate target cluster pair; , Representing clusters , Surface energy coefficient; , Representing clusters , Surface area; This represents the surface area of ​​the virtual cluster generated after virtual fusion; This represents the balance coefficient, with a value of 0.01. This indicates the internal pressure of the virtual cluster; This represents the radius of the virtual cluster.

[0046] For example, ; ; in, , They represent candidate pairs of the cluster respectively. medium cluster ,cluster The radius.

[0047] in, Represents candidate pairs for this cluster Assuming the radius of the new cluster generated after fusion can be calculated using the following mathematical expression: ; in, Represents candidate pairs for this cluster medium cluster Included samples to clusters The maximum distance between the included samples.

[0048] Step S5: Based on the surface energy of the actual cluster and the surface energy change of the virtual cluster, as well as the internal pressure of the virtual cluster, select the target cluster candidate pairs that meet the conditions for actual fusion.

[0049] In some implementations, the screening of the target cluster candidate pair that meets the actual fusion conditions includes: determining that the target cluster candidate pair meets the actual fusion conditions when the surface energy change is negative and the internal pressure of the virtual cluster to which it belongs is less than the maximum internal pressure threshold; otherwise, determining that the target cluster candidate pair does not meet the actual fusion conditions, deleting the current target cluster candidate pair and returning to step S4 to select a new target cluster candidate pair.

[0050] It is understood that in step S5, the selected cluster candidate pair is determined based on the change in cluster surface energy and the assumed internal pressure of the merged cluster to determine whether fusion can be implemented. If fusion cannot be implemented, the cluster candidate pair is removed from the cluster candidate pair set and the process returns to step S4; otherwise, step S6 is executed. For example, step S5 includes the following sub-steps S51 to S53.

[0051] Sub-step S51: Calculate candidate pairs for the cluster The changes in cluster surface energy before and after fusion are expressed by the following formula: ; Sub-step S52: Calculate candidate pairs for the cluster Assuming the internal pressure of the new cluster generated after fusion can be calculated using the following formula: ; Sub-step S53: Based on the changes in cluster surface energy and the assumed internal pressure of the cluster after fusion, the candidate cluster pairs are determined. Whether integration can be implemented, i.e., if the following conditions are met. and Then the candidate pairs of this cluster can be determined. If the fusion can be implemented and step S6 can continue, but the conditions are not met... and Then the candidate pair of the cluster From the cluster candidate pair set in step S3 Delete, set , Then return to step S4.

[0052] Step S6: Merge the two clusters in the target cluster candidate pair that meet the actual fusion conditions to generate a new actual cluster and replace the original two clusters with the new actual cluster. Update the cluster list and delete the cluster candidate pair set that contains the merged cluster. Iterate through steps S4 to S6 until the cluster candidate pair set is empty.

[0053] In some implementations, replacing the two original clusters with the actual new cluster includes: the quality of the actual new cluster is the sum of the qualities of the two independent clusters that are fused; the center of the actual new cluster is the mean of the feature vectors of all samples within the cluster; and the radius of the actual new cluster is the maximum Euclidean distance between the sample pairs that constitute the actual new cluster.

[0054] It can be understood that in step S6, the selected cluster candidate pairs are fused to generate a new cluster, and other cluster candidate pairs associated with samples in the selected cluster candidate pairs are removed from the cluster candidate pair set. If the cluster candidate pair set is empty, the entire cluster candidate pair iterative fusion procedure stops; otherwise, it returns to step S4. For example, step S6 includes the following sub-steps S61 to S63.

[0055] Sub-step S61: For the candidate pairs in sub-step S53 of this cluster After confirming that fusion can be implemented, The fusion is performed to generate a new cluster, denoted as Simultaneously update the cluster set in sub-step S22. The new cluster is about to be Add the cluster set to sub-step S22 In the middle, delete the cluster set at the same time. Clusters in and cluster .

[0056] Sub-step S62: Update the new cluster using the methods described in sub-step S42. radius At the same time, update the new cluster. The mass of is calculated using the following formula: ; in, , They represent candidate pairs of the cluster respectively. medium cluster ,cluster The quality of the cluster is called the quality of the cluster. ,cluster Number of samples included.

[0057] Sub-step S63: Combine with the candidate pairs of this cluster from sub-step S53 medium cluster ,cluster All associated cluster candidate pairs are derived from the cluster candidate pair set in sub-step S32. Delete it, and check at the same time. If the set is empty, the iterative fusion process for the entire cluster candidate pair stops; otherwise, the updated cluster set in sub-step S61 is processed. All clusters are ordered from 1 to Renumber and set , Then return to step S4.

[0058] Step S7: Delete clusters containing only a single sample from the updated cluster list, merge small clusters with fewer than a predetermined threshold of samples into the nearest cluster based on the nearest distance between the cluster centers of the small clusters, and output all current clusters as the clustering result.

[0059] For example, the predetermined quantity threshold is 10.

[0060] In some implementations, merging small clusters with fewer than a predetermined threshold of samples into the nearest cluster based on the nearest distance from the cluster center of the small cluster includes: defining a cluster with a sample size greater than or equal to 2 but less than 10 as the small cluster, and performing the operation of merging the small cluster into the nearest cluster based on the nearest distance from the cluster center of the small cluster.

[0061] It is understood that in step S7, after the iterative fusion process of the entire cluster candidate pair stops, the remaining clusters that did not participate in the fusion of the cluster candidate pairs are regarded as noise samples and deleted. At the same time, for clusters consisting of fewer than 10 samples, they are forcibly assigned to the cluster closest to their center according to the distance between the cluster centers, and all the clusters finally formed are used as the classification result of the large-scale image. Step S7 includes the following sub-steps S71 to S73.

[0062] Step S71: Confirm the cluster set generated in sub-step S63 If a cluster contains a single sample, it is considered a noise sample and removed from the cluster set. Delete it.

[0063] Step S72: Confirm the cluster set generated in sub-step S71 Does it exist in 2? If a cluster of 10 samples exists, it is forcibly assigned to the cluster closest to its center based on the distance from the cluster center.

[0064] Step S73: Combine the cluster sets finally formed in sub-step S72 All clusters are used as classification results for large-scale images.

[0065] See attached document Figure 2 The diagram shows the actual data distribution of an embodiment of this application, comprising two categories (represented by red and blue solid circles) totaling [data missing]. Taking a sample set of 100 samples as an example, each sample in the sample set contains two dimensions: Feature 1 and Feature 2. (See Appendix) Figure 3-12 As shown, the fusion results of each cluster candidate pair in this embodiment are illustrated. A total of 9 cluster candidate pair fusions were performed, in which... Figure 3 Demonstrating Figure 2 Each sample is treated as a cluster containing a single sample, resulting in a total of 11 clusters (where the clusters inside the solid circles are...). The center of the sample (as shown in the above analysis, each sample is initially its center), each cluster is represented by a different color and circled in black, with the following... Figure 4 To be continued Figure 12 This shows the fusion results of each cluster candidate pair. The samples contained in the newly generated cluster are represented by the same color, with the samples outside the solid circle... This represents the center of the newly generated cluster. Among them, the attached... Figure 4 It shows the attachment Figure 2 Each sample is treated as a cluster containing a single sample, resulting in a total of 11 clusters (where the clusters inside the solid circles are...). (Representing the center of the sample, initially each sample is its center), each cluster is represented by a different color and circled with a black line; Appendix Figure 4 The result of the fusion at t=1 is shown, with 10 clusters after fusion; Appendix Figure 5 The result of the fusion at t=2 is shown, with a cluster number of 9 after fusion; Appendix Figure 6 The result of the fusion at t=3 is shown, with 8 clusters after fusion; Appendix Figure 7 The result of the fusion at t=4 is shown, with a cluster number of 7 after fusion; Appendix Figure 8 The result of the fusion at t=5 is shown, with a cluster number of 6 after fusion; Appendix Figure 9 The result of the fusion at t=6 is shown, with 5 clusters after fusion; Appendix Figure 10 The result of the fusion at t=7 is shown, with a cluster number of 4 after fusion; Appendix Figure 11 The result of the fusion at t=8 is shown, with 3 clusters after fusion; Appendix Figure 12 The result of the fusion at t=9 is shown, with 2 clusters after fusion; the newly generated clusters (all represented by black circles) contain samples of the same color, with the samples outside the solid circles... Each represents the center of the newly generated cluster. Table 1 shows the attached... Figure 2 The sample set described in the first section All cluster candidate pairs determined before cluster candidate pair fusion are considered for fusion in each iteration of cluster candidate pair fusion, with the cluster candidate pair having the highest attractiveness value being selected. Table 2 shows the cluster candidate pairs with the highest attractiveness value from Table 1. Determine whether some key values ​​are involved in the fusion process. Because and Therefore, cluster candidate pairs can be determined. The fusion can be implemented, and the resulting new cluster is as follows: Figure 4 The two blue dots circled with black wires.

[0066] Table 1: The List of all cluster candidate pairs determined before cluster candidate pair fusion

[0067] Table 2: List of cluster candidate pairs with the highest attraction value in Table 1

[0068] See attached document Figure 13 As shown, the results of verifying the performance of the embodiments of this application using the CIFAR10 dataset are illustrated. This dataset contains 60,000 32×32 color images, all of which can be divided into 10 categories, as shown below. Figure 13 As shown, each class corresponds to 6000 images. In the experiment, 20000 images were uniformly and randomly selected, and feature extraction was performed on the selected images using a convolutional neural network based on the embodiments of this application. The adaptive clustering method for fast and accurate classification of large-scale images is compared with the contrasting algorithms fuzzy c-means (FCM) and DBSCAN. Referring to Table 3 below, a comparison table shows the classification performance of the method of the embodiments of this application, which achieves better classification performance than the contrasting algorithms FCM and DBSCAN without needing to pre-set the number of classes in the large-scale image set CIFAR10, and requires less running time.

[0069] Table 3: Performance Comparison Table

[0070] This application embodiment provides an adaptive distance scale for the entire clustering process by calculating the average distance of random samples, enabling the algorithm to automatically adapt to the inherent distribution of different datasets and avoiding the hassle of manually setting the neighborhood radius. This application embodiment constructs a dynamic screening mechanism based on local attraction through initialization in step S2 and candidate pair generation in step S3. Using physical properties and attraction thresholds, the algorithm effectively identifies spatially adjacent and closely related sample pairs, laying the foundation for high-quality fusion, while significantly reducing the number of candidate pairs requiring global evaluation and improving computational efficiency. The evaluation in step S4 and the determination in step S5 are the core innovations of this application embodiment. By introducing dual physical criteria of surface energy change and internal pressure, the algorithm simulates a physical process similar to droplet fusion, ensuring that each fusion makes the cluster structure more compact (reduced surface energy) and the internal density not too high (controlled pressure), thus naturally discovering clusters of arbitrary shapes and avoiding the forced merging of samples with excessive differences or noise. This embodiment of the application ensures the stability and purity of the results through the fusion and update operations in step S6 and the post-processing in step S7. Step S6 dynamically updates the clusters and candidate sets after each fusion, enabling the clustering process to evolve iteratively and hierarchically. The number of categories is automatically generated during this process without the need for pre-setting. Step S7 effectively removes noise and outliers by deleting single-sample clusters and merging small clusters, significantly enhancing the robustness of the algorithm on real noisy data and ultimately outputting more accurate classification results. In summary, this embodiment of the application achieves adaptive image clustering that does not require pre-setting the number of categories, can identify clusters of arbitrary shapes, and is robust to noise.

[0071] This application also discloses an adaptive clustering system for large-scale image classification, including: a sample selection module, an independent cluster configuration module, an attractiveness determination module, a surface energy determination module, a target cluster candidate pair screening module, a new cluster fusion module, and a clustering result output module.

[0072] For example, a sample selection module is used to randomly select a portion of samples from the set of image samples to be classified and to calculate the average distance between the selected samples.

[0073] For example, the independent cluster configuration module is used to initialize each sample in the image sample set as a corresponding single independent cluster, and configure the initialized physical properties for each independent cluster; set an attraction threshold for determining whether independent clusters can form cluster candidate pairs, and an internal maximum pressure threshold for constraining the tightness of independent clusters.

[0074] For example, the attraction determination module is used to calculate the attraction between each current independent cluster and other clusters falling within its average distance range, and to add cluster pairs with attraction greater than the attraction threshold to the cluster candidate pair set.

[0075] For example, the surface energy determination module is used to select the most attractive target cluster candidate pair from the set of cluster candidate pairs, calculate the actual cluster surface energy of the target cluster candidate pair before fusion, the virtual cluster surface energy of the virtual cluster generated after performing virtual fusion, and the internal pressure of the virtual cluster.

[0076] For example, the target cluster candidate pair screening module is used to screen the target cluster candidate pairs that meet the actual fusion conditions based on the surface energy of the actual cluster and the surface energy change of the virtual cluster, as well as the internal pressure of the virtual cluster.

[0077] For example, the new cluster fusion module is used to actually merge two clusters in the target cluster candidate pair that meet the actual fusion conditions, generate an actual new cluster and replace the original two clusters with the actual new cluster, update the cluster list, and delete the cluster candidate pair set that contains the fused cluster. Iteratively execute the execution operations of the surface energy determination module, the target cluster candidate pair screening module and the new cluster fusion module until the cluster candidate pair set is empty.

[0078] For example, the clustering result output module is used to delete clusters containing only a single sample from the updated cluster list, merge small clusters with fewer than a predetermined threshold of samples into the nearest cluster according to the nearest distance from the cluster center of the small cluster, and output all current clusters as clustering results.

[0079] Compared with existing clustering schemes that can be used for fast and accurate classification of large-scale images, the number of categories (i.e., the number of clusters) in the image of this application embodiment is naturally generated during the iterative implementation of the fusion of all cluster candidate pairs in each round, without the need to pre-set the number of categories in the image before implementing clustering. This is something that most current clustering methods do not have, especially for large-scale image classification problems. The method constructed in this application embodiment is able to discover clusters of arbitrary shapes based on the local attraction between each pair of clusters, the change in surface energy before and after fusion, and the internal pressure of the clusters generated after fusion, and has good generalization. In this application embodiment, because noise samples are usually isolated and have weak attraction with other samples, and have high surface energy, they are difficult to be fused by other samples or newly generated clusters during the iterative implementation of cluster candidate pair fusion. They will eventually be identified as small clusters or outliers. Therefore, this application embodiment has good noise robustness, which is beneficial for achieving fast and accurate classification of large-scale images.

[0080] The above are merely specific implementations of the embodiments of this application, but the protection scope of the embodiments of this application is not limited thereto. Any simple modifications, changes and equivalent changes made by those skilled in the art to the above embodiments based on the technical essence of the embodiments of this application within the scope of the technology disclosed in the embodiments of this application shall still fall within the protection scope of the technical solution of the embodiments of this application.

Claims

1. An adaptive clustering method for large-scale image classification, characterized in that, include: Step S1: Randomly select a portion of samples from the image sample set to be classified, and calculate the average distance between the selected samples; wherein, before randomly selecting a portion of samples from the image sample set to be classified, the method further includes: using a convolutional neural network to extract features from the original images and converting each image into a feature vector; and constructing the image sample set to be classified based on the set of all feature vectors. Step S2: Initialize each sample in the image sample set as a corresponding single independent cluster, and configure the initialized physical properties for each independent cluster; set an attraction threshold for determining whether independent clusters can form cluster candidate pairs, and an internal maximum pressure threshold for constraining the tightness of independent clusters; Step S3: Calculate the attraction between each current independent cluster and other clusters falling within its average distance range, and add cluster pairs with attraction greater than the attraction threshold to the cluster candidate pair set; wherein, the calculation of the attraction between each current independent cluster and other clusters falling within the average distance range, and the addition of cluster pairs with attraction greater than the attraction threshold to the cluster candidate pair set, is obtained through the following mathematical expression: ; in, Indicates the current number Independent clusters and falling in the first The attraction between other clusters within the average distance range of an independent cluster; The center of the cluster is represented by the mean of the feature vectors of all samples within the cluster. Representative cluster candidate pair set The first in Each cluster, the Distance cluster The set of all clusters within the said average distance range, Represents the set of candidate cluster pairs The total number of clusters; Represented by natural numbers An exponential function with base 0. , Representing clusters ,cluster The center; Step S4: Select the target cluster candidate pair with the greatest attraction from the set of cluster candidate pairs, and calculate the actual cluster surface energy of the target cluster candidate pair before fusion, the virtual cluster surface energy of the virtual cluster generated after virtual fusion, and the internal pressure of the virtual cluster. Step S5: Based on the actual cluster surface energy and the change in surface energy between the actual cluster surface energy and the virtual cluster surface energy, as well as the internal pressure of the virtual cluster, select the target cluster candidate pairs that meet the conditions for actual fusion. Step S6: Merge two clusters in the target cluster candidate pair that meet the actual fusion conditions to generate a new actual cluster and replace the original two clusters with the new actual cluster. Update the cluster list and delete the cluster candidate pair set that contains the merged cluster. Iterate through steps S4 to S6 until the cluster candidate pair set is empty. Step S7: Delete clusters containing only a single sample from the updated cluster list, merge small clusters with fewer than a predetermined threshold of samples into the nearest cluster based on the nearest distance between the cluster centers of the small clusters, and output all current clusters as the clustering result.

2. The method according to claim 1, characterized in that, The step of randomly selecting a subset of samples from the image sample set to be classified and calculating the average distance between the selected samples includes: From the set of image samples to be classified, which contains N samples, N / 5 samples are randomly and uniformly selected to form a sample subset; The average Euclidean distance between all pairs of samples within the sample subset is calculated as the average distance between the samples.

3. The method according to claim 1, characterized in that, The initial physical properties include initialization quality, initialization radius, and center. Each independent cluster contains a single sample. The initialization quality of each independent cluster is 1, and the initialization radius is 10. -3 The initial center is the feature vector of the corresponding sample; the attraction threshold is set to 10. -3 The maximum internal pressure threshold is set to 1.

4. The method according to claim 1, characterized in that, The actual cluster surface energy of the target cluster candidate pair before fusion is calculated using the following mathematical expression: ; The virtual cluster surface energy of the virtual cluster generated after virtual fusion of the target cluster candidate pairs is calculated using the following mathematical expression: ; The internal pressure of the virtual cluster generated after the target cluster candidate pair is virtually fused is calculated using the following mathematical expression: ; in, Candidate pairs of target clusters with the maximum attraction value between clusters are denoted as... ; This represents the actual cluster surface energy of the target cluster candidate pair; This represents the virtual cluster surface energy of the target cluster candidate pair; , Representing clusters , Surface energy coefficient; , Representing clusters , Surface area; This represents the surface area of ​​the virtual cluster generated after virtual fusion; This represents the balance coefficient, with a value of 0.

01. This indicates the internal pressure of the virtual cluster; This represents the radius of the virtual cluster.

5. The method according to claim 1, characterized in that, The screening of candidate pairs of target clusters that meet the conditions for actual fusion includes: When the surface energy change is negative and the internal pressure of the virtual cluster is less than the maximum internal pressure threshold, the target cluster candidate pair is determined to meet the conditions for actual fusion. Otherwise, if the target cluster candidate pair is determined not to meet the conditions for actual fusion, the current target cluster candidate pair is deleted and the process returns to step S4 to select a new target cluster candidate pair.

6. The method according to claim 1, characterized in that, The process of replacing the two existing clusters with the new cluster includes: The quality of the actual new cluster is the sum of the qualities of the two independent clusters that are fused; the center of the actual new cluster is the mean of the feature vectors of all samples within the cluster; the radius of the actual new cluster is the maximum Euclidean distance between the sample pairs that constitute the actual new cluster.

7. The method according to claim 1, characterized in that, The predetermined threshold number is 10. The step of merging small clusters with fewer than the predetermined threshold number of samples into the nearest cluster based on the nearest distance between the cluster centers includes: Clusters with a sample size greater than or equal to 2 but less than 10 are defined as the small clusters, and the operation of merging the small clusters into the nearest clusters based on the nearest distance from their cluster centers is performed.

8. An adaptive clustering system for large-scale image classification, characterized in that, include: The sample selection module is used to randomly select a portion of samples from the image sample set to be classified and calculate the average distance between the selected samples; wherein, before randomly selecting a portion of samples from the image sample set to be classified, the module further includes: using a convolutional neural network to extract features from the original images and converting each image into a feature vector; and constructing the image sample set to be classified based on the set of all feature vectors. The independent cluster configuration module is used to initialize each sample in the image sample set as a corresponding single independent cluster, and configure the initialized physical attributes for each independent cluster; it sets an attraction threshold for determining whether independent clusters can form cluster candidate pairs, and an internal maximum pressure threshold for constraining the tightness of independent clusters. An attraction determination module is used to calculate the attraction between each current independent cluster and other clusters falling within its average distance range, and to add cluster pairs with attraction greater than the attraction threshold to a cluster candidate pair set; wherein, the calculation of the attraction between each current independent cluster and other clusters falling within the average distance range, and the addition of cluster pairs with attraction greater than the attraction threshold to the cluster candidate pair set, is obtained through the following mathematical expression: ; in, Indicates the current number Independent clusters and falling in the first The attraction between other clusters within the average distance range of an independent cluster; The center of the cluster is represented by the mean of the feature vectors of all samples within the cluster. Representative cluster candidate pair set The first in Each cluster, the Distance cluster The set of all clusters within the said average distance range, Represents the set of candidate cluster pairs The total number of clusters; Represented by natural numbers An exponential function with base 0. , Representing clusters ,cluster The center; The surface energy determination module is used to select the most attractive target cluster candidate pair from the cluster candidate pair set, and calculate the actual cluster surface energy of the target cluster candidate pair before fusion, the virtual cluster surface energy of the virtual cluster generated after virtual fusion, and the internal pressure of the virtual cluster. The target cluster candidate pair screening module is used to screen the target cluster candidate pairs that meet the actual fusion conditions based on the actual cluster surface energy and the change in surface energy between the actual cluster surface energy and the virtual cluster surface energy, as well as the internal pressure of the virtual cluster. The new cluster fusion module is used to actually merge two clusters in the target cluster candidate pair that meet the actual fusion conditions, generate an actual new cluster, replace the original two clusters with the actual new cluster, update the cluster list, and delete the cluster candidate pair set that contains the merged cluster. Iteratively execute the execution operations of the surface energy determination module, the target cluster candidate pair screening module, and the new cluster fusion module until the cluster candidate pair set is empty. The clustering result output module is used to delete clusters containing only a single sample from the updated cluster list, merge small clusters with fewer than a predetermined threshold of samples into the nearest cluster according to the nearest distance between the cluster centers of the small clusters, and output all current clusters as clustering results.

Citation Information

Patent Citations

  • Rapid clustering method based on local density and inter-cluster framework distance

    CN114239727A

  • Big data feature extraction method based on deep clustering

    CN120578939A