Insulator defect detection method based on end-to-end algorithm
1. The method for detecting the insulator defects based on the end-to-end algorithm is characterized by comprising the following steps of:
s1: constructing an insulator image set;
s2: expanding the image set by an image preprocessing method;
s3: labeling the expanded image set;
s4: respectively training a first detection algorithm and a second detection algorithm by using the image set;
s5: and acquiring an insulator image to be detected, detecting the insulator image to be detected by using the trained first detection algorithm and the trained second detection algorithm, and acquiring a detection result.
2. The method for detecting insulator defects based on an end-to-end algorithm according to claim 1, wherein the step S5 specifically comprises:
s51: acquiring an insulator image to be detected, detecting the insulator image to be detected by using a trained first detection algorithm, and acquiring a first detection result;
s52: detecting the insulator image to be detected by using a trained second detection algorithm to obtain a second detection result;
s53: and combining the first detection result and the second detection result to obtain a defect detection result.
3. The method for insulator defect detection based on end-to-end algorithm as claimed in claim 2, wherein said first detection algorithm is YOLOv1 network, and said second detection algorithm is SSD network.
4. The method for insulator defect inspection based on end-to-end algorithm as claimed in claim 3, wherein the step S5 of identifying the insulator image to be inspected by using YOLOv1 network comprises the following steps:
s511: adjusting 448 x 448 of the insulator image to be detected as the input of the network;
s512: operating the neural network to obtain the coordinate position of the candidate frame, the confidence coefficient of the object and 20 class probabilities;
s513: and (5) performing non-maximum value inhibition, and screening candidate frames of the insulator images which do not meet the requirements.
5. The method for detecting insulator defects based on an end-to-end algorithm according to claim 4, wherein the step S512 specifically includes:
inputting the adjusted insulator image in the YOLOv1 network to perform mesh segmentation on the image, wherein each mesh is responsible for detecting an object type, and each neural mesh also calculates a confidence score in a bounding box, and the calculation formula is as follows:
where confidence is the confidence, Pr (object) is the probability of the object in the image processing object,the cross-over ratio is used.
6. The method for insulator defect detection based on the end-to-end algorithm according to claim 3, wherein the setting rule of the prior frame of the SSD network is as follows:
wherein m is a characteristic diagram quantity, skIs the proportion of the prior frame in the picture, smaxAnd sminThe maximum value and the minimum value of the proportion of the prior frame in the picture are respectively.
7. The method for insulator defect detection based on the end-to-end algorithm as claimed in claim 6, wherein the width and height formula of the prior frame of the SSD network is as follows:
wherein the content of the first and second substances,is the width of the box a priori,is the height of the prior frame, arAre proportional values.
8. The method for insulator defect detection based on end-to-end algorithm as claimed in claim 1, wherein said set of insulator images comprises normal insulator and infrared insulator, defect insulator and normal insulator.
9. The method for detecting insulator defects based on an end-to-end algorithm according to claim 1, wherein the step S2 specifically comprises:
s21, defogging the insulator image to obtain a clearer insulator image;
and S22, expanding the data set by randomly cutting, rotating, adjusting the chromaticity and adjusting the brightness of the defogged insulator image.
10. The method for detecting insulator defects based on an end-to-end algorithm according to claim 9, wherein the step S21 specifically includes:
obtaining dark channels in localized regions of insulator images
Wherein, JdarkIs a dark channel, Jc(y) is the tristimulus minimum, y is the filtered value, c is the channel, Ω (x) is the local window range, c ∈ { r, g, b } refers to the tristimulus primaries,
and solving the minimum value of RGB components of each pixel in the insulator image, storing the minimum value into a gray-scale image with the same size as the original image, and then carrying out minimum value filtering on the gray-scale image to finish defogging.
Background
The electric power system in China is composed of links such as power generation, power transmission, power transformation and power distribution, wherein the insulator is a very special insulating control in the power transmission line and is mainly responsible for fixing a current-carrying conductor and preventing current from flowing back to the ground, and plays a very important role in the electric power system, so that the detection of the insulator becomes a primary task for maintaining the safety of the electric power system.
In recent years, with the development of infrared technology and unmanned aerial vehicle technology, inspection departments utilize unmanned aerial vehicle mounted infrared equipment to detect insulators, the detection method does not need contact and is high in safety, however, data detected by the existing operating infrared technology need manual visual observation, judgment is carried out according to experience, efficiency is low, accuracy is low, and a large amount of manpower and material resources are wasted. With the development of a deep learning target detection technology, insulator infrared detection and image processing technologies are researched, and the infrared insulator detection and the deep learning technology are combined for detecting infrared insulator images of a power inspection department. Currently, there are 2 main target detection methods based on deep learning: (1) a candidate Region extraction (Region pro posal) based target detection method; (2) End-to-End (End-to-End) based target detection algorithms. The method based on candidate region extraction has great advantages in accuracy, but the method is very complex in calculation when extracting features, and cannot meet the real-time requirement on target detection in power system application.
Disclosure of Invention
The invention aims to overcome the defects of the prior art and provide a method for detecting the defects of the insulator based on an end-to-end algorithm.
The purpose of the invention can be realized by the following technical scheme:
a method for detecting insulator defects based on an end-to-end algorithm comprises the following steps:
s1: constructing an insulator image set;
s2: expanding the image set by an image preprocessing method;
s3: labeling the expanded image set;
s4: respectively training a first detection algorithm and a second detection algorithm by using the image set;
s5: and acquiring an insulator image to be detected, detecting the insulator image to be detected by using the trained first detection algorithm and the trained second detection algorithm, and acquiring a detection result.
Preferably, the step S5 specifically includes:
s51: acquiring an insulator image to be detected, detecting the insulator image to be detected by using a trained first detection algorithm, and acquiring a first detection result;
s52: detecting the insulator image to be detected by using a trained second detection algorithm to obtain a second detection result;
s53: and combining the first detection result and the second detection result to obtain a defect detection result.
Preferably, the first detection algorithm is YOLOv1 network, and the second detection algorithm is SSD network.
Preferably, when the insulating sub-images to be detected are identified by using the YOLOv1 network in the step S5, the method includes the following steps:
s511: adjusting 448 x 448 of the insulator image to be detected as the input of the network;
s512: operating the neural network to obtain the coordinate position of the candidate frame, the confidence coefficient of the object and 20 class probabilities;
s513: and (5) performing non-maximum value inhibition, and screening candidate frames of the insulator images which do not meet the requirements.
Preferably, the step S522 specifically includes:
inputting the adjusted insulator image in the YOLOv1 network to perform mesh segmentation on the image, wherein each mesh is responsible for detecting an object type, and each neural mesh also calculates a confidence score in a bounding box, and the calculation formula is as follows:
where confidence is the confidence, Pr (object) is the probability of the object in the image processing object,the cross-over ratio is used.
Preferably, the setting rule of the prior frame of the SSD network is:
wherein m is a characteristic diagram quantity, skIs the proportion of the prior frame in the picture, smaxAnd sminThe maximum value and the minimum value of the proportion of the prior frame in the picture are respectively.
Preferably, the width and height formula of the prior frame of the SSD network is:
wherein the content of the first and second substances,is the width of the box a priori,is the height of the prior frame, arAre proportional values.
Preferably, the insulator image set comprises a common insulator, an infrared insulator, a defect insulator and a normal insulator.
Preferably, the step S2 specifically includes:
s21, defogging the insulator image to obtain a clearer insulator image;
and S22, expanding the data set by randomly cutting, rotating, adjusting the chromaticity and adjusting the brightness of the defogged insulator image.
Preferably, the step S21 specifically includes:
obtaining dark channels in localized regions of insulator images
Wherein, JdarkIs a dark channel, Jc(y) is the tristimulus minimum, y is the filtered value, c is the channel, Ω (x) is the local window range, c ∈ { r, g, b } refers to the tristimulus primaries,
and solving the minimum value of RGB components of each pixel in the insulator image, storing the minimum value into a gray-scale image with the same size as the original image, and then carrying out minimum value filtering on the gray-scale image to finish defogging.
Compared with the prior art, the invention has the following advantages: the insulator image detection method based on the two detection algorithms detects the insulator image and outputs the combined result, can effectively identify and process the insulator image, improves the real-time property of detection and the detection speed, thereby meeting the real-time property requirement of a power system, can obtain clearer insulator image by preprocessing the insulator image, greatly reduces the workload of subsequent characteristic extraction by establishing a targeted image set, thereby improving the detection efficiency, further expands different insulator types of a data set by different processing of the image, and further ensures the accuracy of the detection result.
Drawings
FIG. 1 is a flow chart of the present invention.
Detailed Description
The invention is described in detail below with reference to the figures and specific embodiments. Note that the following description of the embodiments is merely a substantial example, and the present invention is not intended to be limited to the application or the use thereof, and is not limited to the following embodiments.
Examples
A method for detecting insulator defects based on an end-to-end algorithm comprises the following steps:
s1: and constructing an insulator image set, wherein the insulator image set comprises a common insulator, an infrared insulator, a defect insulator and a normal insulator.
The acquisition mode comprises the following steps: the insulator is aerial-photographed by an unmanned aerial vehicle, and various open source data sets on the network are utilized to be sorted and classified to obtain an effective insulator image.
S2: and expanding the image set by an image preprocessing method.
Step S2 specifically includes:
s21, defogging the insulator image to obtain a clearer insulator image:
obtaining dark channels in localized regions of insulator images
Wherein, JdarkIs a dark channel, Jc(y) is the tristimulus minimum, y is the filtered value, c is the channel, Ω (x) is the local window range, c ∈ { r, g, b } refers to the tristimulus primaries,
and (3) solving the minimum value of each pixel RGB component in the insulator image, storing the minimum value in a gray-scale image with the same Size as the original image, and then carrying out minimum value filtering on the gray-scale image to finish defogging, wherein the Radius of the filtering is determined by the Size of a Window, and generally, Window Size is 2 × Radius + 1.
And S22, expanding the data set by randomly cutting, rotating, adjusting the chromaticity and adjusting the brightness of the defogged insulator image.
S3: and labeling the expanded image set. And marking each image in the image set, wherein the non-defective insulator image is marked as a non-defective insulator, and the defective insulator is marked as a defective position.
S4: the first detection algorithm and the second detection algorithm are trained separately using the image sets. And (5) sending the image set into two algorithms to finish algorithm training.
In this embodiment, the first detection algorithm is the YOLOv1 network, and the second detection algorithm is the SSD network.
S5: and acquiring an insulator image to be detected, detecting the insulator image to be detected by using the trained first detection algorithm and the trained second detection algorithm, and acquiring a detection result.
The implementation platform of this embodiment is GPU, NVIDIA GeForce 820M; CPU, Intel Core i5-4200M, 2.50GHz/4.00 GB; the system comprises the following steps: windows10, implementing the language Python.
Step S5 specifically includes:
s51: acquiring an insulator image to be detected, detecting the insulator image to be detected by using a trained first detection algorithm, and acquiring a first detection result;
when the YOLOv1 network is used for identifying the insulator image to be detected, the method comprises the following steps:
s511: adjusting 448 x 448 of the insulator image to be detected as the input of the network;
s512: operating the neural network to obtain the coordinate position of the candidate frame, the confidence coefficient of the object and 20 class probabilities;
step S512 specifically includes:
inputting the adjusted insulator image in the YOLOv1 network to perform mesh segmentation on the image, wherein each mesh is responsible for detecting an object type, and each neural mesh also calculates a confidence score in a bounding box, and the calculation formula is as follows:
where confidence is the confidence, Pr (object) is the probability of the object in the image processing object,the cross-over ratio is used.
If there are no objects in the neural mesh that need to be identified, then the confidence in the mesh is 0. In addition, some degree of prediction is required in each mesh. I.e., the probability that the object to be identified belongs to that classification, given the identified object in the grid.
S513: and (5) performing non-maximum value inhibition, and screening candidate frames of the insulator images which do not meet the requirements.
Many prediction frames for the insulator are obtained by the method of S512, and these prediction frames are then deleted by the non-maximum suppression (NMS) method. The method comprises the steps of firstly, conducting ordered sorting on insulator images under a certain rule, and then selecting a frame with the highest score. Other prediction blocks are then identified, provided that the IOU of the current block with the largest score is greater than the parameter threshold given by the system. Then the box is deleted and the IOU value is set to 0.4; and finally, selecting a prediction box with the maximum score from the frames which are not detected all the time, continuing the process, and further selecting the prediction box with the maximum score, wherein the prediction box is the final output value.
S52: and detecting the insulator image to be detected by using a trained second detection algorithm to obtain a second detection result.
In step S52
Both SSD and YOLOv1 use one CNN to implement feature image detection, but SSD uses multi-scale feature maps. The SSD uses a feature map model of unequal scale during detection, which aims to achieve detection of small feature maps with larger feature maps, but the prior box for each cell is relatively small. While the number of cells of the 3 x 3 feature map is small, but the prior frame is large. Different feature maps are provided with different prior frame numbers, and the setting of the prior frames follows the following rules along with the reduction of the size of the feature maps. The setting rule of the prior frame of the SSD network is as follows:
wherein m is a characteristic diagram quantity, skIs the proportion of the prior frame in the picture, smaxAnd sminThe maximum and minimum values of the ratio of the prior frame to the picture are 0.9 and 0.2, respectively.
The width and height of the prior box of the SSD network is formulated as:
wherein the content of the first and second substances,is the width of the box a priori,is the height of the prior frame, arAre proportional values.
S53: and combining the first detection result and the second detection result to obtain a defect detection result.
In this embodiment, the first detection result is outputting a defect-free result or a defect position in the output image, the second detection result is outputting a defect-free result or a defect position in the output image, when both the two results are defect-free, the output detection result is defect-free, when only one result is a defect position, the defect position is output, and when both the two results are defect positions, the defect positions in the two results are merged into one image to be output.
The above embodiments are merely examples and do not limit the scope of the present invention. These embodiments may be implemented in other various manners, and various omissions, substitutions, and changes may be made without departing from the technical spirit of the present invention.
- 上一篇:石墨接头机器人自动装卡簧、装栓机
- 下一篇:一种基于卷积神经网络的焊点检测方法