Image clustering method and system based on natural neighbor search with fused universal gravitation

By integrating the natural neighbor search method based on gravity, and utilizing the natural structure and quality weights of the image dataset, the neighbor relationships are redefined, solving the accuracy problem of existing image clustering methods and improving the accuracy of image clustering and the ability to handle cluster edge points.

CN116630670BActive Publication Date: 2026-02-24SOUTHWEST UNIVERSITY FOR NATIONALITIES
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310463978.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-26
Publication Date
2026-02-24
Estimated Expiration
2043-04-26

AI Technical Summary

Technical Problem

Existing image clustering methods have low accuracy, especially in terms of parameter dependence, sensitivity to noise points, and ability to handle cluster edge points.

Method used

We employ a natural neighbor search method based on fusion gravity, which redefines neighbor relationships by calculating the gravity between image data, and constructs a neighbor list for clustering using the natural structure and quality weights of the image dataset.

Benefits of technology

It improves the accuracy of image clustering, reduces the sensitivity to noise points, and enhances the processing capability of cluster edge points.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116630670B_ABST
    Figure CN116630670B_ABST
Patent Text Reader

Abstract

The application provides an image clustering method and system based on natural neighbor search of fusion universal gravitation, and the method comprises the following steps: obtaining an image data set to be clustered; calculating the distance between each image data in the image data set according to the image data set; calculating the gravitation between each image data in the image data set based on the distance between each image data; obtaining a neighbor list of each image data based on the natural neighbor search method of fusion universal gravitation according to the gravitation between each image data; determining the neighbor relationship based on the neighbor list of each image data, and clustering the image data which are neighbors of each other into the same cluster according to the neighbor relationship to obtain an image clustering result. The image clustering method based on the natural neighbor search of fusion universal gravitation solves the problem of low accuracy of the existing image clustering method from the root.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of image processing technology, specifically relating to an image clustering method and system based on natural neighbor search with fusion of universal gravitation. Background Technology

[0002] Image processing is a very popular research area in scientific research. Image clustering involves grouping similar or identical images into the same cluster and distributing different images into different clusters. By clustering images, automatic classification of image data can be achieved.

[0003] Currently, common image clustering methods include: image clustering methods based on the K-nearest neighbor (KNN) algorithm, and image clustering methods based on natural neighbors.

[0004] However, in existing KNN-based image clustering methods, different values ​​of the key parameter (k value) lead to completely different image clustering results. Although many optimized KNN-based image clustering methods have been proposed, the determination of these parameters, regardless of the optimization method, relies heavily on researchers' experience and extensive experiments. Furthermore, while existing natural neighbor-based image clustering methods have solved the parameter selection problem of traditional neighbor algorithms, they still use traditional distance metrics as the neighbor criterion. These methods fail to accurately reflect the overall structure of the image dataset during neighbor search; they are highly sensitive to noise points and have limited ability to handle close cluster edge points, resulting in low image clustering accuracy. In summary, the accuracy of current image clustering methods is generally low.

[0005] Therefore, improving the accuracy of image clustering is an urgent problem to be solved in this field. Summary of the Invention

[0006] The purpose of this invention is to address the shortcomings of existing technologies by providing an image clustering method and system based on natural neighbor search with fused gravitational force. This invention utilizes the law of universal gravitation, combined with the natural structure of the image dataset, and selects an appropriate mass weight calculation method to calculate the gravitational force between image data. This gravitational force replaces the traditional distance measurement method, redefining the natural neighbors of image data. Based on the neighbor list, the image clustering results are obtained. This solves the problems of parameter dependence in existing nearest neighbor-based image clustering methods and the low accuracy of natural neighbor-based image clustering methods due to sensitivity to noise points and insufficient performance in handling cluster edges.

[0007] To achieve the above objectives, the present invention adopts the following technical solution:

[0008] This paper proposes an image clustering method based on natural neighbor search with fusion of universal gravitation, characterized by the following steps:

[0009] S1. Obtain the image dataset to be clustered;

[0010] S2. Based on the image dataset, calculate the distance dist(x,y) between each image data in the image dataset; specifically including:

[0011] S21. Calculate the similarity SSIM(x,y) between two images;

[0012] The similarity between two images X and Y is calculated using the following formula, denoted as SSIM(x,y).

[0013]

[0014] Where u x and u y σ represents the average gray level of the two images. x and σ y σ represents the standard deviation of two images. xy SSIM represents the covariance of two images; C1 and C2 are constants to avoid the denominator being zero, and the values ​​of C1 and C2 depend on u and σ; if the denominator is close to zero, the values ​​of C1 and C2 can be arbitrarily chosen to increase the stability of the SSIM value; the above formula represents the structural similarity between two images; the larger the SSIM value, the more similar the two images are.

[0015] S22. Calculate the distance dist(x,y) between two images;

[0016] The distance between two images is denoted as dist(x,y) and is calculated using the following formula:

[0017] dust(x,y)=1-SSIM(x,y);

[0018] S3. Based on the distance dist(x,y) between the image data, calculate the gravitational force between the image data in the image dataset;

[0019] S31. Construct a saturated neighborhood graph based on the natural nearest neighbor algorithm;

[0020] S32. Calculate the quality weight by analyzing the structural similarity between each image data and other image data based on the saturated neighborhood graph. The calculation method is as follows:

[0021]

[0022] Among them, the quality weight M xy The quality m of image x xWith the quality m of image y y The product of σ(x, y) represents the structural similarity between sample image x and image y, defined as the quotient of the square root of the product of the number of shared structures of image nodes x and y and the number of their respective node structures; Γ(x) represents the node structure of image x, referring to the set of image node x and its connected nodes, and Γ(y) represents the node structure of image y, referring to the set of image node y and its connected nodes.

[0023] S33. Calculate the gravitational force between image x and image y; the specific calculation formula is as follows:

[0024]

[0025] Where G is the gravitational constant, with a value of 1; m y For the quality of image y, m x Let x be the quality of image x, and R be the distance between image y and x, where R = dist(x,y);

[0026] S4. Based on the attraction between the image data, obtain the neighbor list of each image data using the natural neighbor search method based on the fusion of universal gravitation.

[0027] S41. For each image data, find the image data with the greatest attraction to it among all other image data, and add it to the neighbor list of that image data.

[0028] S42. In each round of the loop, search for the image data with the greatest attraction to it from all other images except the neighbor list of the image data not included in the neighbor list and add it to the neighbor list of the image data. When all image data has at least one other image data as its neighbor, the entire image dataset reaches a state of gravitational stability and the neighbor search process ends.

[0029] S5. Based on the neighbor list of each image data, determine the neighbor relationship, and according to the neighbor relationship, cluster the images that are neighbors into the same cluster to obtain the image clustering result.

[0030] Furthermore, the value of SSIM is [0,1].

[0031] This paper proposes an image clustering system based on natural neighbor search with fusion of universal gravitation. The system is characterized by executing the image clustering method based on natural neighbor search with fusion of universal gravitation, including: an image dataset acquisition module, an image distance calculation module, an image gravity calculation module, an image neighbor list construction module, and an image clustering result generation module.

[0032] The image dataset acquisition module is used to acquire the image dataset to be clustered;

[0033] The image distance calculation module is used to calculate the distance between each image data in the image dataset based on the image dataset.

[0034] The image-to-image gravity calculation module is used to calculate the gravitational force between each image data in the image dataset based on the distance between each image data.

[0035] The image neighbor list construction module obtains the neighbor list of each image data based on the natural neighbor search method that integrates universal gravitation, according to the attraction between each image data.

[0036] The image clustering result generation module determines the neighbor relationships based on the neighbor list of each image data, and clusters the images that are neighbors into the same cluster according to the neighbor relationships, thus obtaining the image clustering result.

[0037] The present invention also proposes a computer device, the device including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the above-described method.

[0038] Compared with existing technologies, it has the following beneficial effects:

[0039] The image clustering method based on natural neighbor search with fusion gravity of the present invention utilizes the parameter-free property of natural nearest neighbors and the law of universal gravitation. Combined with the natural structure of the image dataset, it selects an appropriate mass weight calculation method to calculate the universal gravitation between image data. By replacing the traditional distance measurement method with universal gravitation, the natural neighbors of image data are redefined. Based on the neighbor list, the image clustering results are obtained, thus improving the accuracy of image clustering. Attached Figure Description

[0040] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0041] Figure 1 This is a schematic diagram of an image clustering method based on natural neighbor search with fusion of universal gravitation provided in an embodiment of the present invention.

[0042] Figure 2 This is a schematic diagram illustrating the construction of a saturated neighborhood graph based on the natural nearest neighbor algorithm, as provided in an embodiment of the present invention.

[0043] Figure 3 This is a schematic diagram of an image clustering system based on natural neighbor search with fusion of universal gravitation, provided in an embodiment of the present invention. Detailed Implementation

[0044] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0045] It should be understood that, when used in this specification and the appended claims, the terms "comprising" and "including" indicate the presence of the described features, integrals, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.

[0046] The present invention will be further described below with reference to the accompanying drawings and specific embodiments, but this is not intended to limit the scope of the invention.

[0047] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the invention. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.

[0048] It should also be further understood that the term "and / or" as used in this specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0049] Terminology Explanation:

[0050] Nearest Neighbor: Nearest neighbor retrieval is one of the fundamental problems in big data processing, with wide applications in machine learning and pattern recognition. Its main process involves preprocessing massive amounts of data and building an index, enabling efficient finding and querying of the closest data object. The core idea of ​​nearest neighbor is to find the few closest data objects to the data object to be predicted, and then make a prediction based on the categories of these closest objects.

[0051] K-Nearest Neighbors (KNN): This means that each sample can be represented by its k nearest neighbors. Cover and Hart proposed the original nearest neighbor algorithm in 1968. KNN is a classification algorithm that uses instance-based learning, which is lazy learning. This means that KNN does not have an explicit learning process; there is no training phase. The dataset already has classifications and feature values, and new samples are processed directly upon arrival.

[0052] Natural Neighbors: The core idea of ​​Natural Neighbors is that the most isolated data objects in a dataset have fewer nearest neighbors or the lowest energy, while denser objects have more nearest neighbors or higher energy. Natural Neighbors can be viewed as a special type of k-nearest neighbor algorithm, automatically assigning a different k value to each point, and ensuring that each point has at least one nearest neighbor. If the formation process of k-nearest neighbors and ε-nearest neighbors is considered an active neighbor search process, then the formation process of Natural Neighbors is a completely passive neighbor search process. In the Natural Neighbors algorithm, each data point can adaptively obtain a different number of natural neighbors. When all data points have at least one natural neighbor, the entire dataset becomes stable, and the search process ends.

[0053] Universal gravitation: Universal gravitation is a natural law discovered by Newton: any two point masses exert a mutual attraction along the line connecting their centers. The magnitude of this attraction is directly proportional to the product of their masses and inversely proportional to the square of the distance between them, and is independent of the chemical composition of the two objects and the type of medium between them.

[0054]

[0055] The law of universal gravitation has two key parameters: mass M and distance R.

[0056] This invention presents an image clustering method based on natural neighbor search incorporating universal gravitation. For example... Figure 1 As shown, the image clustering method based on natural neighbor search with fusion gravity includes the following steps S1 to S5.

[0057] S1. Obtain the image dataset to be clustered.

[0058] S2. Based on the image dataset, calculate the distance dist(x,y) between each image data in the image dataset; specifically including:

[0059] S21. Calculate the similarity SSIM(x,y) between two images;

[0060] The similarity between two images X and Y is calculated using the following formula, denoted as SSIM(x,y);

[0061]

[0062] Where u x and u y σ represents the average gray level of the two images. x and σ y σ represents the standard deviation of two images. xy SSIM represents the covariance of two images; C1 and C2 are constants to avoid the denominator being zero, and the values ​​of C1 and C2 depend on u and σ; if the denominator is close to zero, the values ​​of C1 and C2 can be arbitrarily chosen to increase the stability of the SSIM value; the above formula represents the structural similarity between two images; the larger the SSIM value, the more similar the two images are.

[0063] S22. Calculate the distance dist(x,y) between two images;

[0064] The distance between two images is denoted as dist(x,y) and is calculated using the following formula:

[0065] dist(x,y)=1-SSIM(x,y).

[0066] S3. Based on the distance dist(x,y) between the image data, calculate the gravitational force between the image data in the image dataset.

[0067] Quality weight M yx The calculation of the gravitational force between sample points requires first calculating the mass of the samples. Image data is not an object, so its mass cannot be directly calculated. We can use a method to calculate image data mass weights instead. The SCAN algorithm defines the concept of structural similarity, and we will use this method to calculate the mass weights. Specifically, we first construct a saturated neighborhood graph using the natural nearest neighbor algorithm, and then analyze the structural similarity between each image data point and other image data points based on the saturated neighborhood graph to calculate the mass weight. The specific steps are as follows:

[0068] S31. Construct a saturated neighborhood graph based on the natural nearest neighbor algorithm.

[0069] The specific process of constructing a saturated neighborhood graph based on the natural nearest neighbor algorithm is as follows: Figure 2 As shown. First, the natural neighbor algorithm is used to obtain the natural neighbors and feature value parameter r for each data point. Figure 2 In this context, r=6 means that each data point searches for its six nearest neighbors. When r=6, each data point is considered a neighbor of another data point, and then the process ends. Figure 2 As shown in (a) to (f), each point has neighbors and is connected to its nearest r neighbor by a straight line with progressive arrows (r is automatically determined by the natural neighbor algorithm). Figure 2 In the diagram, (f) represents the final result of the constructed saturated neighborhood graph.

[0070] S32. Calculate the quality weight by analyzing the structural similarity between each image data and other image data based on the saturated neighborhood graph. The calculation method is as follows:

[0071]

[0072] Among them, the quality weight M xy The quality m of image x x With the quality m of image y y The product of σ(x, y) represents the structural similarity between sample image x and image y, defined as the quotient of the square root of the product of the number of shared structures of image nodes x and y and the number of their respective node structures; Γ(x) represents the node structure of image x, referring to the set of image node x and its connected nodes, and Γ(y) represents the node structure of image y, referring to the set of image node y and its connected nodes.

[0073] S33. Calculate the gravitational force between image x and image y; the specific calculation formula is as follows:

[0074]

[0075] Where G is the gravitational constant, with a value of 1; m y For the quality of image y, m x Let x be the quality of image x, and R be the distance between image y and x, where R = dist(x,y).

[0076] Calculation of universal gravitation: In the image clustering method that integrates natural neighbor search based on universal gravitation, all images are treated as lying on a straight line. Only the magnitude of gravity is calculated, without considering the direction of gravity, to ensure the simplicity of the algorithm. In Newton's law of universal gravitation, G is the gravitational constant, which has no effect on the clustering results. For ease of calculation, it is set to 1.

[0077] S4. Based on the attraction between the image data, obtain the neighbor list of each image data using the natural neighbor search method based on the fusion of universal gravitation.

[0078] S41. For each image data, find the image data with the greatest attraction to it among all other image data, and add it to the neighbor list of that image data.

[0079] S42. In each iteration, search for the image data with the greatest attraction to it from all other images except those not included in the neighbor list and add it to the neighbor list of that image data. This continues until all image data have at least one other image data that considers it a neighbor, at which point the entire image dataset reaches a state of gravitational stability, and the neighbor search process ends.

[0080] The pseudocode description of steps S1-S4 of the image clustering method based on natural neighbor search with fusion of universal gravitation is as follows:

[0081] Input: Image dataset X

[0082] Output: :GNaN(x i (Image x) i Gravitational natural neighbors), GNNr (image x in X) i r gravitational natural neighbors), r (gravitational natural neighbor eigenvalues), nb(x i (Image x) i (Number of natural neighbors of gravity)

[0083] Initial values: r = 1, flag = 1, count(1) = size(X),

[0084] while flag do

[0085] #Calculate the gravitational force between every two samples

[0086] for each data x i in X do

[0087] for each data x j in X do

[0088] Calculate F(x) based on the gravitational formula between samples. i y i );

[0089] F(x) i y i Add to sample x i The gravitational set G(x) between other samples i );

[0090] end

[0091] From set G(x) i Take out x i The r-th gravitational nearest neighbor

[0092] nb(x q)=nb(x q +1;

[0093] GNaN(x q )=GNaN(x q )∪x i ;

[0094] GNN r (x i ) = GNN r (x i )∪x q ;

[0095] end

[0096] Count the number of sample points with an nb value of zero (count(r));

[0097] If count(r) no longer changes, then

[0098] flag=0

[0099] else

[0100] r = r + 1

[0101] end

[0102] End

[0103] Where X = x i ∈Rd: Image dataset with d-dimensional feature space, GNNr(x) i Image x in image dataset X i r natural gravitational neighbors, GNaN(x i ):x i Gravitational natural neighbors, nb(x) i ):x i The number of natural neighbors of gravitational attraction, G(x) i ) is sample x i The gravitational set between it and other samples.

[0104] Wherein, GNaN(x i This refers to the list of natural neighbors for each image data obtained through step S4.

[0105] S5. Based on the neighbor list of each image data, determine the neighbor relationship, and according to the neighbor relationship, cluster the images that are neighbors into the same cluster to obtain the image clustering result.

[0106] Specifically, based on the neighbor list GNaN(x) obtained in step S4 iThe process involves determining neighbor relationships and clustering images that are neighbors into the same cluster, ultimately obtaining the image clustering result.

[0107] In one specific embodiment, a gravity-saturated natural neighborhood graph GSNaNG(X) is generated based on the neighbor list. The image clustering results can be viewed more intuitively through the gravity-saturated natural neighborhood graph.

[0108] This application proposes an image clustering method based on natural neighbor search incorporating universal gravitation. Leveraging the parameter-free nature of natural nearest neighbors, it adaptively calculates the necessary parameters, eliminating the influence of human-defined parameters and improving the accuracy of image clustering. Secondly, this application proposes a novel universal gravitation calculation method. Utilizing the law of universal gravitation and combining it with the natural structure of the image dataset, an appropriate mass weight calculation method is selected to calculate the universal gravitation between image data. This universal gravitation is used to replace the traditional distance measurement method and applied to the image neighbor search method, redefining the natural neighbors of image data. Based on the neighbor list, the image clustering results are obtained. Using gravity as the criterion for judging image neighbors better reflects the overall characteristics of the image dataset. The gravity-based neighborhood graph reduces the sensitivity to noise points in the image dataset, improves the rationality of processing cluster edge points, and enhances the accuracy of image clustering.

[0109] Figure 3 This is an image clustering system based on natural neighbor search fused with universal gravitation, provided by an embodiment of the present invention. For example... Figure 3 As shown, the image clustering system based on natural neighbor search with fusion of universal gravitation includes an image dataset acquisition module, an image distance calculation module, an image gravity calculation module, an image neighbor list construction module, and an image clustering result generation module.

[0110] The image dataset acquisition module is used to acquire the image dataset to be clustered;

[0111] The image distance calculation module is used to calculate the distance between each image data in the image dataset based on the image dataset.

[0112] The image-to-image gravity calculation module is used to calculate the gravitational force between each image data in the image dataset based on the distance between each image data.

[0113] The image neighbor list construction module obtains the neighbor list of each image data based on the natural neighbor search method that integrates universal gravitation, according to the attraction between each image data.

[0114] The image clustering result generation module determines the neighbor relationships based on the neighbor list of each image data, and clusters the images that are neighbors into the same cluster according to the neighbor relationships, thus obtaining the image clustering result.

[0115] The aforementioned image clustering system based on natural neighbor search with fusion gravity can be implemented as a computer program that can run on a computer device.

[0116] The computer device can be a server, which can be a standalone server or a server cluster consisting of multiple servers.

[0117] Computer devices include processors, memory, and network interfaces connected via a system bus, wherein the memory may include non-volatile storage media and internal memory.

[0118] The non-volatile storage medium can store an operating system and a computer program. The computer program includes program instructions that, when executed, cause the processor to perform an image clustering method based on a natural neighbor search fused with gravity.

[0119] This processor provides computing and control capabilities to support the operation of the entire computer device.

[0120] This internal memory provides an environment for the execution of computer programs in non-volatile storage media. When executed by a processor, the computer program enables the processor to perform an image clustering method based on natural neighbor search with fusion gravity.

[0121] This network interface is used for network communication with other devices. Those skilled in the art will understand that the above-described computer device structure is only a partial structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than shown in the figures, or combine certain components, or have different component arrangements.

[0122] The processor is used to run a computer program stored in the memory, which implements the image clustering method based on natural neighbor search with fused gravity as described in Embodiment 1.

[0123] It should be understood that, in the embodiments of this application, the processor may be a Central Processing Unit (CPU), but it may also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.

[0124] It will be understood by those skilled in the art that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program includes program instructions and can be stored in a storage medium, which is a computer-readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the process steps of the embodiments of the above methods.

[0125] The present invention also provides a storage medium. This storage medium may be a computer-readable storage medium. The storage medium stores a computer program, wherein when executed by a processor, the computer program causes the processor to perform the image clustering method based on natural neighbor search fused with gravity, as described in Embodiment 1.

[0126] The storage medium can be any computer-readable storage medium capable of storing program code, such as a USB flash drive, portable hard drive, read-only memory (ROM), magnetic disk, or optical disk.

[0127] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0128] In the several embodiments provided by this invention, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For example, the division of each unit is merely a logical functional division, and there may be other division methods in actual implementation. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed.

[0129] The steps in the method of this invention can be adjusted, merged, or reduced in order according to actual needs. The units in the device of this invention can be merged, divided, or reduced according to actual needs. Furthermore, the functional units in the various embodiments of this invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0130] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a terminal, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention.

[0131] Note that the above description is merely a preferred embodiment of the present invention and the technical principles employed. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions can be made without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments, and may include many other equivalent embodiments without departing from the concept of the present invention, the scope of which is determined by the scope of the appended claims.

Claims

1. An image clustering method based on natural neighbor search with fusion of gravitational forces, characterized in that, Including the following steps: S1. Obtain the image dataset to be clustered; S2. Based on the image dataset, calculate the distance dist(x,y) between each image data in the image dataset; specifically including: S21. Calculate the similarity SSIM(x,y) between two images; The similarity between two images X and Y is calculated using the following formula, denoted as SSIM(x,y). Where u x and u y σ represents the average gray level of the two images. x and σ y σ represents the standard deviation of two images. xy SSIM represents the covariance of two images; C1 and C2 are constants to avoid the denominator being zero, and the values ​​of C1 and C2 depend on u and σ; if the denominator is close to zero, the values ​​of C1 and C2 can be arbitrarily chosen to increase the stability of the SSIM value; the above formula represents the structural similarity between two images; the larger the SSIM value, the more similar the two images are. S22. Calculate the distance dist(x,y) between two images; The distance between two images is denoted as dist(x,y) and is calculated using the following formula: dist(x,y)=1-SSIM(x,y); S3. Based on the distance dist(x,y) between the image data, calculate the gravitational force between the image data in the image dataset; S31. Construct a saturated neighborhood graph based on the natural nearest neighbor algorithm; S32. Calculate the quality weight by analyzing the structural similarity between each image data and other image data based on the saturated neighborhood graph. The calculation method is as follows: Among them, the quality weight M xy The quality m of image x x With the quality m of image y y The product of σ(x, y) represents the structural similarity between sample image x and image y, defined as the quotient of the square root of the product of the number of shared structures of image nodes x and y and the number of their respective node structures; Γ(x) represents the node structure of image x, referring to the set of image node x and its connected nodes, and Γ(y) represents the node structure of image y, referring to the set of image node y and its connected nodes. S33. Calculate the gravitational force between image x and image y; the specific calculation formula is as follows: Where G is the gravitational constant, with a value of 1; m y For the quality of image y, m x Let x be the quality of image x, and R be the distance between image y and x, where R = dist(x,y); S4. Based on the attraction between the image data, obtain the neighbor list of each image data using the natural neighbor search method based on the fusion of universal gravitation. S41. For each image data, find the image data with the greatest attraction to it among all other image data, and add it to the neighbor list of that image data. S42. In each round of the loop, search for the image data with the greatest attraction to it from all other images except the neighbor list of the image data not included in the neighbor list and add it to the neighbor list of the image data. When all image data has at least one other image data as its neighbor, the entire image dataset reaches a state of gravitational stability and the neighbor search process ends. S5. Based on the neighbor list of each image data, determine the neighbor relationship, and according to the neighbor relationship, cluster the images that are neighbors into the same cluster to obtain the image clustering result.

2. The method according to claim 1, characterized in that, The value of SSIM is [0,1].

3. An image clustering system based on natural neighbor search with fusion of gravitational forces, characterized in that, The image clustering system executes the image clustering method based on natural neighbor search with fusion gravity as described in claim 1, including: an image dataset acquisition module, an image distance calculation module, an image gravity calculation module, an image neighbor list construction module, and an image clustering result generation module; The image dataset acquisition module is used to acquire the image dataset to be clustered; The image distance calculation module is used to calculate the distance between each image data in the image dataset based on the image dataset. The image-to-image gravity calculation module is used to calculate the gravitational force between each image data in the image dataset based on the distance between each image data. The image neighbor list construction module obtains the neighbor list of each image data based on the natural neighbor search method that integrates universal gravitation, according to the attraction between each image data. The image clustering result generation module determines the neighbor relationships based on the neighbor list of each image data, and clusters the images that are neighbors into the same cluster according to the neighbor relationships, thus obtaining the image clustering result.

4. A computer device, characterized in that, The device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the method as described in any one of claims 1 to 2.