A method and device for detecting defects in a photovoltaic cell based on image processing
By processing photovoltaic panel images into regions to obtain grayscale and illumination images, and using gamma correction and feature extraction models to construct a loss function training model, the problem of inaccurate photovoltaic cell defect detection results is solved, and high-precision detection under different illumination conditions is achieved.
Patent Information
- Application Number
- CN202511332201.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-18
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2045-09-18
AI Technical Summary
In existing photovoltaic cell defect detection methods, the brightness adjustment operation fails to reflect the actual situation, resulting in inaccurate defect detection results.
The photovoltaic panel image is divided into multiple cell regions, and grayscale and illumination images of each region are obtained. Illumination features are extracted using a gamma correction sub-model. Defect detection is performed through a feature extraction sub-model and a classification sub-model. A loss function is constructed to train the model and eliminate the influence of uneven illumination.
It enables accurate acquisition of defect detection results in photovoltaic cell areas under different lighting conditions, improving the accuracy and reliability of detection.
Smart Images

Figure CN120807535B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, and in particular to a method and apparatus for detecting defects in photovoltaic cells based on image processing. Background Technology
[0002] With the further aggravation of the energy crisis and environmental pollution, and the rapid development of photovoltaic power generation technology, various regions have gradually begun to build photovoltaic power plants to utilize solar energy to solve electricity problems. Photovoltaic power plants are equipped with a large number of photovoltaic panels that convert solar energy into electrical energy. However, defects in these photovoltaic panels directly affect the power generation efficiency of photovoltaic power generation. Therefore, in the process of using photovoltaic panels for photovoltaic power generation, it is necessary to conduct defect detection on the photovoltaic cells to promptly identify defective cells.
[0003] Currently, patent application CN114021741A discloses a deep learning-based photovoltaic panel inspection method. The method includes: preparing network input data and collecting image datasets of photovoltaic panels using a drone carrying an imaging device; enhancing and expanding the training and test sets through flipping, rotating, mirroring, and brightness adjustment operations to increase data diversity; constructing a segmentation network U-Net optimized by a parallel attention mechanism; constructing a parallel attention module; training the constructed model on the dataset built in step 1; and testing the trained network on images captured by the drone, fine-tuning the network so that it can extract features of minute defects such as cracks, thereby achieving defect detection of photovoltaic cells.
[0004] The above method improves the network's feature extraction of minute defects such as cracks by increasing data diversity and using a parallel attention module. Although brightness adjustment is performed in increasing data diversity, the result of brightness adjustment does not conform to the brightness distribution of the solar cell under real conditions, which cannot guarantee the accuracy of defect detection results, resulting in inaccurate photovoltaic cell defect detection results. Summary of the Invention
[0005] To address the technical problem of inaccurate photovoltaic cell defect detection results, this application provides a photovoltaic cell defect detection method and apparatus based on image processing, which can accurately obtain photovoltaic cell defect detection results.
[0006] In a first aspect, this application provides a photovoltaic cell defect detection method based on image processing. The method includes: dividing a photovoltaic panel image into multiple cell regions; inputting grayscale images and illumination images of each cell region into a defect detection model, and outputting defect detection results for each cell region; the defect detection model includes a gamma correction sub-model, a feature extraction sub-model, and a classification sub-model; the gamma correction sub-model is used to extract features from the illumination image and regress the feature extraction results into gamma parameters for each cell region; after gamma correction of each grayscale image based on the gamma parameters, the grayscale image is input into the feature extraction sub-model to obtain the grayscale features of each grayscale image. The classification sub-model maps the grayscale features of each grayscale image to defect detection results. The training method of the defect detection model includes: acquiring the time series of photovoltaic panel images and defect labels of each cell region; calculating the illumination complexity of each cell region in any photovoltaic panel image; acquiring multiple defect detection results of each cell region in the time series based on the defect detection model; constructing a loss function by weighted summation of the cross-entropy loss between the defect labels and defect detection results based on the illumination complexity; and iteratively updating the defect detection model using the gradient descent method until the loss function is less than the preset loss or the number of iterations is greater than the preset number, thus completing the training.
[0007] Because of the relative variation between the angle of sunlight and the orientation of the photovoltaic panel, the illumination conditions of each cell area on the panel vary at different times. Therefore, the photovoltaic panel image is divided into multiple cell areas, and grayscale and illumination maps are obtained for each cell area. The illumination map can characterize the illumination conditions of the corresponding cell area. Using the grayscale and illumination maps as inputs to the defect detection model can accurately obtain the defect detection results for each cell area by comprehensively considering the illumination conditions and grayscale features of the cell area. Furthermore, in the defect detection model, the gamma correction sub-model is first used to extract features from the illumination map. After determining the gamma parameters of the corresponding cell area based on the illumination map, the grayscale map of that cell area is gamma-corrected to enhance the image of the grayscale map and eliminate the problem of uneven illumination. The enhanced grayscale map is then input into the feature extraction sub-model to obtain the grayscale features of each grayscale map. The classification sub-model maps the grayscale features of each grayscale map to the defect detection results, accurately obtaining the defect detection results for each cell area.
[0008] Preferably, dividing the photovoltaic panel image into multiple cell regions includes: performing a projection transformation on the photovoltaic panel image to obtain a front view; calculating the gradient value of each pixel in the front view; drawing a gradient value curve based on the average gradient value of each column; obtaining the peak points of the gradient value curve; adding perturbation values to each peak point; calculating the sum of the absolute values of the differences between the intervals of adjacent peak points and a preset interval as an objective function; using the perturbation value corresponding to the minimum value of the objective function as the target perturbation; and using the sum of each peak point and the target perturbation as the segmentation row of the cell; obtaining the segmentation column of the cell; and using the rectangular area enclosed by adjacent segmentation rows and adjacent segments as the cell region.
[0009] While using the peak points of the gradient curve to locate the segmentation rows, the absolute value of the difference between the interval between adjacent peak points and the preset interval is considered. The preset interval is related to the size of the solar cell, so as to achieve accurate positioning of the segmentation rows and thus accurately segment the solar cell area in the photovoltaic panel image.
[0010] Preferably, the photovoltaic panel image is an RGB image, and the method for obtaining the grayscale image and illumination image of each cell region includes: converting the photovoltaic panel image into a grayscale image, and using the image information of any cell region as the grayscale image of the cell region; converting the photovoltaic panel image to the HSV color space to obtain a brightness image, and using the image information of any cell region in the brightness image as the illumination image of the cell region.
[0011] Preferably, calculating the illumination complexity of each cell region in an arbitrary photovoltaic panel image includes: calculating the photovoltaic panel image... Average brightness value in the illumination map of the middle cell area and the two-dimensional image entropy of the illumination map. ; Battery cell area Illumination complexity for:
[0012] ; This is the reference value for brightness.
[0013] The illumination complexity of the cell area is evaluated by the degree of disorder in the brightness values and the degree of deviation between the average brightness and the brightness reference value. The greater the disorder in the brightness values in the illumination map, or the greater the average brightness, the greater the illumination complexity, thus achieving accurate quantification of illumination complexity.
[0014] Preferably, the gamma correction sub-model includes multiple convolutional layers and fully connected layers. The multiple convolutional layers are used to extract features from any illumination map to obtain illumination features. The illumination features are then input into the fully connected layers to obtain the gamma parameters corresponding to the illumination map. The feature extraction sub-model is a convolutional neural network. The classification sub-model is a logistic classification function or a Softmax classification function.
[0015] An end-to-end defect detection model is constructed. This model can determine the gamma parameters of the grayscale image of the corresponding cell region based on the illumination image, realize the adaptive enhancement of the grayscale image, and achieve defect detection results for each cell region.
[0016] Preferably, the loss function for:
[0017] ; The number of cell regions, This represents the number of photovoltaic panel images in the time series. Image of a photovoltaic panel Medium cell area Lighting complexity, Image of a photovoltaic panel The sum of the illumination complexity of each cell region in the battery, and Image of a photovoltaic panel Medium cell area Defect labels and defect detection results, This represents the cross-entropy loss.
[0018] A larger attention level is allocated to the battery cell area with high illumination complexity, and it is included in the construction of the loss function to ensure that the defect detection model can output accurate defect detection results under high illumination complexity.
[0019] Preferably, the training method for the defect detection model further includes: acquiring multiple grayscale features of each battery cell region in the time series; the loss function for:
[0020] ;
[0021] ;
[0022] in, The number of cell regions, This represents the number of photovoltaic panel images in the time series. Image of a photovoltaic panel Medium cell area Lighting complexity, Image of a photovoltaic panel The sum of the illumination complexity of each cell region in the battery, and Image of a photovoltaic panel Medium cell area Defect labels and defect detection results, For cross-entropy loss, This results in a loss of consistency. The consistency coefficient; Image of a photovoltaic panel Images of photovoltaic panels Medium cell area Similarity of illumination maps; and Images of photovoltaic panels Images of photovoltaic panels Medium cell area grayscale features; for and The Euclidean distance.
[0023] While constraining the defect detection results of each cell region to be defect labels, the model also constrains the consistency of grayscale features of the cell region under different lighting conditions. This enables the defect detection model to accurately extract defect features under different lighting conditions, ensuring the accuracy of the defect detection results.
[0024] Preferably, the similarity of the illumination images is calculated using a similarity calculation method based on Euclidean distance or structural similarity.
[0025] In a second aspect, this application also provides a photovoltaic cell defect detection device based on image processing, including a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, a photovoltaic cell defect detection method based on image processing according to the first aspect of this application is implemented.
[0026] The technical solution of this application has the following beneficial technical effects:
[0027] Because there are relative changes between the angle of sunlight and the orientation of the photovoltaic panel, the illumination conditions of each cell area on the panel will vary at different times. Therefore, the photovoltaic panel image is divided into multiple cell areas, and grayscale images and illumination images of each cell area are obtained. The illumination image can represent the illumination conditions of the corresponding cell area. Using the grayscale image and illumination image as input to the defect detection model, the defect detection results of each cell area can be accurately obtained by combining the illumination conditions and grayscale features of the cell area.
[0028] Furthermore, in the defect detection model, the gamma correction sub-model is first used to extract features from the illumination image. After determining the gamma parameters of the corresponding cell region based on the illumination image, the grayscale image of the cell region is gamma corrected to enhance the image and eliminate the problem of uneven illumination. The enhanced grayscale image is then input into the feature extraction sub-model to obtain the grayscale features of each grayscale image. The classification sub-model maps the grayscale features of each grayscale image to the defect detection result, accurately obtaining the defect detection result of each cell region. Attached Figure Description
[0029] Figure 1 This is a flowchart of a photovoltaic cell defect detection method based on image processing according to an embodiment of this application.
[0030] Figure 2 This is a structural diagram of a defect detection model according to an embodiment of this application.
[0031] Figure 3 This is a flowchart of a defect detection model training method according to an embodiment of this application.
[0032] Figure 4 This is a structural block diagram of a photovoltaic cell defect detection device based on image processing according to an embodiment of this application. Detailed Implementation
[0033] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0034] According to a first aspect of this application, this application provides a photovoltaic cell defect detection method based on image processing. Figure 1 This is a flowchart of a photovoltaic cell defect detection method based on image processing, according to an embodiment of this application. Figure 1 As shown, the photovoltaic cell defect detection method based on image processing includes steps S101 to S102, which are described in detail below.
[0035] S101 divides the photovoltaic panel image into multiple cell regions.
[0036] In one embodiment, a photovoltaic power station is equipped with a large number of photovoltaic panels, and each photovoltaic panel includes multiple cells arranged in a regular pattern. An image acquisition device with a fixed pose is deployed in the photovoltaic power station to acquire images of the photovoltaic panels. Alternatively, an image acquisition device can be carried by a drone to take pictures of the photovoltaic panels to obtain images of the photovoltaic panels. This application does not impose any restrictions.
[0037] Specifically, dividing the photovoltaic panel image into multiple cell regions includes: performing a projection transformation on the photovoltaic panel image to obtain a front view; calculating the gradient value of each pixel in the front view; drawing a gradient value curve based on the average gradient value of each column; obtaining the peak points of the gradient value curve; adding perturbation values to each peak point; calculating the sum of the absolute values of the differences between the intervals of adjacent peak points and a preset interval as the objective function; using the perturbation value corresponding to the minimum value of the objective function as the target perturbation; and using the sum of each peak point and the target perturbation as the segmentation row of the cell; obtaining the segmentation column of the cell; and using the rectangular area enclosed by adjacent segmentation rows and adjacent segments as the cell region.
[0038] Since the orientation of photovoltaic panels moves with the movement of sunlight, it is impossible to guarantee that the image acquisition device is capturing images from a frontal view when acquiring photovoltaic panel images. Therefore, it is necessary to use projection transformation to transform the acquired photovoltaic panel images into a frontal view.
[0039] Since all the cells on the photovoltaic panel are the same size and there are grid lines at the edges of the cells, there are obvious gradient features at the edges of the cells. In order to avoid the influence of environmental noise such as light or dust on the peak points, while using the peak points of the gradient curve to locate the segmentation rows, the absolute value of the difference between the interval of adjacent peak points and the preset interval is considered. The preset interval is related to the size of the cells, so as to achieve accurate positioning of the segmentation rows and thus accurately segment the cell areas in the photovoltaic panel image.
[0040] It should be noted that the perturbation values corresponding to each peak point are different, and the range of perturbation values is [missing information]. .
[0041] In this way, multiple cell regions in the photovoltaic panel image are obtained.
[0042] S102, input the grayscale image and illumination image of each cell area into the defect detection model, and output the defect detection results of each cell area.
[0043] In one embodiment, the photovoltaic panel image is an RGB image, and the method for obtaining the grayscale image and illumination image of each cell region includes: converting the photovoltaic panel image into a grayscale image, and using the image information of any cell region as the grayscale image of the cell region; converting the photovoltaic panel image to the HSV color space to obtain a brightness image, and using the image information of any cell region in the brightness image as the illumination image of the cell region.
[0044] In the HSV color space, H represents hue, S represents saturation, and V represents brightness. The image of the V channel is used as the brightness image.
[0045] The grayscale image and illumination image of each cell region are input into the defect detection model to obtain the defect detection results of each cell region in the photovoltaic panel image. The defect detection results include defective and defect-free.
[0046] Please see Figure 2 This is a structural diagram of a defect detection model according to an embodiment of this application. The defect detection model includes a gamma correction sub-model, a feature extraction sub-model, and a classification sub-model. The gamma correction sub-model is used to extract features from the illumination image and regress the feature extraction results into gamma parameters for each cell region. After gamma correction of each grayscale image based on the gamma parameters, the gamma is input into the feature extraction sub-model to obtain the grayscale features of each grayscale image. The classification sub-model maps the grayscale features of each grayscale image to the defect detection result.
[0047] The gamma correction sub-model includes multiple convolutional layers and fully connected layers. The multiple convolutional layers are used to extract features from any illumination image to obtain illumination features. The illumination features are then input into the fully connected layers to obtain the gamma parameters corresponding to the illumination image. The feature extraction sub-model includes multiple convolutional layers and can use existing convolutional neural network structures such as ResNet or VGGNet. The classification sub-model is a logistic classification function or a softmax classification function, used to perform binary classification on the grayscale features of any grayscale image to obtain the defect detection result of the grayscale image.
[0048] Specifically, the gamma correction sub-model can be used to obtain the gamma parameters corresponding to each cell region in the photovoltaic panel image. The gamma parameters corresponding to the cell regions are then used to perform gamma correction on the grayscale image of the cell region, thereby achieving adaptive enhancement of the photovoltaic panel image by region and eliminating the influence of uneven illumination in each cell region on defect detection.
[0049] Gamma correction can enhance images by stretching pixel values, and the gamma parameter directly affects the effect of image enhancement. Gamma correction is a well-known technique in the art and will not be elaborated here.
[0050] Thus, by inputting the grayscale image and illumination image of each cell area in the photovoltaic panel image into the defect detection model, the defect detection results of each cell area can be output.
[0051] In one embodiment, to ensure that the gamma correction sub-model can accurately output the gamma parameters of each cell region and that the defect detection model can accurately output the defect detection results of each cell region, the defect detection model needs to be trained. Please refer to [link to relevant documentation]. Figure 3 This is a flowchart of a defect detection model training method according to an embodiment of this application. The defect detection model training method includes steps S201 to S204, which are described in detail below.
[0052] S201, Obtain the time series of photovoltaic panel images and the defect labels of each cell area.
[0053] The photovoltaic panel image refers to the RGB image of any photovoltaic panel in the photovoltaic power station. The time series of the photovoltaic panel image includes the RGB image of the photovoltaic panel at each acquisition moment within a preset time period. The preset time period is 10 minutes or half an hour, and the time interval between adjacent sampling moments can be set manually, which is not limited in this application; it is assumed that the defect detection results of each battery area within the photovoltaic panel remain unchanged within the preset time period. For example, if the preset time period is half an hour and the time interval between adjacent sampling moments is 5 minutes, then the time series includes a total of 6 photovoltaic panel images.
[0054] During photovoltaic power generation, the angle of sunlight is constantly changing, and the angle of the photovoltaic panel also changes over time. Therefore, the brightness distribution of each cell area in the photovoltaic panel image is different at different acquisition times within a preset time period. However, the defect detection results of each cell area remain unchanged within the preset time period. Therefore, by simply labeling the photovoltaic panel image, the defect label of each cell area in each photovoltaic panel image in the time series can be obtained; the defect label is either defective or defect-free.
[0055] S202, calculate the illumination complexity of each cell region in an arbitrary photovoltaic panel image.
[0056] Different lighting environments will result in different brightness distributions in the battery cell area. The brightness distribution can obscure the defect features in the grayscale image, leading to missed detections and false detections. Therefore, the lighting complexity of each battery cell area is evaluated, and the defect detection model is trained to focus on battery cell areas with higher lighting complexity.
[0057] Specifically, calculating the illumination complexity of each cell region in an arbitrary photovoltaic panel image includes: calculating the photovoltaic panel image... Average brightness value in the illumination map of the middle cell area and the two-dimensional image entropy of the illumination map. ; Battery cell area Illumination complexity for:
[0058] ; This is the reference value for brightness.
[0059] Thus, the entropy of a two-dimensional image It can reflect the degree of disorder of brightness values in a lighting image. The larger the value, the more complex the brightness distribution. When all brightness values in a lighting image are the same, the entropy of the two-dimensional image is 0; the average brightness value... It can reflect the average brightness of the solar cell area. The brightness reference value is the median value of the brightness range. When the average brightness of the solar cell area is too bright or too dark, that is... When the value is large, it will overwhelm the defect features in the grayscale image, leading to missed detections and false detections.
[0060] In summary, the illumination complexity of the cell area is evaluated by the degree of disorder in the brightness values and the degree of deviation between the average brightness and the brightness benchmark value. The greater the illumination complexity, the greater the impact of the illumination on the cell area, and the more difficult it is to obtain accurate defect detection results.
[0061] S203: Based on the defect detection model, multiple defect detection results for each cell region in the time series are obtained. The cross-entropy loss between the defect label and the defect detection result is weighted and summed according to the illumination complexity to construct a loss function.
[0062] The time series contains multiple images of a photovoltaic panel, and the cell region in each photovoltaic panel image can be obtained. That is to say, one cell region corresponds to multiple grayscale images and multiple illumination images.
[0063] The grayscale image and illumination image of each photovoltaic cell region in the time series are obtained. Based on the defect detection model, the grayscale features and defect detection results of the cell region in each photovoltaic cell image are obtained. In this way, multiple grayscale features and multiple defect detection results of each cell region in the time series can be obtained.
[0064] For example, if the time series includes 6 photovoltaic panel images, and each photovoltaic panel image includes 10 cell regions, then 6 grayscale features and 6 defect detection results can be obtained for each cell region.
[0065] Specifically, the loss function for:
[0066] ; The number of cell regions, This represents the number of photovoltaic panel images in the time series. Image of a photovoltaic panel Medium cell area Lighting complexity, Image of a photovoltaic panel The sum of the illumination complexity of each cell region in the battery, and Image of a photovoltaic panel Medium cell area Defect labels and defect detection results, This represents the cross-entropy loss.
[0067] Thus, attention is allocated to each cell region in the photovoltaic panel image based on the complexity of illumination. In photovoltaic panel images, a larger attention is allocated to areas of the solar cells with high illumination complexity, and these areas are included in the construction of the loss function to ensure that the defect detection model can output accurate defect detection results under conditions of high illumination complexity.
[0068] In other embodiments, multiple grayscale features of each cell region can also be obtained. Since the time series contains grayscale images of the same cell region under different illumination patterns, and the grayscale features contain defect features within the cell region (the classification sub-model can obtain defect detection results based on the grayscale features, therefore, the grayscale features contain defect features within the cell region); in order to enable the defect detection model to accurately extract defect features under different illumination patterns and to ensure that the gamma correction sub-model can output accurate gamma parameters, while using the cross-entropy loss function to constrain the defect detection results during training, it is also necessary to constrain the consistency of grayscale features of the cell region under different illumination patterns.
[0069] Specifically, the loss function for:
[0070] ;
[0071] ;
[0072] in, The number of cell regions, This represents the number of photovoltaic panel images in the time series. Image of a photovoltaic panel Medium cell area Lighting complexity, Image of a photovoltaic panel The sum of the illumination complexity of each cell region in the battery, and Image of a photovoltaic panel Medium cell area Defect labels and defect detection results, For cross-entropy loss, This results in a loss of consistency. The consistency coefficient; Image of a photovoltaic panel Images of photovoltaic panels Medium cell area Similarity of illumination maps; and Images of photovoltaic panels Images of photovoltaic panels Medium cell area grayscale features; for and The Euclidean distance.
[0073] The similarity of the illumination images can be calculated using a similarity method based on Euclidean distance or structural similarity; this application makes no restriction. Consistency coefficient The value is 0.5.
[0074] Understandably, if the image of a photovoltaic panel... Images of photovoltaic panels Medium cell area The similarity of the illumination images is relatively high, so they should be allocated greater attention to encourage the grayscale characteristics of the same cell area to tend to be consistent under different illuminations. Approaching 0.
[0075] In this way, while constraining the defect detection results of each cell region to be defect labels, the consistency of grayscale features of the cell region under different lighting conditions is also constrained, enabling the defect detection model to accurately extract defect features under different lighting conditions and ensuring the accuracy of defect detection results.
[0076] S204. The defect detection model is iteratively updated using the gradient descent method until the loss function is less than the preset loss or the number of iterations is greater than the preset number, at which point the training is complete.
[0077] The gradient descent method updates the defect detection model along the direction where the loss function decreases. The defect detection model is iteratively updated. When the loss function is less than the preset loss or the number of iterations is greater than the preset number, it means that the defect detection model can accurately output the defect detection results of each battery cell area. The iterative update is stopped, and the trained defect detection model is obtained.
[0078] The preset loss is 0.01, and the preset number of attempts is 500.
[0079] According to a second aspect of this application, this application also provides a photovoltaic cell defect detection device based on image processing. Figure 4 This is a structural block diagram of a photovoltaic cell defect detection device based on image processing, according to an embodiment of this application. Figure 4 As shown, the device 50 includes a processor and a memory. The memory stores computer program instructions, which, when executed by the processor, implement the image processing-based photovoltaic cell defect detection method according to the first aspect of this application. The device also includes other components well-known to those skilled in the art, such as a communication bus and a communication interface. Their configuration and functions are known in the art and will not be described further here.
[0080] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A photovoltaic cell defect detection method based on image processing, characterized in that, The detection method includes: dividing the photovoltaic panel image into multiple cell regions; inputting the grayscale image and illumination image of each cell region into the defect detection model; and outputting the defect detection results of each cell region. The defect detection model includes a gamma correction sub-model, a feature extraction sub-model, and a classification sub-model. The gamma correction sub-model is used to extract features from the illumination image and regress the feature extraction results into gamma parameters for each cell region. After gamma correction of each grayscale image based on the gamma parameters, the gamma parameters are input into the feature extraction sub-model to obtain the grayscale features of each grayscale image. The classification sub-model maps the grayscale features of each grayscale image to the defect detection results. The training method for the defect detection model includes: acquiring time series images of photovoltaic panels and defect labels for each cell region; calculating the illumination complexity of each cell region in any photovoltaic panel image; acquiring multiple defect detection results for each cell region in the time series based on the defect detection model; constructing a loss function by weighted summation of the cross-entropy loss between the defect labels and defect detection results based on the illumination complexity; and iteratively updating the defect detection model using gradient descent until the loss function is less than a preset loss or the number of iterations is greater than a preset number, thus completing the training.
2. The photovoltaic cell defect detection method based on image processing according to claim 1, characterized in that, The step of dividing the photovoltaic panel image into multiple cell regions includes: Perform a projection transformation on the photovoltaic panel image to obtain a front view, and calculate the gradient value of each pixel in the front view. A gradient curve is plotted based on the average gradient value of each column. The peak points of the gradient curve are obtained. After adding perturbation values to each peak point, the sum of the absolute values of the differences between the intervals of adjacent peak points and the preset interval is calculated as the objective function. The perturbation value corresponding to the minimum value of the objective function is taken as the target perturbation. The sum of each peak point and the target perturbation is taken as the segmentation row of the solar cell. The segmentation column of the solar cell is obtained, and the rectangular area enclosed by adjacent segmentation rows and adjacent segments is taken as the solar cell area.
3. The photovoltaic cell defect detection method based on image processing according to claim 1, characterized in that, The photovoltaic panel image is an RGB image, and the methods for obtaining the grayscale image and illumination image of each cell area include: After converting the photovoltaic panel image into a grayscale image, the image information of any cell area is used as the grayscale image of the cell area. After converting the photovoltaic panel image to the HSV color space, a brightness image is obtained. The image information of any cell area in the brightness image is used as the illumination map of the cell area.
4. The photovoltaic cell defect detection method based on image processing according to claim 1, characterized in that, Calculating the illumination complexity of each cell region in an arbitrary photovoltaic panel image includes: Calculate photovoltaic panel images Average brightness value in the illumination map of the middle cell area and the two-dimensional image entropy of the illumination map. ; Battery cell area Illumination complexity for: ; This is the reference value for brightness.
5. The photovoltaic cell defect detection method based on image processing according to claim 1, characterized in that, The gamma correction sub-model includes multiple convolutional layers and fully connected layers. The multiple convolutional layers are used to extract features from any illumination map to obtain illumination features. The illumination features are then input into the fully connected layers to obtain the gamma parameters corresponding to the illumination map. The feature extraction sub-model is a convolutional neural network. The classification sub-model is a logistic classification function or a softmax classification function.
6. The photovoltaic cell defect detection method based on image processing according to claim 1, characterized in that, The loss function for: ; The number of cell regions, This represents the number of photovoltaic panel images in the time series. Image of a photovoltaic panel Medium cell area The complexity of illumination Image of a photovoltaic panel The sum of the illumination complexity of each cell region in the battery, and Image of a photovoltaic panel Medium cell area Defect labels and defect detection results, This represents the cross-entropy loss.
7. The photovoltaic cell defect detection method based on image processing according to claim 1, characterized in that, The training method for the defect detection model also includes: Obtain multiple grayscale features of each battery cell region in the time series; the loss function for: ; ; in, The number of cell regions, This represents the number of photovoltaic panel images in the time series. Image of a photovoltaic panel Medium cell area The complexity of illumination Image of a photovoltaic panel The sum of the illumination complexity of each cell region in the battery, and Image of a photovoltaic panel Medium cell area Defect labels and defect detection results, For cross-entropy loss, This results in a loss of consistency. The consistency coefficient; Image of a photovoltaic panel Images of photovoltaic panels Medium cell area Similarity of illumination maps; and Images of photovoltaic panels Images of photovoltaic panels Medium cell area grayscale features; for and The Euclidean distance.
8. The photovoltaic cell defect detection method based on image processing according to claim 7, characterized in that, Illumination image similarity is calculated using either Euclidean distance-based similarity calculations or structural similarity.
9. A photovoltaic cell defect detection device based on image processing, characterized in that, It includes a processor and a memory, the memory storing computer program instructions, which, when executed by the processor, implement a photovoltaic cell defect detection method based on image processing according to any one of claims 1 to 8.
Citation Information
Patent Citations
Photovoltaic cell panel inspection method based on deep learning
CN114021741A
Pipeline defect detection method and device in complex light environment
CN114359736A
Defect detection method and system for photovoltaic panel
CN116363097A