A photovoltaic panel defect detection method based on visible light and infrared vision
By installing visible light and infrared cameras on the photovoltaic cleaning robot, combined with the improved YOLOv3 deep learning algorithm and adaptive minimum threshold segmentation method, the problem of low efficiency and low accuracy of hot spot detection in photovoltaic power stations is solved, and efficient and accurate defect detection is achieved Detection and automated cleaning.
Patent Information
- Application Number
- CN202210209242.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-03
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2042-03-03
AI Technical Summary
Existing hot spot detection methods for photovoltaic power plants have problems such as high labor consumption, low detection efficiency, and low accuracy. Moreover, traditional methods are not suitable for automated cleaning and reporting.
The deep learning algorithm based on visible light and infrared vision is combined with the adaptive minimum threshold segmentation method. Through the visible light and infrared cameras installed on the photovoltaic cleaning robot, the improved YOLOv3 deep learning algorithm is used to detect surface stains and infrared images to detect hot spot effect areas.
It achieves high-accuracy and efficient photovoltaic panel defect detection, can discover and clean or report defect locations in real time, and is suitable for detection in various environments.
Smart Images

Figure CN114612406B
Abstract
Description
Technical Field
[0001] The invention relates to a photovoltaic panel defect detection method, and in particular to a photovoltaic panel defect detection method based on visible light and infrared vision. Background Art
[0002] my country has a vast territory and extremely rich solar energy resources that can be developed and utilized. There are a large number of photovoltaic power plants distributed throughout the country. However, photovoltaic power plants are directly exposed to the natural environment. After long-term use of photovoltaic panels, a large amount of dust will accumulate on the surface glass, affecting the light transmittance of photovoltaic panels. In addition, due to the partial coverage of photovoltaic panels by plant leaves, bird and insect excrement, it is easy to cause the photovoltaic panels to be damaged due to the "hot spot effect" causing local overtemperature. Therefore, the cleaning and maintenance of photovoltaic panels has become a very important link in the photovoltaic power generation industry.
[0003] At present, the hot spot detection work of photovoltaic power stations mainly faces two difficulties: on the one hand, due to the large area of photovoltaic power stations, regular hot spot detection of photovoltaic arrays will consume a lot of manpower and material resources, which will significantly increase the operation and maintenance costs of photovoltaic power stations; on the other hand, traditional hot spot detection work is mainly completed by manually holding up infrared thermal imagers or using lifting vehicles to check point by point, which has low detection efficiency, high risk factor and low accuracy. Therefore, it is of great practical significance to design a high-accuracy and efficient hot spot detection method.
[0004] Invention 202010298498.X discloses a method for detecting hot spots on photovoltaic panels, constructs an experimental platform, and detects whether there are hot spots on photovoltaic panels based on experimental data, experimental images, measured data, and measured images. However, this invention focuses on detecting the presence of hot spots on photovoltaic panels with different degrees of dirtiness, and is not of great value in practical applications. Invention 202010740350.7 discloses a method and system for locating hot spots on photovoltaic panels, processes infrared images of photovoltaic panels, and determines whether infrared images of each grid of photovoltaic panels contain hot spots. This invention uses the technology of using drones and cameras to capture images, which has high operation and maintenance costs, low image clarity, and a lot of interference, so it is not conducive to subsequent robot cleaning and reporting. Invention 202011605219.6 discloses a method for detecting hot spots on photovoltaic panels, including a data acquisition device, a detection device, a cleaning mechanism, a control console, etc., which detects whether hot spots exist by comparing the separately collected photovoltaic panel temperature and thermal imaging image. This invention mainly aims at detecting faults through infrared images, but does not combine visible light image information, and has limitations in locating stains. Summary of the invention
[0005] In view of the shortcomings of existing inventions such as lack of comprehensiveness and application limitations, the purpose of the present invention is to provide a vision-based photovoltaic panel defect detection method that can effectively detect defects such as stains and hot spot effect areas on the surface of photovoltaic panels.
[0006] The technical solution to achieve the purpose of the present invention is: through the visible light and infrared cameras installed on the photovoltaic cleaning robot, the photovoltaic panel images are acquired at the same time, and the algorithm designed in this patent is used to detect surface stains and internal hot spot effect areas. The detection of visible light images is based on the improved YOLOv3 deep learning algorithm, and the detection of infrared images is achieved by designing an adaptive minimum threshold segmentation algorithm to detect the hot spot effect area of the photovoltaic panel.
[0007] The detection of visible light images is based on the improved YOLOv3 deep learning algorithm, which includes the following main steps:
[0008] S1. Prepare a training dataset of defective images of photovoltaic panels and mark the defect points. If the number of original images is insufficient, you can use methods such as flipping, rotation, and grayscale to expand them. Then use LabelImg software to box the target in the image and name the label "stain".
[0009] S2. Improve the YOLOv3 deep learning network model. The specific steps are as follows:
[0010] (1) Configure the learning rate of the YOLOv3 network based on the adaptive learning rate method, that is, set a higher learning rate for the first m rounds at the beginning of training. After the training starts (m+2k) rounds, calculate the loss function once every k rounds; then compare the average loss function from the previous 2k rounds to the previous k rounds and from the previous k rounds to the current round, and automatically adjust the learning rate at this time. Among them, k refers to calculating the average loss function for k rounds, and m refers to not changing the learning rate for the first m rounds.
[0011] (2) The default anchor box size of YOLOv3 is calculated on the COCO dataset. Considering that the defect area of photovoltaic panels is small, the improved K-means clustering algorithm is used to calculate and generate the anchor box size adapted to this dataset. In other words, in order to avoid the error caused by the anchor box size, the Euclidean distance used in the traditional K-means clustering algorithm is changed to a custom distance d(box, centroid) = 1-IoU(box, centroid) to improve the accuracy of the detection results. In the formula, box is the anchor box, centroid is the cluster center, d(box, centroid) is the distance from the anchor box border to the cluster center, and IoU is the intersection of the anchor box and the cluster center, that is, the overlap between the predicted border area and the actual target area divided by the part of the set of these two areas.
[0012] (3) The SENet (Squeeze-and-Excitation Networks) structure is embedded into the Residual module of the YOLOv3 backbone feature extraction network DarkNet-53 to obtain the SE-Residual residual block, and the original Residual module is replaced by SE-Residual. In addition, SE attention modules are added to the output positions of the three backbone layers used for feature fusion to further obtain richer target features.
[0013] S3. Load the pre-trained model, parse the path from the .cfg file, load the pre-trained weights, and then start iterative training. The training requires adjusting the image size, and the image size is set to 416×416. After iterating the specified number of epochs, the trained model is saved.
[0014] S4. Use the trained model for detection. Load the trained model and input the image to be detected into the improved YOLOv3 network to obtain multiple detection boxes. Then use the non-maximum suppression method to filter the boxes, and get the box with the highest confidence as the final detection target output.
[0015] The detection of infrared images is achieved by designing an adaptive minimum threshold segmentation algorithm to detect the hot spot effect area of the photovoltaic panel, which specifically includes the following steps:
[0016] S1. Preprocess the input image based on the improved histogram non-uniform stretching method to improve the contrast of the infrared image; then perform median filtering to improve the image signal-to-noise ratio.
[0017] S2. Perform threshold-based image segmentation on the preprocessed image and propose an improved adaptive minimum threshold segmentation algorithm. That is, in order to adjust the balance relationship between the background and the target, a balance coefficient α is introduced into the adaptive minimum threshold segmentation algorithm, which can effectively segment out the hot spots.
[0018] Compared with the prior art, the present invention has the following remarkable effects:
[0019] (1) The ordinary camera module and the infrared camera module are organically combined with clear division of labor, which can effectively detect stains and damage on the surface of photovoltaic panels and internal faults that are not easy to detect with the naked eye;
[0020] (2) The present invention is applicable to real-time detection. After a defect is found, the cleaning robot can move to the defect location in real time to clean or report the defect.
[0021] (3) The improved algorithm provided by the present invention has relatively high detection efficiency and accuracy, and can be adapted to detection in various environments. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 This is a flow chart of the present invention using a deep learning method to detect defects.
[0023] Figure 2 This is a network structure diagram used for deep learning in the present invention. DETAILED DESCRIPTION
[0024] The algorithm in the present invention will be described clearly and in detail below with reference to the accompanying drawings in the embodiments of the present invention.
[0025] The present embodiment proposes a photovoltaic panel defect detection method based on visible light and infrared vision, comprising the steps of: simultaneously acquiring images of photovoltaic panels through visible light and infrared cameras installed on a photovoltaic cleaning robot, and using the algorithm designed in this patent to detect surface stains and internal hot spot effect areas. The detection of visible light images is based on an improved YOLOv3 deep learning algorithm, and the detection of infrared images is achieved by designing an adaptive minimum threshold segmentation algorithm to detect hot spot effect areas of photovoltaic panels.
[0026] The detection of visible light images is based on the improved YOLOv3 deep learning algorithm, as shown in the attached Figure 1 As shown, it includes the following main steps:
[0027] S1. Prepare a photovoltaic panel defect image training dataset and mark the defect locations.
[0028] The specific operation of step S1 is as follows:
[0029] (1) Since the number of images obtained is small, overfitting is likely to occur if neural network training is performed, so data enhancement is performed to improve the generalization and robustness of the model. Here, methods such as flipping, rotating, and graying the images are used to expand the data set, and ultimately 1420 images are obtained.
[0030] (2) Use LabelImg software to annotate the image. Use a box to mark the target to be detected and name the label "stain". The annotated file is in .xml format, which contains the image file name, file path, image size, target annotation name, and coordinates of the annotation box (with the upper left corner of the image as the coordinate origin).
[0031] (3) The data set is divided into training set and test set with a ratio of 8:2. The images are randomly generated and the image paths are recorded and saved in the train.txt and test.txt files respectively, so that the paths can be read and loaded for subsequent model training.
[0032] S2. Improve the YOLOv3 deep learning network model.
[0033] The specific operation of step S2 is as follows:
[0034] (1) Use an adaptive learning rate method to configure the learning rate of the YOLOv3 network. Set a higher learning rate when starting the first m rounds of training. After the training starts (m+2k) rounds, calculate the loss function once every k rounds, and then compare the average loss function from the previous 2k rounds to the previous k rounds and from the previous k rounds to the current round. At this time, the learning rate is automatically adjusted, where k refers to calculating the average loss function for k rounds, and m refers to not changing the learning rate for the first m rounds. When the loss function is corrected too much and the loss function value becomes larger, the learning rate needs to be reduced by a damping factor. Conversely, when the loss function value becomes smaller, the learning rate needs to be increased by an incremental factor. The adaptive learning rate method accelerates the convergence of the network training so that the desired goal can be achieved faster.
[0035] (2) The default anchor box size of YOLOv3 is calculated on the COCO dataset. Considering that the defect area of photovoltaic panels is small, the improved K-means clustering algorithm is used to calculate and generate the anchor box size adapted to this dataset. In order to avoid the error caused by the anchor box size, the Euclidean distance used in the traditional K-means clustering algorithm is changed to the custom distance d(box, centroid) = 1-IoU(box, centroid), so that the intersection-over-union ratio between the anchor box and the true box is larger and the distance is closer, so as to improve the accuracy of the detection result. In the formula, box is the anchor box, centroid is the cluster center, d(box, centroid) is the distance from the anchor box border to the cluster center, and IoU is the intersection-over-union ratio of the anchor box and the cluster center, that is, the overlapped part of the predicted border area and the actual target area divided by the part of the set of these two areas. The process of the improved anchor box clustering algorithm is as follows:
[0036] (I) For the original training set, the deep learning network generates a file including location and category, where each line contains the coordinates equivalent to the ground-truth box of the original image;
[0037] (II) Given k cluster centers (W j ,H j ),j∈{1,2,…,k}, where W j , H j are the width and height of the anchor box respectively;
[0038] (III) Calculate the distance d from each border to the cluster center. During the calculation process, the center of each border should coincide with the cluster center, and the border should be assigned to the cluster center that is closest to it.
[0039] (IV) Recalculate the cluster center of each cluster, which is the average of the height and width of all bounding boxes in each cluster;
[0040] (V) Repeat steps (III) and (IV) until the value of the cluster center remains almost unchanged.
[0041] (3) According to the attached Figure 2 , the SENet (Squeeze-and-Excitation Networks) structure is embedded into the Residual module of the YOLOv3 backbone feature extraction network DarkNet-53 to obtain the SE-Residual residual block, and the original Residual module is replaced with SE-Residual to increase the global receptive field of the feature extraction network and enhance the feature extraction capability. In addition, SE attention modules are added to the output positions of the three backbone layers used for feature fusion to further obtain richer target features.
[0042] S3. Start training the improved YOLOv3 model.
[0043] The specific operation of step S3 is as follows:
[0044] (1) Load the pre-trained model, parse the path from the .cfg file, including the training path, verification path, training category, and each layer of the network, and load the pre-trained weights.
[0045] (2) Start iterative training. Training requires adjusting the image size. Here, the image size is set to 416 × 416. The iteration first needs to obtain images from a batch, obtain the normalized annotation data of the corresponding images from the labels, and then input them into the model for detection.
[0046] (3) Calculate the loss value. The first part is the bounding box loss, the second part is the confidence loss, and the third part is the category loss. The sum of the three parts is the true loss value. Calculate the sum of the loss values and perform back propagation and gradient optimization.
[0047] (4) After iterating the specified number of epochs, the trained model is saved.
[0048] S4. Use the trained model for detection.
[0049] The specific operation of step S4 is as follows:
[0050] (1) Set the initial parameters, such as weight file path, confidence threshold, image size, etc.
[0051] (2) Load the trained model and input the image to be detected into the improved YOLOv3 network to obtain multiple detection boxes.
[0052] (3) Use non-maximum suppression to filter boxes. Each box has a confidence score. If non-maximum suppression is not used, multiple candidate boxes will appear. These boxes are sorted according to the confidence score, and the box with the highest confidence score is selected as the final candidate output.
[0053] (4) Calculate the area of all bounding boxes and the IoU value of the bounding box with the highest confidence and other candidate boxes, remove the bounding boxes with IoU values greater than the threshold, and finally output the remaining bounding boxes, which are the detected targets.
[0054] For infrared images taken by infrared cameras, the brightness of the hot spot area is relatively high, so threshold segmentation can be used for detection. The main steps are as follows:
[0055] S1. Aiming at the low contrast of infrared images, the present invention proposes a method for non-uniform stretching of histogram to solve the problem. Assume that the gray value range of the image is [m 0 ~m n ], the corresponding probability distribution is Then the integral area of the histogram and gray value is:
[0056]
[0057] In the above formula, n is the gray value of an image divided into n equal parts (usually n is 255), l refers to the distance between two gray levels, and the n equal parts of the gray value axis are stretched into k (k>n) unequal parts, that is, the gray value range is [m 0 ~m n ] to [g 0 ~g k ], interval [m i ,m i+1 ] also needs to be re-divided. Let the interval [m i ,m i+1 ] is divided into k i subintervals, [m i ,m i+1 ] When redividing, the area S of each small area should be equal, then:
[0058]
[0059] After non-uniform interpolation on the gray value axis, the interval [g 0 ,g k ] is uniformized, that is, k unequal parts are converted into k equal parts. The stretching at the peak is much larger than that at the trough. If the gray value after stretching is set to m i ',but:
[0060]
[0061] S2. Perform median filtering on the image to increase the image signal-to-noise ratio. Since the noise of the photovoltaic panel infrared image mainly includes salt and pepper noise and Gaussian noise, median filtering has a better effect.
[0062] S3, the image obtained in S2 is segmented based on the threshold value, that is, the hot spots can be detected. The present invention introduces the balance coefficient α in the adaptive minimum threshold segmentation algorithm, which can effectively segment the hot spots. The specific method is as follows: Assume that there is a grayscale image with a size of M×N and a grayscale level of L, where there are n grayscale values i. i pixels, a total of n pixels, with P i Indicates the probability of the pixel with gray value i appearing. 0 and P 1 Background C 0 and Objective-C 1 The prior probability of each distribution, assuming C 0 and C 1 The distributions P(i|j) of j , the variance is The objective function J(t) is designed based on the normal distribution of the minimum classification error, and the balance coefficient α is introduced to adjust the balance relationship between the background and the target:
[0063]
[0064] In the present invention, the α value is set to 0.25 to reduce the weight of negative samples, i.e., background. The optimal threshold t * When J′(t) takes the minimum value, we get:
[0065]
[0066] Based on this threshold, the hot spots on the infrared image of photovoltaic panel defects can be segmented out.
[0067] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A photovoltaic panel defect detection method based on visible light and infrared vision, characterized in that: Includes steps: Photovoltaic panel images are acquired by using a visible light camera and an infrared camera respectively; Based on visible light photovoltaic panel images, surface stain detection is performed using the YOLOv3 deep learning network model; Based on infrared photovoltaic panel images, the hot spot effect area of photovoltaic panels is detected by using an adaptive minimum threshold segmentation algorithm. The YOLOv3 deep learning network model specifically includes: Configure the learning rate of the YOLOv3 deep learning network model based on the adaptive learning rate method; The K-means clustering algorithm is used to calculate the anchor box size of the adapted data set. The K-means clustering algorithm uses a custom distance d(box, centroid) = 1-IoU(box, centroid), where box is the anchor box, centroid is the cluster center, d(box, centroid) is the distance from the anchor box border to the cluster center, and IoU is the intersection-over-union ratio of the anchor box and the cluster center; The backbone feature extraction network of the YOLOv3 deep learning network model adopts the SE-Residual residual block. The YOLOv3 deep learning network model adds SE attention modules to the three backbone layer output positions used for feature fusion. The detection of hot spot effect area of photovoltaic panels by adaptive minimum threshold segmentation algorithm specifically includes: S1. Divide the grayscale value of an infrared photovoltaic panel image into n equal parts. Suppose the grayscale value range of the image is [m0~m n ], the corresponding probability distribution is Determine the integral area of the histogram and grayscale value: In the formula, l refers to the distance between two gray levels; The n equal parts of the gray value axis are stretched into k unequal parts, k>n, that is, the gray value range is [m0~m n ] is changed to [g0~g k ], interval [m i ,m i+1 ] re-divided, set the interval [m i ,m i+1 ] is divided into k i subintervals, [m i ,m i+1 ]When the area S of each small area is equal during redivision, then: If the gray value after stretching is m i ',but: S2, performing median filtering on the infrared photovoltaic panel image processed in step S1; S3. Introduce the balance coefficient α into the adaptive minimum threshold segmentation algorithm to segment the image obtained in S2 and detect the hot spots.
2. The photovoltaic panel defect detection method based on visible light and infrared vision according to claim 1 is characterized in that: The anchor box size calculated by the K-means clustering algorithm to generate the adaptation data set is specifically: Given k cluster centers (W j ,H j ),j∈{1,2,…,k}, where W j , H j are the width and height of the jth anchor box respectively; Calculate the distance d from each anchor box border to the cluster center. During the calculation process, the center of each border coincides with the cluster center, and the anchor box border is assigned to the cluster center closest to it. Recalculate the cluster center of each cluster and repeat the above steps until the value of the cluster center converges to obtain the anchor box size of the data set.
3. The photovoltaic panel defect detection method based on visible light and infrared vision according to claim 1 is characterized in that: The training method of the YOLOv3 deep learning network model includes the following steps: Obtain a training dataset of defective images of photovoltaic panels and mark the defect points. If the number of original images in the training dataset is insufficient, expand it by flipping, rotating, and graying. Then use LabelImg software to mark the targets in the image with boxes and name the marked labels stains. Load the pre-trained YOLOv3 deep learning network model, parse the path from the .cfg file, including the training path, verification path, training category and each layer of the network, and load the pre-trained weights; The pre-trained YOLOv3 deep learning network model is iteratively trained using the training data set. The image size needs to be adjusted during training. During iteration, images are first obtained from a batch, and the normalized annotation data of the corresponding images is obtained from the label, and then input into the model for training. Calculate the bounding box loss, confidence loss, category loss, and true loss, sum the loss values, and perform backpropagation and gradient optimization. The iteration is completed and the converged YOLOv3 deep learning network model is obtained.
4. The photovoltaic panel defect detection method based on visible light and infrared vision according to claim 3 is characterized in that: The learning rate of the YOLOv3 deep learning network model is configured based on the adaptive learning rate method as follows: after the YOLOv3 deep learning network model training starts m+2k rounds, the loss function is calculated every k rounds, and then the average loss function values from the previous 2k rounds to the previous k rounds and from the previous k rounds to the current round are compared. At this time, the learning rate is automatically adjusted. When the loss function value becomes larger, the learning rate is reduced by the damping factor. Conversely, when the loss function value becomes smaller, the learning rate is increased by the incremental factor. Among them, k refers to calculating the loss function average value for k rounds, and m refers to not changing the learning rate for the first m rounds.
5. The photovoltaic panel defect detection method based on visible light and infrared vision according to claim 1 is characterized in that: The surface stain detection by using the YOLOv3 deep learning network model specifically includes: Set initial parameters; Input the collected visible light photovoltaic panel images into the YOLOv3 deep learning network model to obtain multiple detection frames; Use non-maximum suppression method to filter detection frames; The areas of all bounding boxes and the IoU values of the bounding box with the highest confidence and other candidate boxes are calculated. The bounding box with an IoU value less than the threshold is the surface stain detection target.
6. The photovoltaic panel defect detection method based on visible light and infrared vision according to claim 1 is characterized in that: The n equal parts are 255 equal parts.
7. The photovoltaic panel defect detection method based on visible light and infrared vision according to claim 1, characterized in that: The method of introducing the balance coefficient α into the adaptive minimum threshold segmentation algorithm to segment the image obtained by S2 and detecting the hot spots specifically includes: Suppose there is a grayscale image of size M×N and grayscale level L, where there are n grayscale values i. i pixels, a total of n pixels, with P i represents the probability of the pixel with gray value i appearing. P0 and P1 are the prior probabilities of the background C0 and target C1, respectively. Assume that the distributions P(i|j) of C0 and C1 are both subject to the mean μ j , the variance is The objective function J(t) is determined based on the normal distribution of the minimum classification error idea, and the balance coefficient α is introduced into it. The objective function J(t) is: Threshold t * It is determined when J'(t) takes the minimum value, that is: According to the threshold t * The image is segmented and hot spots are detected.
8. The photovoltaic panel defect detection method based on visible light and infrared vision according to claim 7 is characterized in that: The value of the balance coefficient α is 0.25.
Citation Information
Patent Citations
Photovoltaic power station hot spot detection and positioning method based on thermal infrared image
CN112200764A
Photovoltaic defect detection method based on Yolov4 and thermal infrared image
CN113538391A
Method for detecting image target in smart home environment
WO2021244079A1
