Fuzzy clustering effectiveness index optimization method applied to image segmentation
By adopting a multi-grained model in image segmentation, the fine-grained pixel points are converted into coarse-grained points, the existing fuzzy clustering effectiveness index is solved, and a more efficient and robust image segmentation effect is achieved.
Patent Information
- Application Number
- CN202411772186.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-04
- Publication Date
- 2025-03-14
AI Technical Summary
The existing fuzzy clustering effectiveness indexes are inefficient and insufficiently accurate in image segmentation, making it difficult to effectively identify the optimal number of clusters of images.
Using a multi-grained model, fine-grained pixel points are converted into coarse-grained pixel points. Through the particle spherical model and local density peak set model, the calculation amount is reduced and the robustness to noise is improved.
It significantly shortens the running time of fuzzy CVI, improves the efficiency and accuracy of image segmentation, and enhances the robustness to noise.
Smart Images

Figure CN119625361A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of computer vision, and in particular relates to an optimization method for fuzzy clustering effectiveness index applied to image segmentation. Background Art
[0002] Image segmentation is a core task in the field of image processing. Its goal is to divide an image into several independent regions so that pixels in the same region have high similarity in certain characteristics (such as color, texture, shape, etc.), while the characteristics between different regions are significantly different. This process can effectively extract targets of interest from complex scenes, providing key support for subsequent image analysis, target recognition, tracking and understanding. Image segmentation technology plays an important role in many practical applications. For example, in agricultural monitoring, segmenting pest and disease areas can help farmers take timely prevention and control measures to increase crop yields; in robot navigation, segmenting obstacles and driving paths can ensure the safe movement of robots in complex environments; in microscopic image analysis, segmenting cell or tissue regions can assist scientists in cell counting or pathological research; in industrial inspection, segmenting product surface defects, such as scratches or cracks, helps improve the automation level of product quality control.
[0003] In the image segmentation task, the clustering algorithm divides the image into different regions or clusters by measuring and grouping the similarity of the pixels or features of the image. This type of algorithm belongs to an unsupervised learning method, which can mine the potential structural features in the image and cluster similar pixels together without relying on explicit labels or prior knowledge. This enables the clustering algorithm to efficiently implement image segmentation, providing an important tool for processing and analyzing image data. The determination of the number of clusters is very important, which directly determines how many blocks of similar pixels an image will be divided into. Manually determining the number of clusters is not smart enough, so a method is needed to automatically identify the number of clusters that should be obtained. The fuzzy clustering effectiveness index can help find the optimal number of clusters that each image should be segmented into. The specific approach is to use each for each cluster number k (maximum is N is the number of pixels), and the corresponding fuzzy clustering effectiveness index is calculated. The k corresponding to the maximum (minimum) value point finally obtained is the optimal number of clusters. However, the existing fuzzy clustering effectiveness index has the problems of low efficiency and insufficient accuracy. Summary of the invention
[0004] In order to improve the efficiency of image segmentation and the robustness to noise in the image segmentation process, the present invention proposes an optimization method for fuzzy clustering effectiveness index applied to image segmentation, which specifically includes the following steps:
[0005] S1, acquiring a target image, and taking each pixel of the target image as a data object;
[0006] S2, using a multi-granularity model to calculate all data objects of the target image, and converting fine-grained pixels into coarse-grained pixels;
[0007] S3, change the number of clusters k from The cmeans algorithm is used to cluster into k clusters, and the fuzzy clustering validity index is used to calculate the index value, where M is the number of objects after multi-granularity calculation. The present invention converts N fine-grained pixel points into M coarse-grained pixel points, which converts the traditional Find the optimal number of clusters to reduce from Find the optimal number of clusters in the clustering, which can effectively reduce the amount of calculation and improve;
[0008] S4. According to the index value calculated in S3, the number of clusters corresponding to the maximum or minimum value of the index value is obtained, and the optimal number of clusters k is obtained.
[0009] As an optional implementation, the fine-grained pixel points are converted into coarse-grained pixel points using a granular sphere model, which specifically includes the following steps:
[0010] 101. All data objects are regarded as a sphere, and all spheres of the target image are added to the calculation queue;
[0011] 102. Take a ball from the calculation queue. If the radius of the ball is greater than the set threshold, execute step 105; otherwise, execute step 103;
[0012] 103. Calculate the mass of the current ball, and use the ball as the parent ball to pre-split the ball into two child balls, and calculate the splitting weights of the two child balls;
[0013] 104. Determine whether the weighted sum of the masses of the two pre-split daughter balls based on the splitting weights is less than the mass of the parent ball. If so, perform the pre-split operation. Otherwise, perform step 106.
[0014] 105. Perform a splitting operation on the current particle ball, and add the split sub-particle balls to the calculation queue, and return to step 102;
[0015] 106. Add the center of the current sphere to the result set;
[0016] 107. Determine whether the calculation queue is empty. If not, return to step 102; otherwise, use the number of elements in the result set as the value of M.
[0017] As another optional implementation, the fine-grained pixel points are converted into coarse-grained pixel points using a local density peak set model, which specifically includes the following steps:
[0018] 201. Calculate the natural neighbors of each data object;
[0019] 202. Calculate the dynamic scanning radius of each data object;
[0020] 203. Detect outliers from their natural neighbor sets through dynamic scanning radius and filter outliers;
[0021] 204. For the non-outlier points, calculate the convergence points of the non-outlier points, and add the convergence points to the result set;
[0022] 205. After adding the convergence points of all objects to the result set, the number of points in the result set is used as the value of M.
[0023] The granular sphere model of the present invention forms granular spheres by aggregating data with similar distributions, thereby significantly reducing the amount of calculation while retaining the original data structure, making the algorithm more efficient when processing large-scale data; on the other hand, the local density peak set characterizes the data through the core points in the high-density area, which can effectively remove low-density boundary points, thereby improving the accuracy of the clustering results. In the image segmentation experiment, the fuzzy CVI based on this multi-granularity method not only significantly shortens the running time, but also outperforms the traditional single-granularity method in accuracy, verifying its superiority in image segmentation and other noise-sensitive data processing scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 A flowchart of a method for optimizing fuzzy clustering effectiveness index applied to image segmentation according to the present invention;
[0025] Figure 2 Two implementation methods of converting fine-grained pixels into coarse-grained pixels in an embodiment of the present invention;
[0026] Figure 3 Schematic diagram of the particle-sphere splitting in Example 1 of the present invention;
[0027] Figure 4 Schematic diagram of finding the LPS convergence point in Example 1 of the present invention. DETAILED DESCRIPTION
[0028] 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.
[0029] The present invention proposes a method for optimizing the fuzzy clustering effectiveness index for image segmentation, such as Figure 1, specifically including the following steps:
[0030] S1, acquiring a target image, and taking each pixel of the target image as a data object;
[0031] S2, using a multi-granularity model to calculate all data objects of the target image, and converting fine-grained pixels into coarse-grained pixels;
[0032] S3, change the number of clusters k from Loop, use the cmeans algorithm to cluster into k clusters, and use the fuzzy clustering effectiveness index to calculate the index value, where M is the number of objects after multi-granularity calculation;
[0033] S4. According to the index value calculated in S3, the number of clusters corresponding to the maximum or minimum value of the index value is obtained, and the optimal number of clusters k is obtained.
[0034] Most of the existing fuzzy clustering effectiveness indices are based on the most fine-grained calculations, and all data points are involved in the calculation of the indicators, which leads to insufficient robustness to noise and low efficiency. To address this problem, the present invention introduces two mathematical models, GB and LPS, to convert fine-grained pixel data in the image into coarse-grained pixel data, thereby improving efficiency and robustness to noise. This embodiment proposes an embodiment of an optimization method for fuzzy clustering effectiveness indicators applied to image segmentation, which specifically includes the following steps:
[0035] S1. Collect source data.
[0036] For image data, the target images are selected from the famous open source dataset BSDS500, which contains many high-resolution images that can be used for image segmentation scenarios.
[0037] S2: convert fine-grained pixels into coarse-grained pixels.
[0038] In this embodiment, two methods are provided to convert fine-grained pixels into coarse-grained pixels. As an optional implementation, the fine-grained pixel points are converted into coarse-grained pixel points using a granular sphere model, which specifically includes the following steps:
[0039] 101. All data objects are regarded as a sphere, and all spheres of the target image are added to the calculation queue;
[0040] 102. Take a ball from the calculation queue. If the radius of the ball is greater than the set threshold, execute step 105; otherwise, execute step 103;
[0041] 103. Calculate the mass of the current ball, and use the ball as the parent ball to pre-split the ball into two child balls, and calculate the splitting weights of the two child balls;
[0042] 104. Determine whether the weighted sum of the masses of the two pre-split daughter balls based on the splitting weights is less than the mass of the parent ball. If so, perform the pre-split operation. Otherwise, perform step 106.
[0043] 105. Perform a splitting operation on the current particle ball, and add the split sub-particle balls to the calculation queue, and return to step 102;
[0044] 106. Add the center of the current sphere to the result set;
[0045] 107. Determine whether the calculation queue is empty. If not, return to step 102; otherwise, use the number of elements in the result set as the value of M.
[0046] Granular-Ball is a data representation method based on multiple granularities, which is used to effectively represent unsupervised data. The basic concept of Granular-Ball is to aggregate data points with similar distribution into a "Granular-Ball". A Granular-Ball can be regarded as a set of several sample points, which is used to replace multiple data points in the original data set, thereby reducing the amount of calculation and improving noise resistance.
[0047] In this embodiment, the center and radius of the sphere are defined as follows:
[0048]
[0049] r=max(||p i -c||),p i ∈GB
[0050] Among them, c represents the center of the sphere, n refers to the number of data points in a sphere, and p i refers to the i-th data point in a sphere; r is the radius of the sphere, ||·|| means the Euclidean distance; GB represents the set of all data points in a sphere.
[0051] In this embodiment, the smaller the mass of the pellet, the closer the points inside the pellet are, indicating that the particle size of the pellet is more reasonable. Therefore, in this embodiment, the mass of the pellet is defined as:
[0052]
[0053] In this embodiment, the spherules need to meet one of the following two conditions for splitting:
[0054] 1. The radius of the sphere is greater than the set threshold;
[0055] 2. Use the current ball as the parent ball to pre-split the ball into two daughter balls, calculate the splitting weights of the two daughter balls, and check whether the weighted sum of the ball masses of the two daughter balls according to the splitting weights is less than the mass of the parent ball.
[0056] For the first condition above, the radius r of a sphere needs to be greater than a set threshold. In this embodiment, the set threshold is an adaptive threshold, and the calculation process of the threshold includes:
[0057] R = 2 × max (mean (r), median (r))
[0058] Wherein, R represents the radius threshold of the two pre-split sub-spheres; mean(r) represents the average of all sphere radii, and median(r) represents the median of all sphere radii. In this embodiment, all spheres refer to all spheres generated for the current feature map, including spheres in the counting queue and spheres in the result set.
[0059] In this embodiment, when splitting the particle ball, the two data points with the farthest distance are found in the particle ball, and the other data points are selected to form a sub-particle ball based on the distance between the two data points. That is, in the present invention, the two data points with the farthest distance are first determined from the parent particle ball, and then the distance between the other data points is calculated, and the other data points are selected to form a sub-particle ball with the data points with a smaller distance.
[0060] In the present invention, the weighted sum of the mass of the sub-spheres based on the splitting weights is expressed as:
[0061]
[0062] Among them, DM weight is the weighted sum of the quality of the sub-particles based on the split weights; |A| is the number of sample points included in the parent node of the sub-particle, |A1| and |A2| are the number of sample points included in the two sub-particles obtained by splitting the parent node. They are the masses of the two daughter balls obtained by splitting the parent node.
[0063] As another optional implementation, the fine-grained pixel points are converted into coarse-grained pixel points using a local density peak set model, which specifically includes the following steps:
[0064] 201. Calculate the natural neighbors of each data object;
[0065] 202. Calculate the dynamic scanning radius of each data object;
[0066] 203. Detect outliers from their natural neighbor sets through dynamic scanning radius and filter outliers;
[0067] 204. For the non-outlier points, calculate the convergence points of the non-outlier points, and add the convergence points to the result set;
[0068] 205. After adding the convergence points of all objects to the result set, the number of points in the result set is used as the value of M.
[0069] Figure 3 A schematic diagram of converting fine-grained pixels into coarse-grained pixels through the granular sphere model is given. In this process, each pixel is regarded as a data object. As shown in Figure (a), all data objects are regarded as a granular sphere centered on c. Then pre-splitting is performed to find the two data objects p1 and p2 that are farthest apart in the granular sphere. The data object closer to p1 in the entire granular sphere is divided to p1 to form a granular sphere centered on V1; the data object closer to p2 is divided to p2 to form a granular sphere centered on V2. As shown in Figure (b), the sum of the weighted DM values of the two sub-spheres after pre-splitting does not exceed the DM value of the parent sphere, so they should be split and added to the calculation queue. When split to the state of Figure (c), the radius of the red sphere is still too large because it is greater than 2×max(mean(r), median(r)), and further splitting is required, that is, the splitting operation is continued for these areas. The final splitting result is shown in Figure (d).
[0070] In this embodiment, it is necessary to calculate the natural neighbors of each data point, and the definitions related to natural neighbors are as follows:
[0071] (a) k Nearest Neighbors k (x)): For a data set X, the kth nearest neighbor of data object x is the kth point in the data set that is closest to x:
[0072] NN k (x)={p∈X|dist(x, p)≤dist(x, o)}
[0073] Wherein, dist(x, p) is the Euclidean distance between data object x and data object p, and o is the kth nearest neighbor point to data object x.
[0074] (b) Reverse Neighbors, RNN k (x)) refers to the set of all data points that regard data object x as a neighbor, that is, if data object x is the k-nearest neighbor of data object p, then data object p is the reverse neighbor of data object x.
[0075] (c) Natural Neighbors (NaN(x)) is a set of points that satisfy a bidirectional relationship:
[0076] NaN(x)=NN λ (x)∩RNN λ (x)
[0077] Among them, λ is the adaptively obtained natural neighbor eigenvalue, which is used to determine the complexity of the natural neighbor relationship.
[0078] The steps to calculate the natural neighbors of each point are:
[0079] 301. Initialize the search radius r = 1, the r-neighbor set NN of all points r (x), reverse neighbor set RNN r (x) and the reverse neighbor count Nb(x) are both empty or 0;
[0080] 302. Use the data set X to construct a kd tree T to support efficient neighbor query;
[0081] 303. For each data object x, find its r-neighbor u, update its reverse neighbor count Nb(u)=Nb(u)+1, and add u to NN r (x) and add x to the RNN r (u);
[0082] 304. Check the stop condition, count the number of points Num whose reverse neighbor count is 0, if Num does not change or Num=0, stop searching, otherwise set r=r+1 and return to step 303;
[0083] 305. When the search stops, the current search radius r is recorded as the natural neighbor feature value λ.
[0084] 306. For each data object x, calculate its natural neighbor set NaN(x)=NN according to λ λ (x)∩RNN λ (x);
[0085] 307. Output the natural neighbor set NaN(x) of each point as the final result.
[0086] The process of detecting outliers from their natural neighbor sets by dynamically scanning the radius includes:
[0087] Calculate the scanning radius between all data objects. The change in scanning radius between data object x and data object p is expressed as
[0088] Calculate the standard deviation and expected value of the variation between all data objects, and calculate the outlier detection threshold, expressed as: β = EX(RVarList) + ω*SD(RVarList);
[0089] When the change in the scanning radius between data object x and data object p, RVar(x, p)>β, the data object x is an outlier;
[0090] Among them, r(x) and r(p) represent the dynamic scanning radius of data object x and data object p respectively. The dynamic scanning radius of data object x is the maximum Euclidean distance between data object x and its natural neighbors; EX(RVarList) is the expected value of the change in scanning radius between all data objects; SD(RVarList) is the standard deviation of the change in scanning radius between all data objects, and ω is the adjustment coefficient.
[0091] Calculate the convergence point of each non-outlier point, and the set of all convergence points is the result set. The calculation steps include the following steps:
[0092] For each non-outlier data object x, set the initial convergence point CP(x) = x;
[0093] In the natural neighbor set of each data object x (including the data point itself) NaN(x)∪{x}, find the point closest to the center of this natural neighbor set, denoted as CPV(x);
[0094] The convergence point of the updated data point x is CP(x)=CPV(CP(x)) or a cycle path is detected;
[0095] For each non-outlier point x, the final CP(x) is its convergence point.
[0096] Figure 4 A schematic diagram of the implementation of converting fine-grained pixels into coarse-grained pixels through the local density peak set model is given, where Figure (a) is a schematic diagram of finding the convergence point corresponding to point A. The center point CPV(A) of point A is the point in {A}∪NaN(A) that is closest to the center of {A}∪NaN(A). As shown in the figure, CPV(A)=B, CPV(B)=C, CPV(C)=D, CPV(D)=D, so CP(A)=D, ABCD is the convergence trajectory of point A. Figure 4 The red points in (b) are the set of all convergence points, that is, the result set required for converting fine-grained pixel points into coarse-grained pixel points through the local density peak set model in this embodiment.
[0097] In the present invention, the fuzzy clustering validity index is used to calculate the index value, and the index value can be a silhouette measure index (Silhouette Measure Index) index or a triple center relationship (Triple Center Relation, TCR) index. Those skilled in the art can select a suitable clustering index to calculate the number of clusters according to actual needs.
[0098] 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. A method for optimizing fuzzy clustering effectiveness index for image segmentation, characterized in that: The specific steps include: S1, acquiring a target image, and taking each pixel of the target image as a data object; S2, using a multi-granularity model to calculate all data objects of the target image, and converting fine-grained pixels into coarse-grained pixels; S3, change the number of clusters k from Loop, use the cmeans algorithm to cluster into k clusters, and use the fuzzy clustering effectiveness index to calculate the index value, where M is the number of objects after multi-granularity calculation; S4. According to the index value calculated in S3, the number of clusters corresponding to the maximum or minimum value of the index value is obtained, and the optimal number of clusters k is obtained.
2. The method for optimizing the fuzzy clustering effectiveness index for image segmentation according to claim 1, characterized in that: The fine-grained pixel points are converted into coarse-grained pixel points using the granular sphere model, which specifically includes the following steps:
101. All data objects are regarded as a sphere, and all spheres of the target image are added to the calculation queue; 102. Take a ball from the calculation queue. If the radius of the ball is greater than the set threshold, execute step 105; otherwise, execute step 103; 103. Calculate the mass of the current ball, and use the ball as the parent ball to pre-split the ball into two child balls, and calculate the splitting weights of the two child balls; 104. Determine whether the weighted sum of the masses of the two pre-split daughter balls based on the splitting weights is less than the mass of the parent ball. If so, perform the pre-split operation. Otherwise, perform step 106.
105. Perform a splitting operation on the current particle ball, and add the split sub-particle balls to the calculation queue, and return to step 102; 106. Add the center of the current sphere to the result set; 107. Determine whether the calculation queue is empty. If not, return to step 102; otherwise, use the number of elements in the result set as the value of M.
3. The method for optimizing the fuzzy clustering effectiveness index for image segmentation according to claim 2, characterized in that: When splitting a sphere, the two data points with the farthest distance from each other are found in the sphere, and the other data points are selected to form a sub-sphere based on the distance between them and the two data points.
4. The method for optimizing the fuzzy clustering effectiveness index for image segmentation according to claim 2 or 3, characterized in that: The mass of the pellet is calculated as: Among them, DM represents the mass of the sphere; n represents the number of sample points in the sphere; p i represents the i-th sample point in the sphere; c represents the center of the sphere; ∥·∥ represents the Euclidean distance.
5. The method for optimizing the fuzzy clustering effectiveness index for image segmentation according to claim 2, characterized in that: The weighted sum of the mass of the sub-spheres based on the splitting weights is expressed as: Among them, DM weitht is the weighted sum of the quality of the sub-particles based on the split weights; |A| is the number of sample points included in the parent node of the sub-particle, |A1| and |A2| are the number of sample points included in the two sub-particles obtained by splitting the parent node. They are the masses of the two daughter balls obtained by splitting the parent node.
6. The method for optimizing the fuzzy clustering effectiveness index for image segmentation according to claim 2, characterized in that: The calculation of the two pre-splitting daughter sphere radius thresholds includes: R = 2 × max (mean (r), median (r)) Where R represents the radius threshold of the two pre-split sub-spheres; mean(r) represents the average of all sphere radii; median(r) represents the median of all sphere radii.
7. The method for optimizing the fuzzy clustering validity index for image segmentation according to claim 1, characterized in that: The local density peak set model is used to convert fine-grained pixels into coarse-grained pixels, which specifically includes the following steps:
201. Calculate the natural neighbors of each data object; 202. Calculate the dynamic scanning radius of each data object; 203. Detect outliers from their natural neighbor sets through dynamic scanning radius and filter outliers; 204. For the non-outlier points, calculate the convergence points of the non-outlier points, and add the convergence points to the result set; 205. After adding the convergence points of all objects to the result set, the number of points in the result set is used as the value of M.
8. The method for optimizing the fuzzy clustering validity index for image segmentation according to claim 6, characterized in that: The process of detecting outliers from their natural neighbor sets by dynamically scanning the radius includes: Calculate the scanning radius between all data objects. The change in scanning radius between data object x and data object p is expressed as Calculate the standard deviation and expected value of the variation between all data objects, and calculate the outlier detection threshold, expressed as: β = EX(RVarList) + ω*SD(RVarList); When the change in the scanning radius between data object x and data object p, RVar(x,p)>β, the data object x is an outlier; Among them, r(x) and r(p) represent the dynamic scanning radius of data object x and data object p respectively. The dynamic scanning radius of data object x is the maximum Euclidean distance between data object x and its natural neighbors; EX(RVarList) is the expected value of the change in scanning radius between all data objects; SD(RVarList) is the standard deviation of the change in scanning radius between all data objects, and ω is the adjustment coefficient.
Citation Information
Patent Citations
Image segmentation method based on validity index of fuzzy clustering
CN107220977A
Hierarchical clustering-based method for identifying excavation behavior of discriminant part
CN108280465A
Medical examination report clustering method based on density core and dynamic scanning radius
CN108960298A
Image segmentation method and system based on effectiveness index of fuzzy clustering guided by three-degree separation
CN113674295A
Large-scale public transit network hierarchical optimization method based on multi-scale clustering
CN114037175A