An optimization method for image segmentation technology for defect identification of power grid base station components
By improving the Tyrannosaurus Rex optimization algorithm and optimizing the K-means clustering algorithm, the problems of instability and high computational complexity in the identification of defects of power grid base station components are solved, and higher recognition accuracy and feature extraction capabilities are achieved.
Patent Information
- Application Number
- CN202410300832.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-15
- Publication Date
- 2025-05-16
- Estimated Expiration
- 2044-03-15
AI Technical Summary
The existing K-means clustering algorithm has problems such as unstable results in the identification of defects of power grid base station components, the need to determine the number of clusters in advance that affects segmentation accuracy, is sensitive to noise and outliers, ignores the spatial relationship between pixels, and has high computational complexity.
Improve the Tyrannosaurus Rex optimization algorithm, optimize the K-means algorithm to obtain the global optimal value K for image segmentation by adjusting the estimated distance Er of the Tyrannosaurus Rex to reach its prey and the development stage of the Fusion Star Crow optimization algorithm.
The recognition accuracy of image defect detection of power grid base station components is improved, feature extraction ability and noise resistance are enhanced, and local optimal solution is avoided.
Smart Images

Figure CN118298171B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to an image segmentation technology optimization method for defect recognition of power grid base station components. Background Art
[0002] Since the K-means clustering algorithm randomly determines the initial number of clusters, and the original data set contains a large number of redundant features, which will lead to reduced clustering accuracy. Secondly, the K-means algorithm is highly dependent on the initial cluster center and is prone to local optimal stagnation problems.
[0003] K-means clustering is an unsupervised learning method. The basic idea is to cluster samples with high similarity and small differences into one category based on the distance and similarity between samples, so that samples in the same category have high similarity and samples in different categories have high differences. However, the traditional K-means clustering method relies heavily on the selection of the number of clusters K, and the effect is unsatisfactory.
[0004] K-means is a common image segmentation method, but it also has some defects in practical applications. First, its results will be affected by the initial centroid, resulting in unstable clustering results; second, the number of clusters K needs to be determined in advance, which will affect the accuracy of segmentation; in addition, the K-means algorithm is sensitive to noise and outliers and is easily disturbed by them; in addition, K-means only clusters according to the color or grayscale value of pixels, ignoring the spatial relationship between pixels and cannot handle complex image content; finally, for large images, the K-means algorithm has a high computational complexity and a long processing time.
[0005] In recent years, optimal control problems have become increasingly important in solving practical problems. In this regard, metaheuristic algorithms are effective in solving these problems efficiently. However, these algorithms may not be effective in solving all optimization problems. Therefore, this patent proposes a new optimization algorithm based on Tyrannosaurus Rex hunting, the Tyrannosaurus Rex Optimization Algorithm (TROA). The algorithm is inspired by the hunting behavior of Tyrannosaurus Rex. The algorithm was tested on 12 benchmark problems and 4 practical optimal control problems. Seven well-known optimization techniques, including differential evolution (DE) algorithm, particle swarm optimization (PSO), gray wolf optimizer (GWO), white shark optimizer (WSO), jellyfish search (JS), crow search algorithm (CSA), and golden eagle optimization (GEO), were compared. Compared with these methods, this method has better computational effect. However, the Tyrannosaurus Rex optimization algorithm may have a balance problem between quickly finding a feasible solution and achieving a high-precision solution. In some cases, the algorithm converges quickly to a local optimal solution instead of a global optimal solution. The standard Tyrannosaurus Rex optimization algorithm has some shortcomings when optimizing K-means parameters, which may affect the performance and stability of the optimization; the local development performance of the standard Tyrannosaurus Rex optimization algorithm is poor, especially in high-dimensional, non-convex or non-smooth search spaces, the standard Tyrannosaurus Rex optimization algorithm is easily trapped in the local optimal solution and cannot explore a better solution. Summary of the invention
[0006] In view of the above problems in the above-mentioned prior art, the present invention provides an image segmentation technology optimization method for power grid base station component defect identification. The K-means algorithm is optimized by improving the Tyrannosaurus Rex optimization algorithm to obtain the global optimal value K for image segmentation, thereby enhancing the image defect detection effect of power grid base station components. At the same time, the optimized model also exhibits the characteristics of strong feature extraction and strong anti-noise ability.
[0007] In order to achieve the above object, the technical solution adopted by the present invention is as follows:
[0008] A method for optimizing image segmentation technology for defect recognition of power grid base station components includes the following steps.
[0009] Step 1: Collect defective image data of power grid base station components through monitoring cameras, pre-process images of defective power grid base station components, and extract key features in the images.
[0010] Step 2: Convert the image into a data representation suitable for K-means algorithm processing.
[0011] Step 3: Improve the optimization algorithm of ordinary Tyrannosaurus Rex. The specific improvement steps are as follows:
[0012] S31, improve the estimated distance Er that the Tyrannosaurus Rex reaches its prey;
[0013] S32, in the exploration and development stage of the ordinary Tyrannosaurus Rex optimization algorithm, the development stage of the Tyrannosaurus Rex optimization algorithm is integrated with the development stage of the Nutcracker optimization algorithm, and then the development operator l of the integrated Tyrannosaurus Rex-Nutcracker optimization algorithm is improved;
[0014] Step 4: Use the improved Tyrannosaurus Rex optimization algorithm to optimize the parameters of the clustering points K of the K-means clustering model to obtain the global optimal value as the initial clustering center of the K-means algorithm.
[0015] Step 5: Apply the optimized K-means clustering model to the image segmentation of the defective images of power grid base station components to obtain the target defective area.
[0016] Furthermore, in the step 1, key features in the image are extracted. First, the directional gradient histogram (HOG) feature is selected as the feature vector of the power grid base station component defect image. Then, the image features of the power grid base station component defect are constructed by calculating and counting the local area gradient directional histogram of the power grid base station component defect image. The specific steps are:
[0017] Step 1: Use the Gamma correction method to normalize the grayscale image of the defects of the power grid base station components;
[0018] Step 2: Calculate the horizontal gradient value G for each pixel point (x, y) in each local area x (x, y) and the vertical gradient value G y (x, y), the formula is as follows:
[0019] G x (x,y)=H(x+1,y)-H(x-1,y);
[0020] G y (x, y)=H(x, y+1)-H(x, y-1);
[0021] Where H(x, y) is the pixel value at the pixel point (x, y);
[0022] step3. Calculate the gradient value G(x, y) and gradient direction a(x, y) at the pixel point (x, y).
[0023] Furthermore, in step three, step S31, the improvement of the previous Er is not conducive to the balance between the local and global searches of the algorithm, and therefore the estimated distance Er for the Tyrannosaurus Rex to reach its prey is adjusted so that the Tyrannosaurus Rex takes a larger step size in the early stage of optimization to improve the optimization efficiency, and a smaller step size in the later stage of optimization to improve the optimization accuracy. The step size is adaptively changed according to the optimization stage, so as to better avoid falling into the local optimum while improving the optimization efficiency.
[0024] Furthermore, in step three, step S31, the estimated distance Er from the Tyrannosaurus Rex to the prey is improved, and the improved mathematical formula of Er is:
[0025]
[0026] In the formula, Er t-1 is the estimated distance from the last iteration of the Tyrannosaurus Rex to the prey, t is the current iteration number, is the best fitness value of the current iteration, is the fitness value of the i-th individual in the t-th generation population, is the best fitness value of the last iteration.
[0027] Furthermore, in the step three, step S32, in the exploration and development stage of the ordinary Tyrannosaurus Rex optimization algorithm, the development stage of the Tyrannosaurus Rex optimization algorithm is integrated with the development stage of the Nutcracker optimization algorithm, and then the development operator l of the fused Tyrannosaurus Rex-Nutcracker optimization algorithm is improved. The exploration and development stage of the ordinary Tyrannosaurus Rex optimization algorithm has a slow optimization speed and is prone to falling into local optimality, while in the development stage of the Nutcracker optimization algorithm, by improving the development operator l to diversify the development operators of the algorithm, in addition to avoiding falling into local minima that may occur when searching in one direction, the diversity of the improved development operator will help to speed up its convergence speed.
[0028] Furthermore, in the step three, step S32, the development phases of the Tyrannosaurus Rex optimization algorithm and the Nutcracker optimization algorithm are integrated, and then the development operator l of the integrated Tyrannosaurus Rex-Nutcracker optimization algorithm is improved. The mathematical formula of the improved development operator l is:
[0029]
[0030] In the formula, l min To develop the minimum value of the operator, l max To develop the maximum value of the operator, l t is the current iteration value of the development operator, f(t) is the fitness value of the current iteration t, and f worst To set the worst fitness value, t is the current iteration number, and T is the total iteration number.
[0031] Furthermore, in step 4, the improved Tyrannosaurus Rex optimization algorithm is used to optimize the parameters of the clustering points K of the K-means clustering model, and the specific steps are as follows:
[0032] S1. Initialize the parameters of the improved Tyrannosaurus Rex optimization algorithm, the initial position of the algorithm population and the upper and lower bounds of the algorithm search space. The initial position of the algorithm population is the initial cluster center of the K-means clustering model; the upper and lower bounds of the algorithm search space are the range of the initial cluster point number K of the K-means clustering model;
[0033] S2, using the location information of Tyrannosaurus Rex as the value of clustering point K, constructing multiple K-means clustering models, and inputting HOG features into the K-means clustering model;
[0034] S3, using the K-means clustering model to design the fitness function of the Tyrannosaurus Rex optimization algorithm based on the mean square error of the recognition accuracy of the grid base station component images without defects; the input of the fitness function is the number of grid base station component images without defects and the number of grid base station component images without defects that are correctly identified;
[0035] S4. Calculate the fitness value f(t) of the individual in the current iteration of the improved Tyrannosaurus Rex algorithm, compare it with the optimal fitness value of the previous iteration, and record the optimal fitness value f of all current iterations. best ;
[0036] S5, simulating the process of Tyrannosaurus Rex searching for prey and hunting prey, updating the individual positions of the Tyrannosaurus Rex population, that is, updating the clustering point number K solution of the K-means clustering model;
[0037] S6. Judgment If it is established, execute the reverse refraction learning strategy, jump out of the local optimum, and update the algorithm population; otherwise, execute S7;
[0038] S7, calculate the current fitness, compare it with the historical optimal fitness, update the individual optimal solution, and at the same time, update the group optimal solution according to the fitness of all individuals;
[0039] S8. Determine whether the current number of iterations t satisfies t=T. If so, output the optimal clustering point K. Otherwise, return to execute S1.
[0040] Furthermore, in S3, the fitness function formula is:
[0041]
[0042] Where y is the number of grid base station component images without defects, and y′ is the number of grid base station component images correctly identified without defects.
[0043] Furthermore, in S5, the process of the Tyrannosaurus Rex searching for and eating prey is simulated to update the individual positions of the Tyrannosaurus Rex population:, the specific steps are:
[0044] S51, algorithm search phase, the Tyrannosaurus Rex searches for prey randomly, and uses formula (4) to update the position of the Tyrannosaurus Rex population, that is, to update the number of clustering points K of the K-means clustering model:
[0045]
[0046] Where Er is the estimated distance from the improved Tyrannosaurus Rex to the prey, rand() is the random distance value, and X new is the position of the Tyrannosaurus Rex to be updated, x new is the position of the prey in the current iteration, Random is the position of the random prey;
[0047] S52, algorithm development stage, the development stage of the Tyrannosaurus Rex optimization algorithm and the Nutcracker optimization algorithm are integrated to improve the position update strategy of the Tyrannosaurus Rex and update the clustering point number K solution of the K-means clustering model. The formula is as follows:
[0048]
[0049] In the formula, is the position of the t+1 iteration of the i-th algorithm individual; is the position of the tth iteration of the i-th algorithm individual; is the optimal position in the current iterative population; is the average position in the current iterative algorithm population; λ is the random number generated by Levy flight; r1 is a random number with a value in [0, 1], and is the position of random individuals A and B in the i-th iteration, μ is the search step of the population individuals; τ1, τ2, τ3 are random real numbers between [0, 1].
[0050] In summary, due to the adoption of the above technical solution, the beneficial effects of the present invention are:
[0051] The present invention introduces a standard Tyrannosaurus Rex optimization algorithm for the first time. On the basis of the standard Tyrannosaurus Rex optimization algorithm, the estimated distance Er of the Tyrannosaurus Rex to reach its prey is improved, so that the Tyrannosaurus Rex adopts a larger step size in the early stage of optimization to improve the optimization efficiency, and adopts a smaller step size in the later stage of optimization to improve the optimization accuracy. The step size is adaptively changed according to the optimization stage, so as to better avoid falling into the local optimum while improving the optimization efficiency. In the exploration and development stage of the ordinary Tyrannosaurus Rex optimization algorithm, the Tyrannosaurus Rex optimization algorithm is integrated with the development stage of the Nutcracker optimization algorithm, and then the development operator l of the integrated Tyrannosaurus Rex-Nutcracker optimization algorithm is improved. The improved Tyrannosaurus Rex optimization algorithm is used to optimize K-means image segmentation, and the image segmentation technology of the power grid base station component image is enhanced, which effectively improves the recognition accuracy of the power grid base station component image defect image. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Figure 1 The present invention is a flowchart of an image segmentation technology optimization method for defect recognition of power grid base station components.
[0053] Figure 2 Flowchart for optimizing the parameters of the number of clustering points K in the K-means clustering model to improve the Tyrannosaurus Rex optimization algorithm.
[0054] Figure 3 A comparison chart of the fitness values of the standard Tyrannosaurus Rex optimization algorithm and the improved Tyrannosaurus Rex optimization algorithm.
[0055] Figure 4 This is the original image of the power grid base station components.
[0056] Figure 5 This is the image segmentation effect of power grid base station components optimized by the standard Tyrannosaurus Rex optimization algorithm.
[0057] Figure 6 The image segmentation effect of power grid base station components under the optimization of Tyrannosaurus Rex optimization algorithm. DETAILED DESCRIPTION
[0058] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments; based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0059] See also Figure 1-Figure 6 , the present invention provides a technical solution:
[0060] An image segmentation technology optimization method for defect recognition of power grid base station components, the specific steps are as follows Figure 1 As shown:
[0061] Step 1: Collect defective image data of power grid base station components through monitoring cameras, pre-process images of defective power grid base station components, and extract key features in the images.
[0062] Step 2: Convert the image into a data representation suitable for K-means algorithm processing.
[0063] Step 3: Improve the optimization algorithm of ordinary Tyrannosaurus Rex. The specific improvement steps are as follows:
[0064] S31, improve the estimated distance Er that the Tyrannosaurus Rex reaches its prey;
[0065] S32, in the exploration and development stage of the ordinary Tyrannosaurus Rex optimization algorithm, the development stage of the Tyrannosaurus Rex optimization algorithm is integrated with the development stage of the Nutcracker optimization algorithm, and then the development operator l of the integrated Tyrannosaurus Rex-Nutcracker optimization algorithm is improved;
[0066] Step 4: Use the improved Tyrannosaurus Rex optimization algorithm to optimize the parameters of the clustering points K of the K-means clustering model to obtain the global optimal value as the initial clustering center of the K-means algorithm.
[0067] Step 5: Apply the optimized K-means clustering model to the image segmentation of the defective images of power grid base station components to obtain the target defective area.
[0068] Furthermore, in the step 1, key features in the image are extracted. First, the directional gradient histogram (HOG) feature is selected as the feature vector of the power grid base station component defect image. Then, the image features of the power grid base station component defect are constructed by calculating and counting the local area gradient directional histogram of the power grid base station component defect image. The specific steps are:
[0069] Step 1: Use the Gamma correction method to normalize the grayscale image of the defects of the power grid base station components;
[0070] Step 2: Calculate the horizontal gradient value G for each pixel point (x, y) in each local area x (x, y) and the vertical gradient value G y (x, y), the formula is as follows:
[0071] G x (x,y)=H(x+1,y)-H(x-1,y);
[0072] G y (x, y)=H(x, y+1))-H(x, y-1);
[0073] Where H(x, y) is the pixel value at the pixel point (x, y);
[0074] step3. Calculate the gradient value G(x, y) and gradient direction a(x, y) at the pixel point (x, y).
[0075] Furthermore, in step three, step S31, the improvement of the previous Er is not conducive to the balance between the local and global searches of the algorithm, and therefore the estimated distance Er for the Tyrannosaurus Rex to reach its prey is adjusted so that the Tyrannosaurus Rex takes a larger step size in the early stage of optimization to improve the optimization efficiency, and a smaller step size in the later stage of optimization to improve the optimization accuracy. The step size is adaptively changed according to the optimization stage, so as to better avoid falling into the local optimum while improving the optimization efficiency.
[0076] Furthermore, in step three, step S31, the estimated distance Er from the Tyrannosaurus Rex to the prey is improved, and the improved mathematical formula of Er is:
[0077]
[0078] In the formula, Er t-1 is the estimated distance from the last iteration of the Tyrannosaurus Rex to the prey, t is the current iteration number, is the best fitness value of the current iteration, is the fitness value of the i-th individual in the t-th generation population, is the best fitness value of the last iteration.
[0079] Furthermore, in the step three, step S32, in the exploration and development stage of the ordinary Tyrannosaurus Rex optimization algorithm, the development stage of the Tyrannosaurus Rex optimization algorithm is integrated with the development stage of the Nutcracker optimization algorithm, and then the development operator l of the fused Tyrannosaurus Rex-Nutcracker optimization algorithm is improved. The exploration and development stage of the ordinary Tyrannosaurus Rex optimization algorithm has a slow optimization speed and is prone to falling into local optimality, while in the development stage of the Nutcracker optimization algorithm, by improving the development operator l to diversify the development operators of the algorithm, in addition to avoiding falling into local minima that may occur when searching in one direction, the diversity of the improved development operator will help to speed up its convergence speed.
[0080] Furthermore, in the step three, step S32, the development phases of the Tyrannosaurus Rex optimization algorithm and the Nutcracker optimization algorithm are integrated, and then the development operator l of the integrated Tyrannosaurus Rex-Nutcracker optimization algorithm is improved. The mathematical formula of the improved development operator l is:
[0081]
[0082] In the formula, l min To develop the minimum value of the operator, l max To develop the maximum value of the operator, l t is the current iteration value of the development operator, f(t) is the fitness value of the current iteration t, and f worst To set the worst fitness value, t is the current iteration number, and T is the total iteration number.
[0083] 2 Further, in step 4, the improved Tyrannosaurus Rex optimization algorithm is used to optimize the parameters of the clustering points K of the K-means clustering model, such as Figure 2 , the specific steps are as follows:
[0084] S1. Initialize the parameters of the improved Tyrannosaurus Rex optimization algorithm, the initial position of the algorithm population and the upper and lower bounds of the algorithm search space. The initial position of the algorithm population is the initial cluster center of the K-means clustering model; the upper and lower bounds of the algorithm search space are the range of the initial cluster point number K of the K-means clustering model;
[0085] S2, using the location information of Tyrannosaurus Rex as the value of clustering point K, constructing multiple K-means clustering models, and inputting HOG features into the K-means clustering model;
[0086] S3, using the K-means clustering model to design the fitness function of the Tyrannosaurus Rex optimization algorithm based on the mean square error of the recognition accuracy of the grid base station component images without defects; the input of the fitness function is the number of grid base station component images without defects and the number of grid base station component images without defects that are correctly identified;
[0087] S4. Calculate the fitness value f(t) of the individual in the current iteration of the improved Tyrannosaurus Rex algorithm, compare it with the optimal fitness value of the previous iteration, and record the optimal fitness value f of all current iterations. best ;
[0088] S5, simulating the process of Tyrannosaurus Rex searching for prey and hunting prey, updating the individual positions of the Tyrannosaurus Rex population, that is, updating the clustering point number K solution of the K-means clustering model;
[0089] S6. Judgment If it is established, execute the reverse refraction learning strategy, jump out of the local optimum, and update the algorithm population; otherwise, execute S7;
[0090] S7, calculate the current fitness, compare it with the historical optimal fitness, update the individual optimal solution, and at the same time, update the group optimal solution according to the fitness of all individuals;
[0091] S8. Determine whether the current number of iterations t satisfies t=T. If so, output the optimal clustering point K. Otherwise, return to execute S1.
[0092] Furthermore, in S3, the fitness function formula is:
[0093]
[0094] Where y is the number of grid base station component images without defects, and y is the number of grid base station component images correctly identified as without defects.
[0095] Furthermore, in S5, the process of the Tyrannosaurus Rex searching for and eating prey is simulated to update the individual positions of the Tyrannosaurus Rex population:, the specific steps are:
[0096] S51, algorithm search phase, the Tyrannosaurus Rex searches for prey randomly, and uses formula (4) to update the position of the Tyrannosaurus Rex population, that is, to update the number of clustering points K of the K-means clustering model:
[0097]
[0098] Where Er is the estimated distance from the improved Tyrannosaurus Rex to the prey, rand() is the random distance value, and X new is the position of the Tyrannosaurus Rex to be updated, x newis the position of the prey in the current iteration, Random is the position of the random prey;
[0099] S52, algorithm development stage, the development stage of the Tyrannosaurus Rex optimization algorithm and the Nutcracker optimization algorithm are integrated to improve the position update strategy of the Tyrannosaurus Rex and update the clustering point number K solution of the K-means clustering model. The formula is as follows:
[0100]
[0101] In the formula, is the position of the t+1 iteration of the i-th algorithm individual; is the position of the tth iteration of the i-th algorithm individual; is the optimal position in the current iterative population; is the average position in the current iterative algorithm population; λ is the random number generated by Levy flight; r1 is a random number with a value in [0, 1], and is the position of random individuals A and B in the i-th iteration, μ is the search step of the population individuals; τ1, τ2, τ3 are random real numbers between [0, 1].
[0102] Furthermore, in S6, the average value of all individual positions in the current iteration is calculated as follows:
[0103]
[0104] The image segmentation technology optimization method for power grid base station component images proposed in this patent was experimentally verified by Matlab, and the maximum number of iterations T was set to 30, the population size was 100, and the problem dimension D was 3; after algorithm iteration, the optimal clustering number K=3 was obtained after optimization; the segmentation thresholds obtained by optimizing K-menas with the improved Tyrannosaurus Rex optimization algorithm were: 39, 75, 133; the segmentation thresholds obtained by optimizing K-menas with the standard Tyrannosaurus Rex optimization algorithm were 48, 67, 102.
[0105] like Figure 3 As shown in the figure, the fitness values of the standard Tyrannosaurus Rex optimization algorithm (TROA) and the improved Tyrannosaurus Rex optimization algorithm (IBTROA) are compared. According to the principle that the smaller the optimization fitness value, the better, it can be obviously found that the improved Tyrannosaurus Rex optimization algorithm has a smaller optimization fitness value and a faster optimization speed, while the standard Tyrannosaurus Rex optimization algorithm reaches a stable state after 10 iterations, falls into a local optimum and cannot jump out, and the optimization accuracy is lower than that of the improved Tyrannosaurus Rex optimization algorithm, indicating that the improved Tyrannosaurus Rex optimization algorithm has better optimization accuracy and a faster optimization speed.
[0106] Figure 4 This is the original image of the actual power grid base station components. Figure 5 and Figure 6 , Figure 5 and Figure 6 The effect diagram of optimizing the standard Tyrannosaurus Rex optimization algorithm for image segmentation of power grid base station components and optimizing the improved Tyrannosaurus Rex optimization algorithm for image segmentation of power grid base station components shows that the standard Tyrannosaurus Rex optimization algorithm optimizes image segmentation and can effectively extract the features of defects in different power grid base station components, but its number of feature points is small, and the detection and recognition effect of defects in power grid base station components is poor; while the improved Tyrannosaurus Rex optimization algorithm extracts more and more detailed feature points, and has better detection and recognition effect on defects in power grid base station components.
Claims
1. An image segmentation technology optimization method for defect recognition of power grid base station components, characterized in that: The improved Tyrannosaurus Rex algorithm is used to optimize K-means image segmentation and enhance the image defect detection of power grid base station components. The specific steps are as follows: Step 1: Collect defect image data of power grid base station components through monitoring cameras, pre-process images of power grid base station components with defects, and extract key features in the images; Step 2: Convert the image into a data representation suitable for K-means algorithm processing; Step 3: Improve the optimization algorithm of ordinary Tyrannosaurus Rex. The specific improvement steps are as follows: S31. Improve the estimated distance of Tyrannosaurus Rex to reach prey ; S32. In the exploration and development phase of the ordinary Tyrannosaurus optimization algorithm, the Tyrannosaurus optimization algorithm is integrated with the development phase of the Nutcracker optimization algorithm, and then the development operator of the integrated Tyrannosaurus-Nutcracker optimization algorithm is improved. ; Step 4: Use the improved Tyrannosaurus Rex optimization algorithm to optimize the parameters of the clustering points K of the K-means clustering model to obtain the global optimal value as the initial clustering center of the K-means algorithm; Step 5: Apply the optimized K-means clustering model to the image segmentation of the defect image of the power grid base station component to obtain the target defect area; In the step three, step S32, the development phase of the Tyrannosaurus Rex optimization algorithm and the Nutcracker optimization algorithm are integrated, and then the development operator of the integrated Tyrannosaurus Rex-Nutcracker optimization algorithm is improved. , the improved development operator The mathematical formula is: ; In the formula, To develop the operator minimum, To develop the operator maximum, To develop the current iteration value of the operator, is the fitness value of the current iteration t times, To set the worst fitness value, is the current iteration number, is the total number of iterations; In the step 4, the improved Tyrannosaurus Rex optimization algorithm is used to optimize the parameters of the clustering points K of the K-means clustering model. The specific steps are: S1. Initialize the parameters of the improved Tyrannosaurus Rex optimization algorithm, the initial position of the algorithm population and the upper and lower bounds of the algorithm search space. The initial position of the algorithm population is the initial cluster center of the K-means clustering model; the upper and lower bounds of the algorithm search space are the range of the initial cluster point number K of the K-means clustering model; S2, using the location information of Tyrannosaurus Rex as the value of clustering point K, constructing multiple K-means clustering models, and inputting HOG features into the K-means clustering model; S3, using the K-means clustering model to design the fitness function of the Tyrannosaurus Rex optimization algorithm based on the mean square error of the recognition accuracy of the grid base station component images without defects; the input of the fitness function is the number of grid base station component images without defects and the number of grid base station component images without defects that are correctly identified; S4. Calculate the fitness value of the individual in the current iteration of the improved Tyrannosaurus Rex algorithm , compare with the optimal fitness value of the previous iteration, and record the optimal fitness value of all current iterations ; S5, simulating the process of Tyrannosaurus Rex searching for prey and hunting prey, updating the individual positions of the Tyrannosaurus Rex population, that is, updating the clustering point number K solution of the K-means clustering model; S6. Judgment < , if it is established, execute the reverse refraction learning strategy, jump out of the local optimum, and update the algorithm population; otherwise, execute S7; S7, calculate the current fitness, compare it with the historical optimal fitness, update the individual optimal solution, and at the same time, update the group optimal solution according to the fitness of all individuals; S8. Determine the current number of iterations Is it satisfied? , if satisfied, then output the optimal clustering point K, otherwise return to execute S1.
2. The image segmentation technology optimization method for defect recognition of power grid base station components according to claim 1 is characterized in that: In step 3, step S31, improve the estimated distance of the Tyrannosaurus Rex to the prey , the improved The mathematical formula is: ; In the formula, is the estimated distance from the last iteration of the Tyrannosaurus Rex to the prey, is the current iteration number, is the optimal fitness value of the current iteration, is the fitness value of the ith individual in the tth generation population, is the optimal fitness value of the last iteration.
3. The image segmentation technology optimization method for defect recognition of power grid base station components according to claim 1 is characterized in that: In S5, the process of the Tyrannosaurus Rex searching for and eating prey is simulated to update the individual positions of the Tyrannosaurus Rex population. The specific steps are: S51, algorithm search phase, the Tyrannosaurus Rex searches for prey randomly, and uses formula (4) to update the position of the Tyrannosaurus Rex population, that is, to update the number of cluster points K of the K-means clustering model: (4); In the formula, To improve the estimated distance that Tyrannosaurus Rex reached its prey, is a random distance value, The location of the Tyrannosaurus Rex to be updated. is the position of the prey in the current iteration, is the location of random prey; S52, algorithm development stage, the development stages of the Tyrannosaurus Rex optimization algorithm and the Nutcracker optimization algorithm are integrated to improve the Tyrannosaurus Rex position update strategy and update the clustering point number K solution of the K-means clustering model. The formula is as follows: (5); In the formula, is the position of the t+1 iteration of the i-th algorithm individual; is the position of the tth iteration of the i-th algorithm individual; is the optimal position in the current iterative population; is the average position in the current iterative algorithm population; Random numbers generated for Levi's flight; is a random number in the range [0,1]. and is the position of random A and B individuals in the i-th iteration, Search step length for individuals in the population; , , is a random real number between [0,1].
Citation Information
Patent Citations
OLED (Organic Light Emitting Diode) panel defect discrimination method, device, equipment and medium
CN116258721A
Parameter optimization method of adaptive PID (Proportion Integration Differentiation) controller
CN117492359A