Photovoltaic panel defect detection method and device based on dense connection and medium
By combining the dense connection structure of DenseNet121 and YOLOv4 networks, efficient and accurate identification of photovoltaic panel defect detection is achieved, which solves the problems of low efficiency and poor accuracy in the existing technology, improves the robustness and adaptability of detection, and prolongs the life of photovoltaic panels. Extends the panel’s service life and reduces operation and maintenance costs.
Patent Information
- Application Number
- CN202410678180.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-29
- Publication Date
- 2024-09-17
AI Technical Summary
Existing photovoltaic panel defect detection methods have low efficiency and poor accuracy, are difficult to deal with complex defect types and lighting conditions, and are not efficient in processing large-scale image data.
A photovoltaic panel defect detection method based on dense connections is adopted, combined with the Neck feature fusion layer and Head prediction layer of the DenseNet121 network and YOLOv4 network, to achieve efficient and accurate defect detection through preprocessing, feature extraction, feature fusion and classification regression.
It improves the accuracy and efficiency of photovoltaic panel defect detection, has good robustness and adaptability, and can accurately identify defect types and locations in complex environments, extending the service life of photovoltaic panels and reducing operation and maintenance costs.
Smart Images

Figure CN118657953A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of target detection technology, and in particular to a densely connected photovoltaic panel defect detection method, device and medium. Background Art
[0002] Photovoltaic technology, as a clean and renewable form of energy, has received widespread attention and application around the world. As the core component of the photovoltaic system, the performance and stability of photovoltaic panels are directly related to the power generation efficiency and economic benefits of the entire system. However, during the production, transportation, installation and use of photovoltaic panels, various defects such as cracks, stains, and shading will inevitably occur. These defects will not only affect the aesthetics of the photovoltaic panels, but more importantly, they will reduce their power generation efficiency and lifespan, and may even cause failure of the entire photovoltaic system.
[0003] Traditional methods for photovoltaic panel defect detection mainly rely on manual visual inspection or use simple image processing technology. However, with the expansion of photovoltaic panel scale and the diversification of defect types, these methods can no longer meet the needs of efficient and accurate detection. Manual inspection is not only inefficient, but also easily affected by subjective factors and fatigue, resulting in missed detection or false detection. Simple image processing technology is difficult to cope with complex and changing defect types and lighting conditions.
[0004] In recent years, deep learning technology has made breakthrough progress in the field of image recognition and processing, providing a new solution for photovoltaic panel defect detection. Deep learning technology can accurately identify and classify complex objects by automatically learning the feature information in the image. In photovoltaic panel defect detection, deep learning technology can automatically extract the feature information of defects, and classify and locate them efficiently and accurately.
[0005] However, the existing deep learning-based photovoltaic panel defect detection methods still face some challenges. First, the types of photovoltaic panel defects are diverse and their forms vary, requiring the detection method to have strong feature extraction and classification capabilities. Second, photovoltaic panel images are often affected by complex environments such as lighting conditions and shadows, requiring the detection method to have good robustness and adaptability. Finally, in practical applications, large-scale photovoltaic panel image data needs to be processed, requiring the detection method to have efficient processing capabilities. Summary of the invention
[0006] The purpose of the present invention is to provide a method, device and medium for detecting defects of densely connected photovoltaic panels with high detection accuracy.
[0007] The purpose of the present invention can be achieved by the following technical solutions:
[0008] A photovoltaic panel defect detection method based on dense connection includes the following steps:
[0009] Collect image data of photovoltaic panels, perform preprocessing, input into a pre-trained defect target detection model, and output photovoltaic panel defect detection results. The defect detection model includes a DenseNet121 network, a Neck feature fusion layer of a YOLOv4 network, and a Head prediction layer;
[0010] The steps performed by the defect detection model include:
[0011] The preprocessed image data is input into the DenseNet121 network for dense connection to extract features of different sizes and obtain feature maps of multiple sizes;
[0012] Inputting the feature maps of the multiple sizes into the Neck feature fusion layer for feature fusion to obtain a fused feature map;
[0013] The fused feature map is input into the Head prediction layer for classification regression, and the defect detection result is output.
[0014] Furthermore, the preprocessing operation includes denoising, enhancement and normalization.
[0015] Furthermore, the DenseNet121 network includes 4 parts, each of which includes a convolutional layer and a Dense Block dense connection module and a pooling layer connected thereto in sequence, and the step of obtaining feature maps of multiple sizes includes:
[0016] Inputting the preprocessed image data into the convolution layer to perform preliminary feature extraction to obtain local low-level features;
[0017] Inputting the local low-level features into the Dense Block dense connection module to perform dense connection and extract feature maps of initial multiple sizes;
[0018] Downsampling the feature maps of the initial multiple sizes using the pooling layer;
[0019] The above steps are repeated in the last three parts to gradually extract higher-level features and obtain the final feature maps of multiple sizes.
[0020] Furthermore, the local low-level features include edge information, texture features, color information and structure information.
[0021] Furthermore, during the feature fusion process performed by the Neck feature fusion layer, the feature maps of the multiple sizes are upsampled or downsampled according to the resolution size.
[0022] Furthermore, the Head prediction layer is designed as a decoupled head, which processes the fused feature map through convolution to obtain a defect detection result, which includes a target defect, a target defect category and a target defect position.
[0023] Furthermore, during the training process of the defect target detection model, the optimization strategies of hyperparameter adjustment, regularization and performance evaluation are used to optimize the model.
[0024] Furthermore, the defect target detection model uses data enhancement operations to expand the training set during the training process, and the data enhancement operations include flipping, scaling, mirroring, contrast adjustment and noise addition.
[0025] The present invention also provides an electronic device, comprising: one or more processors; a memory; and one or more programs stored in the memory, wherein the one or more programs include instructions for executing the densely connected photovoltaic panel defect detection method as described above.
[0026] The present invention also provides a computer-readable storage medium, comprising one or more programs for execution by one or more processors of an electronic device, wherein the one or more programs include instructions for executing the densely connected photovoltaic panel defect detection method as described above.
[0027] Compared with the prior art, the present invention has the following beneficial effects:
[0028] (1) The present invention utilizes the unique dense connection mechanism of the DenseNet121 network to achieve efficient propagation and reuse of features, and can provide better feature extraction capabilities, so that the network can more deeply capture more subtle and complex defect features in the image, and then perform target detection through the participation of the YOLOv4 network. Not only will the overall network structure not be bloated, but it can also accurately identify the type and location of the defect.
[0029] (2) The YOLOv4 network of the present invention has a powerful real-time processing capability to ensure the high efficiency of the method. By timely and accurately detecting defects on the photovoltaic panels and performing corresponding processing and maintenance, the service life of the photovoltaic panels can be extended, the power generation efficiency can be improved, and the operation and maintenance costs and risks can be reduced.
[0030] (3) In view of the fact that there are various interference factors in the actual environment, such as shadows, reflections, etc., which may affect the image quality, the present invention adopts a preprocessing step to ignore or reduce the influence of the shadow area on defect detection, thereby ensuring that accurate defect detection can still be achieved under shadow occlusion.
[0031] (4) The deep learning of multiple samples and multiple scenes during the defect target detection model training process enables it to have strong generalization ability. Therefore, the method of the present invention has strong adaptability and can handle defects of various shapes, sizes and positions, greatly improving the flexibility and practicality of photovoltaic panel detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 It is a schematic diagram of the method flow of the present invention;
[0033] Figure 2 It is a schematic diagram of the overall structure of the defect target detection model of the present invention;
[0034] Figure 3 It is a training flow chart of the defect target detection model of the present invention;
[0035] Figure 4 A schematic diagram of a feature graph extracted from the network model of the present invention;
[0036] Figure 5 It is the visual detection result of the present invention. DETAILED DESCRIPTION
[0037] The present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. This embodiment is implemented based on the technical solution of the present invention, and provides a detailed implementation method and specific operation process, but the protection scope of the present invention is not limited to the following embodiments.
[0038] Example 1
[0039] This embodiment provides a photovoltaic panel defect detection method based on dense connection, by combining the target detection method YOLOv4 with the DenseNet121 network structure with dense connection characteristics. YOLOv4 is known for its excellent real-time detection capabilities, and can achieve fast detection speeds while maintaining high accuracy. And DenseNet121, through its unique dense connection mechanism, achieves efficient feature propagation and reuse, allowing the network to capture image detail information more deeply. By combining the two, the photovoltaic panel defect detection method of the present invention has reached unprecedented levels in both processing speed and accuracy. Figure 1 As shown, the specific steps of this method are as follows:
[0040] S1. Collect image data of photovoltaic panels and perform preprocessing.
[0041] First, the photovoltaic panels are imaged using a professional high-definition camera or drone. Since there are many interference factors in the actual environment, such as shadows and reflections, which may affect the image quality, the collected images need to be preprocessed. The preprocessing steps include denoising, contrast enhancement, and image normalization to ensure that the image quality meets the requirements of subsequent processing.
[0042] S2. Input the preprocessed image data into the DenseNet121 network for dense connection to extract features of different sizes and obtain feature maps of multiple sizes.
[0043] After preprocessing, it needs to be input into the defect target detection model for defect detection, such as Figure 2 As shown, the defect target detection model of this embodiment includes a DenseNet121 network, a Neck feature fusion layer of a YOLOv4 network, and a Head prediction layer, wherein the DenseNet121 network includes 4 parts, each of which includes a convolutional layer and a Dense Block densely connected module and a pooling layer connected thereto in sequence.
[0044] DenseNet121 is a deep convolutional neural network characterized by dense connections between layers. This connection method enables each layer in the network to directly obtain feature information from all previous layers, thereby achieving full reuse and propagation of features. In photovoltaic panel defect detection, DenseNet121 can capture more subtle and complex defect features, further improving the accuracy of detection.
[0045] Specifically, the steps are as follows:
[0046] S2.1. The preprocessed image data is input into the convolution layer for preliminary feature extraction to extract some local low-level features in the image, such as edge information, texture features, color information, and structural information.
[0047] S2.2, inputting the local low-level features into the Dense Block dense connection module to perform dense connection and extracting feature maps of initial multiple sizes;
[0048] The Dense Block dense connection module consists of multiple convolutional layers. In each Dense Block dense connection module, the output of each layer is connected to the output of all previous layers to form a dense connection pattern. This connection mode enables the network to use features more effectively, reduce information loss, and improve the expressiveness of features. Inside the DenseBlock dense connection module, the output feature map of each convolutional layer is spliced with the output feature map of all previous layers to achieve efficient reuse of features.
[0049] S2.3. Use the pooling layer to downsample the feature maps of the initial multiple sizes.
[0050] The Pooling layer is used to select the pixel value with the largest eigenvalue from the feature map and discard unnecessary pixel values, that is, downsampling is performed to reduce the size of the feature map. The network captures the most significant and representative information in the feature map, while ignoring some unimportant details, and then performs subsequent feature extraction.
[0051] At this point, the first part of the DenseNet121 network is completed. Then repeat the above steps three times to perform the feature extraction process of the next three parts to gradually extract higher-level features. As the network deepens, the resolution of the image (that is, the size of the feature map) will gradually decrease, but the semantic information contained in each feature map will become richer and more abstract. The extracted feature maps of multiple sizes are as follows: Figure 4 shown.
[0052] S3. Input the feature maps of the multiple sizes into the Neck feature fusion layer for feature fusion to obtain a fused feature map.
[0053] The extracted feature map information is passed to the Neck feature fusion layer of YOLOv4 for subsequent feature fusion. During the feature fusion process, the small-resolution feature map is upsampled and the large-resolution feature map is downsampled. The fusion is used to obtain feature maps with more semantic information.
[0054] S4. Input the fused feature map into the Head prediction layer for classification regression, and output the defect detection result.
[0055] After feature fusion, classification regression is performed in the Head prediction layer. The prediction layer is designed as a decoupled head, which processes data through convolution and finally obtains three results: whether there is a target, target category and target position.
[0056] The training process of the defect target detection model used in this embodiment is as follows: Figure 3 As shown, the steps are:
[0057] Collect image data as a training set. If the data is insufficient, use data enhancement technology to expand the training set. The data enhancement technology includes flipping, scaling, mirroring, contrast adjustment and adding noise;
[0058] The training set is labeled with data, and the defect target detection model is constructed to start model training and optimization of each model. After the training is completed, the results are output. The model optimization method can adopt optimization strategies such as hyperparameter adjustment, regularization and performance evaluation.
[0059] The deep learning of multiple samples and multiple scenes during the training process enables it to have strong generalization ability and adaptability, so that the method of this embodiment can still maintain a high detection accuracy when facing complex situations such as different lighting conditions, shadow occlusion and panel surface contamination.
[0060] In order to verify the effect of the method proposed in this paper, a comparative experiment was designed to compare the performance differences between the DenseNet121-YOLOv4 method and the original YOLOv4 and YOLOv5 methods. The experiment used the public photovoltaic panel defect detection dataset PV-multi-defect, which contains five types of defects. The public object detection dataset PascalVOC contains twenty common object classes.
[0061] Data preprocessing: Mixup and mosaic data enhancement are performed on the images in the dataset to increase the number of training samples and data complexity.
[0062] Model training environment: the operating system is Windows 10 64-bit operating system, the processor is AMD R75800H, the graphics card is NVIDIA RTX3060 Laptop, the memory is 16.00GB, the experimental software is JetBrains PyCharm Community Edition 2021.3.2, the experimental environment is Python 3.10, and cosine annealing and Adam optimizer are used to optimize the model training convergence.
[0063] Table 1 Experimental results of PV-Multi-Defect dataset
[0064]
[0065] Table 2. Detection results of Pascal VOC dataset
[0066]
[0067] The experimental evaluation indicators are divided into three items: accuracy, recall, and average precision. Accuracy refers to the proportion of instances predicted by the classifier as positive samples that are truly positive samples. In target detection, accuracy can be understood as the proportion of the target box predicted by the method that actually contains the target. Recall refers to the proportion of all true positive samples that are correctly predicted as positive samples by the classifier. In target detection, recall can be understood as the proportion of all real targets that are successfully detected by the method. Average precision mean is one of the most commonly used evaluation indicators in the field of target detection. It first calculates the average precision (Average Precision, AP) of each category, and then takes the average of the AP of all categories to obtain mAP. The calculation of AP involves the area under the precision-recall curve. The experimental results of the PV-Multi-Defect dataset are shown in Table 1, and the experimental results of the Pascal VOC dataset are shown in Table 2. The results of the visual detection of photovoltaic panel defects are shown in Table 1. Figure 5 shown.
[0068] In the PV-Multi-Defect dataset experiment, it can be seen from Table 1 that, first, DenseNet121-YOLOv4 achieved an accuracy of 86.92%, the best performance among all methods. Compared with the original YOLOv4, the accuracy increased by 1.47 percentage points. This improvement is due to the effective use of the DenseNet121 backbone feature extraction network, whose dense connection mechanism enhances the propagation and reuse of features, enabling the model to better capture the subtle features of photovoltaic panel defects, thereby improving the accuracy of recognition.
[0069] Secondly, in terms of recall rate, DenseNet121-YOLOv4 also performed well, reaching 83.84%, an increase of 1.39 percentage points compared to YOLOv4. The increase in recall rate means that DenseNet121-YOLOv4 can more comprehensively identify the target objects in the image, effectively reducing the number of missed detections. This is crucial for photovoltaic panel defect detection, as missed detections may lead to potential safety hazards.
[0070] In addition, DenseNet121-YOLOv4 achieved 91.21% in mAP (mean Average Precision), which is nearly 2 percentage points higher than YOLOv4. As an important performance indicator in target detection tasks, mAP can comprehensively reflect the detection accuracy and performance stability of the method on different categories of targets. The significant improvement of DenseNet121-YOLOv4 in mAP further proves its superior performance in photovoltaic panel defect detection tasks. This improvement is due to the comprehensive improvements in the method in many aspects such as feature extraction, optimization strategy and loss function.
[0071] In the Pascal VOC dataset experiment (Table 2), it can be seen that compared with the original YOLOv4, DenseNet121-YOLOv4 has achieved a significant improvement in accuracy, increasing by nearly 2 percentage points to 70.74%. This improvement shows that DenseNet121-YOLOv4 has higher accuracy in identifying targets of different categories and can better cope with detection tasks in complex scenes. In terms of recall, although DenseNet121-YOLOv4 has slightly decreased by 0.35 percentage points compared to YOLOv4, it still remains at a high level of 76.31%. The recall rate reflects the completeness of the method in identifying targets, that is, the ability to correctly detect all targets in the image. The high recall rate of DenseNet121-YOLOv4 means that it performs well in reducing missed detections and can capture the target objects in the image more comprehensively. In the comprehensive evaluation indicator of mean average precision (mAP). Compared with YOLOv4, DenseNet121-YOLOv4 has improved by 0.81 percentage points to 75.07%. mAP is an important indicator to measure the performance of target detection methods. It takes into account the accuracy and recall rate, and can fully reflect the detection effect of the method on different categories of targets. The improvement of DenseNet121-YOLOv4 in mAP further proves its high robustness.
[0072] In summary, the photovoltaic panel defect detection method of the embodiment of the present invention is significantly innovative and practical, and the YOLOv4 network plays a key role in it. As a real-time target detection method, YOLOv4 can quickly and accurately identify the target object in the image. In photovoltaic panel defect detection, YOLOv4 is responsible for locating and marking possible defect areas in the input panel image. This process not only ensures the high speed of detection, but also provides an accurate basis for subsequent fine processing. The application of the DenseNet121 network significantly improves the network's ability to express and extract features. This method not only overcomes many limitations of traditional methods, improves the accuracy and efficiency of detection, but also provides a strong technical guarantee for the long-term stable operation of photovoltaic systems. It is believed that in the near future, this invention will play an increasingly important role in the field of photovoltaic power generation and make positive contributions to promoting the popularization and development of clean energy.
[0073] If the above functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program code.
[0074] Example 2
[0075] This embodiment provides an electronic device, including: one or more processors; a memory; and one or more programs stored in the memory, wherein the one or more programs include instructions for executing the densely connected photovoltaic panel defect detection method as described in Example 1.
[0076] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes. The schemes in the embodiments of the present invention may be implemented in various computer languages, for example, object-oriented programming language Java and literal scripting language JavaScript, etc.
[0077] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0078] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0079] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0080] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0081] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A photovoltaic panel defect detection method based on dense connection, characterized in that: The following steps are involved: Collect image data of photovoltaic panels, perform preprocessing, input into a pre-trained defect target detection model, and output photovoltaic panel defect detection results. The defect detection model includes a DenseNet121 network, a Neck feature fusion layer of a YOLOv4 network, and a Head prediction layer; The steps performed by the defect detection model include: The preprocessed image data is input into the DenseNet121 network for dense connection to extract features of different sizes and obtain feature maps of multiple sizes; Inputting the feature maps of the multiple sizes into the Neck feature fusion layer for feature fusion to obtain a fused feature map; The fused feature map is input into the Head prediction layer for classification regression, and the defect detection result is output.
2. A photovoltaic panel defect detection method based on dense connection according to claim 1, characterized in that: The preprocessing operations include denoising, enhancement and normalization.
3. The photovoltaic panel defect detection method based on dense connection according to claim 1 is characterized in that: The DenseNet121 network includes 4 parts, each of which includes a convolutional layer and a Dense Block dense connection module and a pooling layer connected thereto in sequence. The step of obtaining feature maps of multiple sizes includes: Inputting the preprocessed image data into the convolution layer to perform preliminary feature extraction to obtain local low-level features; Inputting the local low-level features into the Dense Block dense connection module to perform dense connection and extract feature maps of initial multiple sizes; Downsampling the feature maps of the initial multiple sizes using the pooling layer; The above steps are repeated in the last three parts to gradually extract higher-level features and obtain the final feature maps of multiple sizes.
4. A photovoltaic panel defect detection method based on dense connection according to claim 3, characterized in that: The local low-level features include edge information, texture features, color information and structure information.
5. The photovoltaic panel defect detection method based on dense connection according to claim 1, characterized in that: During the feature fusion process of the Neck feature fusion layer, the feature maps of the multiple sizes are upsampled or downsampled according to the resolution size.
6. The photovoltaic panel defect detection method based on dense connection according to claim 1, characterized in that: The Head prediction layer is a decoupled head design, which processes the fused feature map through convolution to obtain a defect detection result, which includes a target defect, a target defect category and a target defect position.
7. The photovoltaic panel defect detection method based on dense connection according to claim 1, characterized in that: During the training process of the defect target detection model, the optimization strategies of hyperparameter adjustment, regularization and performance evaluation are used to optimize the model.
8. The photovoltaic panel defect detection method based on dense connection according to claim 1, characterized in that: The defect target detection model uses data enhancement operations to expand the training set during the training process, and the data enhancement operations include flipping, scaling, mirroring, contrast adjustment and noise addition.
9. An electronic device, characterized in that: include: one or more processors; Memory; and One or more programs stored in a memory, wherein the one or more programs include instructions for executing the densely connected photovoltaic panel defect detection method according to any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that: It comprises one or more programs for execution by one or more processors of an electronic device, wherein the one or more programs include instructions for executing the densely connected photovoltaic panel defect detection method as described in any one of claims 1-8.
Citation Information
Cited By
Lightweight photovoltaic cell panel defect detection method based on improved YOLOv8
CN119693712A
