A fast image segmentation method based on sampling clustering

Through the sampling-based image segmentation method, the RNN-DBSCAN algorithm and the construction of representative points is solved, and the problem of high computational complexity of large-scale data sets is realized, which is rapid segmentation and accurate category allocation of images, and overcomes the complex data set structure. challenge.

CN118823357BActive Publication Date: 2024-12-20HUAQIAO UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411302908.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-19
Publication Date
2024-12-20
Estimated Expiration
2044-09-19

AI Technical Summary

Technical Problem

The prior art directly applies clustering algorithms to large-scale data sets to high computational complexity and time-consuming, and the clustering results cannot accurately represent the unique characteristics and differences between different image regions.

Method used

Using a fast image segmentation method based on sampling, image samples are obtained through random sampling, RNN-DBSCAN algorithm is used for local clustering, representative points are constructed, and global classification is performed through clustering algorithms, and image segmentation results are finally updated to reduce the computational complexity and Improve accuracy.

Benefits of technology

It realizes rapid segmentation of images, reduces computational complexity and runtime, and can accurately identify and distinguish categories of complex patterns, overcoming the challenges brought by large-scale data sets.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure QLYQS_4
    Figure QLYQS_4
  • Figure QLYQS_5
    Figure QLYQS_5
  • Figure QLYQS_6
    Figure QLYQS_6
Patent Text Reader

Abstract

The present invention relates to the field of image processing and data analysis and discloses a fast image segmentation method based on sampling clustering, comprising the following steps: (a) randomly sampling an image to obtain samples; (b) clustering local samples to obtain local category centers; (c) constructing representative points; (d) performing global clustering; and (e) updating image segmentation results. The present invention combines the random sampling distribution characteristics and the conclusions obtained from the central limit theorem to select a representative sample set to efficiently merge clustering results from different samples. The construction of representative points solves the defect problem of using cluster centers as category representative points, effectively enhances the distinction between categories and the distribution characteristics of original data, and provides a fast, accurate and reliable clustering method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing and data analysis, and more specifically, proposes a fast image segmentation and clustering method and system based on sampling. Background Art

[0002] Image segmentation plays a vital role in various applications of computer vision, such as object recognition, scene understanding, and medical image analysis. Traditional image segmentation methods usually suffer from high computational complexity and are difficult to apply to large-scale datasets. In addition, they may not be able to effectively capture the inherent features and differences between different image regions.

[0003] In recent years, clustering algorithms have shown good results in image segmentation tasks. Image clustering algorithms mainly refer to the use of clustering algorithms to group pixels or features in an image so as to segment the image into regions or objects with similar properties. Among them, the K-Means clustering algorithm is one of the most commonly used clustering algorithms. It originally originated from signal processing and aims to divide data points into K clusters. The advantages of the K-Means clustering algorithm include simplicity, easy understanding, and fast operation speed, but the disadvantage is that the number of clusters to be clustered needs to be specified before clustering. The analysis process of the algorithm includes determining the K value, randomly selecting the centroid, calculating the distance from each point to the centroid and dividing it, redefining the centroid, and iterating the above steps until the termination condition is met. In image processing, the K-Means clustering algorithm can realize image segmentation, color quantization compression, color level segmentation, etc. Through K-Means clustering, pixels can be clustered into K clusters, and the centroid points in each cluster are used to replace all pixels in the cluster, thereby achieving color simplification or segmentation of the image. This method can effectively reduce the number of colors in an image while maintaining the visual effect of the image without changing the image resolution. In addition to the K-Means clustering algorithm, there are other clustering algorithms applied to image processing, such as the Fuzzy C-Means algorithm, which allows a data point to belong to multiple clusters, each cluster has a certain degree of membership or probability, and is suitable for processing data with uncertainty and ambiguity. The K-medoids algorithm selects the sample point with the most central position in the cluster as the reference point for clustering, and is insensitive to outliers. The Mean Shift algorithm is a density-based non-parametric clustering algorithm that can handle irregularly shaped clusters and noise. The OPTICS algorithm evaluates density by calculating the distance from each point to other points, and generates a sorted list to identify the clustering structure, and can find clusters of any shape and size. In summary, the image clustering algorithm realizes image segmentation, color quantization compression and other functions by grouping pixels or features in the image. Among them, the K-Means clustering algorithm is widely used due to its simplicity and efficiency. At the same time, there are other clustering algorithms that are selected and used according to specific application scenarios and data processing requirements.

[0004] However, directly applying clustering algorithms to large-scale datasets may lead to high computational complexity and time-consuming problems. In addition, the clustering results may not accurately represent the unique characteristics and differences between different image regions. Summary of the invention

[0005] The technical problem to be solved by the present invention is to solve the problem that the prior art directly applies clustering algorithms to large-scale data sets, which may lead to high computational complexity and long time consumption.

[0006] The present invention adopts the following technical solution: a fast image segmentation method based on sampling clustering, comprising the following steps:

[0007] (a) Randomly sample the image and obtain samples:

[0008] Extract the RGB features of each pixel in the image to obtain a 3D data set , perform multiple random sampling to obtain a sample set of multiple images , where S is the number of samples;

[0009] (b) Local sample clustering to obtain local category centers:

[0010] In each image sample dataset The RNN-DBSCAN algorithm is used to perform local clustering analysis, classify similar pixels in the image into the same category, obtain local clustering results, and calculate the center point of each category ;

[0011] (c) Construct representative points:

[0012] Minimum distance: yes Data point to center Minimum distance: in, For all clustering algorithms classified as Class point; For data points arrive Euclidean distance of ; maximum distance: yes Data point to center Maximum distance: ; Average distance: yes Data point to center Average distance: ; The definition of local representative point is: , by putting these four points and The two points are combined into a vector to form a local representative point.

[0013] (d) Perform global clustering:

[0014] Get the local representative points in all sample sets, and use the clustering algorithm to classify again to determine the representative points that are merged together, and calculate the category center of the representative points: Representative point set: ,in The number of categories obtained by clustering the s-th sample set using the clustering algorithm;

[0015] Using clustering algorithms Clustering to identify Category: represents these categories, where For the Representative point categories, is the center set of representative point categories, ;

[0016] (e) Update image segmentation results:

[0017] The classification results obtained from the representative points can be effectively extended to the entire dataset, providing accurate category assignment for the original image. , it is necessary to determine the nearest representative point category center , then Allocation of , which is defined as: , ;in , , , They are representative point category centers The values ​​of the four elements in are the center point, minimum distance, maximum distance and average distance;

[0018] Then, the data points The labels are assigned in the following way and the image is segmented according to the labels:

[0019] ,in, .

[0020] The present invention has the following beneficial effects: the present invention realizes rapid segmentation of images by sampling clustering, so it is not necessary to process all pixel points, and the classification results obtained by using representative points are effectively extended to the entire data set, providing accurate category assignment for the original data points, greatly reducing the computational complexity and running time. At the same time, the representative points proposed by the present invention, on the basis of the local category center points, add more statistical information, can accurately identify and distinguish categories presenting complex patterns, and can overcome the challenges brought by the complex data set structure by using the comprehensive information contained in the local representative points. DETAILED DESCRIPTION

[0021] In order to make the purpose, technical scheme and advantages of the embodiments of the present invention clearer, the technical scheme in the embodiments of the present invention will be clearly and completely described below. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work belong to the scope of protection of the present invention. Therefore, the following detailed description of the embodiments of the present invention is not intended to limit the scope of the invention claimed for protection, but merely represents the selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work belong to the scope of protection of the present invention.

[0022] In the description of the present invention, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", "clockwise", "counterclockwise" and the like to indicate directions or positional relationships are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the referred device or element must have a specific direction, be constructed and operated in a specific direction, and therefore should not be understood as limiting the present invention.

[0023] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.

[0024] In the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0025] In the present invention, unless otherwise clearly specified and limited, a first feature being "above" or "below" a second feature may include that the first and second features are in direct contact, or may include that the first and second features are not in direct contact but are in contact through another feature between them. Moreover, a first feature being "above", "above" and "above" a second feature includes that the first feature is directly above and obliquely above the second feature, or simply indicates that the first feature is higher in level than the second feature. A first feature being "below", "below" and "below" a second feature includes that the first feature is directly below and obliquely below the second feature, or simply indicates that the first feature is lower in level than the second feature.

[0026] Example

[0027] The following are only preferred implementations of the present invention. The protection scope of the present invention is not limited to the following embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention.

[0028] The present invention is based on the principle of sampling distribution. For a given data set , it can be classified into different categories, each with its own distribution characteristics. Data points within the same category have similar properties, and there are obvious differences between different categories. Therefore, the following assumptions can be made:

[0029] Dataset Each class in has a specific, identifiable distribution with bounded variance.

[0030] Assumptions for A sample dataset of The size is limited but large enough to represent the entire dataset.

[0031] In the dataset In the image, points of the same category are closely clustered together, and points of different categories have certain differences.

[0032] Based on these assumptions, the present invention combines the central limit theorem to derive two viewpoints: first, the same category centers in all samples should be distributed in a small neighborhood and obey Gaussian distribution. Second, there should be large differences between different category centers.

[0033] The present invention is a fast image segmentation clustering algorithm based on sampling, which specifically includes the following steps:

[0034] Step 1: Randomly sample the image to obtain samples:

[0035] Extract the RGB features of each pixel in the image to obtain a 3D data set , perform random sampling several times to obtain a sample set of several images .

[0036] Step 2: Cluster local samples and obtain local category centers:

[0037] In each image sample dataset The RNN-DBSCAN algorithm is used to perform local clustering analysis, classify similar pixels in the image into the same category, obtain local clustering results, and calculate the center point of each category If the local clustering results of the samples are correct, then:

[0038] The center points of the corresponding categories in all samples conform to the Gaussian distribution and are independent of the original distribution of the categories.

[0039] For any different samples, the center points of different categories are quite different.

[0040] The RNN-DBSCAN algorithm only needs to select one parameter, namely k The number of nearest neighbors, which makes the algorithm simpler and easier to use. Next, the basic RNN-DBSCAN clustering algorithm is briefly described.

[0041] Assume data set Include n data points, with dimensions d Dimension, for any two Data points x and y , Represents the distance function, used to calculate x and y The distance between them. This paper uses the Euclidean distance, that is, .

[0042] Assume data point , for a given integer k ,in , defines two k -Neighborhood function for the nearest neighbor.

[0043] [Definition 1] (data point x of k -Nearest Neighborhood) data point x of k- The nearest neighbor is defined by the function ,in N satisfy:

[0044] (1)

[0045] (2)

[0046] (3)

[0047] [Definition 2] (data point x The reverse nearest neighbor neighborhood) data point x The reverse nearest neighbor neighborhood of ,in R satisfy:

[0048] (1)

[0049] (2)

[0050] Similar to DBSCAN, three types of data points are defined here: core points, boundary points, and noise points. hour, As the core point; hour, x are boundary points or noise points. Boundary points will be included in a cluster, while noise points remain unassigned.

[0051] [Definition 3] (Direct density reachable) If the data point x Direct density reachable data points y ,So:

[0052] (1)

[0053] (2) (Core point conditions)

[0054] Direct density reachability is asymmetric in non-core points, and also fails to guarantee symmetry in the case of core points. The latter is because the nearest neighbor relation is asymmetric, and the former is because no data point can reach a non-core point.

[0055] [Definition 4] (Density reachable) If there exists a set of data points ,in , and satisfy , then the data point x Density up to data points y .

[0056] (1) : Direct density up to or Direct density up to ;

[0057] (2) Direct density up to ;

[0058] (3) : Direct density up to or Direct density up to ;

[0059] Density reachability is an extension of direct density reachability, which is transitive but not symmetric. However, in the case of core points, this relationship is symmetric because the sequence of core points in the path can be directly density reachable in either direction.

[0060] [Definition 5] (Density Connection) If there is a data point z , so that x and y Both z The density can be reached, x and y There is density connectivity between them. Density connectivity is a symmetric relationship between all types of data points.

[0061] According to the above definition of reachability, the definition of cluster is as follows.

[0062] [Definition 6] (Cluster) Cluster C yes P A non-empty sample set that satisfies two conditions:

[0063] (1) Maximum: If and y and x The density can be reached, ;

[0064] (2) Connectivity: Any two points in a cluster x and y Density connection;

[0065] After determining the cluster C Afterwards, the cluster C The density of is defined as the maximum distance that can be directly reached between core points in the cluster.

[0066] [Definition 7] (Density of cluster C) Cluster C The density of the function definition:

[0067] , , and the data points y Direct density up to x .

[0068] Once all clusters are identified, given cluster C Its density ,cluster C The extended cluster yes C is a superset of , insert the unclustered data points into the clusters C If the nearest core of a data point is not clustered k Nearest Neighbor distance, insert it into middle.

[0069] [Definition 8] (Extended cluster) For a given cluster C , whose extended cluster Equivalent to cluster C and all data points that satisfy the following conditions x The union of:

[0070] (1) , and there are no other clusters , so that (unclustered);

[0071] (2) Data points exist ,satisfy ,and (exist Distance to core k within the distance of the nearest neighbor);

[0072] (3) No data point exists , satisfies the previous condition, and ;

[0073] Finally, all remaining unclustered data points are identified as noise.

[0074] [Definition 9] (Noise point) yes P The noise is then defined as P Does not belong to any cluster A collection of data points, .

[0075] Step 3: Construct representative points:

[0076] Because the center point The features described are not enough. The present invention proposes representative points to reflect the characteristics of each category, which are obtained by adding more statistical information to the local category center. The representative points can reflect the substantial differences between different categories. The specific details are as follows:

[0077] Minimum distance: yes Data point to center Minimum distance:

[0078]

[0079] in, For all clustering algorithms classified as Class point; For data points arrive The Euclidean distance of .

[0080] Maximum distance: yes Data point to center Maximum distance:

[0081]

[0082] Average distance: yes Data point to center Average distance:

[0083]

[0084] The local representative point is defined as:

[0085] , by putting these four points and The two points are combined into a vector to form a local representative point.

[0086] Step 4: Global clustering:

[0087] The above steps obtain local representative points, but it is crucial to integrate the image segmentation results in the global view. In the present invention, all data points are updated in the following way to obtain local representative points in all sample sets, and the clustering algorithm is used again for classification to determine which representative points should be merged together, and the category center of the representative points is calculated, as shown below:

[0088] Representative point set:

[0089] ,in The number of categories obtained by clustering the s-th sample set using the clustering algorithm;

[0090] Use a clustering algorithm (theoretically, any clustering algorithm in the background technology can be used here, and the K-means clustering algorithm is used in the present invention) to Clustering to identify Category. represents these categories, where For the Representative point categories.

[0091] is the center set of representative point categories.

[0092]

[0093] Step 5: Update the image segmentation results:

[0094] The classification results obtained from the representative points can be effectively extended to the entire dataset, providing accurate category assignment for the original image. , it is necessary to determine the nearest representative point category center , then Allocation of , which is defined as:

[0095]

[0096] ;in , , , They are representative point category centers The values ​​of the four elements in are the center point, minimum distance, maximum distance and average distance;

[0097] Then, the data points The labels are assigned in the following way:

[0098]

[0099] in, .

[0100] Since the present invention realizes the rapid segmentation of the image by sampling clustering, it is not necessary to process all the pixels. The classification results obtained by using the representative points are effectively extended to the entire data set, providing accurate category assignment for the original data points, greatly reducing the computational complexity and running time. At the same time, the representative points proposed by the present invention add more statistical information on the basis of the local category center points, and can accurately identify and distinguish categories that present complex patterns. By utilizing the comprehensive information contained in the local representative points, the challenges brought by the complex data set structure can be overcome.

[0101] The above embodiments are only for illustrating the technical concept and features of the present invention, and their purpose is to enable people familiar with the technology to understand the content of the present invention and implement it accordingly, and they cannot be used to limit the protection scope of the present invention. Any equivalent changes or modifications made according to the spirit of the present invention should be included in the protection scope of the present invention.

Claims

1. A fast image segmentation method based on sampling clustering, characterized in that: The steps include: (a) Randomly sample the image and obtain samples: Extract the RGB features of each pixel in the image to obtain a 3D data set , perform multiple random sampling to obtain a sample set of multiple images , where s is the number of samples; (b) Local sample clustering to obtain local category centers: In each image sample dataset The RNN-DBSCAN algorithm is used to perform local clustering analysis, classify similar pixels in the image into the same category, obtain local clustering results, and calculate the center point of each category ; (c) Construct representative points: Minimum distance: yes Data point to center Minimum distance: in, For all clustering algorithms classified as Class point; For data points arrive Euclidean distance of ; maximum distance: yes Data point to center Maximum distance: ; Average distance: yes Data point to center Average distance: ; The definition of local representative point is: ; By putting these four points and The two points are combined into a vector to form a local representative point. (d) Perform global clustering: Get the local representative points in all sample sets, and use the clustering algorithm to classify again to determine the representative points that are merged together, and calculate the category center of the representative points: representative point set ,in For the The number of categories obtained by clustering a sample set using a clustering algorithm; Using clustering algorithms Clustering to identify Category: represents these categories, where For the Representative point categories, is the center set of representative point categories, ; (e) Update image segmentation results: The classification results obtained from the representative points are extended to the entire dataset to provide accurate category assignments for the original images. , it is necessary to determine the nearest representative point category center , then Allocation of , which is defined as: , ; in , , , They are representative point category centers The values ​​of the four elements in are the center point, minimum distance, maximum distance and average distance; Then, the data points The labels are assigned in the following way and the image is segmented according to the labels: ,in, .

Citation Information

Patent Citations

  • Method of image segmentation based on immune spectrum clustering

    CN101299243A

  • SAR (Synthetic Aperture Radar) image segmentation method based on sampling learning

    CN102968796A