A method and system for planning inspection paths of UAV ultra-high voltage substations
By combining simplified facility models and improved algorithms, UAV inspection path planning is optimized, which solves the problem of poor path planning in the existing technology and achieves more efficient substation inspection path planning.
Patent Information
- Application Number
- CN202410743434.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-11
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2044-06-11
AI Technical Summary
In the existing technology, the substation inspection path planning is not interactive enough for actual application scenarios, causing the path planning results to fail to achieve the expected results, especially when the target point positioning in the modeling is not accurate enough.
A simplified facility model is used to combine UAV image collection and target detection, and the improved particle swarm algorithm and Retinanet deep learning model are used to optimize path planning by creating a fitness function to obtain the optimal UAV inspection path.
It improves the practical application effect of path planning, balances cost and accuracy, reduces the number of algorithm iterations, and obtains a more optimized inspection path.
Smart Images

Figure CN118310539B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of substation maintenance, and in particular to a method and system for planning an inspection path for an ultra-high voltage substation using an unmanned aerial vehicle. Background Art
[0002] As an important part of the power grid, substations affect the safe operation of the entire power grid, and substation inspections are the basis for ensuring the reliable operation of substation equipment. With the vigorous construction and vigorous development of UHV AC and DC power projects, traditional substation inspection methods have been difficult to adapt to the characteristics of large areas and multiple devices in UHV substations. The application of drones in substations can not only ensure safety and efficiency, but also overcome some of the shortcomings of traditional manual inspections. In addition, drone path planning can efficiently cover the entire substation area, and through target detection algorithms, it can monitor equipment status in real time, detect abnormal conditions, and provide timely feedback and processing, which improves inspection efficiency and equipment safety.
[0003] Target detection is the prerequisite for completing patrol tasks. The comprehensiveness and accuracy of detection information are related to the reliability of subsequent situation understanding, prediction and evaluation. Comparative analysis of the performance of different algorithms shows that the YOLO V3 algorithm is a single-stage algorithm with the fastest detection speed, but limited positioning accuracy. The Faster-RCNN algorithm is a two-stage algorithm with the highest target detection accuracy, but the running speed is slow. The path planning problem is generally carried out on the basis of modeling and applied in the simulation stage. There is very little interaction with the actual application scenario, making it difficult to complete the patrol task. If the positioning of the path points in the modeling is not accurate enough, the path planning results in the actual scenario will not achieve the best effect. If 1:1 accurate modeling is used, the cost of modeling will be higher and the manpower and material resources required will be large.
[0004] In the prior art, the invention patent with the patent publication number CN117389307A discloses an automatic inspection route planning method and a substation drone. By obtaining and analyzing the inspection tasks of the drone, the equipment that needs to be inspected in the substation can be quickly determined, and then the location information of the equipment can be determined based on the three-dimensional data map. Combined with the detection process in the inspection task, the best inspection route can be planned, thereby improving the efficiency of the inspection. However, the path planning effect of the prior art depends on the positioning accuracy of the path points in the modeling, and has little interaction with the actual application scenario. Summary of the invention
[0005] The technical problem to be solved by the present invention is to solve the problem that the existing path planning has little interaction with the actual application scenario. If the positioning of the target point in the modeling is not accurate enough, the path planning result will not achieve the expected effect.
[0006] In order to solve the above technical problems, the present invention provides the following technical solutions:
[0007] A method for planning a UAV UHV substation inspection path includes the following steps:
[0008] S10, creating a simplified facility model of the UHV substation environment;
[0009] S20, using a drone to sequentially traverse all building facilities in the actual scene based on the simplified facility model and the center point of the facility in the simplified facility model, and during the traversal process, collecting images and recording image coordinate information;
[0010] S30, performing device target detection on the image; if the detection result includes the equipment to be monitored, the corresponding image coordinate information is recorded in the simplified facility model as a path point in path planning;
[0011] S40, creating a UAV path planning fitness function based on the path points;
[0012] S50, using the improved particle swarm algorithm, according to the created fitness function, the UAV inspection path is optimized to obtain the optimal UAV UHV substation inspection path planning.
[0013] Advantages: The present invention uses the target detection and recognition algorithm to identify the equipment category in the substation scene, record the coordinate information of the image acquisition point, and combine it with the environmental modeling, so that the path points in the path planning are more suitable for practical applications and a good balance is established between cost and accuracy. In addition, the IPSO-GA algorithm can reduce the number of algorithm iterations while making the calculated cost smaller, that is, a more optimized path can be obtained.
[0014] In one embodiment of the present invention, the simplified facility model is obtained by simplifying the building facility into a rectangle.
[0015] In one embodiment of the present invention, an improved Retinanet deep learning model is used to perform device target detection; the improved Retinanet deep learning model uses the ResNet deep residual network structure to build a feature pyramid extraction network, and on the basis of the residual network, adds , Auxiliary detection layer, construction Five detection feature layers used to generate detection predictions in the on-device object detection network.
[0016] In one embodiment of the present invention, the Focal Loss function is used as the classification loss function to optimize the improved Retinanet deep learning model; wherein the Focal Loss function is defined as:
[0017] ;
[0018] ;
[0019] In the formula, is the Focal Loss function, is the category label of the image sample, Indicates that the image contains substation equipment. is the probability prediction value considering the sample category label. To improve the prediction value of the Retinanet deep learning model for positive samples, is the linear adjustment factor, is the index adjustment factor.
[0020] In one embodiment of the present invention, creating a UAV path planning fitness function includes: assuming that there is paths, each with The fitness function is created by combining the UAV track elevation cost and the path length cost.
[0021] In one embodiment of the present invention, the drone path length cost is obtained by the following formula:
[0022] ;
[0023] In the formula, the path The coordinates of the path points are passed through express; is the UAV path length cost, where ;
[0024] The UAV track elevation cost is obtained by the following formula:
[0025] ;
[0026] In the formula, is the UAV track elevation cost, For the The height of the waypoints, For the The height of the next neighboring node of the path point;
[0027] The UAV path planning fitness function is obtained by the following formula:
[0028] ;
[0029] In the formula, Fitness function for UAV path planning.
[0030] In one embodiment of the present invention, obtaining the optimal UAV UHV substation inspection path planning includes the following steps:
[0031] S51, initialization parameters, including path point coordinates, the number of path points, the population size of the particle swarm, and the number of iterations;
[0032] S52, determining an optimal inertia weight interval of the improved particle swarm algorithm and a value strategy of the inertia weight in the optimal inertia weight interval;
[0033] S53, using the optimal inertia weight interval, the inertia weight value strategy in the optimal inertia weight interval and the improved particle swarm algorithm to calculate the fitness, sort the fitness of the particle swarm of each iteration, and classify two sub-populations: sub-population and subpopulations ; Define population thresholds, subpopulations For a set greater than the population threshold, the subpopulation is a set smaller than the population threshold;
[0034] S54, subpopulation Directly perform the replication operation on the subpopulation Perform crossover and mutation operations;
[0035] S55, updating the individual optimal value and global optimal value of the particle swarm fitness;
[0036] S56: If the target accuracy of the fitness function is not reached, return to S52 to redefine the optimal inertia weight interval and the value strategy of the inertia weight in the optimal inertia weight interval; if the requirements are met, end and obtain the optimal path to traverse each target point with the optimal fitness.
[0037] In one embodiment of the present invention, determining the optimal inertia weight interval of the improved particle swarm algorithm and the value strategy of the inertia weight in the optimal inertia weight interval includes the following steps:
[0038] S521, according to the inertia weight reference range disclosed in the classic PSO algorithm, a plurality of inertia weight reference values are obtained with a fixed value as the interval interval; the classic PSO algorithm corresponding to the plurality of inertia weight reference values is operated with a group number of T1 and an iteration number of T2; and the classic PSO algorithm corresponding to each inertia weight reference value is run T3 times and the average value is taken to obtain the reference fitness corresponding to each inertia weight reference value;
[0039] S522, compare the sizes of multiple reference fitnesses, take the two smallest reference fitnesses, use the inertia weight reference value corresponding to the smaller reference fitness as the lower limit weight, and use the inertia weight reference value corresponding to the larger reference fitness as the upper limit weight, to obtain the optimal inertia weight interval;
[0040] S523, two strategies are adopted, the first strategy is that the inertia weight in the optimal inertia weight interval gradually increases with the increase of the number of iterations; the second strategy is that the inertia weight in the optimal inertia weight interval gradually decreases with the increase of the number of iterations;
[0041] S524, comparing the fitness results obtained under the two strategies, and taking the smaller fitness result as the inertia weight value strategy in the optimal inertia weight interval of the improved Retinanet deep learning model.
[0042] In one embodiment of the present invention, when the target accuracy of the fitness function is not reached in S56, the process returns to S522, and the two minimum reference fitness values are incremented upward to redefine the lower limit weight and the upper limit weight, and to redefine the optimal inertia weight interval and the inertia weight value strategy in the optimal inertia weight interval.
[0043] The present invention also provides a system using the above-mentioned UAV UHV substation inspection path planning method, comprising:
[0044] Simplified facility module, used to create a simplified facility model of the UHV substation environment;
[0045] An image coordinate information module is used to use a drone to sequentially traverse all building facilities in the actual scene based on the simplified facility model and the center point position of the facility in the simplified facility model, and to collect images and record image coordinate information during the traversal process;
[0046] The equipment target detection module is used to perform equipment target detection on the image; if the detection result contains the equipment to be monitored, the corresponding image coordinate information is recorded in the simplified facility model as a path point in path planning;
[0047] A fitness function module, used to create a UAV path planning fitness function in combination with the path points;
[0048] The inspection path planning module is used to use the improved particle swarm algorithm to optimize the UAV inspection path based on the created fitness function to obtain the optimal UAV UHV substation inspection path planning.
[0049] Compared with the prior art, the beneficial effects of the present invention are: the Retinanet algorithm can achieve the accuracy of a two-stage detection algorithm, and is more suitable for target detection in aerial images than other algorithms. The detection performance can be improved by adding auxiliary detection layers to improve the Retinanet algorithm, and by introducing additional auxiliary detection layers, more prediction and detection information can be provided, thereby improving the performance of the algorithm in target detection tasks. These additional detection layers can help the network better capture the details and features of substation facilities and reduce missed detections and false detections.
[0050] Compared with traditional path planning algorithms, intelligent algorithms have a stronger ability to obtain high-quality solutions. For path planning problems, the improved genetic algorithm has improved the generation value and the number of iterations compared to the traditional genetic algorithm. Compared with the classic particle swarm algorithm, the improved particle swarm algorithm has improved the calculation of inertia weight and optimized the particle swarm iteration performance.
[0051] The image set of all locations taken by the unmanned inspection system is defined as the total image set, which effectively calibrates the image sequences collected by different data sources. The optimized weighted least squares filtering algorithm is used to extract large-scale smooth information and small and medium-scale detail information from multiple images at different angles. An effective texture detail enhancement function is used to enhance small and medium-scale details in the image; the detail information and smooth information are fused, and the local optimization method is used to further improve the image quality; the dual attention transformer neural network model is trained to achieve good image enhancement effects.
[0052] Super-resolution algorithms need to process a large amount of data, and have high requirements for computing resources and time. They also require a large number of high-resolution images and corresponding low-resolution images. There is ambiguity when low-resolution pixels are reconstructed into high-resolution pixels, which cannot be solved well by existing models. The dual attention DAT model used in the present invention can dynamically adjust the model architecture, thereby adjusting the required computing resources. The aforementioned preprocessing can expand the data set and assist in model training. The architecture model performs extremely well in reconstructing pixel ambiguity. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] Figure 1 The present invention is a flowchart of a method for planning a UAV UHV substation inspection path according to an embodiment of the present invention.
[0054] Figure 2 This is a flowchart of a method for planning an inspection path according to an embodiment of the present invention.
[0055] Figure 3 This is a dual attention DAT model architecture diagram of an embodiment of the present invention.
[0056] Figure 4 This is a Transformer block structure diagram of an embodiment of the present invention.
[0057] Figure 5 This is a diagram of the spatial gate feedforward network architecture of an embodiment of the present invention.
[0058] Figure 6 This is a block diagram of a UAV UHV substation inspection path planning system according to an embodiment of the present invention. DETAILED DESCRIPTION
[0059] To facilitate those skilled in the art to understand the technical solution of the present invention, the technical solution of the present invention is further described in conjunction with the accompanying drawings.
[0060] The terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this application, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0061] Example 1
[0062] See also Figure 1 and Figure 2 As shown, the present invention discloses a method for planning a UAV UHV substation inspection path, comprising the following steps:
[0063] S10, creates a simplified facility model of the UHV substation environment.
[0064] In one embodiment of the present invention, in the 3D modeling software, the building facilities are simplified into rectangles. The plane coordinates of the rectangle are , the height is ,in , The number of building facilities.
[0065] S20, using a drone to traverse all building facilities in the actual scene in turn based on the simplified facility model and the center point of the facility in the simplified facility model, and during the traversal process, collecting images and recording image coordinate information.
[0066] In one embodiment of the present invention, the drone uses its own position sensor to traverse the building facility coordinates in the simplified facility model in sequence, while collecting images. While collecting images, it records the data of the position sensor and matches the images with the coordinate positions in sequence.
[0067] S30, performing equipment target detection on the image; if the detection result includes the equipment to be monitored, the corresponding image coordinate information is recorded in the simplified facility model as a path point in path planning.
[0068] In one embodiment of the present invention, an improved Retinanet deep learning model is used to perform equipment target detection, images with monitoring equipment are detected in the image, and the location coordinate information of the image is fed back into the simplified facility model.
[0069] In this embodiment, specifically, the improved Retinanet deep learning model adopts the ResNet deep residual network structure to construct a feature pyramid extraction network, and on the basis of the residual network, adds , The auxiliary detection layer is used to provide additional detection to help the network better learn the feature representation of the target and accelerate training convergence. , Five detection feature layers used to generate detection predictions in the on-device object detection network.
[0070] In this embodiment, in order to solve the category imbalance problem that limits the accuracy of a single-stage detector, a FocalLoss function is proposed as a classification loss function, and a dynamic adjustment factor is added to the cross entropy loss function to reduce the loss weight of easy-to-classify samples and increase the loss weight of difficult samples, thereby guiding the optimizer to focus more on the optimization of difficult samples. Specifically, the FocalLoss function is defined as:
[0071] ;
[0072] ;
[0073] In the formula, is the Focal Loss function, is the category label of the image sample, Indicates that the image contains substation equipment. is the probability prediction value considering the sample category label. To improve the prediction value of the Retinanet deep learning model for positive samples, is the linear adjustment factor, is the index adjustment factor.
[0074] More specifically, the output result of the improved Retinanet deep learning model can be subjected to non-maximum suppression to obtain the detection result of the image.
[0075] S40, creating a UAV path planning fitness function in combination with the path points.
[0076] In one embodiment of the present invention, a fitness function for drone inspection path planning is created. The fitness function is the basis for the iterative evolution of the population in the process of planning the drone inspection path by the particle swarm algorithm. paths, each with The fitness function is created by combining the UAV track elevation cost and the path length cost.
[0077] Among them, the drone path length cost is obtained by the following formula:
[0078] ;
[0079] In the formula, the path The coordinates of the path points are passed through express; is the UAV path length cost, where .
[0080] The UAV track elevation cost is obtained by the following formula:
[0081] ;
[0082] In the formula, is the UAV track elevation cost, For the The height of the waypoints, For the The height of the next neighboring node of a path point.
[0083] The UAV path planning fitness function is obtained by the following formula:
[0084] ;
[0085] In the formula, Fitness function for UAV path planning.
[0086] S50, using the improved particle swarm algorithm, according to the created fitness function, the UAV inspection path is optimized to obtain the optimal UAV UHV substation inspection path planning.
[0087] In one embodiment of the present invention, the optimal UAV UHV substation inspection path planning is obtained, including the following steps:
[0088] S51, initialization parameters, including path point coordinates, the number of path points, the population size of the particle swarm, and the number of iterations.
[0089] S52, determining an optimal inertia weight interval of the improved particle swarm algorithm and a value-taking strategy of the inertia weight in the optimal inertia weight interval.
[0090] In one embodiment of the present invention, according to the research in the open literature, the optimal range of the inertia weight interval is [0.4, 0.9]. Therefore, in most applications based on the particle swarm algorithm, the inertia weight interval is [0.4, 0.9] as the upper and lower limits of the inertia weight value. However, for different optimization problems, the range of the inertia weight interval is not fixed, so the improved particle swarm algorithm is used to optimize the inertia weight interval. Specifically including:
[0091] S521, according to the inertia weight reference range disclosed in the classic PSO algorithm, a plurality of inertia weight reference values are obtained with a fixed value as the interval interval; the classic PSO algorithm corresponding to the plurality of inertia weight reference values is operated with a group number of T1 and an iteration number of T2; and the classic PSO algorithm corresponding to each inertia weight reference value is run T3 times and the average value is taken to obtain the reference fitness corresponding to each inertia weight reference value.
[0092] In this embodiment, the inertia weight reference range is [0, 1.4], and the inertia weight reference range is [0, 1.4] with an interval of 0.1, and the values are 0, 0.1, 0.2, 0.3, ..., 1.4, a total of 15 values, and the classic PSO algorithm corresponding to each inertia weight reference value is operated with a population size of 50 and an iteration number of 50. In order to avoid the influence of random numbers in the algorithm, the PSO algorithm corresponding to each inertia weight reference value is run 10 times and the average value is taken to obtain the corresponding fitness .
[0093] S522, compare the sizes of multiple reference fitnesses, take the two smallest reference fitnesses, use the inertia weight reference value corresponding to the small reference fitness as the lower limit weight, and use the inertia weight reference value corresponding to the large reference fitness as the upper limit weight, to obtain the optimal inertia weight interval.
[0094] In this embodiment, the fitness is compared The size of is sorted in ascending order, and the two fitness values with the smallest values are taken as the upper and lower weights, that is, the optimal inertia weight interval .in, For fitness The inertia weight reference value corresponding to the minimum fitness. For fitness The inertia weight reference value corresponding to the second smallest fitness.
[0095] S523, two strategies are adopted. The first strategy is that the inertia weight in the optimal inertia weight interval gradually increases with the increase of the number of iterations; the second strategy is that the inertia weight in the optimal inertia weight interval gradually decreases with the increase of the number of iterations.
[0096] In one embodiment of the present invention, the incremental rule formula of the first strategy is as follows:
[0097] ;
[0098] In the formula, is the increasing law of the first strategy, The classic PSO algorithm Iterations.
[0099] The decreasing law formula of the second strategy is as follows:
[0100] ;
[0101] In the formula, This is the increasing law of the second strategy.
[0102] S524, comparing the fitness results obtained under the two strategies, and taking the smaller fitness result as the inertia weight value strategy in the optimal inertia weight interval of the improved Retinanet deep learning model.
[0103] The replication, crossover and mutation operations of the genetic algorithm are introduced into the operation of the existing IPSO algorithm to generate a new generation, and the IPSO-GA algorithm is obtained. This algorithm has the characteristics of fast convergence speed of the improved particle swarm algorithm and the characteristics of global optimization of the genetic algorithm. The details are as follows:
[0104] S53, using the optimal inertia weight interval, the inertia weight value strategy in the optimal inertia weight interval and the improved particle swarm algorithm to calculate the fitness, sort the fitness of the particle swarm of each iteration, and classify two sub-populations: sub-population and subpopulations ; Define population thresholds, subpopulations For a set greater than the population threshold, the subpopulation is a set smaller than the population threshold.
[0105] In one embodiment of the present invention, the subpopulation Specifically, the sub-population with better particle fitness is Specifically, it refers to the sub-population with poor particle fitness. The population threshold is set based on experience.
[0106] S54, subpopulation Directly perform the replication operation on the subpopulation Perform crossover and mutation operations to generate individuals with better fitness and improve the iterative efficiency of the algorithm.
[0107] In this embodiment, performing replication, crossover and mutation operations on sub-populations is a conventional operation. The particles in the experiment undergo velocity intersection and position intersection, and the formula is as follows:
[0108] ;
[0109] In the formula, and are the velocities of particle i and particle j respectively, and are the X-axis coordinates of particle i and particle j respectively, and are the Y-axis coordinates of particle i and particle j respectively, , and is a random value between [0, 1], To improve the number of iterations of the particle swarm algorithm.
[0110] S55, updating the individual optimal value and the global optimal value of the particle swarm fitness.
[0111] S56: If the target accuracy of the fitness function is not reached, return to S52 to redefine the optimal inertia weight interval and the value strategy of the inertia weight in the optimal inertia weight interval; if the requirements are met, end and obtain the optimal path to traverse each target point with the optimal fitness.
[0112] In one embodiment of the present invention, when the target accuracy of the fitness function is not reached in S56, the process returns to S522, and the two minimum reference fitness values are incremented upward to redefine the lower limit weight and the upper limit weight, and to redefine the optimal inertia weight interval and the inertia weight value strategy in the optimal inertia weight interval. In this embodiment, the lower limit weight and the upper limit weight that are redetermined are the fitness values. The inertia weights corresponding to the third and fourth smallest fitness values.
[0113] Example 2
[0114] In the air-air-ground stereoscopic multimodal data perception technology of the core equipment of the UHV substation, cameras are placed in key positions to monitor the operating status of the equipment in real time and record possible anomalies. Ground robots travel inside the substation along a predetermined trajectory to conduct detailed inspections of the equipment. UAVs equipped with high-definition cameras can monitor the status of the equipment from multiple angles and dimensions. This multi-level and multi-dimensional joint inspection of equipment can promptly discover and handle problems in the operation of UHV substation equipment, ensure the safe and stable operation of the power grid, and improve the reliability of power supply.
[0115] In the actual operation of the unmanned inspection system, there are a series of difficulties in obtaining reliable inspection results, including the single viewing angle of the fixed-position camera, the limited shooting angle and viewing angle of the ground robot, and the easy deviation of the focus of the drone camera. In addition, the light conditions at the locations of key equipment vary greatly, and there is a lot of electromagnetic interference in the UHV substation. These factors may cause the image to have problems such as improper angle, low clarity, and blur at key locations, resulting in poor quality.
[0116] At the same time, the number and types of core equipment in the UHV substation are large, and the redundancy of similar equipment is high, resulting in complex and diverse locations of fault points. Since the inspection cycles of unmanned inspection robots and unmanned inspection drones are relatively fixed, and the angles of fixed-position monitoring cameras are limited, the image data related to key equipment failures is small and the quality cannot be guaranteed. These problems affect the accuracy of unmanned inspections and the reliability of obtaining fault information, and thus cause difficulties in training neural networks related to fault identification. Therefore, after acquiring the equipment image, Example 2 performs clarity preprocessing to improve the reliability of subsequent fault detection, including the following steps:
[0117] S60, obtaining image sets of all positions taken by the unmanned inspection system, and sorting and classifying image sequences taken at different angles at the same position according to the deployment positions of fixed-position cameras, the inspection trajectories of ground inspection robots and inspection drones, and calibrating the data source of the images in each image sequence; and selecting reference images in each image sequence by manual interpretation;
[0118] S70, performing multi-scale decomposition, detail enhancement and image fusion on the image sequence in sequence to obtain a fused image sequence, and taking all the fused image sequences and the original image set as a data set;
[0119] S80, applies the dataset training to obtain the optimal dual attention DAT model to achieve the final image super-resolution operation and obtain clear high-quality images of key parts at all angles.
[0120] See also Figure 1 , Figures 3 to 5 As shown, in one embodiment of the present invention, S60, obtains a set of images of all locations taken by the unmanned inspection system, and sorts and classifies image sequences taken from different angles at the same location according to the deployment positions of fixed-position cameras, the inspection trajectories of ground inspection robots and inspection drones, and calibrates the data source of the images in each image sequence; and selects a reference image in each image sequence through manual interpretation.
[0121] In one embodiment of the present invention, the image set of all positions taken by the unmanned inspection system is defined as the total image set, which is numbered in sequence as Image1, Image1, ..., Imagea', where a' is the total number of images. The image sequences taken at different angles at the same position are sorted and classified according to the fixed-position camera deployment position, the inspection trajectory of the ground inspection robot and the inspection drone, and the image sequences collected by different data sources are effectively calibrated. Each image sequence selects the corresponding reference image by manual interpretation, and the image sequence is a subset of the image set. In this embodiment, the fixed-position camera deployment position, the position image obtained by the ground inspection robot, and the position image obtained by the drone inspection are not improved in this application, and the position image obtained by the inspection of the drone is obtained by executing the method of Example 1.
[0122] See also Figure 1 , Figures 3 to 5 As shown, in one embodiment of the present invention, S70, multi-scale decomposition, detail enhancement and fusion image are performed on the image sequence in sequence to obtain a fused image sequence, and all fused image sequences and the original image set are used as a data set, specifically including the following steps:
[0123] S71, selecting an image sequence.
[0124] S72, using an optimized weighted least squares filtering algorithm to decompose each image in the selected image sequence to obtain a multi-scale decomposed image.
[0125] S73, constructing an effective texture detail enhancement function to enhance detail information of the multi-scale decomposition image, and obtaining a multi-scale decomposition detail enhanced image;
[0126] S74, fuse the details and smoothing information of the multi-scale decomposition detail enhancement image to obtain the multi-scale decomposition initial fusion; improve the image quality of the multi-scale decomposition initial fusion using a local optimization method to obtain an optimized fused image; form a multi-scale decomposition optimized fused image sequence from the optimized fused images corresponding to each image in the image sequence; fuse the multi-scale decomposition optimized fused image sequence with the corresponding image sequence to obtain a fused image sequence.
[0127] S75, executing S72 to S74 on the remaining other image sequences to obtain fused image sequences corresponding to the other image sequences respectively, and taking all the fused image sequences and the original image set as a data set.
[0128] In one embodiment of the present invention, S71, an image sequence is selected. In this embodiment, it is assumed that an image sequence is Image1, Image1, ..., Imageb', where b' is the number of the image sequence. In the following image preprocessing steps, other image sequences are all taken as an example of the image sequence, and reference images are all described as Image1.
[0129] In one embodiment of the present invention, S72, using an optimized weighted least squares filtering algorithm to decompose each image in the selected image sequence to obtain a multi-scale decomposed image, specifically includes the following steps:
[0130] S721, set the optimization objective function of multi-scale decomposition. The formula of the optimization objective function is as follows:
[0131] ;
[0132] In the formula, To optimize the objective function, is the input image, is the input image pixel, is the output image pixel, is the pixel point on the image, is the similarity between the output image and the input image, and are the smoothing weights in the vertical and horizontal directions of the image, is the horizontal grayscale of the image, is the vertical grayscale of the image, It is a parameter that weighs the smoothing weights in both the vertical and horizontal directions. As the value increases, the image becomes smoother. is the grayscale gradient of the image in the horizontal direction, is the vertical grayscale gradient of the image.
[0133] S722, converting the optimization objective function into an objective matrix. The objective matrix is represented by the following formula:
[0134] ;
[0135] In the formula, For the output image, For transposition, and They form diagonal matrices for the differential symbols, and They are and A diagonal matrix composed of .
[0136] S723, transform and optimize the minimum value of the objective function by solving a linear equation. The minimum value of the objective function is optimized by transforming and solving the following linear equations:
[0137] ;
[0138] ;
[0139] In the formula, is the identity matrix, is the ordinary Laplacian matrix.
[0140] S724, using an optimized weighted least squares filtering algorithm to optimize the minimum value of the objective function, performing multi-scale decomposition on the multi-angle image to obtain a multi-scale decomposed image.
[0141] In this embodiment, the weighted least squares filtering algorithm is optimized to perform m decompositions to construct a +1 =0,1,...,m) level multi-scale decomposition results, the input image is filtered to obtain a series of scale-progressive smooth images ,in, Represents the maximum scale smoothed image.
[0142] In one embodiment of the present invention, S73, construct an effective texture detail enhancement function to enhance detail information of the multi-scale decomposition image, and obtain a multi-scale decomposition detail enhanced image.
[0143] In this embodiment, before enhancing the detail information of the multi-scale decomposition image, the multi-scale decomposition image is first subjected to differential and interpolation preprocessing in sequence to obtain a multi-scale decomposition differential interpolation image. The multi-scale decomposition differential interpolation image is then subjected to detail information enhancement using an effective texture detail enhancement function to obtain a multi-scale decomposition detail enhanced image.
[0144] Specifically, the asymptotically smoothed images of different scales in the previous step are subjected to differential processing using the following formula:
[0145] ;
[0146] In the formula, is the result after difference processing, The first pictures, the number of scale decompositions is , is the reference image in the image sequence, and the number of scale decompositions is ,in, =1,2,...,b', and It is represented as the original image without scale decomposition. By operating the image sequence and the reference image for differential processing, the detail differences between the image sequence and the reference image at different decomposition scales are obtained, which is convenient for subsequent analysis and processing of image details.
[0147] The result of difference processing is processed using bilinear interpolation method Processing is performed to obtain a multi-scale decomposition difference interpolation image. In this embodiment, the way of performing difference and interpolation on the image is a conventional operation method.
[0148] In this embodiment, the formula of the effective texture detail enhancement function is as follows:
[0149] ;
[0150] In the formula, is an effective texture detail enhancement function, specifically a hyperbolic tangent function, is a simple scalar multiplication, is a multi-scale decomposition difference interpolation image, is a specific parameter value, which must be a positive number. The larger it is, the greater the enhancement of small details in the image. exp is an exponential function.
[0151] In one embodiment of the present invention, S74, the detail and smoothing information of the multi-scale decomposition detail enhancement image are fused to obtain the multi-scale decomposition initial fusion; the image quality of the multi-scale decomposition initial fusion is improved using a local optimization method to obtain an optimized fused image; the optimized fused images corresponding to each image in the image sequence are combined into a multi-scale decomposition optimized fused image sequence; the multi-scale decomposition optimized fused image sequence is fused with the corresponding image sequence to obtain a fused image sequence.
[0152] In one embodiment of the present invention, before fusing the multi-scale decomposition detail enhancement map, the sharpness of the strong edge of the multi-scale decomposition detail enhancement map is minimized, and then the detail and smoothing information are fused based on the edge enhancement of the multi-scale decomposition detail enhancement map.
[0153] When decomposing the image, it is impossible to completely maintain the edge results. Strong edges in the detail layer may still remain, and there are high-frequency components in the image information. If the strong edges are also magnified to the same extent during the detail enhancement process, the entire image will be oversaturated in the high-frequency area during the subsequent fusion process. In order to suppress the excessive magnification of strong edges, a simple interception is adopted, and the image will lose a lot of information. If it is simply normalized, the gray value distribution of the image will be offset. In this embodiment, the sharpness of the strong edges is minimized by the following function:
[0154] ;
[0155] In the formula, To minimize the strong edge sharpening function, is a constant that controls the degree to which strong edge boundaries are magnified. , which can suppress the strong edges of the image to the greatest extent and retain the normal edge information. is the base of natural logarithms.
[0156] In this embodiment, on the basis of edge enhancement, image information based on multi-scale decomposition is reconstructed, and large-scale smooth information and medium- and small-scale detail information are superimposed and fused. Specifically, the initial fusion of multi-scale decomposition is obtained by the following formula:
[0157] ;
[0158] In the formula, is the initial fused image, is the redundant information of the sequence image, It is the non-redundant information of the sequence image. The image after the initial superposition and fusion may have local noise or local stripes, and further local optimization is required.
[0159] In this embodiment, local optimization is performed using the following formula to obtain an optimized fused image.
[0160] ;
[0161] In the formula, Locally optimize the subwindow for the reference image, Locally optimize subwindows for potentially high-resolution images, Locally optimize the sub-window for the initial estimated super-resolution reconstruction, is the downsampling factor, is the smoothing scale parameter, To optimize the fused image. argmin is a mathematical function used to find the combination of variables that minimizes the function value.
[0162] After local optimization, the detail information in the image is enhanced, and the noise or stripes are greatly reduced. However, there are still a few edge pixel mutations and texture mutations, which need further processing.
[0163] In one embodiment of the present invention, S75, execute S72 to S74 on the remaining other image sequences to obtain fused image sequences corresponding to the other image sequences, and take all fused image sequences and the original image set as a data set.
[0164] In this embodiment, there are many devices in the substation, and frequent failures are not allowed during operation. The failure rate is originally low, and the number of fault point images captured by the unmanned inspection system is even smaller. The data set is small and needs to be expanded. Conventional data set expansion methods, such as rotation, mirror flipping, scaling, translation, changing contrast, etc., may cause image information loss, which is contrary to the idea of obtaining a clear image in the present invention. The present invention performs multi-scale decomposition on the image, performs feature enhancement on the multi-scale decomposed image, and finally fuses the feature-enhanced multi-scale decomposed image to make the image clear. All fused image sequences and the original image set are combined for data expansion as a training set.
[0165] Conventional data set expansion methods are not applicable to the dual attention DAT model for processing super-resolution problems. The image is preprocessed through steps S72 to S75, and the data set required by the model is expanded while optimizing the image, while ensuring the quality of the data set.
[0166] In one embodiment of the present invention, S80, the optimal dual attention DAT model is obtained by applying the data set training to achieve the final image super-resolution operation, and a high-quality image with clear key parts at each angle is obtained. Specifically, it includes first constructing a dual attention DAT model, using the data set for training, and using the gradient descent algorithm to iterate the model parameters to obtain the optimal dual attention DAT model; and then using the optimal dual attention DAT model to achieve the final image super-resolution operation, and obtain a high-quality image with clear key parts at each angle.
[0167] In one embodiment of the present invention, the dual attention DAT model includes: a shallow feature extraction module, a deep feature extraction module and an image reconstruction module. The shallow feature extraction module is a single convolutional network, which is used to extract shallow features from low-resolution images. Then, the deep feature extraction module extracts deep features based on the shallow features, and the image reconstruction module upsamples the deep features through a pixel rearrangement method to reconstruct a high-resolution image.
[0168] In one embodiment of the present invention, the deep feature extraction module is mainly composed of a plurality of residual groups stacked together, each residual group includes two pairs of Transformer blocks, each pair of Transformer blocks includes a spatial window self-attention module, a channel optimization self-attention module and a first spatial gate feedforward network and a second spatial gate feedforward network with the same structure. The first spatial gate feedforward network is located between the output end of the spatial window self-attention module and the input end of the channel optimization self-attention module, and the second spatial gate feedforward network is located at the output end of the channel optimization self-attention module.
[0169] Continuous Transformer blocks alternately apply spatial window self-attention modules, channel optimization self-attention modules, first spatial gate feedforward networks, and second spatial gate feedforward networks to achieve intra-block feature aggregation between spatial dimensions and channel dimensions. Among them, the first spatial gate feedforward network and the second spatial gate feedforward network can effectively reduce the number of parameters while improving model performance.
[0170] In one embodiment of the present invention, the spatial window self-attention module includes:
[0171] S811, taking the shallow features processed by the shallow feature extraction module as input, and generating a spatial query matrix, a spatial key matrix and a spatial value matrix through linear transformation.
[0172] In this embodiment, for a given image sequence X, the spatial query matrix, the spatial key matrix, and the spatial value matrix are expressed in the following form:
[0173] ;
[0174] In the formula, is the spatial query matrix, is the spatial key matrix, is a space-valued matrix, , and are the linear transformation matrices of the omitted bias of each spatial self-attention matrix.
[0175] S812, dividing the spatial query matrix, the spatial key matrix and the spatial value matrix into multiple non-overlapping windows to form multiple window attention matrices.
[0176] In this embodiment, each non-overlapping window is expanded, and each window contains pixels, the expanded linear transformation matrix is expressed as , and , that is, multiple window attention matrices.
[0177] S813, divide each window attention matrix by columns to form multiple spatial low-dimensional attention matrices.
[0178] In this embodiment, each window attention matrix is divided into h spatial low-dimensional attention matrices by column, namely , and .
[0179] S814, obtain the output of each spatial low-dimensional attention matrix.
[0180] In this embodiment, The output of the spatial low-dimensional attention matrix is:
[0181] ;
[0182] In the formula, For the The output of the spatial low-dimensional attention matrix, softmax is the activation function, is the relative position encoding, For the A low-dimensional spatial query matrix, For the A low-dimensional space key matrix, For the A low-dimensional space-valued matrix, is the number of columns of each spatial low-dimensional attention matrix.
[0183] S815, concatenate the outputs of all spatial low-dimensional attention matrices to obtain spatial attention features.
[0184] In this embodiment, the spatial attention feature is obtained by the following formula:
[0185] ;
[0186] In the formula, is the spatial attention feature, and concat is the concatenation function.
[0187] S816, obtaining the output of the spatial window self-attention module according to the spatial attention feature combined with the linear transformation matrix of the fused spatial self-attention matrix.
[0188] In this embodiment, the output of the spatial window self-attention module is obtained by the following formula:
[0189] ;
[0190] In the formula, is the output of the spatial window self-attention module, is the linear transformation matrix that fuses the spatial self-attention matrix, which can be understood as the linear transformation matrix that fuses all features.
[0191] In one embodiment of the present invention, the channel optimized self-attention module includes:
[0192] S821, taking the output of the spatial window self-attention module and the feature matrix output by the first spatial gate feedforward network as input, and generating a channel query matrix, a channel key matrix and a channel value matrix through linear transformation.
[0193] In this embodiment, for a given input , the channel query matrix, channel key matrix and channel value matrix are expressed in the following form:
[0194] ;
[0195] In the formula, is the channel query matrix, is the channel key matrix and the channel value matrix, for, , and are the linear transformation matrices of the omitted bias of the self-attention matrix of each channel.
[0196] S822, the query matrix, the channel key matrix and the channel value matrix are then divided into multiple channels to form a multi-channel attention matrix.
[0197] In the embodiment, the image channels are generally RGB channels, namely, R channel, G channel and B channel, and the linear transformation matrix is expressed as follows according to the channel expansion: , and , that is, the multi-channel attention matrix.
[0198] S823, divide each channel attention matrix by columns to form multiple channel low-dimensional attention matrices.
[0199] In this embodiment, each channel attention matrix is similarly divided into h channel low-dimensional attention matrices by column, that is, , and .
[0200] S824, concatenate the outputs of the low-dimensional attention matrices of all channels to obtain channel attention features.
[0201] In this embodiment, The output of the low-dimensional attention matrix of each channel is obtained by the following formula:
[0202] ;
[0203] In the formula, For the The output of the channel low-dimensional attention matrix, For the A low-dimensional channel query matrix, For the A low-dimensional channel bond matrix, For the A low-dimensional matrix of channel values, is the temperature parameter for learning, which is used to adjust the inner product before the softmax function. For the channel.
[0204] The channel attention feature is obtained by the following formula:
[0205] ;
[0206] In the formula, is the channel attention feature.
[0207] S825, obtain the output of the channel window self-attention module according to the channel attention feature combined with the linear transformation matrix of the fused channel self-attention matrix.
[0208] In this embodiment, the output of the channel window self-attention module is obtained by the following formula:
[0209] ;
[0210] In the formula, is the output of the channel window self-attention module, It is the linear transformation matrix of the fused channel self-attention matrix, which can be understood as the linear transformation matrix of all features.
[0211] In one embodiment of the present invention, the first spatial gate feedforward network and the second spatial gate feedforward network are two identical spatial gate feedforward networks, and the first and second are defined separately only for the convenience of distinguishing. In order to avoid the specification being concise, only the first spatial gate feedforward network is used for explanation below. The architecture of the first spatial gate feedforward network includes a feedforward network and a spatial gate network. The feedforward network includes a nonlinear activation layer and two fully connected layers, and the two fully connected layers are respectively located at the head and tail of the first spatial gate feedforward network. The spatial gate network is located between the nonlinear activation layer and the fully connected layer at the output end of the network. The spatial gate network mainly includes deep convolutional layers and element multiplications set in sequence. Among them, the spatial gate network also includes a split layer, which is located before the deep convolutional layer, and is used to split the input matrix first to accelerate the operation of the convolutional layer.
[0212] In this embodiment, the first spatial gate feedforward network can be expressed in the following form:
[0213] ;
[0214] ;
[0215] In the formula, For the spatial gate feedforward network, the input The functional relationship of is the intermediate variable of the spatial gate feedforward network, and Two variables in the domain of the intermediate variable, and They are two linear mapping matrices, which are selected based on experience during actual training. is the GELU function, is the parameter of the depthwise convolution, Compared with FFN, the first spatial gate feedforward network and the second spatial gate feedforward network can capture nonlinear spatial information and simplify the channel redundancy of the fully connected layer while maintaining computational efficiency.
[0216] In one embodiment of the present invention, the final image super-resolution operation is achieved through the optimal dual attention DAT model to obtain high-quality images with clear key parts at all angles. In this embodiment, the gradient descent algorithm is used to update the model parameters for iteration as a conventional method, which will not be described here. For model training, the balance between super-resolution performance and training time can be achieved by dynamically adjusting the number of residual groups.
[0217] See also Figures 1 to 6 As shown, the present invention also provides a system for the inspection path planning method of a UHV substation using a drone, comprising a simplified facility module 10, an image coordinate information module 20, an equipment target detection module 30, a fitness function module 50 and an inspection path planning module 60. The simplified facility module 10 is used to create a simplified facility model of the UHV substation environment, the image coordinate information module 20 is used to use a drone to sequentially traverse all building facilities in the actual scene based on the simplified facility model and the center point position of the facility in the simplified facility model, and in the traversal process, collect images and record image coordinate information, the equipment target detection module 30 is used to perform equipment target detection on the image; if the detection result contains the equipment to be monitored, the corresponding image coordinate information is recorded in the simplified facility model as a path point in the path planning, the fitness function module 50 is used to create a UHV path planning fitness function in combination with the path point, and the inspection path planning module 60 is used to use an improved particle swarm algorithm to optimize the UHV inspection path according to the created fitness function to obtain the optimal UHV substation inspection path planning of the drone.
[0218] It is obvious to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential features of the present invention. Therefore, the embodiments should be regarded as exemplary and non-limiting from any point of view, and the scope of the present invention is defined by the appended claims rather than the above description, and it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention, and any reference numerals in the claims should not be regarded as limiting the claims involved.
[0219] The above-described embodiments merely represent implementation methods of the invention. The protection scope of the present invention is not limited to the above-described embodiments. For those skilled in the art, several modifications and improvements may be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention.
Claims
1. A UAV UHV substation inspection path planning method, It is characterized in that The following steps are involved: S10, creating a simplified facility model of the UHV substation environment; S20, using a drone to sequentially traverse all building facilities in the actual scene based on the simplified facility model and the center point of the facility in the simplified facility model, and during the traversal process, collecting images and recording image coordinate information; S30, performing device target detection on the image; if the detection result includes the equipment to be monitored, the corresponding image coordinate information is recorded in the simplified facility model as a path point in path planning; S40, creating a UAV path planning fitness function based on the path points; S50, using the improved particle swarm algorithm, according to the created fitness function, optimizing the inspection path of the UAV, and obtaining the optimal inspection path planning of the UAV UHV substation; Obtaining the optimal UAV UHV substation inspection path planning includes the following steps: S51, initialization parameters, including path point coordinates, the number of path points, the population size of the particle swarm, and the number of iterations; S52, determining an optimal inertia weight interval of the improved particle swarm algorithm and a value strategy of the inertia weight in the optimal inertia weight interval; S53, using the optimal inertia weight interval, the inertia weight value strategy in the optimal inertia weight interval and the improved particle swarm algorithm to calculate the fitness, sort the fitness of the particle swarm of each iteration, and classify two sub-populations: sub-population and subpopulations ; Define population thresholds, subpopulations For a set greater than the population threshold, the subpopulation is a set smaller than the population threshold; S54, subpopulation Directly perform the replication operation on the subpopulation Perform crossover and mutation operations; S55, updating the individual optimal value and global optimal value of the particle swarm fitness; S56, if the target accuracy of the fitness function is not reached, return to S52, re-determine the optimal inertia weight interval and the value strategy of the inertia weight in the optimal inertia weight interval; if the requirements are met, end, and obtain the optimal path to complete the traversal of each target point with the optimal fitness; If the target accuracy of the fitness function is not reached in S56, the process returns to S522, and the two minimum reference fitness values are incremented upward, the lower limit weight and the upper limit weight are redetermined, and the optimal inertia weight interval and the inertia weight value strategy in the optimal inertia weight interval are redetermined; Determining the optimal inertia weight interval of the improved particle swarm algorithm and the value strategy of the inertia weight in the optimal inertia weight interval includes the following steps: S521, according to the inertia weight reference range disclosed in the classic PSO algorithm, a plurality of inertia weight reference values are obtained with a fixed value as the interval interval; the classic PSO algorithm corresponding to the plurality of inertia weight reference values is operated with a group number of T1 and an iteration number of T2; and the classic PSO algorithm corresponding to each inertia weight reference value is run T3 times and the average value is taken to obtain the reference fitness corresponding to each inertia weight reference value; S522, compare the sizes of multiple reference fitnesses, take the two smallest reference fitnesses, use the inertia weight reference value corresponding to the smaller reference fitness as the lower limit weight, and use the inertia weight reference value corresponding to the larger reference fitness as the upper limit weight, to obtain the optimal inertia weight interval; S523, two strategies are adopted, the first strategy is that the inertia weight in the optimal inertia weight interval gradually increases with the increase of the number of iterations; the second strategy is that the inertia weight in the optimal inertia weight interval gradually decreases with the increase of the number of iterations; S524, comparing the fitness results obtained under the two strategies, and taking the smaller fitness result as the inertia weight value strategy in the optimal inertia weight interval of the improved Retinanet deep learning model.
2. The method for planning inspection paths of UAV UHV substations according to claim 1, It is characterized in that The simplified facility model is to simplify the building facility into a rectangle.
3. The method for planning inspection path of a UAV UHV substation according to claim 1, It is characterized in that An improved Retinanet deep learning model is used for device target detection; the improved Retinanet deep learning model uses the ResNet deep residual network structure to build a feature pyramid extraction network, and on the basis of the residual network, adds , Auxiliary detection layer, construction Five detection feature layers used to generate detection predictions in the on-device object detection network.
4. The method for planning inspection path of a UAV UHV substation according to claim 3, It is characterized in that The Focal Loss function is used as the classification loss function to optimize the improved Retinanet deep learning model; wherein the Focal Loss function is defined as: ; ; In the formula, is the Focal Loss function, is the category label of the image sample, Indicates that the image contains substation equipment. is the probability prediction value considering the sample category label. To improve the prediction value of the Retinanet deep learning model for positive samples, is the linear adjustment factor, is the index adjustment factor.
5. The method for planning inspection path of a UAV UHV substation according to claim 1, It is characterized in that Creating a UAV path planning fitness function includes: assuming that there is paths, each with The fitness function is created by combining the UAV track elevation cost and the path length cost.
6. The method for planning inspection path of a UAV UHV substation according to claim 5, It is characterized in that The drone path length cost is obtained by the following formula: ; In the formula, the path The coordinates of the path points are passed through express; is the UAV path length cost, where ; The UAV track elevation cost is obtained by the following formula: ; In the formula, is the UAV track elevation cost, For the The height of the waypoints, For the The height of the next neighboring node of the path point; The UAV path planning fitness function is obtained by the following formula: ; In the formula, Fitness function for UAV path planning.
7. A system using the method for planning a UAV UHV substation inspection path according to any one of claims 1 to 6, It is characterized in that include: Simplified facility module, used to create a simplified facility model of the UHV substation environment; An image coordinate information module is used to use a drone to sequentially traverse all building facilities in the actual scene based on the simplified facility model and the center point position of the facility in the simplified facility model, and to collect images and record image coordinate information during the traversal process; The equipment target detection module is used to perform equipment target detection on the image; if the detection result contains the equipment to be monitored, the corresponding image coordinate information is recorded in the simplified facility model as a path point in path planning; A fitness function module, used to create a UAV path planning fitness function in combination with the path points; The inspection path planning module is used to use the improved particle swarm algorithm to optimize the UAV inspection path based on the created fitness function to obtain the optimal UAV UHV substation inspection path planning.
