A method for detecting defects in solar cells based on neural networks
By improving the Retinex algorithm and using the PP-YOLO neural network, the problem of poor detection of small defects of solar cells in the prior art is solved, and the recognition ability and detection accuracy of small defect targets are improved.
Patent Information
- Application Number
- CN202410675537.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-29
- Publication Date
- 2025-07-01
- Estimated Expiration
- 2044-05-29
AI Technical Summary
The existing solar cell defect detection methods are not efficient, especially the detection effect of small scratches and nodes is not ideal, which can easily lead to identification and classification errors in neural networks.
By improving the Retinex algorithm, the degree of chaos in the image is calculated and the image smoothing is carried out to varying degrees according to the degree of chaos, improving the recognition of small defect targets. Then, the extracted small defect target features are input to the PP-YOLO neural network for training and classification.
It improves the recognition ability of small defect targets of solar cells, enhances the detection effect of small scratches and nodes, and reduces the error rate of identification and classification in neural networks.
Smart Images

Figure CN118570159B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of image data processing, and particularly relates to a method for detecting defects of solar cell wafers based on a neural network. Background Art
[0002] During the use of photovoltaic cell wafers, various defects may exist on the surface, resulting in a reduction in power generation efficiency. For example, there may be scratches on the surface of solar cell wafers, which will cause the scattering and reflection of light, reducing the utilization rate of light energy; there may be some particulate contaminants on the surface of solar cell wafers, such as dust, dirt, etc., and these particulate matters will block sunlight, resulting in a reduction in the utilization rate of light energy; the surface of solar cell wafers may be oxidized to form a layer of oxide, and this layer of oxide will reduce the conductivity and light energy utilization rate of solar cell wafers; there may be cracks on the surface of solar cell wafers, and these cracks will cause a reduction in the mechanical strength of solar cell wafers and also affect the utilization rate of light energy.
[0003] In order to improve the power generation efficiency of solar cell wafers, it is necessary to detect the surface defects and take corresponding measures to reduce the surface defects and improve the performance and power generation efficiency of solar cell wafers.
[0004] At present, the detection of surface defects of cell wafers includes methods such as manual inspection and image detection. Manual inspection has low efficiency, and the image detection method has low cost, but the detection effect is not ideal enough. Especially for very fine scratches and nodes, using the existing image enhancement algorithms, these fine scratches and nodes are easily eliminated, resulting in errors in the subsequent identification and classification of defects in the neural network. Summary of the Invention
[0005] In view of this, the present application improves the Retinex algorithm. By calculating the chaos degree within the guided filter window and smoothing the image to different degrees according to the size of the chaos degree, the recognition degree of small defect targets is improved. Then, the features of the extracted small defect targets are input into the neural network for training and learning to classify the small target defects for subsequent processing.
[0006] To achieve the above object, the method for detecting defects of solar cell wafers based on a neural network disclosed in the present application includes the following steps:
[0007] Use a camera to collect the RGB image of the solar cell wafer;
[0008] Convert the RGB image into the HSV color space;
[0009] Detect the grid lines in the image and segment the image into multiple sub-images according to the grid lines;
[0010] Use the improved Retinex algorithm to enhance the sub-image and extract the defective target image;
[0011] Input the defective target image into the PP-YOLO neural network for training to identify the category of the defect;
[0012] After the training is completed, input the actual cell image into the trained PP-YOLO neural network to identify the defect category.
[0013] Furthermore, in the improved Retinex algorithm, the perceived image I of the actual scene by the human eye in the Retinex algorithm is used as the image p to be filtered, and guided filtering is performed. The size of the filtering window is M×N, and the pixel after filtering is as follows:
[0014]
[0015] Among them, I is the guiding image, q is the filtered image, g i is the gray value of the i-th pixel, g max is the maximum gray value among all pixels in the filtering window, and ξ is the chaos degree in the filtering window.
[0016] Furthermore, calculate the chaos degree ξ in the filtering window as follows:
[0017]
[0018] Among them, is the gradient between pixel q and pixel p when the phase consistency between pixel q and pixel p is the same, is the gradient between pixel q and pixel p when the phase consistency between pixel q and pixel p is different.
[0019] Furthermore, the conversion of the RGB image to the HSV color space includes:
[0020] H-channel component h:
[0021]
[0022] S-channel component s:
[0023]
[0024] V-channel component v: v = T max
[0025] Among them, r is the red component value in the RGB space, g is the green component value in the RGB space, b is the blue component value in the RGB space, and T max is the maximum value among the red, green, and blue components in the RGB space, and T minis the minimum value among the red, green, and blue components in the RGB color space.
[0026] Furthermore, the PP-YOLO neural network includes a feature extraction network, a feature fusion network, and a detection head, and loads the trained model weights.
[0027] The feature extraction network extracts features from the input image, extracting features at multiple scales; then uses the feature fusion network to perform feature fusion at multiple scales; finally, uses the detection head to predict the feature maps at three different scales, and predicts the defect categories in the solar cell image.
[0028] Furthermore, the features at multiple scales include aspect ratio, area, and edge features.
[0029] Furthermore, the following activation function is used in the convolutional layer of the feature extraction network:
[0030]
[0031] where x is the independent variable.
[0032] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0033] An improved Retinex filtering enhancement algorithm is adopted, combined with the image confusion degree, and different degrees of balance are performed according to the change degree of the image texture, improving the recognition ability of small defect targets. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 The flowchart of the defect detection of this application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0035] The present invention will be further described below with reference to the accompanying drawings, but the present invention is not limited in any way. Any transformation or replacement based on the teachings of the present invention belongs to the protection scope of the present invention.
[0036] Combined with Figure 1 , the steps of the method for detecting defects in solar cells based on a neural network proposed in this application are as follows:
[0037] S1 Use a camera to collect the RGB image of the solar cell.
[0038] S2 Convert the RGB image to the HSV color space.
[0039] S3 Detect the grid lines in the image and segment the image into multiple sub-images according to the grid lines.
[0040] S4 Use the improved Retinex algorithm to enhance the sub-images and extract the defect target images.
[0041] S5 inputs the defective target image into the PP-YOLO neural network for training to identify the category of the defect.
[0042] After the training in S6 is completed, the actual cell image is input into the trained PP-YOLO neural network to identify the defect category.
[0043] In step S1, the camera is set above the solar cell to capture the RGB image of the cell.
[0044] In step S2, the RGB image is converted into the HSV color space, including:
[0045] The H-channel component h:
[0046]
[0047] The S-channel component s:
[0048]
[0049] The V-channel component v: v = T max
[0050] where T max is the maximum value among the red, green, and blue components in the RGB space, and T min is the minimum value among the red, green, and blue components in the RGB space, r is the value of the red component in the RGB space, g is the value of the green component in the RGB space, and b is the value of the blue component in the RGB space.
[0051] In step S3, since the grid lines on the surface of the solar cell are regular, that is, the grid lines are horizontal or vertical, the cell image can be segmented into multiple rectangular sub-images according to the rectangles formed by the grid lines.
[0052] After the edges of the image are extracted by the commonly used Canny operator or Sobel operator in the field of image processing, the grid lines appear as regular horizontal or vertical lines in the image, and then the regions enclosed by these lines are divided into multiple sub-images for the next step of image filtering and enhancement respectively.
[0053] In some embodiments, in step S4, an improved Retinex algorithm is used for image enhancement to improve the recognition ability of small targets.
[0054] According to the Retinex algorithm, the perceived image I of the actual scene by the human eye is produced by the combined action of the incident light and the reflection of the actual scene on the incident light, that is:
[0055] I = L·R
[0056] Among them, L is the illuminance and R is the reflectivity of the object surface to light;
[0057] In this application, the image I is used as the guiding image for guided filtering. The size of the filtering window is M×N, and the pixels after filtering are as follows:
[0058]
[0059] g i is the gray value of the i-th pixel, and g max is the maximum gray value among all pixels within the filtering window, and ξ is the chaos degree proposed in this application.
[0060] The chaos degree ξ within the filtering window is calculated as follows:
[0061]
[0062] Among them, is the gradient between pixel q and pixel p when the phase consistency between them is the same, is the gradient between pixel q and pixel p when the phase consistency between them is different.
[0063] The phase consistency was proposed by Morrone et al. and is calculated as follows:
[0064]
[0065] A n (x) represents the amplitude of the n-th Fourier component, and φ n (x) represents the phase angle of the n-th Fourier component. The that maximizes the equation is the amplitude-weighted average local phase angle of all Fourier terms at the point under consideration.
[0066] The calculation method of the image gradient is the prior art in this field. For reference, see Baidu Encyclopedia:
[0067] https: / / baike.baidu.com / item / %E5%9B%BE%E5%83%8F%E6%A2%AF%E5%BA%A6 / 8528837?fr=ge_ala.
[0068] It can be seen from the above formula that when the chaos degree ξ is larger, the image texture is richer, the guided filtering coefficient is smaller, and the smoothing effect is weak, which can preserve the image edge; when the chaos degree ξ is smaller, the image texture is flatter, the guided filtering coefficient is larger, and the smoothing effect is greater. Therefore, this application can well preserve and enhance the image edge during the image enhancement process, improving the detection effect of small defects in the solar cell image.
[0069] Furthermore, in some embodiments, after the image is segmented into different sub-images according to the gate lines, these sub-images are enhanced separately instead of enhancing the entire cell image, which can well avoid the problem of single enhancement effect, especially the problem that some sub-images have good enhancement effect while some sub-images have poor enhancement effect.
[0070] The feature extraction network extracts features from the input image and extracts features of multiple scales; then the feature fusion network is used to fuse features of multiple scales; finally, the detection head predicts the feature maps of three different scales to predict the defect categories in the solar cell image.
[0071] The feature extraction network of the PPYOLO neural network is Resnet50. By connecting the residual layers, the number of network layers is deepened to improve the feature extraction ability. The input data is the image filtered by the improved Retinex algorithm, and then through concat splicing, convolutional layer, batch normalization layer BN, and max pooling layer, it enters 4 stage modules.
[0072] The activation functions of the existing convolutional layers are ReLU and Hardswis activation functions. ReLU forces the output of the part where x ≤ 0 to be 0, which solves the problem of gradient disappearance and improves the training speed, but may cause the network to lose some effective features during the learning process, and ReLU is not sensitive to the spatial feature information of the image. This application uses the following activation function:
[0073]
[0074] This activation function maps the part where the independent variable is greater than 0 between (0.5, 1), which is monotonically continuous, while for the part where the independent variable is less than 0, the gradient is always 0.5, providing the sparse expression ability of the neural network.
[0075] The feature fusion network uses the image pyramid network to combine local and global information and fuse features. The feature extraction network extracts features of different scales of the defect target. It is necessary to fuse the small-size information extracted by the deep network and the large-size information extracted by the shallow network, that is, the low-level information is transmitted to the high-level information, and the high-level information is also transmitted to the low-level information for fusion. The features of multiple scales include aspect ratio (the ratio of the length and width of the defect target), area (the area of the defect target), and edge features.
[0076] The detection head uses YOLOhead in the prior art to classify defects and further determine the types of defects, that is, broken gate, thick line, ghost printing, node, slurry leakage, printing offset, scratch, back electrode defect, aluminum bead, aluminum package, back field missing, etc.
[0077] Compared with the prior art, the beneficial effects of this application are as follows:
[0078] An improved Retinex filtering enhancement algorithm is adopted, combined with the image chaos degree, and different degrees of smoothing are performed according to the change degree of the image texture, so as to retain the detailed parts of the defects while filtering out the noise, and improve the recognition ability of small defect targets.
[0079] As used herein, the term "preferred" is intended to be used as an example, illustration, or exemplification. Any aspect or design described herein as "preferred" should not necessarily be construed as more advantageous than other aspects or designs. On the contrary, the use of the term "preferred" is intended to present concepts in a specific manner. As used in this application, the term "or" is intended to mean an inclusive "or" rather than an exclusive "or". That is, unless otherwise specified or clear from the context, "X uses A or B" means any one of the permutations is naturally included. That is, if X uses A; X uses B; or X uses both A and B, then "X uses A or B" is satisfied in any of the foregoing examples.
[0080] Moreover, although the present disclosure has been shown and described with respect to one or more implementations, equivalent variations and modifications will occur to those skilled in the art based on a reading and understanding of this specification and the drawings. The present disclosure includes all such modifications and variations and is limited only by the scope of the appended claims. In particular, with respect to the various functions performed by the above components (such as elements, etc.), the terms used to describe such components are intended to correspond to any component (unless otherwise indicated) that performs the specified function of the component (i.e., it is functionally equivalent), even if it is not structurally equivalent to the disclosed structure that performs the function in the exemplary implementations of the present disclosure shown herein. In addition, although a particular feature of the present disclosure has been disclosed with respect to only one of several implementations, such a feature may be combined with one or other features of other implementations as may be desired and advantageous for a given or particular application. Moreover, insofar as the terms "comprising", "having", "containing", or any variation thereof are used in a particular embodiment or claim, such terms are intended to include in a manner similar to the term "including".
[0081] Each functional unit in the embodiments of the present invention may be integrated into a processing module, or each unit may exist physically alone, or multiple or more than multiple units may be integrated into one module. The above integrated module may be implemented in the form of hardware or in the form of a software functional module. When the above integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium. The above-mentioned storage medium may be a read-only memory, a magnetic disk, or an optical disc, etc. The above-mentioned various devices or systems may execute the storage method in the corresponding method embodiments.
[0082] In summary, the above embodiments are one implementation manner of the present invention. However, the implementation manner of the present invention is not limited by the above embodiments. Any other changes, modifications, substitutions, combinations, and simplifications made under the premise of departing from the spirit and principle of the present invention shall be equivalent replacement manners and are all included in the protection scope of the present invention.
Claims
1. A method for detecting defects in solar cells based on a neural network, characterized in that: The following steps are involved: Use a camera to collect RGB images of solar cells; Convert RGB image to HSV color space; Detect grid lines in the image and divide the image into multiple sub-images according to the grid lines; The improved Retinex algorithm is used to enhance the sub-image and extract the defect target image; Input the defect target image into the PP-YOLO neural network for training to identify the category of the defect; After the training is completed, the actual cell images are input into the trained PP-YOLO neural network to identify the defect categories; The improved Retinex algorithm uses the image I of the actual scene perceived by the human eye in the Retinex algorithm as the image to be filtered p, and performs guided filtering. The filter window size is M×N. The pixels after filtering are as follows: Where I is the guidance image, λ i (I) is the weight, q is the filtered image, g i is the gray value of the i-th pixel, g max is the maximum grayscale value of all pixels in the filter window, and ξ is the degree of disorder in the filter window; The degree of disorder ξ within the filter window is calculated as follows: in, is the gradient between pixel q and pixel p when the phase consistency between pixel q and pixel p is the same, It is the gradient between pixel q and pixel p when the phase consistency between pixel q and pixel p is different.
2. The method for detecting solar cell defects based on a neural network according to claim 1, characterized in that: The method of converting an RGB image to an HSV color space includes: H channel component h: S channel component s: V channel component v: v = T max Among them, r is the red component value in RGB space, g is the green component value in RGB space, b is the blue component value in RGB space, T max is the maximum value of the red, green, and blue components in the RGB space, T min It is the minimum value of the red, green, and blue components in the RGB space.
3. The method for detecting solar cell defects based on neural network according to claim 2, characterized in that: The PP-YOLO neural network includes a feature extraction network, a feature fusion network and a detection head, and loads the trained model weights; The feature extraction network extracts features from the input image to extract features at multiple scales; then the feature fusion network is used to fuse features at multiple scales; finally, the detection head is used to predict features at three different scales to predict the defect category in the solar cell image.
4. The method for detecting solar cell defects based on a neural network according to claim 3, characterized in that: Features at multiple scales include aspect ratio, area, and edge features.
5. The method for detecting solar cell defects based on neural network according to claim 4, characterized in that: The following activation function is used in the convolutional layer of the feature extraction network: x is the independent variable.
Citation Information
Patent Citations
Image enhancement method
CN111127350A
Convolutional neural network-based building surface crack identification method and system
CN116563202A