Image clustering method and device based on particle multi-kernel k-mean value, and electronic equipment
Through the multi-core k-mean clustering method based on particle spheres, the problems of inefficiency and parameter dependence in the prior art are solved, and efficient and accurate image clustering is achieved.
Patent Information
- Application Number
- CN202411676357.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-22
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2044-11-22
AI Technical Summary
The existing multi-core k-mean clustering method is inefficient when processing large-scale image datasets and requires setting neighborhood parameters, which are susceptible to parameter settings, resulting in degradation of clustering performance.
A multi-core k-mean clustering method based on particle spheres is proposed. The image data is coarsely mapped through particle sphere division, and a more efficient kernel matrix is constructed, and local alignment is used to avoid overfitting.
It significantly improves the efficiency of kernel matrix construction, reduces time complexity, is suitable for clustering of large-scale image data sets, and improves the accuracy and efficiency of clustering.
Smart Images

Figure CN119625360A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image clustering analysis, in particular to an image clustering method, device and electronic equipment based on particle sphere multi-core k-means. Background Art
[0002] Image data is growing explosively in all areas of real life. Analyzing and processing these images helps users understand reality more deeply and optimize the decision-making process. As a key part of the image processing field, image clustering technology has been widely studied in the field of machine learning in recent years, providing strong support for subsequent image segmentation, image recognition, and image retrieval tasks. Traditional clustering methods such as k-means clustering, DBSCAN clustering, and hierarchical clustering are commonly used methods in image clustering. However, due to the complexity of image data, for example, image data is often high-dimensional, its features may come from multiple different aspects (brightness, color, orientation, etc.), and it is nonlinearly separable in the original dimension. This makes it difficult for traditional clustering methods to cope with.
[0003] As an extension of the k-means clustering method in the multi-kernel clustering method, multi-kernel k-means clustering maps data to high-dimensional space by defining multiple kernel matrices, making the data originally nonlinearly separable in low-dimensional space separable in high dimensions, alleviating the defect that k-means cannot handle complex, nonlinearly separable data. At the same time, multiple kernel functions enable the algorithm to capture information from all aspects of the image more comprehensively, achieving a more accurate clustering effect.
[0004] In order to avoid the objective function falling into the local optimal solution, the recent multi-core k-means clustering method SimpleMKKM first introduced the kernel alignment criterion in supervised learning into the unsupervised learning task, and proposed a new multi-core k-means objective function, that is, minimizing the kernel coefficient and maximizing the cluster partition matrix. And rewrite the objective function, transform the tricky minimization-maximization problem into a minimization problem, and use the simplified gradient descent algorithm to solve the objective function value. This method has achieved good clustering performance, but the recent LocalizedSimpleMKKM believes that SimpleMKKM forces the similarity of all sample pairs to be aligned with the ideal similarity matrix during the kernel alignment process, which may lead to the wrong assignment of cluster labels, thus affecting the clustering performance. Therefore, LocalizedSimpleMKKM proposes a local simple multi-core k-means clustering method, which sets the neighborhood parameter τ so that the sample only needs to be aligned with the similarity of its neighboring τ*n samples on the ideal similarity matrix, where n is the total number of samples. This takes into account the local structure of the sample and improves the clustering performance.
[0005] Although LocalizedSimpleMKKM has the above advantages, this method needs to set the neighborhood parameter τ to obtain the neighbor information of each image sample. In actual scenarios, image data is complex, and improper parameter settings may affect the performance of image clustering methods. And because clustering is unsupervised learning, we cannot estimate the clustering effect corresponding to a certain parameter, so we cannot find the appropriate parameters by optimization in practical applications. Therefore, it is extremely challenging to set specific parameters for each data set. In addition, we also observed that the existing multi-core k-means clustering methods are based on a single sample to construct the kernel matrix, that is, the constructed kernel matrix size is n*n. This fine-grained construction method makes the entire algorithm inefficient and cannot be applied to large-scale image data sets. Summary of the invention
[0006] The purpose of the present invention is to solve or alleviate the problems of the prior art and to provide an image clustering method, device and electronic equipment based on particle sphere multi-kernel k-means.
[0007] In order to achieve the above objectives, a multi-core k-means image clustering method based on granular sphere is proposed, which includes the following steps:
[0008] Acquire image data; the image data is a set of discrete data points of multiple images to be clustered;
[0009] Dividing the image data into particles and spheres to obtain an image particle sphere set;
[0010] According to the image sphere set, the image sphere center, the image sphere distance matrix and the average distance between the image spheres are calculated;
[0011] The image granule kernel matrix is calculated based on the image granule center, the image granule distance matrix, the average distance between the image granules and the preset kernel function;
[0012] According to the image particle-sphere kernel matrix and the preset clustering partition matrix, a multi-core k-means clustering objective function based on the particle-sphere is constructed; the objective function is used to indicate the alignment difference of the image particle-sphere kernel matrix of the kernel coefficient and the alignment difference of the image particle-sphere kernel matrix of the clustering partition matrix;
[0013] According to the multi-core k-means clustering objective function based on the sphere, a target clustering partition matrix corresponding to the minimum objective function value is calculated;
[0014] Discretizing the target clustering partition matrix according to a multi-core k-means algorithm to obtain a clustering result of image granules;
[0015] The clustering result of the image sphere is assigned to all discrete data points contained therein to obtain the clustering result of the image data.
[0016] In a second aspect of the present invention, the present invention further proposes an image clustering device based on particle-sphere multi-core k-means, comprising:
[0017] An acquisition module, used to acquire image data; the image data is a set of discrete data points of multiple images to be clustered;
[0018] A division module, used for dividing the image data into particles and spheres to obtain an image particle sphere set;
[0019] A calculation module, used to calculate the image granule center, the image granule distance matrix and the average distance between the image granules according to the image granule set; and to calculate the image granule kernel matrix according to the image granule center, the image granule distance matrix, the average distance between the image granules and a preset kernel function;
[0020] A construction module is used to construct a multi-core k-means clustering objective function based on the sphere according to the image sphere kernel matrix and the preset cluster partition matrix; the objective function is used to indicate the alignment difference of the image sphere kernel matrix of the kernel coefficient and the alignment difference of the image sphere kernel matrix of the cluster partition matrix;
[0021] A determination module, used to calculate the target clustering partition matrix corresponding to the minimum value of the objective function according to the multi-core k-means clustering objective function based on the sphere;
[0022] The clustering module is used to discretize the target clustering partition matrix according to the multi-core k-means algorithm to obtain the clustering result of the image granule ball; the clustering result of the image granule ball is assigned to all the discrete data points contained therein to obtain the clustering result of the image data.
[0023] In the third aspect of the present invention, the present invention further proposes an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method described in the first aspect of the present invention when executing the computer program.
[0024] The present invention has the following beneficial effects:
[0025] Compared with the existing technology, the present invention proposes a new kernel matrix construction method, which uses image granules to perform coarse-grained mapping representation on the original image data. Since the number of image granules is much smaller than the amount of original image data, the present invention significantly improves the efficiency of constructing the kernel matrix, reduces the time complexity of the present invention relative to the existing technology, and is suitable for clustering of large-scale image data sets of multi-core k-means. When constructing the image granule kernel matrix, the present invention utilizes the local density of the image granules, gives the image granules with a closer distance a greater similarity, so that the kernel matrix more accurately represents the structure of the cluster, and improves the accuracy of image clustering. When solving the objective function, the present invention performs similarity alignment based on the coarse-grained granule kernel matrix. Compared with the similarity alignment performed by the kernel matrix constructed on the original image data, this is a local alignment method, which can avoid erroneous cluster label assignment due to overfitting. And this local alignment method does not need to set neighbor parameters, and is an adaptive local alignment method, which can significantly improve the efficiency of image clustering. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 It is a flow chart of an image clustering method based on particle-sphere multi-kernel k-means according to an embodiment of the present invention;
[0027] Figure 2 A schematic diagram of the image particle sphere division process according to an embodiment of the present invention;
[0028] Figure 3 A schematic diagram of an image particle sphere division structure according to an embodiment of the present invention;
[0029] Figure 4 A schematic diagram of a target clustering partitioning matrix calculation process according to an embodiment of the present invention;
[0030] Figure 5 It is a structural diagram of an image clustering device based on particle-sphere multi-core k-means according to an embodiment of the present invention. DETAILED DESCRIPTION
[0031] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0032] The present invention is further described below through specific embodiments. The embodiments of the present invention are only used to illustrate the present invention rather than to limit the present invention. Without departing from the technical concept of the present invention, various substitutions and changes made according to common technical knowledge and customary means in the field should all be included in the scope of the present invention.
[0033] In the description of the present invention, "processor" may include hardware, software or a combination of the two. The processor may be a central processing unit, a microprocessor, an image processor, a digital signal processor or any other suitable processor. The processor has data and / or signal processing functions. The processor may be implemented in software, hardware or a combination of the two. Non-temporary computer-readable storage media include any suitable media that can store program codes, such as a magnetic disk, a hard disk, an optical disk, a flash memory, a read-only memory, a random access memory, etc. The term "A and / or B" means all possible combinations of A and B, such as just A, just B or A and B.
[0034] In order to solve the problem of low efficiency of traditional MKKM. The present invention combines the granular structure and proposes a new coarse-grained kernel matrix construction method, which greatly reduces the scale of the kernel matrix and improves the efficiency of the existing MKKM algorithm in constructing the kernel matrix. On the other hand, in order to solve the problem of overfitting of the image clustering algorithm caused by the global alignment of the kernel matrix, the present invention adopts a local alignment method, using image granular balls instead of surrounding image data samples to participate in the kernel matrix alignment process, and at the same time considers the local density of the image granular balls in the process of kernel matrix construction, so that the constructed kernel matrix can more accurately characterize the structure of the cluster, so that it can fully explore the characteristics of the image data, which is beneficial to improve the efficiency and accuracy of image clustering.
[0035] Figure 1 Flow chart of the image clustering method based on particle-sphere multi-kernel k-means according to an embodiment of the present invention; Figure 1 As shown, the method includes:
[0036] 101. Acquire image data; the image data is a set of discrete data points of multiple images to be clustered;
[0037] In some embodiments, the image to be clustered refers to an image that needs to be clustered, such as a face image. The image to be clustered can be acquired by an image acquisition device, such as a camera, etc.; it can also be acquired by receiving an image sent by an image acquisition device or other terminal device. This exemplary embodiment can digitize the image to be clustered by sampling and grayscale quantization based on each image to be clustered, and by using RGB and other representation methods to convert the image to be clustered into a set of discrete data D: x1, x2, ..., x n , x iis a d-dimensional vector, representing the d-dimensional data of an image to be clustered; these methods can map the image to be clustered into the feature space, and represent the corresponding image to be clustered in the form of a feature vector. For example, multiple face images are obtained, and for each face image, the face features are extracted through the above digitization method, and the face features are converted into a matrix or a feature vector, etc., and mapped to the feature space, and each feature vector in the feature space represents a face image, etc.
[0038] 102. Divide the image data into particles and spheres to obtain an image particle sphere set;
[0039] In the embodiment of the present invention, Figure 2 As shown, step 102 may specifically include:
[0040] 201. Initialize the image data into an image particle sphere, and add the image particle sphere to an image particle sphere set;
[0041] 202. Traverse the image particle sphere set, select two deterministic centers from each image particle sphere, and use a clustering algorithm to divide the image particle sphere into two image sub-spheres;
[0042] 203. If the particle quality of the image sub-sphere after the division is higher than the particle quality of the image particle sphere before the division, the image sub-sphere after the division is added to the image particle sphere set, and the image particle sphere before the division is removed from the image particle sphere set;
[0043] 204. Repeat the above steps until the number of image spheres in the image sphere set does not change, and finally obtain the image sphere set.
[0044] In this embodiment, the image data D is initialized as an image sphere, and the image sphere is added to the image sphere set; by traversing the image sphere set, the current image sphere is tried to be divided into two image sub-spheres, and if the quality of the two divided spheres is better than the quality of the current sphere, the two spheres are added to the sphere set, and the current sphere is removed from the set; the above steps are repeated until the number of spheres in the set does not change, that is, the sphere splitting reaches the convergence condition, and finally the image sphere set GBs = {GB1, GB2, ..., GB m}, where m represents the number of image spheres.
[0045] The mass of the sphere measures the compactness of the data points in the sphere relative to the center of the sphere. The more compact the data points in the sphere are, the higher the mass of the sphere is. Conversely, the sparser the data points in the sphere are, the lower the mass of the sphere is.
[0046] In the embodiment of the present invention, the mass of the ball can be measured by the following formula:
[0047]
[0048] Among them, DM represents the mass of the sphere. The smaller the DM, the higher the mass. c represents the center of the sphere. k represents the number of samples in the sphere. x1, x2, ..., x k Represents the sample in the particle sphere. The weighted quality DM value calculation formula of the image sub-sphere is: Where k1 and k2 represent the number of samples in the image sub-sphere, and DM1 and DM2 represent the DM values of the two image sub-spheres.
[0049] For example, in Figure 3 In the image shown in the process of particle spheroid splitting, at the beginning, as Figure 3 As shown in (a), all image data are mapped into an image granule space and all image data are ensured to be within the image granule; when splitting, Figure 3 The DM value of the image sphere in (b) is 0.532, and the splitting results are Figure 3 After the two image sub-balls in (c), the weighted DM value of the image sub-ball is 0.486. Obviously, the quality of the image sub-ball after splitting is better than that of the image parent ball. Figure 3 The image sphere in (b) needs to be split into Figure 3 After the two balls in (c) split, Figure 3 (d) is the final image sphere.
[0050] 103. According to the image sphere set, calculate and obtain the image sphere center, the image sphere distance matrix, and the average distance between the image spheres;
[0051] In the embodiment of the present invention, for each image sphere in the image sphere set, it is assumed that it contains k data points x1, x2, ..., x k , the center c of the image sphere is determined by the mean of these k data points; according to the calculated center of the image sphere, the sphere distance matrix S is calculated, where S is an m*m matrix, m represents the number of spheres, S ij Represents GB i With GB j The distance between ij The calculation formula is: ||c i -c j ||,c i ,,c j Represents the image granule GB i With the image ball GB j The center of the ball matrix S is calculated to calculate the average distance d between all the balls. avg , the calculation formula of the average distance is as follows:
[0052]
[0053] 104. Calculate the image sphere kernel matrix according to the image sphere center, the image sphere distance matrix, the average distance between the image spheres, and the preset kernel function;
[0054] In an embodiment of the present invention, if the distance between the first image granule ball and the second image granule ball in the image granule ball distance matrix is greater than the average distance between the image granule balls, the value of the image granule ball core matrix is the preset kernel function distance between the center of the first image granule ball and the center of the second image granule ball; if the distance between the first image granule ball and the second image granule ball in the image granule ball distance matrix is less than or equal to the average distance between the image granule balls, the value of the image granule ball core matrix is the preset kernel function distance between the discrete data points of the center of the first image granule ball and the second image granule ball; the discrete data points of the second image granule ball are the discrete data points in the second image granule ball and the closest to the center of the first image granule ball.
[0055] In the embodiment of the present invention, a kernel function κ is selected, and a particle-sphere kernel matrix corresponding to κ is constructed according to the following formula:
[0056]
[0057] in:
[0058]
[0059] κ(GB j ,GB i )=κ(GB i ,GB j ),1≤i≤j≤m
[0060] Where KGB represents the granular core matrix, κ(GB i ,GB j ) represents the image sphere GB i With the image ball GB j The granular core matrix, κ(GB j ,GB i ) represents the image sphere GB i With the image ball GB j The spherical core matrix is reversible. When S ij ≥d avg When , we select the kernel function κ(c i ,c j ), when S ij <d avg When , we select the kernel function κ(c i ,x j), this method of using local density gives closer image particles a greater similarity, allowing the kernel matrix to more accurately represent the structure of the cluster and improve the accuracy of image clustering;
[0061] Repeat the above steps to finally construct a set of particle-sphere core matrix KGB p ,(p=1,2,...,v), v represents the number of selected kernel functions.
[0062] It should be noted that the embodiment of the present invention utilizes image granules to perform coarse-grained mapping representation of the original image data. Since the number of image granules is much smaller than the amount of original image data, the present invention significantly improves the efficiency of constructing the kernel matrix, which also enables the present invention to reduce time complexity and is suitable for clustering of large-scale image data sets for multi-kernel k-means.
[0063] 105. Constructing a multi-core k-means clustering objective function based on the sphere according to the image sphere kernel matrix and the preset cluster partition matrix; the objective function is used to indicate the alignment difference of the image sphere kernel matrix of the kernel coefficient and the alignment difference of the image sphere kernel matrix of the cluster partition matrix;
[0064] In an embodiment of the present invention, the objective function enables the method to find a set of better kernel coefficients and reduce the redundancy between kernels by minimizing the alignment of the particle-sphere-core matrix relative to the kernel coefficient, so that the combined particle-sphere-core matrix can better capture the intrinsic structure of the image data. In addition, the objective function maximizes the alignment of the particle-sphere-core matrix relative to the cluster partition matrix, so that the method can learn a cluster partition matrix that better matches the feature space corresponding to the combined particle-sphere-core matrix in the feature space represented by the combined particle-sphere-core matrix, thereby obtaining a more accurate image clustering result. Specifically, the particle-sphere-based multi-core k-means clustering objective function can be expressed as:
[0065]
[0066] Among them, w is the weight vector of each image particle sphere kernel matrix, Δ is the value range of the weight of the image particle sphere kernel matrix, F is the clustering matrix, and F T is the transposed matrix of F; KGB w is the weighted kernel matrix of v image granular kernel matrices, and Γ is the set of clustering partition matrices. KGB p represents the p-th particle-sphere core matrix, F is the clustering matrix, and F T is the transposed matrix of F.
[0067] In this value range Δ, the sum of the components in the w vector is 1, and each component is greater than or equal to 0. In this restriction range Γ, Γ restricts F to be a matrix with m rows and y columns, and each element in the matrix is a real number, m represents the number of spheres, and y represents the number of clusters.
[0068] 106. According to the particle-sphere-based multi-core k-means clustering objective function, a target clustering partition matrix corresponding to the minimum objective function value is calculated;
[0069] In the embodiment of the present invention, Figure 4 As shown, the calculation method of the target clustering partition matrix includes:
[0070] 601. Minimize the particle-sphere based multi-core k-means clustering objective function using a simplified gradient descent algorithm to obtain the descent gradient of each element; the element is used to indicate the component corresponding to the vector in the objective function;
[0071] Among them, the objective function of multi-core k-means clustering based on granular sphere is expressed as:
[0072]
[0073] Where JGB(w)=max F∈Γ Tr(KGB w FF T ).
[0074] Use the simplified gradient descent algorithm to minimize the formula objective function, represents the descent gradient of the p-th element, The calculation method is as follows:
[0075]
[0076] in, u is the index of the largest component in vector w.
[0077] 602. If the weight of the p-th element is 0 and the descending gradient of the p-th element is greater than 0, the descending direction of the p-th element is 0;
[0078] 603. If the weight of the p-th element is greater than 0 and the p-th element is not the element corresponding to the maximum component, the descending direction of the p-th element is the opposite of the descending gradient of the p-th element;
[0079] 604. If the pth element is the element corresponding to the maximum component, the descending direction of the pth element is the opposite of the descending gradient of the element corresponding to the maximum component;
[0080] The calculation formula corresponding to step 602-step 604 can be expressed as:
[0081]
[0082] Among them, d p Represents the final descent direction.
[0083] 605. Update the weight of the p-th element according to the weight of the p-th element and the descending direction of the p-th element;
[0084] In the embodiment of the present invention, the update formula of the weight of the pth element is expressed as:
[0085] w p '=w p +α*d p
[0086] Among them, w p ' represents the weight of the pth element after update, w p represents the weight of the pth element before updating, α represents the control parameter, and d p Indicates the descending direction of the p-th element.
[0087] 606. When the particle-sphere based multi-core k-means clustering objective function converges, a target clustering partition matrix is obtained.
[0088] Through the above steps, when the particle-sphere-based multi-core k-means clustering objective function converges, the final target clustering partitioning clustering matrix F is obtained.
[0089] It can be understood that, when solving the objective function, the present invention performs similarity alignment based on the coarse-grained granular sphere kernel matrix. Compared with similarity alignment performed using a kernel matrix constructed on the original image data, this is a local alignment method that can avoid incorrect clustering label assignment due to overfitting. Moreover, this local alignment method does not require setting neighbor parameters and is an adaptive local alignment method that can significantly improve the efficiency of image clustering.
[0090] 107. Discretize the target clustering partition matrix according to a multi-core k-means algorithm to obtain a clustering result of image particles;
[0091] In the embodiment of the present invention, a multi-core k-means discretization matrix F is used to obtain the clustering result of the image granules.
[0092] 108. Assign the clustering result of the image sphere to all discrete data points contained therein to obtain a clustering result of the image data.
[0093] Figure 5 FIG. 4 is a structural diagram of an image clustering device based on particle-sphere multi-core k-means according to an embodiment of the present invention. Figure 5 As shown, the device comprises:
[0094] An acquisition module, used to acquire image data; the image data is a set of discrete data points of multiple images to be clustered;
[0095] A division module, used for dividing the image data into particles and spheres to obtain an image particle sphere set;
[0096] A calculation module, used to calculate the image granule center, the image granule distance matrix and the average distance between the image granules according to the image granule set; and to calculate the image granule kernel matrix according to the image granule center, the image granule distance matrix, the average distance between the image granules and a preset kernel function;
[0097] A construction module is used to construct a multi-core k-means clustering objective function based on the sphere according to the image sphere kernel matrix and the preset cluster partition matrix; the objective function is used to indicate the alignment difference of the image sphere kernel matrix of the kernel coefficient and the alignment difference of the image sphere kernel matrix of the cluster partition matrix;
[0098] A determination module, used to calculate the target clustering partition matrix corresponding to the minimum value of the objective function according to the multi-core k-means clustering objective function based on the sphere;
[0099] The clustering module is used to discretize the target clustering partition matrix according to the multi-core k-means algorithm to obtain the clustering result of the image granule ball; the clustering result of the image granule ball is assigned to all the discrete data points contained therein to obtain the clustering result of the image data.
[0100] The embodiment of the present invention also provides an electronic device capable of implementing the above method. It will be appreciated by those skilled in the art that various aspects of the present invention may be implemented as a system, method or program product. Therefore, various aspects of the present invention may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or an implementation combining hardware and software, which may be collectively referred to as a "circuit", "module" or "system" herein.
[0101] An embodiment of the present invention further provides an electronic device, which is in the form of a general-purpose computing device. The components of the electronic device may include, but are not limited to: the at least one processing unit, the at least one storage unit, a bus connecting different system components (including the storage unit and the processing unit), and a display unit.
[0102] The storage unit stores program codes, which can be executed by the processing unit, so that the processing unit executes the steps of various exemplary embodiments of the present invention described in the above “Exemplary Method” section of this specification. For example, the processing unit can execute Figure 1Steps S101 to S108 etc. are shown.
[0103] The storage unit may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) and / or a cache memory unit, and may further include a read-only memory unit (ROM).
[0104] The storage unit may also include a program / utility having a set (at least one) of program modules, such program modules including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0105] The bus may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0106] The electronic device may also communicate with one or more external devices (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device, and / or may communicate with any device that enables the electronic device to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed through an input / output (I / O) interface. Furthermore, the electronic device may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) through a network adapter. The network adapter communicates with other modules of the electronic device through a bus.
[0107] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the exemplary embodiment of the present disclosure.
[0108] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0109] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0110] Program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0111] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present disclosure, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.
[0112] A person skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the relevant hardware through a program, and the program can be stored in a computer-readable storage medium, which can include: ROM, RAM, disk or CD, etc.
[0113] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. An image clustering method based on particle-sphere multi-core k-means, characterized in that: The method comprises: Acquire image data; the image data is a set of discrete data points of multiple images to be clustered; Dividing the image data into particles and spheres to obtain an image particle sphere set; According to the image sphere set, the image sphere center, the image sphere distance matrix and the average distance between the image spheres are calculated; The image granule kernel matrix is calculated based on the image granule center, the image granule distance matrix, the average distance between the image granules and the preset kernel function; According to the image particle-sphere kernel matrix and the preset clustering partition matrix, a multi-core k-means clustering objective function based on the particle-sphere is constructed; the objective function is used to indicate the alignment difference of the image particle-sphere kernel matrix of the kernel coefficient and the alignment difference of the image particle-sphere kernel matrix of the clustering partition matrix; According to the multi-core k-means clustering objective function based on the sphere, a target clustering partition matrix corresponding to the minimum objective function value is calculated; Discretizing the target clustering partition matrix according to a multi-core k-means algorithm to obtain a clustering result of image granules; The clustering result of the image sphere is assigned to all discrete data points contained therein to obtain the clustering result of the image data.
2. The image clustering method based on particle-sphere multi-core k-means according to claim 1, characterized in that: The step of dividing the image data into particles and spheres to obtain an image particle sphere set comprises: Initializing the image data into an image particle sphere, and adding the image particle sphere to an image particle sphere set; Traversing the image particle ball set, for each image particle ball, selecting two deterministic centers therefrom, and using a clustering algorithm to divide the image particle ball into two image sub-balls; If the particle quality of the image sub-sphere after the division is higher than the particle quality of the image particle sphere before the division, the image sub-sphere after the division is added to the image particle sphere set, and the image particle sphere before the division is removed from the image particle sphere set; The above steps are repeated until the number of image spheres in the image sphere set no longer changes, and finally an image sphere set is obtained.
3. The image clustering method based on particle-sphere multi-core k-means according to claim 1, characterized in that: The calculation method of the image particle sphere core matrix includes: If the distance between the first image sphere and the second image sphere in the image sphere distance matrix is greater than the average distance between the image spheres, the value of the image sphere kernel matrix is the preset kernel function distance between the center of the first image sphere and the center of the second image sphere; If the distance between the first image sphere and the second image sphere in the image sphere distance matrix is less than or equal to the average distance between the image spheres, the value of the image sphere kernel matrix is the preset kernel function distance between the center of the first image sphere and the discrete data points of the second image sphere; the discrete data points of the second image sphere are the discrete data points in the second image sphere and the closest to the center of the first image sphere.
4. The image clustering method based on particle-sphere multi-core k-means according to claim 1, characterized in that: The objective function of the multi-core k-means clustering based on the particle sphere is expressed as: Among them, w is the weight vector of each image particle sphere kernel matrix, Δ is the value range of the weight of the image particle sphere kernel matrix, F is the clustering matrix, and F T is the transposed matrix of F; KGB w is the weighted kernel matrix of v image granular kernel matrices, and Γ is the limit range of the clustering partition matrix.
5. The image clustering method based on particle-sphere multi-core k-means according to claim 1, characterized in that: The target clustering partition matrix is calculated as follows: Minimize the multi-core k-means clustering objective function based on the sphere using a simplified gradient descent algorithm to obtain the descent gradient of each element; the element is used to indicate the component corresponding to the vector in the objective function; If the weight of the p-th element is 0 and the descending gradient of the p-th element is greater than 0, the descending direction of the p-th element is 0; If the weight of the pth element is greater than 0 and the pth element is not the element corresponding to the maximum component, the descending direction of the pth element is the opposite of the descending gradient of the pth element; If the pth element is the element corresponding to the maximum component, the descending direction of the pth element is the opposite of the descending gradient of the element corresponding to the maximum component; Update the weight of the p-th element according to the weight of the p-th element and the descending direction of the p-th element; When the particle-sphere based multi-core k-means clustering objective function converges, a target clustering partition matrix is obtained.
6. The image clustering method based on particle-sphere multi-core k-means according to claim 4, characterized in that: The update formula of the weight of the pth element is expressed as: w p '=w p +α*d p Among them, w p ' represents the weight of the pth element after update, w p represents the weight of the pth element before updating, α represents the control parameter, and d p Indicates the descending direction of the p-th element.
7. An image clustering device based on particle-sphere multi-core k-means, characterized in that: include: An acquisition module, used for acquiring image data; The image data is a set of discrete data points of multiple images to be clustered; A division module, used for dividing the image data into particles and spheres to obtain an image particle sphere set; A calculation module, used to calculate the image granule center, the image granule distance matrix and the average distance between the image granules according to the image granule set; and to calculate the image granule kernel matrix according to the image granule center, the image granule distance matrix, the average distance between the image granules and a preset kernel function; A construction module is used to construct a multi-core k-means clustering objective function based on the sphere according to the image sphere kernel matrix and the preset cluster partition matrix; the objective function is used to indicate the alignment difference of the image sphere kernel matrix of the kernel coefficient and the alignment difference of the image sphere kernel matrix of the cluster partition matrix; A determination module, used to calculate the target clustering partition matrix corresponding to the minimum value of the objective function according to the multi-core k-means clustering objective function based on the sphere; The clustering module is used to discretize the target clustering partition matrix according to the multi-core k-means algorithm to obtain the clustering result of the image granule ball; the clustering result of the image granule ball is assigned to all the discrete data points contained therein to obtain the clustering result of the image data.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Face image clustering method and system based on localized simple multi-kernel k-mean value
CN113762354A
Image content noise processing method based on granular ball calculation
CN116071253A
Later-stage fused object image clustering method and device and computer equipment
CN116894964A
Recommendation analysis method for rapid density peak value clustering based on pellets
CN118260479A
Cited By
Image classification method based on machine learning and granular ball spectral clustering
CN120543910A
Graph learning classification method based on granular balls under multi-view data and related device
CN121937809A
A method for learning classification based on particle ball under multi-view data and related device
CN121937809B