A photovoltaic panel fault detection method based on a multi-scale scaling feature fusion network
By improving the YOLOv8 network and combining it with the PEMA module and TS-WIoU loss function, the shortcomings of existing photovoltaic panel fault detection methods in terms of accuracy and speed are solved, and efficient and accurate detection of photovoltaic panel faults is achieved.
Patent Information
- Application Number
- CN202411662184.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-20
- Publication Date
- 2025-12-30
- Estimated Expiration
- 2044-11-20
AI Technical Summary
Existing photovoltaic panel fault detection methods are insufficient in terms of accuracy and speed. In particular, they are prone to false detections when processing target images of different scales and proportions, and they are difficult to effectively extract features such as cracks, especially small target features.
We adopt a method based on multi-scale scaling feature fusion network, which improves the YOLOv8 network by adding a PEMA module and a feature fusion module to the Bottleneck layer, and using the TS-WIoU loss function to optimize model training, thereby enhancing feature representation and anchor box quality.
It significantly improves the accuracy and generalization of photovoltaic panel fault detection, enhances the detection capability for small targets and multi-scale features, and achieves higher detection accuracy and faster detection speed.
Smart Images

Figure CN119516274B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of photovoltaic panel fault detection technology, and specifically to a photovoltaic panel fault detection method based on a multi-scale scaling feature fusion network. Background Technology
[0002] With global population growth and economic development, over-reliance on traditional fossil fuels has led to increasingly serious environmental pollution and climate change problems. Therefore, developing renewable energy has become an important direction for adjusting the global energy structure. Due to its cleanliness and low-carbon characteristics, solar energy has become a crucial component of renewable energy. Photovoltaic panels (PV) are key equipment for converting solar energy into electricity and are widely used in solar power generation. However, surface defects in PV panels can lead to decreased photoelectric conversion efficiency, and hot spot effects can cause safety accidents such as fires. Therefore, with the continuous expansion of photovoltaic power plants, avoiding PV failures is crucial for ensuring stable power generation, efficient operation, and safe production of photovoltaic power generation systems.
[0003] In recent years, PV surface defect detection has been extensively studied. The initial method for PV defect detection was manual visual inspection, identifying damage, shading, hot spots, and other faults by manually observing the appearance of the photovoltaic panel. However, this method is inefficient and prone to subjective judgment. Furthermore, relying on professionally trained personnel, fatigue from long working hours can lead to errors. Therefore, manual visual inspection is unsuitable for large-scale PV defect detection and real-time monitoring. Currently, PV defect detection methods can be divided into traditional target detection methods and deep learning-based defect detection methods. Traditional target detection methods generate candidate regions on the target image using sliding window technology, extract features, and then use classifiers such as Support Vector Machines (SVM) to identify the target. Major detection methods include the Viola-Jones detector, the HOG detector, and AdaBoost ensemble learning. However, the sliding window method generates a large number of false detections against the background and is not adept at handling target images of different sizes and scales. Deep learning-based defect detection methods mainly include defect imaging and feature extraction. The methods are mainly divided into two categories: one-stage detection methods, such as YOLO, SSD, and RetinaNet; and two-stage detection methods, such as R-CNN, Fast R-CNN, and Faster R-CNN. One-stage detection methods directly predict the category and location of the target from the target image without generating candidate regions. Two-stage detection methods generate a set of candidate regions, classify these regions, and regress bounding boxes. This method generally outperforms one-stage methods in target localization and classification accuracy, but it has higher computational costs and is therefore slower than one-stage detection methods. With the technological advancement of one-stage detection methods, their accuracy has been significantly improved through iterative updates, such as the YOLO series of methods. Improving the accuracy and speed of detection methods is essential for large-scale distributed photovoltaic (PV) panel defect detection; therefore, deep learning methods have significant research value for PV panel defect detection.
[0004] The YOLO algorithm in deep learning is widely used in image detection due to its speed and high accuracy. This has prompted numerous researchers to develop improvement strategies to enhance its performance in image detection. For example, some researchers have designed a new lightweight bottleneck fusion strategy with an efficient multi-scale attention (EMA) mechanism to improve model robustness and reduce model parameters. However, its multi-scale feature attention map and dual-channel feature map do not achieve good feature extraction. Other researchers have designed the BiMAF module, which can effectively fuse features at both the global and local levels. However, model performance degrades when training data is imbalanced or anchor box quality is low. Another researcher proposed an improved method integrating GSConv, BiFPN, and DW-Conv, which significantly improves accuracy and training speed. However, this method faces difficulties in extracting edge features and small object features, easily leading to information loss during feature fusion. Currently, YOLOv8 is a relatively advanced algorithm with classification, detection, and segmentation capabilities. With high classification accuracy, detection mAP and segmentation mAP offer faster detection speeds, enabling real-time fault detection. However, YOLOv8 struggles to extract features such as crack detection, especially for targets with poor feature quality. Furthermore, YOLOv8 lacks the ability to enhance edge feature extraction and cannot effectively capture targets with features at different scales. It also faces challenges such as dataset class imbalance, size bias, and low anchor box quality, which inevitably affect the model's detection performance, particularly for small target defects.
[0005] To address this, a photovoltaic panel fault detection method based on a multi-scale scaling feature fusion network is proposed. Summary of the Invention
[0006] The technical problem to be solved by this invention is: how to solve the above-mentioned problems of existing detection methods, thereby improving the accuracy of photovoltaic panel fault detection, and providing a photovoltaic panel fault detection method based on a multi-scale scaling feature fusion network.
[0007] like Figure 1 As shown, the present invention solves the above-mentioned technical problems through the following technical solution, and the present invention includes the following steps:
[0008] S1: Network Construction
[0009] The YOLOv8 network was chosen as the base model. The EMA module was optimized using the ReLU activation function and subjected to cross-space learning and global structural pruning to obtain the PEMA module. A PEMA module was added to the input of the Bottleneck layer of the C2f module in the YOLOv8 backbone network, and a feature fusion module was added to the output of the Bottleneck layer, resulting in the C2f_PEMA backbone network. The C2f_PEMA backbone network was then used to replace the backbone network in the YOLOv8 network to obtain the photovoltaic panel fault detection network.
[0010] S2: Model Training
[0011] The loss calculation of the photovoltaic panel fault detection network is optimized by using the TS-WIoU loss function. The photovoltaic panel fault detection network is then used to train the model on the processed photovoltaic panel image to obtain a photovoltaic panel fault detection model for fault detection.
[0012] S3: Fault Detection
[0013] The image of the photovoltaic panel to be detected is input into the photovoltaic panel fault detection model for defect detection, and the defect type and defect bounding box coordinate information of the photovoltaic panel fault detection are output.
[0014] Furthermore, in step S1, the EMA module extracts descriptors for attention weights from the grouped feature images through three independent channels, wherein two channels are 1x1 branches and the third channel is a 3x3 branch.
[0015] In the 1x1 branch, one-dimensional global average pooling is used to encode channel information in two spatial dimensions, namely horizontal and vertical dimensions. Then, the two encoded features are fused and a 1x1 convolution operation is performed. The ReLU activation function is used to aggregate the attention maps of the two channels in each group through multiplication operations to obtain the first attention feature map.
[0016] In the 3x3 branch, 3x3 convolution operations are performed on the grouped features to capture feature representations at different scales, and then the output is averaged to generate a second attention feature map.
[0017] Furthermore, in step S1, when performing cross-space learning, the two attention feature maps are reconstructed using a two-dimensional global adaptive average pooling method. Then, the reconstruction result is normalized using a softmax function to obtain standardized attention weights. Finally, the normalized result is merged using element-wise multiplication to generate a spatial attention map containing complete spatial location information.
[0018] The reconstruction formula is as follows:
[0019]
[0020] Where C represents the number of input channels, H and W represent the spatial dimensions of the input features, i.e., height and width, respectively, ∑ represents the accumulation operator, and x c This represents the input features of the Cth channel in the i-th row and j-th column. This represents the summation over all pixel positions (i,j). The first summation symbol ∑ sums the height H, and the second summation symbol ∑ sums the width W.
[0021] Furthermore, in step S1, an unstructured global pruning algorithm is used to prune the channel and weight parameters of the EMA module after optimization and cross-space learning processing to obtain a PEMA module.
[0022] Furthermore, in step S1, the feature fusion module uses convolutional layers and nonlinear activation functions to splice the outputs of the PEMA module and each Bottleneck layer, thus fusing global and local information together.
[0023] Furthermore, in step S2, when training using the TS-WIoU loss function, the WIoU loss value is calculated based on the predicted bounding box and the ground truth bounding box. Then, the WIoU loss value is divided by the temperature parameter to adjust the magnitude of the WIoU loss value. Finally, the gradient is recalculated based on the adjusted loss function. Subsequently, the backpropagation process of the model is executed, and the model parameters are updated. The adjusted loss function is the TS-WIoU loss function.
[0024] Furthermore, in step S2, the calculation formula for the TS-WIoU loss function is as follows:
[0025]
[0026] Where p represents the predicted bounding box, i.e., the predicted box; g represents the ground truth bounding box, i.e., the ground truth box; IoU(p,g) is the intersection-union ratio loss between the predicted box p and the ground truth box g; CIoU(p,g) is the CIoU loss between the predicted box p and the ground truth box g, which takes into account the overlapping area, center point distance, and aspect ratio; α1 is the weighting parameter of the IoU loss, β1 is the weighting parameter of the CIoU loss; T is the temperature parameter used to adjust the influence of α1 and β1.
[0027] Furthermore, the formula for calculating the WIoU loss value is as follows:
[0028]
[0029] in, * indicates that the size of the minimum bounding box is extracted and processed separately. d represents the square of the Euclidean distance between the center points of the two bounding boxes. 2 α represents the square of the distance between the predicted bounding box and the ground truth bounding box. Regions A and B are the corresponding ground truth box and predicted box, respectively. The IoU loss is used to measure the degree of overlap between the predicted box and the ground truth box. β2 represents the outlier. α2 and δ are hyperparameters.
[0030] The present invention has the following advantages over the prior art:
[0031] 1. A Prune Efficient Multi-Scale Attention (PEMA) mechanism is proposed to improve feature representation capabilities. The ReLU activation function is used to optimize feature fusion, and global pruning of the network structure is performed to improve the detection accuracy and generalization of the model.
[0032] 2. A temperature-scaled-WIoU (TS-WIoU) loss function is proposed to alleviate the imbalance of detected target categories, and the parameter calculation of the model is optimized to significantly improve the quality of anchor boxes.
[0033] 3. Design a backbone network based on the C2f-PEMA network. Combine the improved PEMA module with the C2f module, and add a feature fusion module to enhance feature representation capabilities, thereby improving the model's detection accuracy.
[0034] 4. After in-depth theoretical analysis and comprehensive evaluation, the comparative results confirm that the proposed method has significant performance advantages. Attached Figure Description
[0035] Figure 1 This is a flowchart illustrating the present invention;
[0036] Figure 2 This is a general framework diagram of the multi-scale scaling feature fusion network in Embodiment 1 of the present invention;
[0037] Figure 3 This is a schematic diagram of the PEMA module in Embodiment 1 of the present invention;
[0038] Figure 4 This is a schematic diagram of the C2f_PEMA backbone network in Embodiment 1 of the present invention. Detailed Implementation
[0039] The embodiments of the present invention are described in detail below. These embodiments are implemented based on the technical solution of the present invention, and provide detailed implementation methods and specific operation processes. However, the scope of protection of the present invention is not limited to the following embodiments.
[0040] Example 1
[0041] This embodiment provides a technical solution: a photovoltaic panel fault detection method based on a multi-scale scaled feature fusion network (MSFFN). The overall framework of MSFFN is as follows: Figure 2 As shown. Although YOLOv8 has demonstrated good performance in object detection, it still has shortcomings in the task of detecting defects on photovoltaic panel surfaces. To enhance the compatibility of the model with different devices, this invention performs global structural pruning on the EMA module. To enhance the model's multi-scale feature fusion characteristics and improve feature representation, this invention optimizes the activation function of the EMA module and embeds it into the C2f module of the backbone network, and performs feature fusion on the outputs of the two modules to improve the model's detection accuracy. To optimize the loss function calculation and handle class imbalance in the dataset, this invention adopts the WIoU loss function and incorporates a temperature scaling operation. The following sections will describe the details of the main contents one by one.
[0042] 1. Prune Efficient Multi-Scale Attention (PEMA) mechanism
[0043] This invention proposes a Prune Efficient Multi-Scale Attention (PEMA) mechanism to improve feature representation capabilities. The design employs the ReLU activation function to optimize feature fusion in the EMA module and performs global pruning of the network structure to improve model detection accuracy and model generalization.
[0044] EMA module optimization
[0045] In photovoltaic panel defect detection, there are small targets belonging to a separate category. These small targets occupy few pixels and have indistinct texture features, making detection difficult. In particular, YOLOv8's convolutional operations are prone to feature loss when extracting feature information. Therefore, this invention employs an efficient multi-scale attention mechanism (EMA) module. The EMA module uses a shared 1x1 convolutional branch from the CA module and names it the 1x1 branch. To better improve the aggregation of multi-scale spatial structure information, the EMA module adds a 3x3 convolutional kernel in parallel next to the 1x1 branch and names it the 3x3 branch.
[0046] like Figure 3As shown, the parallel sub-network, the EMA module, extracts descriptors for attention weights from the grouped feature images through three independent channels. Two channels form 1x1 branches, and the third channel forms a 3x3 branch. In the 1x1 branch, one-dimensional global average pooling is used to encode channel information in two spatial dimensions, namely the horizontal and vertical dimensions. Then, the two encoded features are fused and a 1x1 convolution operation is performed. Since Sigmoid is suitable for handling binary classification problems, and photovoltaic panel fault detection in this invention is not a binary classification problem but has multiple fault categories, this invention uses the ReLU activation function to obtain a dual-channel attention map. Through a simple multiplication operation, the attention maps of the two channels within each group are aggregated to obtain the first attention feature map, thereby realizing different cross-channel feature interactions between the two parallel paths in the 1x1 branch. The 3x3 branch uses EMA to perform a 3x3 convolution operation on the grouped features to capture feature representations at different scales, and then performs average pooling on the output to generate the second attention feature map.
[0047] The formula for calculating the channel attention graph is as follows:
[0048]
[0049] Where C represents the number of input channels, H and W represent the spatial dimensions of the input features, i.e., height and width, respectively, ∑ represents the accumulation operator, and x c This represents the input feature of the C-th channel. This represents the average pixel value calculated along the column and row in the height direction; 0≤i≤W and 0≤j≤W represent the range of the summation, i.e., from 0 to the width W.
[0050] Cross-spatial learning: The EMA module enhances feature aggregation by aggregating information across different spatial dimensions. This module generates two attention feature maps encoding global spatial information in 1x1 and 3x3 convolutional branches. These feature maps are reconstructed using a two-dimensional global adaptive average pooling method, as shown in the following formula. The results are normalized using a softmax function to obtain standardized attention weights. Finally, the normalized results from these two branches are merged through element-wise multiplication to produce a spatial attention map containing complete spatial location information.
[0051]
[0052] In summary, the improved EMA module efficiently integrates global and local information using global average pooling and dot product operations, enabling the network model to identify the overall structural and morphological features of photovoltaic panel fault areas and capture detailed features and texture information of local areas. Furthermore, the improved EMA module initially segments the input into multiple sub-features with excellent spatial semantic properties. Parallel 1x1 and 3x3 convolution operations within the module are used to obtain the spatial context information of the target region.
[0053] Pruning operations
[0054] Due to limitations in computational resources and inference time, the baseline model YOLOv8 suffers from limitations in computational resources and inference time. Therefore, this invention performs global pruning on the EMA module. Pruning is divided into two categories: structured pruning and unstructured pruning. Compared to structured pruning, which removes weights according to a specific pattern or method, unstructured pruning removes weights randomly within the weight matrix of the neural network, without relying on a specific pattern or method. Unstructured global pruning selectively removes weights based on their L1 norm, rather than removing weights from a specific row, column, or block, allowing for more flexible reduction of feature loss and improved model robustness and generalization. Therefore, this invention employs an unstructured global pruning algorithm to trim the channel and weight parameters of the optimized EMA module, resulting in a PEMA module (see...). Figure 3 This approach reduces computational complexity and model size while maintaining accuracy, thereby obtaining a detection model with high robustness and generalizability.
[0055] 2. TS-WIoU Loss Function
[0056] YOLOv8 employs a dynamic label matching strategy, assigning object labels to anchors associated with the predicted bounding box. These anchors are based on ground-value feature maps calculated using a loss function. In loss calculation, it shifts from an anchor-based approach to an anchor-free one, integrating the Complete Intersection over Union (CIoU) loss function to handle bounding box regression, enhancing the model's consistency across classification and localization tasks. The original CIoU regression loss function in the YOLOv8 algorithm did not adequately account for the mismatch between the projected frame and the actual frame.
[0057] Equipment fault and defect detection in the photovoltaic panel field involves multiple fault types, posing a greater challenge in identification and localization than single-category detection. Therefore, it is necessary to improve the network's localization performance to better handle complex scenarios. WIoU (Weighted Intersection over Union) employs a dynamically changing focusing mechanism to dynamically evaluate the quality of anchor boxes and creates an attention-based loss function focused on the bounding boxes through gradient gain adjustment. This loss function enhances the model's generalization and robustness in object detection tasks by incorporating outliers. Furthermore, WIoU implements an efficient gradient gain allocation strategy to reduce the negative impact of low-quality samples on the training process. This allows WIoU to focus on optimizing medium-quality anchor boxes, significantly improving the overall performance of object detection. Therefore, this invention uses WIoU as the model's loss function and incorporates temperature scaling to improve detection accuracy. The calculation formula for the WIoU loss function is shown below:
[0058]
[0059] in,
[0060] In object detection, * indicates that the size of the minimum bounding box is extracted and processed separately. d represents the square of the Euclidean distance between the center points of the two bounding boxes. 2 δ represents the squared distance between the predicted bounding box and the ground truth bounding box. Regions A and B correspond to the actual ground truth bounding box and the model-predicted bounding box, respectively. IoU (Intersection over Union) measures the degree of overlap between the predicted and ground truth boxes, thus evaluating the detection accuracy. Hyperparameters α2 and δ are empirically set to 1.9 and 3, respectively. β2 represents outlier, used to describe the degree of anomalousness in anchor box quality. Anchor boxes with lower outlier are considered to be of higher quality and therefore receive smaller gradient gains. Conversely, anchor boxes with higher outlier, i.e., lower quality anchor boxes, receive smaller gradient gains to avoid them having an excessively negative impact on model training.
[0061] Temperature scaling: Temperature-Scaled WIoU (TS-WIoU) Loss Module
[0062] Temperature scaling is a technique used in deep learning to calibrate model output probabilities, particularly in classification tasks. By dividing the model output by a temperature parameter, it adjusts the shape of the probability distribution, making predictions for certain classes more accurate. This technique enhances the model's ability to recognize features from different classes by adjusting the cross-entropy loss function. Especially when facing challenges of class imbalance or uneven sample distribution, temperature scaling helps optimize model performance, reduce bias towards the majority class, and thus enhance the model's accuracy and robustness. This invention combines temperature scaling with the WIoU loss function to form the TS-WIoU (Temperature-Scaled WIoU) loss function. This loss function combines the weighted cross-union ratio advantage of WIoU with the flexible adjustment capability of temperature scaling. By adjusting and improving the model's parameter calculation process, the computational performance of the loss function is enhanced, further improving the prediction accuracy of bounding boxes in object detection tasks. First, the WIoU loss value is calculated based on the predicted and ground truth bounding boxes. Then, the WIoU loss value is divided by the temperature parameter to flexibly adjust its magnitude. Finally, the gradient is recalculated based on the adjusted loss function, followed by the backpropagation process of the model, and the model parameters are updated. The formula for calculating the TS-WIoU loss function is shown below:
[0063]
[0064] Where p represents the predicted bounding box, g represents the ground truth bounding box, IoU(p,g) is the intersection-over-union ratio between the predicted box p and the ground truth box g, and CIoU(p,g) is the complete intersection-over-union between the predicted box p and the ground truth box g, taking into account the overlapping area, center distance, and aspect ratio. α1 is the weighting parameter of the IoU loss, β1 is the weighting parameter of the CIoU loss, and T is the temperature parameter used to adjust the influence of α1 and β1.
[0065] 3. C2f_PEMA backbone network
[0066] Photovoltaic panel fault detection plays a crucial role in the development of new energy sources. However, the uneven distribution of fault types and sizes, and the difficulty in detecting small-target defects, hinder the development of accurate photovoltaic panel fault detection systems. These existing systems fail to meet detection requirements, and their large model sizes make them difficult to deploy on mobile devices. To address these issues, the C2f module of the YOLOv8 backbone layer is modified and optimized by adding a PEMA attention mechanism module before the Bottleneck layer and a feature fusion module after the output.
[0067] like Figure 4As shown, the C2f_PEMA module of this invention is an improvement on the original C2f module. An optimized EMA module (PEMA attention mechanism module) is added before the Bottleneck part to enhance the dynamics of the model's feature representation. The PEMA attention mechanism module achieves efficient integration of global and local feature information through advanced global average pooling and dot product operations. This module can not only capture the macroscopic structural and morphological features of the photovoltaic panel surface defect detection area, but also extract detailed features and texture information of local areas, greatly improving the accuracy and reliability of the model in photovoltaic panel fault detection tasks. Through optimization and improvement of the activation function of the PEMA attention mechanism module and a carefully designed pruning strategy, the model's performance is further improved, achieving both increased accuracy and computational speed. These improvements not only enhance the model's robustness and generalization but also improve its deployability in practical applications.
[0068] In the C2f_PEMA backbone network, the feature fusion module combines global and local information by concatenating the outputs of the PEMA module and each Bottleneck layer. The PEMA module enhances the temporal continuity of feature representation and its ability to capture dynamic changes by applying exponential moving average. The Bottleneck layers effectively extract key information from the features through deep convolution and dimensionality transformation, while also reducing the number of model parameters. After merging these outputs along the channel dimension, the feature fusion module further promotes the interaction and fusion between features using convolutional layers and nonlinear activation functions, enabling different features to complement each other and improving the overall feature representation capability of the model. The C2f_PEMA backbone network structure diagram is shown below. Figure 4 As shown.
[0069] Example 2
[0070] In this embodiment, the PV-ELAD dataset jointly released by Hebei University of Technology and Beijing University of Aeronautics and Astronautics is used as the base dataset. The PV-ELAD dataset contains 4415 images of 6 defect failure types, including crack, fingerprint, black core, short circuit, thick line, and horizontal displacement.
[0071] To verify the accuracy and generalization of the proposed photovoltaic panel fault detection model (MSFFN model) in image detection, especially its superiority in small target detection, experiments were conducted using the open-source photovoltaic panel defect fault (PV-DF) dataset and the open-source small target photovoltaic panel (PV-OD) dataset. The PV-DF dataset contains 4415 images with three defect types: scratches, broken grids, and dirt. The PV-OD dataset contains 4007 images, and the image detection type is small target photovoltaic panel images.
[0072] This invention uses standard image detection evaluation metrics, including mAP (Mean Average Precision), recall, and precision, as detailed below:
[0073]
[0074] In this dataset, TP (True Positives) represents the number of correctly identified target detection boxes; FP (False Positives) refers to the number of non-target detection boxes incorrectly identified as targets; and FN (False Negatives) refers to the number of actual targets that the model failed to detect. mAP (Mean Average Precision) is the average of the precision across all classes, measuring the overall performance of the model across all classes in the dataset. Precision P (Precision) is the proportion of truly positive samples among all samples judged positive by the model, reflecting the model's false detection rate. Recall R (Recall) is the proportion of correctly identified samples among all actually positive samples, measuring the model's false negative rate. All detection refers to all positive samples detected by the model, while all ground truth refers to all actually existing positive samples.
[0075] To evaluate the superiority of the proposed method in the task of detecting defects on photovoltaic panels, the experiments in this embodiment compared the performance of MSFFN with the current mainstream advanced image detection models SSD, Efficientdet-d0, Retinenet, Faster-RCNN, YOLOv5, YOLOv8, YOLOv9 (2024), and YOLOv10 (2024). The comparison results are shown in Table 1.
[0076] Table 1 Comparison Results
[0077] algorithm mAP / % SSD 79.45 Efficientdet 63.59 Retinenet 90.87 Faster-RCNN 90.73 YOLOv5 88.7 YOLOv8 90 YOLOv9 0.912 YOLOv10 0.904 MSFFN (Model of this Invention) 0.921
[0078] As shown in Table 1, the proposed model (MSFFN model) achieves the highest detection accuracy compared to the comparative models. The MSFFN model's mAP reaches 92.1%, representing a 2.1% improvement over the baseline model YOLOv8, and improvements of 0.9% and 1.7% respectively compared to the recently proposed YOLOv9 and YOLOv10. This demonstrates that the proposed model has the best performance in detecting defective targets. Although YOLOv9 introduces the GELAN module to improve parameter utilization, this translates into performance advantages in photovoltaic panel defect detection tasks. Furthermore, the YOLOv9 model is larger than YOLOv8, leading to a decrease in detection accuracy on some datasets. Therefore, its prediction accuracy is lower than that of the proposed MSFFN model. YOLOv10 integrates large-kernel convolution and partial self-attention (PSA) modules to improve the model's ability to capture global information. However, in photovoltaic panel defect detection tasks with varying sizes and shapes, the improvement in detection accuracy due to global information is not significant; therefore, its prediction accuracy is lower than that of the proposed MSFFN model. The proposed MSFFN model employs a multi-scale feature fusion approach, incorporating a feature fusion module into the backbone network to enhance feature representation, improve anchor box quality, and address issues such as class imbalance, thereby improving detection accuracy. Therefore, the proposed MSFFN model demonstrates significant advantages compared to the latest YOLOv9 and YOLOv10 models. The MSFFN model proposed in this invention surpasses advanced image detection algorithms in detection accuracy.
[0079] In summary, the photovoltaic panel fault detection method based on multi-scale scaling feature fusion network described in the above embodiments performs structured global pruning of the EMA module and optimizes the activation function to enhance the model's detection performance; it adopts WIoU loss and introduces temperature scaling to optimize loss calculation; it embeds the PEMA module into the C2f module of the backbone network, and then fuses the outputs of the PEMA module and the Bottleneck layer of the C2f module to enhance feature representation, thereby solving the problem of difficulty in extracting edge features or small target features in the original model; the proposed model has been validated on multiple experimental datasets, demonstrating its superior performance. The contribution of this invention is of great significance to promoting the sustainable development of renewable energy.
[0080] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.
Claims
1. A photovoltaic panel fault detection method based on a multi-scale scaling feature fusion network, characterized by, The method comprises the following steps: S1: network construction YOLOv8 network is selected as a basic model; the EMA module is optimized by using a ReLU activation function and is subjected to cross-space learning and structure global pruning processing to obtain a PEMA module; the PEMA module is added to the input part of the Bottleneck layer of the C2f module in the backbone network of the YOLOv8, and a feature fusion module is added to the output part of the Bottleneck layer to obtain a C2f_PEMA backbone network; the C2f_PEMA backbone network is used to replace the backbone network in the YOLOv8 network to obtain a photovoltaic panel fault detection network; S2: model training The TS-WIoU loss function is used to optimize the loss calculation of the photovoltaic panel fault detection network, the photovoltaic panel fault detection network is used to train the processed photovoltaic panel image to obtain a photovoltaic panel fault detection model for fault detection; S3: fault detection The photovoltaic panel image to be detected is input into the photovoltaic panel fault detection model for defect detection, and defect type and defect bounding box coordinate information of the photovoltaic panel fault detection are output; In the step S1, the EMA module extracts descriptors for attention weights from grouped feature images through three independent channels, wherein two channels are 1X1 branches, and the third channel is a 3X3 branch; In the 1x1 branch, one-dimensional global average pooling operations are used to encode channel information in two spatial dimensions, i.e., horizontal and vertical dimensions, then two encoded features are fused and subjected to 1X1 convolution operation, and a ReLU activation function is used to aggregate the attention maps of the two channels in each group through multiplication operation to obtain the first attention feature map; In the 3x3 branch, 3x3 convolution operation is performed on the grouped features to capture feature representations of different scales, and then average pooling is performed on the output result to generate the second attention feature map; In the step S2, the calculation formula of the TS-WIoU loss function is as follows: Wherein, p represents a predicted bounding box, i.e., a prediction box; g represents a real bounding box, i.e., a real box; IoU(p,g) is the intersection over union loss between the prediction box p and the real box g; CIoU(p,g) is the CIoU loss between the prediction box p and the real box g, which considers the overlapping area, center point distance and width-height ratio; α1 is a weight parameter of the IoU loss, β1 is a weight parameter of the CIoU loss; T is a temperature parameter for adjusting the influence of α1 and β1. 2.The photovoltaic panel fault detection method based on the multi-scale zoom feature fusion network according to claim 1, characterized in that, In the step S1, when cross-space learning is performed, two-dimensional global adaptive average pooling is used to reconstruct the two obtained attention feature maps, then the reconstructed results are normalized by using a softmax function to obtain standardized attention weights, and finally the normalized results are combined by element-wise multiplication to generate a spatial attention map containing complete spatial position information; The reconstruction formula is as follows: where e denotes the number of input channels, H and W denote the spatial dimensions of the input features, i.e. height and width, ∑ denotes the summation symbol, x e (i,j) denotes the input feature of the e-th channel, i-th row and j-th column, denotes the summation over all pixel positions (i,j) of the feature, the first summation symbol ∑ is over the height H and the second summation symbol ∑ is over the width W. 3.The photovoltaic panel fault detection method based on the multi-scale zoom feature fusion network according to claim 2, characterized in that, In the step S1, the channel and weight parameters of the EMA module processed by optimization and cross-space learning are pruned by using an unstructured global pruning algorithm to obtain a PEMA module.
4. The photovoltaic panel fault detection method based on the multi-scale zoom feature fusion network according to claim 3, characterized in that, In the step S1, the feature fusion module splices the output parts of the PEMA module and each Bottleneck layer by using a convolution layer and a nonlinear activation function to fuse the global information and the local information together.
5. The photovoltaic panel fault detection method based on the multi-scale zoom feature fusion network according to claim 4, characterized in that, In the step S2, when the training is performed by using the TS-WIoU loss function, the WIoU loss value is calculated according to the predicted frame and the real frame, then the WIoU loss value is divided by the temperature parameter to adjust the size of the WIoU loss value, finally the gradient is recalculated according to the adjusted loss function, then the back propagation process of the model is performed, and the model parameters are updated, and the adjusted loss function is the TS-WIoU loss function.
6. The photovoltaic panel fault detection method based on the multi-scale zoom feature fusion network according to claim 5, characterized in that, The calculation formula of the WIoU loss value is as follows: wherein, * indicates that the size of the minimum bounding box is extracted separately for processing, represents the square of the Euclidean distance between the centers of the two bounding boxes, d 2 represents the square of the distance between the predicted bounding box and the real bounding box, regions A and B are the corresponding real frame and predicted frame, the IoU loss is used to measure the degree of overlap between the predicted frame and the real frame, β2 represents the degree of outlying, and α2 and δ are hyperparameters.
Citation Information
Patent Citations
Photovoltaic panel surface defect detection method based on pruning multi-scale feature fusion network
CN120278992A