A power transmission line defect automatic detection method based on container technology
By constructing a specialized dataset and a grouped deconvolutional detection network model, combined with container technology, the problems of insufficient detection accuracy and real-time performance in UAV inspections were solved, and efficient automated detection of power transmission line defects was achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIHANG UNIV
- Filing Date
- 2026-03-24
- Publication Date
- 2026-06-23
AI Technical Summary
Existing drone inspection technology for power transmission line defect detection suffers from problems such as insufficient data volume, easy neglect of small target features, class imbalance, limited model feature extraction and fusion capabilities, and inefficient deployment schemes, resulting in insufficient detection accuracy and real-time performance.
We employ a container-based approach to construct a specialized dataset and use a grouped deconvolutional detection network model. By combining multi-scale feature fusion and illumination simulation, we optimize the dataset and perform iterative training to achieve standardized encapsulation and high-concurrency processing of the model.
It improves the accuracy and real-time performance of power transmission line defect detection, reduces computing costs, and enables high-precision, specialized field power grid inspections by drones.
Smart Images

Figure CN122265718A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power transmission line inspection technology, specifically to an automated method and system for detecting power transmission line defects by integrating data augmentation, multi-level feature fusion networks, and containerized deployment, for achieving high-precision, real-time detection of power transmission line defects. Background Technology
[0002] With the continuous growth of my country's power transmission lines, traditional manual inspections can no longer meet the needs of operation and maintenance. Since 2013, the State Grid and China Southern Power Grid have been conducting intelligent unmanned aerial vehicle (UAV) inspections of power transmission lines. Currently, UAVs are being used on a large scale and in a standardized manner, with over 80 million images inspected annually, identifying approximately 750,000 defects. These defects cover all types, including towers, insulators, hardware, conductors, foundations, corridor environments, grounding devices, and ancillary installations. UAV inspections, with their advantages of high autonomy, wide coverage, and high safety, have broad prospects in modern industrial systems and have been widely applied.
[0003] Traditional drone inspections focus on data collection and transmission. While drone inspections can reduce the investment of human resources in the field, the information collected by drones still requires human screening. To further improve the artificial intelligence level of power distribution network drones and reduce human resource investment, the practice of equipping drones with target detection algorithms for real-time automatic detection is becoming increasingly widespread. However, given the high resolution and small proportion of targets to be inspected characteristic of power line defects, despite the significant achievements of general target detection algorithms in recent years thanks to the powerful learning capabilities and large databases of deep convolutional neural networks, conventional target detection algorithms still struggle to achieve accurate detection. Therefore, small object detection, as a subfield of target detection, has become a major research focus.
[0004] Current algorithms for detecting small targets show a significant performance gap compared to those detecting normal-sized targets. This is due to several factors: First, at the data level, insufficient sample size, the easy neglect of small target features, and significant class imbalance lead to inadequate model training. Second, at the model level, existing networks have limited ability to extract and fuse features from small targets on power transmission lines, resulting in insufficient detection accuracy. Third, at the deployment level, the lack of efficient and lightweight deployment solutions makes real-time detection difficult in practical scenarios. Therefore, a comprehensive and optimized data processing, model building, and deployment solution is urgently needed to improve the performance and practicality of power transmission line defect detection. Summary of the Invention
[0005] In view of this, in order to solve the above-mentioned technical problems, or at least partially solve them, the present invention proposes an automated detection method for transmission line defects based on container technology. This automated detection method for transmission line defects based on container technology specifically includes the following steps, as shown in the appendix. Figure 1 As shown:
[0006] Step S1: Acquire multi-view inspection images of the target scene from the perspective of a drone. The drone maintains an altitude of 5-20 meters from the target and is numbered according to the line segment to form an initial unlabeled dataset. Input the original images into the image preprocessing framework and normalize them. Input the normalized images into the deblurring network and convolutional neural network in sequence to obtain deblurred and distortion-reduced preprocessed images. Then, apply data augmentation strategies to the preprocessed images and perform refined external defect annotation to obtain a labeled dataset. Use label optimization methods and loss functions to adjust the sample class distribution to obtain the initial pre-training dataset.
[0007] Step S2: By adding a convolutional dimensionality reduction strategy before the feature extraction network, the number of channels in the multi-scale feature map is compressed, and a grouped deconvolution method is adopted to achieve parallel upsampling of feature depth in the channel dimension; this enhances the feature extraction capability of small targets while reducing computational costs, thereby constructing a multi-scale grouped deconvolutional detection network model for outdoor power defect identification, realizing the defect-specific identification process of target images; using the dataset in Step S1, the model is trained specifically to obtain detection results containing confidence and defect category; network performance is tested and evaluated based on the detection results;
[0008] Step S3: For the missing or false detection samples in specific complex field scenes that cause poor model performance, trigger additional manual re-capture instructions and data increment supplementation instructions through active learning strategies, perform targeted re-labeling and denoising processing, and achieve corresponding data increment supplementation; ultimately achieve dataset augmentation and reconstruction through the above methods; repeat the network training process of step S2 until the evaluation results meet the target requirements;
[0009] Step S4: Based on the network training results in Step S3, encapsulate the model code and weight files into service interfaces, build a microservice architecture, construct a runtime environment based on container technology and define a base image, integrate the virtual environment, and realize the standardized encapsulation of the model runtime environment; construct an asynchronous service listening module to realize service-oriented encapsulation, realize the standardized reuse of the model and high-concurrency processing, and constitute a UAV real-time automated detection system for power transmission line defects.
[0010] Furthermore, the refined external defect annotation and data augmentation strategy described in step S1 is based on the original defect image data. It constructs a target constraint matrix and enhances specific factors using a geometric parameter library of insulators. This ultimately results in: a target copy-paste algorithm that automatically verifies the minimum spacing and angle compatibility between targets during pasting by constructing a geometric constraint matrix, avoiding manual annotation errors; and a multi-view transformation algorithm, which includes flipping, rotation, and affine transformation methods. For specific factors related to outdoor lighting interference, a multi-dimensional lighting simulation system is constructed, including dynamic modeling of point light sources, global lighting attenuation simulation, directional lighting modeling, and light and shadow consistency constraints.
[0011] Dynamic modeling of point light sources A Gaussian spot superposition model is used to simulate local strong light interference:
[0012]
[0013] in, In the original image Based on this, the output result is superimposed with n Gaussian light spots modulated, where n is the number of point light sources. G is a two-dimensional rotationally symmetric Gaussian kernel function. The intensity coefficient of the k-th light source , The coordinates of the light source center are Let be the standard deviation of the k-th light spot. An adaptive algorithm is used to dynamically adjust this deviation, enabling diverse control over the light spot size and blur level. ;
[0014] Global Illumination Attenuation Simulation An ambient light model based on distance attenuation is introduced to simulate the light attenuation effect caused by atmospheric scattering:
[0015]
[0016] in, The initial light intensity, Let be the Euclidean distance from the pixel to the light source. This is the attenuation constant, with a value ranging from 50 to 200 pixels. This is the ambient light compensation value, ranging from 0.1 to 0.3 times the original brightness;
[0017] Directional lighting modeling To address the changing perspective of drone inspections, a directional light source simulation was added, using the incident angle of the light. and azimuth Parameterize the illumination direction and calculate the surface illuminance using the Lambertian reflection model:
[0018]
[0019] in, Intensity of solar light source, The angle between the light source and the surface normal, with an angle range of... , Let be the azimuth angle of the light source in the image plane, with an angle range of . By randomly generating angle parameters to change the normal angle and azimuth angle, the illumination conditions at different times can be simulated.
[0020] Light and shadow consistency constraints When adding lighting interference, corresponding shadow areas are generated simultaneously, and a projection mask matching the target shape is generated through morphological operations. ,accomplish:
[0021]
[0022] in, This is the shadow attenuation coefficient, with a value ranging from 0.3 to 0.7, ensuring the physical consistency between lighting and shadows and improving the visual realism of the dataset;
[0023] The above-mentioned multi-model fusion lighting simulation method can generate complex lighting scenes that include strong light spots, global attenuation, directional changes and realistic shadows, effectively covering extreme lighting conditions such as backlighting, sidelighting and cloud scattering that may be encountered in field inspections, and improving the lighting diversity of the dataset and the generalization ability of the model.
[0024] Furthermore, the multi-scale grouped deconvolutional detection network model for outdoor power defect identification described in step S2 employs a deep feature reconstruction method that preserves small target details through grouped deconvolutional upsampling, as follows:
[0025] First, a lightweight feature transformation module is introduced into the first two layers of the feature extraction network to reduce the dimensionality of the features, thereby optimizing computation and extracting compact features from the input feature map. Perform a linear transformation, where H represents the height of the feature map and W represents the width of the feature map, projecting it into a low-dimensional space:
[0026]
[0027] in, The projection weight matrix is... For bias terms, and It is the number of input channels and the number of output channels and Dimensionality reduction ratio As a hyperparameter, it is used to control the balance between the degree of information compression and computational complexity;
[0028] The dimensionality-reduced features are then represented by a nonlinear activation function and renormalized as follows:
[0029]
[0030] Here, This indicates a normalization operation. Use the LeakyReLU activation function;
[0031] Secondly, the input feature map channel dimensions are divided. There are a total of g independent groups, where C is the number of channels and g is the number of groups. This represents the number of channels in each group. Each group is deconvolved separately, and the final results are fused to achieve high-resolution feature map reconstruction of small target regions.
[0032]
[0033]
[0034] in, For the deconvolution results of each group, Let g represent the deconvolution operation of the g-th group. The deconvolution operations of different groups are mathematically identical, but their parameters differ. It is independently learnable. Let be the input feature map to be sampled, and s be the upsampling target scale factor. Let g be the learnable parameters of the g-th deconvolutional layer. For the final feature map, a fusion function is used. The results from each group were combined.
[0035] Furthermore, in step S4, the network weights and model files generated in steps S2 to S3 are encapsulated into service interfaces; based on the microservice architecture design, container technology is used to build and define a standardized base image, integrate the virtual environment required for model operation, and realize the standardized encapsulation and isolation of the detection model's operating environment; an asynchronous service listening and calling module is built to realize the service-oriented encapsulation of the detection function, thereby integrating and forming a complete UAV real-time automated detection system for power line defects.
[0036] Thus, the initial dataset and neural network were obtained. Through iterative training and service-oriented encapsulation, the detection model was completed.
[0037] The beneficial effects of this invention are as follows: Based on the various problems faced by existing circuit inspection technologies, this invention proposes an automated defect detection method for transmission lines based on container technology. This method constructs a targeted, specialized dataset and proposes a grouped upsampling network architecture. The basic process involves specialized dataset construction, grouped upsampling network construction and training, iterative training and dataset optimization, and service-oriented encapsulation, thereby achieving high-precision, specialized field power grid inspection by online drones. First, the high-quality dataset construction and detection algorithm optimization for specific power inspection scenarios constructed in this invention provide a data foundation and model basis for the accurate identification of minor defects in transmission lines. Second, this invention effectively enhances the feature extraction capability for small targets and reduces computational costs through an improved grouped upsampling mechanism. Finally, this invention, combined with a containerized deployment scheme, achieves standardized algorithm reuse and high-concurrency processing. The technical approach provided by this invention can offer universally applicable empirical methods for the architecture design of automated inspection systems in complex field environments and the application development of deep learning components. Attached Figure Description
[0038] Figure 1 This is a flowchart illustrating the overall process of an automated defect detection method for power transmission lines based on container technology.
[0039] Figure 2 Target detection results image;
[0040] Figure 3 This is a graph showing the network test results. Detailed Implementation
[0041] The exemplary embodiments of the present invention will now be described in detail with reference to the accompanying drawings. The embodiments described herein are merely specific implementations of a part of the present invention, and not all embodiments. Any modifications, equivalent substitutions, or improvements made within the concept and principles of the present invention should be included within the scope of protection of the present invention.
[0042] Unless otherwise expressly defined, the terms "first," "second," etc., in the embodiments of this invention are used only to distinguish different objects and do not indicate order or technical meaning; "multiple" refers to two or more, and "at least one" refers to one or more; the term "and / or" indicates that the associated object exists in three possible situations: "A exists alone, A and B exist simultaneously, and B exists alone." For the sake of brevity, the similarities or identical aspects between different embodiments are referred to mutually and will not be repeated.
[0043] Furthermore, the dimensions of the components in the accompanying drawings may not be drawn strictly according to actual relationships and should not be taken as a limitation on the actual structure. Identical or similar labels in the drawings represent similar elements, and once defined, they may not be discussed again subsequently.
[0044] Example 1
[0045] To address the issues of poor real-time performance and low specificity identification accuracy in existing technologies for power grid drone field inspections, and to provide an effective technical solution for intelligent, modular, and specialized inspection methods, this invention proposes an automated defect detection method for transmission lines based on container technology. The overall detection process includes dataset construction, network construction and training, network iteration, dataset optimization, and service-oriented encapsulation, such as... Figure 1 As shown. This automated defect detection method for transmission lines based on container technology specifically includes the following steps:
[0046] Step S1: Obtain multi-view inspection images of the target scene from the drone's aerial perspective to form an initial unlabeled dataset. Input the original images into the image preprocessing framework and normalize them. Input the normalized images sequentially into the deblurring network and convolutional neural network to obtain deblurred and distortion-reduced preprocessed images. Then, perform refined external defect annotation and data augmentation strategies on the preprocessed images to obtain a labeled dataset. Use label optimization methods and loss functions to adjust the sample class distribution to obtain the initial pre-training dataset.
[0047] Step S1.1: Obtain the unlabeled dataset of high-voltage transmission lines inspected and photographed by drones.
[0048] Raw, real-world 2D RGB inspection images of high-voltage transmission lines were acquired using a high-definition camera mounted on a drone, forming an initial unlabeled dataset. The original images were then normalized to a uniform size using an OpenCV library called via a Python script. An end-to-end deblurring network based on the U-Net architecture was used to separate motion blur and atmospheric turbulence interference through residual learning to achieve deblurring. Finally, a model improved using Retinex-Net, incorporating spatial and frequency domain constraints, addressed the color distortion caused by changes in the drone's pitch angle, preserving the micro-reflective features of the insulator skirts for color space correction preprocessing.
[0049] Step S1.2: Data augmentation implementation.
[0050] Using professional annotation tools such as LabelImg, refined manual geometric annotations and semantic attribute definitions for external defects (such as insulator damage and cracks) are performed on the preprocessed images. Then, based on the Albumentations library in Python and a custom data augmentation script, a target morphology constraint matrix is constructed using a geometric parameter library based on insulators. During pasting, the minimum spacing and angular compatibility between targets are automatically checked to avoid manual annotation errors. Target copy-paste algorithms, multi-view transformations (including flipping, rotation, and affine transformations), and strategies for simulating lighting interference (adjusting brightness, contrast, and HSV noise) are employed to expand the dataset size.
[0051] To address the issue of the scarcity of small targets in the sample, a target copy-paste operation is implemented: small targets in a single RGB image are copied multiple times and pasted into the image, ensuring that each target is independent and does not appear in the wrong position during pasting; some pasted targets are rotated and scaled to complete data augmentation, without applying Gaussian blur to the target edges; at the same time, the original image is rotated and scaled to increase the sample size and obtain multi-view target images.
[0052] To address the complex lighting issues in outdoor environments, a multi-dimensional lighting simulation system was constructed, including dynamic modeling of point light sources, global illumination attenuation simulation, directional lighting modeling, and light and shadow consistency constraints.
[0053] Dynamic modeling of point light sources The Gaussian spot superposition model is used to simulate local strong light interference. The mathematical expression is:
[0054]
[0055] in, In the original image Based on this, the output result is superimposed with n Gaussian light spots modulated, where n is the number of point light sources. G is a two-dimensional rotationally symmetric Gaussian kernel function. The intensity coefficient of the k-th light source , The coordinates of the light source center are Let be the standard deviation of the k-th light spot. An adaptive algorithm is used to dynamically adjust this deviation, enabling diverse control over the light spot size and blur level. ;
[0056] Global Illumination Attenuation Simulation An ambient light model based on distance attenuation is introduced to simulate the light attenuation effect caused by atmospheric scattering:
[0057]
[0058] in, The initial light intensity, Let be the Euclidean distance from the pixel to the light source. This is the attenuation constant, with a value ranging from 50 to 200 pixels. This is the ambient light compensation value, ranging from 0.1 to 0.3 times the original brightness;
[0059] Directional lighting modeling To address the changing perspective of drone inspections, a directional light source simulation was added, using the incident angle of the light. and azimuth Parameterize the illumination direction and calculate the surface illuminance using the Lambertian reflection model:
[0060]
[0061] in, Intensity of solar light source, The angle between the light source and the surface normal, with an angle range of... , Let be the azimuth angle of the light source in the image plane, with an angle range of . By randomly generating angle parameters to change the normal angle and azimuth angle, the illumination conditions at different times can be simulated.
[0062] Light and shadow consistency constraints When adding lighting interference, corresponding shadow areas are generated simultaneously, and a projection mask matching the target shape is generated through morphological operations. ,accomplish:
[0063]
[0064] in, This is the shadow attenuation coefficient, with a value ranging from 0.3 to 0.7, ensuring the physical consistency between lighting and shadows and improving the visual realism of the dataset;
[0065] The above-mentioned multi-model fusion lighting simulation method can generate complex lighting scenes that include strong light spots, global attenuation, directional changes and realistic shadows, effectively covering extreme lighting conditions such as backlighting, sidelighting and cloud scattering that may be encountered in field inspections, and improving the lighting diversity of the dataset and the generalization ability of the model.
[0066] Step S1.3: Adjust the sample class distribution through label optimization methods to alleviate the class imbalance problem.
[0067] Label optimization based on algorithmic logic utilizes NumPy to perform class distribution statistics on labeled samples; label optimization methods such as resampling strategies are employed to adjust the sample distribution; and a weighted loss function is used in the training configuration file, along with a class balancing sampler applied at the data loading layer, to alleviate the problem of severe class imbalance for common defects in the dataset.
[0068] Oversampling is performed on relevant defects such as tower cracks to increase the concentration of small target samples in the final database; at the same time, the number of each defect type is counted, and sampling and weight allocation are completed according to the proportion to avoid class imbalance.
[0069] Step S2: Construct a multi-scale grouped deconvolutional detection network model for outdoor power defect identification to achieve the defect-specific identification process of the target image. A convolutional dimensionality reduction strategy is added before the feature extraction network to compress the number of channels in the multi-scale feature map, and grouped deconvolution is used to achieve parallel upsampling of feature depth in the channel dimension. The model is trained using the dataset from Step S1 to obtain detection results containing confidence scores and defect categories. The algorithm performance is then evaluated based on the detection results.
[0070] Step S2.1: Construct a target recognition network based on a multi-level feature fusion method using an improved deep feature upsampling (using grouped deconvolution to preserve small target details).
[0071] First, a lightweight feature transformation module is introduced into the first two layers of the feature extraction network to reduce the dimensionality of the features, thereby optimizing computation and extracting compact features from the input feature map. Perform a linear transformation, where H represents the height of the feature map and W represents the width of the feature map, projecting it into a low-dimensional space:
[0072]
[0073] in, The projection weight matrix is... For bias terms, and It is the number of input channels and the number of output channels and Dimensionality reduction ratio As a hyperparameter, it is used to control the balance between the degree of information compression and computational complexity;
[0074] The dimensionality-reduced features are then represented by a nonlinear activation function and renormalized as follows:
[0075]
[0076] Here, This indicates a normalization operation. Use the LeakyReLU activation function;
[0077] Secondly, by dividing the input feature map channel dimensions There are a total of g independent groups, where C is the number of channels and g is the number of groups. This represents the number of channels in each group. Each group is deconvolved separately, and the final results are fused to achieve high-resolution feature map reconstruction of small target regions.
[0078]
[0079]
[0080] in, For the deconvolution results of each group, Let g represent the deconvolution operation of the g-th group. The deconvolution operations of different groups are mathematically identical, but their parameters differ. It is independently learnable. Let be the input feature map to be sampled, and s be the upsampling target scale factor. Let g be the learnable parameters of the g-th deconvolutional layer. For the final feature map, a fusion function is used. The results from each group were combined.
[0081] This results in an improved target recognition network for training.
[0082] Step S2.2: Model Testing and Result Output
[0083] Input the test set of the dataset obtained in the first aspect to the target recognition network visual algorithm model to be trained, and output the tower top and tower pole defect recognition results.
[0084] After image preprocessing, the transbone module generates a three-level feature map, which is then used by a multi-scale detection head to detect targets of different pixels. The detection bounding boxes are processed by Soft-NMS, and the final output is the detection result containing confidence level and defect category.
[0085] Step S2.3: Algorithm Performance Testing
[0086] Calculate the PR regression curve and F1 curve, optimize network parameters, and improve the model's ability to extract and detect features of small target defects in transmission lines.
[0087] Regarding the PR curve and F1 curve involved in step S2, the specific formula definitions and calculation methods are as follows:
[0088] Formulas related to the precision-recall (PR) curve:
[0089] 1. Definition of basic indicators
[0090] True Cases (TP): The number of samples that are actually defective targets and are correctly detected.
[0091] False positives (FP): The number of samples that are actually non-defective targets but are misclassified as defects.
[0092] False negatives (FN): The number of samples that are actually defective targets but were not detected.
[0093] Precision:
[0094]
[0095] This represents the proportion of samples that are actually defects among those detected as defects, reflecting the model's "accurate identification ability" of defects.
[0096] Recall:
[0097]
[0098] This represents the proportion of actual defect samples that are correctly detected, reflecting the model's "complete detection capability" for defects.
[0099] 2. PR curve generation is achieved by detecting a confidence threshold. Slide upwards (e.g., in steps of 0.01) to calculate the threshold value. and A series of coordinate points were obtained. Finally, the connections form the PR curve.
[0100] The higher the threshold (e.g.) Precision is generally higher, but recall is lower.
[0101] The lower the threshold (e.g.) A higher recall rate typically results in a lower precision rate.
[0102] F1 curve formula:
[0103] The F1 score is the harmonic mean of precision and recall, used to balance the overall performance of both:
[0104]
[0105] when hour, Get the maximum value
[0106] When one of them is extremely high and the other is extremely low It will decrease significantly.
[0107] The curve is plotted by different thresholds. The peak point corresponds to the optimal detection threshold (balancing false negatives and false positives).
[0108] Multi-category extended formula (for multi-type defect detection in transmission lines):
[0109] If model detection For each defect type (such as insulator damage, conductor strand breakage, etc.), the overall index is calculated using either macro-average or micro-average.
[0110] Macro average precision / recall:
[0111]
[0112]
[0113] (The arithmetic mean of the indicators calculated separately for each category is suitable for scenarios with balanced sample sizes across categories.)
[0114] Micro-average precision / recall:
[0115]
[0116]
[0117]
[0118]
[0119]
[0120] (This method combines all class samples for calculation, making it suitable for class imbalance scenarios and highlighting the influence of smaller class samples.)
[0121] Step S3: Analyze the test set results based on the evaluation results in Step S2 to identify interference factors in complex field environments; for the missing and false detection samples reported by the model, perform targeted relabeling and denoising manually; for poor performance in specific complex field scenarios, trigger additional manual re-shooting and data increment supplementation instructions through active learning strategies to ultimately achieve dataset augmentation and reconstruction; repeat the network training process in Step S2 until the evaluation results meet the target requirements.
[0122] Step S3.1: Iterative training and dataset refinement.
[0123] The training results are analyzed using test set results to identify interference factors in complex field environments. For missed or false detection samples reported by the model, targeted relabeling and denoising are performed manually to enhance the dataset.
[0124] The dataset was divided into two parts in a 7:2:1 ratio. After initial training of the network using the pre-constructed dataset, test experiments were conducted on the validation and test sets. By analyzing the results of the validation and test sets, interference factors in the dataset were manually removed, and images that were missed or falsely detected were re-labeled to further enhance the dataset.
[0125] Step S3.2: Dynamic update and incremental supplementation mechanism.
[0126] As a continuously updated dataset, based on the inference performance of the algorithm network in actual inspection scenarios, and in cases where performance is poor in specific complex field conditions (such as heavy fog or dense forest background obstruction), an active learning strategy is used to trigger additional manual re-photography and incremental data supplementation, thereby achieving continuous iterative upgrades in dataset quality.
[0127] Step S4: Encapsulate the model code and weight files from the algorithm training results in Step S3 into a service interface, build a microservice architecture, construct a runtime environment based on container technology and define a base image, integrate the virtual environment, and achieve standardized encapsulation of the algorithm runtime environment; construct an asynchronous service listening module to achieve service-oriented encapsulation.
[0128] Step S4.1: Building a Microservice Architecture
[0129] The model code and weight files from the algorithm training results are encapsulated into a service interface using FastAPI.
[0130] A microservice architecture is built, and the runtime environment is constructed based on Docker container technology. A base image is defined using Dockerfile, and the Conda virtual environment is integrated to achieve standardized encapsulation of the algorithm runtime environment. An asynchronous service listening module is built using FastAPI.
[0131] Step S4.2: Test of Defect Identification Capability of Packaging Module
[0132] The Posterman testing tool takes an image to be inspected as input in imageBase64 format and outputs the defect identification results.
[0133] Data encoding conversion:
[0134] The client converts JPG images to UTF-8 encoded strings using the Python base64.b64encode() function, supports batch input (≤100 images per request, total data size ≤1GB), and improves network throughput through HTTP / 2 protocol transmission.
[0135] Algorithm reasoning and processing:
[0136] Within the Conda environment of the Dockke container, BASE64 data is decoded into Tensor format (N×1024×1024×3). The optimized model inference interface (including the TensorRT acceleration engine) is then called, with single-image processing time ≤40ms. Detection results are post-processed using Soft-NMS to generate a JSON array containing defect categories and confidence scores.
[0137] Image detection algorithms are all uniformly encapsulated according to an interface protocol for unified invocation. The specific user protocol is shown in the figure. The detection type can be a single detection of a specific type, such as nest or tower, or a batch detection. Image detection algorithms are encapsulated into single detection and batch detection according to the interface protocol. Single detection detects one image at a time and returns a single result, while batch detection detects multiple images at a time and returns a list of multiple results.
[0138] As described above, the embodiments of the present invention enable specialized training and service-oriented deployment of an online power grid inspection network using a container-based automated detection method for power transmission line defects.
[0139] Example 2:
[0140] Experiment setup details
[0141] This invention uses a self-constructed dataset of visual circuit defect images taken by drones in outdoor scenes. This dataset contains 9838 basic images of five classic power grid defects, supplemented with 1780 additional images that have been collected and annotated with specializations. Data augmentation was achieved through rotation, scaling, copying, and artificial lighting simulation.
[0142] The experimental software environment configuration used in this embodiment of the invention is as follows: the operating system is Ubuntu 20.04; the GPU is NVIDIA GeForce RTX 3090 (24GB VRAM); in the deep learning framework, PyTorch version 1.13.1, CUDA version 11.7, and cuDNN version 8.6.0 are used.
[0143] The specific experimental setup for this embodiment of the invention is as follows: Based on a self-constructed power grid defect target detection dataset, the total number of training epochs is 300; the batch size is 16; the SGD (Stochastic Gradient Descent) optimizer is used, with momentum set to 0.937 and weight decay set to 0.0005; the initial learning rate is 0.01, a cosine annealing scheduling strategy is adopted, and a linear learning rate warm-up of 3 epochs is set, with the final learning rate decaying to 0.0001. The input image size is uniformly adjusted to 640×640. The model detection output results are as follows. Figure 2 As shown, the F1 score and mAP were ultimately used as the main evaluation metrics in the validation phase, such as... Figure 3 As shown.
[0144] ablation experiment
[0145] In the ablation experiments, to verify the effectiveness of the specific dataset and multi-scale grouped deconvolutional detection network model constructed in this invention, the specific dataset and multi-scale grouped deconvolutional structure were removed from the network training process of the proposed method. Finally, a normal dataset and a conventional upsampling network were used for the ablation experiments. The quantitative comparison results are shown in Table 1:
[0146] Ablation test results Class F1 score map Normal dataset + original network 0.71 0.724 Data augmentation + original network 0.739 0.735 Normal dataset + improved network 0.743 0.736 Data augmentation + improved network 0.75 0.747
[0147] As shown, with the addition of specific datasets and multi-scale grouped deconvolution methods, the detection model exhibits significant performance improvements in both accuracy and robustness.
[0148] in conclusion
[0149] In summary, this invention proposes an automated transmission line defect detection method based on container technology. This method constructs a targeted, specialized dataset and proposes a grouped upsampling network architecture. The basic process involves specialized dataset construction, grouped upsampling network construction and training, iterative training and dataset optimization, and service-oriented encapsulation, thereby achieving high-precision, specialized field power grid inspection by online drones. First, the high-quality dataset construction and detection algorithm optimization for specific power grid inspection scenarios provided by this invention offer a data foundation and model basis for the accurate identification of minor defects in transmission lines. Second, the improved grouped upsampling mechanism effectively enhances the feature extraction capability for small targets and reduces computational costs. Finally, the invention, combined with a containerized deployment scheme, achieves standardized algorithm reuse and high-concurrency processing. Training and testing on a self-constructed specialized dataset, experiments verify that the proposed container-based automated transmission line defect detection method significantly improves identification accuracy and detection speed while consuming less memory. The technical approach provided by this invention can offer universally applicable methods for the architecture design of automated inspection systems in complex field environments and the application development of deep learning components.
[0150] It will be readily understood by those skilled in the art that, without conflict, the above-mentioned preferred solutions can be freely combined and superimposed.
[0151] The above description, in conjunction with specific preferred embodiments, provides a further detailed explanation of the present invention. It should not be construed that the specific implementation of the present invention is limited to these descriptions. For those skilled in the art, various simple deductions or substitutions can be made without departing from the concept of the present invention, and all such modifications and substitutions should be considered within the scope of protection of the present invention.
Claims
1. An automated defect detection method for transmission lines based on container technology, characterized in that, Includes the following steps: Step S1: Acquire multi-view inspection images of the target scene from the perspective of a drone. The drone maintains an altitude of 5-20 meters from the target and is numbered according to the line segment to form an initial unlabeled dataset. Input the original images into the image preprocessing framework and normalize them. Input the normalized images into the deblurring network and convolutional neural network in sequence to obtain deblurred and distortion-reduced preprocessed images. Then, apply data augmentation strategies to the preprocessed images and perform refined external defect annotation to obtain a labeled dataset. Use label optimization methods and loss functions to adjust the sample class distribution to obtain the initial pre-training dataset. Step S2: By adding a convolutional dimensionality reduction strategy before the feature extraction network, the number of channels in the multi-scale feature map is compressed, and a grouped deconvolution method is adopted to achieve parallel upsampling of feature depth in the channel dimension; this enhances the feature extraction capability of small targets while reducing computational costs, thereby constructing a multi-scale grouped deconvolutional detection network model for outdoor power defect identification, realizing the defect-specific identification process of target images; using the dataset in Step S1, the model is trained specifically to obtain detection results containing confidence and defect category; network performance is tested and evaluated based on the detection results; Step S3: For the missing or false detection samples in specific complex field scenes that cause poor model performance, trigger additional manual re-capture instructions and data increment supplementation instructions through active learning strategies, perform targeted re-labeling and denoising processing, and achieve corresponding data increment supplementation; ultimately achieve dataset augmentation and reconstruction through the above methods; repeat the network training process of step S2 until the evaluation results meet the target requirements; Step S4: Based on the network training results in Step S3, encapsulate the model code and weight files into service interfaces, build a microservice architecture, construct a runtime environment based on container technology and define a base image, integrate the virtual environment, and realize the standardized encapsulation of the model runtime environment; construct an asynchronous service listening module to realize service-oriented encapsulation, realize the standardized reuse of the model and high-concurrency processing, and constitute a UAV real-time automated detection system for power transmission line defects.
2. The automated defect detection method for transmission lines based on container technology according to claim 1, characterized in that: The refined external defect annotation and data augmentation strategy described in step S1 is based on the original defect image data. It constructs a target constraint matrix and enhances specific factors using a geometric parameter library of insulators. This results in: a target copy-paste algorithm that automatically verifies the minimum spacing and angle compatibility between targets during pasting, avoiding manual annotation errors, and a multi-view transformation algorithm. The multi-view transformation algorithm includes flipping, rotation, and affine transformation methods. Furthermore, a multi-dimensional lighting simulation system is constructed to address specific factors of outdoor lighting interference, including dynamic modeling of point light sources, global lighting attenuation simulation, directional lighting modeling, and light and shadow consistency constraints. Dynamic modeling of point light sources A Gaussian spot superposition model is used to simulate local strong light interference: in, In the original image Based on this, the output result is superimposed with n Gaussian light spots modulated, where n is the number of point light sources. G is a two-dimensional rotationally symmetric Gaussian kernel function. The intensity coefficient of the k-th light source , The coordinates of the light source center are Let be the standard deviation of the k-th light spot. An adaptive algorithm is used to dynamically adjust this deviation, enabling diverse control over the light spot size and blur level. ; Global Illumination Attenuation Simulation An ambient light model based on distance attenuation is introduced to simulate the light attenuation effect caused by atmospheric scattering: in, The initial light intensity, Let be the Euclidean distance from the pixel to the light source. This is the attenuation constant, with a value ranging from 50 to 200 pixels. This is the ambient light compensation value, ranging from 0.1 to 0.3 times the original brightness; Directional lighting modeling To address the changing perspective of drone inspections, a directional light source simulation was added, using the incident angle of the light. and azimuth Parameterize the illumination direction and calculate the surface illuminance using the Lambertian reflection model: in, Intensity of solar light source, The angle between the light source and the surface normal, with an angle range of... , Let be the azimuth angle of the light source in the image plane, with an angle range of . By randomly generating angle parameters to change the normal angle and azimuth angle, the illumination conditions at different times can be simulated. Light and shadow consistency constraints When adding lighting interference, corresponding shadow areas are generated simultaneously, and a projection mask matching the target shape is generated through morphological operations. ,accomplish: in, This is the shadow attenuation coefficient, with a value ranging from 0.3 to 0.7, ensuring the physical consistency between lighting and shadows and improving the visual realism of the dataset; The above-mentioned multi-model fusion lighting simulation method can generate complex lighting scenes that include strong light spots, global attenuation, directional changes and realistic shadows, effectively covering extreme lighting conditions such as backlighting, sidelighting and cloud scattering that may be encountered in field inspections, and improving the lighting diversity of the dataset and the generalization ability of the model.
3. The automated defect detection method for transmission lines based on container technology according to claim 1, characterized in that: The multi-scale grouped deconvolutional detection network model for outdoor power defect identification described in step S2 employs a deep feature reconstruction method that preserves small target details through grouped deconvolutional upsampling. The process is as follows: First, a lightweight feature transformation module is introduced into the first two layers of the feature extraction network to reduce the dimensionality of the features, thereby optimizing computation and extracting compact features from the input feature map. Perform a linear transformation, where H represents the height of the feature map and W represents the width of the feature map, projecting it into a low-dimensional space: in, The projection weight matrix is... For bias terms, and It is the number of input channels and the number of output channels and Dimensionality reduction ratio As a hyperparameter, it is used to control the balance between the degree of information compression and computational complexity; The dimensionality-reduced features are then represented by a nonlinear activation function and renormalized as follows: Here, This indicates a normalization operation. Use the LeakyReLU activation function; Secondly, by dividing the input feature map channel dimensions There are a total of g independent groups, where C is the number of channels and g is the number of groups. This represents the number of channels in each group. Each group is deconvolved separately, and the final results are fused to achieve high-resolution feature map reconstruction of small target regions. in, For the deconvolution results of each group, Let g represent the deconvolution operation of the g-th group. The deconvolution operations of different groups are mathematically identical, but their parameters differ. It is independently learnable. Let be the input feature map to be sampled, and s be the upsampling target scale factor. Let g be the learnable parameters of the g-th deconvolutional layer. For the final feature map, a fusion function is used. The results from each group were combined.
4. The automated defect detection method for transmission lines based on container technology according to claim 1, characterized in that: In step S4, the network weights and model files generated in steps S2 to S3 are encapsulated into service interfaces; based on the microservice architecture design, container technology is used to build and define a standardized base image, integrate the virtual environment required for model operation, and realize the standardized encapsulation and isolation of the detection model's operating environment; An asynchronous service listening and calling module is constructed to realize the service-oriented encapsulation of the detection function, thereby integrating and forming a complete UAV real-time automated detection system for power line defects.