Cross-channel cross-attention power transmission line image resolution reconstruction method and system
By employing cross-channel attention and linear attention methods, the problem of feature capture in low-resolution power transmission line images is solved, achieving efficient and accurate power transmission line image reconstruction. This addresses the issues of inaccurate image reconstruction and high computational burden in existing technologies.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-05
- Publication Date
- 2026-03-31
AI Technical Summary
Existing technologies struggle to effectively capture the continuity and directional features of transmission line images, and are prone to breakage or disappearance under low-resolution conditions. They also introduce artifacts when processing complex background textures, causing key equipment details to be obscured or lost.
A cross-channel attention method is adopted to obtain the channel weights of multi-size feature maps through cross-channel attention, and combined with linear attention to capture positional relationships, and progressive reconstruction is performed to obtain high-resolution transmission line images.
It accurately focuses on key elements, reduces background and artifact interference, effectively captures the continuity and directional characteristics of power transmission lines, improves image reconstruction accuracy, and takes into account computational efficiency.
Smart Images

Figure CN121767181A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer image processing technology, specifically to a method and system for reconstructing the resolution of power transmission line images using cross-channel cross-attention. Background Technology
[0002] With the rapid development of deep learning technology, significant breakthroughs have been achieved in the field of super-resolution. Convolutional neural network (CNN)-based methods have demonstrated superior reconstruction performance by learning end-to-end mappings from low-resolution to high-resolution images; recurrent neural networks (RNNs) have enhanced recursive feature extraction capabilities by introducing temporal information processing mechanisms; and generative adversarial networks (GANs) have generated more realistic and detailed high-resolution images through game-like training between the discriminator and generator. These advanced models have achieved remarkable results in general scenarios such as natural images and face images. Despite the significant progress made in general super-resolution methods, their direct application to power transmission line images faces specific technical challenges. Power transmission line images possess unique visual features and structural characteristics, significantly differing from natural images. Transmission lines exhibit extremely elongated structures, with aspect ratios reaching thousands to one. This unique geometry makes it difficult for traditional square convolutional kernels to effectively capture their continuity and directional features. Furthermore, insulator strings exhibit regular, repeating texture structures, while the hardware at the joints contains complex three-dimensional shapes and metallic luster. Under low-resolution conditions, these elongated structures are prone to breakage or disappearance, and existing methods often struggle to accurately reconstruct these key features. Meanwhile, the background of power transmission line images usually contains diverse elements such as sky, vegetation, and buildings. When processing complex textures, general models may introduce artifacts, causing important equipment details to be obscured or lost. Summary of the Invention
[0003] To address the technical problem of existing technologies failing to improve the accuracy of power transmission line image reconstruction, this invention provides a method and system for reconstructing power transmission line images using cross-channel cross-attention. This method obtains channel weights for each size feature map in multi-size feature maps through cross-channel cross-attention. Based on these channel weights, the initial channel feature maps are adaptively optimized to obtain optimized channel feature maps, thereby accurately focusing on key elements and reducing interference from background and artifacts. Linear attention captures the positional relationships between elements in low-resolution power transmission line images. Using these positional relationships, combined with the optimized channel feature maps, the low-resolution power transmission line images are progressively reconstructed to obtain high-resolution power transmission line images. This effectively captures the continuity and directional features of power transmission lines, solving the technical problem of existing technologies failing to improve the accuracy of power transmission line image reconstruction.
[0004] To address the aforementioned technical problems, this invention provides a method for reconstructing transmission line image resolution using cross-channel cross-attention, comprising the following steps: Multi-scale feature maps are obtained by extracting features from the input low-resolution power line image using a constructed hierarchical Transformer encoder. By obtaining the channel weights of each channel corresponding to the feature map of each size in the multi-size feature map through cross-channel attention, the initial channel feature map is adaptively optimized based on the channel weights to obtain the optimized channel feature map; Linear attention is used to capture the positional relationships between elements in low-resolution power transmission line images. Based on these positional relationships, combined with optimized channel feature maps, the low-resolution power transmission line images are progressively restored to obtain high-resolution power transmission line images.
[0005] Preferably, the step of extracting features from the input low-resolution power line image using the constructed hierarchical Transformer encoder to obtain a multi-scale feature map includes: The low-resolution transmission line image is preprocessed to obtain the adapted image, and the part features and first auxiliary features of the parts in the feature are obtained through the Transformer block; The part features are downsampled, and the downsampled part features are combined with the first auxiliary features to obtain the component features and the second auxiliary features of the component in the elements; The component features are downsampled, and the downsampled component features are combined with the second auxiliary features to obtain the equipment features and the third auxiliary features of the device in the elements; The global layout features of the adapted image are obtained by fusing equipment features and third auxiliary features, and multi-scale feature maps are obtained based on part features, component features, equipment features and global layout features.
[0006] Preferably, the preprocessing of the low-resolution transmission line image to obtain the adapted image includes: The low-resolution power transmission line image is converted in format, resized, normalized and serialized to obtain a suitable image.
[0007] Preferably, the step of obtaining the channel weights of each size feature map corresponding to the multi-size feature map through cross-channel cross-attention includes: Normalize the feature maps of each size, and divide the channels corresponding to each size feature map equally to obtain the first size feature map and the second size feature map; Perform independent linear transformations on the first-size feature map to generate the corresponding first query, first key, and first value; perform independent linear transformations on the second-size feature map to generate the corresponding second query, second key, and second value. Obtain the first similarity between the first key and the first query, normalize the first similarity to obtain the initial weight of the channel corresponding to the first size feature map, and use the initial weight of the channel corresponding to the first size feature map to weight the second value to obtain the first weighted value. Obtain the final weight of the channel corresponding to the first size feature map based on the first weighted value. Obtain the second similarity between the second key and the second query, normalize the second similarity to obtain the initial weight of the channel corresponding to the second size feature map, and use the initial weight of the channel corresponding to the second size feature map to weight the first value to obtain the second weighted value. Obtain the final weight of the channel corresponding to the second size feature map based on the second weighted value. The channel weights are obtained by concatenating the final weights of the channels corresponding to the first-size feature map and the final weights of the channels corresponding to the second-size feature map.
[0008] Preferably, the step of adaptively optimizing the initial channel feature map based on the channel weights to obtain the optimized channel feature map includes: The channel weights are multiplied by the initial channel feature map to obtain the process channel feature map, and the process channel feature map is added to the initial feature map to obtain the optimized channel feature map.
[0009] Preferably, the step of capturing the positional relationships between elements in a low-resolution power line image through linear attention includes: The third query, third key, and third value of the adapted image obtained by preprocessing low-resolution transmission line images are obtained through linear attention. The third query and the third key are nonlinearly mapped by a preset kernel function to obtain the mapping query and the mapping key. The mapping query and the mapping key are used as inputs for rotation position encoding to obtain the fourth query and the fourth key. Aggregate the fourth query with the third value to obtain the global key-value pair library, and perform a dot product between the fourth query and the fourth key to obtain the normalization factor; Global location association features are obtained based on a global key-value pair library and a normalization factor, and the location relationships between elements are obtained based on these global location association features.
[0010] Preferably, the step of progressively restoring the low-resolution transmission line image to obtain a high-resolution transmission line image by combining positional relationships and optimized channel feature maps includes: The first high-resolution transmission line image is obtained by restoring the low-resolution transmission line image based on the global channel feature map in the optimized channel feature map and the global positional relationship in the positional relationship. The second high-resolution transmission line image is obtained by restoring the first high-resolution transmission line image based on the local channel feature map in the optimized channel feature map and the local positional relationship in the positional relationship. The high-resolution transmission line image is obtained by restoring the second high-resolution transmission line image based on the detail channel feature map in the optimized channel feature map and the detail positional relationship in the positional relationship.
[0011] By adopting the above technical solution, the present invention has the following advantages: By obtaining the channel weights of each channel corresponding to the feature map of each size in the multi-size feature map through cross-channel attention, the initial channel feature map is adaptively optimized based on the channel weights to obtain the optimized channel feature map. Specifically, the channel weights are multiplied with the initial channel feature map to obtain the process channel feature map, and the process channel feature map is added to the initial feature map to obtain the optimized channel feature map. This method strengthens the key features while retaining the original information, avoids feature loss caused by over-optimization, and ensures that the key elements are accurately focused on while reducing the interference of background and artifacts on the key elements. While traditional global attention mechanisms can establish long-range dependencies, their quadratic computational complexity imposes a significant computational burden when processing high-resolution transmission line images, making it difficult to meet the efficiency requirements of real-time inspection. Linear attention simplifies attention calculations, reducing complexity to linear levels, and efficiently captures the positional relationships between elements. It effectively captures the continuity and directional features of transmission lines, thus balancing long-range dependencies with inspection efficiency. Through progressive restoration and staged repair, it first ensures the continuity of the overall structure, then supplements the contours of local components, and finally refines the detailed textures. By accurately restoring the continuity of slender structures and the details of key elements, it solves the technical problem of existing technologies failing to improve the accuracy of transmission line image restoration.
[0012] This invention also provides a transmission line image resolution reconstruction system with cross-channel cross-attention, applicable to the aforementioned transmission line image resolution reconstruction method with cross-channel cross-attention, comprising: The feature extraction module is used to extract features from the input low-resolution power line image through the constructed hierarchical Transformer encoder to obtain multi-scale feature maps; The optimized channel feature map acquisition module is used to obtain the channel weights of each size feature map in the multi-size feature map through cross-channel cross attention, and to adaptively optimize the initial channel feature map based on the channel weights to obtain the optimized channel feature map; The high-resolution power transmission line image acquisition module is used to capture the positional relationships between elements in a low-resolution power transmission line image through linear attention. Based on these positional relationships, and combined with optimized channel feature maps, the low-resolution power transmission line image is progressively restored to obtain a high-resolution power transmission line image.
[0013] By adopting the above technical solution, the present invention has the following advantages: By obtaining the channel weights of each channel in the multi-size feature map through cross-channel attention, the initial channel feature map is adaptively optimized based on the channel weights to obtain the optimized channel feature map, thereby enabling precise focus on key elements and reducing the interference of background and artifacts on key elements; While traditional global attention mechanisms can establish long-range dependencies, their quadratic computational complexity imposes a significant computational burden when processing high-resolution transmission line images, making it difficult to meet the efficiency requirements of real-time inspection. Linear attention simplifies attention calculations, reducing complexity to linear levels, and efficiently captures the positional relationships between elements. It effectively captures the continuity and directional features of transmission lines, thus balancing long-range dependencies with inspection efficiency. Through progressive restoration and staged repair, it first ensures the continuity of the overall structure, then supplements the contours of local components, and finally refines the detailed textures. By accurately restoring the continuity of slender structures and the details of key elements, it solves the technical problem of existing technologies failing to improve the accuracy of transmission line image restoration. Attached Figure Description
[0014] Other features, objects, and advantages of the invention will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings. The drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings.
[0015] Figure 1 This is a flowchart illustrating the cross-channel cross-attention transmission line image resolution reconstruction method of the present invention. Figure 2 This is a network architecture diagram of the cross-channel cross-attention transmission line image resolution reconstruction method of the present invention; Figure 3 This is a comparison of the effects of the cross-channel cross-attention transmission line image resolution reconstruction method of the present invention. Detailed Implementation
[0016] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only one preferred embodiment of this invention and are only used to explain this invention. They do not limit the scope of protection of this invention. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.
[0017] Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe the operations (or steps) as sequential processes, many of the operations (or steps) can be performed in parallel, concurrently, or simultaneously. Furthermore, the order of the operations can be rearranged. The process can be terminated when its operation is completed, but it may also have additional steps not included in the figures; the process may correspond to a method, function, procedure, subroutine, subroutine, etc.
[0018] Example 1: like Figure 1 As shown, the transmission line image resolution reconstruction method with cross-channel cross-attention includes the following steps: S1: Multi-scale feature maps are obtained by extracting features from the input low-resolution power line image through a constructed hierarchical Transformer encoder.
[0019] The step of extracting features from the input low-resolution power line image using a constructed hierarchical Transformer encoder to obtain a multi-scale feature map includes: The low-resolution transmission line image is preprocessed to obtain the adapted image, and the part features and first auxiliary features of the parts in the feature are obtained through the Transformer block; The part features are downsampled, and the downsampled part features are combined with the first auxiliary features to obtain the component features and the second auxiliary features of the component in the elements; The component features are downsampled, and the downsampled component features are combined with the second auxiliary features to obtain the equipment features and the third auxiliary features of the device in the elements; The global layout features of the adapted image are obtained by fusing equipment features and third auxiliary features, and multi-scale feature maps are obtained based on part features, component features, equipment features and global layout features.
[0020] Specifically, the preprocessing of the low-resolution transmission line image to obtain the adapted image includes: The low-resolution transmission line image is converted, resized, normalized, and serialized to obtain a suitable image.
[0021] The original low-resolution transmission line image with a size of 800×720 pixels is converted into an RGB three-channel mode. A random cropping strategy is used to extract image blocks of size 256×256 from the low-resolution transmission line image. For images smaller than the target cropping size, bilinear interpolation is used to adjust them to the target size to ensure spatial consistency of the input. After adjustment, the image pixel values of the image blocks are normalized to the range of [-1,1]. The 256×256×3 input image is converted into a 64×64×64 feature map using a 7×7 convolution kernel, stride of 4, and padding of 3. The 64×64×64 feature map is flattened into a two-dimensional sequence representation to obtain the adapted image. The batch size is B, the sequence length is N=64×64=4096, the feature dimension is C=64, and the application layer normalizes and stabilizes the feature distribution.
[0022] A hierarchical Transformer encoder is constructed using multi-stage feature downsampling and a self-attention mechanism. The acquisition of part features and first auxiliary features from the elements through Transformer blocks involves three stages: the first encoding stage (main path processing), the first feeding-forward network processing, and the first auxiliary path processing. The input to the first encoding stage (main path processing) is the features corresponding to the adaptation image. It initiates two cascaded Transformer blocks, each performing multi-head self-attention computation. The 64-dimensional features corresponding to the adaptation image are divided into two attention heads, each processing a 32-dimensional subspace with a space reduction ratio of 4. The query matrix maintains the original sequence length, reshaping the features into a four-dimensional tensor. A convolutional downsampling with a stride of 4 is applied. Based on these settings, downsampling of the key-value matrix and attention computation are performed, followed by flattening to obtain the reduced key-value sequence. The first feeding-forward network processing uses a scaling ratio of 4, inserts depthwise separable convolutions to enhance local modeling, and employs GELU as the activation function. Based on these settings, the output of the first encoding stage (main path processing) is expanded, compressed, and convolved to further optimize feature acquisition of part features, specifically the texture features of the parts. The first stage, auxiliary path processing, involves secondary feature extraction from the features output by the main path processing in the first encoding stage. A first auxiliary feature of 80×80×128 is generated through a 3×3 convolution with a stride of 2. This first auxiliary feature provides multi-scale contextual information for the next stage. Next, the part features are downsampled, and the downsampled part features are combined with the first auxiliary feature to obtain the component features and second auxiliary features within the elements. Specifically, the features output by the main path processing in the first encoding stage are downsampled and convolved to obtain 80×80×128 part features. These part features are then element-wise added to the first auxiliary feature, and the component features are obtained through the Transformer processing in the second encoding stage. The Transformer processing in the second encoding stage contains two Transformer blocks. The attention calculation in each block uses a spatial reduction ratio of 2, and the residual connections employ a random depth strategy. The 80×80×128 features are downsampled to 40×40×320 to obtain the second auxiliary feature. This second auxiliary feature contains more abstract semantic information, supplementing the deep encoding. The component features are downsampled, and the downsampled component features are combined with the second auxiliary features to obtain the equipment features and the third auxiliary features of the elements. Specifically, the component features are downsampled to 40×40×320 and fused with the second auxiliary features. After processing by two Transformer blocks, the number of attention heads is increased to 4 to model more complex spatial relationships, thereby obtaining the equipment features and the 20×20×512 third auxiliary features, which are high-level semantic features. These features encode the global structure and contextual relationships of the power transmission equipment.The process of fusing device features and third-aid features to obtain global layout features for the adapted image specifically involves: increasing the dimension of device features to 512, fusing them with the third-aid features, and then passing them through two Transformer blocks. Four attention heads and full-resolution attention are then used to obtain global layout features. The encoder outputs features at four scales, forming a feature pyramid that provides the decoder with multi-level information from coarse to fine.
[0023] S2: Obtain the channel weights of each channel in the multi-size feature map through cross-channel attention, and adaptively optimize the initial channel feature map according to the channel weights to obtain the optimized channel feature map.
[0024] In some embodiments, obtaining the channel weights of the channels corresponding to each size feature map in the multi-size feature map through cross-channel cross attention includes: Normalize the feature maps of each size, and divide the channels corresponding to each size feature map equally to obtain the first size feature map and the second size feature map; Perform independent linear transformations on the first-size feature map to generate the corresponding first query, first key, and first value; perform independent linear transformations on the second-size feature map to generate the corresponding second query, second key, and second value. Obtain the first similarity between the first key and the first query, normalize the first similarity to obtain the initial weight of the channel corresponding to the first size feature map, and use the initial weight of the channel corresponding to the first size feature map to weight the second value to obtain the first weighted value. Obtain the final weight of the channel corresponding to the first size feature map based on the first weighted value. Obtain the second similarity between the second key and the second query, normalize the second similarity to obtain the initial weight of the channel corresponding to the second size feature map, and use the initial weight of the channel corresponding to the second size feature map to weight the first value to obtain the second weighted value. Obtain the final weight of the channel corresponding to the second size feature map based on the second weighted value. The channel weights are obtained by concatenating the final weights of the channels corresponding to the first-size feature map and the final weights of the channels corresponding to the second-size feature map.
[0025] Cross-channel attention focuses on the relationships between channels of different feature maps and the exchange and weighting of information between feature maps of two sizes. Essentially, it allows feature maps of two sizes to check each other, repeatedly strengthening channels of key elements and negating channels of background and artifacts through bidirectional cross-attention, ultimately achieving precise focus on key elements and effective filtering of interference. The expression for evenly dividing the channels corresponding to each size feature map to obtain the first and second size feature maps is as follows: , This represents the first-size feature map. This represents the second-size feature map. Showing feature diagrams for each size, This indicates the number of channels corresponding to each size feature map. This represents a uniform segmentation operation. The expression for generating the corresponding query, key, and value by performing independent linear transformations on the size feature map is: ,when When =1, Indicates the first query. Indicates the first key. Indicates the first value. This indicates that an independent linear transformation is performed on the i-th size feature map. Represents the first size feature map, when When =2, This indicates the second query. Indicates the second key. Indicates the second value. This represents the second-size feature map. The second value is weighted using the initial weights of the channels corresponding to the first-size feature map to obtain the first output feature. A first weighted value is obtained based on the first output feature, and the final weights of the channels corresponding to the first-size feature map are obtained based on the first weighted value. The expression for weighting the second value using the initial weights of the channels corresponding to the first-size feature map to obtain the first output feature is: , Indicates the first output feature. This indicates a normalization operation. Indicates the first query. Indicates the first key. Indicates the second value. Indicates the scaling factor. This represents the initial weights of the channels corresponding to the first-sized feature map. The first value is weighted using the initial weights of the channels corresponding to the second-sized feature map to obtain the second output feature. A second weighted value is obtained based on the second output feature, and the final weights of the channels corresponding to the second-sized feature map are obtained based on the second weighted value. The expression for weighting the first value using the initial weights of the channels corresponding to the second-sized feature map to obtain the second output feature is: , This represents the second output feature. This indicates the second query. Indicates the second key. Indicates the first value. This represents the initial weights of the channels corresponding to the second-size feature map.
[0026] In other embodiments, after obtaining the first output feature and the second output feature, the formula is used. The first output feature and the second output feature are concatenated to obtain an optimized size feature map. Channel weights are then obtained based on the optimized size feature map. This represents the optimized size feature map. Indicates independent linear transformation operations. This indicates a splicing operation. This indicates that the elements in the optimized size feature map are of real number type. This represents the height of the optimized size feature map, i.e., the number of pixels or elements in the vertical direction. This represents the width of the optimized size feature map, i.e., the number of pixels or elements in the horizontal direction.
[0027] Specifically, the step of adaptively optimizing the initial channel feature map based on the channel weights to obtain the optimized channel feature map includes: The channel weights are multiplied by the initial channel feature map to obtain the process channel feature map, and the process channel feature map is added to the initial feature map to obtain the optimized channel feature map.
[0028] S3: Capture the positional relationships between elements in low-resolution power transmission line images through linear attention. Based on these positional relationships, combine optimized channel feature maps to progressively restore the low-resolution power transmission line images and obtain high-resolution power transmission line images.
[0029] The method of capturing the positional relationships between elements in low-resolution power line images through linear attention includes: The third query, third key, and third value of the adapted image obtained by preprocessing low-resolution transmission line images are obtained through linear attention. The third query and the third key are nonlinearly mapped by a preset kernel function to obtain the mapping query and the mapping key. The mapping query and the mapping key are used as inputs for rotation position encoding to obtain the fourth query and the fourth key. Aggregate the fourth query with the third value to obtain the global key-value pair library, and perform a dot product between the fourth query and the fourth key to obtain the normalization factor; Global location association features are obtained based on a global key-value pair library and a normalization factor, and the location relationships between elements are obtained based on these global location association features.
[0030] The core of linear attention is to reduce computational complexity from the quadratic level of the sequence length to the linear level, making it suitable for long sequence tasks. In this embodiment, linear attention simplifies attention computation, reducing complexity to linear, and efficiently captures the positional relationships between elements. It can effectively capture the continuity and directional characteristics of transmission lines, thus balancing long-range dependencies and inspection efficiency. In this embodiment, the preset kernel function is specifically a kernel function of ELU plus 1. The expression for obtaining the fourth query and the fourth key by using the mapping query and mapping key as inputs for rotation position encoding is: , ,in, This indicates the fourth query. Represents the RoPE rotation matrix. This represents the activation function. This represents the feature matrix corresponding to the adapted image. and Each represents the projection matrix of the lesson. Indicates the fourth key. Indicates a mapping query. This represents the mapping key. In this embodiment, it refers to global key-value pairs. , Indicates the third value. Represents the sequence length corresponding to the adapted image, and the normalization factor. , Let be the mean vector of the vector corresponding to the third key. It is an extremely small positive number, used to prevent division by zero errors during calculation, ensure numerical stability, and represent a global positional correlation feature. The process of obtaining positional relationships between features based on global positional association features includes: obtaining the final output features based on global positional association features, and obtaining the positional relationships between features based on the final output features. The expression for obtaining the final output features based on global positional association features is as follows: , This represents the final output feature. This represents element-wise multiplication. This represents the activation function. This indicates that the gating projection can be learned. This indicates a local location encoding.
[0031] The process of progressively restoring low-resolution power transmission line images to obtain high-resolution power transmission line images by combining positional relationships with optimized channel feature maps includes: The first high-resolution transmission line image is obtained by restoring the low-resolution transmission line image based on the global channel feature map in the optimized channel feature map and the global positional relationship in the positional relationship. The second high-resolution transmission line image is obtained by restoring the first high-resolution transmission line image based on the local channel feature map in the optimized channel feature map and the local positional relationship in the positional relationship. The high-resolution transmission line image is obtained by restoring the second high-resolution transmission line image based on the detail channel feature map in the optimized channel feature map and the detail positional relationship in the positional relationship.
[0032] In this embodiment, positional relationships are combined with optimized channel feature maps and input to the decoder to obtain a feature set of the hierarchical Transformer encoder, containing a complete information hierarchy from low-level texture to high-level semantics. In this embodiment, detail channel feature maps correspond to part features in the feature set, local channel feature maps correspond to component features and equipment features in the feature set, and global channel feature maps correspond to global layout features in the feature set. First, the general outline is restored using global channel feature maps and global positional relationships; then, structural details are supplemented using local channel feature maps and local positional relationships; finally, texture is refined using detail channel feature maps and detail positional relationships. The technical implementation includes: upsampling of the deepest layer features, upsampling 20×20×512 features to 40×40×320 using transposed convolution to restore spatial resolution; feature alignment processing, adjusting to the same size by boundary padding when the upsampled features do not match the target feature spatial size; and a residual fusion mechanism, where the fused features contain residual structures with a scaling factor of 0. 1. Stable training; Stepwise upsampling process, repeating the upsampling-fusion process to generate 80×80×128 features; Continue to restore spatial resolution, generating 160×160×64 features, gradually reconstructing image details; Upsampling beyond the encoder scale, expanding to 320×320×16, further refining spatial details; Approaching the original resolution, reaching 640×640×8, preparing for final image generation; Feature-to-image mapping, converting 8-channel features into RGB images; Output range constraint, applying tanh activation to limit the output to [-1,1].
[0033] In this embodiment, the network parameters of the hierarchical Transformer encoder, cross-channel attention, or linear attention are optimized using a composite loss function. The specific steps are as follows: training data batch organization, with each batch containing 64 pairs of low-resolution and high-resolution images; validation set configuration, containing 300 pairs of images with a batch size of 8, used to monitor the training progress; perceptual loss network preparation, using the first 16 layers of a pre-trained VGG16 to extract multi-scale features; optimizer initialization, using the Adam algorithm with an initial learning rate of... The forward computation process takes a high-resolution image generated by the network as input and then calculates the content loss using Smooth L1. Calculate perceived loss The total loss function is Where λ=0.04; gradient calculation and backpropagation to update network parameters; learning rate scheduling, the learning rate is decayed by 50% every 100 rounds; training monitoring metric PSNR calculation, reflecting the signal-to-noise ratio of the reconstructed image; structural similarity assessment (SSIM), which comprehensively considers brightness, contrast and structural information; checkpoint saving, saving the optimal and latest model parameters; training log recording, recording the time, loss and validation metrics for each round.
[0034] As shown in Table 1, PSNR represents peak signal-to-noise ratio, and the larger the value, the better the image quality. SSIM represents structural similarity, with a value of 0-1. The closer to 1, the more similar the image structure is to the real image. Transweather is the method used in this invention. As can be seen from the table below, this invention is significantly more effective than traditional methods. Table 1. Comparison of Results The network architecture diagram of this method is as follows: Figure 2 As shown, Input LR Image represents the input low-resolution power line image; Patch Embedding represents segmenting the low-resolution power line image; Cross Attention represents cross-channel attention; Linear Attention represents linear attention; Output SR Image represents the output high-resolution power line image; CrossAttention represents the internal operating mechanism of cross-channel attention; Linear Attention represents the internal operating mechanism of linear attention; Encoder Block represents the encoder block, which is the basic unit for feature encoding in the network, composed of modules such as cross-channel attention and linear attention, and is repeated N times; Decoder Block represents the decoder block, used to decode the features output by the encoder to reconstruct the high-resolution power line image; Feature Interaction represents feature interaction, realizing information interaction between different features in the cross-attention module; Position Embedding represents position embedding, adding position information to features, allowing the network to perceive the spatial positional relationship of features; Layernorm represents layer normalization, normalizing features to stabilize network training; Input Features represent input features; Output Features represent output features. The comparison of the super-resolution effect of the Proposed method and traditional methods on power line images is shown in the figure below. Figure 3 As shown in the comparison, it can be seen that the present invention has a significantly better effect on restoring low-resolution transmission line images compared with traditional methods.
[0035] Example 2: This embodiment also provides a transmission line image resolution reconstruction system with cross-channel cross-attention, applicable to the aforementioned transmission line image resolution reconstruction method with cross-channel cross-attention, including: The feature extraction module is used to extract features from the input low-resolution power line image through the constructed hierarchical Transformer encoder to obtain multi-scale feature maps; The optimized channel feature map acquisition module is used to obtain the channel weights of each size feature map in the multi-size feature map through cross-channel cross attention, and to adaptively optimize the initial channel feature map based on the channel weights to obtain the optimized channel feature map; The high-resolution power transmission line image acquisition module is used to capture the positional relationships between elements in a low-resolution power transmission line image through linear attention. Based on these positional relationships, and combined with optimized channel feature maps, the low-resolution power transmission line image is progressively restored to obtain a high-resolution power transmission line image.
[0036] In this embodiment, the step of obtaining the channel weights of the channels corresponding to each size feature map in the multi-size feature map through cross-channel cross-attention includes: normalizing each size feature map and evenly distributing the channels corresponding to each size feature map to obtain a first size feature map and a second size feature map; performing independent linear transformations on the first size feature map to generate corresponding first query, first key, and first value, and performing independent linear transformations on the second size feature map to generate corresponding second query, second key, and second value; obtaining the first similarity between the first key and the first query, normalizing the first similarity to obtain the initial weights of the channels corresponding to the first size feature map, and using the first... The initial weights of the channels corresponding to a first-sized feature map are weighted by a second value to obtain a first weighted value. The final weights of the channels corresponding to the first-sized feature map are then obtained based on the first weighted value. A second similarity between the second key and the second query is obtained, and this second similarity is normalized to obtain the initial weights of the channels corresponding to the second-sized feature map. These initial weights are then used to weight the first value to obtain a second weighted value. The final weights of the channels corresponding to the second-sized feature map are then obtained based on the second weighted value. Finally, the final weights of the channels corresponding to the first and second-sized feature maps are concatenated to obtain the channel weights. The adaptive optimization of the initial channel feature map based on the channel weights to obtain an optimized channel feature map includes: multiplying the channel weights by the initial channel feature map to obtain a process channel feature map, and adding the process channel feature map to the initial feature map to obtain an optimized channel feature map. By obtaining the channel weights of the channels corresponding to each size feature map in the multi-size feature map through cross-channel cross-attention, and adaptively optimizing the initial channel feature map based on these channel weights to obtain an optimized channel feature map, the system can accurately focus on key elements and reduce interference from background and artifacts.
[0037] The specific embodiments described above are preferred embodiments of the cross-channel cross-attention transmission line image resolution reconstruction method and system of the present invention, and are not intended to limit the specific scope of the present invention. The scope of the present invention includes but is not limited to the specific embodiments described above. All equivalent changes made in accordance with the shape and structure of the present invention are within the protection scope of the present invention.
Claims
1. A method for reconstructing transmission line image resolution using cross-channel cross-attention, characterized in that, Includes the following steps: Multi-scale feature maps are obtained by extracting features from the input low-resolution power line image using a constructed hierarchical Transformer encoder. By obtaining the channel weights of each channel corresponding to the feature map of each size in the multi-size feature map through cross-channel attention, the initial channel feature map is adaptively optimized based on the channel weights to obtain the optimized channel feature map; Linear attention is used to capture the positional relationships between elements in low-resolution power transmission line images. Based on these positional relationships, combined with optimized channel feature maps, the low-resolution power transmission line images are progressively restored to obtain high-resolution power transmission line images.
2. The method for reconstructing transmission line image resolution using cross-channel cross-attention according to claim 1, characterized in that, The step of extracting features from the input low-resolution power line image using a constructed hierarchical Transformer encoder to obtain a multi-scale feature map includes: The low-resolution transmission line image is preprocessed to obtain the adapted image, and the part features and first auxiliary features of the parts in the feature are obtained through the Transformer block; The part features are downsampled, and the downsampled part features are combined with the first auxiliary features to obtain the component features and the second auxiliary features of the component in the elements; The component features are downsampled, and the downsampled component features are combined with the second auxiliary features to obtain the equipment features and the third auxiliary features of the device in the elements; The global layout features of the adapted image are obtained by fusing equipment features and third auxiliary features, and multi-scale feature maps are obtained based on part features, component features, equipment features and global layout features.
3. The method for reconstructing transmission line image resolution using cross-channel cross-attention according to claim 2, characterized in that, The step of preprocessing low-resolution transmission line images to obtain adapted images includes: The low-resolution power transmission line image is converted in format, resized, normalized and serialized to obtain a suitable image.
4. The method for reconstructing transmission line image resolution using cross-channel cross-attention as described in claim 1, characterized in that, The method of obtaining the channel weights of each size feature map corresponding to the multi-size feature map through cross-channel cross-attention includes: Normalize the feature maps of each size, and divide the channels corresponding to each size feature map equally to obtain the first size feature map and the second size feature map; Perform independent linear transformations on the first-size feature map to generate the corresponding first query, first key, and first value; perform independent linear transformations on the second-size feature map to generate the corresponding second query, second key, and second value. Obtain the first similarity between the first key and the first query, normalize the first similarity to obtain the initial weight of the channel corresponding to the first size feature map, and use the initial weight of the channel corresponding to the first size feature map to weight the second value to obtain the first weighted value. Obtain the final weight of the channel corresponding to the first size feature map based on the first weighted value. Obtain the second similarity between the second key and the second query, normalize the second similarity to obtain the initial weight of the channel corresponding to the second size feature map, and use the initial weight of the channel corresponding to the second size feature map to weight the first value to obtain the second weighted value. Obtain the final weight of the channel corresponding to the second size feature map based on the second weighted value. The channel weights are obtained by concatenating the final weights of the channels corresponding to the first-size feature map and the final weights of the channels corresponding to the second-size feature map.
5. The method for reconstructing transmission line image resolution using cross-channel cross-attention according to claim 1, characterized in that, The step of adaptively optimizing the initial channel feature map based on the channel weights to obtain the optimized channel feature map includes: The channel weights are multiplied by the initial channel feature map to obtain the process channel feature map, and the process channel feature map is added to the initial feature map to obtain the optimized channel feature map.
6. The method for reconstructing transmission line image resolution using cross-channel cross-attention according to claim 1, characterized in that, The method of capturing the positional relationships between elements in low-resolution power line images through linear attention includes: The third query, third key, and third value of the adapted image obtained by preprocessing low-resolution transmission line images are obtained through linear attention. The third query and the third key are nonlinearly mapped by a preset kernel function to obtain the mapping query and the mapping key. The mapping query and the mapping key are used as inputs for rotation position encoding to obtain the fourth query and the fourth key. Aggregate the fourth query with the third value to obtain the global key-value pair library, and perform a dot product between the fourth query and the fourth key to obtain the normalization factor; Global location association features are obtained based on a global key-value pair library and a normalization factor, and the location relationships between elements are obtained based on these global location association features.
7. The method for reconstructing transmission line image resolution using cross-channel cross-attention according to claim 1, characterized in that, The process of progressively restoring low-resolution power transmission line images to obtain high-resolution power transmission line images by combining positional relationships with optimized channel feature maps includes: The first high-resolution transmission line image is obtained by restoring the low-resolution transmission line image based on the global channel feature map in the optimized channel feature map and the global positional relationship in the positional relationship. The second high-resolution transmission line image is obtained by restoring the first high-resolution transmission line image based on the local channel feature map in the optimized channel feature map and the local positional relationship in the positional relationship. The high-resolution transmission line image is obtained by restoring the second high-resolution transmission line image based on the detail channel feature map in the optimized channel feature map and the detail positional relationship in the positional relationship.
8. A transmission line image resolution reconstruction system with cross-channel cross-attention, applicable to the transmission line image resolution reconstruction method with cross-channel cross-attention as described in any one of claims 1-7, characterized in that, include: The feature extraction module is used to extract features from the input low-resolution power line image through the constructed hierarchical Transformer encoder to obtain multi-scale feature maps; The optimized channel feature map acquisition module is used to obtain the channel weights of each size feature map in the multi-size feature map through cross-channel cross attention, and to adaptively optimize the initial channel feature map based on the channel weights to obtain the optimized channel feature map; The high-resolution power transmission line image acquisition module is used to capture the positional relationships between elements in a low-resolution power transmission line image through linear attention. Based on these positional relationships, and combined with optimized channel feature maps, the low-resolution power transmission line image is progressively restored to obtain a high-resolution power transmission line image.