A power transmission main equipment defect image controllable generation method, system and device
Patent Information
- Application Number
- CN202610971610.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-01
- Publication Date
- 2026-09-18
AI Technical Summary
进一步地,本发明还要解决通用异常生成方法缺少电网设备构件约束、异常位置容易偏移、生成图像与标注标签不一致以及样本质量难以筛选的问题
[0033] This invention determines component-level region priors from an anomaly knowledge base based on the target equipment type and anomaly type, and limits the priority generation region and protected region of anomalies based on the component-level region priors, so that anomalies such as insulator breakage, transformer oil leakage, conductor strand breakage, and component corrosion can be generated in local component regions that match their equipment structure and anomaly mechanism.
Smart Images

Figure CN122780680A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent inspection technology for power equipment, specifically to a method, system, and device for controllable generation of defect images of main power transmission and transformation equipment. Background Technology
[0002] With the application of drone inspections, robotic inspections, and fixed camera equipment in power transmission and transformation operation and maintenance, image-based defect detection of power grid equipment has gradually become an important technical route for power equipment condition perception. Anomalies such as insulator breakage, insulator flashover, transformer oil leakage, conductor strand breakage, and hardware corrosion are usually characterized by low occurrence frequency, high difficulty in on-site data collection, and strict safety control requirements, resulting in insufficient real anomaly samples that can be used to train detection and segmentation models.
[0003] Existing power grid defect identification schemes mostly focus on improving the structure of the detection or segmentation models themselves, such as by improving the target detection network, introducing attention mechanisms, or fusing multi-scale features to enhance defect identification capabilities. These schemes typically assume that there are already sufficient abnormal samples, and they struggle to address the problems of a limited number of real fault images, the long-tailed distribution of abnormal categories, and high annotation costs.
[0004] Other general industrial anomaly image generation schemes can generate anomaly training samples based on normal images and anomalous text, but their applications are mostly for industrial components with regular structures and simple backgrounds. Power grid inspection images simultaneously contain insulator strings, conductors, towers, transformer enclosures, sky, ground, and complex shooting perspectives. If a general generation method is directly used, problems such as abnormal position offsets, deformation of the main body of equipment, incorrect editing of conductors or backgrounds, and material textures that do not conform to the structure of power equipment are likely to occur.
[0005] Furthermore, existing image generation schemes typically focus on generating the image itself, failing to integrate the simultaneous output of pixel-level anomaly masks, target detection boxes, and anomaly category labels as a unified objective. Misalignment between the generated image and the training labels directly impacts the training quality of subsequent detection, segmentation, and anomaly recognition models. Therefore, it is necessary to propose a controllable anomaly image data generation scheme for power grid inspection scenarios, enabling the anomaly generation process to incorporate prior knowledge of equipment components, local editing constraints, structural consistency screening, and synchronized label output. Summary of the Invention
[0006] The technical problem this invention aims to solve is: how to generate power grid equipment anomaly image data based on normal power grid inspection images or text scene descriptions, where the anomaly area is controllable, the equipment structure remains consistent, the scene background is not mistakenly edited, and the annotation information is output synchronously, given the scarcity or absence of real anomaly samples. Furthermore, this invention also addresses the problems of general anomaly generation methods lacking constraints on power grid equipment components, the anomaly location easily shifting, inconsistencies between generated images and annotation labels, and difficulty in screening sample quality.
[0007] This invention is achieved through the following technical solution:
[0008] A method for controllably generating defect images of main power transmission and transformation equipment, comprising:
[0009] The system acquires input data, which includes normal power grid inspection images and / or text scene descriptions, as well as target equipment type information and anomaly type instructions. When the input data includes normal power grid inspection images, the system performs equipment identification and region localization on the normal power grid inspection images to obtain the target equipment main area, candidate anomaly areas, and non-target protected areas.
[0010] Based on the target device type information and the anomaly type instruction, a component-level region prior is determined from the anomaly knowledge base. The component-level region prior is used to define the anomaly priority generation region and the protected region. Based on one or more of the target device main body region, candidate anomaly region, and non-target protected region obtainable from the input data, as well as the component-level region prior, region control conditions and composite control prompts for anomaly image generation are constructed. Based on the input data, a local anomaly editing path for raw image and / or a scene anomaly generation path for raw text image are selected, and multiple candidate anomaly images are generated based on the region control conditions and the composite control prompts.
[0011] The consistency of the multiple candidate abnormal images is evaluated, and qualified abnormal images are selected based on the evaluation results. For the qualified abnormal images, pixel-level abnormal masks, target detection boxes, abnormal category labels and sample metadata are generated and output simultaneously.
[0012] Furthermore, the anomaly knowledge base records the mapping relationship between equipment type, anomaly type, priority acting component, anomaly morphology constraint, and protected component; among them, the priority acting components corresponding to insulator breakage include porcelain disc, shed edge, or glass disc area; the priority acting components corresponding to transformer oil leakage include valve, flange, weld, bottom edge of the enclosure, or oil tank connection part; the priority acting components corresponding to conductor strand breakage include local wire bundle area of the conductor; and the priority acting components corresponding to component corrosion include hardware, bracket, enclosure edge, or connector area.
[0013] Furthermore, the process of identifying equipment and locating regions in the normal power grid inspection images includes:
[0014] The target device body region is determined by using a target detection model, semantic segmentation model, instance segmentation model, visual cue segmentation model, or manual bounding box selection. The candidate abnormal region and the non-target protected region are determined based on the target device body region and the component-level region prior.
[0015] When the location confidence level of a region is lower than the preset location threshold, relocation or manual confirmation is triggered.
[0016] Furthermore, the composite control prompts include device structure prompts, anomaly semantic prompts, and scene protection prompts; the device structure prompts are used to describe the target device type, component composition, and shooting angle; the anomaly semantic prompts are used to describe the anomaly category, anomaly location, and anomaly morphology; and the scene protection prompts are used to constrain non-target protected areas to remain unchanged or meet similarity constraints during the anomaly image generation process.
[0017] Furthermore, selecting the local anomaly editing path for raw images and / or the scene anomaly generation path for raw text images based on the input data includes:
[0018] When a normal power grid inspection image exists and the location confidence of the candidate abnormal region is not lower than the preset location threshold, the local abnormality editing path of the image is selected.
[0019] When there are no normal power grid inspection images, or when it is necessary to expand the samples under different equipment, viewing angles, lighting, weather, or background conditions, the above-mentioned raw image scene anomaly generation path is selected; or, a normal scene base map is first generated through the above-mentioned raw image scene anomaly generation path, and then local anomaly injection is performed through the above-mentioned raw image local anomaly editing path.
[0020] Furthermore, under the local anomaly editing path of the image, an editable region is determined based on the candidate anomaly region, and a freeze constraint or hold constraint is applied to the region outside the editable region, so that cracks, gaps, oil stains, broken strands or rust spots are generated within the editable region.
[0021] Furthermore, the consistency evaluation of the multiple candidate abnormal images includes:
[0022] Calculate the non-editable region similarity, device main structure preservation, anomaly semantic matching degree, and label consistency of the candidate abnormal image, and calculate the generation distribution quality index of the sample batch to which the candidate abnormal image belongs;
[0023] When the non-editing region similarity, device main structure preservation, abnormal semantic matching, label consistency, and generation distribution quality indicators meet the preset quality requirements, the corresponding candidate abnormal image is determined as a qualified abnormal image, and candidate abnormal images that do not meet the preset quality requirements are discarded or regenerated.
[0024] The present invention also provides a controllable generation system for defect images of main power transmission and transformation equipment, based on the aforementioned controllable generation method for defect images of main power transmission and transformation equipment, including an input layer, a perception layer, a control layer, an execution layer, and an evaluation layer;
[0025] The input layer includes an inspection data access module, which is used to acquire input data, including normal power grid inspection images and / or text scene descriptions, and includes target equipment type information and abnormality type instructions;
[0026] The perception layer includes a device type identification module and a region positioning and protected area determination module. The device type identification module is used to identify the target device type in the normal power grid inspection image. The region positioning and protected area determination module is used to perform region positioning on the normal power grid inspection image to obtain the target device main area, candidate abnormal area and non-target protected area.
[0027] The control layer includes an anomaly knowledge base and region prior module, as well as a control prompt construction module. The anomaly knowledge base and region prior module is used to determine component-level region priors from the anomaly knowledge base based on the target device type information and the anomaly type instruction. The component-level region priors are used to limit the anomaly priority generation region and the protected region. The control prompt construction module is used to construct region control conditions and composite control prompts for anomaly image generation based on one or more of the target device main region, candidate anomaly region, and non-target protected region available in the input data, as well as the component-level region priors.
[0028] The execution layer includes a path selection module, a local anomaly editing module, and a scene anomaly generation module. The path selection module is used to select a local anomaly editing path and / or a scene anomaly generation path based on the input data. The local anomaly editing module is used to generate local anomaly appearances within the candidate anomaly area based on the region control conditions and the composite control prompts. The scene anomaly generation module is used to generate candidate anomaly images that conform to the power transmission and transformation inspection scenario based on the composite control prompts and the component-level region priors.
[0029] The evaluation layer includes a consistency evaluation module, a label synchronization generation module, and an anomaly sample output module. The consistency evaluation module is used to evaluate the consistency of multiple candidate anomaly images and select qualified anomaly images based on the evaluation results. The label synchronization generation module is used to synchronously generate pixel-level anomaly masks, target detection boxes, anomaly category labels, and sample metadata for the qualified anomaly images. The anomaly sample output module is used to output the qualified anomaly images and their corresponding annotation information.
[0030] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the controllable generation method for defect images of main power transmission and transformation equipment as described above.
[0031] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the controllable generation method for defect images of main power transmission and transformation equipment as described above.
[0032] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0033] This invention determines component-level region priors from an anomaly knowledge base based on the target equipment type and anomaly type, and limits the priority generation region and protected region of anomalies based on the component-level region priors, so that anomalies such as insulator breakage, transformer oil leakage, conductor strand breakage, and component corrosion can be generated in local component regions that match their equipment structure and anomaly mechanism.
[0034] This invention introduces layered constraints on the target device main body area, candidate anomaly area, and non-target protected area during the abnormal image generation process. By using regional control conditions and composite control prompts, the range of anomaly generation is limited, so that the abnormal appearance is mainly formed within the candidate anomaly area, while maintaining the consistency of non-target device components, background area, and shooting angle.
[0035] This invention selects a local anomaly editing path for raw images and / or a scene anomaly generation path for raw images based on input data. It can generate local defect samples using existing normal power grid inspection images, and can also generate new abnormal scene samples when there is a lack of normal base images or when scene conditions need to be expanded.
[0036] This invention generates pixel-level anomaly masks, target detection boxes, anomaly category labels, and sample metadata simultaneously while outputting qualified anomaly images. This ensures that the generated images correspond to the labeled information, reduces the workload of subsequent manual labeling, and improves the usability of the generated samples for training defect detection, semantic segmentation, and anomaly recognition models. Attached Figure Description
[0037] To more clearly illustrate the technical solutions of the exemplary embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly described below. It should be understood that the following drawings only show some embodiments of the present invention and should not be considered as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort. In the drawings:
[0038] Figure 1 This is a flowchart of the method for controllable generation of defect images of main power transmission and transformation equipment according to Embodiment 1 of the present invention;
[0039] Figure 2 This is a block diagram of the controllable generation system for defect images of main power transmission and transformation equipment according to Embodiment 2 of the present invention. Detailed Implementation
[0040] To make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the embodiments and accompanying drawings. The illustrative embodiments and descriptions of the present invention are only used to explain the present invention and are not intended to limit the present invention.
[0041] Example 1
[0042] A method for controllable generation of defect images of main power transmission and transformation equipment, such as Figure 1 As shown, it includes:
[0043] The system acquires input data, which includes normal power grid inspection images and / or text scene descriptions, as well as target equipment type information and anomaly type instructions. When the input data includes normal power grid inspection images, the system performs equipment identification and region localization on the normal power grid inspection images to obtain the target equipment main area, candidate anomaly areas, and non-target protected areas.
[0044] Based on the target device type information and the anomaly type instruction, a component-level region prior is determined from the anomaly knowledge base. The component-level region prior is used to define the anomaly priority generation region and the protected region. Based on one or more of the target device main body region, candidate anomaly region, and non-target protected region obtainable from the input data, as well as the component-level region prior, region control conditions and composite control prompts for anomaly image generation are constructed. Based on the input data, a local anomaly editing path for raw image and / or a scene anomaly generation path for raw text image are selected, and multiple candidate anomaly images are generated based on the region control conditions and the composite control prompts.
[0045] The consistency of the multiple candidate abnormal images is evaluated, and qualified abnormal images are selected based on the evaluation results. For the qualified abnormal images, pixel-level abnormal masks, target detection boxes, abnormal category labels and sample metadata are generated and output simultaneously.
[0046] Furthermore, the anomaly knowledge base records the mapping relationship between equipment type, anomaly type, priority acting component, anomaly morphology constraint, and protected component; among them, the priority acting components corresponding to insulator breakage include porcelain disc, shed edge, or glass disc area; the priority acting components corresponding to transformer oil leakage include valve, flange, weld, bottom edge of the enclosure, or oil tank connection part; the priority acting components corresponding to conductor strand breakage include local wire bundle area of the conductor; and the priority acting components corresponding to component corrosion include hardware, bracket, enclosure edge, or connector area.
[0047] Furthermore, the process of identifying equipment and locating regions in the normal power grid inspection images includes:
[0048] The target device body region is determined by using a target detection model, semantic segmentation model, instance segmentation model, visual cue segmentation model, or manual bounding box selection. The candidate abnormal region and the non-target protected region are determined based on the target device body region and the component-level region prior.
[0049] When the location confidence level of a region is lower than the preset location threshold, relocation or manual confirmation is triggered.
[0050] In this embodiment, the composite control prompt includes device structure prompt, abnormal semantic prompt, and scene protection prompt; the device structure prompt is used to describe the target device type, component composition, and shooting angle; the abnormal semantic prompt is used to describe the abnormal category, abnormal location, and abnormal shape; and the scene protection prompt is used to constrain the non-target protected area to remain unchanged or meet similarity constraints during the abnormal image generation process.
[0051] Specifically, composite control prompts can be represented as:
[0052] ;
[0053] in, Provides equipment structure hints, describing the target equipment type, structural components, materials, and shooting angle; This provides semantic hints for anomalies, describing their type, location, form, and severity. This serves as a scene protection prompt, used to ensure consistency between the background environment, tower, conductors, ground, sky, camera viewpoint, and non-target equipment components.
[0054] In this embodiment, selecting the local anomaly editing path for raw images and / or the scene anomaly generation path for raw text images based on the input data includes:
[0055] When normal power grid inspection images exist and the location confidence of the candidate abnormal region is not lower than a preset location threshold. When selecting the local anomaly editing path in the generated image;
[0056] When there are no normal power grid inspection images, or when it is necessary to expand the samples under different equipment, viewing angles, lighting, weather, or background conditions, the above-mentioned raw image scene anomaly generation path is selected; or, a normal scene base map is first generated through the above-mentioned raw image scene anomaly generation path, and then local anomaly injection is performed through the above-mentioned raw image local anomaly editing path.
[0057] In this embodiment, under the local anomaly editing path of the raw image, the editable area is determined according to the candidate anomaly area, and a freeze constraint or hold constraint is applied to the area outside the editable area, so that cracks, gaps, oil stains, broken strands or rust spots are generated within the editable area.
[0058] In some specific implementation scenarios, under the local anomaly editing path of the image, the system classifies candidate anomaly regions according to the main body area of the target device. The area is expanded outwards, and the intersection of the expanded area and the main body area of the target device is calculated to obtain an editable area. Freeze constraints or hold constraints are applied to the area outside the editable area, and a generation is performed. Candidate anomaly images are generated. Under the anomaly generation path of the Wensheng image scene, the system generates candidate anomaly images that conform to the power grid inspection context based on composite control prompts, and limits structural drift through component constraints and anomaly localization prompts. The freeze constraint is used to keep the pixel values outside the editable area unchanged; the hold constraint is used to allow limited changes outside the editable area, but requires that the structural similarity or feature similarity of the corresponding area is not lower than a preset threshold.
[0059] In this embodiment, the consistency evaluation of the multiple candidate abnormal images includes:
[0060] Calculate the non-editable region similarity, device main structure preservation, anomaly semantic matching degree, and label consistency of the candidate abnormal image, and calculate the generation distribution quality index of the sample batch to which the candidate abnormal image belongs;
[0061] When the non-editable region similarity, device main structure preservation, anomaly semantic matching, label consistency, and generation distribution quality indicators meet the preset quality requirements, the corresponding candidate anomaly image is determined as a qualified anomaly image. Candidate anomaly images that do not meet the preset quality requirements are discarded or regenerated. Specifically, for each candidate anomaly image, a comprehensive score Q is calculated:
[0062] ;
[0063] in, Indicates the similarity of non-edited regions. Indicates the degree of structural integrity of the equipment. This indicates the degree of matching between the image and the semantic clues about the anomaly. This indicates the degree of consistency between the visible abnormal area and the generated label. , , and These are the corresponding weights, and they satisfy... The quality of the generated distribution can be evaluated using the FID value; when the overall score Q is not lower than the preset retention threshold... Furthermore, if the FID value is not higher than the preset distribution threshold, the candidate abnormal image or sample batch is retained; otherwise, it is discarded or regenerated. A comprehensive score Q is calculated based on the similarity of the non-edited region, the preservation of the main structure of the device, the semantic matching degree of the abnormality, and the consistency of the label, and the quality index of the generated distribution is used as an independent screening condition.
[0064] In one specific implementation, a preset positioning threshold is used. The value can be between 0.60 and 0.90, preferably 0.75; the expansion ratio of the editable area. The value can be between 1.05 and 1.20, with 1.10 being preferred; the number of candidates generated. The value can be 4 to 12, preferably 8; Sample retention threshold The value can be between 0.70 and 0.90, with 0.80 being preferred.
[0065] In one implementation, the weight of the overall score Q can be set as follows: , , , The FID distribution threshold can be set to 45. The above parameters are only used to illustrate the feasibility of the present invention, and can be adjusted according to device type, image resolution, anomaly size, generative model capability, and downstream training requirements in practical applications.
[0066] In one effect verification method, to verify the applicability of the method of the present invention in the task of generating abnormal samples of power transmission and transformation main equipment, a general image generation method and a general image editing method can be selected as comparison methods to evaluate the generated samples' conventional FID, abnormal semantic matching degree, equipment main structure preservation degree, power grid FID, power grid abnormal matching degree, non-editable region SSIM, label consistency degree, and power grid comprehensive score. The conventional FID is used to evaluate the overall distribution quality of the generated image; the abnormal semantic matching degree is used to evaluate the degree of matching between the generated abnormal appearance and the abnormal type instruction; the equipment main structure preservation degree is used to evaluate the degree of preservation of the target equipment's main outline and component structure before and after generation; the non-editable region SSIM is used to evaluate the similarity of non-target protected areas before and after abnormal generation; and the label consistency degree is used to evaluate the consistency between the generated abnormal area and the synchronously generated annotation information.
[0067] In another specific implementation, the input data is a normal transformer image obtained from ground inspection, and the anomaly type instruction is transformer oil leakage. After performing equipment identification and region localization on the normal transformer image, at least one local area among the transformer tank, bushing, flange, valve, weld, tank bottom edge, and oil tank connection is identified as a candidate anomaly area. Non-leaking target components, background areas, and areas corresponding to the shooting angle are identified as non-target protected areas. Based on the anomaly knowledge base, the priority areas for generating oil leakage anomalies are determined to be flanges, valves, welds, tank bottom edge, or oil tank connection. Anomaly morphology constraints include oil seepage, oil stain diffusion, or localized oil accumulation. After generating candidate anomaly images, a pixel-level oil leakage mask is generated based on the oil stain response area and image post-processing results, and the target detection box is extracted from this pixel-level oil leakage mask.
[0068] In this embodiment, inspection images of main power transmission and transformation equipment such as insulators, transformers, and conductors are selected as test objects, and abnormal samples of insulator breakage, transformer oil leakage, and conductor strand breakage are generated respectively. Table 1 shows examples of evaluation results of different methods in conventional image editing tasks and power grid equipment anomaly generation tasks. As can be seen from Table 1, compared with the generation method based solely on text prompts or ordinary image editing, the method of the present invention, through equipment type recognition, component-level region localization, anomaly knowledge base constraints, non-target protected area constraints, and label synchronous generation mechanism, has better results in terms of non-edited area SSIM, label consistency, and power grid comprehensive score. This indicates that the method of the present invention can reduce the problems of unreasonable anomaly area location, erroneous modification of the main structure of equipment, and difficulty in obtaining reliable labels synchronously for generated images.
[0069]
[0070] Furthermore, Table 2 shows examples of evaluation results for different anomaly types. As can be seen from Table 2, in the insulator breakage sample generation task, the consistency between the non-editable region SSIM and the label is high, indicating that the method of the present invention can maintain the consistency of other porcelain discs, fittings, conductors, and background areas during the local breakage generation process. In the transformer oil leakage sample generation task, the anomaly matching degree is high, indicating that the method of the present invention can generate oil traces in areas such as flanges, valves, welds, or the bottom edge of the tank that match the oil leakage anomaly. In the conductor strand breakage sample generation task, due to the fine target area and strong structural constraints, the generation difficulty is relatively high, but it can still maintain good anomaly semantic matching degree and label consistency.
[0071]
[0072] Example 2
[0073] A controllable image generation system for main power transmission and transformation equipment defects, such as Figure 2As shown, a method for controllable generation of defect images of main power transmission and transformation equipment is used to implement Embodiment 1. The system 100 includes an input layer, a perception layer, a control layer, an execution layer, and an evaluation layer.
[0074] The input layer includes an inspection data access module 101. The inspection data access module 101 is used to acquire input data, which includes normal power grid inspection images and / or text scene descriptions, and includes target equipment type information and anomaly type instructions. The normal power grid inspection images can be drone inspection images, robot inspection images, images acquired by fixed camera equipment, or historical inspection sample images; the anomaly type instructions can include at least one of the following: insulator breakage, insulator flashover, transformer oil leakage, conductor strand breakage, component corrosion, hardware loosening, or equipment surface ablation.
[0075] The perception layer includes a device type identification module 102 and a region positioning and protected area determination module 103. The device type identification module 102 identifies the target device type in the normal power grid inspection image. The target device type includes at least one of insulators, transformers, conductors, fittings, towers, switchgear, or instrument transformers. The region positioning and protected area determination module 103 performs region positioning on the normal power grid inspection image to obtain the target device main body region, candidate abnormal regions, and non-target protected regions. The target device main body region defines the overall range of the target device, the candidate abnormal regions define the possible range for generating abnormal appearances, and the non-target protected regions limit the generation process from erroneously modifying background areas, non-target device components, or other normal components.
[0076] In one specific implementation, when the target equipment type is an insulator, the area positioning and protected area determination module 103 outputs candidate abnormal areas corresponding to the main body area of the insulator string, the edge of a single porcelain disc, or the edge of the shed, and identifies conductors, towers, the sky background, and other porcelain discs as non-target protected areas. When the target equipment type is a transformer, the area positioning and protected area determination module 103 outputs at least one local area among the transformer tank, bushings, flanges, valves, welds, bottom edge of the tank, and oil conservator connection, and determines the corresponding candidate abnormal areas and non-target protected areas according to the abnormality type instruction.
[0077] The control layer includes an anomaly knowledge base and region prior module 104, and a control prompt construction module 105. The anomaly knowledge base and region prior module 104 is used to determine component-level region priors from the anomaly knowledge base based on the target device type information and the anomaly type instruction. The component-level region priors are used to limit the anomaly priority generation area and the protected area. The anomaly knowledge base records the mapping relationship between equipment type, anomaly type, priority affected component, anomaly morphology constraint, and protected component. For example, the priority affected components for insulator breakage include porcelain discs, shed edges, or glass disc areas, and the anomaly morphology constraint includes local cracks, edge gaps, or local breakage. The priority affected components for transformer oil leakage include valves, flanges, welds, bottom edges of the enclosure, or oil conservator connections, and the anomaly morphology constraint includes oil seepage, oil stain diffusion, or local oil accumulation. The priority affected components for conductor strand breakage include local conductor bundle areas, and the anomaly morphology constraint includes outward bending of broken wires, burrs, or incomplete strands. The priority affected components for component corrosion include hardware, supports, enclosure edges, or connecting parts areas, and the anomaly morphology constraint includes rust spots, corrosion boundaries, or surface color changes.
[0078] The control prompt construction module 105 is used to construct regional control conditions and composite control prompts for abnormal image generation based on the target device main body region, candidate abnormal regions, non-target protected regions, and the component-level region priors. The composite control prompts include device structure prompts, abnormal semantic prompts, and scene protection prompts; the device structure prompts are used to describe the target device type, component composition, material characteristics, and shooting angle; the abnormal semantic prompts are used to describe the abnormal category, abnormal location, and abnormal morphology; and the scene protection prompts are used to constrain non-target protected regions to remain unchanged or meet similarity constraints during abnormal image generation.
[0079] The execution layer includes a generation path selection module 106, an image-based local anomaly editing module 107, and a text-based scene anomaly generation module 108. The generation path selection module 106 is used to select an image-based local anomaly editing path and / or a text-based scene anomaly generation path based on the input data. Specifically, when a normal power grid inspection image exists and the location confidence of the candidate anomaly region is not lower than a preset location threshold, the image-based local anomaly editing path is selected; when no normal power grid inspection image exists, or when samples need to be expanded under different equipment, viewing angles, lighting, weather, or background conditions, the text-based scene anomaly generation path is selected; alternatively, a normal scene base map is first generated using the text-based scene anomaly generation path, and then local anomaly injection is performed using the image-based local anomaly editing path.
[0080] The image local anomaly editing module 107 is used to generate local anomaly appearances within the candidate anomaly area based on the region control conditions and the composite control prompts. Specifically, the image local anomaly editing module 107 determines the editable region based on the candidate anomaly region, and applies freeze constraints or hold constraints to non-target protected areas outside the editable region, so that cracks, gaps, oil stains, broken strands, or rust spots are generated within the editable region, while maintaining consistency between the main structure of the equipment, the background environment, and the shooting angle.
[0081] The text-based scene anomaly generation module 108 is used to generate candidate anomaly images that conform to the power transmission and transformation inspection scenario based on the composite control prompts and the component-level region priors. Specifically, when there are no normal power grid inspection images or when it is necessary to expand the specific scenario samples, the text-based scene anomaly generation module 108 generates candidate anomaly images based on the text scene description, equipment structure prompts, anomaly semantic prompts, and scene protection prompts, and limits the anomaly spread to non-target areas through equipment component constraints and anomaly localization constraints.
[0082] The evaluation layer includes a consistency evaluation module 109, a label synchronization generation module 110, and an anomaly sample output module 111. The consistency evaluation module 109 performs consistency evaluation on multiple candidate anomaly images and filters out qualified anomaly images based on the evaluation results. The consistency evaluation includes non-editing region similarity evaluation, device main structure preservation evaluation, anomaly semantic matching evaluation, label consistency evaluation, and generation distribution quality evaluation. When a candidate anomaly image meets preset quality requirements, it is determined as a qualified anomaly image; candidate anomaly images that do not meet the preset quality requirements are discarded or regenerated.
[0083] The label synchronization generation module 110 is used to synchronously generate pixel-level anomaly masks, target detection boxes, anomaly category labels, and sample metadata for the qualified anomaly images. Specifically, the label synchronization generation module 110 generates pixel-level anomaly masks based on candidate anomaly regions, generated anomaly response regions, and image post-processing results, and determines the target detection boxes by the minimum bounding rectangle of the pixel-level anomaly masks; wherein, the sample metadata includes device type, anomaly type, generation path type, quality score, and generation parameters.
[0084] The abnormal sample output module 111 is used to output the qualified abnormal image and its corresponding annotation information. The annotation information includes pixel-level abnormal mask, target detection box, abnormal category label and sample metadata, so that the generated defect image can be used for training of power transmission and transformation main equipment defect detection, semantic segmentation or abnormal recognition models.
[0085] Example 3
[0086] An electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the controllable generation method for defect images of main power transmission and transformation equipment as described in Embodiment 1.
[0087] Example 4
[0088] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method for controllable generation of defect images of main power transmission and transformation equipment as described in Example 1.
[0089] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0090] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, as well as combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0091] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0092] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1The steps of the function specified in one or more boxes.
[0093] Those skilled in the art will understand that all or part of the steps in the above method can be implemented by a program instructing related hardware. The program or the program described therein can be stored in a computer-readable storage medium. When the program is executed to implement the steps of the above method for controllable generation of defect images of main power transmission and transformation equipment, the storage medium can be ROM / RAM, magnetic disk, optical disk, etc.
[0094] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for controllably generating defect images of main power transmission and transformation equipment, characterized in that, include: The system acquires input data, which includes normal power grid inspection images and / or text scene descriptions, as well as target equipment type information and anomaly type instructions. When the input data includes normal power grid inspection images, the system performs equipment identification and area localization on the normal power grid inspection images to obtain the main area of the target equipment, candidate anomaly areas, and non-target protected areas. Based on the target device type information and the anomaly type instruction, a component-level region prior is determined from the anomaly knowledge base. The component-level region prior is used to define the anomaly priority generation region and the protected region. Based on one or more of the target device main body region, candidate anomaly region, and non-target protected region obtainable from the input data, as well as the component-level region prior, region control conditions and composite control prompts for anomaly image generation are constructed. Based on the input data, a local anomaly editing path for raw image and / or a scene anomaly generation path for raw text image are selected, and multiple candidate anomaly images are generated based on the region control conditions and the composite control prompts. A consistency evaluation is performed on the multiple candidate abnormal images, and qualified abnormal images are selected based on the evaluation results; For the qualified abnormal images, pixel-level abnormal masks, target detection boxes, abnormal category labels, and sample metadata are generated and output simultaneously.
2. The method for controllable generation of defect images of main power transmission and transformation equipment according to claim 1, characterized in that, The anomaly knowledge base records the mapping relationship between equipment type, anomaly type, priority acting component, anomaly morphology constraint, and protected component; among them, the priority acting components corresponding to insulator breakage include porcelain plate, shed edge, or glass plate area; the priority acting components corresponding to transformer oil leakage include valve, flange, weld, bottom edge of the enclosure, or oil tank connection part; the priority acting components corresponding to conductor strand breakage include local wire bundle area of the conductor; and the priority acting components corresponding to component corrosion include hardware, bracket, enclosure edge, or connector area.
3. The method for controllable generation of defect images of main power transmission and transformation equipment according to claim 1, characterized in that, The process of identifying equipment and locating regions in the normal power grid inspection images includes: The target device body region is determined by using a target detection model, semantic segmentation model, instance segmentation model, visual cue segmentation model, or manual bounding box selection. The candidate abnormal region and the non-target protected region are determined based on the target device body region and the component-level region prior. When the location confidence level of a region is lower than the preset location threshold, relocation or manual confirmation is triggered.
4. The method for controllable generation of defect images of main power transmission and transformation equipment according to claim 1, characterized in that, The composite control prompts include device structure prompts, anomaly semantic prompts, and scene protection prompts. The device structure prompts are used to describe the target device type, component composition, and shooting angle. The anomaly semantic prompts are used to describe the anomaly category, anomaly location, and anomaly morphology. The scene protection prompts are used to constrain non-target protected areas to remain unchanged or meet similarity constraints during the anomaly image generation process.
5. The method for controllable generation of defect images of main power transmission and transformation equipment according to claim 1, characterized in that, Based on the input data, the selection of the local anomaly editing path for raw images and / or the scene anomaly generation path for raw text images includes: When a normal power grid inspection image exists and the location confidence of the candidate abnormal region is not lower than the preset location threshold, the local abnormality editing path of the image is selected. When there are no normal power grid inspection images, or when it is necessary to expand the samples under different equipment, viewing angles, lighting, weather, or background conditions, the above-mentioned raw image scene anomaly generation path is selected; or, a normal scene base map is first generated through the above-mentioned raw image scene anomaly generation path, and then local anomaly injection is performed through the above-mentioned raw image local anomaly editing path.
6. The method for controllable generation of defect images of main power transmission and transformation equipment according to claim 1, characterized in that, Under the local anomaly editing path of the image, the editable area is determined according to the candidate anomaly area, and a freeze constraint or hold constraint is applied to the area outside the editable area, so that cracks, gaps, oil stains, broken strands or rust spots are generated within the editable area.
7. The method for controllable generation of defect images of main power transmission and transformation equipment according to claim 1, characterized in that, The consistency evaluation of the multiple candidate anomalous images includes: Calculate the non-editable region similarity, device main structure preservation, anomaly semantic matching degree, and label consistency of the candidate abnormal image, and calculate the generation distribution quality index of the sample batch to which the candidate abnormal image belongs; When the non-editing region similarity, device main structure preservation, abnormal semantic matching, label consistency, and generation distribution quality indicators meet the preset quality requirements, the corresponding candidate abnormal image is determined as a qualified abnormal image, and candidate abnormal images that do not meet the preset quality requirements are discarded or regenerated.
8. A controllable image generation system for main power transmission and transformation equipment defects, used to implement the controllable image generation method for main power transmission and transformation equipment defects as described in any one of claims 1 to 7, characterized in that, It includes an input layer, a perception layer, a control layer, an execution layer, and an evaluation layer; The input layer includes an inspection data access module, which is used to acquire input data, including normal power grid inspection images and / or text scene descriptions, and includes target equipment type information and abnormality type instructions; The perception layer includes a device type identification module and a region positioning and protected area determination module. The device type identification module is used to identify the target device type in the normal power grid inspection image. The region positioning and protected area determination module is used to perform region positioning on the normal power grid inspection image to obtain the target device main area, candidate abnormal area and non-target protected area. The control layer includes an anomaly knowledge base and a region prior module, as well as a control prompt construction module. The anomaly knowledge base and region prior module is used to determine the component-level region prior from the anomaly knowledge base based on the target device type information and the anomaly type instruction. The component-level region prior is used to limit the anomaly priority generation area and the protected area. The control prompt construction module is used to construct regional control conditions and composite control prompts for abnormal image generation based on one or more of the target device main body region, candidate abnormal region and non-target protected region that can be obtained from the input data, as well as the component-level region prior. The execution layer includes a path selection module, a local anomaly editing module, and a scene anomaly generation module. The path selection module is used to select a local anomaly editing path and / or a scene anomaly generation path based on the input data. The local anomaly editing module is used to generate local anomaly appearances within the candidate anomaly area based on the region control conditions and the composite control prompts. The scene anomaly generation module is used to generate candidate anomaly images that conform to the power transmission and transformation inspection scenario based on the composite control prompts and the component-level region priors. The evaluation layer includes a consistency evaluation module, a label synchronization generation module, and an anomaly sample output module. The consistency evaluation module is used to evaluate the consistency of multiple candidate anomaly images and select qualified anomaly images based on the evaluation results. The label synchronization generation module is used to synchronously generate pixel-level anomaly masks, target detection boxes, anomaly category labels, and sample metadata for the qualified anomaly images. The anomaly sample output module is used to output the qualified anomaly images and their corresponding annotation information.
9. An electronic device, characterized in that, It includes a processor and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, it implements the method for controllable generation of defect images of main power transmission and transformation equipment as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the method for controllable generation of defect images of main power transmission and transformation equipment as described in any one of claims 1 to 7.