Defect data enhancement method and device for power transmission line
By combining residual connectivity and attention mechanisms in an image rendering model, a high-quality transmission line defect dataset is generated, which solves the problems of insufficient sample diversity and image quality in existing technologies, and improves the accuracy of defect detection and the maintenance capability of power systems.
Patent Information
- Application Number
- CN202511744548.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-25
- Publication Date
- 2026-02-10
AI Technical Summary
Existing technologies have limited sample diversity when generating images of transmission line defects, making it difficult to cover defect types that have not appeared before. Furthermore, the quality of the generated images is insufficient to meet the requirements of high-precision detection, resulting in a decrease in the generalization ability of the defect detection model under small sample conditions.
By acquiring the original defect image dataset, identifying potential defect types through failure mode and impact analysis, generating an extended defect image dataset, and improving the rendering quality of defect and background regions through hybrid enhancement processing and an image rendering model combining residual connectivity and attention mechanisms, a high-quality defect dataset is generated.
It improves the accuracy and cost-effectiveness of transmission line defect detection, while enhancing the realism and practicality of simulated images, providing strong technical support for power system maintenance and fault prevention.
Smart Images

Figure CN121504750A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the technical field of transmission line defect enhancement, specifically relating to a method and apparatus for enhancing defect data of transmission lines. Background Technology
[0002] In power systems, the transmission network serves as the backbone of power transmission, and its stable operation directly impacts the safety and reliability of the entire power grid. Defect detection is a crucial aspect of transmission line operation and maintenance. Early identification of faults such as insulator damage, hardware corrosion, and conductor abnormalities can effectively prevent accidents and avoid large-scale power outages caused by equipment failures, thereby ensuring the stability of electricity supply for social production and residents. However, in actual operation and maintenance, the availability of defect samples is a significant challenge in building high-precision defect detection models, especially for severe or rare types of defects, which are extremely limited in number in real-world scenarios. Because power grid equipment operates normally most of the time with a low probability of failure, the number of defect images available for training is far less than the number of normal samples. This class imbalance severely restricts the generalization ability of supervised learning models.
[0003] Because some defect types may occur with extremely low frequency or be novel defects that have not yet been recorded, there may be no corresponding samples in existing datasets. These "unseen defects" prevent defect detection models from learning relevant features during training, making it difficult to make correct judgments in practical applications. Under such conditions of small or even zero samples, traditional deep learning models trained on large amounts of labeled data often perform poorly, are prone to overfitting, and exhibit significantly reduced generalization ability.
[0004] To alleviate the problem of data scarcity, data augmentation techniques such as Generative Adversarial Networks (GANs) have been introduced to expand the training set by synthesizing artificial defect samples. For example, invention patent application CN111415316A discloses a defect data synthesis algorithm based on GANs, with the following specific steps: 1. Based on existing samples, a depthwise convolutional GAN is used to generate defect foregrounds; 2. For different background images, a set of regions S for placing the defect foreground is determined using a color and texture-based gPbUCM segmentation algorithm; 3. A region R is randomly selected from the set S obtained in step 2, and the corresponding perspective transformation matrix M is obtained through a depth prediction algorithm; 4. A mask image is obtained by randomly selecting from the defect foreground database generated in step 1 and using an edge extraction algorithm; 5. Perspective transformation is applied to the mask image using the perspective transformation matrix M, and color information is added to the transformed defect foreground; 6. Poisson image fusion technology is used to fuse the defect foreground with the background image to synthesize a new image. However, traditional GANs have significant limitations in generating defect images of power transmission equipment. On the one hand, the diversity of its generated samples is limited by the distribution of training data, making it difficult to break out of the framework of existing defect patterns and effectively simulate unknown or rare defect types; on the other hand, the generated images rely on the color and texture information of the background image, and there are gaps between them and real images in terms of detail texture and edge clarity. The image quality is insufficient to support the needs of high-precision detection tasks, and may even introduce false features, interfering with model learning.
[0005] Therefore, how to improve the ability of defect detection models to identify diverse and unknown types of defects under limited sample conditions, and ensure the authenticity and effectiveness of the generated samples, has become an urgent problem to be solved in the field of power visual inspection. Summary of the Invention
[0006] To address the shortcomings of existing technologies, this invention provides a method and apparatus for enhancing defect data in transmission lines. The method includes: acquiring an original defect image dataset of the transmission line; determining the defect type and analyzing it to generate an extended defect image dataset; performing a hybrid enhancement process on the extended defect image dataset and the original defect image dataset to obtain an initial defect image dataset; rendering the defect regions of the initial defect image dataset based on a first image rendering model combining residual connectivity and attention mechanisms to obtain an initial rendered dataset; and rendering the background regions of the initial rendered dataset based on a pre-constructed second image rendering model, combined with the initial defect image dataset and the initial rendered dataset, to obtain an enhanced defect dataset. This invention can improve the accuracy of transmission line defect detection, reduce costs, and enhance the realism and practicality of simulated images, providing strong technical support for power system maintenance and fault prevention.
[0007] In a first aspect, the present invention provides a method for enhancing defect data of transmission lines, comprising: Acquire the original defect image dataset of the transmission line, and determine the defect type and analyze it to generate an extended defect image dataset; The extended defect image dataset and the original defect image dataset are mixed and enhanced to obtain the initial defect image dataset; Based on the first image rendering model that combines residual connections and attention mechanisms, the defect regions of the initial defect image dataset are rendered to obtain the initial rendering dataset. Based on a pre-built second image rendering model, and combined with the initial defect image dataset and the initial rendering dataset, the background area of the initial rendering dataset is rendered to obtain the enhanced defect dataset.
[0008] Furthermore, the defect types are identified and an extended defect image dataset is generated through analysis, including: Potential failure modes of transmission line defects are identified through failure mode and effects analysis, and the defect types are identified. Based on the potential failure modes, each defect type is graphically plotted to obtain a dataset of plotted images; Geometric transformations are performed on the drawn image dataset to obtain an extended defect image dataset.
[0009] Furthermore, the extended defect image dataset and the original defect image dataset are hybridized and enhanced to obtain the initial defect image dataset, which includes: Both the extended defect image dataset and the original defect image dataset are binarized to obtain the corresponding binary masks. The binary mask of the extended defect image dataset is scaled, rotated, affine transformed, morphologically operated and / or combined to obtain the transformed extended defect image dataset. The binary mask of the transformed extended defect image dataset and the binary mask of the original defect image dataset are superimposed, embedded, and / or replaced to obtain a hybrid mask image dataset. The initial defect image dataset is obtained by performing a union operation on the binary masks of the hybrid mask image dataset, the transformed extended defect image dataset, and the original defect image dataset.
[0010] Furthermore, the first image rendering model includes an encoder, a bottleneck layer, a decoder, and an output layer connected in sequence; Based on the first image rendering model combining residual connectivity and attention mechanisms, the defect regions of the initial defect image dataset are rendered to obtain the initial rendering dataset, which includes: The encoder performs multiple downsampling processes on all binary masks in the initial defect image dataset, combining residual connections and attention mechanisms. The bottleneck layer performs context information aggregation on the result of the last downsampling process and then inputs it into the decoder. The decoder, which has skip connections with the encoder, performs multiple upsampling processes on the results of multiple downsampling processes and the results of context information aggregation processes, combining residual connections and attention mechanisms. The output layer performs feature mapping on the result of the last upsampling process to obtain the first rendering feature map corresponding to each binary mask, thus providing the initial rendering dataset.
[0011] Furthermore, multiple downsampling processes combining residual connections and attention mechanisms are performed sequentially, including: The binary mask is subjected to the first batch of normalization, the first activation operation and the first convolution process in sequence to give the first intermediate feature; The first intermediate feature is input into the first attention mechanism layer for feature enhancement processing in the channel or spatial dimension, and the first enhanced feature is given. The first enhanced feature and the first intermediate feature are added element by element, and then the second activation operation is performed. The result is then fed into the first residual network layer for feature extraction, which produces a downsampled feature map.
[0012] Furthermore, multiple upsampling processes are performed, combining residual connections and attention mechanisms, including: The result of the context information aggregation process or the previous upsampling process is concatenated with the downsampling process result of the corresponding jump connection. The splicing results are subjected to a second batch normalization, a third activation operation, and a second convolution process in sequence to give the second intermediate feature. The second intermediate feature is input into the second attention mechanism layer for feature enhancement processing in the channel or spatial dimension, resulting in the second enhanced feature. The second enhanced feature and the second intermediate feature are added element by element, and then the fourth activation operation is performed. The result is then fed into the second residual network layer for feature extraction, which produces an upsampled feature map.
[0013] Furthermore, the second intermediate feature is input into the second attention mechanism layer for channel or spatial dimension feature enhancement processing, resulting in a second enhanced feature, specifically including: Max pooling and average pooling are performed on the second intermediate feature, respectively; The spatial weights are obtained by concatenating the results of max pooling and average pooling and then learning through convolution. The spatial weights are weighted together with the second intermediate feature to obtain the second enhanced feature.
[0014] Furthermore, based on the pre-built second image rendering model, and combining the initial defect image dataset and the initial rendering dataset, the background region of the initial rendering dataset is rendered to obtain the enhanced defect dataset, including: The initial diffusion rendering dataset is obtained by progressively adding forward Gaussian noise to the initial rendering dataset. The conditional information corresponding to the initial diffusion rendering dataset, which contains defect features and background features, is obtained and fused with the multi-channel vector to obtain the conditional vector; wherein, the multi-channel vector includes the initial defect image dataset and the initial rendering dataset; Conditional vector embedding is combined with a denoising network module that integrates residual connections and attention mechanisms. The initial diffusion rendering dataset is then denoised based on the denoising network module with embedded conditional vectors, providing the predicted noise for the current step of the initial diffusion rendering dataset. Based on the predicted noise of the current step, the initial diffusion rendering dataset is back-diffused to give the initial diffusion rendering dataset of the previous step. Repeat the above denoising and update steps until the predetermined conditions are met, and give the final enhanced defect dataset.
[0015] Furthermore, a denoising network module based on embedded conditional vectors denoises the initial diffusion rendering dataset, providing the predicted noise for the current step of the initial diffusion rendering dataset, including: The initial diffusion rendering dataset is concatenated with the conditional vector and then cyclically encoded to obtain a multi-scale diffusion feature set. The encoding process includes downsampling, attention weighting, and residual connection in sequence. Based on the reverse order of the diffusion feature sets at different scales, the multi-scale diffusion feature sets are concatenated with the conditional vector and then sequentially decoded to obtain the prediction noise of the current step in the initial diffusion rendering dataset; wherein, the decoding process includes sequential upsampling, attention weighting and residual connection.
[0016] Secondly, the present invention also provides a defect data enhancement device for transmission lines, employing the aforementioned defect data enhancement method for transmission lines, the device comprising: The data acquisition module is used to acquire the original defect image dataset of the transmission line, as well as to determine the defect type and analyze and generate an extended defect image dataset. The data mixing module is used to perform mixing and enhancement processing on the extended defect image dataset and the original defect image dataset to obtain the initial defect image dataset. The defect rendering module is used to render the defect regions of the initial defect image dataset based on the first image rendering model that combines residual connections and attention mechanisms, so as to obtain the initial rendering dataset. The background rendering module is used to render the background area of the initial rendering dataset based on a pre-built second image rendering model, combined with the initial defect image dataset and the initial rendering dataset, to obtain the enhanced defect dataset.
[0017] The present invention provides a method and apparatus for enhancing defect data of transmission lines, which has at least the following beneficial effects: (1) By acquiring and analyzing the original defect image dataset, the defect type is determined and an extended defect image dataset is generated. Based on this, a hybrid enhancement process is performed to obtain the initial defect image dataset. Combined with the first image rendering model, the defect area of the initial defect image dataset is rendered. Through the second image rendering model, the background area of the initial rendering dataset output by the first image rendering model is rendered to obtain the enhanced defect dataset. While improving the accuracy of transmission line defect detection and reducing costs, it also enhances the realism and practicality of the simulated image, providing strong technical support for the maintenance and fault prevention of the power system.
[0018] (2) By constructing an initial defect image dataset, the statistical characteristics of the real defects in the original defect images are preserved. Based on this, the binary mask of the hybrid mask image dataset and the binary mask of the transformed extended defect image dataset are generated, which expands the morphological diversity of defect images and enhances the coverage of low-frequency defects and potential defect patterns.
[0019] (3) The binary mask of the generated transformed extended defect image dataset is ensured to conform to the physical failure mechanism by drawing images drawn by experts, and the morphological coverage of the initial defect image dataset is significantly improved by transformation and mixing operations, and the data diversity is enhanced.
[0020] (4) The first image rendering model focuses on the mask edges and key areas through the attention mechanism to generate a coarse rendering defect outline that is close to reality, and uses residual connections to alleviate gradient vanishing. The first image rendering model achieves high-quality mapping from abstract mask to concrete defect image by integrating the spatial symmetry of UNet (encoder and decoder), the gradient optimization mechanism of ResNet and the detail enhancement capability of attention, providing a solid foundation for subsequent background fusion and realism enhancement. Attached Figure Description
[0021] Figure 1 A flowchart illustrating a method for enhancing defect data of transmission lines provided in an embodiment of the present invention; Figure 2 A flowchart for obtaining an initial defect image dataset provided in an embodiment of the present invention; Figure 3 A flowchart for obtaining the initial rendering dataset provided in an embodiment of the present invention; Figure 4 A model architecture diagram of the first image rendering model provided in an embodiment of the present invention; Figure 5 A flowchart for obtaining an enhanced defect dataset provided in an embodiment of the present invention; Figure 6 This is a structural block diagram of a defect data enhancement device for power transmission lines provided in an embodiment of the present invention.
[0022] Among them, 201 is the data acquisition module; 202 is the data mixing module; 203 is the defect rendering module; and 204 is the background rendering module. Detailed Implementation
[0023] To better understand the above technical solutions, a detailed description of the solutions will be provided below in conjunction with the accompanying drawings and specific embodiments. Obviously, the described embodiments are merely some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0024] The terminology used in the embodiments of this invention is for the purpose of describing particular embodiments only and is not intended to limit the invention. The singular forms “a,” “the,” and “the” as used in the embodiments of this invention and the appended claims are also intended to include the plural forms, and “multiple” generally includes at least two unless the context clearly indicates otherwise.
[0025] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that an article or device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such an article or device. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the article or device that includes said element.
[0026] In power transmission network defect detection, accurate defect identification is crucial for ensuring the safety and reliability of the power grid. While traditional generative adversarial networks (GANs) can generate artificial defect samples, the diversity of these samples is limited, making it difficult to cover previously unseen defect types, and the quality of the generated images may be insufficient for practical needs. To address the problem of limited defect identification capabilities of efficient defect detection models trained under small sample conditions due to the scarcity of actual defect samples, especially for rare or previously unseen defect types, this invention proposes a method and apparatus for enhancing defect data in power transmission lines. The method includes: acquiring an original defect image dataset of the power transmission line; determining the defect type and analyzing it to generate an extended defect image dataset; performing hybrid enhancement processing on the extended defect image dataset and the original defect image dataset to obtain an initial defect image dataset; rendering the defect regions of the initial defect image dataset based on a first image rendering model combining residual connections and attention mechanisms to obtain an initial rendered dataset; and rendering the background regions of the initial rendered dataset based on a pre-constructed second image rendering model, combined with the initial defect image dataset and the initial rendered dataset, to obtain an enhanced defect dataset. By combining expert knowledge, optimizing experimental design, and utilizing advanced generative models to efficiently generate diverse and high-quality defect images, this method provides ample data support for intelligent defect detection in small-sample scenarios. While improving the accuracy of transmission line defect detection and reducing costs, it also enhances the realism and practicality of simulated images, providing strong technical support for power system maintenance and fault prevention.
[0027] like Figure 1 As shown, the present invention provides a method for enhancing defect data of transmission lines, the specific steps of which are as follows: S101: Obtain the original defect image dataset of the transmission line, and determine the defect type and analyze it to generate an extended defect image dataset.
[0028] The original defect image dataset for transmission lines includes images of transmission line defects corresponding to faults that occur during actual use; it is a collection of real defect images of transmission lines. The extended defect image dataset is a collection of transmission line defect images generated by analyzing the original defect image dataset and corresponding defect types; it is an expansion of the real defect images of transmission lines.
[0029] Furthermore, the defect types are identified and an extended defect image dataset is generated through analysis, including: Potential failure modes of transmission line defects are identified through failure mode and effects analysis, and the defect types are identified. Based on the potential failure modes, each defect type is graphically plotted to obtain a dataset of plotted images; Geometric transformations are performed on the drawn image dataset to obtain an extended defect image dataset.
[0030] Failure Mode and Effects Analysis (FMEA) is a systematic method for identifying potential failure modes and their effects in transmission lines. Through in-depth analysis of the transmission line system, subsystems, or components, it predicts potential problems and develops preventative measures. This invention applies FMEA to the expansion of the original defect image dataset. By analyzing possible failure modes of the transmission line, it identifies various potential defect types and their effects, providing a scientific basis and systematic framework for enhancing the original defect image dataset. In a specific example, a 50-kilometer-long transmission line mainly consists of aluminum alloy conductors, fittings, and insulators. The aluminum alloy conductors are exposed to humid, salt spray, and lightning strike environments. Historical data shows that surface defects are the main source of failure for the aluminum alloy conductors. FMEA is used to identify potential failure modes of conductor surface defects, assess risks, and propose preventative measures to improve line reliability and reduce outage time. Historical data is obtained through historical maintenance records of the aluminum alloy conductors, field inspection data, and simulation tests.
[0031] Specifically, firstly, structural and functional analyses are performed on the aluminum alloy conductor: the conductor is decomposed into sub-components including the conductor surface and internal structure. Then, based on the defect states and shapes in historical data, such as "cracks (V-shaped)" or "porosity (circular)," potential failure modes are identified. For each defect state in the historical data, the corresponding causes (e.g., corrosion, manufacturing defects) and effects (e.g., increased resistance leading to overheating, eventual breakage causing power outage) are listed. For example, the failure mode is "V-shaped cracks appear on the surface of the aluminum alloy conductor, possibly caused by lightning strikes or mechanical fatigue, with the effect of a local short circuit." Finally, a risk assessment is performed. In this example, a 1-10 scale is used to evaluate the severity (S), occurrence (O), and detection rate (D) of various failure modes of the aluminum alloy conductor, and the risk priority number RPN is calculated based on this: RPN = S × O × D. In this example, if the risk priority number RPN exceeds the risk threshold of 100, immediate action is required; specific data is shown in Table 1.
[0032] Table 1 Failure Analysis Table
[0033] In one specific implementation, based on the failure mode analysis results of FMEA, the corresponding defects in the original defect image dataset are divided into multiple defect types. For each defect type, typical defect shapes corresponding to multiple defect types are drawn to form a drawn image dataset. Then, geometric transformations are performed on the drawn image dataset to obtain an extended defect image dataset. These geometric transformation operations include scaling, rotation, affine transformation, morphological operations, and combination operations. Affine transformations include shearing and translation; morphological operations are used to simulate edge blurring or local missing parts, including erosion, dilation, and opening / closing operations; combination operations are used to simulate composite defects, including performing logical AND, OR, and OR operations on standard binary masks of multiple drawn images; scaling involves scaling the drawn images by a random ratio; and rotation involves rotating the drawn images by a random angle. It is understood that the process of performing geometric transformations on the drawn images can be a single transformation operation or a combination of multiple transformation operations. The order in which these transformation operations are combined will also affect the effect of the extended defect images in the extended defect image dataset.
[0034] S102: Perform hybrid enhancement processing on the extended defect image dataset and the original defect image dataset to obtain the initial defect image dataset.
[0035] Furthermore, the extended defect image dataset and the original defect image dataset are mixed and enhanced to obtain the initial defect image dataset, referring to... Figure 2 ,include: Both the extended defect image dataset and the original defect image dataset are binarized to obtain the corresponding binary masks. The binary mask of the extended defect image dataset is scaled, rotated, affine transformed, morphologically operated and / or combined to obtain the transformed extended defect image dataset. The binary mask of the transformed extended defect image dataset and the binary mask of the original defect image dataset are superimposed, embedded, and / or replaced to obtain a hybrid mask image dataset. The initial defect image dataset is obtained by performing a union operation on the binary masks of the hybrid mask image dataset, the transformed extended defect image dataset, and the original defect image dataset.
[0036] In one specific implementation, the original defect image dataset is D. real ={I i}, where I i ∈R H×W×C Let H represent the i-th original defect image, where H and W are the spatial resolutions of the original defect image, and C is the number of channels in the original defect image. The set of original defect masks corresponding to the original defect image dataset is M.real ={M i}, where M i ∈{0,1} H×W This is a binary mask used to mark the defect region in the original defect image. If the binary mask is 1, it means that the corresponding region in the original defect image is a defect region. If the binary mask is 0, it means that the corresponding region in the original defect image is a background region.
[0037] Based on the failure mode analysis results of FMEA, the corresponding defects in the original defect image dataset are divided into K defect types, denoted as C={c1,c2,...,c...}. k For each defect type c k Draw P k The typical defect shapes corresponding to each defect type form a dataset S of images for rendering. k ={s k,p |p=1,...P k}, where s k,p For experts in the field, based on defect type c k The p-th hand-drawn image. After processing the drawn image, an extended defect image dataset is obtained. The extended defect images are then binarized and morphologically processed, and converted into a binary mask m. k,p =Bin(s k,p )∈{0,1} H×W .
[0038] Based on the binary mask of the extended defect image in the extended defect image dataset, geometric transformation enhancement is performed on the extended defect image to obtain the transformed extended defect image dataset. Specifically, for each m... k,p Apply a set of differentiable geometric transformation operations T={T θ |θ∈Θ}, where θ is the transformation parameter and Θ is the parameter space. Geometric transformation operations include scaling, rotation, affine transformation, morphological operations, and combination operations. Affine transformations include shearing and translation; morphological operations are used to simulate edge blurring or local defects, including erosion, dilation, and opening / closing operations; combination operations are used to simulate complex defects, including performing logical AND, OR, and OR operations on binary masks of multiple extended defect image datasets; scaling is specifically represented as:
[0039] Rotation is specifically represented as:
[0040] T scale (m,α) represents a scaling operation on the binary mask m of the extended defect image dataset with a scaling factor of α, and Resize() is the scaling function. rot(m,β) represents a rotation operation of angle β on the binary mask m of the extended defect image dataset, where Rotate() is the rotation function. The transformed extended defect image dataset is specifically represented as follows: , where p(Θ) is the sampling distribution of the transformation parameters (such as a uniform distribution or a priori distribution based on the physical properties of the defect).
[0041] The binary mask M of the original defect image dataset i ∈M real Binary mask m of the transformed extended defect image dataset k,p ∈ME performs blending operations to generate more realistic and novel blending masks. Blending operations include superposition, embedding, and replacement. Blending operation M hybrid Specifically, it is expressed as follows:
[0042] Where Φ represents the combination method of mixed operations, and Compose() is the function for combining mixed operations.
[0043] In a specific example, when Φ = superposition, the blending operation M hybrid Specifically, it is expressed as follows:
[0044] When Φ=embedding, it means placing the binary mask of the transformed and extended defect image dataset at a specific location (such as the edge or center) of the binary mask of the original defect image dataset. When Φ=replacement, it means replacing the local region of the binary mask of the original defect image dataset with the binary mask of the transformed and extended defect image dataset.
[0045] The binary masks of the hybrid masked image dataset, the transformed extended defect image dataset, and the original defect image dataset are combined to obtain the initial defect image dataset MHDA, specifically represented as follows:
[0046] Among them, M hybrid M is a binary mask for a mixed masked image dataset. real is the binary mask for the original defect image dataset, and ME is the binary mask for the transformed extended defect image dataset.
[0047] By constructing an initial defect image dataset, the statistical characteristics of real defects in the original defect images are preserved. Based on this, binary masks for the hybrid mask image dataset and binary masks for the transformed extended defect image dataset are generated, expanding the morphological diversity of defect images and especially enhancing the coverage of low-frequency defects and potential defect patterns.
[0048] The expert-drawn images ensure that the binary mask of the generated transformed extended defect image dataset conforms to the physical failure mechanism, and the morphological coverage of the initial defect image dataset is significantly improved through transformation and blending operations, thus enhancing data diversity. High-quality training samples can still be generated even in scenarios where real-world data is scarce.
[0049] S103: Based on the first image rendering model that combines residual connections and attention mechanisms, the defect regions of the initial defect image dataset are rendered to obtain the initial rendering dataset.
[0050] Furthermore, the first image rendering model includes an encoder, a bottleneck layer, a decoder, and an output layer connected in sequence; Based on the first image rendering model combining residual connectivity and attention mechanisms, the defect regions of the initial defect image dataset are rendered to obtain the initial rendering dataset, which is then referenced. Figure 3 ,include: The encoder performs multiple downsampling processes on all binary masks in the initial defect image dataset, combining residual connections and attention mechanisms. The bottleneck layer performs contextual information aggregation on the result of the last downsampling process and then inputs it into the decoder. The decoder, which has skip connections with the encoder, performs multiple upsampling processes on the results of multiple downsampling processes and the results of context information aggregation processes, combining residual connections and attention mechanisms. The output layer performs feature mapping on the result of the last upsampling process to obtain the first rendering feature map corresponding to each binary mask, thus providing the initial rendering dataset.
[0051] Furthermore, refer to Figure 4 The encoder includes multiple downsampling layers that combine residual connections and attention mechanisms, and the decoder includes multiple upsampling layers. The upsampling layer includes an upsampling sub-layer and a feature fusion layer that combines residual connections and attention mechanisms. After the downsampling layer and the upsampling sub-layer are skipped, the downsampling layer includes a batch normalization layer, a first activation operation layer, a convolutional layer, an attention mechanism layer, a second activation operation layer, and a residual connection layer.
[0052] In one specific implementation, the first image rendering model adopts a symmetrical encoder-decoder structure, wherein the encoder consists of... L It consists of several downsampling layers, each of which includes a batch normalization layer, a first activation operation layer, a convolutional layer, an attention mechanism layer, a second activation operation layer, and a residual connection layer.
[0053] Furthermore, multiple downsampling processes combining residual connections and attention mechanisms are performed sequentially, including: The binary mask is subjected to the first batch of normalization, the first activation operation and the first convolution process in sequence to give the first intermediate feature; The first intermediate feature is input into the first attention mechanism layer for feature enhancement processing in the channel or spatial dimension, and the first enhanced feature is given. The first enhanced feature and the first intermediate feature are added element by element, and then the second activation operation is performed. The result is then fed into the first residual network layer for feature extraction, which produces a downsampled feature map.
[0054] In a specific example, the binary mask in the initial defect image dataset is sequentially subjected to the first batch of normalization, the first activation operation, and the first convolution process to obtain the first intermediate feature, which is specifically represented as follows:
[0055] Among them, X l Let BN(·) be the batch normalization function used for the first batch of normalization, and RelU(·) be the activation function used for the first activation operation. Let Conv be the initial defect image data in the initial defect image dataset used for input downsampling layer l. 3×3 (·) is a 3×3 convolution function used for the first convolution process, Y ml1 This is the first intermediate feature output by the downsampling layer l.
[0056] Then, the first intermediate feature is input into the first attention mechanism layer for feature enhancement processing in the channel or spatial dimension, resulting in the first enhanced feature Z. l1 Specifically, it is expressed as:
[0057] Among them, Attention(·) is the first attention mechanism layer, which is used to perform feature enhancement processing on the first intermediate feature.
[0058] The aforementioned first attention mechanism layer can be a Squeeze-and-Excitation Block (SE Block), which first performs "global compression" of the channel information of the first intermediate feature, and then "adaptively excites" the channels to reweight them, automatically focusing on important feature maps to obtain the first enhanced feature. Alternatively, the aforementioned first attention mechanism layer can be a convolutional block attention module (CBAM), which performs a two-step weighting process of "channel attention + spatial attention" on the first intermediate feature to obtain the first enhanced feature.
[0059] Finally, the first enhanced feature and the first intermediate feature are added element-wise, followed by a second activation operation, and then input into the first residual network layer for feature extraction, resulting in a downsampled feature map, specifically represented as follows:
[0060] Among them, X l+1 The input is the downsampled feature map of the downsampled layer l+1. Downsample(·) is the residual network function used for feature extraction in the first residual network layer, and ReLU(·) is the activation operation function used for the second activation operation.
[0061] By connecting multiple downsampling layers in the encoder through the first residual network layer, gradient flow is ensured, thus improving training stability.
[0062] It is understandable that when l=1, X l The initial defect image dataset contains a binary mask M ∈ {0,1}. H×W X1∈R obtained after channel expansion H×W×Cin Where Cin is the number of channels.
[0063] It's important to understand that the residual connections in the first image rendering model are primarily reflected in the encoder structure, specifically implemented through "residual attention blocks." In each downsampling layer of the encoder, the input feature map X... l First, it undergoes a standard batch normalization-activation operation-convolution (Conv). 3×3 →ReLU→BN), to obtain the first intermediate feature Y ml1 Subsequently, Y ml1 The input is fed into the attention mechanism module for feature enhancement in the channel or spatial dimensions, and outputs Z. l1 Finally, the key residual connectivity is reflected in X. l+1 =Downsample(ReLU(X l +Z l1 In )), that is, X l Compared with attention-weighted features Z l1Element-wise addition is performed, followed by activation and downsampling operations to form the input for the next layer. This "direct input + nonlinear transformation output addition" structure is the core idea of residual connections. It allows gradients to bypass the nonlinear transformation layer during backpropagation and be directly propagated back to shallower layers, effectively alleviating the gradient vanishing problem in deep networks and improving the stability and convergence speed of model training. Furthermore, this residual structure works synergistically with the attention mechanism to dynamically enhance important features of defective regions while preserving the original spatial structure information, laying a high-quality feature foundation for subsequent decoder skip connections and fine-grained rendering. Therefore, residual connections are not independent modules but are deeply embedded in each feature extraction unit, forming a key technical support for stable and efficient operation.
[0064] In one specific implementation, the bottleneck layer introduces a multi-scale context aggregation module in the deepest feature space to capture multi-sensory field information. This involves aggregating contextual information from the final downsampling result, specifically as follows:
[0065] Among them, X bottle The feature map output by the bottleneck layer, ASPP() is the context information aggregation function, and X is the feature map output by the bottleneck layer. L The result of the final downsampling process is shown below. The context information aggregation function uses atrous spatial pyramid pooling (ASPP), which samples data in parallel within the same layer using dilated convolutions with different dilation rates, and then concatenates features from all scales at once to obtain multi-scale context from near to far without loss of resolution. In other words, the final downsampling result X... L Simultaneously, multiple dilated convolutional branches with different dilation rates are fed in, and finally convolutional fusion is performed by splicing along the channels to output a feature map X that "contains both local details and global semantics". bottle .
[0066] By using ASPP, multi-scale context can be captured in a single step, significantly improving target edge / interior consistency without sacrificing resolution and avoiding loss of edge details.
[0067] It's important to understand that the bottleneck layer in the first image rendering model introduces Multi-Scale Context Aggregation (ASPP), which efficiently aggregates contextual information through a parallel, multi-branch convolutional structure. Specifically, the ASPP module contains four key branches: a 1×1 convolutional branch (dilation rate=1), three 3×3 dilated convolutional branches (dilation rates 6, 12, and 18 respectively), and a global average pooling branch. These branches process the input feature map X in parallel.L Each branch captures contextual information at different scales through varying dilation rates: small dilation rates focus on local details, medium dilation rates capture medium-scale context, and large dilation rates acquire global semantic information. Simultaneously, the global average pooling branch compresses the spatial dimension of the entire feature map to 1×1, extracting global contextual information. Subsequently, the outputs of all branches are concatenated and fused along the channel dimension, and then feature fusion and dimensionality reduction are performed using 1×1 convolutions to form a feature representation X with rich multi-scale contextual information. bottle ASPP can effectively integrate local details and global semantics without increasing computational complexity, significantly improving the model's context awareness of complex defect regions and providing a high-quality feature foundation for subsequent defect foreground generation and fusion.
[0068] Furthermore, multiple upsampling processes are performed, combining residual connections and attention mechanisms, including: The result of the context information aggregation process or the previous upsampling process is concatenated with the downsampling process result of the corresponding jump connection. The splicing results are subjected to a second batch normalization, a third activation operation, and a second convolution process in sequence to give the second intermediate feature. The second intermediate feature is input into the second attention mechanism layer for feature enhancement processing in the channel or spatial dimension, resulting in the second enhanced feature. The second enhanced feature and the second intermediate feature are added element by element, and then the fourth activation operation is performed. The result is then fed into the second residual network layer for feature extraction, which produces an upsampled feature map.
[0069] In one specific implementation, the decoder comprises L upsampling layers. Each upsampling layer includes an upsampling sub-layer and a feature fusion layer combining residual connections and an attention mechanism. Each upsampling layer in the decoder is skipped to the corresponding downsampling layer in the encoder. A residual attention block (RAB) is used as the feature fusion layer for feature fusion and detail restoration. Specifically, the skip connections between each upsampling layer in the decoder and the corresponding downsampling layer in the encoder are as follows:
[0070] Among them, X con,l This is the concatenated result obtained by combining the result of context information aggregation processing or the result of the previous upsampling process with the result of the downsampling process of the corresponding skip connection. For downsampling layer l, For downsampling layer l The corresponding upsampling layer is (L-l+1), and Concat(·) is the skip connection function.
[0071] It is understandable that the process of obtaining the second intermediate feature, the second enhanced feature, and adding the second enhanced feature and the second intermediate feature element by element based on the splicing result after the skip connection is the same as the process of obtaining the first intermediate feature, the first enhanced feature, and adding the first enhanced feature and the first intermediate feature element by element, as described above. It will not be repeated here. However, the difference is that the second residual network layer uses a feature fusion layer to obtain the corresponding upsampled feature map.
[0072] In this example, the output layer uses a 1×1 convolution to map the features of the last upsampling process to the target image channel space, obtaining the first rendered feature map corresponding to each binary mask. I coarse The initial rendering dataset is now constructed, specifically as follows:
[0073] in, σ X is the sigmoid activation function, used to normalize the output to [0,1]. out This is the result of the last upsampling process, Conv 1×1 This refers to the convolution in the output layer.
[0074] Furthermore, both the first attention mechanism layer and the second attention mechanism layer satisfy the following relationship: Max pooling and average pooling are performed on the first intermediate feature and the second intermediate feature, respectively. The spatial weights are obtained by concatenating the results of max pooling and average pooling and then learning through convolution. The spatial weights are weighted together with either the first or second intermediate feature to obtain the first or second enhanced feature.
[0075] It is understandable that the processing procedures of the first and second attention mechanism layers are the same; the only difference lies in the data processed. The first attention mechanism layer processes the first intermediate feature, and the second attention mechanism layer processes the second intermediate feature. In actual use, the first and second attention mechanism layers can be configured as two identical attention mechanism layers, or they can be the same attention mechanism layer; there is no limitation on this.
[0076] In the embodiments provided by the present invention, the processing of the first intermediate feature by the first attention mechanism is described as an example. Given the input first intermediate feature Y, ml1 ∈R H×W×C First, max pooling and average pooling are performed along the channel dimension, specifically as follows:
[0077] Among them, MaxPoolc (·) is the max pooling function, AvgPool c (·) is the average pooling function, F max For the max pooling result, F avg For the average pooling result, H represents the height of the feature map and W represents the width of the feature map.
[0078] The results of max pooling and average pooling are concatenated, and spatial weights A are obtained through convolutional learning. spatial Specifically, it is expressed as:
[0079] Finally, the spatial weights are weighted together with the first intermediate feature to obtain the first enhanced feature Z. l1 Specifically, it is expressed as:
[0080] in, This is element-wise multiplication.
[0081] By setting the first attention mechanism layer, the first image rendering model focuses on the mask boundary and key deformation areas, significantly improving the edge rendering quality.
[0082] Meanwhile, the first image rendering model employs a composite loss function during training to simultaneously optimize pixel-level fidelity and structural similarity. The composite loss function is specifically expressed as follows:
[0083] Where λ1 and λ2 are weighting coefficients, and loss MSE Mean squared error, used to ensure pixel-level accuracy, loss SSIM Structural similarity loss is used to improve visual naturalness. gt For the ideal output image, SSIM() is the structural similarity index. SSIM measures the degree of visual similarity by comparing the brightness, contrast, and structural information of two images. The larger the value, the closer the image quality perceived by the human eye is, making the loss function more consistent with visual characteristics.
[0084] The first image rendering model focuses on mask edges and key regions through an attention mechanism to generate realistic coarse-rendered defect contours. It utilizes residual connections to mitigate gradient vanishing and supports deeper network structures. Furthermore, it employs skip connections to preserve spatial structure information and avoid deformation distortion. By fusing the spatial symmetry of UNet (encoder and decoder), the gradient optimization mechanism of ResNet, and the detail enhancement capabilities of attention, the first image rendering model achieves high-quality mapping from abstract masks to concrete defect images, providing a solid foundation for subsequent background blending and realism enhancement.
[0085] S104: Based on the pre-built second image rendering model, and combined with the initial defect image dataset and the initial rendering dataset, the background area of the initial rendering dataset is rendered to obtain the enhanced defect dataset.
[0086] Furthermore, based on the pre-built second image rendering model, and combining the initial defect image dataset and the initial rendering dataset, the background region of the initial rendering dataset is rendered to obtain the enhanced defect dataset, as shown in the reference. Figure 5 ,include: The initial diffusion rendering dataset is obtained by progressively adding forward Gaussian noise to the initial rendering dataset. The conditional information corresponding to the initial diffusion rendering dataset, which contains defect features and background features, is obtained and fused with the multi-channel vector to obtain the conditional vector; wherein, the multi-channel vector includes the initial defect image dataset and the initial rendering dataset; Conditional vector embedding is combined with a denoising network module that integrates residual connections and attention mechanisms. The initial diffusion rendering dataset is then denoised based on the denoising network module with embedded conditional vectors, providing the predicted noise for the current step of the initial diffusion rendering dataset. Based on the predicted noise of the current step, the initial diffusion rendering dataset is back-diffused to give the initial diffusion rendering dataset of the previous step. Repeat the above denoising and update steps until the predetermined conditions are met, and give the final enhanced defect dataset; where the predetermined condition is that the number of repetitions is equal to the number of steps of adding forward Gaussian noise.
[0087] In one application scenario, a denoising network module based on embedded conditional vectors denoises the initial diffusion rendering dataset, providing the predicted noise for the current step of the initial diffusion rendering dataset, which may include: The initial diffusion rendering dataset is concatenated with the conditional vector and then cyclically encoded to obtain a multi-scale diffusion feature set. The encoding process includes downsampling, attention weighting, and residual connection in sequence. Based on the reverse order of the diffusion feature sets at different scales, the multi-scale diffusion feature sets are concatenated with the conditional vector and then sequentially decoded to obtain the prediction noise of the current step in the initial diffusion rendering dataset; wherein, the decoding process includes sequential upsampling, attention weighting and residual connection.
[0088] In one specific implementation, the second image rendering model is a defect refinement diffusion (DR-Diff) model. DR-Diff is a deep learning method that improves the quality of coarsely rendered defect images, particularly enhancing the background portion to make it more realistic in texture. This model is based on conditional denoising diffusion probabilistic models (C-DDPMs), which enhance the understanding and representation of fine-grained information such as defect type, location, and morphology through training. DR-Diff focuses specifically on extracting and optimizing the background portion from the coarsely rendered image (i.e., the first rendered feature map in the initial rendering dataset) to generate a finely rendered defect image with highly realistic texture.
[0089] It's important to understand that the initial rendered image in the initial rendered dataset contains both foreground (i.e., the defective portion) and background (non-defective areas). While the foreground may possess some detail, the background may lack realistic texture. In addition to the initial rendered image, the second image rendering model can better understand the defect features in the initial rendered image based on additional conditional information, thus enabling more accurate background rendering. This additional conditional information can be fine-grained details such as defect type, location, and shape, or it can be the initial rendered image and its corresponding binary mask image. This constrains DR-Diff to function as a "conditional background generator," meaning DR-Diff does not process the foreground, fundamentally avoiding the bias caused by processing the foreground (defect). The background portion of the output of the second image rendering model (i.e., the enhanced defect image in the enhanced defect dataset) will be significantly improved, exhibiting a more natural and realistic texture effect.
[0090] The core of DR-Diff lies in its conditional denoising diffusion process. In this process, the model first gradually adds noise to the input image, then learns how to remove the noise from the noisy image, recovering a clear and realistic image. This process not only enhances the model's ability to capture original defect features but also allows it to adjust the background rendering style based on given conditional information (such as defect type, defect location, defect morphology, etc.), making the final generated image more realistic in both the foreground and background.
[0091] To improve the learning efficiency of the second image rendering model in acquiring fine-grained information related to defects, DR-Diff employs a specially designed UNet architecture. This architecture effectively integrates information from different scales and captures both the global structure and local details of defects through multiple downsampling and upsampling operations. Furthermore, the UNet architecture can receive additional conditional information as input, further guiding the learning process of the second image rendering model.
[0092] In one specific implementation, forward Gaussian noise is added to the initial rendering dataset to obtain the initial diffusion rendering dataset, i.e., the forward diffusion process, which is specifically represented as follows:
[0093] Where q(I) coarse,t |I coarse,t-1 (I) is the noise feature map at step t-1. coarse,t-1 Generate the noise feature map I at step t given the given information. coarse,t The probability distribution is given by N(·), where N is the multivariate Gaussian distribution function, I is the identity matrix, sqrt(·) is the square root function, and β is the base function. t To fix the variance, i.e., for step t-1, I coarse,t-1 Adding forward Gaussian noise yields I at step t. coarse,t All noise feature maps with added t-step forward Gaussian noise form the initial diffusion rendering dataset, noise feature map I. coarse,t-0 This is the first rendered feature map in the initial rendered dataset.
[0094] It is understandable that the initial diffusion rendering dataset is subjected to multiple upsampling and downsampling processes through a denoising network module to obtain the predicted noise at each step; then, based on the predicted noise corresponding to the initial diffusion rendering dataset, the noise is sampled from the final noise distribution and gradually removed through a backdiffusion process to restore the original data distribution.
[0095] The denoising network module uses the U-Net model to determine and predict noise. The U-Net model employs a symmetric encoder-decoder structure, which includes an encoder, a decoder, a conditional fusion module, and residual attention blocks (RABs). The encoder uses multi-layer downsampling (e.g., convolution with a preset stride), performing batch normalization and activation operations on the output feature maps after each downsampling layer to enhance non-linear feature representation. The decoder has multi-layer upsampling symmetrical to the encoder (e.g., transposed convolution / interpolation + convolution), fusing skip connection features from the corresponding encoder layer at each upsampling layer; the upsampling process is used to progressively recover spatial details. The conditional fusion module uses a conditional encoder to encode conditional information (such as defect type, location, background style, etc.) containing defect features and background features, as well as a multi-channel vector formed by the initial defect image dataset and the initial rendering dataset, into a conditional vector through an MLP or Transformer. Before downsampling and upsampling at each layer of the encoder and decoder, the conditional vector is adjusted to have the same number of channels as the current layer's (downsampling or upsampling) features through a 1×1 convolution. Then, it is concatenated / added with the input feature map (in the first layer downsampling, the feature map corresponds to the first rendered feature map with added forward Gaussian noise) to achieve conditional guidance. Furthermore, since the conditional information and multi-channel vectors originate from different sources, they can be converted into a unified embedding vector using a multimodal encoder. Specifically, defect types in the conditional information can be encoded into category embedding vectors using a classification model (e.g., ResNet+Softmax) or a text encoder (e.g., the text branch of CLIP). Location coordinates can be converted into embedding vectors from pixel-level location masks (e.g., bounding boxes or segmentation masks) using a spatial encoder (e.g., fully connected layers or Transformers). Background style can be encoded into embedding vectors using a classification encoder (e.g., ResNet). For multi-channel vectors, lightweight convolutional networks (e.g., 2-3 layers of convolution + BN + ReLU) can be used to extract spatial feature maps as embedding vectors. Further, the conditional vectors formed by the conditional fusion module can also include the time step when adding forward Gaussian noise, which, along with the conditional information and multi-channel vectors, is encoded into a conditional vector using an MLP or Transformer. Residual attention blocks are inserted into critical layers of the encoder and decoder (downsampling / upsampling in mid-to-deep layers), or they can be inserted into each layer of the encoder and decoder. Residual attention blocks include attention branches and residual branches. Attention branches include channel attention (SE Block) + spatial attention (Spatial Gate).
[0096] During training, U-Net learns the following features: an initial diffuse rendering dataset obtained from a real-world defect image dataset and the corresponding rendering background. Therefore, U-Net generates the missing background in the region outside the defect mask and ensures seamless integration of the generated background with the given foreground at the edges based on the defect labels.
[0097] The back diffusion process consists of a series of parameterized Gaussian distributions, specifically represented as follows:
[0098] in, Given the noise feature map I containing noise at step t. coarse,t Under the premise of predicting the noise feature map I at step t-1. coarse,t-1 The conditional probability distribution, μ θ and Σ θ These are the parameters obtained through neural network learning.
[0099] The training process of the second image rendering model is determined through the following steps: The goal of the second image rendering model is to minimize the real data (defective image) p data (I coarse,0 ) and the images generated by the model (in the augmented defect dataset) p θ (I coarse,0 The KL divergence between ) is calculated. In practice, this typically translates to minimizing the reconstruction error L at each time step t. t Specifically, it is expressed as:
[0100] in, For the noise feature map I at step t based on the current noise level coarse,t And the estimated value of the actual data predicted at time step t.
[0101] In another implementation, one or more condition vectors y are added to the diffusion process described above, allowing the generation process to be adjusted according to these conditions. Based on the condition vectors, in the forward diffusion process, in addition to adding noise to the data, the influence of the conditional inputs is also considered, specifically as follows:
[0102] In the backdiffusion process, the condition vector also needs to be considered, specifically as follows:
[0103] Where N(·) is the Gaussian distribution function.
[0104] The entire denoising process is guided by conditional vectors. This means that in each diffusion step, the specific attributes of the defect being processed (such as defect type, defect location, etc.) and the background area that needs to be denoised are taken into account, thereby ensuring that the generated result is both realistic and highly lifelike.
[0105] The learning objective of the conditional probability diffusion model remains minimizing the true data p. data (I coarse ) and the p generated by the model θ (I coarse The differences between the samples are considered, but it is necessary to ensure that the generated samples meet the given conditional input. Therefore, during training, special emphasis is placed on sample features that can correctly reflect the conditional information.
[0106] This invention utilizes expert experience to analyze the failure modes and defect types of transmission lines, and constructs a defect shape library (i.e., a transformed extended defect image dataset) based on this, generating binary masks representing defect morphology. Then, a first image rendering model and a second image rendering model are used to generate the foreground and background of the defect, respectively. Finally, by optimizing the quality of the generated images, realistic images without defects are generated, significantly improving the detection effect of the defect detection model under small sample conditions.
[0107] Overall, this invention first identifies potential failure modes specific to power transmission lines using FMEA. Therefore, the generated "extended defect image dataset" (i.e., defect shape mask images) is based on defects in power transmission lines, such as "cracks (V-shaped)" or "pores (circular)." Its physical micro-texture is highly consistent with the visual features of common metal surface defects, already incorporating domain knowledge of power transmission lines, ensuring that the defect morphology fits the application scenario of power transmission lines. Based on the above, a wider and more diverse range of "common metal surface defect data" can be used to train the first image rendering model (foreground rendering model). Its core objective is to train a "defect texture generator," enabling the first image rendering model to learn the most realistic and diverse micro-texture features of defects such as "cracks" and "corrosion," giving it strong generalization ability and avoiding overfitting problems caused by training with only a small amount of scarce data. Finally, this invention uses a second image rendering model (background rendering model) to fuse this "correctly shaped and realistically textured" defect foreground with the real background of the power transmission line and adjust the lighting and shadows to ensure that the final enhanced data perfectly matches the specific application scenario of the "power transmission line". Therefore, using metal surface defect data to train the foreground rendering model can improve the correlation with the power transmission line scene and achieve a high degree of realism and high generalization ability.
[0108] Reference Figure 6 The present invention also provides a defect data enhancement device for transmission lines, employing the above-described defect data enhancement method for transmission lines, the device comprising: The data acquisition module 201 is used to acquire the original defect image dataset of the transmission line, and to determine the defect type and analyze and generate an extended defect image dataset. The data mixing module 202 is used to perform mixing and enhancement processing on the extended defect image dataset and the original defect image dataset to obtain the initial defect image dataset. The defect rendering module 203 is used to render the defect regions of the initial defect image dataset based on the first image rendering model that combines residual connections and attention mechanisms, so as to obtain the initial rendering dataset. Background rendering module 204 is used to render the background area of the initial rendering dataset based on a pre-built second image rendering model and in combination with the initial defect image dataset and the initial rendering dataset, to obtain an enhanced defect dataset.
[0109] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working process of the described module can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0110] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention. Clearly, those skilled in the art can make various alterations and modifications to the invention without departing from its spirit and scope. Thus, if these modifications and variations of the invention fall within the scope of the claims and their equivalents, the invention is also intended to include these modifications and variations.
Claims
1. A method for enhancing defect data of transmission lines, characterized in that, include: Acquire the original defect image dataset of the transmission line, and determine the defect type and analyze it to generate an extended defect image dataset; The extended defect image dataset and the original defect image dataset are mixed and enhanced to obtain the initial defect image dataset; Based on the first image rendering model that combines residual connections and attention mechanisms, the defect regions of the initial defect image dataset are rendered to obtain the initial rendering dataset. Based on a pre-built second image rendering model, and combined with the initial defect image dataset and the initial rendering dataset, the background area of the initial rendering dataset is rendered to obtain the enhanced defect dataset.
2. The method for enhancing defect data of transmission lines as described in claim 1, characterized in that, Determine the defect type and analyze to generate an extended defect image dataset, including: Potential failure modes of transmission line defects are identified through failure mode and effects analysis, and the defect types are identified. Based on the potential failure modes, each defect type is graphically plotted to obtain a dataset of plotted images; Geometric transformations are performed on the drawn image dataset to obtain an extended defect image dataset.
3. The defect data enhancement method for transmission lines as described in claim 1, characterized in that, The extended defect image dataset and the original defect image dataset are mixed and enhanced to obtain the initial defect image dataset, which includes: Both the extended defect image dataset and the original defect image dataset are binarized to obtain the corresponding binary masks. The binary mask of the extended defect image dataset is scaled, rotated, affine transformed, morphologically operated and / or combined to obtain the transformed extended defect image dataset. The binary mask of the transformed extended defect image dataset and the binary mask of the original defect image dataset are superimposed, embedded, and / or replaced to obtain a hybrid mask image dataset. The initial defect image dataset is obtained by performing a union operation on the binary masks of the hybrid mask image dataset, the transformed extended defect image dataset, and the original defect image dataset.
4. The method for enhancing defect data of transmission lines as described in claim 1, characterized in that, The first image rendering model includes an encoder, a bottleneck layer, a decoder, and an output layer connected in sequence; Based on the first image rendering model combining residual connectivity and attention mechanisms, the defect regions of the initial defect image dataset are rendered to obtain the initial rendering dataset, which includes: The encoder performs multiple downsampling processes on all binary masks in the initial defect image dataset, combining residual connections and attention mechanisms. The bottleneck layer performs contextual information aggregation on the result of the last downsampling process and then inputs it into the decoder. The decoder, which has skip connections with the encoder, performs multiple upsampling processes on the results of multiple downsampling processes and the results of context information aggregation processes, combining residual connections and attention mechanisms. The output layer performs feature mapping on the result of the last upsampling process to obtain the first rendering feature map corresponding to each binary mask, thus providing the initial rendering dataset.
5. The method for enhancing defect data of transmission lines as described in claim 4, characterized in that, Multiple downsampling processes combining residual connections and attention mechanisms are performed sequentially, including: The binary mask is subjected to the first batch of normalization, the first activation operation and the first convolution process in sequence to give the first intermediate feature; The first intermediate feature is input into the first attention mechanism layer for feature enhancement processing in the channel or spatial dimension, and the first enhanced feature is given. The first enhanced feature and the first intermediate feature are added element by element, and then the second activation operation is performed. The result is then fed into the first residual network layer for feature extraction, which produces a downsampled feature map.
6. The method for enhancing defect data of transmission lines as described in claim 4, characterized in that, Multiple upsampling processes combining residual connections and attention mechanisms are performed, including: The result of the context information aggregation process or the previous upsampling process is concatenated with the downsampling process result of the corresponding jump connection. The splicing results are subjected to a second batch normalization, a third activation operation, and a second convolution process in sequence to give the second intermediate feature. The second intermediate feature is input into the second attention mechanism layer for feature enhancement processing in the channel or spatial dimension, resulting in the second enhanced feature. The second enhanced feature and the second intermediate feature are added element by element, and then the fourth activation operation is performed. The result is then fed into the second residual network layer for feature extraction, which produces an upsampled feature map.
7. The method for enhancing defect data of transmission lines as described in claim 5, characterized in that, The second intermediate feature is input into the second attention mechanism layer for channel or spatial dimension feature enhancement processing, resulting in the second enhanced feature, which specifically includes: Max pooling and average pooling are performed on the second intermediate feature, respectively; The spatial weights are obtained by concatenating the results of max pooling and average pooling and then learning through convolution. The spatial weights are weighted together with the second intermediate feature to obtain the second enhanced feature.
8. The method for enhancing defect data of transmission lines as described in claim 1, characterized in that, Based on a pre-built second image rendering model, and combining the initial defect image dataset and the initial rendering dataset, the background region of the initial rendering dataset is rendered to obtain the enhanced defect dataset, including: The initial diffusion rendering dataset is obtained by progressively adding forward Gaussian noise to the initial rendering dataset. The conditional information containing defect features and background features corresponding to the initial diffusion rendering dataset is obtained and fused with the multi-channel vector to obtain the conditional vector; wherein, the multi-channel vector includes the initial defect image dataset and the initial rendering dataset; Conditional vector embedding is combined with a denoising network module that integrates residual connections and attention mechanisms. The initial diffusion rendering dataset is then denoised based on the denoising network module with embedded conditional vectors, providing the predicted noise for the current step of the initial diffusion rendering dataset. Based on the predicted noise of the current step, the initial diffusion rendering dataset is back-diffused to give the initial diffusion rendering dataset of the previous step. Repeat the above denoising and update steps until the predetermined conditions are met, and give the final enhanced defect dataset.
9. The defect data enhancement method for transmission lines as described in claim 8, characterized in that, A denoising network module based on embedded conditional vectors denoises the initial diffusion rendering dataset, providing the predicted noise for the current step of the initial diffusion rendering dataset, including: The initial diffusion rendering dataset is concatenated with the conditional vector and then cyclically encoded to obtain a multi-scale diffusion feature set. The encoding process includes downsampling, attention weighting, and residual connection in sequence. Based on the reverse order of the diffusion feature sets at different scales, the multi-scale diffusion feature sets are concatenated with the conditional vector and then sequentially decoded to obtain the prediction noise of the current step in the initial diffusion rendering dataset; wherein, the decoding process includes sequential upsampling, attention weighting and residual connection.
10. A defect data enhancement device for transmission lines, characterized in that, The apparatus employing the defect data enhancement method for transmission lines as described in any one of claims 1 to 9 comprises: The data acquisition module is used to acquire the original defect image dataset of the transmission line, as well as to determine the defect type and analyze and generate an extended defect image dataset. The data mixing module is used to perform mixing and enhancement processing on the extended defect image dataset and the original defect image dataset to obtain the initial defect image dataset. The defect rendering module is used to render the defect regions of the initial defect image dataset based on the first image rendering model that combines residual connections and attention mechanisms, so as to obtain the initial rendering dataset. The background rendering module is used to render the background area of the initial rendering dataset based on a pre-built second image rendering model, combined with the initial defect image dataset and the initial rendering dataset, to obtain the enhanced defect dataset.
Citation Information
Patent Citations
Defect data synthesis algorithm based on generative adversarial network
CN111415316A