A Defect Detection Method for Poor Spacing of Photovoltaic Modules Based on Convolutional Neural Network
Through the method based on convolutional neural network, the defects of poor spacing between photovoltaic modules are automatically detected, which solves the shortcomings of manual detection, and achieves high flexibility and robust spacing detection, improving detection accuracy.
Patent Information
- Application Number
- CN202210285921.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-22
- Publication Date
- 2025-08-05
- Estimated Expiration
- 2042-03-22
AI Technical Summary
In the prior art, the detection of defects in photovoltaic module spacing depends on manual judgment, and there are problems such as miss detection caused by visual fatigue and inaccurate battery spacing estimation.
The method based on convolutional neural network is adopted to automatically detect spacing abnormalities by positioning the battery cell position, extracting ROI areas, performing semantic segmentation and post-processing, and combining the threshold correction method, the detection accuracy is improved by using UNet segmentation network and threshold interval correction.
It realizes high flexibility and robustness of photovoltaic module spacing defect detection, reduces false alarm rates and missed alarm rates, and improves detection accuracy.
Smart Images

Figure CN114663393B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of photovoltaic modules, and in particular to a photovoltaic module spacing measurement method based on a convolutional neural network. Background Art
[0002] Photovoltaic modules are the basic components of solar power generation systems. Generally speaking, a photovoltaic module consists of several battery strings connected in parallel, and each battery string is composed of several single battery cells connected in series. Figure 1 The cells in the PV module shown are arranged in a specific pattern to form a photovoltaic array. The spacing between the cells is limited to a specific range to optimally harvest solar energy for power generation. This design effectively avoids hot spot effects caused by shading between the front and rear rows of cells, extending the lifespan of the PV module and increasing output power. The spacing of the PV array is calculated based on factors such as the array mounting angle and the solar altitude. During the production process, cell position shifts can occur during operations such as string soldering and lamination, causing the cell spacing to exceed the specified range and resulting in poor spacing defects.
[0003] The current industry practice for these defects is to use visible light cameras to capture images of the module's appearance, and then manually determine whether there are any poor spacing defects between each cell. This current method can lead to missed detections due to visual fatigue caused by prolonged observation, and the human eye can only roughly estimate the cell spacing, making it impossible to maintain a stable and consistent judgment standard.
[0004] Therefore, to address the above problems, a photovoltaic module spacing defect detection method based on convolutional neural network is proposed. Summary of the Invention
[0005] In view of the deficiencies in the above-mentioned prior art, the object of the present invention is to provide a method for detecting poor spacing defects in photovoltaic modules based on convolutional neural networks.
[0006] A method for detecting poor spacing defects in photovoltaic modules based on a convolutional neural network, the method steps are as follows:
[0007] Step 1: Roughly locate the position of the battery cells and intercept the ROI area between the battery cells;
[0008] Step 2: Use the convolutional neural network (CNN) model to extract features from the ROI image block and perform semantic segmentation, that is, classify each pixel into two categories to determine whether it is foreground or background;
[0009] Step 3: Post-process the network output and calculate the distance between the cells;
[0010] Step 4: Compare the calculated spacing between each cell with the set threshold. If it exceeds the threshold, it is determined that the spacing between the cells is abnormal; otherwise, it is determined to be normal.
[0011] The ROI region extraction method in step 1 is:
[0012] (1) Extract the outline of each cell through a series of traditional image processing methods such as denoising and contour extraction;
[0013] (2) Obtaining rough cell location information;
[0014] (3) According to the located cell positions, the area between every two cells (including the horizontal and vertical directions) is cut out as the ROI area;
[0015] (4) Perform a 90-degree rotation operation on the horizontal ROI image block to obtain a unified vertical cell orientation.
[0016] The convolutional neural network model in step 2 uses the UNet segmentation network; the UNet segmentation network uses the Encoder-Decoder symmetric network structure to extract image features and finally outputs the semantic segmentation results of each category.
[0017] Select the feature map representing the foreground probability in the network output result in step 3, and convert the feature Figure 2 The threshold T is set, and the pixel value of each pixel whose probability is less than T is 0, and the pixel value greater than T is 1; the binary feature map is normalized to the size of the input image to obtain the mask result map of the image segmentation.
[0018] The further method of step 4 is to set the threshold interval in advance: [a, b], calculate the ratio between the unit pixel value of the captured image and millimeters, and convert the pixel value distance into the actual distance d in millimeters. If the calculated distance d exceeds the threshold interval, that is, d≥a or d≥b, it is determined that there is a poor spacing defect, otherwise it is a normal sample.
[0019] The threshold correction method in step 4 is:
[0020] S1. Obtain the threshold interval of normal samples and abnormal samples obtained by measurement method 1; collect a large number of normal samples and abnormal samples offline, and perform steps 1 to 3 above to obtain the normal sample threshold interval [a p , b p ], abnormal sample threshold interval (0, a n ) and (b n ,+∞), then it is easy to get a n ≤a≤a p ≤b p ≤b≤bn ;
[0021] S2, do interval mapping, that is, map the distance calculated by measurement method 1 to the scale space of measurement method 2; take any sample, assume that the distance calculated by steps 1 to 3 is x, and now map it to the scale space of measurement method 2, and record the mapped x as x'; if normal samples are used for threshold interval mapping, then [a p , b p ] is mapped to the interval [a, b], then According to this mapping method, the condition for x to be a positive sample is: Right now Similarly, the condition for x to be a positive sample obtained by using abnormal samples for threshold interval mapping is:
[0022] S3. Threshold range correction: Since the impact of missed detection rate in industrial inspection is much higher than the pass rate, the industry generally tends to use more stringent inspection indicators to control possible defects. The following corrections were made to the threshold range:
[0023]
[0024]
[0025] That is, the threshold interval is finally adopted Replace the threshold interval [a,b] for defect detection.
[0026] Compared with the prior art, the present invention has the following beneficial effects:
[0027] 1. The method of predicting the spacing between photovoltaic modules based on convolutional neural networks is characterized by high flexibility and good robustness.
[0028] 2. The method of automatically extracting the ROI area in the present invention can overcome the problem of inaccurate cell positioning caused by product switching, component displacement, etc.;
[0029] 3. The threshold interval correction method of the present invention can map the threshold predicted by the model and the threshold actually measured into a unified space, thereby improving the accuracy of poor spacing defect detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 A schematic diagram of a photovoltaic module array in the prior art;
[0031] Figure 2 It is a flowchart of the present invention;
[0032] Figure 3 This is a flowchart of the ROI region extraction of the present invention. DETAILED DESCRIPTION
[0033] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments may be combined with each other.
[0034] like Figure 2 and combined Figure 3 As shown, a method for detecting poor spacing defects of photovoltaic modules based on convolutional neural networks is provided, and the method steps are as follows:
[0035] Step 1: Roughly locate the position of the battery cells and capture the ROI area between the battery cells.
[0036] During the production of a batch of battery modules, specific templates are used to arrange the photovoltaic arrays, and template matching is used to roughly locate the positions of the battery cells. The disadvantage of this method is that a different template must be switched for each batch of products. At the same time, component shifting is inevitable during the production process, resulting in positioning errors. When the positioning error is too large, it will interfere with subsequent distance measurements.
[0037] In order to overcome the problem of inaccurate cell positioning caused by product switching, component displacement, etc., and obtain a higher quality ROI image, the present invention proposes the following Figure 3 The automatic ROI region extraction method shown in this paper first extracts the outline of each cell through a series of traditional image processing methods such as denoising and contour extraction to obtain rough cell location information. Next, based on the located cell positions, the area between each two cells (including horizontal and vertical directions) is intercepted as the ROI region, which contains the local cell image and the gap between cells. To facilitate subsequent processing, the horizontal ROI image block is rotated 90 degrees to obtain a unified vertical cell orientation. The resulting vertical cell gap is the cell spacing. To obtain a higher-contrast image, the present invention additionally adds the CLAHE histogram equalization method to post-process the ROI image block.
[0038] Step 2: Use the convolutional neural network (CNN) model to extract features from the ROI image block and perform semantic segmentation, that is, classify each pixel into two categories to determine whether it is foreground or background.
[0039] The cell gap area is marked as the foreground class, and the area inside the cell is marked as the background class. A certain number of images are collected offline, and the collected images are cropped to obtain ROI image blocks, which are then annotated to create training and test sets.
[0040] The CNN model uses the UNet segmentation network. The Unet model uses an encoder-decoder symmetric network structure to extract image features and ultimately outputs semantic segmentation results for each category. The encoder consists of four downsampling modules, each of which contains three convolutional layers and one max pooling layer for extracting image features. The decoder consists of four upsampling modules, each of which uses a deconvolution operation to double the size of the input image and fuse it with the corresponding features in the encoder. If the sizes of the corresponding feature maps of the encoder and decoder are inconsistent, the Unet model crops the decoder feature map to the same size as the encoder feature map before performing feature fusion.
[0041] The cross entropy loss function is used to train the Unet segmentation network, and Mean IOU is used as the evaluation indicator. The model with the largest Mean IOU on the validation set is selected as the optimal model for subsequent inference.
[0042] Step 3: Post-process the network output and calculate the distance between the cells.
[0043] Select the feature map representing the foreground probability in the network output result and convert the feature Figure 2 The binary feature map is normalized to the size of the input image to obtain the mask result map of the image segmentation.
[0044] A contour extraction method is used to obtain the foreground region in the mask, and small areas with an area smaller than a threshold are removed. The mean vertical length of the foreground region in the mask is calculated as the pixel distance between the cells. To speed up the algorithm, the mean length of k randomly sampled points is selected as the cell spacing.
[0045] Step 4: Compare the calculated spacing between each battery cell with the set threshold. If it exceeds the threshold, it is determined that the battery cell spacing is abnormal, otherwise it is determined to be normal. The specific method is as follows: set the threshold interval in advance: [a, b]; calculate the ratio between the pixel value of the collected image and millimeters, and convert the pixel value distance into the actual distance d in millimeters. If the calculated distance d exceeds the threshold interval, that is, d≤a or d≥b, it is determined that there is a poor spacing defect, otherwise it is a normal sample.
[0046] In the actual appearance images collected, the transition areas between battery cells are relatively blurred, so the mask annotations used to train the UNet in step 2 are inevitably inaccurate. This will lead to errors in the distance calculated using the UNet segmentation method (denoted as measurement method 1) and the actual measured distance (denoted as measurement method 2). To resolve the inconsistency between the results obtained by the two measurement methods, the threshold interval correction method is used. The specific operation is as follows:
[0047] Obtain the threshold interval of normal samples and abnormal samples obtained by the measurement method; collect a large number of normal samples and abnormal samples offline, perform steps 1 to 3 above, and obtain the threshold interval of normal samples [a p , b p ], abnormal sample threshold interval (0, a n ) and (b n ,+∞), then it is easy to get a n ≤a≤a p ≤b p ≤b n .
[0048] Do interval mapping, that is, map the distance calculated by measurement method 1 to the scale space of measurement method 2; take any sample, assume that the distance calculated by steps 1 to 3 is x, and now map it to the scale space of measurement method 2, and record the mapped x as x'; if normal samples are used for threshold interval mapping, that is, [a p , b p ] is mapped to the interval [a, b], then According to this mapping method, the condition for x to be a positive sample is: Right now Similarly, the condition for x to be a positive sample obtained by using abnormal samples for threshold interval mapping is:
[0049] Threshold range correction: Since the impact of missed detection rate in industrial inspection is much higher than the pass rate, the industry generally tends to use more stringent detection indicators to control possible defects. The following corrections were made to the threshold range:
[0050]
[0051]
[0052] That is, the threshold interval is finally adopted Replace the threshold interval [a,b] for defect detection.
[0053] Due to the adoption of the threshold interval correction method, no matter how the user adjusts the threshold interval [a, b], the method of the present invention can obtain a correspondingly better threshold interval after correction. The user can flexibly adjust the threshold to control the defect according to different production standards or the actual situation of online production.
[0054] To verify the performance of the present invention, this embodiment conducted an experiment on industrial data collected during the photovoltaic module production process. A total of 730 test images were taken, of which 30 were defective "NG" images and 700 were normal "OK" images. The missed alarm rate and false alarm rate were used as evaluation criteria, and the calculation formula was as follows:
[0055]
[0056]
[0057] The effects of the preprocessing method and threshold correction method for automatically extracting ROI regions are evaluated on the above test set. The experimental comparison is shown in Table 1 below.
[0058] Table 1 Comparative experimental results of preprocessing methods
[0059] Comparison Method False negative rate False alarm rate Using template matching to replace automatic ROI region extraction method 0.54% 34.43% No threshold interval correction 0.82% 10.96% Method of the present invention 0.54% 2.05%
[0060] Compared with the preprocessing method shown in Table 1, the false alarm rate of the present invention is reduced by 32.38%; the threshold interval proposed by the present invention shows that the preprocessing method proposed by the present invention can significantly reduce the false alarm rate of the algorithm, and has a significant effect on improving the detection accuracy of poor spacing defects compared with the template matching correction method. In summary, the poor spacing detection method based on convolutional neural network proposed by the present invention can effectively detect poor spacing defects in photovoltaic modules.
[0061] The above description is only a preferred embodiment of the invention and does not limit the patent scope of the invention. Any equivalent structure or equivalent process transformation made by using the contents of the invention description and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A method for detecting poor spacing defects in photovoltaic modules based on a convolutional neural network, characterized by: The method steps are: Step 1: Locate the position of the battery cells and capture the ROI area between the battery cells; Step 2: Use the convolutional neural network model to extract features from the ROI image block and perform semantic segmentation, that is, classify each pixel into two categories to determine whether it is foreground or background; Step 3: Post-process the network output and calculate the distance between the cells; Step 4: Compare the calculated spacing between each cell with the set threshold. If it exceeds the threshold, it is determined that the spacing between cells is abnormal; otherwise, it is determined to be normal. The threshold setting method in step 4 is: S1. Statistically analyze the distance threshold interval [a, b] of normal samples; collect a large number of normal samples and abnormal samples offline, and perform steps 1 to 3 above to obtain the normal sample threshold interval , abnormal sample threshold interval and ; S2, perform interval mapping, that is, mapping the distance calculated by the measurement method into the millimeter measurement space; Take any sample and assume that the spacing calculated from step 1 to step 3 is x , now map it to the millimeter metric space, and record the distance after mapping as x’ ; If normal samples are used for threshold interval mapping, Mapping to the interval [ a , b ], then According to this mapping method, we can get x The conditions for being a positive sample are: ,Right now ; The threshold interval mapping is obtained by using abnormal samples x The conditions for being a positive sample are: ; S3, threshold interval correction: The threshold interval was corrected as follows: , , That is, the threshold interval is finally adopted Replace threshold interval [ a , b ] to make defect judgment.
2. The method for detecting poor spacing defects in photovoltaic modules based on a convolutional neural network according to claim 1, wherein: The ROI region extraction method in step 1 is: (1) Extract the outline of each battery cell through denoising and contour extraction methods; (2) Obtaining rough cell location information; (3) According to the located cell positions, the area between each two cells is cut out as the ROI area; (4) Perform a 90-degree rotation operation on the horizontal ROI image block to obtain a unified vertical cell orientation.
3. The method for detecting poor spacing defects in photovoltaic modules based on a convolutional neural network according to claim 1, wherein: The convolutional neural network model in step 2 uses the UNet segmentation network to extract image features and output the semantic segmentation results of the photovoltaic modules.
4. The method for detecting poor spacing defects in photovoltaic modules based on a convolutional neural network according to claim 1, wherein: Select the feature map representing the foreground probability from the network output in step 3, binarize the feature map and scale it to the input image size to obtain the mask result map of the image segmentation, calculate the height of the foreground target in the mask, and obtain the distance value between the two battery cells in pixels.
5. The method for detecting poor spacing defects in photovoltaic modules based on a convolutional neural network according to claim 1, wherein: The further method of step 4 is to calculate the ratio between the pixel value of the captured image and the millimeter, and convert the pixel value distance into the actual distance in millimeters. d , if the calculated distance d Beyond the threshold range, that is or , it is determined that there is a poor spacing defect, otherwise it is a normal sample.
Citation Information
Patent Citations
An ultrasound image segmentation method for thyroid nodules based on cascaded total convolution neural network
CN109087327A
Ranging method for photovoltaic appearance assembly
CN113674150A