A method for recognizing defects of a ground wire based on small sample generation and feature enhancement

By introducing physical structural constraints to generate defect samples and combining them with logical verification, the problem of scarcity and easy confusion of rare defect samples in transmission lines is solved, achieving defect identification with high accuracy and low false alarm rate, and improving the robustness and adaptability of the model.

CN122368636APending Publication Date: 2026-07-10CHINA SOUTHERN POWER GRID ARTIFICIAL INTELLIGENCE TECHNOLOGY CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHINA SOUTHERN POWER GRID ARTIFICIAL INTELLIGENCE TECHNOLOGY CO LTD
Filing Date
2026-05-08
Publication Date
2026-07-10

AI Technical Summary

Technical Problem

In complex equipment such as power transmission lines, rare defect samples are scarce and easily confused, leading to overfitting and poor generalization ability of deep learning models. Existing technologies generate defect images that do not conform to the physical topology of the equipment, resulting in low recognition accuracy and high false alarm rate.

Method used

Based on the method of small sample generation and feature enhancement, defect samples are generated by introducing physical structural constraints, and logical verification is performed by using the spatial positional relationship between the target component and related components. A training set is constructed and the detection model is trained. Combined with a multi-scale feature fusion network and a dynamic weight adjustment strategy, the robustness and accuracy of the model are improved.

Benefits of technology

It effectively solves the problem of model overfitting, improves the accuracy of rare defect identification, reduces the false alarm rate, enhances the model's adaptability to defects of different scales and frequencies, and achieves high reliability and high accuracy defect identification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122368636A_ABST
    Figure CN122368636A_ABST
Patent Text Reader

Abstract

This invention discloses a method for identifying conductor defects based on few-sample generation and feature enhancement, relating to the fields of image recognition and defect detection technology. It includes generating sample images containing defect features based on the physical structural constraints of the original image of the target object, constructing a training set based on the sample images, training a detection model using the training set, identifying target components in the image to be detected using the detection model, and verifying the presence of defects in the target component based on whether the spatial relationship between the target component and related components conforms to preset physical connection rules upon identification of the target component. This application introduces physical structural constraints to generate defect samples, ensuring that the generated images conform to the physical topology of the device, fundamentally solving the model overfitting problem caused by the scarcity of rare defect samples, and significantly improving the model's generalization ability and robustness.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image recognition and defect detection technology, specifically to a method for identifying conductor defects based on small sample generation and feature enhancement. Background Technology

[0002] Currently, in the field of intelligent operation and maintenance of complex equipment such as power transmission lines, deep learning-based target detection algorithms are commonly used to identify defects in acquired images. However, in actual operation, the probability of certain serious defects (such as loose grounding leads) is extremely low, resulting in a severe shortage of real defect samples that can be collected, leading to a small sample size problem. Directly training deep learning models with a small number of samples easily leads to overfitting and poor generalization ability. Meanwhile, to increase the sample size, existing technologies attempt to use generative models to generate defect images, but the generated images often do not conform to the physical topology of the equipment, resulting in poor realism and difficulty in effectively improving model performance. Furthermore, for certain specific defects, relying solely on visual appearance features is insufficient to distinguish them from components in their normal state. For example, loose leads and normally bent wires are visually very similar, lacking logical judgment based on physical structure, resulting in limited recognition accuracy and a high false alarm rate. Therefore, there is an urgent need for a target defect identification scheme that can solve the problem of scarce rare defect samples and easily confused defect misjudgment. Summary of the Invention

[0003] The purpose of this invention is to provide a method for identifying conductor defects based on small sample generation and feature enhancement, so as to solve the problems mentioned in the background art.

[0004] To achieve the above objectives, the present invention provides the following technical solution: a ground wire defect identification method based on small sample generation and feature enhancement, comprising: generating sample images containing defect features based on the physical structural constraints of the original image of the target object, and constructing a training set based on the sample images; training a detection model using the training set; identifying target components in the image to be detected through the detection model; and verifying whether the target component has a defect based on whether the spatial positional relationship between the target component and associated components conforms to a preset physical connection rule in response to the identification of the target component.

[0005] The above scheme generates defect samples by introducing physical structural constraints, ensuring the physical authenticity and topological rationality of the generated samples, fundamentally solving the model overfitting problem caused by small samples; at the same time, by verifying the spatial positional relationship based on physical connection rules, it transforms simple visual recognition into dual verification of visual and physical logic, effectively eliminating interference terms that are visually similar but have different physical states, and achieving high-accuracy recognition of rare and easily confused defects.

[0006] As an optional implementation, generating a sample image containing defect features based on the physical structure constraints of the original image of the target object includes: extracting a physical structure feature map of the original image, inputting the physical structure feature map as a constraint into an image generation model, and generating the sample image that conforms to the physical structure feature map.

[0007] The above-mentioned optional implementation restricts the geometric and topological degrees of freedom of the generated images by inputting the physical structure feature map as an explicit constraint into the generative model, so that the generated defective samples are structurally consistent with the real devices, further improving the quality of training data and the robustness of model training.

[0008] As an optional implementation, the physical structure features include edge features or topological connectivity features; the image generation model includes a diffusion model and a control network; the physical structure feature map is input into the control network to obtain control features; the control features and text prompts are input into the diffusion model to guide the diffusion model to generate the sample image.

[0009] The above-mentioned optional implementation methods, through multi-dimensional constraints of edge features or topological connectivity features, and combined with the collaborative guidance mechanism of control network and diffusion model, achieve precise control over the local details and global structure of the generated image, ensuring both the diversity of defect features and the accuracy of physical structure.

[0010] As an optional implementation, the step of verifying whether the target component has a defect based on whether the spatial positional relationship between the target component and the associated component conforms to a preset physical connection rule includes: identifying associated components in the image to be detected that have a physical connection relationship with the target component through the detection model; analyzing the spatial positional relationship between the target component and the associated component; and determining whether the target component has a defect based on whether the spatial positional relationship conforms to the preset physical connection rule.

[0011] The above optional implementation method, by explicitly identifying related components with physical connections and analyzing their spatial relationships, transforms abstract physical common sense into computable logical judgment rules, providing a reliable secondary verification mechanism for easily confused defects and significantly reducing the false alarm rate in complex backgrounds.

[0012] As an optional implementation, the target component is a grounding lead, and the associated component is a fastener; when the fastener is not present in the end region of the grounding lead, it is determined that the grounding lead has a loosening defect.

[0013] The above-mentioned optional implementation methods address the typical and easily confused defect of loose grounding leads by utilizing the physical a priori rule that "there must be no fastener at the loose end" to accurately distinguish between visually similar normal bent wires and real loosening defects, thus achieving reliable identification of defects in critical power equipment.

[0014] As an optional implementation, the detection model includes a multi-scale feature fusion network configured to fuse shallow detail features and deep semantic features.

[0015] The above-mentioned optional implementations, by integrating features at different scales, enable the model to simultaneously capture the detailed features of minute defects and the semantic features of larger-scale defects, thereby enhancing the model's adaptability to defects of different shapes and scales.

[0016] As an optional implementation, training the detection model using the training set includes: dynamically adjusting the weights of various defects in the loss function of the detection model using an inverse frequency weighting method based on the frequency of various defect samples in the training set.

[0017] The above optional implementation method dynamically adjusts the loss weights by inverse frequency weighting, automatically increasing the gradient contribution of rare defect samples during training, suppressing the dominant role of common defects, effectively alleviating the class imbalance problem caused by long-tail distribution, and improving the model's sensitivity to rare defects.

[0018] Furthermore, the present invention also provides a conductor defect identification device based on small sample generation and feature enhancement, comprising: a data enhancement module configured to generate sample images containing defect features based on the physical structural constraints of the original image of the target object, and to construct a training set based on the sample images; a model training module configured to train a detection model using the training set; a target recognition module configured to identify target components in the image to be detected through the detection model; and a defect verification module configured to verify whether the target component has a defect based on whether the spatial positional relationship between the target component and associated components conforms to a preset physical connection rule in response to the identification of the target component.

[0019] The aforementioned device scheme, through the coordinated operation of various modules, solidifies the physical constraint generation and logical verification mechanism into the system architecture, realizing a closed loop of the entire process from data construction to model training and then to inference verification, ensuring the accuracy and reliability of rare and easily confused defect identification.

[0020] In addition, the present invention also provides a power transmission line inspection device, including a processor and a memory, wherein the processor executes a program stored in the memory to implement the target defect identification method as described above.

[0021] The above-mentioned equipment solution integrates the target defect identification method into the inspection hardware entity, enabling the inspection equipment to complete high-precision defect identification and logic verification on the work site, reducing operation and maintenance costs and improving the level of inspection automation.

[0022] In addition, the present invention provides a computer-readable storage medium storing a program that, when executed, implements the target defect identification method as described above.

[0023] The aforementioned media scheme provides a platform for the software deployment and distribution of the target defect identification method, facilitating the porting and application of the algorithm on different computing platforms.

[0024] Compared with the prior art, the beneficial effects of the present invention are: This application generates defect samples by introducing physical structure constraints, ensuring that the generated images conform to the physical topology of the device. This fundamentally solves the problem of model overfitting caused by the scarcity of rare defect samples, and significantly improves the model's generalization ability and robustness.

[0025] Meanwhile, to address easily confused defects, logical verification is performed based on whether the spatial relationship between the target component and related components conforms to preset physical connection rules. This introduces prior physical knowledge, transforming simple visual recognition into a dual verification of "visual + logical," effectively eliminating visual similarity interference and significantly reducing the false alarm rate. The introduction of a multi-scale feature fusion network and dynamic weight adjustment strategy enables the model to adapt to defect recognition needs at different scales and frequencies, improving detection performance in complex scenes and long-tailed distributions. Attached Figure Description

[0026] Figure 1 This is a schematic diagram of the target defect identification method of the present invention; Figure 2 This is a schematic diagram of the sample image generation method based on the collaboration of physical structure feature maps and generation models according to the present invention. Figure 3 This is a schematic diagram of the defect secondary verification mechanism based on physical connection rules and component spatial topology of the present invention; Figure 4 This is a schematic diagram of the training and architecture optimization method for the detection model of multi-scale defects and long-tail distribution according to the present invention. Figure 5 This is a schematic diagram of the target defect identification device of the present invention. Detailed Implementation

[0027] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0028] The terms "first," "second," etc., in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. For example, the first cluster and the second cluster mentioned below belong to different clusters. It should be understood that such names can be used interchangeably where appropriate so that the embodiments described herein can be implemented in a sequence other than that illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or modules is not necessarily limited to those steps or modules explicitly listed, but may include other steps or modules not explicitly listed or inherent to these processes, methods, products, or devices. The division of modules in the embodiments of this application is merely a logical division. In actual applications, there may be other division methods. For example, multiple modules may be combined into or integrated into another system, or some features may be ignored or not performed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interface, and the indirect coupling or communication connection between modules may be electrical or other similar forms. None of these are limited in the embodiments of this application. Furthermore, the modules or sub-modules described as separate components may or may not be physically separated, may or may not be physical modules, or may be distributed among multiple circuit modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the embodiments of this application.

[0029] like Figure 1 As shown, this embodiment provides a method for identifying target defects. This method constructs a complete closed loop from data generation to inference and judgment by introducing physical-level constraints and verification mechanisms, making it particularly suitable for defect identification scenarios that are rare and easily visually confused with normal states. It should be understood that the technical process described in this embodiment is merely illustrative and not restrictive. Those skilled in the art can adaptively adjust the execution order or specific implementation method of the steps according to the specific application scenario without departing from the concept of this invention.

[0030] Step S100: Based on the physical structural constraints of the original image of the target object, generate sample images containing defect features, and construct a training set based on the sample images.

[0031] Specifically, in real-world scenarios such as industrial inspections, the probability of serious defects such as loose grounding leads is extremely low, resulting in a severe shortage of real defect samples and a typical small sample size problem. If these scarce samples are directly used to train deep learning models, the models are prone to overfitting, leading to poor generalization and ineffective field application. To address this fundamental data-level pain point, this embodiment does not employ traditional unconstrained random generation or simple image transformations (such as rotation and cropping) to expand the data. Instead, it innovatively introduces "physical structural constraints." Physical structural constraints refer to restrictive information extracted from the original image that reflects the true geometric contours and topological connections of the target object. By using these physical structural constraints as boundary limits in the generation process, the generation model is forced to render and mutate defect features only within a framework that conforms to physical realism, thus ensuring that the generated sample images do not undergo structural distortion or loss of accuracy. For example, in the scenario of power transmission towers, physical structural constraints ensure that the generated image of a loose grounding lead still follows the true topological layout of the tower components, rather than producing floating or misaligned lines that violate physical principles. This physical constraint-based generation method fundamentally overcomes the defects of pure random generation, which is prone to distortion. It makes the constructed training set both diverse in sample and physically realistic, laying a solid data foundation for the robust training of subsequent models.

[0032] Step S200: Construct a training detection model using the training set.

[0033] Specifically, after obtaining a training set constructed from realistic and diverse sample images generated by physical constraints, this embodiment uses this training set to train the detection model. Since the training set contains a large number of previously scarce but now realistic defect samples, the model can fully learn the characteristic behavior of defects under different lighting, backgrounds, and angles during training, thereby effectively avoiding the risk of overfitting due to insufficient samples. The detection model can be any neural network architecture with target detection capabilities. Its specific network structure and optimization strategy will be further elaborated in subsequent embodiments. This embodiment does not impose specific limitations here, as long as it can complete parameter optimization based on the training set and has the ability to identify target parts.

[0034] Step S300: Identify the target component in the image to be detected using the detection model.

[0035] Specifically, after the model is trained, it is deployed in a real-world inference environment. When an image to be detected (such as an image of a steel tower taken by a drone during inspection) is acquired, the detection model performs feature extraction and inference analysis on the image, outputting the identification result of whether the target component exists. This step mainly addresses the initial visual perception problem of "where" and "what," that is, locating candidate regions where defects may exist from a complex background. However, relying solely on preliminary identification based on visual appearance features often has limitations when dealing with certain specific defects. For example, a loose lead wire and a normally bent wire are visually very similar, easily causing visual confusion.

[0036] Step S400: In response to identifying the target component, verify whether the target component has a defect based on whether the spatial positional relationship between the target component and the associated component conforms to a preset physical connection rule.

[0037] Specifically, to address the visual confusion issue mentioned in step S300, this embodiment introduces a logical verification mechanism based on physical common sense on top of the initial identification. Associated components refer to other components that are physically connected to the target component, such as fasteners (bolts, clips, rivets, etc.). Preset physical connection rules are spatial positional constraints derived from the actual engineering design specifications of the target object, such as "a fastener must be present at the end of a normally connected lead wire." When the detection model identifies the target component, the system does not immediately determine that it has a defect, but further analyzes the spatial positional relationship between the target component and its associated components. If this spatial positional relationship conforms to the preset physical connection rules (e.g., a fastener is detected near the end of the lead wire), it indicates that the visually abnormal shape may be a normal physical state (e.g., normal bending), thus eliminating false positives; if it does not conform to the preset physical connection rules (e.g., no fastener is present in the lead wire end area), it verifies that the visual abnormality does indeed correspond to the destruction of the physical structure (i.e., loosening defect). This verification mechanism transforms simple visual recognition into a dual verification of "visual + logical," effectively eliminating interference items that are visually similar but have different physical states, and significantly reducing the false alarm rate in complex backgrounds.

[0038] Through the coordinated operation of steps S100 to S400, this embodiment establishes a closed-loop narrative framework of "physical constraint generation + logical verification." Physical constraint generation solves the problem of data scarcity enabling model training, while logical verification solves the problem of model misjudgment ensuring reliable results. These two techniques are not isolated but rather have a deep synergistic effect: without real data generated from physical constraints, the model cannot effectively learn defect features, and logical verification cannot be triggered; without the rule constraints of logical verification, even if the model can identify candidate targets, it cannot distinguish between real defects and visual interference, causing the value of the generated data to be overwhelmed by false positives. Therefore, this combined approach achieves high accuracy and high reliability in identifying rare and easily confused defects.

[0039] Based on Example 1, this example further elaborates on the specific algorithm flow for generating sample images based on physical structure constraints in step S100. For example... Figure 2 As shown, this embodiment provides a sample image generation method based on the collaboration of physical structure feature maps and generative models, aiming to provide a data augmentation scheme for scarce defect samples that combines physical realism and semantic diversity.

[0040] Step S101: Extract the physical structure feature map of the original image, use the physical structure feature map as a constraint condition to input the image generation model, and generate the sample image that conforms to the physical structure feature map.

[0041] Specifically, physical structure feature maps are digital representations of the true geometric contours and topological layout of a target object. By inputting these physically realistic feature maps as explicit constraints into the image generation model, the spatial degrees of freedom of the generation model when rendering defect features are limited, forcing the generation process to fill in textures and semantics only within the framework of conforming to the original physical structure. This mechanism fundamentally avoids structural distortion in the generated images, ensuring that the generated defect samples are geometrically consistent with real industrial scenes. This prevents detection models trained on such samples from becoming biased due to data distortion, significantly improving the model's generalization ability in real-world environments.

[0042] Step S102: The physical structure features include edge features or topological connectivity features; the image generation model includes a diffusion model and a control network; the physical structure feature map is input into the control network to obtain control features; the control features and text prompts are input into the diffusion model to guide the diffusion model to generate the sample image.

[0043] Specifically, this embodiment refines the specific connotation of physical structural features and the collaborative architecture of the generation model. Physical structural features are not limited to edge features extracted by edge detection operators (such as the Canny operator), but can also be topological connection features reflecting the connection relationships between components, such as the topological connection skeleton diagram obtained by skeleton extraction algorithms. Edge features focus on characterizing the outer contour of components, while topological connection features focus on characterizing the connection topology and relative positions between components. Both have their advantages in generating different types of defects, and appropriate physical structural features can be selected for constraints according to the specific defect morphology.

[0044] In terms of image generation models, this embodiment introduces a combined architecture of a diffusion model and a control network. The control network (such as ControlNet) transforms the physical structure feature map into control features that can be aligned with the feature space within the diffusion model. The diffusion model (such as Stable Diffusion) is responsible for progressive denoising in the latent space to generate the final image. During generation, control features and text prompts work together as conditional inputs to guide the diffusion model. The text prompts provide high-level semantic information about defect types, background environment, and lighting conditions, while the control features provide low-level structural constraints about geometric contours and topological layout. The collaborative guidance of these two features realizes the generation logic of "semantic definition of content, structure defining form," ensuring that the generated image contains accurate defect semantics (such as loosening or breaking) and that these defect features are attached to a structural skeleton that conforms to physical laws.

[0045] It should be understood that image generation models are not limited to combinations of diffusion models and control networks; they can also be implemented by combining generative adversarial networks (GANs, such as StyleGAN) with structural constraint loss functions. In GAN architectures, physical structure feature maps can be used as additional inputs to the generator, and structural consistency loss can be introduced during training to penalize deviations in contour or topology between the generated image and the original physical structure feature map, thereby achieving a similar physical constraint effect.

[0046] This embodiment employs a collaborative mechanism of physical structure feature maps and textual prompts, rather than relying solely on one condition, based on a comprehensive consideration of generation quality and diversity. If only pure textual prompts are used for generation guidance, the model is prone to structural distortion when processing complex industrial components due to the text's lack of precise description of local geometry. For example, it might generate suspended conductors or misaligned bolts that do not conform to the topology of a steel tower. Conversely, if only pure structural feature replication (such as simple image stitching or structural transformation) is used, while geometric realism is ensured, semantic diversity is lacking. The generated samples are highly homogenous in texture, lighting, and background, making the model prone to overfitting to these fixed patterns. Therefore, this embodiment achieves the optimal balance between physical realism and sample diversity through a collaborative mechanism of "physical structure feature maps constraining geometry + textual prompts enriching semantics." This ensures that the generated sample images are both grounded in engineering reality and cover defect manifestations in various complex environments, providing high-quality data support for the robust training of subsequent detection models.

[0047] Based on Example 1, this example further elaborates on the specific logical flow of verifying defects based on spatial location relationships in step S400. For example... Figure 3 As shown, this embodiment provides a secondary verification mechanism for defects based on physical connection rules and component spatial topology, aiming to solve the fundamental misjudgment problem that cannot distinguish between normal and defective states by relying solely on visual appearance features.

[0048] Step S401: Identify the associated components in the image to be detected that have a physical connection with the target component through the detection model.

[0049] Specifically, after the detection model initially identifies the target component, the system does not directly output a defect alarm. Instead, it triggers the collaborative identification of related components. Related components refer to those parts that are physically connected, supported, or fastened to the target component. For example, in a power transmission line scenario, if the target component is a grounding lead, the related components with which it is physically connected are typically fasteners; if the target component is a conductor, the related components could also be insulator strings or clamps. It should be understood that the specific type of related component depends on the engineering design specifications of the target object, and this embodiment does not impose any restrictions on this. By explicitly identifying related components, the system expands the focus of visual inspection from a single suspected defect target to the physical connection topology in which the target exists, providing the necessary factual basis for subsequent logical judgments.

[0050] Step S402: Analyze the spatial positional relationship between the target component and the associated component.

[0051] Specifically, after identifying the image regions (such as bounding boxes or segmentation masks) of the target component and its associated components, the system further calculates their spatial geometric features on the image plane, including their relative position, distance, overlap, or enclosure relationship. This spatial relationship is a visual projection of the physical connection state in the real world. For example, the end region of a properly secured grounding lead will inevitably overlap with or be very close to the area of ​​the fastener in the image; while the end of a loose lead will be far from its original fastener position, appearing suspended or overlapping. By quantitatively analyzing this spatial relationship, the system transforms abstract physical common sense into calculable geometric indicators.

[0052] Step S403: Determine whether the target component has a defect based on whether the spatial positional relationship conforms to the preset physical connection rules.

[0053] Specifically, the preset physical connection rules are spatial position constraints derived from the actual engineering design specifications of the target object. The system compares the actual spatial position relationship calculated in step S402 with these preset rules. If the rules are met, it indicates that the visually abnormal shape (such as bent lead wire) is a reasonable manifestation under normal physical conditions; if the rules are not met, it verifies that the visual abnormality does indeed correspond to the destruction of the physical structure. The core value of this step lies in introducing a deep mechanism explanation of "why not something else": pure appearance features cannot distinguish between normal bending and loosening defects because the texture and shape of the two are highly similar at the pixel level, which can easily lead to misjudgment by deep learning models based on appearance statistical features; it is necessary to introduce logical verification of physical connections, and only through the hard physical prior of "whether the structural relationship is complete" can the interference links of visual confusion be fundamentally cut off, and a reliable leap from "looks like" to "is physically true" be achieved.

[0054] As a more specific alternative implementation, the target component is a grounding lead, and the associated component is a fastener; when the fastener is not present in the end region of the grounding lead, it is determined that the grounding lead has a loosening defect.

[0055] Specifically, this embodiment applies the aforementioned general verification logic to the most typical and easily confused defect scenario in transmission lines. The grounding lead is a crucial component of the tower grounding system, and its two ends are normally secured by fasteners. When the lead becomes loose, its connection end detaches from the fastener and hangs suspended. Therefore, "the loose end must have no fastener" becomes a highly discriminative physical prior rule. After detecting a candidate frame for the grounding lead, the system pays particular attention to its end region. If no fastener is detected in this end region, the lead is determined to have a loosening defect.

[0056] It should be understood that the fasteners mentioned in this embodiment are not limited to bolts, but can also be clips, rivets, pressure plates, or any other components that provide mechanical fastening functions. This generalization aims to cover diverse fastening designs in different voltage levels and tower types. Similarly, associated components are not limited to fasteners; in other defect types, associated components can also be insulator strings, vibration dampers, or wire clamps, etc. Furthermore, the identification logic for associated components is not limited to using independent lightweight sub-models (such as bolt detection models with MobileNetV3 as the backbone network) for secondary inference. An auxiliary detection head can be added to the main detection model to simultaneously output the positions of the target component and associated components through multi-task learning, thereby completing the calculation of spatial positional relationships in a single inference, to adapt to edge computing scenarios with higher real-time requirements.

[0057] The above description of grounding leads and fasteners is illustrative only and not restrictive. Those skilled in the art can flexibly replace the specific categories of target components and related components according to the specific inspection objects and defect types, and adjust the specific content of the preset physical connection rules accordingly, as long as they follow the core concept of "verifying visual confusion based on physical connection relationships".

[0058] Based on Example 1, this example further elaborates on the network architecture optimization and training loss function adjustment of the detection model in step S200. For example... Figure 4 As shown, this embodiment provides a training and architecture optimization scheme for detection models oriented towards multi-scale defects and long-tail distributions, aiming to further improve the model's ability to capture rare and morphologically varied defect features and its learning efficiency.

[0059] Step S201, the detection model includes a multi-scale feature fusion network, which is configured to fuse shallow detail features and deep semantic features.

[0060] Specifically, in complex industrial scenarios such as power transmission lines, the scale of target defects varies greatly. For example, defects such as strand skipping or loose binding wires are often small in scale, requiring high-resolution detailed features to be effectively captured; while defects such as loose grounding leads are relatively large in scale, requiring macroscopic semantic features to locate their overall outline and topological relationships. If the detection model relies solely on feature maps of a single scale for inference, it will inevitably fail to simultaneously consider the precision of small defects and the completeness of larger defects, leading to missed detection of small targets or inaccurate localization of large targets. To address this, this embodiment introduces a multi-scale feature fusion network into the detection model. Its core mechanism lies in fusing feature maps of different resolutions extracted by the backbone network across layers. Shallow feature maps have high resolution and small receptive fields, rich in local details such as edges and textures, but are weakly resistant to background interference; deep feature maps have low resolution and large receptive fields, containing global semantic information such as category and topology, but have coarse spatial localization accuracy. Multi-scale feature fusion networks, through bidirectional feature propagation paths from top to bottom and bottom to top, enable shallow detail features and deep semantic features to be fully intertwined and enhanced, thus possessing both refined perceptual capabilities and robust semantic discriminative power at each prediction scale.

[0061] It should be understood that multi-scale feature fusion networks are not limited to weighted bidirectional feature pyramid networks, but can also be feature pyramid networks, path aggregation networks, or other network architectures with cross-scale feature interaction capabilities. As long as they can achieve information fusion of feature maps at different resolutions, they should fall within the protection scope of this invention. Furthermore, as an optional enhancement, this embodiment can also embed an attention mechanism module, such as a convolutional block attention module, at the output layer of the multi-scale feature fusion network. This module, through cascaded channel attention and spatial attention sub-modules, enables the model to adaptively focus on the key features of the defect region while suppressing interference from irrelevant noise in complex backgrounds, further improving the effectiveness of feature representation.

[0062] Step S202: Based on the frequency of various defect samples in the training set, dynamically adjust the weights of various defects in the loss function of the detection model using an inverse frequency weighting method.

[0063] Specifically, in the training set generated by physical constraints, although the absolute number of rare defects is effectively supplemented, the frequency of different defect types still exhibits significant long-tailed distribution differences due to the inherent properties of real-world data. If a uniform weighting strategy is adopted during training, meaning that all types of defects contribute the same gradient when calculating the loss, then the predominantly numerous common defects will dominate the model's parameter update direction, while the weak gradient signals generated by the few rare defects are easily submerged in the gradient flood of common defects. This leads to a severe lack of sensitivity of the model to rare defects, causing it to tend to misclassify rare defects as common defects or background during actual inference.

[0064] To fundamentally address this gradient flooding problem, this embodiment introduces a dynamic weight adjustment mechanism based on inverse frequency weighting. The core logic is that the lower the frequency of a certain type of defect sample, the higher its weight is allocated in the loss function. This amplifies the gradient contribution of this type of defect during backpropagation, forcing the model to give more attention to rare defects during parameter optimization.

[0065] Specifically, this embodiment employs a combination strategy of Focal Loss and inverse frequency weighting for classification loss. The basic formula for Focal Loss is:

[0066] in, This is the classification loss value; To balance the weighting coefficients of positive and negative samples; γ represents the model's predicted probability of the true label category; if the true label is positive, it represents the probability of predicting the positive class, otherwise it represents the probability of predicting the negative class. γ is the focusing parameter, used to reduce the weight contribution of easily classifiable samples, allowing the model to focus its training on hard samples that are difficult to classify. log(·) is the natural logarithm function. Based on this, this embodiment further uses an inverse frequency weighting formula to dynamically calculate the above weight coefficients. Its formula is:

[0067] in, This refers to the weighting coefficient for the i-th type of defect sample, which is used as the weighting coefficient for the i-th type of defect in the aforementioned Focal Loss formula. Parameter; N is the total number of samples in the training set; Let C be the specific number of defect samples of type i in the training set; C is the total number of defect categories. Through the synergistic effect of the above formulas, the model exhibits a significant defensive advantage during training: for the extremely low probability defect of loose grounding leads, due to its small sample size... The inverse frequency weighting formula will assign it an extremely large weight coefficient, which is extremely small. By combining the focusing parameter γ in Focal Loss, the gradient signal of this rare defect in the loss function is doubly amplified. Without this inverse frequency weighting mechanism, the tiny gradient of the rare defect would be masked by the sum of the huge gradients of common defects, and the model would be unable to learn the deep features of the rare defect, causing the valuable samples generated by the aforementioned physical constraints to lose their training value. Therefore, the inverse frequency weighting mechanism is a key algorithmic safeguard for ensuring the trainability of the rare defect model and the reliability of its final identification.

[0068] It should be understood that the dynamic weight adjustment strategy is not limited to the specific mathematical combination of Focal Loss and inverse frequency weighting mentioned above. It can also be other weighting strategies or resampling strategies based on class frequency. As long as it can achieve the function of dynamically adjusting the gradient contribution of each class according to the sample frequency, it should be regarded as an equivalent replacement of the inventive concept. The above description of network architecture and loss function is only illustrative and not restrictive. Those skilled in the art can flexibly select or combine the above optimization strategies according to the specific hardware computing power and data distribution.

[0069] like Figure 5 As shown, this embodiment provides a target defect identification device. This device constructs a closed-loop system encompassing the entire process from data construction to model training and inference verification by transforming the aforementioned method flow into a collaborative architecture of functional modules. It is particularly suitable for defect identification scenarios that are rare and easily visually confused with normal conditions. It should be understood that the device described in this embodiment is merely an interpretative virtual module division, not a limiting hardware entity. Those skilled in the art can adaptively adjust the module division or merging according to the specific software deployment environment without departing from the inventive concept.

[0070] The target defect identification device includes: a data augmentation module, a model training module, a target identification module, and a defect verification module.

[0071] The data augmentation module is configured to generate sample images containing defect features based on the physical structural constraints of the original image of the target object, and to construct a training set based on the sample images.

[0072] Specifically, the data augmentation module is the data source for the entire device to address the pain point of scarce small sample data. This module receives the original image of the target object as input. Through its internally integrated physical structure feature extraction unit and image generation unit, it uses physical structure constraints reflecting real geometric contours and topological connections as boundary restrictions. This forces the generation process to render and mutate defect features only within a framework that conforms to physical realism, thereby outputting sample images that possess both sample diversity and physical realism. Subsequently, the data augmentation module fuses and annotates these generated sample images with a small number of potentially existing real samples to construct a sufficiently large and evenly distributed training set, which is then output to the downstream model training module. It should be understood that although this embodiment describes the data augmentation module as an independent virtual unit, in actual software engineering practice, this module can also be implemented as an offline data preprocessing script or an online service; its specific operational form does not affect its functional positioning within the architecture of this invention.

[0073] The model training module is configured to train the detection model using the training set.

[0074] Specifically, the model training module receives the training set output by the data augmentation module as input and iteratively updates the parameters of the detection model through its internally configured optimization algorithms and network architecture. Since the training set contains realistic and diverse defect samples generated by physical constraints, the model training module can drive the detection model to fully learn the characteristic behavior of defects under different lighting, backgrounds, and angles, effectively avoiding the risk of overfitting due to insufficient samples. During training, the model training module can also dynamically adjust the loss weights according to the frequency of various defect samples to ensure that the gradient contribution of rare defects is not submerged. After completing parameter optimization, the model training module outputs the detection model parameters with target component recognition capabilities to the target recognition module for deployment. It should be understood that the model training module typically runs during the offline preparation phase of the device. Once the detection model training is complete and converges, this module can be in a dormant or unloaded state during the online inference phase of the device to save computational resources.

[0075] The target recognition module is configured to identify target components in the image to be detected through the detection model.

[0076] Specifically, the target recognition module is the core perception unit of the device during the online inference phase. This module receives the image to be detected (such as on-site images collected by an inspection system) as input, loads the detection model parameters output by the model training module, performs feature extraction and inference analysis on the image, and outputs the recognition result of whether the target component exists. This module mainly solves the preliminary visual perception problems of "where" and "what," that is, locating candidate regions where defects may exist from complex backgrounds. However, relying solely on the visual appearance features of the target recognition module for preliminary identification often has limitations when facing certain easily confused defects. Therefore, its output recognition result is not directly used as the final defect judgment conclusion, but rather as a conditional signal to trigger downstream logic verification.

[0077] The defect verification module is configured to, in response to the identification of the target component, verify whether the target component has a defect based on whether the spatial positional relationship between the target component and associated components conforms to a preset physical connection rule.

[0078] Specifically, the defect verification module is the logical closed-loop guarantee for the device to solve the problem of visual confusion and misjudgment. This module has a close data flow and triggering relationship with the target recognition module: when the target recognition module identifies a target component, it sends a trigger signal and the target component's position information to the defect verification module; in response to the trigger signal, the defect verification module further identifies related components with physical connections to the target component in the image to be detected and analyzes the spatial relationship between them. Subsequently, the defect verification module compares the actual spatial relationship with built-in preset physical connection rules. If it conforms to the rules, the misjudgment is eliminated; if it does not conform to the rules, a defect is verified. This mechanism transforms simple visual recognition into a dual verification of "visual + logical," effectively eliminating interference items that are visually similar but have different physical states. It should be understood that the defect verification module can not only be connected in series after the target recognition module as an independent post-processing unit, but it can also share part of the feature extraction network with the target recognition module to achieve end-to-end joint inference optimization, as long as it can achieve the secondary verification function based on physical connection rules.

[0079] Through the configuration relationship and data flow of the above four modules, the device in this embodiment solidifies the synergistic effect of "physical constraint generation + logical verification" into the system architecture. The data augmentation module and the model training module work together to solve the problem of data scarcity making the model trainable, providing a robust perceptual foundation for the target recognition module; the target recognition module and the defect verification module work together to solve the problem of model misjudgment making the results reliable, providing logical assurance for the final output. Without the physical constraint generation of the data augmentation module, the model training module cannot learn effectively, and the target recognition module cannot be accurately triggered; without the logical constraints of the defect verification module, even if the target recognition module can identify candidate targets, it cannot distinguish between real defects and visual interference. Therefore, this device architecture achieves a high-accuracy and high-reliability closed loop for the identification of rare and easily confused defects.

[0080] This embodiment provides a hardware entity and software carrier solution to ensure the supply chain is fully protected. It aims to solidify the target defect identification method established in the aforementioned embodiments into specific inspection equipment and distribution media, ensuring that the technical concept of this invention can be implemented in actual hardware in industrial sites and forming a complete protection coverage for downstream complete products and software distribution.

[0081] On the one hand, this embodiment provides a power transmission line inspection device, including a processor and a memory. When the processor executes the program stored in the memory, it implements the target defect identification method as described in the foregoing embodiment.

[0082] Specifically, the power transmission line inspection equipment is a physical hardware device with image acquisition and edge computing capabilities. For example, the device could be a drone equipped with an edge computing box, an inspection robot, or an intelligent monitoring terminal fixedly installed on a power transmission tower. The processor could be a central processing unit, a graphics processing unit, or a dedicated neural network processor, responsible for loading and running the computer program instructions stored in the memory, and performing data processing and inference judgments according to the process logic described in Embodiment 1. The memory includes high-speed random access memory and non-volatile memory, wherein the non-volatile memory is used to persistently store trained detection model parameters, preset physical connection rule bases, and operating system and application code. When the processor executes the program, the device, in response to external triggers or timed tasks, first generates sample images containing defect features based on the physical structural constraints of the original image of the target object and constructs a training set to complete the local update or initialization of the model. Subsequently, the detection model is trained using the training set. During inspection operations, the detection model identifies target components in images collected in real-time by drones or robots. Finally, in response to the identification of a target component, the device verifies whether the target component has a defect based on whether the spatial relationship between the target component and associated components conforms to preset physical connection rules. Upon verification of a defect, an alarm signal is sent to the remote maintenance center via the device's communication module. It should be understood that although this embodiment uses drones and inspection robots as typical carriers, in other embodiments, the device can also be a cloud server cluster or an edge gateway device. As long as it includes a processor and memory and can execute the aforementioned method flow, it should fall within the protection scope of this invention.

[0083] On the other hand, this embodiment provides a computer-readable storage medium storing a program that, when executed, implements the target defect identification method as described in the foregoing embodiments.

[0084] Specifically, the computer-readable storage medium is a non-transitory data carrier used to carry and distribute software logic. For example, the medium can be a solid-state drive, hard disk drive, optical disc, USB flash drive, or a virtual storage node in a cloud-based distributed storage system. The program stored in the medium contains computer-executable instructions that implement all steps of the aforementioned target defect identification method. When the medium is deployed in any computing-capable electronic device, and the device reads and executes these instructions, the device will exhibit the following response logic: First, it calls the data augmentation instruction set to generate defect sample images and construct a training set based on physical structural constraints; then, it calls the model training instruction set to optimize the detection model's parameters using the training set; next, it calls the target recognition instruction set to infer the target component from the image to be detected using the optimized detection model; finally, it calls the defect verification instruction set to perform logical verification based on whether the spatial relationship between the target component and related components conforms to preset physical connection rules, and outputs the final defect judgment result, in response to the target component's identification result. This media solution provides a legitimate distribution carrier for the software encapsulation, version iteration, and cross-platform portability of the target defect identification algorithm. This allows the algorithm to be flexibly integrated into various existing inspection systems or maintenance platforms as plugins, SDKs, or standalone applications without requiring large-scale modifications to the underlying hardware architecture of these systems. The above descriptions of the devices and media are illustrative only and not restrictive. Those skilled in the art can select appropriate hardware forms and storage media types based on specific engineering deployment requirements, as long as they can achieve the execution and response of the aforementioned method flow.

[0085] To more clearly illustrate the combined value and irreplaceability of the technical solutions of this invention, a detailed demonstration of the overall closed-loop process established in the aforementioned embodiments is provided, using the application scenario of intelligent UAV inspection of rare defects in transmission line conductors (loose grounding leads) as an example. It should be understood that the following description is illustrative only and not restrictive; those skilled in the art can adapt the scenario details to the specific inspection object and hardware carrier.

[0086] In this application scenario, the inspection equipment is a drone equipped with an edge computing box, and its target defect identification method specifically includes the following data flow and logical judgment steps: Step S700: In view of the scarcity of grounding lead loosening samples, realistic loosening samples are generated using the physical structural constraints of the original tower image.

[0087] Specifically, in the actual operation of transmission lines, grounding lead detachment is a rare defect with an extremely low probability of occurrence, making it almost impossible to collect a sufficient number of real samples on-site. If the model is directly trained based on these scarce samples, it will suffer from severe overfitting. Therefore, the system first acquires original images of normal transmission towers taken during historical UAV inspections and extracts their physical structure feature maps as constraints. These physical structure feature maps are not limited to the tower edge contour maps extracted by the Canny operator; they can also be topological connection skeleton maps reflecting the connection relationship between the lead and the tower materials. Subsequently, the system inputs the physical structure feature maps into a control network (such as ControlNet) to obtain control features; and then inputs the control features along with textual prompts describing the semantics of the detachment defect (e.g., "High-resolution image of a transmission tower, the groundinglead wire is loose and disconnected from the clamp, the bolt is missing on the loose end, clear sky background") into a diffusion model (such as Stable Diffusion) to guide the model in generating sample images.

[0088] The core value of this generation mechanism lies in the synergy between physical constraints and semantic guidance: pure text generation lacks geometric constraints and is prone to producing distorted images such as suspended wires or misaligned bolts that do not conform to the topological laws of the tower, causing the model to learn false features; pure structural replication lacks semantic diversity and cannot cover loose morphologies under different lighting and backgrounds. By defining the geometric shape and topological layout through physical structural feature maps and enriching the semantics of defects and environmental textures with textual prompts, the system generates loose sample images that are both physically realistic and possess scene diversity, fundamentally solving the problem of overfitting with small samples and providing a high-quality data foundation for subsequent model training.

[0089] Step S701: Train a YOLOv8 detection model containing a multi-scale feature fusion network using an inverse frequency weighting method.

[0090] Specifically, the system fuses the generated loose sample images with a small number of real samples to construct a training set. Since various defect samples still exhibit long-tail distribution differences in the training set (e.g., many skipped strand samples and very few loose samples), the system dynamically adjusts the weights of various defects in the loss function of the detection model based on the frequency of each type of defect sample in the training set when training the YOLOv8 detection model. The specific formula is as follows:

[0091] The number of samples with loosening defects Extremely small, therefore its weighting coefficient The dynamic amplification forces the model to contribute more gradients to rare defects during parameter optimization, preventing their gradient signals from being overwhelmed by common defects. Simultaneously, the YOLOv8 detection model incorporates a multi-scale feature fusion network (such as BiFPN) that integrates shallow detail features and deep semantic features, enabling the model to capture the texture of minute defects like loose strands while also locating the outlines of larger defects such as loose grounding leads.

[0092] Step S702: The drone takes images of the tower on site, and the detection model initially identifies the candidate boxes for the grounding lead.

[0093] Specifically, during inspection operations, a drone flies near the power transmission tower and uses a camera to capture images of the target component in real time, transmitting them to an edge computing box. The YOLOv8 detection model deployed on the edge computing box performs inference analysis on the images, identifying candidate bounding boxes for the target component—the grounding lead. At this point, the model has only completed preliminary visual perception based on appearance features. However, because a loose lead is highly similar to a normally bent lead in visual texture and shape, this step alone is insufficient to reliably determine whether the lead truly has a loosening defect.

[0094] Step S703: The bolt detection sub-model is triggered, and it is found that there is no fastener at the end, which is verified as a loosening defect and an alarm is issued.

[0095] Specifically, in response to the detection of a grounding lead, the system immediately triggers a logic verification mechanism based on physical connection rules. The system uses a detection model (specifically, a lightweight bolt detection sub-model with MobileNetV3 as the backbone network) to identify associated components—fasteners—in the image to be inspected that have a physical connection to the grounding lead. It should be understood that fasteners are not limited to bolts; they can also be clips, rivets, or pressure plates, or any component that provides mechanical fastening. This overarching generalization covers the fastening designs of different tower types. The system then analyzes the spatial relationship between the end region of the grounding lead and the fasteners. Based on whether this spatial relationship conforms to preset physical connection rules, it determines whether the grounding lead has a defect. In this scenario, the preset physical connection rule is summarized as "a normally connected grounding lead must have fasteners at its end." When the system finds no fasteners at the end region of the grounding lead, it determines that the grounding lead has a loosening defect.

[0096] This logical verification step is the key safeguard against false alarms in the entire integrated solution. Pure visual features cannot distinguish between normal bending and loosening defects because their pixel-level projections are extremely similar. Deep learning models are prone to misclassifying normally bent wires as loose. It is essential to introduce the physical prior rule that "a loose end must have no fasteners," and through logical verification of spatial relationships, to cut off the visually confusing interference and achieve a reliable transition from "looks like" to "physically is." Finally, after verifying the loosening defect, the edge computing box sends an alarm signal to the remote operations and maintenance center via the drone's communication module, completing the entire closed loop.

[0097] Through the complete scenario of drone inspection of power transmission towers described above, the irreplaceable nature of the combined solution of this invention can be clearly demonstrated: without the generative data augmentation based on physical structural constraints in step S700, the model cannot learn effectively due to the scarcity of samples, and the preliminary identification in step S702 cannot be accurately triggered; without the logical verification based on spatial positional relationships in step S703, even if the preliminary identification in step S702 is triggered, it will be overwhelmed by the visual confusion of normally bent conductors, resulting in a large number of false alarms. Physical constraint generation solves the problem of model trainability due to data scarcity, and logical verification solves the problem of reliable results due to model misjudgment. The two work together to achieve high accuracy and high reliability in identifying rare and easily confused defects.

[0098] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended embodiments and their equivalents.

Claims

1. A method for identifying conductor / ground wire defects based on small sample generation and feature enhancement, comprising: Based on the physical structural constraints of the original image of the target object, sample images containing defect features are generated, and a training set is constructed based on the sample images. The detection model is trained using the training set. The detection model identifies target components in the image to be detected. In response to the identification of the target component, the system verifies whether the target component has defects based on whether the spatial relationship between the target component and associated components conforms to a preset physical connection rule.

2. The method for identifying conductor defects based on small sample generation and feature enhancement according to claim 1, characterized in that, The generation of sample images containing defect features based on the physical structural constraints of the original image of the target object includes: Extract the physical structure feature map of the original image, and use the physical structure feature map as a constraint condition to input the image generation model to generate the sample image that conforms to the physical structure feature map.

3. The method for identifying conductor defects based on small sample generation and feature enhancement according to claim 2, characterized in that, Physical structural features include edge features or topological connectivity features; the image generation model includes a diffusion model and a control network; The physical structure feature map is input into the control network to obtain the control features; The control features and text prompts are input into the diffusion model to guide the diffusion model in generating the sample image.

4. The method for identifying conductor defects based on small sample generation and feature enhancement according to claim 1, characterized in that, The verification of whether the target component has defects based on whether the spatial relationship between the target component and associated components conforms to preset physical connection rules includes: The detection model identifies associated components in the image to be detected that have a physical connection with the target component. Analyze the spatial relationship between the target component and the associated component; Based on whether the spatial relationship conforms to the preset physical connection rules, it is determined whether the target component has a defect.

5. The method for identifying conductor defects based on small sample generation and feature enhancement according to claim 4, characterized in that, The target component is a grounding lead, and the associated component is a fastener; When the fastener is not present in the end region of the grounding lead, it is determined that the grounding lead has a loosening defect.

6. The method for identifying conductor defects based on small sample generation and feature enhancement according to claim 1, characterized in that, The detection model includes a multi-scale feature fusion network, which is configured to fuse shallow detail features and deep semantic features.

7. The method for identifying conductor defects based on small sample generation and feature enhancement according to claim 1, characterized in that, The step of training the detection model using the training set includes: Based on the frequency of various defect samples in the training set, the weights of various defects in the loss function of the detection model are dynamically adjusted using an inverse frequency weighting method.

8. A conductor / ground wire defect identification device based on small sample generation and feature enhancement, comprising: The data augmentation module is configured to generate sample images containing defect features based on the physical structural constraints of the original image of the target object, and to construct a training set based on the sample images. The model training module is configured to train a detection model using the training set; The target recognition module is configured to identify target components in the image to be detected using the detection model; The defect verification module is configured to verify whether the target component has a defect in response to the identification of the target component, based on whether the spatial positional relationship between the target component and associated components conforms to a preset physical connection rule.

9. A power transmission line inspection device, comprising a processor and a memory, wherein the processor executes a program stored in the memory to implement the target defect identification method of claim 1.

10. A computer-readable storage medium storing a program that, when executed, implements the target defect identification method of claim 1.