Damaged insulator image generation method and device, equipment and storage medium

By generating rich damaged insulator images, using an improved denoising diffusion generation model and defect mask module, combined with a bilinear interpolation algorithm, the problems of insufficient diversity and generalization ability of existing detection methods are solved, and the accuracy and adaptability of insulator detection are improved.

CN120635624APending Publication Date: 2025-09-12YUNNAN POWER GRID CO LTD ELECTRIC POWER RES INST
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510516216.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-23
Publication Date
2025-09-12

AI Technical Summary

Technical Problem

Existing insulator detection methods lack diversity and generalization capabilities, and are difficult to adapt to complex backgrounds and changing conditions, resulting in low detection accuracy.

Method used

By generating rich damaged insulator images, using an improved denoising diffusion generation model and defect mask module, combined with a bilinear interpolation algorithm, we can generate insulator images containing complex environments and different damage types to train the detection model.

Benefits of technology

The generalization ability of the detection model is improved, enabling it to accurately identify insulator defects in various environments, and enhancing the accuracy and robustness of the detection results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120635624A_ABST
    Figure CN120635624A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a damaged insulator image generation method and device, equipment and a storage medium. The method comprises the following steps: acquiring a standard environment background image and a standard insulator image; inputting the standard environment background image into a preset environment background generation module to obtain a target environment image; inputting the standard insulator image into a preset insulator image generation model to obtain a target insulator image; and performing scale transformation and fusion on the target environment image and the target insulator image by using a bilinear interpolation algorithm to obtain a synthesized insulator damage image, performing model training based on the insulator damage image, and generating a detection model for identifying whether the insulator is damaged or not. According to the method, abundant insulator damage images are generated through the standard environment background image and the standard insulator image, so that the generalization ability of the detection model obtained based on insulator damage image training is improved, the detection model can adapt to various insulator defects, and then the accuracy of the detection result is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image generation technology, and in particular to a method and apparatus, device, and storage medium for generating an image of a damaged insulator. Background Art

[0002] The distribution network is a crucial component of the power system. Its primary function is to distribute electricity on demand, making it the power supply link with the user most closely connected. The distribution network consists of plug lines, cables, insulators, and poles. Insulators are a key component of the distribution network. Because insulators are located in the field and lack effective protection, they are susceptible to various faults, such as cracks, breakage, and contamination. These defects can cause insulator breakdown, short circuits, and even power outages, posing a serious threat to the stable operation of the power grid. Therefore, regular inspection of insulator status is necessary to ensure power grid security.

[0003] The existing insulator inspection method is a model detection method, but the network of the model detection method lacks diversity and generalization ability, has poor adaptability to complex backgrounds and changing conditions, and has low detection accuracy. Summary of the Invention

[0004] Based on this, it is necessary to propose a method and device, equipment and storage medium for generating images of damaged insulators to address the above problems, so as to improve the richness of training images and thus improve the accuracy of the detection model.

[0005] To achieve the above-mentioned objectives, the present application provides, in a first aspect, a method for generating an image of a damaged insulator, the method comprising:

[0006] Acquire a standard environment background image and a standard insulator image;

[0007] Inputting the standard environment background image into a preset environment background generation module to obtain a target environment image, wherein the target environment image is an image containing complex environment content;

[0008] Inputting the standard insulator image into a preset insulator image generation model to obtain a target insulator image, wherein the target insulator image is an image including a damaged insulator;

[0009] The target environment image and the target insulator image are scale-transformed and fused using a bilinear interpolation algorithm to obtain a synthesized insulator damage image.

[0010] Furthermore, the environmental background generation module includes an improved first denoising diffusion generation model;

[0011] Then, the step of inputting the standard environment background image into a preset environment background generation module to obtain a target environment image specifically includes:

[0012] Performing forward process processing on the standard environment background image using the improved first denoising diffusion generation model to generate a first Gaussian noise image;

[0013] When the improved first denoising diffusion generation model performs a reverse process on the first Gaussian noise image, the improved first denoising diffusion generation model introduces a denoising diffusion implicit model to accelerate a sampling process of the reverse process of the first Gaussian noise image to obtain an initial background image;

[0014] The initial background image is randomly exposed to obtain a target environment image.

[0015] Furthermore, the step of performing forward processing on the standard environment background image using the improved first denoising diffusion generation model to generate a first Gaussian noise image specifically includes:

[0016] The improved first denoising diffusion generation model performs forward process processing on the standard environment background according to the cosine noise addition method to obtain a first Gaussian noise image.

[0017] Furthermore, the forward process is performed on the standard environment background according to the superimposed cosine noise method to obtain a first Gaussian noise image, which specifically includes:

[0018] Stepwise adding noise to the standard environment background according to the noise variance corresponding to each time step and the preset Gaussian noise to obtain the first Gaussian noise image;

[0019] The noise variance is expressed by the following formula:

[0020]

[0021] Where, β t is the noise variance at time step t, where 0≤t≤T, T is the total number of time steps, is the cumulative noise retention coefficient of the tth step, and s is the offset of the preset cosine scheduling function.

[0022] Furthermore, the insulator image generation model includes an improved second denoising diffusion generation model and a defect mask module;

[0023] The step of inputting the standard insulator image into a preset insulator image generation model to obtain a target insulator image, wherein the target insulator image is an image including a damaged insulator, specifically includes:

[0024] Inputting the standard insulator image into the improved second denoising diffusion generation model for forward processing to generate a second Gaussian noise image;

[0025] The defect mask module generates a defect mask image according to the standard insulator image;

[0026] merging the second Gaussian noise image and the defect mask image to generate a target Gaussian noise image;

[0027] When the improved second denoising diffusion generation model performs a reverse process on the target Gaussian noise image, the improved second denoising diffusion generation model introduces a denoising diffusion implicit model to accelerate the sampling process of the reverse process of the target Gaussian noise image to obtain the target insulator image.

[0028] Furthermore, the step of inputting the standard insulator image into the improved second denoising diffusion generation model for forward processing to generate a second Gaussian noise image specifically includes:

[0029] The standard insulator image is gradually denoised according to the noise variance corresponding to each time step and the preset Gaussian noise to obtain a noisy image at each time step;

[0030] The defect mask module generates a corresponding target defect mask image based on the noisy image generated at each time step;

[0031] Merging the target noisy image generated at a target time step and the target defect mask image corresponding to the target noisy image to generate merged data, wherein the target time step is any time step among all the time steps of the forward process;

[0032] The U-Net network in the improved second denoising diffusion generation model performs noise prediction on the merged data generated at the target time step to obtain the predicted noise of the target noisy image at the target time step;

[0033] The improved second denoising diffusion generation model is optimized according to the predicted noise of the target noisy image and the actual noise of the target noisy image based on the loss function to obtain an optimized target second denoising diffusion generation model, and the standard insulator image is forward processed based on the optimized target second denoising diffusion generation model to generate a second Gaussian noise image.

[0034] Furthermore, the loss function is expressed as follows:

[0035] LOSS=MSE(∈ θ (x t +x m ,t),∈ t )+τMSE m (∈ θ (x t +x m,t),∈ t )

[0036] Where,∈ θ (x t +x m ,t) is the prediction noise at time step t, x t Noise image at time step t, x m is the mask image at time step t, ∈ t is the actual noise at time step t, and τ is the preset loss coefficient.

[0037] To achieve the above-mentioned object, the second aspect of the present application provides a device for generating an image of a damaged insulator, the device comprising an image acquisition unit, an image generation unit, and an image processing unit;

[0038] The image acquisition unit is used to acquire a standard environment background image and a standard insulator image;

[0039] The image generation unit is used to input the standard environment background image into a preset environment background generation module to obtain a target environment image, wherein the target environment image is an image containing complex environment content;

[0040] Inputting the standard insulator image into a preset insulator image generation model to obtain a target insulator image, wherein the target insulator image is an image including a damaged insulator;

[0041] The image processing unit is used to perform scale transformation and fusion on the target environment image and the target insulator image using a bilinear interpolation algorithm to obtain a synthesized insulator damage image.

[0042] To achieve the above-mentioned objectives, the third aspect of the present application provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the processor executes the steps of the method described in the first aspect.

[0043] To achieve the above-mentioned objectives, the fourth aspect of the present application provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the method described in the first aspect.

[0044] The embodiments of the present invention have the following beneficial effects:

[0045] An embodiment of the present invention provides a method for generating an image of a damaged insulator. The method comprises: obtaining a standard environmental background image and a standard insulator image; inputting the standard environmental background image into a preset environmental background generation module to obtain a target environmental image, wherein the target environmental image is an image containing complex environmental content; inputting the standard insulator image into a preset insulator image generation model to obtain a target insulator image, wherein the target insulator image is an image containing a damaged insulator; and using a bilinear interpolation algorithm to scale and fuse the target environmental image and the target insulator image to obtain a synthesized insulator damage image, thereby training a model based on the insulator damage image and generating a detection model for identifying whether an insulator is damaged. The present invention generates a rich set of insulator damage images using the standard environmental background image and the standard insulator image, thereby improving the generalization capability of the detection model trained based on the rich set of insulator damage images, enabling the detection model to adapt to various insulator defects and thereby improving the accuracy of the detection results. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0047] in:

[0048] Figure 1 Schematic diagram of the process of a method for generating an image of a damaged insulator according to an embodiment of the present invention;

[0049] Figure 2 This is a structural block diagram of a device for generating an image of a damaged insulator according to an embodiment of the present invention;

[0050] Figure 3 2 is a diagram showing the internal structure of a computer device in an embodiment of the present invention. DETAILED DESCRIPTION

[0051] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.

[0052] With technological advancements, particularly the rise of artificial intelligence and deep learning, automated insulator defect detection methods have begun to attract attention. These methods utilize advanced image processing and machine learning algorithms to identify defects on insulators. However, current insulator defect detection still faces numerous challenges. For example, there are relatively few defect detection datasets and algorithms for distribution network insulators, and the accuracy required to meet inspection requirements is insufficient.

[0053] Existing image generation-based technologies are significantly impacted by the data volume and image quality of their datasets, and most existing insulator defect detection technologies rely on limited datasets. Because high-quality defect images are difficult to obtain in large quantities, the models trained using enhanced training cannot fully learn and adapt to a wide range of defect types, especially rare or subtle breakage defects. Limited and monotonous training data also leads to a lack of network diversity and generalization, as well as poor adaptability to complex backgrounds and changing conditions. Existing detection systems are often optimized for specific defect types. When faced with unknown or untrained defect types, detection accuracy is significantly reduced, leading to misjudgments or missed detections.

[0054] Based on this, an embodiment of the present invention proposes a method for generating a damaged insulator image, which can be found in Figure 1 , Figure 1 FIG. 1 is a flow chart of a method for generating an image of a damaged insulator according to an embodiment of the present invention. The method includes:

[0055] Step 100: Acquire a standard environment background image and a standard insulator image.

[0056] In this embodiment of the present invention, the standard environmental background image is the original environmental image, which has low noise, clear image content, and is free of excessive obstructions. The standard insulator image is an image that includes normal insulators, which can be understood as insulators that are not damaged. By effectively controlling the damaged insulator image generated based on the standard environmental background image and the standard insulator image, a richer damaged insulator image can be generated.

[0057] Step 200: Input the standard environment background image into a preset environment background generation module to obtain a target environment image, which is an image containing complex environment content.

[0058] In the embodiment of the present invention, the preset environment background generation module can generate different target environment images containing complex environment contents based on the standard environment background image.

[0059] Step 300: Input the standard insulator image into a preset insulator image generation model to obtain a target insulator image, where the target insulator image is an image including a damaged insulator.

[0060] In the embodiment of the present invention, the preset insulator image generation model can generate target insulator images with different damage degrees and types based on the standard insulator image.

[0061] Step 400: Use a bilinear interpolation algorithm to perform scale transformation on the target environment image and the target insulator image, and fuse them to obtain a synthesized insulator damage image.

[0062] In this embodiment of the present invention, a bilinear interpolation algorithm is used to rescale the target environment image and the target insulator image to obtain appropriately sized and clear target environment and insulator images. These resized target environment and insulator images are then fused to produce images of damaged insulators with varying degrees of damage and types under different environmental backgrounds. This model, trained on a rich set of damaged insulator images, generates a detection model for identifying damaged insulators that can adapt to various environmental backgrounds and insulator defects, thereby improving the accuracy of detection results.

[0063] In one embodiment of the present invention, the environmental background generation module includes an improved first denoising diffusion probabilistic model. The improved denoising diffusion probabilistic model (IDDPM) consists of a forward process and a backward process. The forward process is essentially a training process, while the backward process is also a sampling process. The sampling process and the exposure processing process constitute the generation process. In this embodiment, the forward process uses a cosine noise superposition method to add noise to the input image. Specifically, the cosine noise scheduling adds varying degrees of noise to each step of the forward process, ultimately producing a completely Gaussian noise image. This method can effectively simulate noise conditions in complex environments and improve the generalization capability of the detection model. Furthermore, the improved first denoising diffusion probabilistic model also introduces denoising diffusion implicit models (DDIMs) during the image generation sampling process. This utilizes the concept of Markov-free decision diffusion models to break the Markov chain during the sampling process, thereby accelerating image generation. By introducing a deterministic sampling process, the DDIM reduces the number of sampling steps, significantly improving the generation speed while maintaining the quality of the generated image.

[0064] Based on this, step 200, inputting the standard environment background image into a preset environment background generation module to obtain a target environment image, specifically includes:

[0065] Step 210: Use the improved first denoising diffusion generation model to perform forward process processing on the standard environment background image to generate a first Gaussian noise image.

[0066] The denoising diffusion probabilistic model (DDPM) is a process that linearly adds time-varying Gaussian noise to the original image, ultimately converting it to pure Gaussian noise after a predetermined number of time steps. The DDPM then works backwards from pure noise to generate the target image by predicting the added noise at each time step. During the training phase, given a real image x0~q(x0), the process can be considered a Markov process.

[0067]

[0068] Among them, x t is the noise data at time step t, obtained by gradually adding Gaussian noise, and the final x T ~N(0,I);β t is the noise variance at time step t, i.e., the noise scheduling parameter, which controls the amount of noise added at each step and satisfies 0<β1<β2<......<β T <1; ∈ is standard Gaussian noise, ∈~N(0,I), used to generate noise terms.

[0069] Let α t =1-β t ,and Substituting into the above formula recursively, we can get:

[0070]

[0071] Among them, α t is the single-step noise retention coefficient, α t =1-β t Indicates the weight of retaining the previous state, is the cumulative noise retention coefficient used to calculate x directly from x0 t .

[0072] When t→T, there is α t →0 and α t ≈0, thus 1-α t ≈1, at this time x T ~N(0,I). Therefore, the noise intensity β t >0, and gradually increases with time, making x T Close to pure Gaussian noise.

[0073] In this embodiment, an improved first denoising diffusion generation model is used to generate a target environment image. Step 210, using the improved first denoising diffusion generation model to perform a forward process on the standard environment background image to generate a first Gaussian noise image, specifically including: the improved first denoising diffusion generation model performs a forward process on the standard environment background according to the superimposed cosine noise method to obtain the first Gaussian noise image.

[0074] Specifically, the improved first denoising diffusion generation model (IDDPM1) uses a cosine noise superposition method. Cosine noise has the following characteristics: a linear decline in the intermediate process, with minimal variation around t = 0 and t = T. In contrast, linear noise decreases to zero more quickly, destroying information more quickly. This improvement in the cosine noise method results in better performance on low-resolution images.

[0075] Furthermore, the standard environment background is forward processed according to the superimposed cosine noise method to obtain a first Gaussian noise image, specifically including: gradually adding noise to the standard environment background according to the noise variance corresponding to each time step and the preset Gaussian noise to obtain the first Gaussian noise image.

[0076] The noise variance is expressed as follows:

[0077]

[0078]

[0079] Where, β t is the noise variance at time step t, where 0≤t≤T, T is the total number of time steps, is the cumulative noise retention coefficient of the tth step, and s is the offset of the preset cosine scheduling function.

[0080] In this embodiment, β t Not greater than 0.999 to prevent a singularity from occurring near t=T at the end of the diffusion process.

[0081] Step 220: When the improved first denoising diffusion generation model performs a reverse process on the first Gaussian noise image, the improved first denoising diffusion generation model introduces a denoising diffusion implicit model to accelerate the sampling process of the reverse process of the first Gaussian noise image to obtain an initial background image.

[0082] In this embodiment, the improved first denoising diffusion generation model IDDPM1 trains a U-Net network to predict the noise ∈ t When training the U-Net network, the mean squared error (MSE) is used as the loss function, that is, minimizing the MSE (∈t ,∈ θ (x t ,t)), where∈ θ (x t ,t) represents the predicted value of the U-Net network. The optimal U-Net network is obtained through the loss function to perform noise prediction through the optimal U-Net network.

[0083] Specifically, the prediction noise generation process needs to be t Derived step by step back to x0. According to the formula:

[0084]

[0085] Furthermore, the posterior distribution can be calculated by

[0086]

[0087] Finally, use the trained U-Net network to predict ∈ t , and perform step-by-step denoising using the following formula:

[0088]

[0089] This embodiment also introduces a denoising diffusion implicit model for sampling generation to achieve the purpose of accelerating the sampling process and quickly generating the initial background image.

[0090] Specifically, de-Markovization is performed on the denoising diffusion implicit model to accelerate model generation, which can be expressed as follows:

[0091]

[0092] The denoising diffusion implicit model cleverly removes the Markov constraint by designing an optimization objective, significantly reducing the number of sampling steps without affecting the boundary distribution of the improved first denoising diffusion generative model IDDPM1. The trained improved first denoising diffusion generative model IDDPM1 can be directly used without retraining the model, speeding up sampling.

[0093] During training, the IDDPM1 employed in this embodiment employs a cosine-based noise addition, enhancing the model's generalization capabilities and ensuring that the U-Net network can better learn the noise. During generation, the present invention employs DDIM for model generation and addition, which, compared to DDPM, is faster and more efficient.

[0094] Step 230: Perform random exposure processing on the initial background image to obtain the target environment image.

[0095] In an embodiment of the present invention, exposure information is randomly added to the initial background image. Specifically, a point is randomly determined in the initial background image as the center of a circle, and exposure information of a scale of n×n is added to increase the diversity of the complex background in the target environment image.

[0096] This embodiment adds random exposure points during the target environment background image generation process, increasing the complexity of the environment. This makes the generated image more similar to images captured in a high-exposure environment, significantly enriching the training dataset. This allows the detection model trained on this target environment background image to identify diverse defects, particularly diverse critical defects.

[0097] An embodiment of the present invention proposes a target environment image generation method, which can not only generate a high-quality initial background image, but also simulate various interference factors in a complex environment through noise superposition and rapid sampling technology. The target environment background image finally generated will also undergo exposure processing to simulate a real and complex environmental background, so that the detection model generated by model training based on the rich target environment background image can more accurately identify and process various types of image data in various complex environments when performing distribution network insulator defect detection, thereby improving the overall performance and robustness of the insulator defect detection system.

[0098] In one embodiment of the present invention, the insulator image generation model includes an improved second denoising diffusion generation model and a defect mask module. Similar to the target environment image generation method, the insulator image generation model also uses the IDDPM to superimpose noise and then performs accelerated sampling processing using the denoising diffusion implicit model to obtain an image of the insulator with defects.

[0099] Based on this, step 300, inputting the standard insulator image into a preset insulator image generation model to obtain a target insulator image, where the target insulator image is an image containing damaged insulators, specifically includes:

[0100] Step 310: Input the standard insulator image into the improved second denoising diffusion generation model for forward processing to generate a second Gaussian noise image.

[0101] In this embodiment, during the training process, the method in which IDDPM1 generates the first Gaussian noise picture can be used to generate the second Gaussian noise picture for the improved second denoising diffusion generation model IDDPM2, which will not be elaborated herein.

[0102] Step 320: The defect mask module generates a defect mask image based on the standard insulator image.

[0103] During the sampling process, unlike the generation process of the environmental background generation module, the target insulator image is generated by inputting the defect mask image and the second Gaussian noise image. The defect mask image is generated by the defect mask module.

[0104] Settings for the defect mask module:

[0105] 1. Create an all-zero matrix with the same size as the input standard insulator image. The all-zero matrix will be used to store the generated mask.

[0106] 2. Randomly generate a rectangular area as the mask matrix area and obtain the coordinates of the upper left corner, width and height of the mask matrix area. The size of the mask matrix can be controlled to ensure that the generated rectangle is not too large or too small. Assume that the size of the mask matrix is ​​(H×W), the width is w, and the height is h. The coordinates of the upper left corner of the random mask matrix are (x1, y1). For each pixel (i, j) in the mask matrix, if the following equation is satisfied, the value of the pixel in the mask matrix is ​​set to 1, thereby obtaining the defect mask image:

[0107] x1≤j <x1+w

[0108] y1≤i <y1+h

[0109] Different randomly generated defect mask matrices can be generated through the above steps, so as to generate a target insulator image based on the different defect mask matrices and the second Gaussian noise image.

[0110] Step 330: Merge the second Gaussian noise image and the defect mask image to generate a target Gaussian noise image.

[0111] During the generation process, the feature U-Net network is used to merge the second Gaussian noise image and the defect mask image to generate a 4-channel data to obtain the target Gaussian noise image.

[0112] Step 340: When the improved second denoising diffusion generation model performs reverse processing on the target Gaussian noise image, the improved second denoising diffusion generation model introduces a denoising diffusion implicit model to accelerate the sampling process of the reverse process of the target Gaussian noise image to obtain the target insulator image.

[0113] In this embodiment, during the generation phase, the improved second denoising diffusion generation model IDDPM2 may be used to generate the target insulator image by introducing the denoising diffusion implicit model IDDPM1 to generate the target environment background image, which will not be elaborated herein.

[0114] In this embodiment, a defect mask module is used to generate defects in a standard insulator image. Guided solely by the image fusion module, the position and morphology of the generated defects on the insulator can be changed. By adjusting the generation scale of the damaged insulator, the significance of the generated defects can be controlled, achieving the goal of generating small target defects. Secondly, the position of the damaged insulator in the background image can be controlled, increasing the diversity of model generation.

[0115] In another embodiment of the present invention, Step 310, inputting the standard insulator image into the improved second denoising diffusion generation model for forward processing to generate a second Gaussian noise image, specifically includes:

[0116] Step 311: The standard insulator image is gradually denoised according to the noise variance corresponding to each time step and the preset Gaussian noise to obtain a noisy image at each time step.

[0117] Step 312: The defect mask module generates a corresponding target defect mask image based on the noisy image generated at each time step.

[0118] During the entire processing process, after each step of the noise addition operation from the initial noise-free standard insulator image to the final high-noise second Gaussian noise image is completed, the defect mask module will generate a corresponding defect mask image based on the current noise addition image.

[0119] Step 313: Merge the target noisy image generated at the target time step and the target defect mask image corresponding to the target noisy image to generate merged data, where the target time step is any time step among all the time steps of the forward process.

[0120] In this embodiment, the current noisy image and its corresponding defect mask image are merged into a 4-channel merged data.

[0121] Step 314: The U-Net network in the improved second denoising diffusion generation model performs noise prediction on the merged data generated at the target time step to obtain the predicted noise of the target noisy image at the target time step.

[0122] In this embodiment, this merged data is fed into the U-Net network together with the noisy image at the current time step to obtain the predicted noise.

[0123] Step 315. Based on the loss function, the improved second denoising diffusion generation model is optimized according to the predicted noise of the target noisy image and the actual noise of the target noisy image to obtain the optimized target second denoising diffusion generation model. The standard insulator image is forward processed based on the optimized target second denoising diffusion generation model to generate a second Gaussian noise image.

[0124] In this embodiment, this predicted noise is compared with the actual added noise, and a loss function is calculated to optimize the parameters of the improved second denoising diffusion generation model. The training process is essentially an iterative process, aiming to continuously adjust the feature U-Net network so that it can accurately fit the noise distribution and effectively predict the noise value during the generation process, thereby achieving high-quality image generation tasks.

[0125] In the characteristic U-Net network structure, the traditional mean squared error (MSE) loss function is insufficient. To address the problem that the traditional loss function cannot adequately distinguish between background and defect areas, a new loss function design is introduced to better adapt to the characteristics of the defect detection task. This loss function formula consists of two parts: the first part is the standard MSE loss calculated for the entire image; the second part is the MSE loss calculated specifically for the defect area, which is multiplied by the loss coefficient τ to amplify the importance of the defect area. In this way, the model can focus more on learning the characteristics of the defect area, thereby improving the ability to recognize the shape and location of subtle defects.

[0126] The loss function is expressed as follows:

[0127] LOss=MSE(∈ θ (x t +x m ,t),∈ t )+τMSE m (∈ θ (x t +x m ,t),∈ t )

[0128] Where,∈ θ (x t +x m ,t) is the prediction noise at time step t, x t Noise image at time step t, x m is the mask image at time step t, ∈ t is the actual noise at time step t, and τ is the preset loss coefficient.

[0129] By adjusting the loss parameter τ, we can control the ratio of the loss in the defective area to the overall loss, thereby promoting the model to focus more on learning the defect location and enhancing its ability to capture defect features. This improvement enables the feature U-Net network to not only accurately fit the noise distribution globally, but also achieve higher precision in local details.

[0130] In the actual process of inspecting distribution network insulators, they are often detected as small targets in inspection images. To improve the detection model's accuracy, the insulators in the training samples should be kept to an appropriate size during model training. This means that when fusing the target insulator image with the target environment background image, a rescaling operation is often required to ensure that the insulator can be clearly identified and analyzed in the fused image.

[0131] To achieve this goal, this embodiment uses a bilinear interpolation algorithm to scale the target insulator image and the target environment background image. Bilinear interpolation is a commonly used image scaling algorithm that calculates the pixel value at the target location by taking a weighted average of the four neighboring pixels surrounding the target pixel, thereby achieving smooth image scaling. This method can preserve image detail while avoiding jagged edges.

[0132] During the generation of target insulator images, the resulting images are typically 64×64 pixels in size. To effectively fuse these generated target insulator images with the target environment background image, the scale parameters of the insulators in the generated target insulator images are input into the image fusion control module. By adjusting these parameters, a resizing algorithm is used to appropriately scale the target insulator images to match their size, ensuring good visual quality and accurate detection performance in the fused images.

[0133] Specifically, based on the input insulator scale parameters, the target size of the target insulator image within the target environment background image is determined. The scaling ratio between the target size and the original size is calculated to obtain the scaled insulator image. For each pixel in the scaled insulator image, its corresponding position in the original image is found, and the weighted average of the four surrounding pixels is taken to calculate the value of the target pixel.

[0134] In this way, the target insulator image can be accurately scaled to the required size and seamlessly integrated with the target environment background image, thereby improving the accuracy and reliability of distribution network insulator detection.

[0135] Specifically, at each time step t, the defect mask image x is first used m Mask the noised background image y at the current time step to obtain the background image y with the defect removed. t -x m , this process follows the formula:

[0136]

[0137] At the same time, using the same defect mask xm Insulator image during denoising process x t Masking is performed to obtain the masked insulator noise image x′ t . The masked x′ t with y t -x m Synthesize according to the formula to generate a new image that incorporates defect-free background information:

[0138]

[0139] In this way, it can be ensured that no defect background information affects the prediction results of the feature U-Net network in the subsequent iteration process, thereby enhancing the coordination consistency between defects and background and avoiding the influence of x m There is a noticeable unnatural feeling between the defects generated by the guide and the background.

[0140] The embodiment of the present invention considers the influence of the background information of each step of the generation process on the defect generation, which helps to ensure the harmony and unity of the defect and the background in the final generated image. t The black background area, that is, the part outside the defect, is directly t -x m The original mean value is replaced by the corresponding regional value, ensuring that these regions are highly consistent with the overall background. This processing method enables the model to transfer defects with high quality across different backgrounds, improving the realism and diversity of defect image generation, and also allows for controllable generation of the position of damaged insulators within the background.

[0141] In one embodiment of the present invention, a device for generating a damaged insulator image is also provided. Figure 2 , Figure 2 2 is a structural block diagram of a device for generating an image of a damaged insulator according to an embodiment of the present invention. The device includes an image acquisition unit 201 , an image generation unit 202 and an image processing unit 203 .

[0142] The image acquisition unit 201 is used to acquire a standard environment background image and a standard insulator image.

[0143] The image generation unit 202 is configured to input the standard environment background image into a preset environment background generation module to obtain a target environment image, where the target environment image is an image containing complex environment content.

[0144] The standard insulator image is input into a preset insulator image generation model to obtain a target insulator image, which is an image containing a damaged insulator.

[0145] The image processing unit 203 is configured to perform scale transformation and fusion on the target environment image and the target insulator image using a bilinear interpolation algorithm to obtain a synthesized insulator damage image.

[0146] The damaged insulator image generation device of an embodiment of the present invention generates a variety of damaged insulator images through standard environmental background images and standard insulator images, performs model training based on the damaged insulator images, and generates a detection model for identifying whether an insulator is damaged. The generalization ability of the detection model trained based on the rich damaged insulator images can be effectively improved, so that the detection model can adapt to various insulator defects, thereby improving the accuracy of the detection results.

[0147] Figure 3 FIG1 shows the internal structure of a computer device in one embodiment of the present invention. The computer device can be a terminal or a system. Figure 3 As shown, the computer device includes a processor, a memory, and a network interface connected via a system bus. The memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium of the computer device stores an operating system and may also store a computer program. When the computer program is executed by the processor, the processor can implement the various steps in the above method embodiment. The internal memory may also store a computer program. When the computer program is executed by the processor, the processor can implement the various steps in the above method embodiment. It will be understood by those skilled in the art that Figure 3 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0148] In one embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program. When the computer program is executed by the processor, the processor executes each step in the above method embodiment.

[0149] In one embodiment, a computer-readable storage medium is provided, which stores a computer program. When the computer program is executed by a processor, the processor executes the steps in the above method embodiment.

[0150] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0151] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0152] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present invention, all of which fall within the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be determined by the appended claims.

Claims

1. A method for generating an image of a damaged insulator, characterized in that: The method comprises: Acquire a standard environment background image and a standard insulator image; Inputting the standard environment background image into a preset environment background generation module to obtain a target environment image, wherein the target environment image is an image containing complex environment content; Inputting the standard insulator image into a preset insulator image generation model to obtain a target insulator image, wherein the target insulator image is an image including a damaged insulator; The target environment image and the target insulator image are scale-transformed and fused using a bilinear interpolation algorithm to obtain a synthesized insulator damage image.

2. The method according to claim 1, wherein The environmental background generation module includes an improved first denoising diffusion generation model; Then, the step of inputting the standard environment background image into a preset environment background generation module to obtain a target environment image specifically includes: Performing forward process processing on the standard environment background image using the improved first denoising diffusion generation model to generate a first Gaussian noise image; When the improved first denoising diffusion generation model performs a reverse process on the first Gaussian noise image, the improved first denoising diffusion generation model introduces a denoising diffusion implicit model to accelerate a sampling process of the reverse process of the first Gaussian noise image to obtain an initial background image; The initial background image is randomly exposed to obtain a target environment image.

3. The method according to claim 2, wherein The step of performing forward processing on the standard environment background image using the improved first denoising diffusion generation model to generate a first Gaussian noise image specifically includes: The improved first denoising diffusion generation model performs forward process processing on the standard environment background according to the cosine noise addition method to obtain a first Gaussian noise image.

4. The method according to claim 2, wherein The forward process of processing the standard environment background according to the superimposed cosine noise method to obtain a first Gaussian noise image specifically includes: Stepwise adding noise to the standard environment background according to the noise variance corresponding to each time step and the preset Gaussian noise to obtain the first Gaussian noise image; The noise variance is expressed by the following formula: Where, β t is the noise variance at time step t, where 0≤t≤T, T is the total number of time steps, is the cumulative noise retention coefficient of the tth step, and s is the offset of the preset cosine scheduling function.

5. The method according to claim 1, wherein The insulator image generation model includes an improved second denoising diffusion generation model and a defect mask module; The step of inputting the standard insulator image into a preset insulator image generation model to obtain a target insulator image, wherein the target insulator image is an image including a damaged insulator, specifically includes: Inputting the standard insulator image into the improved second denoising diffusion generation model for forward processing to generate a second Gaussian noise image; The defect mask module generates a defect mask image according to the standard insulator image; merging the second Gaussian noise image and the defect mask image to generate a target Gaussian noise image; When the improved second denoising diffusion generation model performs a reverse process on the target Gaussian noise image, the improved second denoising diffusion generation model introduces a denoising diffusion implicit model to accelerate the sampling process of the reverse process of the target Gaussian noise image to obtain the target insulator image.

6. The method according to claim 5, wherein The step of inputting the standard insulator image into the improved second denoising diffusion generation model for forward processing to generate a second Gaussian noise image specifically includes: The standard insulator image is gradually denoised according to the noise variance corresponding to each time step and the preset Gaussian noise to obtain a noisy image at each time step; The defect mask module generates a corresponding target defect mask image based on the noisy image generated at each time step; Merging the target noisy image generated at a target time step and the target defect mask image corresponding to the target noisy image to generate merged data, wherein the target time step is any time step among all the time steps of the forward process; The U-Net network in the improved second denoising diffusion generation model performs noise prediction on the merged data generated at the target time step to obtain the predicted noise of the target noisy image at the target time step; The improved second denoising diffusion generation model is optimized according to the predicted noise of the target noisy image and the actual noise of the target noisy image based on the loss function to obtain an optimized target second denoising diffusion generation model, and the standard insulator image is forward processed based on the optimized target second denoising diffusion generation model to generate a second Gaussian noise image.

7. The method according to claim 6, wherein The loss function is expressed as follows: LOSS=MSE(∈ θ (x t +x m ,t),∈ t )+τMSE m (∈ θ (x t +x m ,t),∈ t ) Where,∈ θ (x t +x m ,t) is the prediction noise at time step t, x t Noise image at time step t, x m is the mask image at time step t, ∈ t is the actual noise at time step t, and τ is the preset loss coefficient.

8. A device for generating an image of a damaged insulator, characterized in that: The device includes an image acquisition unit, an image generation unit and an image processing unit; The image acquisition unit is used to acquire a standard environment background image and a standard insulator image; The image generation unit is used to input the standard environment background image into a preset environment background generation module to obtain a target environment image, wherein the target environment image is an image containing complex environment content; Inputting the standard insulator image into a preset insulator image generation model to obtain a target insulator image, wherein the target insulator image is an image including a damaged insulator; The image processing unit is used to perform scale transformation and fusion on the target environment image and the target insulator image using a bilinear interpolation algorithm to obtain a synthesized insulator damage image.

9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the processor is caused to perform the steps of the method according to any one of claims 1 to 7.

10. A computer device comprising a memory and a processor, characterized in that: The memory stores a computer program, and when the computer program is executed by the processor, the processor is caused to perform the steps of the method according to any one of claims 1 to 7.