An Image Segmentation Optimization Method for Traditional Pattern Image Feature Extraction

By improving the Snow Goose optimization algorithm, the K-means algorithm is optimized, combined with Fourier transform and PID search algorithm, and the segmentation threshold is adjusted, which solves the problem of difficulty in determining the number of clusters and local optimality in traditional pattern image segmentation, and improves segmentation accuracy and calculation efficiency.

CN118379318BActive Publication Date: 2024-09-17HAINAN UNIV
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202410351438.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-26
Publication Date
2024-09-17
Estimated Expiration
2044-03-26

AI Technical Summary

Technical Problem

In traditional pattern image segmentation technology, the segmentation results of the K-means algorithm are easily affected by the selection of the initial cluster center, making it difficult to determine the number of clusters, resulting in local optimal solutions and reduced convergence speed, especially in complex images.

Method used

The improved Snow Goose Optimization Algorithm (PGOOSE) optimizes the K-means algorithm, separates feature and non-feature areas through two-dimensional Fourier transform, combines the PID search algorithm and control parameter alpha, and adjusts the segmentation threshold to improve segmentation accuracy.

Benefits of technology

It improves the accuracy of traditional pattern image segmentation, reduces background interference, ensures the accuracy of feature extraction, reduces the amount of calculation, speeds up the generation, and solves the problem of feature extraction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118379318B
    Figure CN118379318B
Patent Text Reader

Abstract

The invention provides an image segmentation optimization method for extracting features of traditional pattern images, which belongs to the field of image segmentation and comprises the following steps: obtaining RGB color space pixels of traditional pattern images, converting the images from a spatial domain to a frequency domain by using a two-dimensional Fourier transform, obtaining a spectrum in a complex form, analyzing the spectrum, and separating the spectrum of a feature area and the spectrum of a non-feature area in the image; converting the image from the frequency domain back to the spatial domain by inverse Fourier transform processing; setting the pixel value range of the spatial domain image between 0 and 255, and converting the image into a grayscale image; improving a snow goose optimization algorithm, using an improved wild goose optimization algorithm to adjust the segmentation threshold of a K-means algorithm, obtaining an optimal threshold K for segmenting the traditional pattern images by the K-means algorithm, segmenting the grayscale image by using the optimal threshold, and improving the accuracy of extracting features of the traditional pattern images by optimizing the image segmentation technology.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image segmentation, and in particular to an image segmentation optimization method for extracting features of traditional pattern images. Background Art

[0002] Automatic generation of traditional patterns usually involves using computer graphics and artificial intelligence techniques to simulate the style and characteristics of traditional patterns. This technology can be used to design and create patterns with traditional cultural characteristics.

[0003] In the process of automatic generation of traditional patterns, feature extraction of patterns is very critical. By extracting the key features of patterns, the amount of calculation can be reduced, the generation speed can be accelerated, and the automatic generation process can be made more efficient. It helps to capture the core style and elements of the pattern and ensure that the generated pattern maintains the original cultural characteristics and aesthetic style. At the same time, by analyzing and extracting the features of high-quality patterns, the generation process can be guided to improve the quality and aesthetics of the generated patterns.

[0004] Through image segmentation technology, traditional patterns can be separated from the background, thereby reducing background interference and ensuring that the extracted features more accurately reflect the characteristics of the pattern itself. Traditional image segmentation technologies, such as the K-means algorithm, rely heavily on the selection of initial cluster centers for their segmentation results. Inappropriate initial centers may lead to convergence to a local optimal solution, affecting the segmentation effect. K-means requires pre-specifying the number of clusters (K value), which is difficult to determine in practical applications, especially for complex images.

[0005] The Snow Goose Optimization Algorithm (GOOSE), a metaheuristic algorithm based on the resting and foraging behavior of geese, is well suited for application in image processing. However, existing public experiments have shown that the Snow Goose Optimization Algorithm (GOOSE) is overly complex in the local development phase, which reduces the algorithm's convergence speed. Furthermore, in the global search phase, it is prone to falling into local optimality in the later stages of iteration. Summary of the Invention

[0006] In response to the above technical problems, this technical solution provides an image segmentation optimization method for traditional pattern image feature extraction. By improving the Snow Goose Optimization Algorithm (GOOSE), the optimization performance of the Snow Goose Optimization Algorithm is improved. The improved Snow Goose Optimization Algorithm (PGOOSE) is used to optimize the K-means algorithm for image segmentation, thereby improving the segmentation accuracy of the K-means algorithm for traditional pattern images, thereby improving the effect of traditional pattern image feature extraction.

[0007] To achieve the above object, the technical solution of the present invention is:

[0008] An image segmentation optimization method for extracting features of traditional pattern images is proposed. The K-means algorithm is optimized by improving the snow goose optimization algorithm to segment traditional pattern images and extract the features of traditional patterns. The specific steps are as follows.

[0009] Step 1: Obtain RGB color space pixels of the traditional pattern image, use two-dimensional Fourier transform to convert the image from the spatial domain to the frequency domain, obtain a complex spectrum, analyze the spectrum, and separate the spectrum of the characteristic area and the spectrum of the non-characteristic area in the image.

[0010] Step 2: Perform inverse Fourier transform on the feature area and non-feature area of ​​the image to convert the image from the frequency domain back to the spatial domain.

[0011] Step 3: Set the pixel value range of the spatial domain image after the inverse Fourier transform to between 0 and 255, and convert it into a grayscale image.

[0012] Step 4: Improve the position update mathematical model of the local development phase of the snow goose optimization algorithm and the search control parameter alpha in the global exploration phase.

[0013] Step 5: Use the improved snow goose optimization algorithm to adjust the segmentation threshold of the K-means algorithm to obtain the optimal threshold K for segmenting the traditional pattern image using the K-means algorithm. Use the optimal threshold to segment the grayscale image to achieve feature extraction of the traditional pattern image.

[0014] Furthermore, in step 1, the image is converted from the spatial domain to the frequency domain using a two-dimensional Fourier transform, and the mathematical model is:

[0015]

[0016] Where P is one of the three color channels of red, green and blue of the traditional pattern image (R, G, B), u and v are frequency coordinates, x and y are spatial coordinates, and F P (u, v) is the spectrum representation of the traditional pattern image, f P (x, y) is the pixel intensity of the traditional pattern image at the coordinate (x, y), and M and N are the width and height of the traditional pattern image, respectively.

[0017] Furthermore, by analyzing the spectrum F of the traditional pattern image P (u, v) can identify the characteristic areas and non-characteristic areas in the image. The characteristic area is the main part of the traditional pattern image and is an important basis for the automatic generation of traditional pattern images. Its spectrum contains high-frequency components, while the spectrum of the non-characteristic area mainly contains low-frequency components. By separating these spectra, the extraction and analysis of the characteristics of the traditional pattern image can be achieved.

[0018] Furthermore, in step 2, the image feature area and the non-feature area are subjected to inverse Fourier transform processing, and the mathematical model is:

[0019]

[0020] In the formula, the meaning of each parameter is consistent with formula (1).

[0021] Furthermore, in step 4, the improved snow goose optimization algorithm is used, and the specific steps of improving the snow goose optimization algorithm are:

[0022] S41. Integrate the local development position update strategy of the snow goose optimization algorithm with the update mechanism of the PID search algorithm to reduce the optimization complexity of the snow goose optimization algorithm and improve the optimization convergence speed and accuracy of the local development stage of the snow goose optimization algorithm.

[0023] X i,j (t+1)=X i,j (t)+β·Δu(t)+(1-β)·o(t) (2);

[0024] Where, X i,j (t+1) is the j-th dimension position of the i-th snow goose individual at the t+1-th iteration, i = 1, 2, ..., N GP , j = 1, 2, ..., D, Δu(t) is the PID output value at the current iteration t, that is, the convergence step size of the improved snow goose optimization algorithm, and o(t) is the limiting step size parameter of the current iteration; S42, the control parameter alpha that determines the searchability of the snow goose optimization algorithm in the global exploration phase of the improved snow goose optimization algorithm, and the improved control parameter alpha is used to generate a new mathematical model of the global exploration position update strategy of the snow goose optimization algorithm; the improved mathematical model of the control parameter alpha is:

[0025]

[0026] Where t is the current iteration number, T max is the maximum number of iterations, N GP is the maximum size of the population, rand is a random number in [0, 1], J min is the minimum value of the objective function in the current iteration, J i is the objective function value of the individual position of the i-th snow goose in the current iteration.

[0027] Furthermore, in step 5, the segmentation threshold of the K-means algorithm is adjusted using the improved snow goose optimization algorithm. During the adjustment process, the compactness and separation of the clusters are combined to design the objective function J(X i ), the mathematical model formula of the objective function is:

[0028]

[0029] Where w is a random parameter between 0 and 1, which is used to balance the importance of intra-cluster compactness and inter-cluster separation. is the compactness within the cluster, that is, the sum of the squares of the distances between the data points in each cluster and the cluster center; is the inter-cluster separability, that is, the sum of the squares of the distances between the centers of different clusters.

[0030] Furthermore, when using the improved snow goose optimization algorithm (PGOOSE) to optimize K-means clustering, the goal is to minimize the objective function, and the smaller the objective function value, the better; compactness refers to the sum of the distances between the samples within the cluster and its centroid, while separability refers to the distance between the centroids of different clusters. The clustering of the optimization target should have high separability and low compactness, which means that points in the same cluster should be as close as possible, while points in different clusters should be as far away as possible.

[0031] Furthermore, the PID search algorithm has a simple optimization process, low complexity, and fast global optimization speed. During local convergence, the convergence step size Δu(t) of the PID search algorithm can adaptively change the convergence range according to the number of iterations and the gap between the current position and the target position, thereby avoiding the optimization process from falling into the local optimum as much as possible. At the same time, the PID search algorithm has a parameter that limits the step size to avoid the convergence step size of the optimization process being too large, resulting in missing the optimal solution. The local development stage of the snow goose optimization algorithm is highly complex and the local convergence speed is slow. Integrating the PID search algorithm into the local development stage of the snow goose optimization algorithm can improve the local convergence speed and accuracy of the snow goose optimization algorithm.

[0032] Furthermore, the control parameter alpha of the Snow Goose Optimization Algorithm's search performance controls the performance of the Snow Goose Optimization Algorithm in the global exploration stage. The improved control parameter alpha has a larger value in the early stage of iteration, which facilitates the Snow Goose Optimization Algorithm to search over a large range and provides more solutions for the Snow Goose Optimization Algorithm to find the best solution. It has a smaller value in the later stage of iteration, which facilitates the Snow Goose Optimization Algorithm to narrow the search and improve the local convergence of the Snow Goose Optimization Algorithm.

[0033] Furthermore, in step five, the segmentation threshold of the K-means algorithm is adjusted using the improved snow goose optimization algorithm to obtain the optimal threshold K for segmenting the traditional pattern image using the K-means algorithm. The specific steps are as follows:

[0034] Step 1: Initialize the parameters common to the PID search algorithm and the improved snow goose optimization algorithm, including: the maximum population size N GP , maximum number of iterations T max , problem dimension D and optimization upper bound ub and lower bound lb;

[0035] Step 2: Initialize the initial position of the snow goose population of the improved snow goose optimization algorithm using the good point set. The initial position of the snow goose population is mapped to the threshold K of the K-means algorithm. The position of each individual snow goose corresponds to a solution of the threshold K.

[0036] Step 3, constructing a mathematical model for the position update of the snow goose population, updating the position of each individual snow goose according to the mathematical model, and decoding the updated position of the individual snow goose into a solution of the segmentation threshold K of the K-means algorithm;

[0037] Step 4, using the objective function J to calculate the fitness values ​​of the positions of the updated snow goose individuals, sorting the fitness values ​​in ascending order, and retaining the position of the snow goose individual with the largest fitness value;

[0038] Step 5. Calculate the maximum fitness value at the current iteration number t The maximum fitness value at the last iteration t-1 Rate of change If the change rate is less than 0.2, it means that the segmentation threshold K of the current iteration K-means algorithm is close to the optimal value. Continue to iterate t = t + 2 times, and output the segmentation threshold K solution of the K-means algorithm corresponding to the position of the snow goose individual after the iteration. Otherwise, return to Step 2.

[0039] Furthermore, the optimal threshold is used to segment the traditional pattern grayscale image to realize the feature extraction of the traditional pattern image. The specific steps are: according to the improved snow goose optimization algorithm, the segmentation threshold of the K-means algorithm is adjusted to obtain the optimal K value, and K cluster centers are initialized. The cluster centers are randomly selected pixels; the Euclidean distance is used to calculate the distance between the pixel and the cluster center, and then each pixel is assigned to the nearest cluster center to form K clusters; according to the result of the current clustering, the center of each cluster is updated to the mean of all pixels in the cluster, and the execution is repeated until the predetermined number of iterations is reached, the pixels in each cluster are marked with the same color, and the clustering results are converted into image segmentation results. In the image segmentation results, the traditional pattern image is segmented into areas with similar features.

[0040] Furthermore, in Step 3, the step of constructing a position update mathematical model for the snow goose population and updating the individual position of each snow goose according to the position update mathematical model includes:

[0041] Step 31, the local development phase is the process of the improved snow goose optimization algorithm converging to the target value, simulating the convergence behavior of the PID search algorithm. The convergence step length Δu(t) of the improved snow goose optimization algorithm is modeled according to formula (4):

[0042]

[0043] Where Δu(t) is the PID output value at the current iteration t, which is the convergence step of the improved snow goose optimization algorithm; Kp, Ki, and Kd are the adjustment coefficients of proportional, integral, and differential, respectively, which are set to 1, 0.5, and 1.2; r1, r2, and r3 are random numbers in [0, 1]; e n (t) is the difference between the individual position of the snow goose at the current iteration and the optimal position, e n-1 (t) is the total deviation of the previous iteration when the number of iterations is t, e n-2 (t) is the overall deviation of the first two iterations;

[0044] Step 32: In order to avoid the improved snow goose optimization algorithm from having too large a convergence step, which may lead to missing the optimal solution, a mathematical model of the parameter limiting the step length is established according to formula (5):

[0045]

[0046] Where o(t) is the limiting step size parameter of the current iteration, r4 is a random number in [0, 1], L is the Levy flight function, and λ is a calculated adjustment coefficient. The mathematical model is: λ=[ln(T max -t+2) / ln(T max )] 2 ;

[0047] Step 33, according to Step 31 and Step 32, establish an improved snow goose optimization algorithm local development position update strategy according to formula (2);

[0048] X i,j (t+1)=X i,j (t)+β·Δu(t)+(1-β)·o(t) (2);

[0049] Where, X i,j (t+1) is the j-th dimension position of the i-th snow goose individual at the t+1-th iteration, i = 1, 2, ..., N GP , j = 1, 2, ..., D,

[0050] Step 34, use randn(1, D) to randomly explore other snow goose individuals in the search space, use the minimum time variable Min_Time and the improved control parameter alpha to improve the searchability of the snow goose optimization algorithm, and establish the improved snow goose optimization algorithm global exploration position update strategy according to formula (6);

[0051] X i,j(t+1)=randn(1,D)×(Min_Time×alpha)+X best (6);

[0052] Where randn(1, D) is a random value in the problem dimension D, X best is the current global optimal snow goose position.

[0053] Furthermore, the Sobol sequence is used to initialize the good point set. The specific steps are as follows:

[0054] Step 21: Determine the dimension and number of the best point set based on the problem dimension D and the maximum population size N.

[0055] Step 22, using the Sobol sequence method to generate a uniformly distributed point set, which is used as the initial solution of the improved snow goose optimization algorithm;

[0056] Step 23: Map the generated good point set to the search space of the K-means algorithm optimized by the improved snow goose optimization algorithm.

[0057] The beneficial effects of the present invention are: an improved snow goose optimization algorithm (PGOOSE) is proposed to optimize the K-means algorithm, improve the accuracy of traditional pattern image segmentation, combine two-dimensional Fourier transform and grayscale processing to extract the features of traditional pattern images, and improve the effect of feature extraction of traditional pattern images by adjusting the segmentation threshold of the K-means algorithm; through the improved snow goose optimization algorithm, the problems of the snow goose optimization algorithm being too complex in the local development stage and easily falling into local optimality in the global search stage are solved, the accuracy of the K-means algorithm in traditional pattern image segmentation is improved, background interference is reduced, and it is ensured that the extracted features more accurately reflect the characteristics of the pattern itself, which solves the problem of feature extraction in the process of automatic generation of traditional patterns, reduces the amount of calculation, and speeds up the generation speed. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the specific embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0059] Figure 1 Diagram of the steps for traditional pattern image feature extraction.

[0060] Figure 2 Diagram of the steps for adjusting the segmentation threshold K of the K-means algorithm using the improved Snow Goose Optimization algorithm

[0061] Figure 3 This is a fitness comparison chart of the K-means algorithm optimized by the Snow Goose Optimization Algorithm before and after improvement.

[0062] Figure 4 The pseudo-color image of the traditional pattern image segmentation is obtained by optimizing the K-means algorithm before the improvement of the snow goose optimization algorithm.

[0063] Figure 5 Pseudo-color image of the traditional pattern image segmentation using the K-means algorithm optimized by the improved snow goose optimization algorithm.

[0064] Figure 6 This is the effect image after the traditional pattern image is segmented using the improved Snow Goose Optimization Algorithm after optimizing the K-means algorithm.

[0065] Figure 7 The effect image after using the improved snow goose optimization algorithm to optimize the K-means algorithm segmentation of the traditional pattern image. DETAILED DESCRIPTION

[0066] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of them. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.

[0067] See also Figure 1-Figure 7 , the present invention provides a technical solution:

[0068] An image segmentation optimization method for traditional pattern image feature extraction, according to Figure 1 ,Through improving the snow goose optimization algorithm to optimize the K-means algorithm for ,segmentation of traditional pattern images, the features of ,traditional patterns are extracted. The specific steps are as follows.

[0069] Step 1: Obtain RGB color space pixels of the traditional pattern image, use two-dimensional Fourier transform to convert the image from the spatial domain to the frequency domain, obtain a complex spectrum, analyze the spectrum, and separate the spectrum of the characteristic area and the spectrum of the non-characteristic area in the image.

[0070] Step 2: Perform inverse Fourier transform on the feature area and non-feature area of ​​the image to convert the image from the frequency domain back to the spatial domain.

[0071] Step 3: Set the pixel value range of the spatial domain image after the inverse Fourier transform to between 0 and 255, and convert it into a grayscale image.

[0072] Step 4: Improve the position update mathematical model of the local development phase of the snow goose optimization algorithm and the search control parameter alpha in the global exploration phase.

[0073] Step 5: Use the improved snow goose optimization algorithm to adjust the segmentation threshold of the K-means algorithm to obtain the optimal threshold K for segmenting the traditional pattern image using the K-means algorithm. Use the optimal threshold to segment the grayscale image to achieve feature extraction of the traditional pattern image.

[0074] Furthermore, in step 1, the image is converted from the spatial domain to the frequency domain using a two-dimensional Fourier transform, and the mathematical model is:

[0075]

[0076] Where P is one of the three color channels of red, green and blue of the traditional pattern image (R, G, B), u and v are frequency coordinates, x and y are spatial coordinates, and F P (u, v) is the spectrum representation of the traditional pattern image, f P (x, y) is the pixel intensity of the traditional pattern image at the coordinate (x, y), and M and N are the width and height of the traditional pattern image, respectively.

[0077] Furthermore, by analyzing the spectrum F of the traditional pattern image P (u, v) can identify the characteristic areas and non-characteristic areas in the image. The characteristic area is the main part of the traditional pattern image and is an important basis for the automatic generation of traditional pattern images. Its spectrum contains high-frequency components, while the spectrum of the non-characteristic area mainly contains low-frequency components. By separating these spectra, the extraction and analysis of the characteristics of the traditional pattern image can be achieved.

[0078] Furthermore, in step 2, the image feature area and the non-feature area are subjected to inverse Fourier transform processing, and the mathematical model is:

[0079]

[0080] In the formula, the meaning of each parameter is consistent with formula (1).

[0081] Furthermore, in step 4, the improved snow goose optimization algorithm is used, and the specific steps of improving the snow goose optimization algorithm are:

[0082] S41. Integrate the local development position update strategy of the snow goose optimization algorithm with the update mechanism of the PID search algorithm to reduce the optimization complexity of the snow goose optimization algorithm and improve the optimization convergence speed and accuracy of the local development stage of the snow goose optimization algorithm.

[0083] X i,j (t+1)=X i,j(t)+β·Δu(t)+(1-β)·o(t) (2);

[0084] Where, X i,j (t+1) is the j-th dimension position of the i-th snow goose individual at the t+1-th iteration, i = 1, 2, ..., N GP , j = 1, 2, ..., D, Δu(t) is the PID output value at the current iteration t, that is, the convergence step size of the improved snow goose optimization algorithm, and o(t) is the limiting step size parameter of the current iteration; S42, the control parameter alpha that determines the searchability of the snow goose optimization algorithm in the global exploration phase of the improved snow goose optimization algorithm, and the improved control parameter alpha is used to generate a new mathematical model of the global exploration position update strategy of the snow goose optimization algorithm; the improved mathematical model of the control parameter alpha is:

[0085]

[0086] Where t is the current iteration number, T max is the maximum number of iterations, N GP is the maximum size of the population, rand is a random number in [0, 1], J min is the minimum value of the objective function in the current iteration, J i is the objective function value of the individual position of the i-th snow goose in the current iteration.

[0087] Furthermore, in step 5, the segmentation threshold of the K-means algorithm is adjusted using the improved snow goose optimization algorithm. During the adjustment process, the compactness and separation of the clusters are combined to design the objective function J(X i ), the mathematical model formula of the objective function is:

[0088]

[0089] Where w is a random parameter between 0 and 1, which is used to balance the importance of intra-cluster compactness and inter-cluster separation. is the compactness within the cluster, that is, the sum of the squares of the distances between the data points in each cluster and the cluster center; is the inter-cluster separability, that is, the sum of the squares of the distances between the centers of different clusters.

[0090] Furthermore, when using the improved snow goose optimization algorithm (AGOOSE) to optimize K-means clustering, the goal is to minimize the objective function, and the smaller the objective function value, the better; compactness refers to the sum of the distances between the samples within the cluster and its centroid, while separability refers to the distance between the centroids of different clusters. The clustering of the optimization target should have high separability and low compactness, which means that points in the same cluster should be as close as possible, while points in different clusters should be as far away as possible.

[0091] Furthermore, the PID search algorithm has a simple optimization process, low complexity, and fast global optimization speed. During local convergence, the convergence step size Δu(t) of the PID search algorithm can adaptively change the convergence range according to the number of iterations and the gap between the current position and the target position, thereby avoiding the optimization process from falling into the local optimum as much as possible. At the same time, the PID search algorithm has a parameter that limits the step size to avoid the convergence step size of the optimization process being too large, resulting in missing the optimal solution. The local development stage of the snow goose optimization algorithm is highly complex and the local convergence speed is slow. Integrating the PID search algorithm into the local development stage of the snow goose optimization algorithm can improve the local convergence speed and accuracy of the snow goose optimization algorithm.

[0092] Furthermore, the control parameter alpha of the Snow Goose Optimization Algorithm's search performance controls the performance of the Snow Goose Optimization Algorithm in the global exploration stage. The improved control parameter alpha has a larger value in the early stage of iteration, which facilitates the Snow Goose Optimization Algorithm to search over a large range and provides more solutions for the Snow Goose Optimization Algorithm to find the best solution. It has a smaller value in the later stage of iteration, which facilitates the Snow Goose Optimization Algorithm to narrow the search and improve the local convergence of the Snow Goose Optimization Algorithm.

[0093] Furthermore, in step 5, the segmentation threshold of the K-means algorithm is adjusted using the improved snow goose optimization algorithm to obtain the optimal threshold K for segmenting the traditional pattern image using the K-means algorithm, as shown in FIG. Figure 2 As shown, the specific steps are: Step 1, initialize the parameters common to the PID search algorithm and the improved snow goose optimization algorithm, including: the maximum population size N GP , maximum number of iterations T max , problem dimension D and optimization upper bound ub and lower bound lb;

[0094] Step 2: Initialize the initial position of the snow goose population of the improved snow goose optimization algorithm using the good point set. The initial position of the snow goose population is mapped to the threshold K of the K-means algorithm. The position of each individual snow goose corresponds to a solution of the threshold K.

[0095] Step 3, constructing a mathematical model for the position update of the snow goose population, updating the position of each individual snow goose according to the mathematical model, and decoding the updated position of the individual snow goose into a solution of the segmentation threshold K of the K-means algorithm;

[0096] Step 4, using the objective function J to calculate the fitness values ​​of the positions of the updated snow goose individuals, sorting the fitness values ​​in ascending order, and retaining the position of the snow goose individual with the largest fitness value;

[0097] Step 5. Calculate the maximum fitness value at the current iteration number t The maximum fitness value at the last iteration t-1 Rate of change If the change rate is less than 0.2, it means that the segmentation threshold K of the current iteration K-means algorithm is close to the optimal value. Continue to iterate t = t + 2 times, and output the segmentation threshold K solution of the K-means algorithm corresponding to the position of the snow goose individual after the iteration. Otherwise, return to Step 2.

[0098] Furthermore, the optimal threshold is used to segment the traditional pattern grayscale image to realize the feature extraction of the traditional pattern image. The specific steps are: according to the improved snow goose optimization algorithm, the segmentation threshold of the K-means algorithm is adjusted to obtain the optimal K value, and K cluster centers are initialized. The cluster centers are randomly selected pixels; the Euclidean distance is used to calculate the distance between the pixel and the cluster center, and then each pixel is assigned to the nearest cluster center to form K clusters; according to the result of the current clustering, the center of each cluster is updated to the mean of all pixels in the cluster, and the execution is repeated until the predetermined number of iterations is reached, the pixels in each cluster are marked with the same color, and the clustering results are converted into image segmentation results. In the image segmentation results, the traditional pattern image is segmented into areas with similar features.

[0099] Furthermore, in Step 3, the step of constructing a position update mathematical model for the snow goose population and updating the individual position of each snow goose according to the position update mathematical model includes:

[0100] Step 31, the local development phase is the process of the improved snow goose optimization algorithm converging to the target value, simulating the convergence behavior of the PID search algorithm. The convergence step length Δu(t) of the improved snow goose optimization algorithm is modeled according to formula (4):

[0101]

[0102] Where Δu(t) is the PID output value at the current iteration t, which is the convergence step of the improved snow goose optimization algorithm; Kp, Ki, and Kd are the adjustment coefficients of proportional, integral, and differential, respectively, which are set to 1, 0.5, and 1.2; r1, r2, and r3 are random numbers in [0, 1]; e n (t) is the difference between the individual position of the snow goose at the current iteration and the optimal position, e n-1 (t) is the total deviation of the previous iteration when the number of iterations is t, e n-2 (t) is the overall deviation of the first two iterations;

[0103] Step 32: In order to avoid the improved snow goose optimization algorithm from having too large a convergence step, which may lead to missing the optimal solution, a mathematical model of the parameter limiting the step length is established according to formula (5):

[0104]

[0105] Where o(t) is the limiting step size parameter of the current iteration, r4 is a random number in [0, 1], L is the Levy flight function, and λ is a calculated adjustment coefficient. The mathematical model is: λ = [ln(T max -t+2) / ln(T max )] 2 ;

[0106] Step 33, according to Step 31 and Step 32, establish an improved snow goose optimization algorithm local development position update strategy according to formula (2);

[0107] X i,j (t+1)=X i,j (t)+β·Δu(t)+(1-β)·o(t) (2);

[0108] Where, X i,j (t+1) is the j-th dimension position of the i-th snow goose individual at the t+1-th iteration, i = 1, 2, ..., N GP , j = 1, 2, ..., D,

[0109] Step 34, use randn(1, D) to randomly explore other snow goose individuals in the search space, use the minimum time variable Min_Time and the improved control parameter alpha to improve the searchability of the snow goose optimization algorithm, and establish the improved snow goose optimization algorithm global exploration position update strategy according to formula (6);

[0110] X i,j (t+1)=randn(1,D)×(Min_Time×alpha)+X best (6);

[0111] Where randn(1, D) is a random value in the problem dimension D, X best is the current global optimal snow goose position.

[0112] Furthermore, the Sobol sequence is used to initialize the good point set. The specific steps are as follows:

[0113] Step 21: Determine the dimension and number of the best point set based on the problem dimension D and the maximum population size N.

[0114] Step 22, using the Sobol sequence method to generate a uniformly distributed point set, which is used as the initial solution of the improved snow goose optimization algorithm;

[0115] Step 23: Map the generated good point set to the search space of the K-means algorithm optimized by the improved snow goose optimization algorithm.

[0116] Specifically, in one embodiment, in Matlab, the maximum population size N is set GP =20, maximum number of iterations T max =70, problem dimension D=1, and optimization upper bound ub=10 and lower bound lb=0, input traditional pattern image in JPG format, use improved snow goose optimization algorithm (PGOOSE) and improved snow goose optimization algorithm (GOOSE) to optimize K-means algorithm to segment the traditional pattern image, and get segmentation threshold K=4. The cluster centers obtained by GOOSE are 0.67566, 0.26525, 0.92771, 0.39859; the cluster centers obtained by PGOOSE are 0.36242, 0.71062, 0.61102, 0.23487; Figure 3 As shown in the figure, the best optimal value of the objective function found by GOOSE, that is, the minimum fitness value is: 284.8583, and the best optimal value of the objective function found by PGOOSE, that is, the minimum fitness value is: 160.8716; when using the intelligent optimization algorithm to optimize K-means clustering, the goal is to minimize the objective function, and the smaller the objective function value, the better. Therefore, the improved snow goose optimization algorithm (PGOOSE) proposed in the present invention is better for the traditional pattern image segmentation effect.

[0117] Figure 4 This is a pseudo-color image of the traditional pattern image segmentation using the K-means algorithm optimized by the improved Snow Goose Optimization Algorithm (GOOSE). Figure 5 This is a pseudo-color image of the traditional pattern image segmented by the improved snow goose optimization algorithm (PGOOSE) optimizing the K-meams algorithm. The pseudo-color image can intuitively display the distribution of different colors in the traditional pattern image. It can be seen from the figure that the improved snow goose optimization algorithm (PGOOSE) optimizes the K-meams algorithm to segment the traditional pattern image, and the pseudo-color image obtained reflects the characteristics of the traditional pattern image more obviously. Through this method, the features of the traditional pattern image can be better extracted.

[0118] Figure 6 This is the effect diagram of the traditional pattern image after using the improved Snow Goose Optimization Algorithm (GOOSE) to optimize the K-means algorithm segmentation. Figure 7 The effect of using the improved snow goose optimization algorithm (PGOOSE) to optimize the K-means algorithm for segmentation of traditional pattern images is compared. Figure 6 and Figure 7It was found that the traditional pattern effect image after segmentation by the improved snow goose optimization algorithm (PGOOSE) optimized K-means algorithm was clearer in image details and the segmentation of traditional pattern image features was more detailed.

Claims

1. An image segmentation optimization method for traditional pattern image feature extraction, It is characterized in that include: Step 1: obtaining RGB color space pixels of the traditional pattern image, converting the image from the spatial domain to the frequency domain using a two-dimensional Fourier transform, obtaining a spectrum in complex form, analyzing the spectrum, and separating the spectrum of the characteristic area and the spectrum of the non-characteristic area in the image; Step 2: Perform inverse Fourier transform processing on the characteristic area and non-characteristic area of ​​the traditional pattern image to convert the traditional pattern image from the frequency domain back to the spatial domain; Step 3: setting the pixel value range of the spatial domain image after the inverse Fourier transform to between 0 and 255, and converting it into a grayscale image; Step 4: Improve the position update mathematical model of the local development phase of the Snow Goose Optimization Algorithm and the search control parameters of the global exploration phase ; The specific steps of improving the snow goose optimization algorithm are: S41. Integrate the local development position update strategy of the snow goose optimization algorithm with the update mechanism of the PID search algorithm to reduce the optimization complexity of the snow goose optimization algorithm and improve the optimization convergence speed and accuracy of the local development stage of the snow goose optimization algorithm. (2); In the formula, For the The iteration Snow Goose The location of the dimension, , , ; For the current iteration The PID output value at , which is the convergence step length of the improved snow goose optimization algorithm, The limiting step size parameter for the current iteration; S42, Improved Snow Goose Optimization Algorithm Global Exploration Phase Control Parameters Determining the Searchability of the Snow Goose Optimization Algorithm , using the improved control parameters Generate a new mathematical model for the global exploration position update strategy of the Snow Goose Optimization algorithm; Improve control parameters The mathematical model is: ; In the formula, is the current iteration number, is the maximum number of iterations, The largest population size, is a random number in [0, 1], is the minimum value of the objective function in the current iteration, For the current iteration The objective function value of the individual snow goose position; Step 5: Use the improved snow goose optimization algorithm to adjust the segmentation threshold of the K-means algorithm, obtain the optimal threshold K of the K-means algorithm for segmenting the traditional pattern image, use the optimal threshold to segment the grayscale image, and realize the feature extraction of the traditional pattern image. The specific steps are: Step 1: Initialize the parameters common to the PID search algorithm and the Snow Goose optimization algorithm, including: the maximum size of the population , maximum number of iterations , Problem Dimension And find the upper bound and the lower bound ; Step 2, using the good point set to initialize the initial position of the snow goose population of the improved snow goose optimization algorithm, the initial position of the snow goose population is mapped to the threshold K of the K-means algorithm, and the position of each individual snow goose corresponds to a solution of the threshold K; Step 3, construct a mathematical model for updating the position of the snow goose population, update the position of each individual snow goose according to the mathematical model, and decode the updated position of the individual snow goose into a solution of the segmentation threshold K of the K-means algorithm; the specific steps are: Step 31: The local development phase is the process of the improved snow goose optimization algorithm converging to the target value. It simulates the convergence behavior of the PID search algorithm and calculates the convergence step length of the improved snow goose optimization algorithm according to formula (4). To model: (4); In the formula, For the current iteration The PID output value at , which is the convergence step of the improved snow goose optimization algorithm; Kp, Ki and Kd are the adjustment coefficients of proportion, integration and differentiation, which are set to 1, 0.5 and 1.2 respectively; , and is a random number in [0, 1]; is the difference between the individual position of the snow goose in the current iteration and the optimal position, is the total deviation of the previous iteration when the number of iterations is t, is the overall deviation of the first two iterations; Step 32: In order to avoid the improved snow goose optimization algorithm from having too large a convergence step and thus missing the optimal solution, a mathematical model of the parameter limiting the step length is established according to formula (5): (5); In the formula, is the limiting step size parameter of the current iteration, is a random number in [0, 1], is the Levy flight function, is a calculated adjustment coefficient, and the mathematical model is: ; Step 33, according to Step 31 and Step 32, establish an improved snow goose optimization algorithm local development position update strategy according to formula (2); (2); In the formula, For the The iteration Snow Goose The location of the dimension, , , ; Step 34. Use Randomly explore other snow geese in the search space, using the minimum time variable and improved control parameters Improve the searchability of the snow goose optimization algorithm and establish an improved global exploration position update strategy of the snow goose optimization algorithm according to formula (6); (6); In the formula, is a random value in the problem dimension D, is the current global optimal snow goose position; Step 4: Using the objective function Calculate the fitness values ​​of the positions of the updated snow goose individuals, sort the fitness values ​​in ascending order, and retain the position of the snow goose individual with the largest fitness value; wherein the objective function is designed by combining the compactness and separation of clustering , the mathematical model formula of the objective function is: ; In the formula, is a random parameter between 0 and 1, which is used to balance the importance of intra-cluster compactness and inter-cluster separation. is the compactness within the cluster, that is, the sum of the squares of the distances between the data points in each cluster and the cluster center; is the separation between clusters, that is, the sum of squared distances between the centers of different clusters; Step 5. Calculate the current number of iterations The maximum fitness value when The number of previous iterations The maximum fitness value when Rate of change (3) If the change rate is less than 0.2, it means that the segmentation threshold K of the current iteration of the K-means algorithm is close to the optimal value, and the iteration is continued. Output the segmentation threshold K solution of the K-means algorithm corresponding to the position of the individual snow goose after iteration, otherwise return to Step 2.

2. According to claim 1, an image segmentation optimization method for extracting features from traditional pattern images, It is characterized in that In step 1, the image is converted from the spatial domain to the frequency domain using a two-dimensional Fourier transform, and the mathematical model is: (1); In the formula, It is one of the three color channels of red, green and blue in the traditional pattern image (R, G, B). and is the frequency coordinate, and is the spatial coordinate, is the spectrum representation of the traditional pattern image, is the pixel intensity of the traditional pattern image at the coordinate (x, y), and They are respectively the width and height of the traditional pattern image.

3. According to claim 2, an image segmentation optimization method for traditional pattern image feature extraction, It is characterized in that In step 2, the image feature area and non-feature area are subjected to inverse Fourier transform processing, and the mathematical model is: ; In the formula, the meaning of each parameter is consistent with that in formula (1).

4. The image segmentation optimization method for extracting features from traditional pattern images according to claim 3, It is characterized in that In step 4, the segmentation threshold of the K-means algorithm is adjusted by using the improved snow goose optimization algorithm. During the adjustment process, the compactness and separation of the clusters are combined to design the objective function. , the smaller the objective function is, the better the setting effect is, otherwise, the worse the setting effect is. The mathematical model formula of the objective function is: ; In the formula, is a random parameter between 0 and 1, which is used to balance the importance of intra-cluster compactness and inter-cluster separation. is the compactness within the cluster, that is, the sum of the squares of the distances between the data points in each cluster and the cluster center; is the separation between clusters, that is, the sum of squared distances between the centers of different clusters.

Citation Information

Patent Citations

  • A digital image processing method based on local time-frequency domain transformation

    CN109685728A

  • Lesion image lesion detection method and device

    CN111815610A

  • RBF (Radial Basis Function) neural network optimization method based on improved Harlisia eagle algorithm

    CN113240069A

  • Three-dimensional blood vessel image reconstruction method and system, medical equipment and storage medium

    CN113706684A

  • Image segmentation method and device, electronic equipment and storage medium

    CN114266894A