Wire detection method, apparatus, and device

By acquiring feature maps of wires at different resolutions and using a wire detection network model for multi-layer abstraction and image enhancement, the problem of low accuracy in traditional wire detection methods is solved, achieving higher accuracy in wire detection and ensuring the flight safety of UAVs.

CN116664517BActive Publication Date: 2026-07-03AUTEL ROBOTICS CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
AUTEL ROBOTICS CO LTD
Filing Date
2023-05-31
Publication Date
2026-07-03

Smart Images

  • Figure CN116664517B_ABST
    Figure CN116664517B_ABST
Patent Text Reader

Abstract

The application discloses a power line detection method, device and equipment. The method comprises the following steps: acquiring a power line image, preprocessing the power line image, acquiring at least two power line feature maps with different resolutions according to the preprocessed power line image, inputting the at least two power line feature maps with different resolutions into a preset power line detection network model, and outputting a detection result of the power line according to the power line detection network model. The application detects the power line based on the power line feature maps with different resolutions and the preset power line detection network model, so that the power line can be accurately detected.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, and device for detecting electrical wires. Background Technology

[0002] Drones are widely used in modern life. When they fly autonomously, especially in low-altitude power line inspection missions, accurate detection of power lines is crucial for ensuring drone flight safety. Currently, power line detection is based on traditional Convolutional Neural Networks (CNNs), such as Fully Convolutional Networks (FCNs), SegNet (Semantic Segmentation), and the DeepLab series. However, current methods have relatively small receptive fields, resulting in low segmentation accuracy and consequently, inaccurate power line detection. Summary of the Invention

[0003] The main technical problem addressed by the embodiments of this application is how to improve the accuracy of wire detection.

[0004] To address the aforementioned technical problems, one technical solution adopted in this application is to provide a wire detection method, comprising: acquiring a wire image; preprocessing the wire image and acquiring at least two wire feature maps of different resolutions based on the preprocessed wire image; inputting the at least two wire feature maps of different resolutions into a preset wire detection network model, and outputting the wire detection result based on the wire detection network model.

[0005] Optionally, the step of inputting the at least two wire feature maps of different resolutions into a preset wire detection network model and outputting the wire detection result according to the wire detection network model includes: performing multi-layer abstraction and feature extraction based on the at least two wire feature maps of different resolutions to obtain a first feature vector corresponding to each wire feature map; performing image enhancement processing based on the at least two wire feature maps of different resolutions to obtain a second feature vector corresponding to each wire feature map; performing feature fusion processing on the first feature vector and the second feature vector to obtain wire image detection results of different resolutions; and merging the wire image detection results of different resolutions to output an image including the original resolution of the wire.

[0006] Optionally, obtaining at least two wire feature maps of different resolutions based on the preprocessed wire image includes: extracting local features from the preprocessed wire image to obtain local feature maps; downsampling based on the local feature maps; and normalizing the downsampled local feature maps to output multiple wire feature maps of different resolutions.

[0007] Optionally, the step of performing multi-level abstraction and feature extraction based on the at least two wire feature maps of different resolutions to obtain a first feature vector corresponding to each wire feature map includes: performing downsampling and upsampling operations at preset levels on the at least two wire feature maps of different resolutions respectively through a feature extraction module to obtain a representation vector corresponding to each wire feature map; and performing multi-level abstraction and feature extraction on the representation vectors corresponding to the at least two wire feature maps of different resolutions through a Transformer block to obtain a first feature vector corresponding to each wire feature map.

[0008] Optionally, the step of performing image enhancement processing based on the at least two wire feature maps of different resolutions to obtain a second feature vector corresponding to each wire feature map includes: performing image enhancement processing on the at least two wire feature maps of different resolutions through at least two wire perception modules to obtain a second feature vector corresponding to the at least two wire feature maps of different resolutions; and extracting semantic information from the low-resolution wire feature map among the at least two wire feature maps of different resolutions through a semantic information extraction module to obtain a second feature vector corresponding to the low-resolution wire feature map.

[0009] Optionally, the step of performing image enhancement processing on the at least two wire feature maps of different resolutions using at least two wire sensing modules specifically includes: extracting wire features from the wire feature maps using two-way asymmetric dilated convolution of the wire sensing modules, wherein each of the at least two wire sensing modules includes the two-way asymmetric dilated convolution, and the number of the at least two wire sensing modules corresponds to the number of categories at the resolution.

[0010] Optionally, the method further includes: obtaining the wire detection network model, wherein obtaining the wire detection network model includes: constructing an initial model of the wire detection network; sampling wire images and preprocessing the wire images to obtain preprocessed sample data; inputting the sample data into the initial model of the wire detection network and outputting the corresponding wire recognition result; constructing a loss function based on the wire recognition result; optimizing and training the initial model of the wire detection network according to the loss function to obtain the model parameters corresponding to minimizing the loss function, and determining the final wire detection network model according to the model parameters.

[0011] Optionally, the initial model for constructing the wire detection network includes:

[0012] Multiple feature extraction modules are designed based on a U-shaped neural network. The multiple feature extraction modules are configured as a symmetrical encoder and decoder. The encoder is used to process at least two wire feature maps with different resolutions.

[0013] The U-shaped neural network is used to insert a channel adjustment module, which is based on the symmetrical design of the U-shaped neural network and is used to adjust the size and number of channels of the feature maps processed by the encoder and the decoder.

[0014] The U-shaped neural network inserts a wire sensing module and a semantic information extraction module. The number of the wire sensing module and the semantic information extraction module corresponds to the number of the encoder and the number of the decoder. The wire sensing module is used to perform image enhancement processing on the at least two wire feature maps of different resolutions to obtain a second feature vector corresponding to each wire feature map. The semantic information extraction module is used to extract semantic information from the low-resolution wire feature map among the at least two wire feature maps of different resolutions.

[0015] Based on the U-shaped neural network, a Transformer block is inserted. The output results of the encoder and the channel adjustment module are both input into the Transformer block. The Transformer block is used to perform multi-layer abstraction and feature extraction based on the at least two wire feature maps of different resolutions to obtain a first feature vector corresponding to each wire feature map. The decoder is used to perform feature fusion processing on the first feature vector and the second feature vector to obtain wire image detection results of different resolutions.

[0016] Optionally, constructing the loss function based on the identification result of the wire includes: constructing a loss function corresponding to the following formula, wherein the formula is:

[0017] L=α*CE weight=1:5 +β*phiLoss+γ*DiceLoss weight=1:5 ;

[0018] Where L represents the loss function, α, β, and γ are weight coefficients, CE refers to the cross-entropy loss function, phiLoss refers to the loss function used for object detection tasks, DiceLoss refers to the loss function used for image segmentation tasks, and weight = 1:5 refers to the weight ratio.

[0019] To solve the above-mentioned technical problems, another technical solution adopted in this application is: to provide a wire detection device, including: a wire image acquisition module for acquiring a wire image; an image preprocessing module for preprocessing the wire image and acquiring at least two wire feature maps of different resolutions based on the preprocessed wire image; and a wire detection module for inputting the at least two wire feature maps of different resolutions into a preset wire detection network model and outputting the wire detection result based on the wire detection network model.

[0020] To solve the above-mentioned technical problems, another technical solution adopted in this application is: to provide a wire detection device, including: at least one processor; a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method described above.

[0021] Unlike related technologies, the wire detection method, apparatus, and device provided in this application acquire a wire image, preprocess the wire image, and obtain at least two wire feature maps of different resolutions based on the preprocessed wire image. These at least two wire feature maps of different resolutions are then input into a preset wire detection network model, and the detection result of the wire is output based on the wire detection network model. This embodiment of the application can detect wires based on wire feature maps of different resolutions and a preset wire detection network model, thereby accurately detecting wires. Attached Figure Description

[0022] One or more embodiments are illustrated by way of example with reference to the accompanying drawings. These illustrations do not constitute a limitation on the embodiments. Elements having the same reference numerals in the drawings are denoted as similar elements. Unless otherwise stated, the figures in the drawings are not to be limited by scale.

[0023] Figure 1 This is a schematic diagram of one application environment of the wire detection method provided in the embodiments of this application;

[0024] Figure 2 This is a structural block diagram of an unmanned aerial vehicle provided in an embodiment of this application;

[0025] Figure 3 This is a flowchart of a wire detection method provided in an embodiment of this application;

[0026] Figure 4 This is a flowchart of the method for obtaining the wire detection network model provided in an embodiment of this application;

[0027] Figure 5This is a schematic diagram of the structure of a wire detection network model provided in an embodiment of this application;

[0028] Figure 6 This is a schematic diagram of the structure of a Double_U Block provided in an embodiment of this application;

[0029] Figure 7 These are feature heatmaps of various stages of the shallow layer of the wire image network provided in this application embodiment;

[0030] Figure 8 This is a schematic diagram of the structure of a PowerLine Aware Block provided in an embodiment of this application;

[0031] Figure 9 This is a schematic diagram of the structure of a Shared SCSE Block provided in an embodiment of this application;

[0032] Figure 10 This is a flowchart of a method for outputting wire detection results based on the wire detection network model provided in this application embodiment;

[0033] Figure 11 This is a schematic diagram of the structure of a wire detection device provided in an embodiment of this application;

[0034] Figure 12 This is a schematic diagram of the hardware structure of the wire testing device 400 that performs the wire testing method according to an embodiment of this application. Detailed Implementation

[0035] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0036] It should be noted that, unless otherwise specified, the various features in the embodiments of this application can be combined with each other, all of which are within the protection scope of this application. Furthermore, although functional modules are divided in the device schematic diagram and a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device schematic diagram or the order in the flowchart.

[0037] Unless otherwise defined, all technical and scientific terms used in this specification have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the scope of this application.

[0038] Figure 1This is one application environment for the wire detection method provided in the embodiments of this application. For example... Figure 1 As shown, the application environment includes an unmanned aerial vehicle (UAV) 100 and a power line detection device 200. The UAV 100 and the power line detection device 200 are communicatively connected to exchange information.

[0039] It is worth noting that the wire detection device 200 can be a standalone device that communicates with the unmanned aerial vehicle 100, or it can be an integrated device within the unmanned aerial vehicle 100, forming a single structure with the unmanned aerial vehicle 100.

[0040] The unmanned aerial vehicle 100 can be any type of powered flying vehicle or other mobile device, including but not limited to multi-rotor unmanned aerial vehicles, such as quadcopter unmanned aerial vehicles, fixed-wing aircraft, and helicopters. In this embodiment, a quadcopter unmanned aerial vehicle is used as an example.

[0041] The unmanned aerial vehicle 100 can be equipped with appropriate size or power according to actual needs, thereby providing sufficient payload capacity, flight speed, flight range, etc.

[0042] For example, such as Figure 2 As shown, the unmanned aerial vehicle 100 has at least one power system for providing flight propulsion and a flight control system for controlling the flight of the unmanned aerial vehicle 100. The flight control system is communicatively connected to the power system.

[0043] The propulsion system may include an electronic speed controller (ESC), one or more propellers, and one or more motors corresponding to the propellers. The motors are connected between the ESC and the propellers, and the motors and propellers are mounted on the arm of the corresponding UAV 100.

[0044] The electronic speed controller receives drive signals generated by the flight control system and provides drive current to the motor according to the drive signals to control the motor speed. The motor drives the propeller to rotate, thereby providing power for the flight of the unmanned aerial vehicle 100, which enables the unmanned aerial vehicle 100 to achieve one or more degrees of freedom of movement.

[0045] In some embodiments, the unmanned aerial vehicle 100 can rotate about one or more rotation axes. For example, the aforementioned rotation axes may include a roll axis, a translation axis, and a pitch axis. It is understood that the motor can be a DC motor or an AC motor. Additionally, the motor can be a brushless motor or a brushed motor.

[0046] The flight control system may include a flight controller and a sensing system. The sensing system is used to measure the attitude information of the unmanned aerial vehicle 100, that is, the position and state information of the unmanned aerial vehicle 100 in space, such as three-dimensional position, three-dimensional angle, three-dimensional velocity, three-dimensional acceleration, and three-dimensional angular velocity. The sensing system may include at least one of the following sensors: a gyroscope, an electronic compass, an inertial measurement unit (IMU), a visual sensor, a global navigation satellite system (GPS), and a barometer. For example, the GPS may be the Global Positioning System.

[0047] The flight controller is used to control the flight of the unmanned aerial vehicle 100. For example, it can control the flight of the unmanned aerial vehicle 100 based on attitude information measured by a sensor system. It is understood that the flight controller can control the flight of the unmanned aerial vehicle 100 according to pre-programmed instructions, or it can control the flight of the unmanned aerial vehicle 100 in response to one or more control instructions from other devices.

[0048] In addition, one or more functional modules can be added to the unmanned aerial vehicle 100 to enable it to perform more functions, such as aerial photography and mapping.

[0049] For example, in some embodiments, the unmanned aerial vehicle 100 includes at least one wire detection device 200 for detecting wires. In another embodiment, the unmanned aerial vehicle 100 includes at least one image acquisition device and one communication device for acquiring images. The image acquisition device and the communication device can each be integrated into a component of the unmanned aerial vehicle 100. The image acquisition device acquires wire images, and the communication device sends the wire images to the wire detection device 200, so that the wire detection device 200 preprocesses the wire images and obtains at least two wire feature maps of different resolutions based on the preprocessed wire images. The at least two wire feature maps of different resolutions are input into a preset wire detection network model, and the wire detection result is output based on the wire detection network model.

[0050] In some embodiments, the unmanned aerial vehicle (UAV) 100 may further include a storage space for storing the wire images, so that the images can be retrieved later when needed. The storage space can be internal or external to the UAV 100. For example, the UAV 100 may have an external SD card interface, into which a memory device such as an SD card can be inserted to store the acquired wire images. Furthermore, several consecutive frames of wire images can form a video or recording. In some instances, the video or recording formed by several consecutive frames of wire images can also be stored in the internal or external storage space of the UAV 100.

[0051] The wire testing device 200 can be any type of user interaction device. The wire testing device 200 can be equipped with one or more different user interaction devices to collect user commands or display or provide feedback to the user, such as the testing results of the wires.

[0052] These interactive devices include, but are not limited to, buttons, displays, touchscreens, speakers, and remote control joysticks. For example, the wire detection device 200 may be equipped with a touchscreen display, through which it receives touch commands from the user and displays information to the user, such as displaying an image of a wire.

[0053] In some embodiments, the wire detection device 200 can be a smart terminal device, such as a mobile phone, tablet computer, personal computer, server, etc.

[0054] In some embodiments, the wire detection device 200 may be an image processing module, integrated into the unmanned aerial vehicle (UAV) 100 as a component. This image processing module may be a chip or similar device with computing power.

[0055] It is understood that the naming of the various components of the unmanned aerial vehicle 100 described above is for identification purposes only and should not be construed as a limitation on the embodiments of the present invention.

[0056] Furthermore, the wire detection method provided in this application embodiment can be further extended to other suitable application environments, and is not limited to... Figure 1 The application environment shown. Figure 1 The unmanned aerial vehicle 100 and the power line detection device 200 are set up independently. In actual application, the application environment can also include more unmanned aerial vehicles 100. The power line detection device 200 can detect power lines from power line images collected by multiple unmanned aerial vehicles 100.

[0057] The wire testing method of this application will be explained and described below with reference to specific embodiments.

[0058] Please see Figure 3, Figure 3 This is a flowchart of a wire detection method provided in an embodiment of this application. The method includes:

[0059] S11. Obtain the image of the wire.

[0060] The term "power line image" refers to image data captured and collected from power transmission lines using vehicles such as drones and aircraft equipped with cameras and other devices. These images can include transmission lines, substations, and overhead lines. They can be used for monitoring, inspection, and maintenance of power systems. For example, by acquiring these images, power line information can be obtained, allowing for the detection of damage, corrosion, loosening, and other issues on transmission lines, as well as the detection of tilting and displacement of utility poles. Furthermore, they can be used for drone navigation path planning. For instance, by acquiring these images, the drone can identify the power lines within the image, thus avoiding contact with them during flight and ensuring safe operation.

[0061] By analyzing and processing power line images, it is possible to inspect and identify transmission lines, quickly locate fault points, and improve the operational efficiency and reliability of power systems. Simultaneously, power line images can also be used in power system planning and design, helping decision-makers better formulate construction and maintenance plans. Furthermore, in the field of drones, obtaining accurate power line images can improve the safety of drone flights.

[0062] In this embodiment of the application, the main focus is on accurately detecting the wires in the acquired wire image to obtain wire data within a certain area.

[0063] S12. Preprocess the wire image and obtain at least two wire feature maps with different resolutions based on the preprocessed wire image.

[0064] Preprocessing operations for power line images include, but are not limited to, image denoising, image correction, image stitching, target detection, and image segmentation. Aerial images are affected by factors such as the shooting environment and weather, resulting in noise and interference. Image denoising improves image quality and clarity. Differences in shooting angle and altitude during aerial image acquisition necessitate image correction to align the images horizontally for subsequent analysis and processing. Overlapping areas may exist in aerial image acquisition; image stitching techniques can be used to combine multiple images into a single, complete image for further analysis and processing. Power line images may contain multiple utility poles and power lines; target detection extracts these targets for analysis and processing. For complex power line images, image segmentation is required to divide the image into multiple regions for better analysis and processing.

[0065] Specifically, at least two wire feature maps of different resolutions can be extracted from the preprocessed wire image using the Pooling Stem Block module in the neural network, such as... Figure 5 As shown, the Pooling Stem Block is used to extract feature information from the input data. It includes a convolutional layer, a pooling layer, and a normalization layer. The convolutional layer processes the preprocessed wire image of the input through convolutional operations to extract local features of the image. Then, the pooling layer downsamples the feature map output by the convolutional layer to reduce the size and number of parameters of the feature map while retaining important feature information. Finally, the normalization layer normalizes the feature map output by the pooling layer so that the feature values ​​are within a certain range, which is beneficial for subsequent processing.

[0066] S13. Input the at least two wire feature maps of different resolutions into a preset wire detection network model, and output the wire detection result according to the wire detection network model.

[0067] After obtaining at least two feature maps of the wire at different resolutions, these feature maps can be input into a preset wire detection network model, which then outputs the detection results of the wire. This wire detection network model refers to a model used to accurately identify target wires based on wire images.

[0068] In this embodiment, the wire detection network model is a segmentation and detection framework for wire detection. This model consists of a CNN (Convolutional Neural Network) feature extraction module (i.e., a Double_U Block, including an encoder and decoder), a wire awareness module (i.e., a Powerline AwareBlock), a channel adjustment module (i.e., a Transition block), a semantic information extraction module (i.e., a Shared scSE Block), and a Transformer block. The feature extraction module can include multiple modules, acquiring at least two wire feature maps of different resolutions through multiple token encoders. These feature maps are then processed by the encoder and the channel adjustment module to obtain vector representations of the wire feature maps. These vector representations are input into the Transformer block for further processing, enabling process abstraction and feature extraction to obtain a first feature matrix or a first feature vector. Additionally, at least two wire feature maps of different resolutions are input into the wire awareness module and the semantic information extraction module for image enhancement processing. The enhanced image data is then input into the Transformer block for further processing to obtain a second feature matrix or a second feature vector. Finally, the detection results corresponding to at least two wire feature maps at different resolutions are merged, that is, the first feature vector and the second feature vector are fused to obtain the wire image detection results corresponding to at least two wire feature maps at different resolutions. The decoder of the feature extraction module can restore the fused feature map to the resolution of the original image, thus obtaining the wire detection results in the image at the original resolution.

[0069] Based on the aforementioned pre-defined wire detection network model, the following section will explain in detail how to perform wire detection on wire images using this network model.

[0070] First, obtain the wire detection network model. For details, please refer to [link to relevant documentation]. Figure 4 The process of obtaining the wire detection network model includes:

[0071] S131. Construct the initial model of the wire detection network.

[0072] The initial model of the wire detection network refers to the network architecture when the specific parameters of the aforementioned wire detection network model are not determined. The process of obtaining the wire detection network model in this embodiment is the process of determining the parameters of the wire detection network model. This is mainly achieved by optimizing the training model parameters through a constructed loss function to obtain the final model parameters, thus determining the final wire detection network model.

[0073] In this embodiment, the overall network architecture design of the initial model of the wire detection network follows a U-shaped neural network structure, such as the U-Net structure. U-Net is a convolutional neural network structure used for image segmentation, mainly consisting of two parts: an encoder and a decoder. The encoder comprises convolutional layers, pooling layers, and activation functions, used to extract image features and compress them into low-resolution feature maps. The decoder comprises deconvolutional layers and skip connections, used to restore the low-resolution feature maps to the resolution of the original image, and to fuse high-level features from the decoder with low-level features from the encoder through skip connections to improve segmentation performance.

[0074] In this embodiment of the application, the construction of the initial model of the wire detection network includes:

[0075] Multiple feature extraction modules are designed based on a U-shaped neural network. The multiple feature extraction modules are configured as a symmetrical encoder and decoder. The encoder is used to process at least two wire feature maps with different resolutions.

[0076] Based on the U-shaped neural network, a Transformer block is inserted. The output of the encoder is input into the Transformer block. The Transformer block is used to perform multi-layer abstraction and feature extraction based on the at least two wire feature maps of different resolutions to obtain a first feature vector corresponding to each wire feature map. The first feature vector is processed by the decoder to obtain wire image detection results of at least two different resolutions.

[0077] Specifically, please refer to Figure 5 , Figure 5 This is a schematic diagram of the structure of a wire detection network model provided in an embodiment of this application. For example... Figure 5 As shown, multiple feature extraction encoders (i.e., Double_U Blocks) are designed based on a U-shaped neural network. These multiple feature extraction encoders are configured as symmetrical encoders and decoders. Figure 5 The Double_U Blocks 1 / 2 / 3 / 4 on the left are encoders (i.e., encoding modules), and the Double_U Blocks 1 / 2 / 3 / 4 on the right are decoders (i.e., decoding modules). The number of encoders corresponds to the number of decoders, and can be represented as follows: Figure 5 The diagram shows a one-to-one correspondence, meaning one encoder corresponds to one decoder. The encoder processes wire feature maps at different resolutions to obtain representation vectors corresponding to those resolutions. These representation vectors are then input into the Transformer block (i.e.,...). Figure 5The Transformer Block in the code is used to fuse the outputs of the multiple feature extraction encoders with the output of the Transformer Block to obtain wire image detection results at different resolutions. This decoder can also convert features back to the original image size and resolution, for example... Figure 5 The left and right Double_U Block1 images have the same size and resolution.

[0078] The Double_U Block is a convolutional neural network module for image segmentation tasks. It consists of two U-Net-like networks cascaded together, each U-Net module comprising an encoder and a decoder. The encoder extracts features from the image, while the decoder restores these features to the original image size and resolution. In Double_UBlock, these two U-Net modules share the encoder and decoder, thereby reducing the number of parameters in the model and improving its efficiency.

[0079] like Figure 6 The diagram shown illustrates the structure of a Double_U Block, where the two U-shaped networks are designated U1 and U2. This Double_U Block has six downsampling operations and six upsampling operations, located within the two U-shaped networks U1 and U2 respectively. Please refer to [reference needed]. Figure 6 hx11 to hx12, hx12 to hx13, hx13 to hx14 are the three downsampling steps corresponding to U1. hx14 to hx13d, hx13d to hx12d, hx12d to hx11d are the three upsampling steps corresponding to U1. After three downsampling and three upsampling steps, U1 obtains the feature map hx11d. The feature map corresponding to hx11d is used as the input of U2. After three downsampling and three upsampling steps, U2 outputs the feature map hx20d. Among them, hx11d to hx21, hx21 to hx22, hx22 to hx23 are the three downsampling steps corresponding to U2. hx23 to hx22d, hx22d to hx21d, hx21d to hx20d are the three upsampling steps corresponding to U2. Finally, the obtained hx11d, hx20d, and the initial hx11 are fused, and the fused features are used as the output features of the Double_U Block. Figure 6In the diagram, hx11, hx12, hx13, hx14, hx13d, hx12d, hx11d, hx21, hx22, hx23, hx22d, hx21d, and hx20d all belong to their respective feature maps. The two U-shaped networks reduce the resolution of the feature maps and increase the number of channels simultaneously through three downsampling operations. This allows for the extraction of global information from the input image and reduces the size of the feature maps, thus reducing computational cost. This process can be implemented using pooling layers or convolutional layers. Similarly, the two U-shaped networks restore the resolution of the feature maps to their original size and reduce the number of channels through three upsampling operations. This process can be implemented using deconvolutional layers or upsampling layers. The upsampling process can recover information lost during downsampling. Through downsampling and upsampling operations, U-Net can extract global and local feature information from the input image and use this information for image segmentation tasks.

[0080] In U1, the two downsampling operations enable the network to acquire a larger receptive field (in convolutional neural networks, the receptive field refers to the size of the region where a neuron receives input information; it can be seen as the local sensitivity of a neuron to input information). By expanding the receptive field, the model can better capture global information about the image or features. Furthermore, by connecting feature maps of different resolutions in the U1 and U2 networks using `short_cut`, information not explored in U1 can be further explored in U2, increasing the network's information mining capabilities. For example, U-Net typically uses convolutional and pooling layers alternately for feature extraction and downsampling in the encoder part. For U1, assuming the input image size is 256x256 pixels, the first downsampling in U1 can halve the image size to 128x128 pixels. In this process, a convolutional layer with a stride of 2 can be used to halve the image size, followed by further downsampling using a pooling layer. The second downsampling can halve the image size to 64x64 pixels, which can also be achieved using convolutional and pooling layers with a stride of 2. In the decoder section of U-Net, deconvolutional layers or upsampling layers are often used to restore the feature map. For U1, assuming two downsampling operations have been performed, the feature map needs to be restored to its original size of 256x256 pixels. The first upsampling can use an upsampling layer to double the feature image size, restoring it from 64x64 pixels to 128x128 pixels. Then, a convolutional layer with a stride of 1 is used to process the features, further increasing the image resolution. The second upsampling can use the same method to restore the image to its original size, i.e., using an upsampling layer to double the feature image size, restoring it from 128x128 pixels to 256x256 pixels. Finally, a convolutional layer is used to output the final segmentation result. U2 operates similarly to U1, using downsampling and upsampling to extract features from the input image, thereby increasing the network's information mining capabilities.

[0081] Shortcut connections, also known as skip connections, refer to directly connecting the outputs of certain layers in a network to the inputs of subsequent layers, allowing information to be passed across multiple layers. In the U-Net model, shortcut connections connect the outputs of corresponding layers between the encoder and decoder. The purpose of this connection is to directly pass high-resolution feature maps to the decoder, thereby helping the decoder to better reconstruct the original image. In the Double_U Block, since it contains two U-Net modules, it is also necessary to connect the outputs of corresponding layers between them to maintain the integrity and continuity of information.

[0082] The output of each Double_U Block is a joint residual output, which integrates features from both shallow and deep layers, making it more conducive to building deep networks. The formula is as follows:

[0083]

[0084] It should be noted that, Figure 6 The diagram shows a Double_U Block consisting of two U-Net modules. In other embodiments, it may also include fewer or more U-Net modules. The structure of each U-Net module may include fewer or more downsampling and upsampling operations, and is not limited to the above-described U-Net module having three downsampling and three upsampling operations.

[0085] Optionally, Figure 5 Double U Block 1, Double U Block 2, Double U Block 3, and Double U Block 4 can all be... Figure 6 The structure of the Double U Block, which consists of two U-shaped networks, U1 and U2, can perform six downsampling and six upsampling operations. However, in practical applications... Figure 5 The Double U Block can also exist in other structural forms, and is not limited to these. Figure 6 The structure shown.

[0086] Figure 5 The feature extraction part of this wire detection network model consists of four Double_U Blocks, enabling multi-level resolution and multiple feature mining operations. The table below shows the resolution corresponding to each Double_U Block group:

[0087]

[0088] It should be noted that, Figure 5The diagram shows four Double_U Blocks. In practical applications, the number of Double_U Blocks can be adjusted as needed. For example, adding an image with an input resolution of 1024x1024 would require adding one more Double_U Block.

[0089] The encoder performs downsampling and upsampling operations at preset levels on at least two wire feature maps of different resolutions to obtain a representation vector corresponding to each wire feature map. This representation vector represents the features and semantic information of the image at each resolution. The representation vectors corresponding to the wire feature maps of different resolutions are input into the Transformer block. The Transformer block performs multi-level abstraction and feature extraction on the representation vectors corresponding to the wire feature maps of different resolutions to obtain a first feature vector corresponding to each wire feature map. This first feature vector can be fused with the features output by the four Double_UBlock (encoders) to produce wire image detection results that maintain the original size and resolution at the output of the four Double_UBlock (decoders).

[0090] The Transformer block is a neural network model based on an attention mechanism, used for multi-level abstraction and feature extraction of input sequences. Specifically, the Transformer encodes sequences through multiple self-attention layers. Each self-attention layer performs self-attention computation on the input sequence, thereby weighted representing and abstracting different parts of the input sequence. In each self-attention layer, each position in the input sequence is associated and computed with other positions, achieving multi-level feature extraction and abstraction. In the self-attention computation, the representation vector at each position is weighted and converged based on the representation vectors at other positions, resulting in a more global representation vector. Through the stacking of multiple self-attention layers, the Transformer block can perform multi-level abstraction and feature extraction of the input sequence, resulting in a more advanced and abstract feature representation. A typical Transformer block includes a multi-head self-attention layer, residual connections, layer normalization, a feedforward network layer, residual connections, and layer normalization. The design of the Transformer block eliminates the temporal dependencies and local receptive field limitations of traditional recurrent neural networks and convolutional neural networks, enabling the model to have better parallelization capabilities and the ability to process longer input sequences. It should be noted that the number of Transformer blocks can be adjusted according to the actual application, and is not limited to a specific number. Figure 5 .

[0091] In some embodiments, constructing the initial model of the wire detection network further includes: inserting a channel adjustment module based on the U-shaped neural network. For example... Figure 5As shown, this channel adjustment module is the Transition block. Based on the symmetrical design of the U-shaped neural network, this module is used to adjust the size and number of channels of the feature maps processed by the encoder and decoder. Specifically, the Transition block is used to adjust the size and number of channels of the feature maps to facilitate connections and transfer between different layers. In some deep neural networks, the size and number of channels of the feature maps change continuously with the increase of network layers. To ensure smooth feature transfer between different layers, this Transition block is introduced.

[0092] In some embodiments, constructing the initial model of the wire detection network further includes: inserting a wire perception module and a semantic information extraction module based on the U-shaped neural network. For example... Figure 5 As shown, the wire sensing module is the PowerLine AwareBlock, and the semantic information extraction module is the Share SCSE Block. The number of the wire sensing modules and the semantic information extraction modules corresponds to the number of encoders and the number of decoders, for example... Figure 5 The three PowerLineAware Blocks correspond to Double_U Blocks 1 / 2 / 3 respectively, and the one Shared SCSE Block corresponds to Double_U Block 4. The wire sensing module is used to perform image enhancement processing on the at least two wire feature maps of different resolutions to obtain a second feature vector corresponding to each wire feature map. The semantic information extraction module is used to extract semantic information from the low-resolution wire feature map among the at least two wire feature maps of different resolutions to obtain a second feature vector corresponding to the low-resolution wire feature map. For example... Figure 5 As shown, the decoder includes three PowerLine Aware Blocks and one Shared SCSE Block. The three PowerLine Aware Blocks acquire wire feature maps of different resolutions processed by Double_U Blocks 1, 2, and 3, respectively, and perform image enhancement processing on these different resolution wire feature maps. The Shared SCSE Block acquires the lowest resolution wire feature map from Double_U Block 4 and performs image enhancement processing on this lowest resolution wire feature map. The PowerLine Aware Blocks and Shared SCSE Blocks can obtain second feature vectors corresponding to wire feature maps of different resolutions. These second feature vectors can be input into the four Double_U Blocks that make up the decoder.

[0093] In this embodiment, a PowerLine Aware Block is designed specifically for the elongated shape of electrical wires. Shallow networks contain a wealth of detailed information, allowing for the dedicated extraction of wire features using the PowerLine Aware Block. Feature fusion further enhances the subsequent network's ability to perceive electrical wires. Figure 7 As shown, this is a feature heatmap of each stage of the shallow layer of the wire image network. The first row, hx1, hx2, and hx3, are feature maps without wire feature enhancement. The second row, plabout1, plabout2, and plabout3, are feature maps enhanced by the PowerLine Aware Block. The feature maps enhanced by the PowerLine Aware Block can better suppress the activation of the background and highlight the features of the wire, which is beneficial for wire detection.

[0094] The structure of the PowerLine Aware Block (PLAB) can be as follows: Figure 8 As shown, the features of a slender wire are captured using two-way asymmetric dilated convolution. The design of two parallel asymmetric dilated convolutions effectively extracts features in both the vertical and horizontal directions, and parallel ordinary convolutions are used to supplement the dilated features. The output of the entire module follows the formula:

[0095]

[0096] Where d is the dilation rate of dilated convolution, and n is the number of convolutions.

[0097] Among them, the Share SCSE (Spatial and Channel Squeeze and Excitation) Block is an improved module in this application embodiment for enhanced mining of wire features in deep networks. For example, as Figure 9 As shown, Figure 9This is a schematic diagram of a Shared scSE Block provided in an embodiment of this application. As is known, max pooling and average pooling are two commonly used pooling methods in convolutional neural networks, both of which downsample the image after the convolution operation. Max pooling extracts the most salient features from the input data. It divides a given input region into several sub-regions and then selects the maximum value from each sub-region as the output. This effectively reduces the image size while retaining important features for subsequent classification or other tasks. For example, in image classification tasks, max pooling makes the model more robust and less sensitive to changes in the position of the target object in the image. In this embodiment, the Spatial and Channel Squeeze and Excitation modules are modified. In the Channel SE branch, max pooling replaces average pooling, which correlates the wire portion with the highest activation in the feature map with the importance weight of the channel dimension. Specifically, as... Figure 9 As shown, the main steps include: for a specific wire section, obtaining its corresponding feature map using a CNN model, the feature map containing several channels; converting the output of each channel into a numerical value using a global average pooling layer (Depth layer); weighting the numerical values ​​of each channel according to the weights output by the classifier; and performing spatial average pooling again on each weighted channel to obtain the importance weight of the entire feature map in the channel dimension. Therefore, this embodiment of the application weights each channel according to its importance weights in the feature map, and then uses the weighted average of each channel in the spatial dimension as the importance weight of the entire feature map in the channel dimension, thereby correlating the wire section with the highest activation in the feature map with the importance weight in the channel dimension.

[0098] In this embodiment, the original module is extended in the Spatial SE (Squeeze-and-Excitation) branch. It is assumed that the original Spatial SE module did not undergo true spatial compression expansion. This is achieved by using multi-resolution convolutional kernels (e.g., Figure 9The Spatial SE branch extracts features from different receptive fields (1x1conv, 3x3conv, 7x7conv, 15x15conv) and integrates features from different receptive fields, achieving true spatial compression and expansion, further improving the performance of the Spatial SE branch. Spatial SE is a deep learning network module for image classification that adaptively adjusts the weights of each feature map channel to improve model performance. The Spatial SE module consists of two parts: squeeze and excitation. The squeeze operation reduces the number of channels through global average pooling to better understand the interactions between features. Then, the excitation operation learns the importance weights of each channel using two fully connected layers and applies them to the original features. This adaptive channel weighting mechanism effectively improves the model's representational power and has achieved excellent performance in many image classification tasks.

[0099] In some embodiments, the Transformer block is used to perform multi-layer abstraction and feature extraction based on the at least two wire feature maps of different resolutions to obtain a first feature vector corresponding to each wire feature map. The first feature vector and the second feature vector generated by the PowerLine Aware Block and Share SCSE Block are then subjected to feature fusion processing by the decoder to obtain wire image detection results of different resolutions.

[0100] In this embodiment, when constructing the initial model of the aforementioned wire detection network, the sampled image data (including and excluding images containing wires) is first sent to the Pooling Stem Block for processing. Because the Pooling Stem Block can handle high-resolution data, ultra-high-resolution images captured by a drone can be sent to it for processing. Furthermore, even after multiple resolution downgrading processes (e.g., to 1 / 2, 1 / 4, 1 / 8, 1 / 16 of the original resolution), the high-resolution images maintain a high recognition accuracy. Images of different resolutions are then sent to their corresponding Double U Blocks. Optionally, the Double U Blocks can further reduce the resolution. The Transition Block belongs to the category of deep neural networks and is used to process images with even lower resolutions. It is known that the Transition Block and Shared SCSE Block belong to deep neural networks, while the Double U Block and PowerLine Aware Block belong to shallow neural networks. After processing image data of different resolutions using different Double U Blocks and Transition Blocks, vector representations of the image data are obtained. The image data representation is then input into the Transformer Block for processing. The Transformer Block performs process abstraction and feature extraction on the input vector, specifically obtaining the corresponding feature matrix or feature vector. On the other hand, images at different resolutions also undergo image enhancement processing via the PowerLine Aware Block and the Shared SCSE Block. Finally, the feature extraction output from the Transformer Block is fused with the features output from the PowerLine Aware Block and the Shared SCSE Block to obtain the wire detection results for images at different resolutions. These wire detection results are then merged to obtain the wire detection results for the image at the original resolution.

[0101] The above steps can be used to construct the initial model of the wire detection network. Next, the initial model of the wire detection network is trained to determine the final wire detection network model.

[0102] S132. Sample the wire image and preprocess the wire image to obtain preprocessed sample data.

[0103] Preprocessing the wire image mainly includes image denoising, image enhancement, and image binarization, etc. For details, please refer to relevant technical documentation. Through preprocessing, a large amount of sample data is obtained, which is used to train the initial model of the wire detection network described below.

[0104] S133. Input the sample data into the initial model of the wire detection network and output the corresponding wire recognition result.

[0105] Based on the initial model of the wire detection network constructed above and the input sample data, the identification result of the wire can be output, which includes information such as the wire image and the wire location.

[0106] S134. Construct a loss function based on the identification results of the wires.

[0107] In this embodiment, the challenges of wire detection are addressed: extremely imbalanced data samples, with foreground pixels far outnumbering background pixels; and the slender nature of wires is easily affected by a large amount of redundant background information. Based on this, a joint multi-weight loss function is proposed. Specifically, the formula for this loss function is:

[0108] L=α*CE weight=1:5 +β*phiLoss+γ*DiceLoss weight=1:5 ;

[0109] Where L represents the loss function, α, β, and γ are weight coefficients, CE refers to the cross-entropy loss function, phiLoss refers to the loss function used for object detection, DiceLoss refers to the loss function used for image segmentation, and weight = 1:5 refers to the weight ratio. For detailed descriptions of the cross-entropy loss function, the loss function used for object detection, and the loss function used for image segmentation, please refer to relevant technical records.

[0110] S135. Optimize and train the initial model of the wire detection network according to the loss function to obtain the model parameters that minimize the loss function, and determine the final wire detection network model according to the model parameters.

[0111] The process of optimizing and training the initial model of the wire detection network based on the loss function to obtain the model parameters that minimize the loss function may include:

[0112] Initialize model parameters: Initialize the model parameters to some random values, typically using a uniform or normal distribution. Forward propagation: Calculate the model's output using the initialized model parameters through forward propagation. Calculate the loss function: Compare the model output with the true values ​​and calculate the loss function. Backpropagation: Calculate the gradient of the loss function with respect to the model parameters using the backpropagation algorithm. Parameter update: Update the model parameters using the optimizer according to gradient descent to minimize the loss function. Repeat forward propagation, loss calculation, backpropagation, and parameter update until the predetermined number of training epochs is reached or the loss function converges.

[0113] Therefore, the obtained model parameters are used as the parameters of the initial model of the wire detection network, and the initial model of the wire detection network including these parameters is the final wire detection network model.

[0114] Alternatively, a test set can be used to evaluate the performance of the trained model, typically using metrics such as accuracy, recall, and F1 score.

[0115] The preset wire detection network model can be obtained through the above method. Next, the detection results of the wires are output according to the wire detection network model.

[0116] Please see Figure 10 The step of outputting the detection results of the wires based on the wire detection network model includes:

[0117] S141. Perform multi-level abstraction and feature extraction based on the at least two wire feature maps of different resolutions to obtain a first feature vector corresponding to each wire feature map. The feature extraction module can perform downsampling and upsampling operations at preset levels on the at least two wire feature maps of different resolutions to obtain a representation vector corresponding to each wire feature map; the Transformer block can then perform multi-level abstraction and feature extraction on the representation vectors corresponding to the at least two wire feature maps of different resolutions to obtain a first feature vector corresponding to each wire feature map.

[0118] S142. Perform image enhancement processing based on the at least two wire feature maps of different resolutions to obtain a second feature vector corresponding to each wire feature map. Image enhancement processing can be performed on the at least two wire perception modules to obtain the second feature vector corresponding to the at least two wire feature maps of different resolutions; semantic information extraction can be performed on the low-resolution wire feature map among the at least two different resolution wire feature maps to obtain the second feature vector corresponding to the low-resolution wire feature map.

[0119] Specifically, the image enhancement processing of the at least two wire feature maps with different resolutions is performed by at least two wire sensing modules. This includes extracting wire features from the wire feature maps by performing two-way asymmetric dilated convolutions of the wire sensing modules. Each of the at least two wire sensing modules includes the two-way asymmetric dilated convolutions. The number of the at least two wire sensing modules corresponds to the number of categories at the resolution, and the correspondence can be one-to-one.

[0120] S143. Perform feature fusion processing on the first feature vector and the second feature vector to obtain wire image detection results at different resolutions.

[0121] S144. Merge the detection results of the wire images at different resolutions and output an image including the original resolution of the wire.

[0122] The detailed process of steps S141 to S144 above can be found in the description of the above embodiments.

[0123] The power line detection method provided in this application proposes a Heavy Token Encoding (HTE) Transformer architecture for aerial data power line detection and segmentation. It introduces a power line perception module and an improved Shared SCSE Block to address the slender characteristics of power lines. Furthermore, it proposes a joint multi-weight loss function to optimize power line segmentation and train the power line detection network model. This enhances the power line detection capability and improves the accuracy of power line detection, achieving advanced performance in power line segmentation and solving a major challenge in the industry.

[0124] Please see Figure 11 , Figure 11 This is a schematic diagram of the structure of a wire detection device provided in an embodiment of this application. Figure 11 As shown, the wire detection device 300 includes:

[0125] The wire image acquisition module 301 is used to acquire wire images;

[0126] Image preprocessing module 302 is used to preprocess the wire image and obtain at least two wire feature maps of different resolutions based on the preprocessed wire image.

[0127] The wire detection module 303 is used to input the at least two wire feature maps of different resolutions into a preset wire detection network model, and output the wire detection result according to the wire detection network model.

[0128] In some embodiments, the system further includes a wire detection network model acquisition module 304, which is specifically used for: constructing an initial model of a wire detection network; sampling wire images and preprocessing the wire images to obtain preprocessed sample data; inputting the sample data into the initial model of the wire detection network and outputting the corresponding wire recognition result; constructing a loss function based on the wire recognition result; optimizing and training the initial model of the wire detection network according to the loss function to obtain the model parameters that minimize the loss function, and determining the final wire detection network model according to the model parameters.

[0129] It should be noted that the above-described wire testing device 300 can execute the wire testing method provided in the embodiments of this application, and has the corresponding functional modules and beneficial effects for executing the method. Technical details not described in detail in the embodiments of the wire testing device 300 can be found in the wire testing method provided in the embodiments of this application.

[0130] Please see Figure 12 , Figure 12 This is a schematic diagram of the hardware structure of the wire testing device 400 for performing the wire testing method according to an embodiment of this application. Figure 12 As shown, the wire testing device 400 includes: one or more processors 401 and a memory 402. Figure 12 Take a processor 401 as an example.

[0131] The processor 401 and the memory 402 can be connected via a bus or other means. Figure 12 Taking the example of a connection between China and Israel via a bus.

[0132] The memory 402, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as the program instructions / modules corresponding to the wire detection method in the embodiments of this application. The processor 401 executes various functional applications and data processing of the server by running the non-volatile software programs, instructions, and modules stored in the memory 402, thereby implementing the wire detection method in the above-described method embodiments.

[0133] The memory 402 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the wire detection device. Furthermore, the memory 402 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 402 may optionally include memory remotely located relative to the processor 401, and these remote memories may be connected to the wire detection device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0134] The one or more modules are stored in the memory 402, and when executed by the one or more processors 401, they execute the wire detection method in any of the above method embodiments.

[0135] The above-described product can perform the methods provided in the embodiments of this application, and has the corresponding functional modules and beneficial effects for performing the methods. Technical details not described in detail in this embodiment can be found in the methods provided in the embodiments of this application.

[0136] The wire detection device in this application exists in various forms, including but not limited to: drones, smartphones, personal computers, servers, and other electronic devices with data interaction functions.

[0137] This application provides a non-volatile computer-readable storage medium storing computer-executable instructions that are executed by one or more processors, for example... Figure 12 One of the processors 401 can enable the one or more processors to execute the wire detection method in any of the above method embodiments.

[0138] This application provides a computer program product, which includes a computer program stored on a non-volatile computer-readable storage medium. The computer program includes program instructions, which, when executed by the wire detection device, enable the wire detection device to perform the wire detection method in any of the above method embodiments.

[0139] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0140] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented using software and a general-purpose hardware platform, or of course, using hardware. Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.

[0141] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and not to limit them; under the concept of this application, the technical features of the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations of different aspects of this application as described above, which are not provided in detail for the sake of brevity; although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.

Claims

1. A power line detection method characterized by comprising: include: Acquire images of electrical wires; The wire image is preprocessed, and at least two wire feature maps of different resolutions are obtained based on the preprocessed wire image. The at least two wire feature maps of different resolutions are input into a preset wire detection network model, and the detection result of the wire is output according to the wire detection network model. The overall network architecture design of the wire detection network model follows a U-shaped neural network structure. The step of inputting the at least two wire feature maps of different resolutions into a preset wire detection network model, and outputting the wire detection result based on the wire detection network model, includes: Multi-level abstraction and feature extraction are performed based on the at least two wire feature maps with different resolutions to obtain a first feature vector corresponding to each wire feature map; Image enhancement processing is performed based on the at least two wire feature maps of different resolutions to obtain a second feature vector corresponding to each wire feature map; The first feature vector and the second feature vector are fused to obtain wire image detection results at different resolutions; The detection results of the wire images at different resolutions are merged to output an image including the original resolution of the wire.

2. The method according to claim 1, characterized in that, The step of obtaining at least two wire feature maps of different resolutions based on the preprocessed wire image includes: Local features are extracted from the preprocessed wire image to obtain a local feature map; Downsampling is performed based on the local feature map; The downsampled local feature map is then normalized to output multiple wire feature maps with different resolutions.

3. The method according to claim 1, characterized in that, The step of performing multi-level abstraction and feature extraction based on the at least two wire feature maps of different resolutions to obtain a first feature vector corresponding to each wire feature map includes: The feature extraction module performs downsampling and upsampling operations at preset levels on the at least two wire feature maps of different resolutions to obtain the representation vector corresponding to each wire feature map. The Transformer block performs multi-level abstraction and feature extraction on the representation vectors corresponding to the at least two wire feature maps with different resolutions to obtain the first feature vector corresponding to each wire feature map.

4. The method according to claim 1, characterized in that, The image enhancement processing based on the at least two wire feature maps of different resolutions to obtain a second feature vector corresponding to each wire feature map includes: Image enhancement processing is performed on the at least two wire feature maps of different resolutions using at least two wire sensing modules to obtain the second feature vectors corresponding to the at least two wire feature maps of different resolutions. The semantic information extraction module extracts semantic information from the low-resolution wire feature map among the at least two wire feature maps of different resolutions to obtain the second feature vector corresponding to the low-resolution wire feature map.

5. The method according to claim 4, characterized in that, The image enhancement processing of the at least two wire feature maps at different resolutions using at least two wire sensing modules specifically includes: The wire feature map is extracted by using two-way asymmetric dilated convolution of the wire sensing module. Each of the at least two wire sensing modules includes the two-way asymmetric dilated convolution, and the number of the at least two wire sensing modules corresponds to the number of categories in the resolution.

6. The method according to any one of claims 1 to 5, characterized in that, The method further includes: obtaining the wire detection network model. The process of obtaining the wire detection network model includes: Construct an initial model for the wire detection network; Sampling wire images and preprocessing the wire images to obtain preprocessed sample data; Input the sample data into the initial model of the wire detection network, and output the corresponding wire identification result; A loss function is constructed based on the identification results of the wires; The initial model of the wire detection network is trained by optimizing the loss function to obtain the model parameters that minimize the loss function, and the final wire detection network model is determined based on the model parameters.

7. The method according to claim 6, characterized in that, The initial model for constructing the wire detection network includes: Multiple feature extraction modules are designed based on a U-shaped neural network. The multiple feature extraction modules are configured as a symmetrical encoder and decoder. The encoder is used to process at least two wire feature maps with different resolutions. The U-shaped neural network is used to insert a channel adjustment module, which is based on the symmetrical design of the U-shaped neural network and is used to adjust the size and number of channels of the feature maps processed by the encoder and the decoder. The U-shaped neural network inserts a wire sensing module and a semantic information extraction module. The number of the wire sensing module and the semantic information extraction module corresponds to the number of the encoder and the number of the decoder. The wire sensing module is used to perform image enhancement processing on the at least two wire feature maps of different resolutions to obtain a second feature vector corresponding to each wire feature map. The semantic information extraction module is used to extract semantic information from the low-resolution wire feature map among the at least two wire feature maps of different resolutions. Based on the U-shaped neural network, a Transformer block is inserted. The output results of the encoder and the channel adjustment module are both input into the Transformer block. The Transformer block is used to perform multi-layer abstraction and feature extraction based on the at least two wire feature maps of different resolutions to obtain a first feature vector corresponding to each wire feature map. The decoder is used to perform feature fusion processing on the first feature vector and the second feature vector to obtain wire image detection results of different resolutions.

8. The method according to claim 6, characterized in that, The loss function constructed based on the identification results of the wires includes: Construct the loss function corresponding to the following formula, where the formula is: L=a CEweight=1:5+β phiLoss+γ DiceLossweight=1:5; Where L represents the loss function, α, β, and γ are weight coefficients, CE refers to the cross-entropy loss function, phiLoss refers to the loss function used for object detection tasks, DiceLoss refers to the loss function used for image segmentation tasks, and weight = 1:5 refers to the weight ratio.

9. A wire detection device for implementing the method according to any one of claims 1-8, characterized in that, include: The wire image acquisition module is used to acquire wire images; An image preprocessing module is used to preprocess the wire image and obtain at least two wire feature maps of different resolutions based on the preprocessed wire image. The wire detection module is used to input the at least two wire feature maps of different resolutions into a preset wire detection network model, and output the wire detection results according to the wire detection network model.

10. A wire testing device, characterized in that, include: At least one processor; A memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 8.