Photovoltaic panel defect detection system and method, computer equipment and storage medium
By using the YOLOv5s neural network model and the K-means++ clustering algorithm, combined with the SIoU loss function, the problems of complex operation and low recognition accuracy in photovoltaic panel defect detection are solved, and high-precision and efficient automatic recognition effect are achieved.
Patent Information
- Application Number
- CN202410640981.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-22
- Publication Date
- 2024-11-12
AI Technical Summary
The existing photovoltaic panel defect detection methods have problems such as complex operation and low recognition accuracy, especially the methods based on electrical characteristics are difficult to effectively detect defects, and the traditional image processing methods are poor in generalization and robustness.
The YOLOv5s neural network model is used to combine the K-means++ clustering algorithm and SIoU loss function. Through multiple rounds of training and data augmentation, an optimized photovoltaic panel defect detection model is generated, and images are collected by infrared drones for automatic recognition.
It realizes high-precision automatic identification of photovoltaic panel defects, improves generalization ability and recognition efficiency, and solves the problems of traditional methods that target single scenes and low recognition accuracy.
Smart Images

Figure CN118941493A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of photovoltaic panel defect detection, and relates to a photovoltaic panel defect detection system, method, computer equipment and storage medium. Background Art
[0002] As the core component of the photovoltaic power generation system, the performance of photovoltaic cell modules directly affects the power generation efficiency and service life of the entire system. However, during the production and use process, various defects such as hot spots, missing parts, and cracks are prone to appear on the surface of photovoltaic cell modules, which seriously affect their power generation efficiency. Therefore, automated defect detection and quality control of photovoltaic cell modules to ensure their performance indicators are the key to ensuring the long-term efficient and stable operation of the entire photovoltaic power generation system.
[0003] There are two main methods for detecting defects in photovoltaic panels: The first method is to analyze the physical characteristics of photovoltaic panels to detect defects in photovoltaic panels. The basic idea is to deploy sensors around photovoltaic panels to collect the electrical parameters and working environment values of photovoltaic panels when they are working, such as the output voltage, output current, output power of photovoltaic modules, and the intensity of solar radiation, temperature between panels, humidity, etc., and then use these data to analyze the output characteristics of the circuit using neural networks, numerical analysis, expert systems and other methods to determine the fault type of the photovoltaic panel. Photovoltaic panel defect detection methods based on electrical characteristics have many difficulties and complex operations.
[0004] The second method is photovoltaic panel defect detection based on image features. Collect images of photovoltaic panels under visible light, infrared imaging, and electro-imaging, analyze image features, and use various image processing algorithms to detect photovoltaic panel defects. Traditional image processing methods rely on manually designed feature extractors, which cannot cover many complex photovoltaic scenes, and the algorithm has poor generalization and robustness. Summary of the invention
[0005] The present invention provides a photovoltaic panel defect detection system, method, computer equipment and storage medium, which solve the problems of difficulty and low precision in the existing photovoltaic panel defect detection.
[0006] In order to achieve the above-mentioned object of the invention, the technical solution adopted by the present invention is:
[0007] A photovoltaic panel defect detection method comprises the following steps:
[0008] Step 1, obtaining the original image of the photovoltaic panel, preprocessing the original image of the photovoltaic panel, and obtaining an enhanced image of the photovoltaic panel;
[0009] Step 2: Input the photovoltaic panel enhanced image into the trained YOLOv5s neural network model for recognition, and output the photovoltaic panel defect labeling result map;
[0010] In step 2, the training process of the YOLOv5s neural network model is:
[0011] Step 2.1, obtaining multiple original images of photovoltaic panels, preprocessing the original images of photovoltaic panels, and obtaining enhanced images of photovoltaic panels;
[0012] Step 2.2, marking defects of the photovoltaic panel enhanced image to generate a marked image;
[0013] Step 2.3: Take the original image and the annotated image of the photovoltaic panel as the photovoltaic panel defect image dataset, replace the K-means clustering algorithm of the YOLOv5s neural network with the K-means++ algorithm, and re-cluster the anchor box size of the new dataset according to the marked defect location information;
[0014] The photovoltaic panel defect image dataset is input into the YOLOv5s neural network model for multiple rounds of training to obtain the optimal weight parameters and obtain a trained photovoltaic panel defect detection model.
[0015] Furthermore, the photovoltaic panel defect image dataset is divided into a training set and a validation set;
[0016] In step 2.3, when the YOLOv5s neural network model performs the nth round of training, the classification result data of each pixel point of the photovoltaic panel defect enhanced image in the training set is first obtained, and the loss function is used to calculate the classification result data and the value of each pixel point of the labeled image obtained in step 2.2 to obtain the loss value;
[0017] The loss value is back-propagated to the YOLOv5s neural network model for parameter update, and then the YOLOv5s network model with updated parameters is used to perform forward inference on the validation set, and the SIoU value is calculated using the inference result and the annotated image obtained in step 2.2;
[0018] The calculated SIoU value is compared with the highest SIoU value in the previous n-1 rounds, and the network structure and model parameters with the highest SIoU value are saved as the optimal photovoltaic panel defect detection model.
[0019] Furthermore, in step 1, an infrared drone is used to obtain original images of photovoltaic panels in different scenes.
[0020] Furthermore, in step 1 and step 2.1, the preprocessing is used to perform data expansion on the image, and the data expansion method is horizontal flipping, vertical flipping, random cropping, rotation or adding noise.
[0021] Further, step 2.2 is specifically as follows:
[0022] Use Labelme software to annotate the enhanced image of the photovoltaic panel and generate a json file containing the annotation name and annotation position; use Python language and opencv library to batch process the original image of the photovoltaic panel and the corresponding json file to generate annotated images.
[0023] Furthermore, the YOLOv5s network includes a backbone network and a neck network;
[0024] The backbone network uses the Conv structure and C3 structure to extract feature information from the input image data, reducing the 5-times downsampling of the YOLOv5s neural network to 4-times downsampling; and then fuses the local features and global feature maps through the SPPF structure;
[0025] The neck network uses the structure of FPN and PAN to fuse the different scale features of the backbone network;
[0026] The output of the YOLOv5s network uses the SIoU loss function instead of the CIoU loss function as the standard metric.
[0027] Furthermore, the backbone network and the neck network are connected through the IRN module, which is composed of SiLU activation function, multi-scale convolution and residual connection. The input image is passed through the backbone network to extract feature maps of different scales as the input feature map. The input feature map passes through the SiLU activation function, and then performs convolution of different scales. Finally, the input feature map and the convolved feature map are connected through the residual connection.
[0028] The present invention also discloses a photovoltaic panel defect detection system, comprising:
[0029] A data preprocessing module is used to preprocess the original image of photovoltaic panel defects to obtain an enhanced image of photovoltaic panel defects;
[0030] The image detection module is used to input the photovoltaic panel defect enhanced image into the trained YOLOv5s neural network model, detect the photovoltaic panel defect image, and obtain the photovoltaic panel defect image detection result map.
[0031] The present invention also discloses a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the photovoltaic panel defect detection method when executing the computer program.
[0032] The present invention also discloses a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the photovoltaic panel defect detection method are implemented.
[0033] Compared with the prior art, the present invention has the following beneficial effects:
[0034] The present invention discloses a photovoltaic panel defect detection method, which can make full use of the advantages of deep learning. After one-time labeling, photovoltaic panel defect images of various backgrounds and categories can be end-to-end batch recognized. It has strong universality and generalization ability, and solves the problem that traditional image processing methods are single for a scene and need to design a specific solution for each type of scene, eliminating the design and implementation of complex algorithms and improving work efficiency. On the other hand, the traditional image processing method has low recognition accuracy and poor segmentation effect due to its less information focus. The photovoltaic panel defect detection method proposed by the present invention is based on the YOLOv5s network structure, which has a large number of channel connections between upsampling and downsampling, and can effectively utilize the deep and shallow features of the image, retain the underlying details of the image, improve the recognition accuracy of photovoltaic panel defects, and has strong generalization ability, realizing the automatic recognition of photovoltaic panel defects.
[0035] The anchor boxes configured by the YOLOv5s neural network model are clustered in the COCO dataset using the K-means clustering algorithm. In order to make the anchor boxes more consistent with the characteristics of this dataset, which has many small objects and few large objects, the improved K-means++ clustering algorithm is used to replace them, so that the size of the clustered anchor boxes is more consistent with this dataset, which can improve the final recognition accuracy.
[0036] Furthermore, when saving the final network recognition model, only the network model with the highest SIoU value is retained, which not only ensures the accuracy and reliability of the recognition model, but also avoids excessive storage space occupation caused by retaining too many models, as well as the extra workload of ultimately selecting the optimal model.
[0037] Furthermore, the present invention connects the IRN module to the backbone network and the neck network, and fuses the features of the two, thereby improving the network feature extraction. The IRN module is composed of SiLU activation function, multi-scale convolution and residual connection. First, the input feature map is passed through the SiLU activation function, and then convolutions of different scales are performed. Finally, the input feature map and the convolved feature map are connected through residual connection. It is possible to obtain receptive fields of different sizes and avoid the gradient vanishing problem caused by the deepening of the network hierarchy. Simplified BiFPN is also used to improve the recognition accuracy of the algorithm. The IRN module is used to improve the recognition accuracy of the algorithm and reduce the difficulty of network training, thereby speeding up network training; the SIoU loss function can improve the network recognition accuracy.
[0038] Furthermore, the backbone network only performs 4 downsampling times, and the structure is also simplified. The reduced number of downsampling times means that the underlying feature information with higher resolution is retained, which is more sensitive to the detection of small targets. The backbone network is improved in terms of high algorithm recognition accuracy, faster network training, and reduced network parameter volume. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1It is a schematic diagram of the process of the present invention;
[0040] Figure 2 It is the YOLOv5s neural network structure diagram of the present invention;
[0041] Figure 3 The original defect image of the photovoltaic panel to be detected by the present invention;
[0042] Figure 4 This is a YOLOv5s network detection result diagram of the photovoltaic panel defect image of the present invention. DETAILED DESCRIPTION
[0043] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0044] It should be noted that the terms "including" and "having" and any variations thereof in the specification and claims of the present invention and the above-mentioned drawings are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0045] The present invention is further described in detail below in conjunction with the accompanying drawings:
[0046] like Figure 1 As shown, the present invention discloses a photovoltaic panel defect detection method, comprising the following steps:
[0047] Step 1, obtaining the original image of the photovoltaic panel, preprocessing the original image of the photovoltaic panel, and obtaining an enhanced image of the photovoltaic panel;
[0048] Step 2: Input the photovoltaic panel enhanced image into the trained YOLOv5s neural network model for recognition, and the output is as follows: Figure 4 The photovoltaic panel defect image detection result diagram shown;
[0049] In step 2, the training process of the YOLOv5s neural network model is:
[0050] Step 2.1, obtaining multiple original images of photovoltaic panels, preprocessing the original images of photovoltaic panels, and obtaining enhanced images of photovoltaic panels;
[0051] Step 2.2, annotate the photovoltaic panel enhanced image to generate an annotated image;
[0052] Step 2.3: The original image and the annotated image of the photovoltaic panel are used together as a photovoltaic panel defect image dataset. The photovoltaic panel defect image dataset is input into the YOLOv5s neural network model for multiple rounds of training to obtain the optimal weight parameters and obtain a trained photovoltaic panel defect detection model.
[0053] The specific steps for making a photovoltaic panel defect image dataset are as follows:
[0054] like Figure 3 As shown, the original image of the photovoltaic panel is preprocessed to obtain an enhanced image of the photovoltaic panel;
[0055] The specific preprocessing is: use Python's opencv library to perform batch horizontal and vertical flipping, cropping or adding noise to the images for data enhancement to enhance the robustness of the network model.
[0056] Use Labelme software to annotate the data and set the photovoltaic panel defect label name as target. After the labeling is completed, a corresponding json file will be generated for each image.
[0057] Use Python language and opencv library to batch process photovoltaic panel enhanced images and corresponding json files to generate labeled images.
[0058] Then, the photovoltaic panel enhanced image and the generated annotated image with the same name are placed in two folders, named Img and label, and input into the YOLOv5s network for training.
[0059] In layman's terms, the "labeled image" is the "standard answer" provided manually. During the training process, the network determines the accuracy of its current training results by comparing the "labeled image". The difference between the predicted value and the labeled image (true value) after each round of network training is calculated through the loss function. After the calculation, the parameters are updated and the next round of training is carried out until it gets closer and closer to the true value. Therefore, the photovoltaic panel defect image dataset consists of two parts, one is the original image of the photovoltaic panel defect, and the other is the generated labeled image.
[0060] 2. Network model construction
[0061] The YOLOv5s deep learning network framework is widely used in target detection. It does not require a lot of data, so it can be easily and efficiently applied to various scenarios. Figure 2As shown in the figure, the YOLOv5s network mainly consists of an input end, a backbone network, a neck network, and an output end. The input end is responsible for preprocessing and adjusting the image to adapt it to the requirements of the network. Typically, this includes operations such as image scaling, cropping, normalization, and format conversion. The backbone network is used to extract feature maps of different scales. The neck network is used to further enhance the feature expression capability and promote the fusion of information at different scales, and process the feature maps extracted by the backbone network. The output end is responsible for generating detection results and post-processing. The output end accepts the feature map output by the neck network and converts it into a bounding box and category prediction. YOLOv5 uses anchor boxes and prediction heads to detect objects in images. Anchor boxes are used to define candidate boxes of different scales and aspect ratios, while prediction heads are used to predict the bounding box coordinates and category probabilities of each anchor box. The output end also performs post-processing steps such as non-maximum suppression to filter and merge overlapping bounding boxes to obtain the final detection results.
[0062] As attached Figure 2 As shown, the YOLOv5s neural network established by the present invention for identifying defects in photovoltaic panels consists of the following parts. First, the image to be detected is input into the YOLOv5s model. Before input, the image usually needs to be preprocessed, including operations such as scaling, cropping, and normalization to make it meet the requirements of the model. Secondly, the input image is subjected to feature extraction through the backbone network. The YOLOv5s backbone network adopts a CSP architecture, which consists of a series of convolutional layers and pooling layers for extracting high-level features from images. These features have different scales and semantic information and can capture the contextual relationship of the target. Again, the feature pyramid network and the feature fusion network are combined to further improve the processing feature information. YOLOv5s uses anchor boxes and prediction heads for target detection. Anchor boxes are a predefined set of candidate boxes of different scales and aspect ratios used to represent areas that may contain targets. The prediction head is responsible for predicting the bounding box coordinates and category probabilities of each anchor box. In the generated bounding boxes, there may be overlapping candidate boxes. In order to obtain the final detection result, post-processing and filtering steps need to be performed. Common post-processing techniques include non-maximum suppression (NMS), which removes redundant detection results by filtering and merging overlapping bounding boxes through thresholds and retains the bounding boxes with the highest confidence. Finally, the final detection result after post-processing is obtained. Each detection result usually includes information such as the target category, the location of the bounding box, and the confidence level, which can be used to mark and identify targets in the image.
[0063] As attached Figure 2As shown, the anchor frame of the YOLOv5s neural network established by the present invention for identifying defects in photovoltaic panels is improved using the K-means++ algorithm. The YOLOv5s anchor frame is generated by K-means algorithm clustering based on the COCO dataset, and the size of the anchor frame is adjusted using a genetic algorithm. However, the results of the K-means algorithm are greatly affected by the selection of the initial clustering center. Different initial selections may lead to different clustering results, so multiple runs are required to obtain more stable results. In addition, the data distribution of the self-built dataset in this article is different from that of the COCO dataset. The present invention recalculates the k value and uses the K-means++ algorithm to re-cluster the anchor frame size, so that the clustering center can better represent the distribution of the dataset, thereby improving the convergence speed and clustering effect of the clustering algorithm.
[0064] The present invention uses a simplified BiFPN network structure. When the input and output nodes have the same scale, a jump fusion path is added between the input module and the output module at the same level in the network, which can enhance the detection ability of the neck network for small defect targets.
[0065] BiFPN is a multi-scale feature fusion network structure for target detection. BiFPN achieves more efficient and accurate multi-scale feature fusion by introducing bidirectional connections and weighted fusion mechanisms. Additional cross-scale connections are added in the top-down and bottom-up paths so that features can be directly transferred and fused between nodes of different scales. At the same time, BiFPN adds learnable weights to each input feature to characterize the importance of different features in order to better fuse features of each scale. In this way, BiFPN can make more full use of feature information at different levels and provide more accurate and rich multi-scale feature representations, thereby improving the performance of target detection. Drawing on the core idea of BiFPN, cross-scale connections are added between input nodes and output nodes of the same scale. The simplified BiFPN network meets the data characteristics of photovoltaic panel defect images with small and simple features, and can achieve better results.
[0066] The 3rd layer of the backbone network is the large target feature layer, the 4th layer is the medium target feature layer, and the 5th layer is the small target feature layer. They are fused into the 2nd, 3rd, and 4th layers, that is, the network input data is downsampled 2, 3, and 4 times and then fused with the neck network features. The modified network finally outputs feature maps with scales of 160×128, 80×64, and 40×32. Therefore, the backbone network only downsamples 4 times and the structure is simplified. The reduced number of downsampling means that higher-resolution underlying feature information is retained, which is more sensitive to the detection of small targets.
[0067] The present invention connects the IRN module to the backbone network and the neck network, and fuses the features of the two, thereby improving the network feature extraction. The IRN module consists of SiLU activation function, multi-scale convolution and residual connection. First, the input image is passed through the backbone network to extract feature maps of different scales as the input feature map; the input feature map passes through the SiLU activation function, and then convolutions of different scales are performed, and finally the input feature map and the convolved feature map are connected through the residual connection method. It can not only obtain receptive fields of different sizes, but also avoid the gradient vanishing problem of deepening the network layer. In order to improve the small target detection effect of YOLOv5s in this data set, the target detection part is improved.
[0068] Figure 2 In the figure, the C3 structure is composed of convolution layer + batch normalization layer + SiLU activation layer.
[0069] The present invention uses SIoU as the loss function in the target detection box to measure the difference between the predicted box and the real box. The design of SIoU enables the network to quickly optimize the direction of the box in the early stage of training, optimize the position in the middle stage, and approximate the aspect ratio in the late stage, thereby achieving faster and more accurate box regression.
[0070] 3. Model Training
[0071] The photovoltaic panel defect enhanced images and the corresponding json files are used to generate annotated images, and then a photovoltaic panel defect dataset is produced, which contains photovoltaic panel defect enhanced images and annotated images. The photovoltaic panel defect enhanced images and the corresponding annotated images are included, and the photovoltaic panel defect enhanced images and annotated images are used to generate training sets, validation sets, and test sets in a ratio of 7:2:1.
[0072] Regarding the segmentation of training set, validation set and test set, when generating the annotated graph, the default name of the image is the same as the original image name. When segmenting these three parts, they are divided into 7:2:1 according to the image name. For example, if the image is named "Img1", there are two corresponding images, one is the original image and the other is the annotated image. That is, an original image and a annotated image can be regarded as a whole, one is used for training and learning, and the other is used to compare and observe the accuracy of network learning.
[0073] The prepared photovoltaic panel defect image and the generated annotated image are input into the built YOLOv5s network, and the Dropout method is used for training. The training is stopped when the number of training times reaches the preset threshold. After each training, the SIoU value in the model obtained by the current round of training is compared with the highest SIoU value in history. SIoU (intersection over union ratio) is a standard metric for image recognition, which refers to the calculation of the intersection over union ratio of two sets. In this case, it is the ratio of the intersection and union of the pixel values of the annotated image generated by the annotation and the pixel values of the predicted image obtained by network training. The value is between 0 and 1, and the closer to 1, the more accurate the prediction result. The obtained accuracy is compared with the best historical accuracy in the model (accuracy refers to the specific indicator SIoU), and then the photovoltaic panel defect detection model with the highest SIoU value is taken as the final result.
[0074] The formula for SIoU is:
[0075]
[0076] Among them, V represents the angle loss cost between the real box and the predicted box, and Ω represents the shape loss cost between the real box and the loss box at a certain angle.
[0077] The design of SIoU enables the network to quickly optimize the orientation of the box in the early stage of training, optimize the position in the middle stage, and approximate the aspect ratio in the late stage, thereby achieving faster and more accurate box regression.
[0078] In this invention, the accuracy function used by the YOLOv5s neural network is:
[0079]
[0080] Among them, TP is the number of positive samples correctly judged as positive by the model, and FP is the number of negative samples incorrectly judged as positive by the model.
[0081] The accuracy function is used to evaluate the difference between the photovoltaic panel defect images generated during network training and the annotation images generated by manual annotation, which will be fed back to the network for parameter update during the training process.
[0082] 4. Example Effect
[0083] In this embodiment, a total of 3200 photovoltaic panel defect images were collected and constructed, of which 2240 images were used as training sets, 640 images were used as validation sets, and 320 images were used as test sets. The model with the highest accuracy on the validation set was selected as the final model and applied to the test set. The average performance of the model on the test set is shown in the following table:
[0084] Dataset Training duration Precision mAP FPS Photovoltaic panel defect image 12.5h 97.3 96.3 46.3
[0085] Intuitively, according to the accuracy values and mAP values in the above table, the photovoltaic panel defects in the image can be basically detected with high accuracy and good recognition effect.
[0086] When a photovoltaic panel defect image is input into the network in this application example, the network forward propagates and outputs the defect category of the photovoltaic panel defect image, and then compares it with the pixel value of the annotation image generated by manual annotation, and uses the loss function to calculate the gap value. The error value is back-propagated to the network using the chain rule. During back-propagation, the optimizer uses Adam to update the parameters in the network, such as the convolution kernel value, bias, etc., and determines whether to save this round of network model according to the SIoU value. At this point, one round of training is completed. In the example of the present invention, the total number of iterations of the YOLOv5s network model epochs is 300, the initial learning rate is set to 0.0005, and the cosine annealing algorithm is used to adjust the learning rate.
[0087] In an exemplary embodiment, a computer-readable storage medium is also provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the photovoltaic panel defect detection method are implemented. The computer storage medium can be any available medium or data storage device that can be accessed by a computer, including but not limited to magnetic storage (such as floppy disk, hard disk, magnetic tape, magneto-optical disk (MO), etc.), optical storage (such as CD, DVD, BD, HVD, etc.), and semiconductor storage (such as ROM, E PRO M, EEPROM, non-volatile memory (NANDFLASH), solid state drive (SSD)), etc.
[0088] In an exemplary embodiment, a computer device is also provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the photovoltaic panel defect detection method when executing the computer program. The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc.
[0089] The photovoltaic panel defect detection method proposed in the present invention is a method that directly outputs an image annotation from the input photovoltaic panel defect original image. The backbone network and the neck network of the YOLOv5s network are connected, so that the network can fuse the shallow and deep features of the image, effectively retain the image details, and perform higher-precision detection.
[0090] The present invention can make full use of the advantages of the image detection model YOLOv5s network, realize end-to-end photovoltaic panel defect detection, and solve the problem that the traditional image processing method is applicable to a single scene. On the other hand, the traditional image processing method has complex operation steps, the algorithm is too targeted, and the universality is weak. It cannot solve the problem in batches and has low work efficiency. The photovoltaic panel defect detection method proposed in the present invention not only improves the recognition accuracy, but also has a strong generalization ability, and realizes the automatic recognition of photovoltaic panel defects.
[0091] The above contents are only for explaining the technical idea of the present invention and cannot be used to limit the protection scope of the present invention. Any changes made on the basis of the technical solution in accordance with the technical idea proposed by the present invention shall fall within the protection scope of the claims of the present invention.
Claims
1. A photovoltaic panel defect detection method, characterized in that: The following steps are involved: Step 1, obtaining the original image of the photovoltaic panel, preprocessing the original image of the photovoltaic panel, and obtaining an enhanced image of the photovoltaic panel; Step 2: Input the photovoltaic panel enhanced image into the trained YOLOv5s neural network model for recognition, and output the photovoltaic panel defect labeling result map; In step 2, the training process of the YOLOv5s neural network model is: Step 2.1, obtaining multiple original images of photovoltaic panels, preprocessing the original images of photovoltaic panels, and obtaining enhanced images of photovoltaic panels; Step 2.2, marking defects of the photovoltaic panel enhanced image to generate a marked image; Step 2.3: Take the original image and the annotated image of the photovoltaic panel as the photovoltaic panel defect image dataset, replace the K-means clustering algorithm of the YOLOv5s neural network with the K-means++ algorithm, and re-cluster the anchor box size of the new dataset according to the marked defect location information; The photovoltaic panel defect image dataset is input into the YOLOv5s neural network model for multiple rounds of training to obtain the optimal weight parameters and obtain a trained photovoltaic panel defect detection model.
2. A photovoltaic panel defect detection method according to claim 1, characterized in that: The photovoltaic panel defect image dataset is divided into a training set and a validation set; In step 2.3, when the YOLOv5s neural network model performs the nth round of training, the classification result data of each pixel point of the photovoltaic panel defect enhanced image in the training set is first obtained, and the loss function is used to calculate the classification result data and the value of each pixel point of the labeled image obtained in step 2.2 to obtain the loss value; The loss value is back-propagated to the YOLOv5s neural network model for parameter update, and then the YOLOv5s network model with updated parameters is used to perform forward inference on the validation set, and the SIoU value is calculated using the inference result and the annotated image obtained in step 2.2; The calculated SIoU value is compared with the highest SIoU value in the previous n-1 rounds, and the network structure and model parameters with the highest SIoU value are saved as the optimal photovoltaic panel defect detection model.
3. A photovoltaic panel defect detection method according to claim 1, characterized in that: In step 1, an infrared drone is used to obtain original images of photovoltaic panels in different scenes.
4. A photovoltaic panel defect detection method according to claim 1, characterized in that: In step 1 and step 2.1, the preprocessing is used to perform data expansion on the image, and the data expansion method is horizontal flipping, vertical flipping, random cropping, rotation or adding noise.
5. A photovoltaic panel defect detection method according to claim 1, characterized in that: Step 2.2 is as follows: Use Labelme software to annotate the enhanced image of the photovoltaic panel and generate a json file containing the annotation name and annotation position; use Python language and opencv library to batch process the original image of the photovoltaic panel and the corresponding json file to generate annotated images.
6. A photovoltaic panel defect detection method according to claim 1, characterized in that: The YOLOv5s network includes a backbone network and a neck network; The backbone network uses the Conv structure and C3 structure to extract feature information from the input image data, reducing the 5-times downsampling of the YOLOv5s neural network to 4-times downsampling; and then fuses the local features and global feature maps through the SPPF structure; The neck network uses the structure of FPN and PAN to fuse the different scale features of the backbone network; The output of the YOLOv5s network uses the SIoU loss function instead of the CIoU loss function as the standard metric.
7. A photovoltaic panel defect detection method according to claim 6, characterized in that: The backbone network and the neck network are connected through the IRN module, which consists of SiLU activation function, multi-scale convolution and residual connection. The input image is passed through the backbone network to extract feature maps of different scales as the input feature map. The input feature map passes through the SiLU activation function, and then performs convolution of different scales. Finally, the input feature map and the convolved feature map are connected through the residual connection.
8. A photovoltaic panel defect detection system based on the photovoltaic panel defect detection method according to any one of claims 1 to 7, characterized in that: include: A data preprocessing module is used to preprocess the original image of photovoltaic panel defects to obtain an enhanced image of photovoltaic panel defects; The image detection module is used to input the photovoltaic panel defect enhanced image into the trained YOLOv5s neural network model, detect the photovoltaic panel defect image, and obtain the photovoltaic panel defect image detection result map.
9. A computer device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the photovoltaic panel defect detection method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the photovoltaic panel defect detection method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Image target detection method based on deep learning
CN117372732A
Cited By
Photovoltaic cell defect detection method and device, computer equipment and storage medium
CN119477906A
Photovoltaic panel defect detection method, system, equipment and medium
CN119851046A
Double-stage photovoltaic panel defect detection method and system based on multispectral spatial model
CN120147225A
Photovoltaic module bird droppings defect detection method and system
CN120525887A
