Iron tower power line position detection method and system based on two-stage deep learning

Through the tower power line position detection method based on two-stage deep learning, the improved YOLOv8 algorithm is used to build a target detection network, which solves the problems of low efficiency and high cost of traditional power line detection methods, and realizes efficient and accurate power line position detection and hidden danger identification, ensuring the safe operation of the power system.

CN119863614AInactive Publication Date: 2025-04-22CHINA TOWER CO LTD XIANGTAN BRANCH
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510345230.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-24
Publication Date
2025-04-22
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Traditional power line detection methods are inefficient and costly, and it is difficult to accurately detect power line locations and hidden dangers in complex environments.

Method used

The tower power line position detection method based on two-stage deep learning is adopted, and the tower camera is used to obtain images. The target detection network is built through the improved YOLOv8 algorithm, and the power line position is trained and optimized to achieve efficient and accurate detection of power line positions and reliable identification of hidden dangers.

Benefits of technology

It realizes fully automatic round patrol inspection, improves detection efficiency and accuracy, reduces labor costs and safety risks, can adapt to tower power line inspection needs in different environments, and ensures the safe operation of the power system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119863614A_ABST
    Figure CN119863614A_ABST
Patent Text Reader

Abstract

The invention discloses an iron tower power line position detection method and system based on two-stage deep learning, and the method comprises the steps: obtaining a plurality of power line images through an iron tower camera, and carrying out the preprocessing, and obtaining a power line data set; constructing a target detection network based on an improved YOLOv8 algorithm, and training and optimizing the target detection network by using the power line data set to obtain a first detection network and a second detection network; performing capture detection on the detection area through a preset cruise route by using the first detection network to obtain a plurality of wire targets; and obtaining coordinate data of the plurality of wire targets, and performing hidden danger detection by using a second detection network according to the coordinate data to obtain a hidden danger detection result. The invention relates to the technical field of power line detection, and solves the technical problems that a traditional power line detection mode is low in efficiency and high in cost, and an existing detection technology is difficult to accurately detect the position of a power line and hidden dangers in a complex environment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of power line detection and relates to deep learning technology, specifically to a tower power line position detection method and system based on two-stage deep learning. Background Art

[0002] With the continuous development of the power system, the safe operation of transmission lines is crucial to ensuring national energy security. However, transmission lines are exposed to complex natural environments for a long time and are easily affected by factors such as bad weather and natural disasters, resulting in frequent accidents such as power line leakage, fire, icing, and breakage. These accidents will not only cause huge economic losses, but also trigger a vicious cycle, further damaging power lines, optical cables, towers and other facilities. Therefore, regular inspection and monitoring of transmission lines is particularly important.

[0003] Traditional inspection methods for power transmission lines mainly include close-range manual observation and inspection with binoculars, infrared thermal imagers and other tools. However, with the increase in the number of power and communication towers, these traditional methods have exposed the problems of low efficiency and high cost in remote mountainous and forested areas. In complex terrains such as mountains and swamps, as well as disaster conditions such as rain, snow, ice, and earthquakes, it is difficult for inspection personnel to reach the site and find damaged power lines and damaged tower equipment. There are also personnel safety risks and high costs. The inspection method based on drones also has many problems. Power lines have a low pixel ratio and a slender shape in drone aerial images. It is difficult to automatically extract them from complex backgrounds and difficult to distinguish them from other objects. Moreover, power lines are often blocked by buildings and vegetation, which increases the difficulty of detection. In addition, drones have poor adaptability to severe weather and are difficult to work normally in heavy snow and stormy weather. The control level of operators is extremely high. When drones approach power lines and towers, the complex electromagnetic environment will interfere with their operations and affect safety. In addition, drones have limited endurance and short flight time, which cannot meet the needs of large-scale inspections. Summary of the invention

[0004] The present invention aims to solve at least one of the technical problems existing in the prior art; to this end, the present invention proposes a tower power line position detection method and system based on two-stage deep learning, which is used to solve the technical problems that traditional power line detection methods are inefficient and costly, and that existing detection technologies are difficult to accurately detect power line positions and hidden dangers in complex environments.

[0005] To achieve the above objectives, a first aspect of the present invention provides a tower power line location detection method based on two-stage deep learning, comprising: S1, using the tower camera to obtain several power line images and pre-process them to obtain a power line dataset; S2, constructing a target detection network based on the improved YOLOv8 algorithm, and using the power line dataset to train and optimize the target detection network to obtain a first detection network and a second detection network; S3, using the first detection network to capture and detect the detection area through a preset cruise route to obtain a number of wire-type targets; S4, obtaining coordinate data of a plurality of electric wire targets, and performing hidden danger detection using a second detection network according to the coordinate data to obtain hidden danger detection results.

[0006] Furthermore, the process of acquiring the power line data set includes: S1-1, using a tower camera to obtain a plurality of power line images with magnifications of 3 and 40, respectively, and using a marking tool to mark the positions of the power lines to obtain a first data set and a second data set; S1-2, performing data enhancement on the first data set and the second data set to obtain an expanded data set; S1-3, compress the expanded data set using an image compression tool to obtain a power line data set.

[0007] By creating a first data set with a magnification of 3 and a second data set with a magnification of 40, and performing manual annotation and data enhancement, such as rotation and translation, brightness adjustment and other operations, the images are also compressed; the optimized data set makes the shape and texture of the power lines more suitable for network training, enhances the model's ability to recognize power lines in different environments, and improves detection accuracy.

[0008] Furthermore, the improved YOLOv8 algorithm includes: Extract the output feature map of the first C2f module in the YOLOv8 algorithm to obtain the first feature; Extract the output feature map of the upsampling stage of the Neck part of the YOLOv8 algorithm to obtain the second feature; The second feature is upsampled and concat-ed with the first feature, and then input into the C2f module to obtain the third feature; The third feature is input into the CBL module and then concat-operated with the second feature to obtain the fourth feature; wherein the CBL module includes a convolution layer, a batch normalization layer and an activation function; After the fourth feature is input into the C2f module, it is input into the downsampling stage of the Neck part in the YOLOv8 algorithm to obtain the output of the original Neck part; The third feature and the output of the original Neck part are input into the Head part of the YOLOv8 algorithm to obtain the improved YOLOv8 algorithm framework.

[0009] In order to solve the problem that YOLOv8 has poor detection effect on thin power lines, a small target detection layer is added to fuse the shallow feature map and the deep feature map. By adding a C2f layer, upsampling and multiple Concat operations, the network pays more attention to small target detection, and improves the detection accuracy of thin power lines in the initial detection stage.

[0010] Furthermore, the training and optimization of the target detection network using the power line dataset includes: S2-1, dividing the power line data set into a training set, a validation set and a test set according to a preset ratio; S2-2, constructing based on the improved YOLOv8 algorithm and setting training parameters of the target detection network; wherein the target detection network includes a first target detection network and a second target detection network, and the input of the first target detection network is the first data set, and the input of the second target detection network is the second data set; S2-3, input the training set and the validation set into the target detection network for iterative training and update optimization to obtain the target detection network with the highest validation accuracy; S2-4, input the test set to the target detection network with the highest verification accuracy, obtain the test accuracy, and determine whether the test accuracy is greater than the preset accuracy threshold; if yes, output the target detection network with the highest verification accuracy to obtain the first detection network and the second detection network; if no, adjust the training parameters of the target detection network and jump to S2-3; wherein the output of the first detection network is a wire target, and the output categories of the second detection network include power line targets and optical cable targets.

[0011] Furthermore, the method of using the first detection network to capture and detect the detection area through a preset cruise route includes: S3-1, define the detection area of ​​the tower camera, set the initial detection position and the initial pitch angle, initial horizontal angle and focal length of the tower camera; S3-2, the tower camera starts from the initial position, gradually increases the horizontal angle according to the preset horizontal angle value and captures the image, and uses the first detection network to detect the captured image until it returns to the initial position, thereby obtaining a round of patrol results; S3-3, increasing the pitch angle once according to the preset pitch angle value, and marking the current position of the tower camera as the initial position; S3-4, determine whether the pitch angle is equal to the preset value; if yes, complete the capture detection and obtain a number of wire targets; if no, jump to S3-2.

[0012] Further, the performing hidden danger detection using the second detection network according to the coordinate data includes: S4-1, obtaining the center coordinates according to the detection frame coordinate data of the current wire target, and converting the detection frame coordinate data and the center coordinates into elevation angles and horizontal angles to obtain the detection frame position and the target center position; S4-2, control the tower camera to focus on the center of the target, and zoom in to the maximum magnification to obtain the current frame image; S4-3, using the second detection network to detect the current frame image and obtain a detection result; S4-4, determine whether the detection result includes power lines; if yes, issue a hidden danger warning based on the detection result and jump to S4-5; if no, jump to S4-5; S4-5, controlling the tower camera to move toward the extension direction of the power line to obtain an updated current frame image; S4-6, obtain the current pitch angle and current horizontal angle of the tower camera, get the camera position, and determine whether the camera position is within the detection frame position; if yes, jump to S4-3; if not, traverse the next power line target, get the current wire type target, and jump to S4-1.

[0013] Furthermore, the method for acquiring the extension direction of the power line includes: S4-51, extracting the mask information of the power line from the detection result, and obtaining the power line pixel coordinate set V={(xi,yi)}; wherein (xi,yi) represents the pixel coordinate; S4-52, averaging the horizontal coordinates and vertical coordinates in the power line pixel coordinate set V to obtain the center point coordinates (Cx, Cy); S4-53, calculate the centralized data set V′ according to the formula V′={(xi-Cx,yi-Cy)}; S4-54, calculate the covariance matrix S of the power line pixel coordinates according to the covariance formula, and perform eigenvalue decomposition on the covariance matrix to obtain an eigenvalue set λ and an eigenvector set μ; S4-55, sort the elements in the eigenvalue set λ from large to small, and get λ sotred , and sotred The corresponding eigenvector μ sorted The first eigenvector μ in principal Marked as the principal axis direction, the second eigenvector μ secondary Marked as secondary axis direction; S4-56, according to the main axis direction μ principal The extension direction of the power lines is calculated.

[0014] It should be noted that the center point coordinates (Cx, Cy) will be stored in the preset coordinate bin. When performing routine inspections later, the preset coordinates can be used to control the camera for rapid inspection.

[0015] Further, according to the main axis direction μ principal The extension direction of the power lines is calculated, including: According to the formula θ deg =atctan2(μ principal [1],μ principal [0]) × 180° / π to calculate the spindle tilt angle θ deg ; Determine the spindle tilt angle θ deg Is it a positive value? If it is, then θ deg Marked as the extension direction of the electric line; if not, according to the formula θ deg =θ deg +180° to get the extension direction of the electric line θ deg .

[0016] Furthermore, the hidden danger warning according to the detection result includes: S4-41, calculating the IoU value between the detection frames of the power line target and the optical cable target in the detection result, and judging whether the IoU value is greater than a preset IoU threshold; if yes, sending a warning message of the hidden danger of cable entanglement; if no, jumping to S4-42; S4-42, according to formula P secondary =V′×μ secondary Calculate the projection P of the pixel coordinates of the power line in the direction of the secondary axis secondary , and calculate P secondary The difference between the maximum and minimum values ​​of the secondary axis is obtained by secondary ; S4-43, according to the formula d = (l / w secondary )×L to calculate the actual cable distance d; where l represents the actual width of the power line, and L represents the pixel distance between the center point of the power line and the center point of the optical cable. The actual width of the power line can be obtained from the product manual, and the pixel distance can be calculated from the coordinates of the center points of the power line and the optical cable. S4-44, when the actual cable distance d is less than the preset distance threshold, a hidden danger alarm message of the cable distance being too close is sent.

[0017] A second aspect of the present invention provides a tower power line position detection system based on two-stage deep learning, comprising: Data processing module: used to obtain a number of power line images using the tower camera and perform preprocessing to obtain a power line data set; Model training module: used to build a target detection network based on the improved YOLOv8 algorithm, train and optimize the target detection network using the power line dataset, and obtain the first detection network and the second detection network; Initial detection module: used for the first detection network to capture and detect the detection area through a preset cruise route to obtain several wire-type targets; Hidden danger detection module: used to obtain the coordinate data of several electric wire targets, and use the second detection network to perform hidden danger detection according to the coordinate data to obtain hidden danger detection results.

[0018] Compared with the prior art, the present invention has the following beneficial effects: The present invention adopts a two-stage detection strategy, combined with preset cruise and zoom positioning, to realize the fully automatic patrol of the camera; wherein, the conventional detection stage is based on the initial detection results, and the power line target initially detected is located, amplified and detected, and the coordinates are stored during the first operation, and the subsequent detection can be directly performed according to the preset points, which can greatly save the cruise time; and through the preset cruise route and zoom positioning method, the camera can realize fully automatic patrol, thereby improving the overall detection efficiency; In order to solve the problem that YOLOv8 has poor detection effect on thin wires, a small target detection layer is added to fuse the shallow feature map and the deep feature map and integrate the information. By adding a C2f layer, upsampling and multiple Concat operations, the network pays more attention to small target detection, which improves the detection accuracy of thin power lines. During the hidden danger detection stage, the IoU value of the power line and the optical cable detection frame is calculated to determine whether the cables are entangled, and the actual distance between the power line and the optical cable is calculated to determine whether the cables are too close, providing strong protection for the safe operation of the power system; at the same time, during the detection process, the camera is controlled to move in the direction of the power line extension according to the detection results, and new images are continuously acquired for detection to ensure the continuity and accuracy of the detection and avoid missing hidden dangers. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0020] Figure 1 A schematic diagram of a flow chart of a tower power line location detection method based on two-stage deep learning provided by the present invention; Figure 2 A schematic flow chart of a hidden danger detection module in a tower power line location detection system based on two-stage deep learning provided by the present invention; Figure 3 A schematic diagram of a process for providing early warning of hidden dangers based on detection results provided by the present invention; Figure 4A schematic diagram of the improved YOLOv8 algorithm framework provided by the present invention; Figure 5 This is a schematic diagram of hidden danger detection results provided by the present invention. DETAILED DESCRIPTION

[0021] The technical solution of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0022] See also Figure 1 - Figure 5 The first aspect of the present invention provides a method for detecting the position of a power line of a tower based on two-stage deep learning, comprising: S1, using the tower camera to obtain several power line images and pre-process them to obtain a power line dataset; S2, constructing a target detection network based on the improved YOLOv8 algorithm, and using the power line dataset to train and optimize the target detection network to obtain a first detection network and a second detection network; S3, using the first detection network to capture and detect the detection area through a preset cruise route to obtain a number of wire-type targets; S4, obtaining coordinate data of a plurality of electric wire targets, and performing hidden danger detection using a second detection network according to the coordinate data to obtain hidden danger detection results.

[0023] Based on the above technical process, the present invention realizes efficient and accurate detection of power line locations and reliable identification of hidden dangers. The tower camera is used to acquire and process power line images to construct a data set, which provides data support that fits the actual scene for model training, making the detection model more suitable for power line detection tasks in complex environments around towers. The target detection network is constructed based on the improved YOLOv8 algorithm, which significantly improves the detection accuracy while ensuring the detection speed; during the detection process, the preset cruise route is combined with the capture detection of the first detection network to quickly and comprehensively cover the detection area and accurately locate power line targets; then the second detection network is used to detect hidden dangers based on the target coordinates, and various hidden dangers are accurately judged; Compared with the traditional power line detection method, the present invention gets rid of the dependence on manual inspection and drone detection, avoids the impact of bad weather and complex electromagnetic environment on the detection work, and reduces labor costs and safety risks. At the same time, the method has good scalability and versatility, can adapt to the needs of tower power line detection in different regions and environments, and provides a strong technical guarantee for the construction of smart grids and the safe and stable operation of power systems. It has broad application prospects and significant economic and social benefits.

[0024] In this embodiment, the tower power line location detection method based on two-stage deep learning specifically includes the following steps: S1, using the tower camera to obtain several power line images and pre-process them to obtain a power line dataset; In order to achieve efficient inspection of power lines and accurate hidden danger identification, a high-quality power line data set is constructed in this embodiment. The data set includes a first data set with a magnification of 3 and a second data set with a magnification of 40. Among them, the first data set is conducive to finding wires with a very small pixel ratio, and also avoids the problem of reduced inspection efficiency due to a small field of view; while the second data set is conducive to clearly detecting whether the wire is a high-voltage power line or an optical cable, thereby effectively carrying out hidden danger identification work; In this embodiment, the first data set and the second data set both use the tower visual platform interface to control the camera above the tower to capture the original image, and obtain 1000 original images with a resolution of 2560×1440. After completing the image acquisition, the Labelme tool is used to annotate the image and generate a .json file label, which is then converted into a .txt format label suitable for YOLO; In one implementation, in order to enhance the generalization ability of the model so that it can better adapt to the unique environment around each tower, the dataset is expanded in batches, including: First, we simulated the camera's constant movement and rotation during the detection process, and rotated each original image by 5 random angles, translated it by 1 random size, and flipped it once; considering the large changes in light between cloudy and sunny days, and the fact that some power lines are hidden under the shade of trees, we adjusted the brightness of each original image once and once. After expansion, the training set and validation set of each data set have a total of 9,000 images, and the expanded label files are generated simultaneously; each data set is divided into 800 training sets, 100 validation sets, and 100 test sets in a ratio of 8:1:1; The size of the expanded image dataset reaches 20G. In order to speed up the data processing and training process of YOLOv8, the Image module of the PIL library in Python is used to compress the image quality. After compression, the image is reduced from about 6MB to about 600KB. The compressed image dataset becomes 4.7G, and the final power line dataset is obtained, as shown in Figure 3 shown.

[0025] S2, constructing a target detection network based on the improved YOLOv8 algorithm, and using the power line dataset to train and optimize the target detection network to obtain a first detection network and a second detection network; In this embodiment, in order to achieve efficient and accurate detection of power lines, a target detection network based on the improved YOLOv8 algorithm is constructed to achieve initial detection and conventional detection. In the initial detection stage, since the power line target is large and has obvious features, the SG-YOLOv8 model with the highest segmentation accuracy in YOLOv8 is used as the first detection network to segment wire objects; in the conventional detection stage, the improved YOLOv8 model is directly used as the second detection network to distinguish power lines from optical cables.

[0026] Since the YOLO series has a large downsampling multiple and the sample size of small objects is small, the feature information of small objects will be diffused or even disappear in the deep feature map. Therefore, YOLOv8 has difficulty in learning the feature information of thin wires, and the detection effect of thin wires that are only magnified 3 times in the initial stage is relatively poor.

[0027] Therefore, in this embodiment, the YOLOv8 algorithm is improved as follows: Extract the output feature map of the first C2f module in the YOLOv8 algorithm to obtain the first feature; Extract the output feature map of the upsampling stage of the Neck part of the YOLOv8 algorithm to obtain the second feature; The second feature is upsampled and concat-ed with the first feature, and then input into the C2f module to obtain the third feature; The third feature is input into the CBL module and then concat-operated with the second feature to obtain the fourth feature; After the fourth feature is input into the C2f module, it is input into the downsampling stage of the Neck part in the YOLOv8 algorithm to obtain the output of the original Neck part; The third feature and the output of the original Neck part are input into the Head part of the YOLOv8 algorithm to obtain the improved YOLOv8 algorithm framework.

[0028] Specifically, the input image of size 640×640×3 is passed through two simple CBL modules (conv-bn-silu) and one C2f layer to complete channel expansion, feature map reduction, and extract shallow feature maps with rich small target features. At this time, the output size is 128×160×160; in the Neck part, the shallow feature map undergoes a series of convolutions, pooling and the second Concat operation, and the output size becomes 768×80×80. Figure 3 As shown in the red dotted box, a new C2f layer is added to enrich the deep feature information, and then upsampling is performed to make the output size 768×160×160. At this time, the shallow feature map and the deep feature map are concat for the third time to obtain a feature map of size 896×160×160; then the C2f layer is added to fuse the high-level semantic features with the low-level detail features. After further enriching the features, the Head part is entered to classify and locate the feature information. Finally, the feature map is reduced and the Concat operation is performed after the added CBL module, returning to the detection process of the original network.

[0029] In this embodiment, the target detection network is trained and optimized using the power line dataset, specifically including: S2-1, dividing the power line data set into a training set, a validation set and a test set according to a preset ratio; S2-2, constructing a target detection network based on the improved YOLOv8 algorithm, and setting training parameters of the target detection network; wherein the target detection network includes a first target detection network and a second target detection network, and the input of the first target detection network is the first data set, and the input of the second target detection network is the second data set; S2-3, input the training set and the validation set into the target detection network for iterative training and update optimization to obtain the target detection network with the highest validation accuracy; S2-4, input the test set to the target detection network with the highest verification accuracy, obtain the test accuracy, and determine whether the test accuracy is greater than the preset accuracy threshold; if yes, output the target detection network with the highest verification accuracy to obtain the first detection network and the second detection network; if no, adjust the training parameters of the target detection network and jump to S2-3; wherein the output of the first detection network is a wire target, that is, a rough detection is performed on the image to obtain a large category of wires, and the output categories of the second detection network include power line targets and optical cable targets.

[0030] S3, using the first detection network to capture and detect the detection area through a preset cruise route to obtain a number of wire-type targets; In actual applications, in order to meet the tower company's requirements for efficient completion of each routine inspection and avoid taking up other business time, the long-term time cost must be fully considered when designing the conventional inspection framework. If the fixed-point inspection method is adopted, it will take less time, but the inspection range is fixed; if the cruise inspection method is adopted, although the coverage is wider, it will greatly increase the inspection time and seriously affect the development of other businesses. Therefore, in order to optimize the inspection process and improve the inspection efficiency, the power line location detection and hidden danger identification process is divided into two stages: initial inspection and routine inspection.

[0031] Among them, the initial detection stage requires a long period of full-range cruising to detect all wire-type targets within the field of view, and only one initialization is required on the system; while during the first operation of the routine detection stage, all wire-type objects detected in the initial stage need to be analyzed one by one, located and magnified before detection and judgment, and the detected power line coordinates are stored at the same time. In the subsequent routine business monitoring, it is only necessary to control the camera to directly perform the second stage of detection according to the preset point instructions, so as to save a lot of cruising time and speed up the detection speed.

[0032] In this embodiment, the algorithm pseudo code of the two-stage detection process can be shown as follows: Algorithm 1: Fast-Twostage Detection Framework Input: Camera ID Output: Power line center point location set Locations[] Initialization parameters: Initialize the pitch angle PA = -90°, the horizontal angle HA = 0°, the magnification m←[3,40], the threshold Y cycle: For PA in [-90°,-80°,-70°,-60°,-50°,-40°] do For HA in [0°,60°,120°,180°,240°,300°] do camera ← (PA,HA), m[0] Use the first detection network to get the current frame output wires If wires ≠ Null then For wire in wires do Calculate the wire center position W and the detection box position (x1, y1, x2, y2) camera ← (W), m[1] Calculate the camera position (x_camera, y_camera) If (x_camera < x1) or (x_camera > x2) or (y_camera < y1) or (y_camera> y2) then Use the second detection network to get the current frame output powerline and opticalfibre While powerline ≠ Null do Calculate the powerline center position P and extension direction angle D Calculate the IoU value of powerline and optical fiber detection box If IoU > Y then Output power line and optical cable entanglement alarm End If Locations[] ← P, camera ← (P + D), m[1] Update the camera position C(x_camera,y_camera) End While End If End For End If HA ← HA + 60° End For PA ← PA + 10° End For The parameter supplementary description is as follows: camera: camera ID; Locations[]: power line center point location set; PA: initial pitch angle; HA: horizontal angle, initial value is 0°; m: magnification; wires: wire set detected in the initial stage; wire: single wire detected in the initial stage; W: wire center point coordinates; powerline: power line detected in the regular stage; opticalfibre: optical cable detected in the regular stage.

[0033] In this embodiment, the first detection network is used to perform snapshot detection on the detection area through a preset cruise route, which is the initial detection stage in the two stages. As shown in Algorithm 1, the initial detection stage starts with a rotation capture from a pitch angle of -90°, a horizontal angle of 0°, and a focal length of 3, and the first detection network SG-YOLOv8 is used for detection. A capture detection is performed every time the horizontal angle increases by 60°, and the capture and detection are performed 6 times after one rotation to complete the first round of cruise; then the pitch angle is increased by 10° each time to make the front and rear cruise fields of view border each other, and then one rotation is performed for detection to complete the subsequent 5 rounds of cruise. A total of 36 capture detections are performed in the initial detection stage, covering the space around the tower to detect all wire-like objects; The first run of the conventional detection phase starts from line 8. First, the center coordinates are obtained based on the detection frame coordinate data of the current wire target, and the detection frame coordinate data and the center coordinates are converted into elevation angles and horizontal angles to obtain the detection frame position and the target center position; one of the wire targets detected in the initial detection phase is located and enlarged, and the center coordinates of the detection frame of the target are calculated and converted into elevation angles and horizontal angles W. Then the camera is controlled to focus on point W and enlarged to a maximum magnification of 40. At this time, the wire features are clear. The second detection network YOLOv8 is used to detect and classify to obtain the detection results. When a power line is detected, the coordinates P of the center point of the power line and the angle D of its extension direction are calculated, and P is stored in the preset coordinate bin. Then the IoU threshold between the detection frame of the power line and the optical cable is calculated. When the threshold is greater than the set value, an alarm for hidden dangers of cable entanglement is issued. Then the camera is controlled to move toward the direction of the power line, and the current frame is updated when the horizontal angle or pitch angle is 10° apart. The camera position is calculated based on the current pitch angle and the current horizontal angle of the tower camera. When the camera position is within the detection frame, calculation and judgment are started again; otherwise, the next power line target is traversed and the cycle is restarted.

[0034] In one implementation, when controlling the camera to move toward the extension direction of the power line, the extension direction of the power line can be obtained by the following steps: S4-51, extracting the mask information of the power line from the detection result of the second detection network, and obtaining a power line pixel coordinate set V={(xi,yi)}; wherein (xi,yi) represents the pixel coordinate; S4-52, averaging the horizontal coordinates and vertical coordinates in the power line pixel coordinate set V to obtain the center point coordinates P (Cx, Cy); S4-53, calculate the centralized data set V′ according to the formula V′={(xi-Cx,yi-Cy)}; S4-54, calculate the covariance matrix S of the power line pixel coordinates according to the covariance formula, and perform eigenvalue decomposition on the covariance matrix to obtain an eigenvalue set λ and an eigenvector set μ; S4-55, sort the elements in the eigenvalue set λ from large to small, and get λ sotred , and sotred The corresponding eigenvector μ sorted The first eigenvector μ in principal Marked as the principal axis direction, the second eigenvector μ secondary Marked as secondary axis direction; S4-56, according to the formula θ deg =atctan2(μ principal [1],μ principal [0]) × 180° / π to calculate the spindle tilt angle θ deg ; Determine the spindle tilt angle θ deg Is it a positive value? If it is, then θ deg Marked as the extension direction of the electric line; if not, according to the formula θ deg =θ deg +180° to get the extension direction of the electric line θ deg ; In this embodiment, in addition to the potential safety hazard warning for cable entanglement, a warning for cables being too close is also included. The specific steps are: According to the formula P secondary =V′×μ secondary Calculate the projection P of the pixel coordinates of the power line in the direction of the secondary axis secondary , then calculate P secondary The difference between the maximum and minimum values ​​of the secondary axis is obtained by secondary ; According to the formula d = (l / w secondary )×L to calculate the actual cable distance d; where l represents the actual width of the power line, L represents the pixel distance between the center point of the power line and the center point of the optical cable, and the actual width of the power line can be obtained from the product manual, and the pixel distance can be calculated from the center point coordinates of the power line (Cx, Cy) and the center point coordinates of the optical cable, and the center point coordinates of the optical cable can be obtained by the same method as S4-51 to S4-52; When the actual cable distance d is less than the preset distance threshold, a hidden danger alarm message of the cable distance being too close is sent.

[0035] The second aspect of the present invention provides a tower power line position detection system based on two-stage deep learning, including: Data processing module: used to obtain a number of power line images using the tower camera and perform preprocessing to obtain a power line data set; Model training module: used to build a target detection network based on the improved YOLOv8 algorithm, train and optimize the target detection network using the power line dataset, and obtain the first detection network and the second detection network; Initial detection module: used for the first detection network to capture and detect the detection area through a preset cruise route to obtain several wire-type targets; Hidden danger detection module: used to obtain the coordinate data of several electric wire targets, and use the second detection network to perform hidden danger detection according to the coordinate data to obtain hidden danger detection results.

[0036] Part of the data in the above formula is calculated by removing the dimension and taking its numerical value. The formula is a formula closest to the actual situation obtained by software simulation of a large amount of collected data; the preset parameters and preset thresholds in the formula are set by technical personnel in this field according to actual conditions or obtained through simulation of a large amount of data.

[0037] Working principle of the present invention: The present invention uses the tower camera to collect power line images to construct a data set, providing strong data support for model training. At the same time, the YOLOv8 algorithm is improved, and the detection ability of small targets such as thin power lines is significantly enhanced by fusing feature maps at different levels; In terms of detection strategy, the present invention adopts a two-stage detection method. In the initial detection stage, a full-range cruise method is used to comprehensively detect all wire targets within the field of view; in the conventional detection stage, based on the results of the initial detection, accurate detection is carried out and hidden dangers are judged; In the hidden danger detection link, the present invention determines whether the cables are entangled by calculating the IoU value of the detection frame; at the same time, it determines whether the cable distance is too close by calculating the actual distance of the cables, thereby realizing early warning of potential hidden dangers and effectively ensuring the safe operation of the power lines.

[0038] The above embodiments are only used to illustrate the technical method of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical method of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical method of the present invention.

Claims

1. A tower power line location detection method based on two-stage deep learning, characterized in that: include: S1, using the tower camera to obtain several power line images and pre-process them to obtain a power line dataset; S2, constructing a target detection network based on the improved YOLOv8 algorithm, and using the power line dataset to train and optimize the target detection network to obtain a first detection network and a second detection network; S3, using the first detection network to capture and detect the detection area through a preset cruise route to obtain a number of wire-type targets; S4, obtaining coordinate data of a plurality of electric wire targets, and performing hidden danger detection using a second detection network according to the coordinate data to obtain hidden danger detection results.

2. The method for detecting the position of power lines of a tower based on two-stage deep learning according to claim 1, characterized in that: The improved YOLOv8 algorithm includes: Extract the output feature map of the first C2f module in the YOLOv8 algorithm to obtain the first feature; Extract the output feature map of the upsampling stage of the Neck part of the YOLOv8 algorithm to obtain the second feature; The second feature is upsampled and concat-ed with the first feature, and then input into the C2f module to obtain the third feature; The third feature is input into the CBL module and then concat-operated with the second feature to obtain the fourth feature; wherein the CBL module includes a convolution layer, a batch normalization layer and an activation function; After the fourth feature is input into the C2f module, it is input into the downsampling stage of the Neck part in the YOLOv8 algorithm to obtain the output of the original Neck part; The third feature and the output of the original Neck part are input into the Head part of the YOLOv8 algorithm to obtain the improved YOLOv8 algorithm framework.

3. The method for detecting the position of power lines of a tower based on two-stage deep learning according to claim 1, characterized in that: The method of using the first detection network to capture and detect the detection area through a preset cruise route includes: S3-1, define the detection area of ​​the tower camera, set the initial detection position and the initial pitch angle, initial horizontal angle and focal length of the tower camera; S3-2, the tower camera starts from the initial position, gradually increases the horizontal angle according to the preset horizontal angle value and captures the image, and uses the first detection network to detect the captured image until it returns to the initial position, thereby obtaining a round of patrol results; S3-3, increasing the pitch angle once according to the preset pitch angle value, and marking the current position of the tower camera as the initial position; S3-4, determine whether the pitch angle is equal to the preset value; if yes, complete the capture detection and obtain a number of wire targets; if no, jump to S3-2.

4. The method for detecting the position of power lines of a tower based on two-stage deep learning according to claim 1, characterized in that: The method of performing hidden danger detection using the second detection network according to the coordinate data includes: S4-1, obtaining the center coordinates according to the detection frame coordinate data of the current wire target, and converting the detection frame coordinate data and the center coordinates into elevation angles and horizontal angles to obtain the detection frame position and the target center position; S4-2, control the tower camera to focus on the center of the target, and zoom in to the maximum magnification to obtain the current frame image; S4-3, using the second detection network to detect the current frame image and obtain a detection result; S4-4, determine whether the detection result includes power lines; if yes, issue a hidden danger warning based on the detection result and jump to S4-5; if no, jump to S4-5; S4-5, controlling the tower camera to move toward the extension direction of the power line to obtain an updated current frame image; S4-6, obtain the current pitch angle and current horizontal angle of the tower camera, get the camera position, and determine whether the camera position is within the detection frame position; if yes, jump to S4-3; if not, traverse the next power line target, get the current wire type target, and jump to S4-1.

5. The method for detecting the position of power lines of a tower based on two-stage deep learning according to claim 4 is characterized in that: The method for obtaining the extension direction of the power line includes: S4-51, extracting the mask information of the power line from the detection result, and obtaining the power line pixel coordinate set V={(xi,yi)}; wherein (xi,yi) represents the pixel coordinate; S4-52, averaging the horizontal coordinates and vertical coordinates in the power line pixel coordinate set V to obtain the center point coordinates (Cx, Cy); S4-53, calculate the centralized data set V′ according to the formula V′={(xi-Cx,yi-Cy)}; S4-54, calculate the covariance matrix S of the power line pixel coordinates according to the covariance formula, and perform eigenvalue decomposition on the covariance matrix to obtain an eigenvalue set λ and an eigenvector set μ; S4-55, sort the elements in the eigenvalue set λ from large to small, and get λ sotred , and sotred The corresponding eigenvector μ sorted The first eigenvector μ in principal Marked as the principal axis direction, the second eigenvector μ secondary Marked as secondary axis direction; S4-56, according to the main axis direction μ principal The extension direction of the power lines is calculated.

6. The method for detecting the position of power lines of a tower based on two-stage deep learning according to claim 5, characterized in that: According to the main axis direction μ principal The extension direction of the power lines is calculated, including: According to the formula θ deg =atctan2(μ principal [1],μ principal [0]) × 180° / π to calculate the spindle tilt angle θ deg ; Determine the spindle tilt angle θ deg Is it a positive value? If it is, then θ deg Marked as the extension direction of the electric line; if not, according to the formula θ deg =θ deg +180° to get the extension direction of the electric line θ deg .

7. The method for detecting the position of power lines of a tower based on two-stage deep learning according to claim 4, characterized in that: The hidden danger warning according to the detection results includes: S4-41, calculating the IoU value between the detection frames of the power line target and the optical cable target in the detection result, and judging whether the IoU value is greater than a preset IoU threshold; if yes, sending a warning message of the hidden danger of cable entanglement; if no, jumping to S4-42; S4-42, according to formula P secondary =V′×μ secondary Calculate the projection P of the pixel coordinates of the power line in the direction of the secondary axis secondary , and calculate P secondary The difference between the maximum and minimum values ​​of the secondary axis is obtained by secondary ; S4-43, according to the formula d = (l / w secondary )×L to calculate the actual cable distance d; where l represents the actual width of the power line, and L represents the pixel distance between the center point of the power line and the center point of the optical cable; S4-44, when the actual cable distance d is less than the preset distance threshold, a hidden danger alarm message of the cable distance being too close is sent.

8. The method for detecting the position of power lines of a tower based on two-stage deep learning according to claim 1, characterized in that: The process of acquiring the power line data set includes: S1-1, using a tower camera to obtain a plurality of power line images with magnifications of 3 and 40 respectively, and using a marking tool to mark the positions of the power lines to obtain a first data set and a second data set; S1-2, performing data enhancement on the first data set and the second data set to obtain an expanded data set; S1-3, compress the expanded data set using an image compression tool to obtain a power line data set.

9. The method for detecting the position of power lines of a tower based on two-stage deep learning according to claim 1, characterized in that: The method of training and optimizing the target detection network using the power line dataset includes: S2-1, dividing the power line data set into a training set, a validation set and a test set according to a preset ratio; S2-2, constructing based on the improved YOLOv8 algorithm and setting training parameters of the target detection network; wherein the target detection network includes a first target detection network and a second target detection network, and the input of the first target detection network is the first data set, and the input of the second target detection network is the second data set; S2-3, input the training set and the validation set into the target detection network for iterative training and update optimization to obtain the target detection network with the highest validation accuracy; S2-4, input the test set to the target detection network with the highest verification accuracy, obtain the test accuracy, and determine whether the test accuracy is greater than the preset accuracy threshold; if yes, output the target detection network with the highest verification accuracy to obtain the first detection network and the second detection network; if no, adjust the training parameters of the target detection network and jump to S2-3; wherein the output of the first detection network is a wire target, and the output categories of the second detection network include power line targets and optical cable targets.

10. A tower power line position detection system based on two-stage deep learning, applied to a tower power line position detection method based on two-stage deep learning as described in any one of claims 1 to 9, characterized in that: include: Data processing module: used to obtain a number of power line images using the tower camera and perform preprocessing to obtain a power line data set; Model training module: used to build a target detection network based on the improved YOLOv8 algorithm, train and optimize the target detection network using the power line dataset, and obtain the first detection network and the second detection network; Initial detection module: used for the first detection network to capture and detect the detection area through a preset cruise route to obtain several wire-type targets; Hidden danger detection module: used to obtain the coordinate data of several electric wire targets, and use the second detection network to perform hidden danger detection according to the coordinate data to obtain hidden danger detection results.

Citation Information

Patent Citations

  • Visual recognition and positioning method for robot intelligent capture application

    CN108171748A

  • Unmanned aerial vehicle holder progressive target focusing method based on intelligent visual control

    CN113902698A

  • Multi-target detection and positioning method for tea based on YoloV5

    CN115272791A

  • Rolov8-based steel surface defect detection method and system

    CN118247286A

  • Small target detection method for images acquired by unmanned aerial vehicle based on improved YOLOv8 algorithm

    CN118628939A