An insulator defect sample generation method, device, equipment and storage medium

CN122967069APending Publication Date: 2026-10-23SANXIA JINSHAJIANG YUNCHUAN HYDROPOWER DEV CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611120221.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-27
Publication Date
2026-10-23

AI Technical Summary

Technical Problem

[0006]本申请提供一种绝缘子缺陷样本生成方法、装置、设备及存储介质,可以解决现有技术中传统图像增强仅局限于像素级变换而无法创造新的缺陷几何形态,易导致模型过拟合;生成对抗网络训练不稳定且难以精确控制缺陷的物理结构一致性;三维渲染方法虽几何准确但光照纹理过于理想化,与真实场景存在显著域差距;基于文本的扩散模型缺乏空间约束易产生结构幻觉;导致现有方案均无法同时兼顾缺陷物理结构的准确性与视觉纹理的真实性,存在难以满足高精度诊断需求的问题

Benefits of technology

[0017]本申请实施例提供的技术方案带来的有益效果包括:

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122967069A_ABST
    Figure CN122967069A_ABST
Patent Text Reader

Abstract

The application relates to an insulator defect sample generation method and device, equipment and a storage medium, and relates to the technical field of insulator defect intelligent diagnosis. The method comprises the following steps: based on a standard insulator three-dimensional model and a defect primitive three-dimensional model, an insulator three-dimensional model containing defect geometric parameters is constructed, and a geometric structure guide map is obtained through virtual perspective rendering or projection; the geometric structure guide map is input into a control network of a pre-trained diffusion model as a spatial constraint condition to lock the spatial structure of a generated sample image; preset scene style weight parameters are configured to the pre-trained diffusion model; and the pre-trained diffusion model configured with the spatial constraint condition and the scene style weight parameters is used to generate an insulator defect sample image. The method solves the problem that the prior art cannot simultaneously consider the accuracy of a defect physical structure and the authenticity of a visual texture, and cannot meet the requirement of high-precision diagnosis.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent diagnostic technology for insulator defects, specifically to a method, apparatus, device, and storage medium for generating insulator defect samples. Background Technology

[0002] High-voltage transmission lines are the backbone of the power system, and their operational safety directly affects the stable power supply of the grid. Insulators, as critical electrical insulation and mechanical support components in transmission lines, are exposed to complex outdoor environments for extended periods, making them susceptible to defects such as breakage, cracks, and flashover. Failure to detect and address these defects promptly can lead to string drops, line breaks, or even large-scale power outages. Therefore, efficient and accurate diagnosis of insulator defects has significant engineering application value.

[0003] In recent years, with the rapid development of UAV inspection technology and computer vision technology, deep learning-based automatic insulator defect diagnosis methods have gradually become mainstream. These methods typically extract image features using convolutional neural networks (CNNs) or Transformer architectures to detect and classify defect targets. However, the performance of deep learning models is highly dependent on the scale and quality of the training data. In practical engineering scenarios, acquiring insulator defect samples faces significant challenges: on the one hand, high-voltage line inspections primarily focus on normal operating conditions, resulting in an extremely low probability of defects, leading to a severe "long-tail distribution" of defect samples and an imbalance between positive and negative samples; on the other hand, collecting real defect data is costly, risky, and difficult to cover all possible defect morphologies (such as damage at different locations, cracks at different depths, etc.). Data scarcity has become a major bottleneck restricting the improvement of diagnostic model accuracy and generalization ability.

[0004] In existing technologies, the following types of data augmentation or generation schemes are mainly used: The first type is data augmentation methods based on traditional image processing. This method physically expands the number of samples by rotating, flipping, cropping, color changing, or pixel-level adjustments (such as Gaussian blur, adjusting brightness / contrast, and adding noise) on a small number of existing defective images. The second type is image generation methods based on generative adversarial networks (GANs). Through the game between the generator and the discriminator, seemingly realistic defective images are generated from random noise, or normal samples are converted into defective samples. The third type is synthetic data methods based on 3D modeling and rendering. This method uses 3D software to construct an insulator model, manually sets defects and adjusts lighting parameters, and then renders the image. The fourth type is generation methods based on the latest diffusion models, which generate images by inputting text prompts.

[0005] However, traditional image enhancement is limited to pixel-level transformations and cannot create new defect geometries, which can easily lead to model overfitting; generative adversarial networks are unstable to train and it is difficult to precisely control the consistency of the physical structure of defects; although 3D rendering methods are geometrically accurate, their lighting and textures are too idealized, resulting in a significant domain gap with real scenes; text-based diffusion models lack spatial constraints and are prone to structural illusions; as a result, existing solutions cannot simultaneously take into account the accuracy of the physical structure of defects and the realism of visual textures, and thus cannot meet the requirements of high-precision diagnosis. Summary of the Invention

[0006] This application provides a method, apparatus, device, and storage medium for generating insulator defect samples. It can solve the problems in the prior art where traditional image enhancement is limited to pixel-level transformation and cannot create new defect geometry, which easily leads to model overfitting; generative adversarial networks are unstable in training and it is difficult to accurately control the consistency of the physical structure of defects; although the 3D rendering method is geometrically accurate, the lighting and texture are too idealized, and there is a significant domain difference from the real scene; text-based diffusion models lack spatial constraints and are prone to structural illusions. As a result, the existing solutions cannot simultaneously take into account the accuracy of the physical structure of defects and the realism of visual texture, and have the problem of failing to meet the requirements of high-precision diagnosis.

[0007] In a first aspect, embodiments of this application provide a method for generating insulator defect samples, comprising: Based on the standard insulator 3D model and the defect element 3D model, a 3D insulator model containing defect geometric parameters is constructed, and a geometric structure guide diagram is obtained through virtual perspective rendering or projection. The geometric structure guidance map is input as a spatial constraint into the control network of the pre-trained diffusion model to lock the spatial structure of the generated sample image; Configure the preset scene style weight parameters into the pre-trained diffusion model; A pre-trained diffusion model configured with spatial constraints and scene style weight parameters is used to generate insulator defect sample images.

[0008] In one implementation, the construction of a three-dimensional insulator model containing defect geometric parameters based on a standard insulator three-dimensional model and a defect primitive three-dimensional model, and the acquisition of a geometric structure guidance diagram through virtual perspective rendering or projection, includes: Load the standard insulator 3D model; The defect element 3D model is moved to the preset damage location using rotation and translation operations; By removing the intersection between the standard insulator 3D model and the defect element 3D model, a 3D defect insulator model with physical damage characteristics is obtained. Set the virtual camera parameters, perform orthogonal or perspective rendering on the 3D defective insulator model, and generate a 2D guide image for the corresponding channel as a geometric structure guide image.

[0009] In one implementation, the step of inputting the geometric structure guidance map as a spatial constraint into the control network of a pre-trained diffusion model to lock the spatial structure of the generated sample image includes: Construct text prompts and encode them to obtain the text prompt code; The geometric structure guide map is converted into the corresponding edge space condition code after feature encoding; The marginal space conditional encoding is injected into the denoising process of the pre-trained diffusion model through a zero convolutional layer in the control network; The content and structure of the sample images generated are jointly constrained by text prompt word encoding and edge space condition encoding.

[0010] In one implementation, the conditional prediction objective function for the content and structure of the jointly constrained generated image is expressed as: ; in, For the first The latent space characteristic noise of the step, The noise predicted by the network based on both joint text and spatial geometry conditions. Encode text prompt words, Conditional encoding for edge space, These are the initial latent variables.

[0011] In one implementation, configuring preset scene style weight parameters into the pre-trained diffusion model includes: Freeze the core weights of the pre-trained diffusion model, and inject a low-rank decomposition matrix and an increased-dimensional matrix into the cross-attention layer for low-rank updates; The low-rank decomposition matrix and the increased-dimensional matrix are trained using real inspection scene images to obtain scene style weight parameters; Configure the scene style weight parameters obtained from training into the pre-trained diffusion model.

[0012] In one embodiment, after generating the insulator defect sample image, the method further includes: A defect diagnosis model is trained by mixing generated insulator defect sample images with real images. Obtain the evaluation metrics of the defect diagnosis model on the validation set; If the evaluation index does not meet the preset conditions, the defect geometric parameters or the generation condition parameters of the pre-trained diffusion model are adjusted in reverse, and the process returns to the step of constructing a three-dimensional model of an insulator containing the defect geometric parameters.

[0013] In one implementation, during the process of reversely adjusting the defect geometry parameters or the generation condition parameters of the pre-trained diffusion model: When the missed detection rate of a specific category of defects is higher than a preset threshold, the removal depth or removal area of ​​the corresponding defect is increased. When the false alarm rate in a specific environment exceeds a preset threshold, adjust the lighting description weight in the text prompt or select the scene style weight parameter of the corresponding style.

[0014] Secondly, embodiments of this application also provide an insulator defect sample generation apparatus, which includes: The 3D modeling and guide map generation module is used to construct a 3D model of an insulator containing defect geometric parameters based on a standard 3D insulator model and a 3D model of defect primitives, and obtain a geometric structure guide map through virtual view rendering or projection. A spatial constraint configuration module is used to input the geometric structure guidance map as a spatial constraint into the control network of the pre-trained diffusion model in order to lock the spatial structure of the generated sample image. The scene style weight configuration module is used to configure the preset scene style weight parameters into the pre-trained diffusion model; The sample generation module is used to generate insulator defect sample images using a pre-trained diffusion model configured with spatial constraints and scene style weight parameters.

[0015] Thirdly, this application also provides an insulator defect sample generation device, which includes a processor, a memory, and an insulator defect sample generation program stored in the memory and executable by the processor. When the insulator defect sample generation program is executed by the processor, it implements the steps of the above-described insulator defect sample generation method.

[0016] Fourthly, embodiments of this application also provide a storage medium storing an insulator defect sample generation program, wherein when the insulator defect sample generation program is executed by a processor, it implements the steps of the above-described insulator defect sample generation method.

[0017] The beneficial effects of the technical solutions provided in this application include: By constructing a 3D insulator model containing defect geometric parameters based on a standard 3D insulator model and a 3D defect primitive model, and combining this with virtual perspective rendering to obtain a geometric structure guidance map, the morphology, location, and size of defects can be precisely controlled from the physical source, enabling diversified generation of defect samples. Furthermore, the geometric structure guidance map is input as a spatial constraint into the control network of a pre-trained diffusion model, effectively locking the spatial structure of the generated images and avoiding the structural illusion problem easily generated by purely generative models. Simultaneously, by configuring preset scene style weight parameters into the pre-trained diffusion model, the background, lighting, and texture features of the generated samples are highly consistent with real inspection scenes, significantly reducing the domain gap between synthetic and real data. This method balances the accuracy of the defect's physical structure with the realism of its visual texture. Using the generated high-quality samples to train a defect diagnosis model can significantly improve the model's generalization ability and diagnostic accuracy in complex environments, while reducing the cost of relying on scarce real defect data, demonstrating good engineering application value. This addresses several issues in existing technologies. Traditional image enhancement is limited to pixel-level transformations and cannot create new defect geometries, leading to model overfitting. Generative adversarial networks are unstable during training and struggle to precisely control the consistency of the physical structure of defects. While 3D rendering methods are geometrically accurate, their lighting and textures are overly idealized, resulting in significant domain discrepancies with real-world scenes. Text-based diffusion models lack spatial constraints and are prone to structural illusions. Consequently, existing solutions cannot simultaneously achieve both accuracy in the physical structure of defects and realism in visual texture, making it difficult to meet the demands of high-precision diagnosis. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 This is a flowchart illustrating the first embodiment of the insulator defect sample generation method of the present invention.

[0020] Figure 2 This is a schematic diagram of the hardware structure of the insulator defect sample generation device involved in the embodiments of this application. Detailed Implementation

[0021] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.

[0022] Firstly, this application provides a method for generating insulator defect samples.

[0023] In one embodiment, reference is made to Figure 1 , Figure 1 This is a schematic flowchart of the first embodiment of the insulator defect sample generation method of this application. Figure 1 As shown, the method for generating insulator defect samples includes: S1: Based on the standard insulator 3D model and the defect primitive 3D model, construct an insulator 3D model containing defect geometric parameters, and obtain the geometric structure guide diagram through virtual perspective rendering or projection.

[0024] S2: Input the geometric structure guide map as a spatial constraint into the control network of the pre-trained diffusion model to lock the spatial structure of the generated sample images.

[0025] S3: Configure the preset scene style weight parameters into the pre-trained diffusion model.

[0026] S4: Generate insulator defect sample images using a pre-trained diffusion model configured with spatial constraints and scene style weight parameters.

[0027] By constructing a 3D insulator model containing defect geometric parameters based on a standard 3D insulator model and a 3D defect primitive model, and combining this with virtual perspective rendering to obtain a geometric structure guidance map, the morphology, location, and size of defects can be precisely controlled from the physical source, enabling diversified generation of defect samples. Furthermore, the geometric structure guidance map is input as a spatial constraint into the control network of a pre-trained diffusion model, effectively locking the spatial structure of the generated images and avoiding the structural illusion problem easily generated by purely generative models. Simultaneously, by configuring preset scene style weight parameters into the pre-trained diffusion model, the background, lighting, and texture features of the generated samples are highly consistent with real inspection scenes, significantly reducing the domain gap between synthetic and real data. This method balances the accuracy of the defect's physical structure with the realism of its visual texture. Using the generated high-quality samples to train a defect diagnosis model can significantly improve the model's generalization ability and diagnostic accuracy in complex environments, while reducing the cost of relying on scarce real defect data, demonstrating good engineering application value.

[0028] Furthermore, in one embodiment, the construction of a three-dimensional insulator model containing defect geometric parameters based on a standard insulator three-dimensional model and a defect primitive three-dimensional model, and the acquisition of a geometric structure guidance diagram through virtual perspective rendering or projection, includes: Load the standard insulator 3D model; The defect element 3D model is moved to the preset damage location using rotation and translation operations; By removing the intersection between the standard insulator 3D model and the defect element 3D model, a 3D defect insulator model with physical damage characteristics is obtained. Set the virtual camera parameters, perform orthogonal or perspective rendering on the 3D defective insulator model, and generate a 2D guide image for the corresponding channel as a geometric structure guide image.

[0029] In this embodiment, a three-dimensional insulator model containing defect geometric parameters is constructed based on a standard three-dimensional insulator model and a three-dimensional defect element model. By using Boolean difference operations to remove the intersection of the models, the actual damage characteristics can be simulated at the physical volume level, ensuring the physical consistency and geometric accuracy of the defect morphology. This effectively avoids the problem of structures violating physical laws that may be caused by two-dimensional image synthesis or purely generative models. By rotating and translating the defect elements to the preset damage position, the parameterized controllable adjustment of the defect position, angle, and size is realized, which facilitates the batch generation of diverse defect samples and enriches the geometric morphology of the training data. Furthermore, by setting virtual camera parameters to perform orthogonal or perspective rendering on the three-dimensional defect insulator model, two-dimensional guide images of the corresponding channels are generated as geometric structure guide images, providing accurate spatial structure priors for the subsequent diffusion model and laying a solid geometric foundation for generating high-fidelity insulator defect samples.

[0030] In this example, a standard insulator model is first constructed using 3D modeling software. Secondly, based on feature-based modeling technology, the extrusion cut function in 3D modeling software is used to establish a reference plane at a specific location on the insulator skirt and draw an irregular two-dimensional defect sketch outline. Then, a stretching operation is used to map it into three-dimensional space, generating a defect primitive entity. The formal representation of this three-dimensional mapping process is as follows: After selecting the aforementioned defect primitives, move them to the standard insulator model. The predetermined damage location is identified, and the intersection of the two is removed using Boolean difference operations to obtain a three-dimensional defect insulator model with physical damage characteristics. The physical resection process is calculated as follows: ,in, and These represent the rotation and translation matrices, respectively. Adjusting these two matrices allows for precise control of the angle and three-dimensional position of the defect element entering the insulator. Finally, the virtual camera parameters are set. For defect models Perform rendering or projection to output a geometric guide map containing precise geometric information. The projection extraction function Represented as: .

[0031] Further, in one embodiment, the step of inputting the geometric structure guidance map as a spatial constraint into the control network of the pre-trained diffusion model to lock the spatial structure of the generated sample image includes: Construct text prompts and encode them to obtain the text prompt code; The geometric structure guide map is converted into the corresponding edge space conditional code after feature encoding; The marginal space conditional encoding is injected into the denoising process of the pre-trained diffusion model through a zero convolutional layer in the control network; The content and structure of the sample images generated are jointly constrained by text prompt word encoding and edge space condition encoding.

[0032] In this embodiment, by transforming the geometric structure guidance map into edge space conditional encoding through feature encoding and combining it with text prompt word encoding, a dual joint constraint of semantic information and spatial geometric information is achieved. This effectively solves the technical problems of structural illusion and uncontrollable defect morphology that are prone to occur when generating images using traditional diffusion models. By using zero convolutional layers in the control network to inject edge space conditional encoding into the denoising process of the pre-trained diffusion model, it is possible to accurately lock the spatial structure of the generated image while retaining the massive prior knowledge of natural images in the pre-trained model, thus avoiding the waste of computational resources caused by retraining the model. Based on the joint constraint mechanism of text prompt word encoding and edge space conditional encoding, it is ensured that the generated sample image not only conforms to the semantic content of the defect description but also strictly follows the geometric structure of the physical model, significantly improving the structural accuracy and content consistency of the generated sample, and providing a high-fidelity and structurally reliable data foundation for subsequent diagnostic model training.

[0033] Furthermore, in one embodiment, the conditional prediction objective function for jointly constraining the content and structure of the generated image is expressed as: ; in, For the first The latent space characteristic noise of the step, The noise predicted by the network based on both joint text and spatial geometry conditions. Encode text prompt words, Conditional encoding for edge space, These are the initial latent variables.

[0034] In this embodiment, by defining a specific conditional prediction objective function, text prompt word encoding and edge space conditional encoding are jointly incorporated into the optimization objective of the diffusion model denoising process, achieving dual joint constraints on the semantic content and spatial structure of the generated image. This function, by minimizing the difference between real noise and joint conditional prediction noise, forces the network to simultaneously respond to the defect type features described in the text and the physical structure features of the geometric guide map during the latent space denoising iteration process, effectively avoiding semantic drift or structural distortion problems that may occur under a single conditional constraint. Based on the joint optimization mechanism of this objective function, it is ensured that the generated insulator defect sample image maintains the precise and controllable defect geometry while possessing realistic texture and background features consistent with the text description, significantly improving the structural consistency and semantic alignment of the generated samples, and providing a highly reliable and high-fidelity training data foundation for subsequent defect diagnosis models.

[0035] In this example, before image generation, a general pre-trained diffusion model is first subjected to transfer learning to enable it to identify and map insulators in the field. Specifically, multiple high-definition insulator inspection images from hydropower stations are collected as a training set. After image preprocessing and uniformly cropping to a preset standard resolution, automatic annotation and unique identifiers are added. Subsequently, a low fine-tuning learning rate is set, and prior fidelity loss is enabled to prevent overfitting or forgetting general knowledge. The core parameters of the network are fine-tuned until the loss function converges. After training, a fixed dedicated model is output. Next, the trained dedicated model is loaded, and a ControlNet adapter is introduced to apply geometric hard constraints. The geometric structure guides the image. The spatial conditions are passed to the ControlNet adapter. In terms of parameter configuration, the ControlNet control weights are set within a strongly constrained range to ensure that edge boundaries are locked from the initial noise stage of the generation process. This strong constraint forces the model to generate images rigorously, preventing issues such as incorrect insulator skirt numbers or misaligned damage locations. During the latent space denoising iteration, the network simultaneously receives text cue word encodings. Conditional coding of edge space Finally, a structured cue word containing trigger words is constructed to activate the feature memory of the dedicated base model. Positive cue words must include unique identifiers set during fine-tuning training, combined with descriptions of physical parameters and ambient lighting; negative cue words are used to filter low-quality generated results. After configuration, the diffusion generation process is initiated. The dedicated base model provides material textures that match the on-site characteristics, while ControlNet provides accurate physical contours. Both are combined to progressively denoise within the latent space, ultimately outputting an insulator sample image that possesses both accurate physical defect dimensions and a realistic industrial on-site texture.

[0036] Furthermore, in one embodiment, configuring the preset scene style weight parameters into the pre-trained diffusion model includes: Freeze the core weights of the pre-trained diffusion model, and inject a low-rank decomposition matrix and an increased-dimensional matrix into the cross-attention layer for low-rank updates; The low-rank decomposition matrix and the increased-dimensional matrix are trained using real inspection scene images to obtain scene style weight parameters; Configure the scene style weight parameters obtained from training into the pre-trained diffusion model.

[0037] In this embodiment, by freezing the core weights of the pre-trained diffusion model, the massive prior knowledge of natural images in the large model is effectively preserved, avoiding the waste of computational resources and the problem of forgetting general knowledge caused by full fine-tuning. Low-rank updates are performed only by injecting low-rank decomposition matrices and increasing-dimensional matrices into the cross-attention layer, which greatly reduces the number of trainable parameters and enables the model to adapt efficiently and quickly to specific scenarios. Scene style weight parameters are obtained by training the low-rank matrix using real inspection scene images, which enables the generated model to accurately capture the lighting, background and texture features of the real scene, significantly reducing the domain gap between the synthetic samples and the real data. This ensures that the generated samples are highly consistent with the real inspection images in terms of visual distribution, and can be directly used for diagnostic model training without complicated post-processing, thus improving the generalization ability of downstream tasks.

[0038] In this example, a small number of real background images and normal insulator images from specific working scenarios are first collected as the training set. When training the low-rank adaptation (LoRA) model, in order to incorporate specific environmental features while preserving the generalization ability of the pre-trained large model, this embodiment employs a special freezing strategy: freezing the core weights of the pre-trained diffusion model. Low-rank decomposition matrices are injected only at the cross-attention layer. and the increasing dimension matrix Perform a low-rank update. For the input feature X, the specific formula for calculating the network forward propagation with fused LoRA weights is as follows: ,in, The size of the low-rank parameter is set (e.g., the effective range is between 8 and 32). The scaling constant is used. Secondly, during training, a corresponding optimizer is employed, and the learning rate is set to dynamic decay mode. For the aforementioned small sample dataset, the total number of training steps is strictly controlled within a reasonable range that allows the model to converge sufficiently without overfitting, while mixed precision is enabled to accelerate convergence. Finally, the trained LoRA weights are attached and fused into the spatially constrained generative model. Comparison shows that if only spatial constraints are applied without style transfer in this step, the generated images, while structurally accurate, often exhibit a "domain gap" between the background and lighting and the real scene. However, after attaching LoRA weights, the generated defect images automatically acquire a scene-specific style, making their visual distribution highly consistent with real inspection images, allowing them to be directly used for subsequent diagnostic model training without complex post-processing.

[0039] Furthermore, in one embodiment, after generating the insulator defect sample image, the method further includes: A defect diagnosis model is trained by mixing generated insulator defect sample images with real images. Obtain the evaluation metrics of the defect diagnosis model on the validation set; If the evaluation indicators do not meet the preset conditions, the defect geometric parameters or the generation condition parameters of the pre-trained diffusion model are adjusted in reverse, and the process returns to the step of constructing a three-dimensional model of the insulator containing the defect geometric parameters.

[0040] In this embodiment, by constructing an intelligent data augmentation closed loop based on diagnostic feedback, a deep linkage between the defect sample generation process and the performance optimization of the diagnostic model is achieved. This effectively solves the technical problems of traditional data generation methods being blind and unable to provide targeted supplementation for model identification weaknesses. By acquiring evaluation indicators and inversely adjusting defect geometric parameters or generation condition parameters, the system can automatically mine the features of difficult sample cases that cause the model to miss or falsely report, achieving iterative and precise augmentation and dynamic optimization of training data. This feedback mechanism can continuously adjust the generation strategy without extensive manual intervention, significantly improving the generalization ability, recall rate, and mean precision of the defect diagnosis model in complex scenarios, ensuring the high reliability and engineering practicality of the final diagnostic system.

[0041] In this example, return to the step of building a 3D model of the insulator containing the defect geometry parameters until the evaluation metrics meet the preset conditions or the maximum number of iterations is reached.

[0042] Furthermore, in one embodiment, during the process of reversely adjusting the defect geometry parameters or the generation condition parameters of the pre-trained diffusion model: When the missed detection rate of a specific category of defects is higher than a preset threshold, the removal depth or removal area of ​​the corresponding defect is increased. When the false alarm rate in a specific environment exceeds a preset threshold, adjust the lighting description weight in the text prompt or select the scene style weight parameter of the corresponding style.

[0043] In this embodiment, by establishing a specific inverse mapping strategy between diagnostic evaluation indicators and generation parameters, targeted data augmentation targeting model performance shortcomings is achieved, effectively solving the problem of insufficient coverage of difficult examples due to the lack of specificity in traditional generation methods. When the false negative rate of a specific category of defects is high, the salience of defect features is enhanced by increasing the defect excision depth or expanding the excision area, forcing the diagnostic model to focus on subtle or hidden defect morphologies, thereby reducing the false negative rate. When the false positive rate is high in a specific environment, the environmental distribution of generated samples is better matched to complex real-world scenes by adjusting the lighting description weight in the text prompts or selecting scene style weight parameters of the corresponding style, effectively suppressing false positives caused by environmental interference. This differentiated adjustment mechanism can achieve intelligent iteration of the generation strategy without manual intervention, significantly improving the generalization ability, recall, and precision of the defect diagnosis model under complex working conditions, ensuring the high reliability and practicality of the diagnostic system.

[0044] In this example, the synthetic defect data generated in the previous steps is first mixed with real inspection background data in a proportional manner to construct an augmented dataset, which is then used to train an improved defect detection model such as YOLO. Next, the trained defect detection model is tested on a validation set to calculate the mean accuracy (mAP), precision (P), and recall (R). The theoretical formulas for these calculations are defined as follows: , ,in, The number of real samples that were correctly predicted as defects by the model; The number of normal samples that were incorrectly predicted as defects; This represents the number of true defect samples that were not detected. Furthermore, the system automatically calculates the mean precision (mAP), which reflects the overall detection capability of the model. The average precision (AP) for each class is obtained by integrating the precision-recall curve. Multi-class mAP is the arithmetic mean of the APi of each class: Finally, a reverse mapping mechanism of "visual features - physical parameters" is constructed. Specifically, when the detection model outputs a difficult case analysis report, it first automatically parses the feature labels of missed or low-confidence samples, and then calls a pre-set parameter adjustment strategy library to match the mapping rules. This strategy library contains multiple sets of logical mapping relationships. For example, for missed detections of "micro-cracks," the "removal width" value in the modeling parameters is automatically adjusted and the random variation range of the removal depth is increased; for false alarms in "backlit environments," the lighting description weight in the prompt words is adjusted, and the LoRA weight of the strong lighting style is selected. Based on the matched adjustment strategy, the input parameters of the 3D modeling script or the condition parameters of the generated model are updated, thereby triggering a new batch of sample generation tasks. The above generation and discrimination process is executed cyclically until the mean accuracy (mAP) on the validation set reaches the preset index, at which point the iteration automatically stops.

[0045] Secondly, this application also provides an insulator defect sample generation apparatus, which includes: The 3D modeling and guide map generation module is used to construct a 3D model of an insulator containing defect geometric parameters based on a standard 3D insulator model and a 3D model of defect primitives, and obtain a geometric structure guide map through virtual view rendering or projection. The spatial constraint configuration module is used to input the geometric structure guide map as spatial constraint into the control network of the pre-trained diffusion model to lock the spatial structure of the generated sample image. The scene style weight configuration module is used to configure the preset scene style weight parameters into the pre-trained diffusion model; The sample generation module is used to generate insulator defect sample images using a pre-trained diffusion model configured with spatial constraints and scene style weight parameters.

[0046] The functions of each module in the above-mentioned insulator defect sample generation device correspond to the steps in the above-mentioned insulator defect sample generation method embodiment, and their functions and implementation processes will not be described in detail here.

[0047] The 3D modeling and guide map generation module, spatial constraint configuration module, scene style weight configuration module, and sample generation module can be devices with data processing capabilities, such as personal computers (PCs), laptops, and servers.

[0048] like Figure 2As shown, in a third aspect, this application also provides an insulator defect sample generation device, which includes a processor, a memory, and an insulator defect sample generation program stored in the memory and executable by the processor, wherein when the insulator defect sample generation program is executed by the processor, it implements the steps of the above-described insulator defect sample generation method.

[0049] In this embodiment of the application, an insulator defect sample generation device may further include a communication interface and a communication bus.

[0050] The communication bus can be of any type and is used to interconnect the processor, memory, and communication interface.

[0051] The communication interface includes input / output (I / O) interfaces, physical interfaces, and logical interfaces used for interconnecting devices within the insulator defect sample generation device, as well as interfaces used for interconnecting the insulator defect sample generation device with other devices (such as other computing devices or user equipment). Physical interfaces can be Ethernet interfaces, fiber optic interfaces, ATM interfaces, etc.; user equipment can be displays, keyboards, etc.

[0052] Memory can be various types of storage media, such as random access memory (RAM), read-only memory (ROM), non-volatile RAM (NVRAM), flash memory, optical storage, hard disk, programmable ROM (PROM), erasable PROM (EPROM), electrically erasable PROM (EEPROM), etc.

[0053] The processor can be a general-purpose processor, which can call the insulator defect sample generation program stored in the memory and execute the insulator defect sample generation method provided in the embodiments of this application. For example, the general-purpose processor can be a central processing unit (CPU). The method executed when the insulator defect sample generation program is called can be referred to in the various embodiments of the insulator defect sample generation method of this application, and will not be repeated here.

[0054] Fourthly, embodiments of this application also provide a storage medium.

[0055] The storage medium stores an insulator defect sample generation program, wherein when the insulator defect sample generation program is executed by the processor, it implements the steps of the above-described insulator defect sample generation method.

[0056] The method implemented when the insulator defect sample generation program is executed can be referred to in various embodiments of the insulator defect sample generation method of this application, and will not be repeated here.

[0057] It should be noted that the sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0058] The terms "comprising" and "having," and any variations thereof, in the specification, claims, and accompanying drawings of this application are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to such process, method, product, or apparatus. The terms "first," "second," and "third," etc., are used to distinguish different objects, etc., and do not indicate a sequence, nor do they limit "first," "second," and "third" to different types.

[0059] In the description of the embodiments of this application, terms such as "exemplary," "for example," or "for instance" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "exemplary," "for example," or "for instance" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of terms such as "exemplary," "for example," or "for instance" is intended to present the relevant concepts in a concrete manner.

[0060] In the description of the embodiments of this application, unless otherwise stated, " / " means "or". For example, A / B can mean A or B. The "and / or" in the text is merely a description of the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist simultaneously, and B exists alone. In addition, in the description of the embodiments of this application, "multiple" means two or more.

[0061] In some processes described in the embodiments of this application, multiple operations or steps are included in a specific order. However, it should be understood that these operations or steps may not be executed in the order they appear in the embodiments of this application, or they may be executed in parallel. The sequence number of the operation is only used to distinguish different operations, and the sequence number itself does not represent any execution order. In addition, these processes may include more or fewer operations, and these operations or steps may be executed sequentially or in parallel, and these operations or steps may be combined.

[0062] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes several instructions to cause a terminal device to execute the methods described in the various embodiments of this application.

[0063] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.

Claims

1. A method for generating insulator defect samples, characterized in that, include: Based on the standard insulator 3D model and the defect element 3D model, a 3D insulator model containing defect geometric parameters is constructed, and a geometric structure guide diagram is obtained through virtual perspective rendering or projection. The geometric structure guidance map is input as a spatial constraint into the control network of the pre-trained diffusion model to lock the spatial structure of the generated sample image; Configure the preset scene style weight parameters into the pre-trained diffusion model; A pre-trained diffusion model configured with spatial constraints and scene style weight parameters is used to generate insulator defect sample images.

2. The method for generating insulator defect samples as described in claim 1, characterized in that, The aforementioned method involves constructing a 3D insulator model containing defect geometric parameters based on a standard insulator 3D model and a defect primitive 3D model, and obtaining a geometric structure guide diagram through virtual perspective rendering or projection, including: Load the standard insulator 3D model; The defect element 3D model is moved to the preset damage location using rotation and translation operations; By removing the intersection between the standard insulator 3D model and the defect element 3D model, a 3D defect insulator model with physical damage characteristics is obtained. Set the virtual camera parameters, perform orthogonal or perspective rendering on the 3D defective insulator model, and generate a 2D guide image for the corresponding channel as a geometric structure guide image.

3. The method for generating insulator defect samples as described in claim 1, characterized in that, The method of inputting the geometric structure guidance map as a spatial constraint into the control network of the pre-trained diffusion model to lock the spatial structure of the generated sample image includes: Construct text prompts and encode them to obtain the text prompt code; The geometric structure guide map is converted into the corresponding edge space condition code after feature encoding; The marginal space conditional encoding is injected into the denoising process of the pre-trained diffusion model through a zero convolutional layer in the control network; The content and structure of the sample images generated are jointly constrained by text prompt word encoding and edge space condition encoding.

4. The method for generating insulator defect samples as described in claim 3, characterized in that, The objective function for predicting the content and structure of the jointly constrained generated image is expressed as follows: ; in, For the first The latent space characteristic noise of the step, The noise predicted by the network based on both joint text and spatial geometry conditions. Encode text prompt words, Conditional encoding for edge space, These are the initial latent variables.

5. The method for generating insulator defect samples as described in claim 1, characterized in that, The method of configuring preset scene style weight parameters into the pre-trained diffusion model includes: Freeze the core weights of the pre-trained diffusion model, and inject a low-rank decomposition matrix and an increased-dimensional matrix into the cross-attention layer for low-rank updates; The low-rank decomposition matrix and the increased-dimensional matrix are trained using real inspection scene images to obtain scene style weight parameters; Configure the scene style weight parameters obtained from training into the pre-trained diffusion model.

6. The method for generating insulator defect samples as described in claim 1, characterized in that, After generating the insulator defect sample image, the method further includes: A defect diagnosis model is trained by mixing generated insulator defect sample images with real images. Obtain the evaluation metrics of the defect diagnosis model on the validation set; If the evaluation index does not meet the preset conditions, the defect geometric parameters or the generation condition parameters of the pre-trained diffusion model are adjusted in reverse, and the process returns to the step of constructing a three-dimensional model of an insulator containing the defect geometric parameters.

7. The method for generating insulator defect samples as described in claim 6, characterized in that, In the process of reversely adjusting the defect geometry parameters or the generation condition parameters of the pre-trained diffusion model: When the missed detection rate of a specific category of defects is higher than a preset threshold, the removal depth or removal area of ​​the corresponding defect is increased. When the false alarm rate in a specific environment exceeds a preset threshold, adjust the lighting description weight in the text prompt or select the scene style weight parameter of the corresponding style.

8. An insulator defect sample generation device, characterized in that, include: The 3D modeling and guide map generation module is used to construct a 3D model of an insulator containing defect geometric parameters based on a standard 3D insulator model and a 3D model of defect primitives, and obtain a geometric structure guide map through virtual view rendering or projection. A spatial constraint configuration module is used to input the geometric structure guidance map as a spatial constraint into the control network of the pre-trained diffusion model in order to lock the spatial structure of the generated sample image. The scene style weight configuration module is used to configure the preset scene style weight parameters into the pre-trained diffusion model; The sample generation module is used to generate insulator defect sample images using a pre-trained diffusion model configured with spatial constraints and scene style weight parameters.

9. An insulator defect sample generation device, characterized in that, The insulator defect sample generation device includes a processor, a memory, and an insulator defect sample generation program stored in the memory and executable by the processor, wherein when the insulator defect sample generation program is executed by the processor, it implements the steps of the insulator defect sample generation method as described in any one of claims 1 to 7.

10. A storage medium, characterized in that, The storage medium stores an insulator defect sample generation program, wherein when the insulator defect sample generation program is executed by a processor, it implements the steps of the insulator defect sample generation method as described in any one of claims 1 to 7.