Solar photovoltaic panel infrared thermal image defect detection method and device based on improved YOLOv11 and storage medium
By improving the YOLOv11 network model, windmill-shaped convolution PConv, SPDConv and C2PS-CBAM modules are introduced to optimize feature extraction and detection accuracy, solving the problem of low infrared thermal image detection accuracy of solar photovoltaic panels, and achieving efficient defect detection and multi-anomaly type recognition.
Patent Information
- Application Number
- CN202510526338.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-25
- Publication Date
- 2025-08-05
AI Technical Summary
In the detection of infrared thermal image defects of solar photovoltaic panels, the detection accuracy is low and the detection capability for small targets is poor, making it difficult to meet the large-scale online detection needs of photovoltaic power stations.
Based on the YOLOv11 network model, the windmill-shaped convolution PConv, SPDConv and C2PS-CBAM modules are introduced to optimize feature extraction and detection accuracy, and generate weight files for identification and classification through data augmentation and training optimization.
It improves the accuracy and real-time detection of infrared thermal image defects of solar photovoltaic panels, enhances the recognition ability of various abnormal types, and is suitable for photovoltaic power station inspection and intelligent operation and maintenance systems.
Smart Images

Figure CN120431387A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of solar photovoltaic panel defect detection, and in particular to a solar photovoltaic panel infrared thermal image defect detection method, device, and storage medium based on an improved YOLOv11. Background Art
[0002] Solar photovoltaic technology is a vital component of clean energy, and its widespread adoption has driven the development of renewable energy. However, over the long-term operation of photovoltaic power plants, photovoltaic panels may develop defects such as hot spots and cracks due to manufacturing defects, environmental factors, and aging. These defects can reduce power generation efficiency and even pose safety risks such as fires. Therefore, accurate and rapid detection of photovoltaic panel defects is crucial to ensuring the operational efficiency and safety of photovoltaic systems.
[0003] Currently, defect detection methods for photovoltaic panels primarily include manual inspection, optical imaging, electrical testing, and infrared thermal imaging. Manual inspection is inefficient, costly, and susceptible to subjective factors, making it difficult to meet the needs of large-scale photovoltaic power plants. Optical imaging can detect visible surface defects, but has difficulty detecting hidden defects such as microcracks. Electrical testing methods, such as electroluminescence and photoluminescence, offer high accuracy but require complex equipment and high costs, making them unsuitable for large-scale online testing. Infrared thermal imaging, on the other hand, identifies defects by detecting abnormal temperature areas on photovoltaic panels. It offers the advantages of non-contact, high efficiency, and strong real-time performance, making it suitable for online monitoring of large-scale photovoltaic power plants. With advances in artificial intelligence and deep learning technologies, computer vision methods have gained widespread application in infrared thermal imaging defect detection. YOLO (You Only Look Once) is currently the mainstream object detection algorithm. However, the real-time YOLO network suffers from relatively low accuracy and poor detection capabilities for small objects. Improving the accuracy and real-time performance of defect detection using infrared thermal images of solar photovoltaic panels has become an urgent challenge. Summary of the Invention
[0004] The technical problem to be solved by the present invention is: in order to overcome the above technical problems, the present invention provides a solar photovoltaic panel infrared thermal image defect detection method based on the improved YOLOv11. Based on the improved YOLOv11 algorithm, the defect detection accuracy and real-time performance of the infrared thermal image of the solar photovoltaic panel are improved, and technical support is provided for the intelligent operation and maintenance of photovoltaic components; by optimizing the feature extraction, detection accuracy and computational efficiency of YOLOv11, the research results can be widely used in scenarios such as photovoltaic power station inspection, intelligent operation and maintenance systems and drone detection, which helps to improve the safety and economy of the photovoltaic system.
[0005] The technical solution adopted by the present invention to solve the technical problem is: a solar photovoltaic panel infrared thermal image defect detection method based on improved YOLOv11, comprising the following steps:
[0006] Step 1: Build a network model for solar photovoltaic panel infrared thermal image defect detection;
[0007] Step 2: Collect infrared thermal images of solar photovoltaic panels in real time to generate test set images;
[0008] Step 3: Import the test set images into the solar photovoltaic panel infrared thermal image defect detection network model and compare them to obtain the solar photovoltaic panel defect detection results;
[0009] Wherein, step one includes the following steps:
[0010] Step 11: Collect infrared thermal imaging images containing defects and damage of solar photovoltaic panels, mark the defects, and form a data set;
[0011] Step 12: Build an improved model based on the YOLO v11n network model, introduce the pinwheel-shaped convolution PConv (Pinwheel-shaped Conv) at the beginning of the model, introduce the SPDConv convolution in the model backbone, and replace the original C2PSA module with the C2PS-CBAM module to form a new YOLO v11n-LT model;
[0012] Step 13: Train and optimize the YOLOv11n network model, generate weight files and save them locally, and use these weight files to identify and classify defects in infrared thermal image detection of solar photovoltaic panels;
[0013] Among them, step three includes: inputting the test set image into the network model weights trained in step 13, outputting the detection results, and comparing them with the real labels (ground truth) manually annotated in the test set images.
[0014] In step 11, infrared thermal images of solar photovoltaic panel defects and a small number of images of solar photovoltaic panel damage are first collected. Infrared thermal images of solar photovoltaic panel defects are images of functional anomalies, while images of solar photovoltaic panel damage are images of structural anomalies. Fusion of visible light images, especially images of damage, with infrared defect images into the same dataset improves the model's ability to identify multiple anomaly types, enabling dual detection of "functional anomalies + structural damage," and providing more comprehensive intelligent operation and maintenance decision support. The images are then annotated with defects to establish a solar photovoltaic panel defect database. Next, data augmentation is performed on the images to increase the size of the dataset. Finally, the augmented dataset is proportionally divided into training, validation, and test sets.
[0015] Data augmentation methods include image stretching, rotation, horizontal flipping, and cropping.
[0016] The data-augmented dataset is divided into training set, validation set, and test set in a ratio of 7:2:1.
[0017] In step 12, improvements are made based on the original YOLOv11n network. The specific improvement steps include:
[0018] Step 12.1. Introduce the pinwheel-shaped convolutional module in YOLOv11n:
[0019] The first layer of the windmill convolution PConv performs parallel convolution in four directions: horizontal, vertical, left oblique, and right oblique. The calculation formula is as follows:
[0020]
[0021] in, is the convolution operator, W1 (1,3,c) It is a 1×3 convolution kernel with an output channel of c'; W2 (3,1,c′) It is a 3×1 convolution kernel with an output channel of c'; W3 (1,3,c′) It is a 1×3 convolution kernel with an output channel of c'; W4 (3,1,c′) is a 3×1 convolution kernel with an output channel of c'; the padding parameter P(0,1,0,3) indicates the number of padded pixels in the left, right, top, and bottom directions, respectively; h', w', and c' are the height, width, and number of channels of the output feature map, respectively. BN indicates the application of batch normalization, SiLU represents the sigmoid linear unit, and h1, w1, and c1 are the height, width, and number of channels of the output feature map, respectively. Here, h1, w1, and c1 are the original quantities, and h', w', and c' are the variables after substitution in the formula. To enhance training stability and speed, batch normalization (BN) and sigmoid linear units (SiLU) are applied after each convolution to the height h', width w', and number of channels c' of the output feature map.
[0022] After the first layer completes the parallel convolution in four directions, it then performs the interleaved convolution operation. The relationship between the height h', width w', and number of channels c' of the output feature map after the first layer of interleaved convolution and the input feature map is:
[0023]
[0024] Where c2 is the number of channels in the pinwheel convolution module's final output feature map, and s is the convolution stride. Feature maps from different orientations are interleaved and fused across channels or spatial dimensions to enhance the relevance and expressiveness of features. This step, located after the first layer of parallel convolution, is a crucial component of the PConv module, connecting the direction-aware features with the subsequent network structure.
[0025] The results of the first layer of interleaved convolution are concatenated Cat(.,.)Cat(.,.)Cat(.,.), and the output is calculated as:
[0026]
[0027] In the PConv module, interleaved convolution refers to concatenating the feature maps obtained by parallel convolution in four directions in the first layer along the channel dimension (Cat) to form a fused feature map X ′(h′,w′,4c′) The staggered feature map integrates information from multiple directions, enhances the network's ability to perceive multi-directional features such as edges and defect shapes, and serves as the input of subsequent convolutions to further extract global context information. Here, the convolution output feature map X1 in the four directions of the first layer is (h′,w′,c′) 、X2 (h ′,w′,c′) 、X3 (h′,w′,c′) and X4 (h′,w′,c′) Splicing along the channel dimension to obtain the fusion feature map X′ (h′,w′,4c′) The output feature map has a height h', width w', and number of channels c'. After concatenation, the number of channels increases to 4c'. Cat(·) represents the channel-dimensional concatenation operation, which is used to integrate convolutional features from different directions and enhance feature representation capabilities.
[0028] Finally, the concatenated tensor passes through the convolution kernel Normalize and do not fill. It is a 2×2 convolution kernel with an output channel of c2. The height and width of the output feature map are adjusted to the preset values h2 and w2, so that the windmill convolution PConv is interchangeable with the standard convolution Conv layer, and as a channel attention mechanism, the contribution of different convolution directions is analyzed, and the final output is The calculation is as follows:
[0029]
[0030] The formula for calculating the number of parameters of standard convolution Conv is:
[0031] Conv params =c2×c1×k, (bias=False), where k represents the size of the convolution kernel;
[0032] If the number of output channels c1 is equal to the number of input channels c2, the parameters of the 3×3 standard convolution Conv are The number of parameters of the pinwheel convolution PConv is calculated as follows:
[0033]
[0034] Step 12.2: Introduce the SPDConv module into the YOLOv11n model backbone:
[0035] The SPDConv (Space-to-Depth Convolution) module consists of two parts: first, an SPD (Space-to-Depth) layer, followed by a non-strided convolution layer;
[0036] The SPD layer generates a series of sub-feature maps by slicing the intermediate feature map. These sub-feature maps are obtained by dividing the specific area of the original feature map, and each sub-map downsamples the original feature map by a certain scaling factor (scale); in neural networks, "intermediate feature maps" usually refer to the feature maps of the non-input and non-output layers of the network, that is, the intermediate results after processing through several layers, such as convolutional layers and pooling layers. They contain the feature representations of certain layers in the network for further processing by subsequent layers. Then, a non-strided convolution layer is used to further process the features transformed by the SPD layer. The non-strided convolution layer uses learnable parameters to reduce the number of channels;
[0037] Step 12.3: Introduce the C2PS-CBAM module into the model backbone:
[0038] The PSA block is introduced into the standard C2f module, and the original attention function in the original PSA module is replaced with CBAM. CBAM consists of two submodules: CAM (Channel Attention Module) and SAM (Spartial Attention Module), which perform channel-wise and spatial attention, respectively.
[0039] In step 13, training the model includes: inputting the training set collected in step 11 into the improved model in step 12 for training to obtain a new network model.
[0040] Step 13 also includes setting up the experimental environment: the deep learning training environment is implemented using the Pytorch-GPU training framework and Python language, using CUDA version 11.7 and the GPU version NVIDIA GeForce GTX 3080Ti.
[0041] Set network parameters: image training size is set to 1024×1024; epoch is set to 200; batch-size is set to 16.
[0042] A solar photovoltaic panel infrared thermal image defect detection device based on improved YOLOv11, the device comprising: a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, the solar photovoltaic panel infrared thermal image defect detection method based on improved YOLOv11 described in the present invention is implemented.
[0043] A computer-readable storage medium stores computer program instructions, which, when executed by a processor, implement the solar photovoltaic panel infrared thermal image defect detection method based on the improved YOLOv11 described in the present invention.
[0044] The beneficial effects of the present invention are as follows: a method, device, and storage medium for detecting defects in infrared thermal images of solar photovoltaic panels based on an improved YOLOv11 are provided. Compared with previous versions such as YOLOv5 and YOLOv8, YOLOv11 has higher detection accuracy and faster inference speed, and is suitable for target detection in high-resolution infrared thermal images. The method of the present invention can improve detection accuracy when detecting defects in infrared thermal images of solar photovoltaic panels, and the model has good transferability and generalization:
[0045] An improved model is constructed based on the YOLO v11n network model, and Pinwheel-shaped Conv is introduced at the beginning of the model. The design of PConv is based on the Gaussian spatial distribution characteristics of small infrared targets. The receptive field of its convolution kernel decreases in effectiveness outward, similar to a Gaussian distribution, and the features of small targets are more concentrated in the center, highlighting the importance of central features. PConv uses grouped convolution to significantly expand the receptive field while minimizing the increase in the number of parameters. Through asymmetric padding, horizontal and vertical convolution kernels are created for different areas of the image. These convolution kernels diffuse outward, which can better capture the features of small infrared targets and enhance the underlying feature extraction capabilities. With minimal parameters, it achieves high efficiency and a larger receptive field, thereby improving the detection performance of small infrared targets.
[0046] SPDConv convolution is also introduced into the model backbone. As an efficient convolution operation, SPDConv greatly optimizes model performance by reducing the number of parameters and computational complexity of the convolution layer. Compared with traditional convolution operations, SPDConv only performs calculations in necessary areas, significantly improving computational efficiency. This sparse computing method enables YOLOv11 to significantly reduce inference time while maintaining high accuracy, making it suitable for real-time detection scenarios.
[0047] The original C2PSA module is replaced with the C2PS-CBAM module, and the CBAM attention mechanism is combined with the C2PSA built into YOLOv11 to implement a more powerful attention mechanism, thereby improving the model's ability to capture important features. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] The present invention will be further described below with reference to the accompanying drawings and examples.
[0049] Figure 1 This is a basic flow chart of the solar photovoltaic panel infrared thermal image defect detection method based on improved YOLOv11 of the present invention.
[0050] Figure 2 This is the existing YOLOv11n structure diagram.
[0051] Figure 3 This is the improved YOLOv11n structure diagram.
[0052] Figure 4 It is a structural diagram of the PConv module of the present invention.
[0053] Figure 5 This is a structural diagram of the C2PSA module of the present invention.
[0054] Figure 6 It is a structural diagram of the C2PS-CBAM module of the present invention. DETAILED DESCRIPTION
[0055] The present invention will now be described in further detail with reference to the accompanying drawings, which are simplified schematic diagrams that illustrate the basic structure of the present invention in a schematic manner.
[0056] The present invention provides a solar photovoltaic panel infrared thermal image defect detection method based on improved YOLOv11, comprising the following steps:
[0057] Step 1: Build a network model for solar photovoltaic panel infrared thermal image defect detection;
[0058] Step 2: Collect infrared thermal images of solar photovoltaic panels in real time to generate test set images;
[0059] Step 3: Import the test set images into the solar photovoltaic panel infrared thermal image defect detection network model and compare them to obtain the solar photovoltaic panel defect detection results;
[0060] Wherein, step one includes the following steps:
[0061] Step 11: Collect infrared thermal imaging images containing defects and damage of solar photovoltaic panels, mark the defects, and form a solar photovoltaic panel defect and damage dataset;
[0062] Step 12: Build an improved model based on the YOLO v11n network model, introduce the windmill convolution PConv at the beginning of the model, introduce the SPDConv convolution in the model backbone, and replace the original C2PSA module with the C2PS-CBAM module to form a new YOLO v11n-LT model.
[0063] Step 13: Train and optimize the YOLOv11n network model, generate weight files and save them locally, and use these weight files to identify and classify defects in infrared thermal image detection of solar photovoltaic panels;
[0064] Among them, step three includes: inputting the test set image into the network model weight trained in step 13, outputting the detection result, and performing error comparison with the true standard information.
[0065] In step 11, infrared thermal images of solar photovoltaic panel defects and a small number of images of solar photovoltaic panel damage are first collected. Infrared thermal images of solar photovoltaic panel defects are functional anomalies, while images of solar photovoltaic panel damage are structural anomalies. Fusion of visible light images, particularly damage images, with infrared defect images into a single dataset improves the model's ability to identify multiple anomaly types, enabling dual detection of "functional anomalies and structural damage," and providing more comprehensive intelligent operation and maintenance decision support. The images are then annotated to establish a solar photovoltaic panel defect database. Next, data augmentation is performed on the images to increase the dataset size. Data augmentation methods include image stretching, rotation, horizontal flipping, and cropping. Finally, the augmented dataset is divided into training, validation, and test sets in a 7:2:1 ratio.
[0066] like Figure 2 As shown in Figure 1, the existing YOLOv11n model primarily consists of a backbone network, a neck network, and a detection head. The backbone is responsible for feature extraction and employs a series of convolutional and deconvolutional layers, along with residual connections and a bottleneck structure to reduce network size and improve performance. YOLOv1 uses C3K2 blocks to handle feature extraction at different stages of the backbone. The smaller 3x3 kernels allow for more efficient computation while retaining the model's ability to capture essential features in the image. The core of the YOLOv11 backbone is the C3K2 block, an evolution of the cross-stage partial CSP bottleneck introduced in earlier versions. The C3K2 module optimizes information flow within the network by segmenting the feature map and applying a series of smaller 3x3 kernel convolutions, which is faster and less computationally expensive than larger kernel convolutions. By processing smaller, independent feature maps and merging them after several convolutions, the C3K2 module uses fewer parameters to improve feature representation compared to the C2f module of YOLOv8.
[0067] The C2PSA block uses two partial spatial attention PSA modules that operate on different branches of the feature map and are then concatenated, similar to the C2F block structure. This setup ensures that the model focuses on spatial information while maintaining a balance between computational cost and detection accuracy. The C2PSA module refines the model's ability to selectively focus on regions of interest by applying spatial attention to the extracted features. This allows YOLOv11 to outperform previous versions such as YOLOv8 in scenarios where fine object details are required for accurate detection.
[0068] The neck network sits between the backbone network and the head network, performing feature fusion and enhancement. The neck network receives input from the backbone network's feature layer and uses the nn.Upsample module, the Concat module, and upsampling operations to fuse features, ultimately outputting a feature map. The head network is the decision-making component of the object detection model and is responsible for generating the final detection results. The Detect layer is the final detection layer, responsible for outputting the detection results.
[0069] The present invention improves on the original YOLOv11n network. The improved YOLOv11n-LT is as follows: Figure 3 As shown, in step 12, the specific improvement steps include:
[0070] Step 12.1, introduce the windmill convolution module, namely PConv module, into YOLOv11n, as shown in Figure 4 As shown,
[0071] PConv's design is based on the Gaussian spatial distribution of small infrared targets. The receptive field of its convolution kernel decreases in effectiveness outward, similar to a Gaussian distribution. Furthermore, the features of small targets are more concentrated in the center, highlighting the importance of central features. PConv utilizes grouped convolution to significantly expand the receptive field while minimizing the increase in the number of parameters.
[0072] The first layer of the windmill convolution PConv performs parallel convolution in four directions: horizontal, vertical, left oblique, and right oblique. The calculation formula is as follows:
[0073]
[0074] in, is the convolution operator, W1 (1,3,c) It is a 1×3 convolution kernel with an output channel of c'; W2 (3,1,c′) It is a 3×1 convolution kernel with an output channel of c'; W3 (1,3,c′) It is a 1×3 convolution kernel with an output channel of c'; W4 (3,1,c′)is a 3×1 convolution kernel with an output channel of c'; the padding parameter P(0,1,0,3) indicates the number of padded pixels in the left, right, top, and bottom directions, respectively; h', w', and c' are the height, width, and number of channels of the output feature map, respectively. BN indicates the application of batch normalization, SiLU represents the sigmoid linear unit, and h1, w1, and c1 are the height, width, and number of channels of the output feature map, respectively. Here, h1, w1, and c1 are the original quantities, and h', w', and c' are the variables after substitution in the formula. To enhance training stability and speed, batch normalization (BN) and sigmoid linear units (SiLU) are applied after each convolution to the height h', width w', and number of channels c' of the output feature map.
[0075] After the first layer completes the parallel convolution in four directions, it then performs the interleaved convolution operation. The relationship between the height h', width w', and number of channels c' of the output feature map after the first layer of interleaved convolution and the input feature map is:
[0076]
[0077] Where c2 is the number of channels in the pinwheel convolution module's final output feature map, and s is the convolution stride. Feature maps from different orientations are interleaved and fused across channels or spatial dimensions to enhance the relevance and expressiveness of features. This step, located after the first layer of parallel convolution, is a crucial component of the PConv module, connecting the direction-aware features with the subsequent network structure.
[0078] The results of the first layer of interleaved convolution are concatenated Cat(.,.)Cat(.,.)Cat(.,.), and the output is calculated as:
[0079]
[0080] In the PConv module, interleaved convolution refers to concatenating the feature maps obtained by parallel convolution in four directions in the first layer along the channel dimension (Cat) to form a fused feature map X′ (h′,w′,4c′) The staggered feature map integrates information from multiple directions, enhances the network's ability to perceive multi-directional features such as edges and defect shapes, and serves as the input of subsequent convolutions to further extract global context information. Here, the convolution output feature map X1 in the four directions of the first layer is (h′,w′,c′) 、X2 (h ′,w′,c′) 、X3 (h′,w′,c′) and X4 (h′,w′,c′) Splicing along the channel dimension to obtain the fusion feature map X′ (h′,w′,4c′) The output feature map has a height h', width w', and number of channels c'. After concatenation, the number of channels increases to 4c'. Cat(·) represents the channel-dimensional concatenation operation, which is used to integrate convolutional features from different directions and enhance feature representation capabilities.
[0081] Finally, the concatenated tensor passes through the convolution kernel Normalize and do not fill. It is a 2×2 convolution kernel with an output channel of c2. The height and width of the output feature map are adjusted to the preset values h2 and w2, so that the windmill convolution PConv is interchangeable with the standard convolution Conv layer, and as a channel attention mechanism, the contribution of different convolution directions is analyzed, and the final output is The calculation is as follows:
[0082]
[0083] The effectiveness of the receptive field gradually decreases outward, similar to a Gaussian distribution, and the smaller the target, the more concentrated its features, highlighting the importance of the central features. The number of convolutions in PConv (k=3) decreases from the center outward, similar to a Gaussian distribution. PConv uses grouped convolution to significantly increase the receptive field while minimizing the number of parameters. The formula for calculating the number of parameters of standard convolution Conv is:
[0084] Conv params =c2×c1×k, (bias=False), where k represents the size of the convolution kernel;
[0085] If the number of output channels c1 is equal to the number of input channels c2, the parameters of the 3×3 standard convolution Conv are The number of parameters of the pinwheel convolution PConv is calculated as follows:
[0086]
[0087] PConv creates horizontal and vertical convolution kernels for different areas of the image through asymmetric padding. These convolution kernels diffuse outward, which can better capture the features of small infrared targets, enhance the underlying feature extraction capabilities, and improve the detection performance of small infrared targets.
[0088] Step 12.2: Introduce the SPDConv module into the YOLOv11n model backbone:
[0089] The SPDConv module aims to improve the processing capabilities of low-resolution images and small objects. It consists of two parts: first, an SPD layer, followed by a non-strided convolution layer. The core idea of this design is to replace the traditional strided convolution and pooling operations to retain more fine-grained information, thereby improving the performance when processing small-sized objects and low-resolution images.
[0090] Specifically, the SPD layer generates a series of sub-feature maps by slicing the intermediate feature map. These sub-feature maps are obtained by dividing specific areas of the original feature map, and each sub-map downsamples the original feature map by a certain scaling factor. A specific embodiment is that the SPD layer divides the intermediate feature map into several sub-regions, such as dividing a 64×6464\times6464×64 feature map into 4×44\times 44×4 16×1616\times 1616×16 blocks, and downsamples each sub-map using a fixed scaling factor, such as 0.5, to achieve spatial scale decoupling and information compression. This process not only reduces the spatial dimension, but also increases the channel dimension.
[0091] Next, a non-strided convolutional layer is used to further process the features transformed by the SPD layer. The non-strided convolutional layer uses learnable parameters to reduce the number of channels; this can prevent information redundancy caused by the increase in channels while retaining discriminative feature information as much as possible.
[0092] Through this structural design, the SPDConv module can reduce the resolution of the feature map without losing learnable information, completely abandoning the strided convolution and pooling operations that are widely used but perform poorly in this scenario.
[0093] Step 12.3: Introduce the C2PS-CBAM module into the model backbone:
[0094] C2PSA is an extension of the C2f module. It combines the PSA (Pointwise SpatialAttention) block to enhance feature extraction and attention mechanism. By introducing the PSA block into the standard C2f module, C2PSA implements a more powerful attention mechanism, thereby improving the model's ability to capture important features. Its structure is as follows Figure 4 shown.
[0095] CBAM is a lightweight convolutional attention module that combines channel-wise and spatial-wise attention mechanisms. It consists of two submodules, CAM and SAM, which perform channel-wise and spatial-wise attention, respectively. This not only saves parameters and computational power, but also ensures its plug-and-play integration into existing network architectures.
[0096] The new C2PS-CBAM module combines the advantages of C2PSA and CBAM to reduce the amount of calculation, improve the inference speed (part of the calculation characteristics of C2PSA), enhance the ability to express global and local features (CBAM provides channel and spatial attention, C2PSA provides more effective spatial attention), improve the accuracy of target detection tasks, especially in small target detection scenarios, maintain good computational efficiency, and is suitable for lightweight deep learning models. Its structure is as follows Figure 6 shown.
[0097] In step 13, training the model includes: inputting the training set collected in step 11 into the improved model in step 12 for training to obtain a new network model.
[0098] Step 13 also involves setting up the experimental environment: the deep learning training environment uses the Pytorch-GPU training framework and Python, using CUDA version 11.7 and an NVIDIA GeForce GTX 3080Ti GPU. Network parameters are set: the image training size is set to 1024×1024, the epoch number is set to 200, and the batch size is set to 16.
[0099] A solar photovoltaic panel infrared thermal image defect detection device based on improved YOLOv11, the device comprising: a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, the solar photovoltaic panel infrared thermal image defect detection method based on improved YOLOv11 described in the present invention is implemented.
[0100] A computer-readable storage medium stores computer program instructions, which, when executed by a processor, implement the solar photovoltaic panel infrared thermal image defect detection method based on the improved YOLOv11 described in the present invention.
[0101] The following table compares the model parameters of YOLOv11n before and after improvement.
[0102]
[0103]
[0104] Compared with the YOLOv11n source code model, the precision rate is increased by 6.1%, and compared with the latest YOLOv12n model, the precision rate is increased by 16.8%, and the average precision is increased by 4.2%, which greatly improves the accuracy of surface defect detection for solar photovoltaic panels.
[0105] The indicator formula for evaluating model performance is as follows:
[0106]
[0107] With the above-described preferred embodiments of the present invention as a guide, and with reference to the above description, relevant personnel are fully capable of making various changes and modifications without departing from the technical scope of this invention. The technical scope of this invention is not limited to the contents of the specification and must be determined according to the scope of the claims.
Claims
1. A solar photovoltaic panel infrared thermal image defect detection method based on improved YOLOv11, characterized in that: The following steps are involved: Step 1: Build a network model for solar photovoltaic panel infrared thermal image defect detection; Step 2: Collect infrared thermal images of solar photovoltaic panels in real time to generate test set images; Step 3: Import the test set images into the solar photovoltaic panel infrared thermal image defect detection network model and compare them to obtain the solar photovoltaic panel defect detection results; Wherein, step one includes the following steps: Step 11: Collect infrared thermal imaging images containing defects and damage of solar photovoltaic panels, mark the defects, and form a data set; Step 12: Build an improved model based on the YOLO v11n network model, introduce the windmill convolution PConv at the beginning of the model, introduce the SPDConv convolution in the model backbone, and replace the original C2PSA module with the C2PS-CBAM module to form a new YOLO v11n-LT model. Step 13: Train and optimize the YOLOv11n network model, generate weight files and save them locally, and use these weight files to identify and classify defects in infrared thermal image detection of solar photovoltaic panels; Among them, step three includes: inputting the test set image into the network model weights trained in step 13, outputting the detection results, and comparing them with the real labels manually annotated in the test set images.
2. The solar photovoltaic panel infrared thermal image defect detection method based on improved YOLOv11 according to claim 1 is characterized in that: In step 11, first, infrared thermal images of solar photovoltaic panel defects and a small number of images of damaged solar photovoltaic panels are collected, and then the images are defect-labeled to establish a solar photovoltaic panel defect database; then, data enhancement is performed on the images to increase the size of the dataset; finally, the enhanced dataset is divided into training set, validation set, and test set in proportion.
3. The solar photovoltaic panel infrared thermal image defect detection method based on improved YOLOv11 according to claim 2 is characterized in that: Data augmentation methods include image stretching, rotation, horizontal flipping, and cropping.
4. The solar photovoltaic panel infrared thermal image defect detection method based on improved YOLOv11 according to claim 2, characterized in that: The data-augmented dataset is divided into training set, validation set, and test set in a ratio of 7:2:
1.
5. The solar photovoltaic panel infrared thermal image defect detection method based on improved YOLOv11 according to claim 1, characterized in that: In step 12, improvements are made based on the original YOLOv11n network. The specific improvement steps include: Step 12.
1. Introduce the windmill convolution module in YOLOv11n: The first layer of the windmill convolution PConv performs parallel convolution in four directions: horizontal, vertical, left oblique, and right oblique. The calculation formula is as follows: in, is the convolution operator, W1 (1,3,c′) Is a 1×3 convolution kernel with an output channel of c′; W2 (3,1,c′) It is a 3×1 convolution kernel with an output channel of c'; W3 (1,3,c′) It is a 1×3 convolution kernel with an output channel of c'; W4 (3,1,c′) It is a 3×1 convolution kernel with an output channel of c'; the padding parameter P(0,1,0,3) represents the number of padded pixels in the left, right, top, and bottom directions respectively; h', w', c' are the height, width, and number of channels of the output feature map respectively; BN represents the application of batch normalization function, SiLU represents sigmoid linear unit, h1, w1, c1 represent the height, width, and number of channels of the output feature map respectively; After the first layer completes the parallel convolution in four directions, it then performs the interleaved convolution operation. The relationship between the height h', width w', and number of channels c' of the output feature map after the first layer of interleaved convolution and the input feature map is: Where c2 is the number of channels of the final output feature map of the windmill convolution module, and s is the convolution step size; The results of the first layer of interleaved convolution are concatenated Cat(.,.)Cat(.,.)Cat(.,.), and the output is calculated as: Finally, the concatenated tensor passes through the convolution kernel Normalize and do not fill. It is a 2×2 convolution kernel with an output channel of c2. The height and width of the output feature map are adjusted to the preset values h2 and w2, so that the windmill convolution PConv is interchangeable with the standard convolution Conv layer, and as a channel attention mechanism, the contribution of different convolution directions is analyzed, and the final output is The calculation is as follows: The formula for calculating the number of parameters of standard convolution Conv is: Conv params =c2×c1×k, (bias=False), where k represents the size of the convolution kernel; If the number of output channels c1 is equal to the number of input channels c2, the parameters of the 3×3 standard convolution Conv are The number of parameters of the pinwheel convolution PConv is calculated as follows: Step 12.2: Introduce the SPDConv module into the YOLOv11n model backbone: The SPDConv module consists of two parts: first, an SPD layer, followed by a non-strided convolutional layer; The SPD layer generates a series of sub-feature maps by slicing the intermediate feature map. These sub-feature maps are obtained by dividing the specific area of the original feature map. Each sub-map downsamples the original feature map by a certain scaling factor. Then, a non-strided convolutional layer is used to further process the features transformed by the SPD layer. The non-strided convolutional layer uses learnable parameters to reduce the number of channels. Step 12.3: Introduce the C2PS-CBAM module into the model backbone: The PSA block is introduced into the standard C2f module. CBAM contains two sub-modules, CAM and SAM, which perform channel and spatial attention respectively.
6. The solar photovoltaic panel infrared thermal image defect detection method based on improved YOLOv11 according to claim 1, characterized in that: In step 13, training the model includes: inputting the training set collected in step 11 into the improved model in step 12 for training to obtain a new network model.
7. The solar photovoltaic panel infrared thermal image defect detection method based on improved YOLOv11 according to claim 6, characterized in that: Step 13 also includes setting up the experimental environment: the deep learning training environment is implemented using the Pytorch-GPU training framework and Python language, using CUDA version 11.7 and the GPU version NVIDIA GeForce GTX 3080Ti.
8. The solar photovoltaic panel infrared thermal image defect detection method based on improved YOLOv11 according to claim 7, characterized in that: Set network parameters: image training size is set to 1024×1024; epoch is set to 200; batch-size is set to 16.
9. A solar photovoltaic panel infrared thermal image defect detection device based on improved YOLOv11, characterized in that: The device includes: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, it implements the solar photovoltaic panel infrared thermal image defect detection method based on the improved YOLOv11 according to any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer program instructions, which, when executed by a processor, implement the solar photovoltaic panel infrared thermal image defect detection method based on the improved YOLOv11 according to any one of claims 1 to 8.
Citation Information
Cited By
Defect detection method, system and equipment based on chessboard convolution and medium
CN120747090A
Overhead power communication optical cable defect detection method, device and system, and storage medium
CN121504865A
Defect detection method and device, system and storage medium for overhead power communication optical cable
CN121504865B