Distribution line detection method based on deep learning
Through the power distribution line detection method based on deep learning, the drone collects multi-angle image data, and combines the EfficientDet and Transformer modules to build a detection model, solving the problems of low efficiency and limited accuracy of traditional detection methods, and achieving efficient and accurate real-time fault detection.
Patent Information
- Application Number
- CN202411682873.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-22
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2044-11-22
AI Technical Summary
Traditional distribution line detection methods are inefficient and have limited accuracy, making it difficult to achieve real-time monitoring, especially in complex environments, and it is difficult to meet the detection needs.
The power distribution line detection method based on deep learning is adopted to collect image data under multi-angle and multi-light conditions through drone equipment, and initial feature learning is performed using self-supervised learning and data augmentation technology. The detection model is constructed in combination with EfficientDet and Transformer modules, and the calculation overhead is reduced through model pruning and quantization technology.
It greatly improves the efficiency and accuracy of distribution line detection, can effectively deal with diverse environmental changes and equipment limitations, achieve real-time on-site fault detection and feedback, and maintain a good balance between accuracy and speed.
Smart Images

Figure CN119625570A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of power distribution line detection, and in particular to a power distribution line detection method based on deep learning. Background Art
[0002] In modern power systems, the stable operation of distribution lines is crucial to maintaining the reliability of power supply. However, due to factors such as natural disasters, man-made damage, and aging equipment, distribution lines are prone to failure. This not only threatens the continuity of power supply, but also may cause serious economic losses and safety hazards. Therefore, quickly and accurately detecting distribution line faults has become an important challenge facing the power industry.
[0003] Traditional distribution line detection methods mainly rely on manual inspections and regular maintenance, which have many shortcomings, such as low detection efficiency, limited accuracy, and difficulty in achieving real-time monitoring. In recent years, with the development of drone technology and image processing technology, image-based distribution line detection methods have gradually attracted attention. However, traditional image processing methods are sensitive to environmental changes and are difficult to meet the detection needs in complex scenarios. Summary of the invention
[0004] In order to solve the above problems, the purpose of the present invention is to provide a distribution line detection method based on deep learning, which can greatly improve the detection efficiency and accuracy, and can effectively cope with various environmental changes and equipment limitations.
[0005] To achieve the above object, the present invention adopts the following technical solutions:
[0006] A distribution line detection method based on deep learning includes the following steps:
[0007] S1: Collect normal and faulty images of distribution lines, use drone equipment to collect images from different perspectives and under different lighting conditions, and use data augmentation and synthesis techniques to expand the data set;
[0008] S2: Apply self-supervised learning methods on the expanded dataset for preliminary feature learning;
[0009] S3: Build a distribution line detection model based on EfficientDet and Transformer, as follows:
[0010] Use EfficientNet as the feature extraction backbone network, and use EfficientDet's efficient feature pyramid network BiFPN to process multi-scale features and enhance small target detection capabilities; BiFPN uses custom weighting and fusion technology to effectively fuse features of different scales. Given an input feature map {P1, P2, ..., P i′ ,...,Pn}, the updated feature map of BiFPN is:
[0011]
[0012] Among them, Conv represents the convolution operation; w i′ is the weight corresponding to the i′th input feature map;
[0013] EfficientDet uses three composite coefficients φ to automatically balance network depth, width, and input resolution:
[0014] r=r0·2 φ / 3 ;
[0015] d=d0·2 φ / 3 ;
[0016] e=e0+φ / / 3;
[0017] Where r is the input resolution of the network, r0 is the input resolution of the benchmark network; d is the width of the network, d0 is the width of the benchmark network; e is the depth of the network, e0 is the benchmark depth; / / indicates integer division;
[0018] By adjusting the composite coefficients in EfficientDet, the balance between accuracy and speed of the model is optimized. A Transformer module is added after the EfficientDet model to capture the complex spatial features and temporal information in the image. Transformer is used to improve the global consistency of detection and classification results.
[0019] S4: Train the distribution line detection model based on the training data set, use the One-Cycle Policy to adjust the learning rate, quickly enter the optimal learning stage and prevent overfitting, and use the Warmup strategy to optimize the learning process in the initial stage;
[0020] S5: Use model pruning and quantization techniques to reduce model overhead and obtain the final distribution line detection model;
[0021] S6 deploys the final distribution line detection model on drone equipment to achieve real-time fault detection and feedback on site.
[0022] Furthermore, S1 is specifically:
[0023] Use drones to collect data. Drones can flexibly change shooting angles to obtain images from different perspectives, including images of distribution lines in normal operation and images containing various fault forms;
[0024] The data set is enhanced using data augmentation techniques. Each time the data is augmented, the parameters of the geometric transformation (θ, α, tx, ty) and the parameters of the color transformation and noise addition are randomly selected.
[0025] Apply geometric transformation, color transformation and noise addition to the image using selected parameters;
[0026] Geometric transformations include:
[0027] Rotation: Randomly select a rotation angle θ, the formula is:
[0028] RotatedImage=[cos(θ)sin(θ)-sin(θ)cos(θ)]×OriginalImage;
[0029] Scaling: Scale the image at different ratios α:
[0030] ScaledImage=α×OriginalImage;
[0031] Translation: Random translation in the x and y axis directions;
[0032] Color transformation includes brightness adjustment and color dithering. Brightness adjustment is achieved by increasing or decreasing the intensity value of each pixel; color dithering is achieved by randomly changing the hue, saturation and contrast of the image.
[0033] Noise addition, by adding salt and pepper noise to the image to simulate various interference conditions;
[0034] Based on data synthesis technology, existing data are used to generate more simulated samples and expand the data set.
[0035] Furthermore, the data synthesis technology is used to generate more simulation samples using existing data, as follows: Use WGAN-GP to generate new distribution line scenarios:
[0036] WGAN-GP consists of a generator G and a discriminator D, which are trained through an adversarial process;
[0037] Generator G: receives a random noise vector z as input, consists of several deconvolution layers, batch normalization layers, and activation functions, and generates distribution line scenarios through learning;
[0038] Discriminator D: Distinguish between generated images and real images; input a real or generated image, pass the convolution layer, batch normalization is not used, use the activation function, and output is the true score of the input image.
[0039] Use adversarial loss to optimize the generator and discriminator:
[0040] Discriminator loss LD :
[0041]
[0042] Generator loss L G :
[0043]
[0044] Where x is from the real data distribution p data The image sampled from the generator; z is the random noise vector input to the generator; p z is the distribution of random noise vectors; G(z) is the image generated by the generator based on the input noise vector z; G(x) is the image generated by the generator based on the input x; D(x) and D(G(x)) are the scores of the discriminator output based on x and G(x) respectively;
[0045] Improve the training stability of WGAN by introducing gradient penalty:
[0046]
[0047] in, is the sample obtained from the linear interpolation of the real data x and the generated data G(z), λ is the gradient penalty coefficient; L GP is the gradient penalty term; ||·||2 is the L2 norm; ∈ is the random weight of;
[0048] For each round of training, a batch of real samples is sampled from the real data distribution and a batch of pseudo samples is generated;
[0049] Calculate the loss L of the discriminator D Perform gradient penalty and calculate L GP And add it to the loss; update the discriminator parameters;
[0050] Generate a new batch of pseudo samples and calculate the loss L of the generator G , update the generator parameters;
[0051] The training cycle is repeated until the desired optimization is achieved.
[0052] Furthermore, the quality of the generated images is checked regularly, and the quality and stability of the generated images are evaluated using the quantitative indicator FID, as follows:
[0053] Select a set of representative images from the real dataset and generate a set of images by sampling from the generative model;
[0054] The above images are input into the pre-trained Inception v3 model, and the pool layer of the pre-trained Inception v3 model is used to extract features from the real and generated images to obtain the feature vector set {f r}From the real image and {f g}Generate an image from it; and use the feature vector set to calculate the feature mean and covariance matrix:
[0055]
[0056] Among them, μ r is the mean of the feature distribution of the real image; μ g is the mean of the feature distribution of the generated image; Σ r is the covariance matrix of the feature distribution of the real image; Σ g is the covariance matrix of the feature distribution of the generated image; N is the number of samples involved in calculating the real features; M is the number of samples involved in calculating the generated features; f r,i represents the feature vector of the i-th real image after being processed in the Inception network pool layer; f g,i Represents the feature vector of the i-th generated image after being processed in the Inception network pool layer;
[0057] The FID score is calculated according to the following formula:
[0058] FID(r, g)=||μ r -μ g || 2 +Tr(∑ r +∑ g -2(∑ r ∑ g ) 1 / 2 );
[0059] Where Tr represents the trace of the matrix, that is, the sum of the diagonal elements of the matrix;
[0060] FID is calculated periodically at multiple stages of model training to monitor changes in the quality of generated images and the convergence of the model.
[0061] Furthermore, the distribution line detection model combines the comprehensive loss of EfficientDet and Transformer modules, with the goal of minimizing the position regression loss and category classification loss of the detection box at the same time, as follows:
[0062] The classification loss used in EfficientDet is Focal Loss:
[0063] L cls (p t )=-αt (1-p t ) γ log(p t );
[0064] Among them, p t is the probability that the model prediction at time t is consistent with the true label; α t is the class balance parameter, γ is the adjustment factor;
[0065] For regression loss, EfficientDet uses GIoU Loss:
[0066] L GIoU (B p ,B g )=1-GIoU(B p ,B g );
[0067] Among them, B p ,B g They are the predicted and true boxes respectively; GIoU measures the overlap and relative position of the two boxes;
[0068] When the Transformer module performs target detection, in order to ensure the accuracy and consistency of feature mapping, the KL divergence is used to quantify the distribution difference between the two feature maps to enhance the consistency of the Transformer output. The KL divergence loss is:
[0069]
[0070] Where p(i″) is the baseline distribution of pixel i″; Q(i″) is the distribution of pixel i″ after Transformer processing;
[0071] Combine the KL divergence loss with the classification loss and regression loss to form a comprehensive loss L:
[0072] L=λ cls ·L cls +λ GIoU ·L GIoU +λ KL ·L KL ;
[0073] Among them, λ cls , GIoU and λ KL They are the weight parameters corresponding to classification loss, regression loss and KL divergence loss respectively.
[0074] Furthermore, the distribution line detection model is trained based on the training data set, and the One-Cycle Policy is used to adjust the learning rate, quickly enter the optimal learning stage and prevent overfitting, and the Warmup strategy is used to optimize the learning process in the initial stage, as follows:
[0075] Set the initial learning rate η star , the minimum learning rate η min , the maximum learning rate η max , and the final learning rate η final ; Configure the number of Warmup steps t warmup ; Configure the One-Cycle Policy period, including increasing the number of steps t up and reduce the number of steps t down ;
[0076] When training starts, at time 0≤t≤t warnup Use the Warmup strategy to gradually increase the learning rate:
[0077]
[0078] Then switch to One-Cycle Policy to dynamically adjust the learning rate, including the rising stage and the falling stage. The rising stage is from the end of the Warmup policy to the peak value:
[0079]
[0080] The decline phase is from the peak to the end of the cycle
[0081]
[0082] Furthermore, model pruning and quantization techniques are used to reduce model overhead and obtain the final distribution line detection model, as follows:
[0083] Calculate the L1 norm of each layer weight of the distribution line detection model, sort the weights, and find the weights less than the threshold for pruning;
[0084] After pruning, fine-tune the model using a preset learning rate to recover the original performance loss. During the fine-tuning process, use the training dataset and monitor the performance of the model on the validation set.
[0085] Run the model by extracting a preset amount of data from the training data, obtain the dynamic range of the activation function and weights, and collect the maximum and minimum activation values of each layer; for each neural network parameter, calculate the scaling factor and zero point;
[0086] Based on the scaling factor and the zero point, the floating-point numbers are converted to 8-bit integers. In the inference phase, the integers are restored to floating-point numbers for calculation. The performance of the quantized model is verified based on the model's accuracy, recall, and F1 score.
[0087] A distribution line detection system based on deep learning includes a processor, a memory, and a computer program stored in the memory. When the processor executes the computer program, it specifically performs the steps in the distribution line detection method based on deep learning as described above.
[0088] The present invention has the following beneficial effects:
[0089] 1. The present invention can greatly improve the efficiency and accuracy of power distribution line detection, and can effectively cope with diverse environmental changes and equipment limitations;
[0090] 2. This invention combines the EfficientDet and Transformer modules to build a model that uses multi-scale features and complex semantic information to more effectively detect distribution lines, maintaining a good balance between accuracy and speed; and prunes and quantizes the model to significantly reduce its computing and storage requirements, thereby meeting the requirements for efficient deployment and operation in low-resource environments.
[0091] 3. The present invention combines the One-Cycle Policy with the warm start strategy, which can not only quickly achieve the ideal state of effective training, but also prevent the oscillation in the early stage of training and the overfitting problem in the later stage, effectively enhancing the performance of the model in the distribution line detection task. BRIEF DESCRIPTION OF THE DRAWINGS
[0092] Figure 1 The figure is a flow chart of the method of the present invention. DETAILED DESCRIPTION
[0093] The present invention is further described in detail below with reference to the accompanying drawings and specific embodiments:
[0094] A distribution line detection method based on deep learning includes the following steps:
[0095] S1: Collect normal and faulty images of distribution lines, use drone equipment to collect images from different perspectives and under different lighting conditions, and use data augmentation and synthesis techniques to expand the data set;
[0096] S2: Apply self-supervised learning methods on the expanded dataset for preliminary feature learning;
[0097] S3: Build a distribution line detection model based on EfficientDet and Transformer, as follows:
[0098] Use EfficientNet as the feature extraction backbone network, and use EfficientDet's efficient feature pyramid network BiFPN to process multi-scale features and enhance small target detection capabilities; BiFPN uses custom weighting and fusion technology to effectively fuse features of different scales. Given an input feature map {P1, P2, ..., P i′ ,...,P n}, the updated feature map of BiFPN is:
[0099]
[0100] Among them, Conv represents the convolution operation; w i′ is the weight corresponding to the i′th input feature map;
[0101] EfficientDet uses three composite coefficients φ to automatically balance network depth, width, and input resolution:
[0102] r=r0·2 φ / 3 ;
[0103] d=d0·2 φ / 3 ;
[0104] e=e0+φ / / 3;
[0105] Where r is the input resolution of the network, r0 is the input resolution of the benchmark network; d is the width of the network, d0 is the width of the benchmark network; e is the depth of the network, e0 is the benchmark depth; / / indicates integer division;
[0106] By adjusting the composite coefficients in EfficientDet, the balance between accuracy and speed of the model is optimized. A Transformer module is added after the EfficientDet model to capture the complex spatial features and temporal information in the image. Transformer is used to improve the global consistency of detection and classification results.
[0107] S4: Train the distribution line detection model based on the training data set, use the One-Cycle Policy to adjust the learning rate, quickly enter the optimal learning stage and prevent overfitting, and use the Warmup strategy to optimize the learning process in the initial stage;
[0108] S5: Use model pruning and quantization techniques to reduce model overhead and obtain the final distribution line detection model;
[0109] S6 deploys the final distribution line detection model on drone equipment to achieve real-time fault detection and feedback on site.
[0110] In this embodiment, S1 is specifically:
[0111] Use drones to collect data. Drones can flexibly change shooting angles to obtain images from different perspectives, including images of distribution lines in normal operation and images of various fault forms (such as broken wires, grounding, tower tilt, etc.);
[0112] The data set is enhanced using data augmentation techniques. Each time the data is augmented, the parameters of the geometric transformation (θ, α, tx, ty) and the parameters of the color transformation and noise addition are randomly selected.
[0113] Apply geometric transformation, color transformation and noise addition to the image using selected parameters;
[0114] Geometric transformations include:
[0115] Rotation: Randomly select a rotation angle θ, the formula is:
[0116] RotatedImage=[cos(θ)sin(θ)-sin(θ)cos(θ)]×OriginalImage;
[0117] Scaling: Scale the image at different ratios α:
[0118] ScaledImage=α×OriginalImage;
[0119] Translation: Random translation in the x and y axis directions;
[0120] Color transformation includes brightness adjustment and color dithering. Brightness adjustment is achieved by increasing or decreasing the intensity value of each pixel; color dithering is achieved by randomly changing the hue, saturation and contrast of the image.
[0121] Noise addition, by adding salt and pepper noise to the image to simulate various interference conditions;
[0122] Based on data synthesis technology, existing data are used to generate more simulated samples and expand the data set.
[0123] In this embodiment, existing data are used to generate more simulation samples based on data synthesis technology, as follows: WGAN-GP is used to generate a new distribution line scenario:
[0124] WGAN-GP consists of a generator G and a discriminator D, which are trained through an adversarial process;
[0125] Generator G: receives a random noise vector z as input and consists of several deconvolution layers (transposed convolution), batch normalization layers, and activation functions (such as ReLU). It generates realistic distribution line scenes through learning;
[0126] Discriminator D: Distinguish between generated images and real images; input a real or generated image, pass the convolution layer, batch normalization is not used, use the activation function, and output is the true score of the input image.
[0127] Use adversarial loss to optimize the generator and discriminator:
[0128] Discriminator loss L D :
[0129]
[0130] Generator loss L G :
[0131]
[0132] Where x is from the real data distribution p data The image sampled from the generator; z is the random noise vector input to the generator; p z is the distribution of random noise vectors; G(z) is the image generated by the generator based on the input noise vector z; G(x) is the image generated by the generator based on the input x; D(x) and D(G(x)) are the scores of the discriminator output based on x and G(x) respectively;
[0133] Improve the training stability of WGAN by introducing gradient penalty:
[0134]
[0135] in, is the sample obtained from the linear interpolation of the real data x and the generated data G(z), λ is the gradient penalty coefficient; L GP is the gradient penalty term; ||·||2 is the L2 norm; ∈ is the random weight of;
[0136] For each round of training, a batch of real samples is sampled from the real data distribution and a batch of pseudo samples is generated;
[0137] Calculate the loss L of the discriminator D Perform gradient penalty and calculate L GP And add it to the loss; update the discriminator parameters;
[0138] Generate a new batch of pseudo samples and calculate the loss L of the generator G , update the generator parameters;
[0139] The training cycle is repeated until the desired optimization is achieved.
[0140] In this embodiment, the quality of the generated images is checked regularly, and a quantitative index such as FID (Fréchet Inception Distance) is used to evaluate the quality and stability of the generated images, as follows:
[0141] Select a set of representative images from the real dataset and generate a set of images by sampling from the generative model;
[0142] The above images are input into the pre-trained Inception v3 model, and the pool layer of the pre-trained Inception v3 model is used to extract features from the real and generated images to obtain the feature vector set {f r}From the real image and {f g}Generate an image from it; and use the feature vector set to calculate the feature mean and covariance matrix:
[0143]
[0144] Among them, μ r is the mean of the feature distribution of the real image; μ g is the mean of the feature distribution of the generated image; Σ r is the covariance matrix of the feature distribution of the real image; Σ g is the covariance matrix of the feature distribution of the generated image; N is the number of samples involved in calculating the real features; M is the number of samples involved in calculating the generated features; f r,i represents the feature vector of the i-th real image after being processed in the Inception network pool layer; f g,i Represents the feature vector of the i-th generated image after being processed in the Inception network pool layer;
[0145] The FID score is calculated according to the following formula:
[0146] FID(r, g)=||μ r -μ g || 2 +Tr(∑ r +∑ g -2(∑ r ∑ g ) 1 / 2 );
[0147] Where Tr represents the trace of the matrix, that is, the sum of the diagonal elements of the matrix;
[0148] FID is calculated periodically at multiple stages of model training to monitor changes in the quality of generated images and the convergence of the model.
[0149] In this embodiment, the distribution line detection model combines the comprehensive loss of EfficientDet and Transformer modules, with the goal of minimizing the position regression loss and category classification loss of the detection box at the same time, as follows:
[0150] The classification loss used in EfficientDet is Focal Loss:
[0151] L cls (p t )=-α t (1-p t ) γ log(p t );
[0152] Among them, p t is the probability that the model prediction at time t is consistent with the true label; α t is the class balance parameter, γ is the adjustment factor;
[0153] For regression loss, EfficientDet uses GIoU Loss:
[0154] L GIoU (B p ,B g )=1-GIoU(B p ,B g );
[0155] Among them, B p ,B g They are the predicted and true boxes respectively; GIoU measures the overlap and relative position of the two boxes;
[0156] When the Transformer module performs target detection, in order to ensure the accuracy and consistency of feature mapping, the KL divergence is used to quantify the distribution difference between the two feature maps to enhance the consistency of the Transformer output. The KL divergence loss is:
[0157]
[0158] Where p(i″) is the baseline distribution of pixel i″; Q(i″) is the distribution of pixel i″ after Transformer processing;
[0159] Combine the KL divergence loss with the classification loss and regression loss to form a comprehensive loss L:
[0160] L=λ cls ·L cls +λ GIoU ·L GIoU +λ KL ·LKL ;
[0161] Among them, λ cls , GIoU and λ KL They are the weight parameters corresponding to classification loss, regression loss and KL divergence loss respectively.
[0162] In this embodiment, the distribution line detection model is trained based on the training data set, and the One-CyclePolicy is used to adjust the learning rate, quickly enter the optimal learning stage and prevent overfitting, and the Warmup strategy is used to optimize the learning process in the initial stage, as follows:
[0163] Set the initial learning rate η star , the minimum learning rate η min , the maximum learning rate η max , and the final learning rate η final ; Configure the number of Warmup steps t warmup ; Configure the One-Cycle Policy period, including increasing the number of steps t up and reduce the number of steps t down ;
[0164] When training starts, at time 0≤t≤t warnup Use the Warmup strategy to gradually increase the learning rate:
[0165]
[0166] Then switch to One-Cycle Policy to dynamically adjust the learning rate, including the rising stage and the falling stage. The rising stage is from the end of the Warmup policy to the peak value:
[0167]
[0168] The decline phase is from the peak to the end of the cycle
[0169]
[0170] In this embodiment, model pruning and quantization techniques are used to reduce model overhead and obtain the final distribution line detection model, which is as follows:
[0171] Calculate the L1 norm of each layer weight of the distribution line detection model, sort the weights, and find the weights less than the threshold for pruning;
[0172] After pruning, fine-tune the model using a preset learning rate to recover the original performance loss. During the fine-tuning process, use the training dataset and monitor the performance of the model on the validation set.
[0173] Run the model by extracting a preset amount of data from the training data, obtain the dynamic range of the activation function and weights, and collect the maximum and minimum activation values of each layer; for each neural network parameter, calculate the scaling factor and zero point;
[0174] Based on the scaling factor and the zero point, the floating-point numbers are converted to 8-bit integers. In the inference phase, the integers are restored to floating-point numbers for calculation. The performance of the quantized model is verified based on the model's accuracy, recall, and F1 score.
[0175] In this embodiment, a distribution line detection system based on deep learning is also provided, including a processor, a memory, and a computer program stored in the memory. When the processor executes the computer program, it specifically executes the steps in the distribution line detection method based on deep learning as described above.
[0176] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0177] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0178] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0179] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0180] The above is only a preferred embodiment of the present invention, and does not limit the present invention in other forms. Any technician familiar with the profession may use the above disclosed technical content to change or modify it into an equivalent embodiment with equivalent changes. However, any simple modification, equivalent change and modification made to the above embodiment according to the technical essence of the present invention without departing from the technical solution of the present invention still belongs to the protection scope of the technical solution of the present invention.
Claims
1. A distribution line detection method based on deep learning, characterized in that: The following steps are involved: S1: Collect normal and faulty images of distribution lines, use drone equipment to collect images from different perspectives and under different lighting conditions, and use data augmentation and synthesis techniques to expand the data set; S2: Apply self-supervised learning methods on the expanded dataset for preliminary feature learning; S3: Build a distribution line detection model based on EfficientDet and Transformer, as follows: Use EfficientNet as the feature extraction backbone network, and use EfficientDet's efficient feature pyramid network BiFPN to process multi-scale features and enhance small target detection capabilities; BiFPN uses custom weighting and fusion technology to effectively fuse features of different scales. Given an input feature map {P1, P2, ..., P i′ ,...,P n }, the updated feature map of BiFPN is: Among them, Conv represents the convolution operation; w i′ is the weight corresponding to the i′th input feature map; EfficientDet uses three composite coefficients φ to automatically balance network depth, width, and input resolution: r=r0·2 φ / 3 ; d=d0·2 φ / 3 ; e=e0+φ / / 3; Where r is the input resolution of the network, r0 is the input resolution of the benchmark network; d is the width of the network, d0 is the width of the benchmark network; e is the depth of the network, e0 is the benchmark depth; / / indicates integer division; By adjusting the composite coefficients in EfficientDet, the balance between accuracy and speed of the model is optimized. A Transformer module is added after the EfficientDet model to capture the complex spatial features and temporal information in the image. Transformer is used to improve the global consistency of detection and classification results. S4: Train the distribution line detection model based on the training data set, use the One-Cycle Policy to adjust the learning rate, quickly enter the optimal learning stage and prevent overfitting, and use the Warmup strategy to optimize the learning process in the initial stage; S5: Use model pruning and quantization techniques to reduce model overhead and obtain the final distribution line detection model; S6 deploys the final distribution line detection model on drone equipment to achieve real-time fault detection and feedback on site.
2. A power distribution line detection method based on deep learning according to claim 1, characterized in that: The S1 is specifically: Use drones to collect data. Drones can flexibly change shooting angles to obtain images from different perspectives, including images of distribution lines in normal operation and images containing various fault forms; The data set is enhanced using data augmentation techniques. Each time the data is augmented, the parameters of the geometric transformation (θ, α, tx, ty) and the parameters of the color transformation and noise addition are randomly selected. Apply geometric transformation, color transformation and noise addition to the image using selected parameters; Geometric transformations include: Rotation: Randomly select a rotation angle θ, the formula is: RotatedImage=[cos(θ)sin(θ)-sin(θ)cos(θ)]×OriginalImage; Scaling: Scale the image at different ratios α: ScaledImage=α×OriginalImage; Translation: Random translation in the x and y axis directions; Color transformation includes brightness adjustment and color dithering. Brightness adjustment is achieved by increasing or decreasing the intensity value of each pixel; color dithering is achieved by randomly changing the hue, saturation and contrast of the image. Noise addition, by adding salt and pepper noise to the image to simulate various interference conditions; Based on data synthesis technology, existing data are used to generate more simulated samples and expand the data set.
3. A distribution line detection method based on deep learning according to claim 2, characterized in that: The data synthesis technology uses existing data to generate more simulation samples, as follows: Use WGAN-GP to generate new distribution line scenarios: WGAN-GP consists of a generator G and a discriminator D, which are trained through an adversarial process; Generator G: receives a random noise vector z as input, consists of several deconvolution layers, batch normalization layers, and activation functions, and generates distribution line scenarios through learning; Discriminator D: distinguishes between generated images and real images; Input is a real or generated image, passed through a convolutional layer, batch normalization is not used, an activation function is used, and the output is a true score for the input image. Use adversarial loss to optimize the generator and discriminator: Discriminator loss L D : Generator loss L G : Where x is from the real data distribution p data The image sampled from the generator; z is the random noise vector input to the generator; p z is the distribution of random noise vectors; G(z) is the image generated by the generator based on the input noise vector z; G(x) is the image generated by the generator based on the input x; D(x) and D(G(x)) are the scores of the discriminator output based on x and G(x) respectively; Improve the training stability of WGAN by introducing gradient penalty: in, is the sample obtained from the linear interpolation of the real data x and the generated data G(z), λ is the gradient penalty coefficient; L GP is the gradient penalty term; ||.||2 is the L2 norm; ∈ is the random weight of; For each round of training, a batch of real samples is sampled from the real data distribution and a batch of pseudo samples is generated; Calculate the loss L of the discriminator D Perform gradient penalty and calculate L GP And add it to the loss; update the discriminator parameters; Generate a new batch of pseudo samples and calculate the loss L of the generator G , update the generator parameters; The training cycle is repeated until the desired optimization is achieved.
4. A distribution line detection method based on deep learning according to claim 3, characterized in that: The quality of the generated images is checked regularly, and the quantitative indicator FID is used to evaluate the quality and stability of the generated images, as follows: Select a set of representative images from the real dataset and generate a set of images by sampling from the generative model; The above images are input into the pre-trained Inception v3 model, and the pool layer of the pre-trained Inception v3 model is used to extract features from the real and generated images to obtain the feature vector set {f r }From the real image and {f g }Generate an image from it; and use the feature vector set to calculate the feature mean and covariance matrix: Among them, μ r is the mean of the feature distribution of the real image; μ g is the mean of the feature distribution of the generated image; Σ r is the covariance matrix of the feature distribution of the real image; Σ g is the covariance matrix of the feature distribution of the generated image; N is the number of samples involved in calculating the real features; M is the number of samples involved in calculating the generated features; f r,i represents the feature vector of the i-th real image after being processed in the Inception network pool layer; f g,i Represents the feature vector of the i-th generated image after being processed in the Inception network pool layer; The FID score is calculated according to the following formula: FID(r,g)=||μ r -m g || 2 +Tr(∑ r +∑ g –2(∑ r ∑ g ) 1 / / 2 ); Where Tr represents the trace of the matrix, that is, the sum of the diagonal elements of the matrix; FID is calculated periodically at multiple stages of model training to monitor changes in the quality of generated images and the convergence of the model.
5. A distribution line detection method based on deep learning according to claim 4, characterized in that: The distribution line detection model combines the comprehensive loss of EfficientDet and Transformer modules, with the goal of minimizing the position regression loss and category classification loss of the detection box at the same time, as follows: The classification loss used in EfficientDet is Focal Loss: L cls (p t )=-a t (1-p t ) γ log(p t ); Among them, p t is the probability that the model prediction at time t is consistent with the true label; α t is the class balance parameter, γ is the adjustment factor; For regression loss, EfficientDet uses GIoU Loss: L GIoU (B p ,B g )=1-GIoU(B p ,B g ); Among them, B p ,B g They are the predicted and true boxes respectively; GIoU measures the overlap and relative position of the two boxes; When the Transformer module performs target detection, in order to ensure the accuracy and consistency of feature mapping, the KL divergence is used to quantify the distribution difference between the two feature maps to enhance the consistency of the Transformer output. The KL divergence loss is: Where p(i″) is the baseline distribution of pixel i″; Q(i″) is the distribution of pixel i″ after Transformer processing; Combine the KL divergence loss with the classification loss and regression loss to form a comprehensive loss L: L=λ cls ·L cls +λ GIoU ·L GIoU +λ KL ·L KL ; Among them, λ cls , GIoU and λ KL They are the weight parameters corresponding to classification loss, regression loss and KL divergence loss respectively.
6. A distribution line detection method based on deep learning according to claim 5, characterized in that: The distribution line detection model is trained based on the training data set. The One-CyclePolicy is used to adjust the learning rate, quickly enter the optimal learning stage and prevent overfitting, and the Warmup strategy is used to optimize the initial learning process. The details are as follows: Set the initial learning rate η star , the minimum learning rate η min , the maximum learning rate η max , and the final learning rate η final ; Configure the number of Warmup steps t warmup ; Configure the One-Cycle Policy period, including increasing the number of steps t up and reduce the number of steps t down ; When training starts, at time 0≤t≤t warnup Use the Warmup strategy to gradually increase the learning rate: Then switch to One-Cycle Policy to dynamically adjust the learning rate, including the rising stage and the falling stage. The rising stage is from the end of the Warmup policy to the peak value: The decline phase is from the peak to the end of the cycle 7. A power distribution line detection method based on deep learning according to claim 1, characterized in that: The model pruning and quantization technology is used to reduce the model overhead and obtain the final distribution line detection model, which is as follows: Calculate the L1 norm of each layer weight of the distribution line detection model, sort the weights, and find the weights less than the threshold for pruning; After pruning, fine-tune the model using a preset learning rate to recover the original performance loss. During the fine-tuning process, use the training dataset and monitor the performance of the model on the validation set. Extract a preset amount of data from the training data to run the model, obtain the dynamic range of the activation function and weight, and collect the maximum and minimum activation values of each layer; For each neural network parameter, calculate the scaling factor and zero point; Based on the scaling factor and the zero point, the floating-point numbers are converted to 8-bit integers. In the inference phase, the integers are restored to floating-point numbers for calculation. The performance of the quantized model is verified based on the model's accuracy, recall, and F1 score.
8. A distribution line detection system based on deep learning, characterized in that: It includes a processor, a memory, and a computer program stored in the memory. When the processor executes the computer program, it specifically performs the steps in a distribution line detection method based on deep learning as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Distribution line nest fault identification method based on RVI-BNN
CN113903032A
Data processing detection method and data training method for small target in complex scene
CN116152580A
Power distribution network defect on-site intelligent identification method and device based on unmanned aerial vehicle system
CN117636186A
Power transmission line intelligent inspection method based on image recognition and deep learning technology
CN118691795A
Defect detection in image space
US20230014823A1