Density peak clustering color separation algorithm based on SOM neural network
Through the combination of Real-ESRGAN and SOM neural network, the problem of image degradation and noise points is solved, accurate color separation of high-resolution images is achieved, the calculation process is simplified, and the accuracy and efficiency of the color separation algorithm are improved.
Patent Information
- Application Number
- CN202410684083.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-30
- Publication Date
- 2024-08-30
AI Technical Summary
In the existing knitting pattern CAD system, the details of the pattern image caused by image degradation are not clear enough, and the color separation algorithm is difficult to process accurately, and the commonly used algorithms ignore local spatial information, prone to noise point problems, high computational overhead, and parameter Setup errors often occur.
Real-ESRGAN blind super-resolution reconstruction network is used for image clarity processing, combined with SOM neural network and improved density peak clustering algorithm, and through Lab color space conversion and connected domain analysis, the number of clusters is automatically calculated and noise points are merged. Reduce the amount of calculation and noise points.
It improves image detail information, simplifies the calculation amount of color separation algorithm, improves accuracy, automatically calculates the number of clusters, effectively solves the problem of noise points, and improves color separation accuracy and calculation efficiency.
Smart Images

Figure CN118570315A
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of clarity processing and color separation, in particular to a density peak value clustering color separation algorithm based on a SOM neural network. Background Art
[0002] The knitting pattern CAD system is a computer-aided design software specially used for knitting product pattern design, which greatly improves the design and production efficiency of products. The knitting pattern CAD system first performs color separation on the input pattern image to obtain a color separation image with limited color types; then the pattern is properly edited and adjusted through the image editing function; finally, a process file that can be read by the knitting machine is generated through the data conversion module to automatically produce knitted products.
[0003] Among them, color separation is one of the most important image processing functions of knitting pattern CAD system. Color separation is also called color quantization and color segmentation. It uses limited colors to represent the colorful original pattern without changing the image effect. The input pattern image is a true color image. The pattern image that has not been color-separated has tens of thousands of different colors. It is necessary to simplify the image color through a color separation algorithm. However, the sources of pattern images are wide, and because scanners are inconvenient to carry and cumbersome to use, many companies directly obtain textile pattern images through mobile phones, digital cameras and other photographic devices, or download color design patterns through the Internet platform. Pattern images will have image degradation problems during the process of image imaging, network transmission, image editing, and image compression, which makes the details of the pattern images obtained by the company not clear enough and unable to perform accurate color separation.
[0004] The color boundary of the degraded flower image is very fuzzy. The clarity of the image is proportional to the resolution. High-resolution images can usually provide more detailed information and the color separation will be more accurate. Super-resolution reconstruction network is an effective method to improve the image resolution. It mainly restores the low-resolution image by learning the mapping relationship between low-resolution images and high-resolution images. However, the degradation of flower images in real scenes usually comes from a complex combination of different degradation processes. Most super-resolution reconstruction networks only assume an ideal bicubic downsampling degradation kernel, which is difficult to simulate complex degradation. The Real-ESRGAN blind super-resolution reconstruction network extends the classic "first-order" degradation model to the "high-order" degradation model in the real world, and uses the sinc filter to model the common ringing artifacts in the image. This method better simulates the unknown and complex degradation process of flower images in real scenes. In addition, the network uses the ESRGAN generator to generate high-resolution reconstructed images with rich detail information. The spectrally normalized U-Net structure discriminator generates higher-quality reconstructed images. The image details using the Real-ESRGAN blind super-resolution reconstruction network are very clear. By comparing the color types of the image before and after the sharpening process, it can be found that the color types of the degraded image far exceed the recognizable range of the human eye, and after the sharpening process, the color types of the image increase significantly, which will greatly increase the workload of the subsequent color separation algorithm.
[0005] The image after color separation needs to conform to the human eye's perception of the flower pattern image, that is, to maintain the similarity between the color separation image and the flower pattern image, and to minimize the noise points of the color separation image. Currently, the commonly used image color separation algorithms include: K-means, hierarchical clustering, spectral clustering, fuzzy c-means (FCM) clustering, neighborhood information constrained deviation sparse fuzzy c-means algorithm (DSFCM_N), etc. However, this type of algorithm only performs unsupervised classification on a large number of pixels based on color similarity, ignoring the local spatial information of the pixels, and is prone to noise points. Moreover, these algorithms all rely on manual setting of the cluster number parameters, which is prone to misjudgment. The pixels of the high-resolution image after the sharpening process are greatly improved. If the above algorithm is used for color separation, all pixels need to be repeatedly calculated and iteratively optimized, and the calculation cost is very large. The density peak clustering (DPC) algorithm can automatically calculate the number of clusters of data points. However, directly processing the image will produce a huge similarity matrix, resulting in memory overflow. The color segmentation algorithm combining the self-organizing map (SOM) neural network and DPC, the main clustering center of the pixel is identified by the SOM neural network, and then the optimal number of clusters is identified and clustered by the DPC algorithm, which greatly shortens the calculation time. However, since this algorithm only considers the color information of the pixel, there will still be the problem of noise points. The color segmentation algorithm combining SOM and efficient dense subspace clustering eliminates the mis-segmentation of edge colors through post-processing such as grayscale transformation, binarization and opening operation. However, the accuracy of this method is low and the process is complicated. The unsupervised mean shift algorithm can also be used for color segmentation of printed fabrics. This algorithm can complete the color segmentation of fabric images under different textures and lighting conditions, but since the fabric needs to be washed and ironed before color segmentation, there are certain shortcomings in industrial applications. Summary of the invention
[0006] In order to solve the technical problems in the prior art, the present invention provides a density peak clustering color separation algorithm based on a SOM neural network.
[0007] The technical solution provided by the embodiment of the present invention is as follows:
[0008] First aspect:
[0009] The embodiment of the present invention provides a density peak clustering color separation algorithm based on a SOM neural network, comprising:
[0010] S1. Use the Real-ESRGAN blind super-resolution network to sharpen the degraded color image and obtain a high-resolution color image with clear boundaries.
[0011] S2, preprocessing the high-resolution color image to convert the image from the RGB color space to a Lab color space that is uniformly perceived by the human eye;
[0012] S3, after training the SOM neural network, using the SOM neural network to perform initial clustering on the pixels of the image;
[0013] S4, performing secondary clustering on the image using a density peak clustering (DPC) algorithm;
[0014] S5, merging the noise points in the image by a method based on connected domain analysis;
[0015] S6. Use the nearest neighbor interpolation algorithm to adjust the size of the color separation image without changing the number of image colors.
[0016] The beneficial effects brought about by the technical solution provided by the embodiment of the present invention include at least:
[0017] (1) In the present invention, the Real-ESRGAN blind super-resolution reconstruction network is used as a clearing processing step for degraded images, which can enhance the detail information of the image and improve the accuracy of the color separation algorithm;
[0018] (2) In the present invention, the SOM neural network is used as the initial clustering, which effectively simplifies the color information of the high-resolution image and reduces the calculation amount of the DPC algorithm;
[0019] (3) In the present invention, the number of clusters of color nodes is automatically calculated under the premise of being consistent with human eye perception through the improved DPC algorithm;
[0020] (4) In the present invention, the problem of noise points in the color separation image is effectively solved by using a color merging algorithm based on connected domain analysis. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0022] Figure 1 A schematic diagram of a flow chart of a density peak clustering color separation algorithm based on a SOM neural network provided in an embodiment of the present invention;
[0023] Figure 2 A color comparison diagram under the same RGB difference value of a density peak clustering color separation algorithm based on a SOM neural network provided in an embodiment of the present invention;
[0024] Figure 3An initial clustering effect diagram of an image based on a density peak clustering color separation algorithm of a SOM neural network provided in an embodiment of the present invention, (a) high-resolution reconstructed image, (b) color types of the reconstructed image, (c) initial clustering effect of the SOM neural network, (d) color types of the image after initial clustering;
[0025] Figure 4 A secondary clustering decision diagram of a density peak clustering color separation algorithm based on a SOM neural network provided in an embodiment of the present invention;
[0026] Figure 5 A diagram of the effect of merging noise points based on connected domain analysis of a density peak clustering color separation algorithm based on a SOM neural network provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0027] The technical solution of the present invention is described below in conjunction with the accompanying drawings.
[0028] In the embodiments of the present invention, words such as "exemplarily" and "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "example" in the present invention should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of the word "example" is intended to present the concept in a specific way. In addition, in the embodiments of the present invention, the meaning expressed by "and / or" can be both, or it can be either of the two.
[0029] In order to make the technical problems, technical solutions and advantages to be solved by the present invention more clear, a detailed description will be given below with reference to the accompanying drawings and specific embodiments.
[0030] Reference Manual Attached Figure 1 , shows a flow chart of a density peak clustering color separation algorithm based on a SOM neural network provided in an embodiment of the present invention.
[0031] The embodiment of the present invention provides a density peak clustering color separation algorithm based on a SOM neural network. The method may include the following steps:
[0032] S1. Use the Real-ESRGAN blind super-resolution network to sharpen the degraded color image and obtain a high-resolution color image with clear boundaries.
[0033] S2, preprocessing the high-resolution color image, converting the image from the RGB color space to the Lab color space that is uniformly perceived by the human eye;
[0034] S3, after training the SOM neural network, use the SOM neural network to perform initial clustering on the pixels of the image;
[0035] S4, using the density peak clustering (DPC) algorithm to perform secondary clustering on the image;
[0036] S5, merging the noise points in the image by a method based on connected domain analysis;
[0037] S6. Use the nearest neighbor interpolation algorithm to adjust the size of the color separation image without changing the number of image colors.
[0038] S2 specifically includes: the flower image after the sharpening process belongs to the RGB color space, but the RGB color space does not match the human eye perception, and the color separation result under this color space is different from the human eye perception. Therefore, before performing image color separation, the flower image needs to be converted from the RGB color space to the Lab color space that is uniformly perceived by the human eye.
[0039] like Figure 2 As shown, the colors under the same RGB difference are compared. The color changes of each channel between color a and color b are 35, -30, -30 respectively, and the color changes of each channel between color c and color d are also 35, -30, -30 respectively. However, according to the human eye's perception of color difference, the color difference between color c and color d is more obvious, so the RGB color space does not match the human eye's perception. Convert the pattern draft image from the RGB color space to the Lab color space that the human eye perceives uniformly, and use the following formula to convert the image from the RGB color space to the XYZ space:
[0040]
[0041] Use the following formulas in turn to convert XYZ color from XYZ color space to Lab color space,
[0042]
[0043] In the above formula, the function f(x) is,
[0044]
[0045] Constants X0=0.95, Y0=1, Z0=1.089.
[0046] Since there are a large number of pixels in the high-resolution reconstructed image after the sharpening process, directly using the density peak clustering (DPC) algorithm to process the image will cause a memory overflow problem. The embodiment of the present invention uses a self-organizing map (SOM) neural network to perform initial clustering on the pixels of the high-resolution reconstructed image, simplify the image information, and reduce the calculation amount of the subsequent DPC algorithm.
[0047] SOM neural network can process various complex patterns, and the algorithm can automatically learn and adjust the cluster center. SOM neural network consists of two layers of feedforward neural network: input layer and output layer. All output neurons are connected to input nodes through weight vectors, and there is no hidden layer. Since the application object is a color image, the input of the SOM neural network is the pixel value of all pixels in the flower image. S3 specifically includes:
[0048] S31, inputting the pixel values of all pixels of the image into the SOM neural network, setting the number of neuron nodes in the input layer to 3, corresponding to the three color channels of L, a and b respectively, and each output neuron represents a potential cluster center;
[0049] S32. Too many output neurons will increase the computational complexity of the subsequent algorithm, while too few will affect the judgment of the cluster center. The number of neurons is set to 5*5, that is, the initial clustering colors are 25. The initialization setting of the full-time vector adopts the random assignment method, and the input is the value of L, a and b components, where the value of L is between 0 and 100, and the values of a and b components are between -128 and +127. The weight is assigned to the random number of the corresponding value range of each component;
[0050] S33, the training process is the process of self-organizing learning mapping of the SOM neural network. The color range of the training samples should be as wide as possible. Assuming that N is the number of image pixels, the input data of the network is expressed as,
[0051] x i (i=1,...,N)=(L i ,a i ,b i )
[0052] The weight vector connecting the input node and the output neuron is expressed as,
[0053] w j (j=1,...,M)
[0054] In the above formula, M represents the total number of connection weight vectors, that is, the product of the number of input nodes and the number of output neurons;
[0055] S34. Training is completed through the competition process between the training sample data and the SOM neural network, so that the SOM neural network learns the corresponding color clustering pattern and saves it in the form of a weight vector, and the pixels of the image are initially clustered through the color clustering pattern.
[0056] like Figure 3 As shown, the initial clustering effect of three flower images is shown. Figure 3 (a) is the high-resolution reconstructed image after sharpening. Figure 3(b) is the color type of the reconstructed image. It can be seen that the high-resolution image contains a large number of different colors. Figure 3 (c) is the initial clustering image effect through the SOM neural network, which is consistent with the reconstructed image effect, but through Figure 3 (d) It can be seen that the number of color types of the image is reduced to 25.
[0057] The competition process of the SOM neural network in S34 specifically includes:
[0058] S341, assign a random number to the weight vector and perform a random initialization on the input data x i and the weight vector w j After normalization, we get x i ' and w j ';
[0059] S342, x i 'Input to SOM neural network and calculate x i ' and w j 'The distance,
[0060] d j =||y i ,w j '||,j=1,2,3,L,M
[0061] In the above formula, x i ' and w j ' is the input data x i and the weight vector w j The value obtained after normalization;
[0062] S343, select the neuron with the smallest distance as the winning neuron,
[0063] c=mind j ,j=1,2,3,L,M
[0064] In the above formula, c represents the winning neuron;
[0065] S344, updating the neighborhood radius of the winning neuron c,
[0066]
[0067] In the above formula, ρ=||c i ,c j || 2 , c i (c j ) is the position of neuron i(j) in the output layer, σ(t) is the neighborhood function, and the value of σ decreases with the increase of learning time t;
[0068] S345, update the weight vector,
[0069] w p =w p +α(t)h(ρ,t)(xw p )
[0070] In the above formula, α(t) is the learning efficiency function. The closer the neuron is to the winning neuron, the smaller the full-time vector adjustment amplitude is.
[0071] S346, update the neighborhood function σ(t) and the learning rate α(t),
[0072]
[0073] In the above formula, λ = N / log(σ0), N is the number of iterations, and log(σ0) is the initial neighborhood;
[0074] S347: If the learning rate has not stopped and has not reached the maximum number of iterations, re-execute 342.
[0075] S4 specifically includes: in order to solve the problem that the clustering quantity parameters of the traditional color separation algorithm need to rely on manual settings, the embodiment of the present invention uses an improved density peak clustering (DPC) algorithm to perform secondary clustering on the flower pattern images.
[0076] Because the SOM neural network simplifies the color information of the flower image, the DPC algorithm will not have the problem of memory overflow. The DPC algorithm is a density-based clustering algorithm that automatically selects the local density ρ i and the relative distance δ i The larger data point is used as the cluster center. The local density refers to the distance parameter d of a data point. c The number of other data points within the circle with a radius of d is used to describe the density of the data points. c The value of is usually selected based on experience under the Euclidean distance, which is not accurate for judging the cluster center. The NBS distance is used to measure the human eye's perception of color difference. We replace the Euclidean distance between data points with the NBS distance to select an appropriate cutoff distance parameter d based on the human eye's perception of color difference. c .
[0077] S41, using NBS distance to calculate the color distance between superpixels. Before calculating the NBS value between data points, the image after initial clustering is converted from Lab color space to HVC space and then the NBS distance is calculated. The formula is as follows:
[0078]
[0079] in,
[0080]
[0081] In the above formula, A and B represent two colors, and the pixel values are (H A V A C A ) and (H B V B C B );
[0082] S42. Redefine the cutoff distance d based on human eye perception c , cutoff distance parameter d c It is an important threshold parameter for the DPC algorithm to determine whether data points belong to the same cluster. According to the corresponding relationship between NBS and human eye perception of color difference given in the table below, when the NBS distance between two colors is greater than 3.0, it is considered that the color difference between the two colors is obvious.
[0083] NBS distance 0-0.5 0.5-1.5 1.5-3.0 3.0-6.0 6.0 or above Perceived color difference Feels very small Feeling slight Feeling subtle Feel obvious Feeling strong
[0084] Therefore, the cutoff distance d is selected c is 3, and the local density ρ of color node i is calculated using the Gaussian kernel i , the formula is as follows,
[0085]
[0086] In the above formula, N represents the number of output neurons of the SOM neural network, that is, the initial cluster center, 1≤i≤N, 1≤j≤N, S j is the number of pixels corresponding to the jth output neuron, d ij Represents the color node x i and x j The NBS distance between i The larger the value of is, the more likely it is to be the cluster center. i The smaller the value of is, the more likely it is noise or an extreme value of the data set. i Refers to the color node i and the local density ρ i The minimum NBS distance between the larger color nodes. After calculating the local density of all color nodes, all color nodes are sorted in descending order according to the density, and the relative distance δ is calculated. i ,
[0087]
[0088] In the above formula, d ij Represents the color node x i and x j The NBS distance between them;
[0089] S43, automatically calculating the cluster center through the decision diagram, and assigning all pixels to the nearest cluster center to obtain a color separation image with the best color type. Since the cluster center has a large local density ρ i and the relative distance δ i , so using ρ i and δ i The product of γ i Adaptively determine cluster centers,
[0090] γ i =ρ i *δ i
[0091] In calculating the gamma of the color node i After the value of γ i Normalization is performed to eliminate ρ i and δ i The impact of different dimensions,
[0092]
[0093] All color nodes are divided into i In descending order, the cluster center has a larger γ i , rather than the cluster center γ i is small, so the γ between the cluster center and the non-cluster center i has a large difference due to γ i Satisfies the power distribution law, log(γ i ) function graph approximates a linear function, by finding the log(γ i ), determine the location of the cluster center, and realize the automatic calculation of the number of clusters. Figure 3 The three initial clustering images in (c) are calculated to generate a decision diagram as shown in Figure 4 (ac) is shown. The horizontal axis is the color node, corresponding to the 25 cluster centers of the initial cluster image. The vertical axis is the γ of the color node. i The red data points are the calculated cluster centers. It can be seen that the number of clusters of the secondary clustering is 5, 4, and 5 respectively.
[0094] After the image is clustered twice, the color types of the image are reduced to a limited number of colors. However, the pixel colors at the color junctions in the flower pattern image are complex and diverse. In order to solve the problem of noise points, a noise point merging method based on connected domain analysis is proposed to identify these noise point pixels and eliminate them. S5 specifically includes:
[0095] S51, traversing the pixels of the color separation image, if there is a color different from the central pixel in the 8-connected domain, the central pixel is a suspicious noise point, and the suspicious noise point may be a noise point or a pixel at the edge of the color area;
[0096] S52, determine the pixel value with the most color in the 8-neighborhood of the suspicious pixel, and assign it to the suspicious noise point pixel. If the suspicious noise point pixel is a noise point, it will be merged with the main color with the most surrounding colors. If the suspicious noise point is not a noise point, the color will not change.
[0097] The noise point merging algorithm based on connected domain analysis combines the color information and spatial information of pixels, which can effectively remove the noise points in the color separation image. The effect before and after the noise point merging is as follows: Figure 5 shown. Figure 5 (a) is the image after color separation. There are a large number of independent pixels on the edge, which seriously affects the product quality. Figure 5 (b) is the image after the noise points are merged. There are no independent pixels and the visual effect is good.
[0098] The beneficial effects brought about by the technical solution provided by the embodiment of the present invention include at least:
[0099] (1) In the present invention, the Real-ESRGAN blind super-resolution reconstruction network is used as a clearing processing step for degraded images, which can enhance the detail information of the image and improve the accuracy of the color separation algorithm;
[0100] (2) In the present invention, the SOM neural network is used as the initial clustering, which effectively simplifies the color information of the high-resolution image and reduces the calculation amount of the DPC algorithm;
[0101] (3) In the present invention, the number of clusters of color nodes is automatically calculated under the premise of being consistent with human eye perception through the improved DPC algorithm;
[0102] (4) In the present invention, the problem of noise points in the color separation image is effectively solved by using a color merging algorithm based on connected domain analysis.
[0103] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
[0104] There are a few points to note:
[0105] (1) The drawings of the embodiments of the present invention only relate to the structures related to the embodiments of the present invention, and other structures may refer to the general design.
[0106] (2) For the sake of clarity, in the drawings used to describe the embodiments of the present invention, the thickness of the layers or regions is exaggerated or reduced, that is, these drawings are not drawn according to the actual scale. It is understood that when an element such as a layer, film, region or substrate is referred to as being "on" or "under" another element, the element may be "directly" "on" or "under" the other element or there may be intermediate elements.
[0107] (3) In the absence of conflict, the embodiments of the present invention and the features therein may be combined with each other to obtain new embodiments.
[0108] The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. The protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A density peak clustering color separation algorithm based on SOM neural network, characterized in that: include: S1. Use the Real-ESRGAN blind super-resolution network to sharpen the degraded color image and obtain a high-resolution color image with clear boundaries. S2, preprocessing the high-resolution color image to convert the image from the RGB color space to a Lab color space that is uniformly perceived by the human eye; S3, after training the SOM neural network, using the SOM neural network to perform initial clustering on the pixels of the image; S4, performing secondary clustering on the image using a density peak clustering (DPC) algorithm; S5, merging the noise points in the image by a method based on connected domain analysis; S6. Use the nearest neighbor interpolation algorithm to adjust the size of the color separation image without changing the number of image colors.
2. The density peak clustering color separation algorithm based on SOM neural network according to claim 1 is characterized in that: The S2 specifically includes: Use the following formula to convert the image from RGB color space to XYZ space, Use the following formulas in turn to convert XYZ color from XYZ color space to Lab color space, In the above formula, the function f(x) is, Constants X0=0.95, Y0=1, Z0=1.
089.
3. The density peak clustering color separation algorithm based on SOM neural network according to claim 1 is characterized in that: The S3 specifically includes: S31, inputting the pixel values of all pixels of the image into the SOM neural network, setting the number of neuron nodes in the input layer to 3, corresponding to the three color channels of L, a and b respectively, and each output neuron represents a potential cluster center; S32, setting the number of neurons to 5*5, that is, the initial clustering colors are 25, and the full-time vector is initialized by random assignment, with the input being the values of L, a and b components, where the value of L is between 0 and 100, the values of a and b components are between -128 and +127, and the weights are assigned to random numbers in the value range corresponding to each component; S33, assuming that N is the number of pixels in the image, the input data of the network is expressed as, x i (i=1,...,N)=(L i ,a i ,b i ) The weight vector connecting the input node and the output neuron is expressed as, w j (j=1,...,M) In the above formula, M represents the total number of connection weight vectors, that is, the product of the number of input nodes and the number of output neurons; S34, completing the training through the competition process between the training sample data and the SOM neural network, so that the SOM neural network learns the corresponding color clustering pattern and saves it in the form of a weight vector, and initially clustering the pixels of the image through the color clustering pattern.
4. The density peak clustering color separation algorithm based on SOM neural network according to claim 3 is characterized in that: The competition process of the SOM neural network in S34 specifically includes: S341, assign a random number to the weight vector and perform a random initialization on the input data x i and the weight vector w j After normalization, we get x i ′ and w j ′; S342, x i ′ is input into the SOM neural network to calculate x i ′ and w j ', d j =||y i ,w j ′||,j=1,2,3,L,M In the above formula, x i ′ and w j ′ is the input data x i and the weight vector w j The value obtained after normalization; S343, select the neuron with the smallest distance as the winning neuron, c=min d j , j 1, 2, 3, L, M In the above formula, c represents the winning neuron; S344, updating the neighborhood radius of the winning neuron c, In the above formula, ρ=||c i , c j ‖ 2 , c i (c j ) is the position of neuron i(j) in the output layer, σ(t) is the neighborhood function, and the value of σ decreases with the increase of learning time t; S345, update the weight vector, w p =w p +α(t)h(ρ,t)(x-w p ) In the above formula, α(t) is the learning efficiency function. The closer the neuron is to the winning neuron, the smaller the full-time vector adjustment amplitude is. S346, update the neighborhood function σ(t) and the learning rate α(t), In the above formula, λ = N / log(σ0), N is the number of iterations, and log(σ0) is the initial neighborhood; S347: If the learning rate has not stopped and has not reached the maximum number of iterations, re-execute step 342.
5. The density peak clustering color separation algorithm based on SOM neural network according to claim 1 is characterized in that: The S4 specifically includes: S41, using NBS distance to calculate the color distance between superpixels, converting the image after initial clustering from Lab color space to HVC space and then calculating the NBS distance, the formula is as follows: in, In the above formula, A and B represent two colors, and the pixel values are (H A V A C A ) and (H B V B C B ); S42. Redefine the cutoff distance d based on human eye perception c , cutoff distance parameter d c It is an important threshold parameter for the DPC algorithm to determine whether data points belong to the same cluster. According to the correspondence between NBS and human eye perception of color difference, when the NBS distance between two colors is greater than 3.0, it is considered that the color difference between the two colors is obvious, so the cutoff distance d is selected. c is 3, and the local density ρ of color node i is calculated using the Gaussian kernel i , the formula is as follows, In the above formula, N represents the number of output neurons of the SOM neural network, that is, the initial cluster center, 1≤i≤N, 1≤j≤N, S j is the number of pixels corresponding to the jth output neuron, d ij Represents the color node x i and x j The NBS distance between i The larger the value of is, the more likely it is to be the cluster center. i The smaller the value of is, the more likely it is noise or an extreme value of the data set. i Refers to the color node i and the local density ρ i The minimum NBS distance between the larger color nodes. After calculating the local density of all color nodes, all color nodes are sorted in descending order according to the density, and the relative distance δ is calculated. i , In the above formula, d ij Represents the color node x i and x j The NBS distance between them; S43, automatically calculating the cluster center through the decision diagram, and assigning all pixels to the nearest cluster center to obtain a color separation image with the best color type. Since the cluster center has a large local density ρ i and the relative distance δ i , so using ρ i and δ i The product of γ i Adaptively determine cluster centers, c i =ρ i *d i When calculating the gamma of the color node i After the value of γ i Normalization is performed to eliminate ρ i and δ i The impact of different dimensions, All color nodes are divided into i In descending order, the cluster center has a larger γ i , rather than the cluster center γ i Small, by finding the log(γ i ), determine the location of the cluster center, and realize automatic calculation of the number of clusters.
6. The density peak clustering color separation algorithm based on SOM neural network according to claim 1 is characterized in that: The S5 specifically includes: S51, traversing the pixels of the color separation image, if there is a color different from the central pixel in the 8-connected domain, the central pixel is a suspicious noise point, and the suspicious noise point may be a noise point or a pixel at the edge of the color area; S52, determining the pixel value with the most color in the 8-neighborhood of the suspicious pixel point, and assigning it to the suspicious noise point pixel; if the suspicious noise point pixel is a noise point, it is merged with the main color with the most surrounding colors; if the suspicious noise point pixel is not a noise point, the color will not change.
Citation Information
Patent Citations
Region segmentation method for colorful textile texture images
CN102629386A
