A method and system for detecting hot spot defects in photovoltaic panels based on YOLOv11n optimization and improvement

By introducing ADown, MDCR, and EMA networks into the YOLOv11 network, the detection of hot spots on photovoltaic panels is optimized, solving the problems of accuracy and real-time performance in detecting small targets in complex backgrounds, and achieving efficient and accurate detection of hot spot defects on photovoltaic panels.

CN122135172APending Publication Date: 2026-06-02NANJING NORMAL UNIVERSITY

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
NANJING NORMAL UNIVERSITY
Filing Date
2026-03-09
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

Existing photovoltaic panel inspection technologies struggle to efficiently identify small hot spot defects in the face of complex backgrounds and noise interference, resulting in insufficient detection accuracy and real-time performance, and a high rate of false detections and false misses.

Method used

Based on the YOLOv11 network framework, an adaptive downsampling network (ADown), a multi-channel dilatation refinement network (MDCR), and an efficient multi-scale attention module (EMA) are introduced to optimize the backbone and neck network layers, enhance feature extraction and multi-scale fusion capabilities, and optimize the model by combining bounding box regression, classification, and distribution set loss functions.

Benefits of technology

It significantly improves the accuracy and generalization of hot spot small target detection during drone inspections of photovoltaic power plants, reduces the false detection rate and missed detection rate, and meets the needs of industrial production.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122135172A_ABST
    Figure CN122135172A_ABST
Patent Text Reader

Abstract

This invention discloses a photovoltaic panel hot spot defect target detection method based on optimized and improved YOLOv11n. The method involves the following steps: inputting a constructed photovoltaic hot spot defect dataset; constructing a target detection network model based on optimized and improved YOLOv11n network structure; training and validating the optimized and improved network model against the original YOLOv11n, and concluding that the performance indicators (such as precision, recall, and mean precision) of the optimized and improved network model are higher than those of the original YOLOv11n. In practical industrial applications for photovoltaic hot spot defect target inference testing, the network model of this invention can accurately locate the hot spot defect position of the photovoltaic panel, improving the confidence probability by reducing the false detection rate or false negative detection rate of the true hot spot defect category. This invention has been verified by other publicly available infrared photovoltaic hot spot defect datasets and can further improve the detection accuracy and generalization of UAVs in photovoltaic hot spot small target detection tasks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of deep learning, computer vision, and photovoltaic power plant defect detection technology, specifically to a photovoltaic panel hot spot defect target detection method and system based on YOLOv11n optimization and improvement. Background Technology

[0002] When photovoltaic (PV) panels are in operation, they are susceptible to uneven solar radiation, ambient temperature variations, damage to components such as bypass diodes, and obstruction by bird droppings or dust. These factors can cause some units of the PV device to malfunction, meaning that the shaded areas can act as "loads" and generate localized overheating. This phenomenon is known as the "hot spot effect." This not only leads to power loss and performance degradation of the PV panel, but in severe cases, it can also cause the PV device to burn out or even pose safety hazards such as fires.

[0003] In recent years, deep learning technology has made significant progress in the field of computer vision, providing new approaches for defect detection in photovoltaic devices. Mainstream deep learning object detectors are primarily divided into three categories: multi-stage detectors, single-stage detectors, and other Transformer-based detectors. Single-stage detectors (such as RetinaNet, SSD based on the CNN framework, and the YOLO series) do not require the generation of intermediate candidate regions; they directly perform category prediction and bounding box localization on the feature map. They possess advantages such as simple structure, strong real-time performance, and fast inference speed, making them particularly suitable for scenarios with high requirements for detection speed and deployment performance. Multi-stage detectors (such as Faster R-CNN, Sparse R-CNN, and Cascade R-CNN) achieve high-precision detection by generating candidate regions and multi-stage regression, but their inference speed is slower and their real-time performance is poor. Transformer-based detectors (such as DINO, RT-DETR, and Deformable-DETR) utilize multi-head self-attention mechanisms to capture long-range dependencies, effectively extracting global contextual information between different regions in an image. They perform excellently in medium to large-sized object detection, but typically rely on large-scale datasets and high computational resources, placing high demands on real-time performance and device performance. In recent years, the YOLO series of algorithms have been continuously updated and iterated. Relying on a typical single-stage detector framework, with its end-to-end structure, efficient multi-scale feature fusion mechanism and good real-time performance, it has outstanding application potential in the field of target detection.

[0004] The YOLOv11 single-stage detector boasts excellent real-time performance, lightweight design, and strong multi-scale feature fusion capabilities, while the Transformer-based detector demonstrates significant potential in global feature modeling and contextual information fusion. By combining the strengths of both network algorithms—namely, by structural improvements and feature enhancements to the YOLOv11 network framework—an improved single-stage detection algorithm for small targets like hotspots in infrared images can be designed. This approach maintains the high real-time performance and lightweight design of the network model while enhancing the target detector's ability to identify small target features under complex backgrounds and noise interference. Summary of the Invention

[0005] Purpose of the invention: Based on the advantages of the network algorithms of YOLOv11 and Transformer detectors, this invention proposes a high-precision and highly generalizable infrared photovoltaic small target detection network model based on the improved YOLOv11n. This model ensures that when UAVs are performing multi-directional operations in photovoltaic power plants, the target detector can efficiently improve its feature extraction and multi-scale fusion capabilities for photovoltaic hot spot small targets.

[0006] Technical Solution: This invention provides a method for detecting hot spot defects in photovoltaic panels based on YOLOv11n optimization and improvement, specifically including the following steps:

[0007] S1. Collect infrared photovoltaic hot spot defect image samples;

[0008] S2. Next, perform image annotation and data augmentation preprocessing;

[0009] S3. The preprocessed infrared photovoltaic hot spot defect image samples are further processed into a dataset;

[0010] S4. Construct a network model based on the optimized and improved YOLOv11n;

[0011] S5. Calculate the loss function;

[0012] S6. Input the photovoltaic hot spot defect training set and validation set into the network model based on the above-mentioned improvement for training and validation;

[0013] S7. Input the photovoltaic hot spot defect test set into the network model to perform bounding box and confidence inference for photovoltaic hot spot defect targets.

[0014] Furthermore, the acquisition of infrared photovoltaic hot spot defect image samples in step S1 is to fuse five publicly available datasets of UAV infrared photovoltaic samples with multiple altitudes and multiple rotation angles into a multi-source dataset.

[0015] Furthermore, the image annotation and data augmentation preprocessing in step S2 involves using annotation tools to annotate the images in the multi-source dataset; and performing data augmentation processing such as flipping, rotating, brightness adjustment, and saturation adjustment on the annotated multi-source dataset samples.

[0016] Furthermore, in step S3, the preprocessed infrared photovoltaic hot spot defect image samples are further processed into a dataset by dividing the multi-source dataset samples after the above data enhancement processing into a training set, a validation set, and a test set according to a certain ratio to obtain the photovoltaic hot spot defect dataset.

[0017] Furthermore, in step S4, the construction of the network model based on the optimized and improved YOLOv11n involves replacing the traditional convolutional layers (Conv) in the backbone network layer with an adaptive downsampling network (ADown); secondly, the spatial pyramid pooling network (SPPF) in the backbone network layer is improved into a multi-channel dilated refinement network (MDCR), and MDCR is also introduced into the large-scale feature detection branch of the neck network layer; finally, the channel parallel spatial attention network (C2PSA) in the backbone network layer is improved into an efficient multi-scale attention module (EMA), and EMA is also introduced into the small-scale and medium-scale feature detection branches of the neck network layer.

[0018] Furthermore, the ADown network improvement strategy in step S4 is to process the input features in parallel by dividing them into two paths: one path uses 3×3 compensated convolution for downsampling; the other path integrates max pooling and point convolution to achieve downsampling.

[0019] Furthermore, the MDCR network improvement strategy in step S4 includes the following steps:

[0020] Input feature partitioning unit: The input multi-channel feature map is partitioned along the channel dimension ( The feature maps are divided into four independent branches and then subjected to depthwise separable convolution to capture local and global information at multiple scales.

[0021] Depth-separable expansion unit: Each branch is further divided along its respective channel dimension, and the single-channel features with the same dimension are then arranged and fused in the same dimensional order;

[0022] Feature enhancement unit: The multi-scale feature maps of the depth-separable dilatation unit are fused and upsampled by pointwise convolution, and then inference is accelerated by pointwise convolution and batch normalization and activation function.

[0023] Furthermore, the EMA network improvement strategy in step S4 includes the following steps:

[0024] Input feature grouping unit: groups the input feature map by channel ( ) divided into Each sub-feature has a dimension of 1. ), and will Sub-features are reshaped to the batch processing dimension, forming A new batch processing dimension;

[0025] Parallel sub-network unit: contains Branches and Branch. Branch reference of Global average pooling encodes spatial location information along the horizontal and vertical directions. Convolutional modeling of local cross-channel interactions; Branch through Convolution expands the receptive field, capturing multi-scale spatial structure information;

[0026] Cross-spatial learning unit: The outputs of the two branches are processed separately. Global average pooling, after After activation, two spatial attention maps are generated through matrix dot product, and then aggregated. The d function outputs the final attention weights, which are multiplied element-wise with the original input feature map to obtain a weighted feature map (the dimension remains the same). ( ), which can be directly embedded in deep networks.

[0027] Furthermore, the loss function in step S5 includes the following steps:

[0028] Bounding box regression loss: used to optimize the difference between the predicted bounding box and the true bounding box;

[0029] Classification loss: This part optimizes the model's prediction accuracy for the target category, ensuring the model correctly identifies which category an object in an image belongs to. Cross-entropy loss is used (…). )calculate;

[0030] Distribution concentration loss: mainly addresses the class imbalance problem in object detection, improving the model's performance in handling small targets and difficult samples.

[0031] In another aspect, the present invention provides a photovoltaic panel hot spot defect target detection system based on YOLOv11n optimization and improvement, capable of performing the above-mentioned photovoltaic panel hot spot defect target detection task, including:

[0032] Image acquisition unit: Acquires images of photovoltaic hot spot defects;

[0033] Image processing unit: performs image annotation and data augmentation on photovoltaic hot spot defect images;

[0034] Dataset Construction Unit: Based on image annotation and data augmentation of photovoltaic hot spot defect image samples, a dataset is constructed, which includes a training set, a validation set, and a test set;

[0035] Network model building unit: Using YOLOv11n as the original network model, an ADown network is introduced into the backbone network to replace the traditional convolutional layers in the shallow, intermediate, and deep layers. The original SPPF network in the deep layers is improved to an MDCR network, and the original C2PSA network is improved to an EMA network. EMA networks are introduced into the small-scale and medium-scale feature detection branches of the neck network, and an MDCR network is introduced into the large-scale feature detection branch.

[0036] Network model performance training and validation unit: The training and validation sets of photovoltaic hot spot defects are input into the improved network model to train and validate the model.

[0037] Network model inference target unit: Input the photovoltaic hot spot defect test set into the network model to infer the bounding box and confidence of the photovoltaic hot spot defect target.

[0038] Compared with some existing technologies, the beneficial effects of this invention are as follows: The network model based on the optimized and improved YOLOv11n proposed in this invention ensures that when UAVs perform multi-directional operations in photovoltaic power plants, they can efficiently improve the feature extraction and multi-scale fusion capabilities of the target detector for small photovoltaic hot spots, possessing high target detection accuracy and strong generalization, and significantly reducing the false detection rate and false negative rate of small hot spot defects. This invention provides a new optimization approach and solution for UAVs performing infrared inspection of photovoltaic device defects in photovoltaic power plants, thereby effectively meeting the needs of industrial production. Attached Figure Description

[0039] Figure 1 This is an overall flowchart of the photovoltaic panel hot spot defect target detection method in this invention;

[0040] Figure 2 This is a diagram of the overall network framework of the present invention based on the optimized and improved YOLOv11n.

[0041] Figure 3 This is a comparison chart of the experimental results (Precision index) of the network model before and after optimization and improvement based on YOLOv11n in this invention;

[0042] Figure 4 This is a comparison chart of experimental results (Recall index) of the network model before and after optimization and improvement based on YOLOv11n in this invention;

[0043] Figure 5This is a comparison chart of the experimental results (mAP@50 index) of the network model before and after optimization and improvement based on YOLOv11n in this invention;

[0044] Figure 6 Comparison of experimental results (mAP@50-95 index) of the network model before and after optimization and improvement based on YOLOv11n in this invention;

[0045] Figure 7 This is a comparison chart of the experimental results (Val Box Loss index) of the network model before and after optimization and improvement based on YOLOv11n in this invention;

[0046] Figure 8 This is a comparison chart of the experimental results (Val ClassLoss index) of the network model before and after optimization and improvement based on YOLOv11n in this invention;

[0047] Figure 9 This is a comparison chart of the experimental results (Val DFL Loss index) of the network model before and after optimization and improvement based on YOLOv11n in this invention;

[0048] Figure 10 This is a diagram showing the test results of photovoltaic hot spot defect target inference in this invention;

[0049] Figure 11 This is a flowchart of the photovoltaic panel hot spot defect target detection system based on YOLOv11n optimization and improvement of the present invention. Detailed Implementation

[0050] To make the objectives, technical solutions, and effects of this invention clearer and more explicit, the following description is provided in conjunction with the accompanying drawings in the embodiments. Figure 1-11 The technical solution of the method of the present invention will be further described below. The technical solution of the present invention will be elaborated in detail. It should be understood that the described embodiments are only for explaining the present invention and are not intended to limit the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the protection scope of the embodiments of the present invention.

[0051] Example 1: A schematic diagram of a photovoltaic panel hot spot defect target detection method based on YOLOv11n optimization and improvement is provided, as shown below. Figure 1 As shown, this embodiment mainly includes:

[0052] S1. Acquire infrared photovoltaic hot spot defect image samples, including:

[0053] In this embodiment, five publicly available infrared photovoltaic hotspot datasets from the Roboflow platform are merged to reconstruct a multi-source dataset. The sub-datasets within the multi-source dataset have diverse acquisition methods: multiple height viewpoints and multiple rotation viewpoints. The infrared photovoltaic hotspot defect image information in the multi-source dataset includes: random sampling of the five sub-datasets (a total of 9229 samples) involved in the multi-source dataset, ultimately obtaining 2577 infrared photovoltaic hotspot image samples with multiple height viewpoints, multiple rotation viewpoints, and complex backgrounds (such as chromatic aberration and noise), all with a resolution of 640×640.

[0054] S2. Next, perform image annotation and data augmentation preprocessing, including the following steps:

[0055] The multi-source dataset was labeled using Labellmg. All photovoltaic hotspot defect regions were manually marked with bounding boxes, and the hotspot defects were labeled as "hotspot". Then, all YOLO-type label files (.txt format) were exported.

[0056] Offline data augmentation includes the following steps:

[0057] (a) Images from subset 1 of the multi-source dataset are horizontally flipped and rotated from -13° to +13°;

[0058] (b) Images from subset 3 of the multi-source dataset were horizontally and vertically flipped, rotated -15° to +15°, and their brightness adjusted -15% to +15%.

[0059] (c) Images from subset 5 of the multi-source dataset were horizontally and vertically flipped, rotated -90° to +90°, and saturated -16° to +16°.

[0060] S3. The preprocessed infrared photovoltaic hot spot defect image samples are further processed into a dataset, including the following steps:

[0061] The multi-source dataset is further divided into training set (train), validation set (val), and test set (test) in an 8:1:1 ratio, with corresponding image and YOLO format annotation file data sizes of 2057, 260, and 260, respectively.

[0062] S4. Construct a network model based on the optimized and improved YOLOv11n; specific improvements are as follows: Figure 2 As shown, it includes the following steps:

[0063] Because YOLOv11 is prone to problems such as severe feature loss, insufficient downsampling information compression, and poor multi-scale feature fusion when performing small object detection in complex backgrounds, this invention will specifically use three functional networks to optimize and improve the backbone and neck layers of the original YOLOv11 network structure:

[0064] First, in the backbone, layers P3, P4, and P5 are replaced with traditional convolutional layers (Conv) using an adaptive downsampling network (ADown). This addresses the loss of texture and edge information caused by downsampling space dimensionality reduction in shallow feature layers. Furthermore, semantics and details are balanced in the feature layers, allowing the network to retain more local spatial information during feature extraction. Finally, dual-channel fusion is performed in the deep feature layers to improve the robustness of feature representation.

[0065] Secondly, the Spatial Pyramid Pooling (SPPF) module in the P5 layer of the backbone is improved into a Multi-Diffuse Channel Refinement (MDCR) module, and the MDCR is also introduced into the P5 large-scale feature detection branch of the Neck. This aims to both expand the receptive field under the deep-scale feature layer to enhance the network's ability to perceive multi-scale semantic features and improve the fusion quality of features at different scales to improve the network model's detection accuracy of hotspot small targets in multi-scale semantic space.

[0066] Finally, the channel-parallel spatial attention module (C2PSA) in layer P5 of the backbone was improved into an efficient multi-scale attention module (EMA), and the EMA was also introduced into the small-scale (P3) and medium-scale (P4) feature detection branches of the Neck. This adaptively enhances the features of salient target regions and suppresses redundant background information interference, enabling the network model to focus more on key target regions in complex backgrounds, improving the quality of multi-scale feature fusion, and further enhancing the network model's detection accuracy for hotspot-like small targets.

[0067] (1) Construct the ADown network improvement strategy in the optimized and improved network model based on YOLOv11n. The specific implementation of ADown includes the following steps:

[0068] The input contains a feature map with multiple channels (C is the number of channels, H and W are the height and width of the feature map). Then, a two-dimensional average pooling layer (AvgPool2D) with a 2×2 pooling kernel and a stride of 2 is used to compress the data space dimension by averaging the values ​​in each sliding region through a downsampling operation, generating a new smooth average pooling feature map. The spatial resolution changes from H×W to H / 2×W / 2, while the number of channels C remains unchanged. The average pooling feature map is then divided into two parallel branches along the channel dimension (each with the number of channels C / 2), denoted as X1 and X2, so that the module can independently process tasks with different feature types. Branch X1 performs downsampling through a convolutional layer with a 3×3 kernel and a stride of 2. This extracts smooth global features, such as color, texture, and shape, by focusing on the local receptive field, further reducing the spatial resolution (from H / 2×W / 2 to H / 4×W / 4). Branch X2 first uses a 2D max-pooling layer (MaxPool2D) with a 3×3 kernel and a stride of 2 to output the maximum value within each sliding region, extracting feature information such as the brightness of areas with significant photovoltaic hotspots. Then, it passes through a convolutional layer with a 3×3 kernel and a stride of 1 to further extract more refined local feature information, keeping the number of channels at C / 2. Finally, the feature maps obtained independently by branches X1 and X2 are concatenated along the channel dimension, fusing global and local feature information to obtain the final downsampled feature map. Finally, the output feature map is generated, restoring the number of output channels to C, and fixing the spatial resolution to H / 4×W / 4.

[0069] (2) Construct the MDCR network improvement strategy in the optimized and improved network model based on YOLOv11n. The specific implementation of MDCR includes the following steps:

[0070] Input feature partitioning unit: First, the input feature map (C×H×W, where C is the number of channels, and H and W are the height and width of the spatial dimension, respectively) is divided into four independent branch feature maps along the channel dimension. Then, depthwise separable convolution (DSConv) is performed on each branch with different dilation rates to obtain new feature maps under the four branches;

[0071] Depth-separable expansion unit: First, each group of branch feature maps is further divided into C / 4 parts along its respective channel dimension to obtain a single-channel feature map (1×H×W) under each branch. Then, the single-channel features with the same dimension in the four group of branch feature maps are arranged and fused in the same dimensional order to obtain C / 4 multi-scale feature maps (4×H×W). This process further enhances the feature representation capability of small targets;

[0072] Feature enhancement unit: First, feature information is fused from C / 4 multi-scale feature maps yj using pointwise convolution (PWConv). Then, the multi-scale feature map group is concatenated by Concat upsampling to obtain a new multi-scale feature map (C×H×W). PWConv is then applied to y again, followed by batch normalization (BN) and ReLU activation function for network acceleration inference, outputting the final multi-scale feature map (C×H×W). After two pointwise convolutions, lightweight inference and rich spatial and semantic feature aggregation are achieved.

[0073] (3) Construct the EMA network improvement strategy in the optimized and improved network model based on YOLOv11n. The specific implementation of EMA includes the following steps:

[0074] Input feature grouping unit: To reduce computational complexity, the input feature map (C×H×W) is divided into G independent branch feature maps (C / / G×H×W) along the channel dimension. Then, a three-branch parallel structure is used to capture the spatial attention feature map weight information of the input feature map.

[0075] The parallel sub-network unit specifically comprises a first stage and a second stage:

[0076] Stage 1: The input feature map is passed through two 1×1 branches (X1 and X2, C / / ×1×W and C / / G×H×1), and then through average pooling layers (XAvgPool and YAvgPool) in the W and H spatial dimensions to obtain two sets of feature encoding vectors. These two encoded feature vectors are then upsampled and concatenated (Concat), and then fused through a common 1×1 convolutional layer, outputting two one-dimensional vectors. The linear convolution results are then fitted by two non-linear sigmoid functions along the H and W directions, and the attention feature map and weight information (Re-weight) are obtained through element-wise multiplication. The input feature map is also passed through a 3×3 branch (X3, C / / G×H×W) and through a 3×3 convolutional layer to capture multi-scale features.

[0077] The second stage involves further cross-spatial aggregation of the feature maps obtained in the first stage, which contain information from different spatial dimensions. The 1×1 branch attention map is first normalized (GroupBorm), then subjected to a linear transformation using a two-dimensional average pooling layer (AvgPool) and a two-dimensional normalized exponential function (Softmax). This transformation is then combined with the output information of the 3×3 branch feature map processed in parallel in the first stage to perform matrix operations (Matmul), resulting in the first spatial attention map with multi-scale information. Similarly, the 3×3 branch feature map from the first stage is subjected to AvgPool and Softmax operations, and then combined with the normalized 1×1 branch attention map processed in parallel in the first stage to perform Matmul, resulting in the second spatial attention map with precise spatial location information.

[0078] Cross-spatial learning unit: The weight values ​​of the two spatial attention maps in each two-stage group are aggregated and fitted by a sigmoid function to obtain the final spatial attention map, which is rich in weight information of different regions in the feature map at the same scale and weight information of important regions in the feature maps at different scales (re-weight).

[0079] S5. Calculate the loss function; the loss function consists of bounding box regression loss (box_loss), classification loss (class_loss), and distribution settling loss (DFL_loss), and includes the following steps:

[0080] The overall mathematical expression for the loss function is calculated as follows: ;

[0081] In the above formula For balance coefficient, For bounding box regression loss variables, For categorical loss variables, The loss variable is distributed in a set of values.

[0082] Bounding box regression loss: used to optimize the difference between the predicted bounding box and the true bounding box, the specific mathematical expression is as follows:

[0083] + ;

[0084] In the above formula It is the size of the grid. It is the number of bounding boxes predicted for each grid cell. Indicates the first In the grid cell, the th Does each bounding box have the responsibility of predicting the target? These are the coordinates of the center point of the bounding box. These are the width and height of the bounding box. These are weighting coefficients used to balance the losses of different parts;

[0085] Classification loss: This part optimizes the model's prediction accuracy for the target category, ensuring the model correctly identifies which category an object in an image belongs to. Cross-entropy loss is used (…). The calculation is as follows:

[0086] ;

[0087] In the above formula It is the size of the grid. Indicates the first Does each grid cell contain the target? It is the model's prediction of the first The target in each grid cell belongs to category The probability, It is a real label, indicating the first Does the target in each grid cell belong to a category? ;

[0088] Distributional concentration loss: This mainly addresses the class imbalance problem in object detection, improving the model's performance in handling small targets and difficult samples. Its specific mathematical expression is as follows:

[0089] =

[0090] in It is the sample size. It is the number of categories. It is the first The true label of each sample (one-hot encoded, with only one element being 1 and the rest being 0). It is the first Each sample belongs to category Prediction categories, The balancing factor is used to adjust the weights between positive and negative samples. It is a focusing parameter used to control the degree of attention given to difficult samples.

[0091] S6. Input the photovoltaic hot spot defect training set and validation set into the improved network model described above for training and validation, including the following steps:

[0092] (1) Environment configuration: Download the YOLOv11 algorithm source code officially released by Ultralytics from Github, create a virtual environment using Anaconda, and install environment packages such as Python=3.8, Pytorch=1.8.1 and CUDA=11.1 using the Linux operating system;

[0093] (2) Hyperparameter configuration: Batch=16, Image size(Pixels)=640×640, Epochs=600, Workers=8, Optimizer=SGD, Lr0=0.01, Lrf=0.01, Momentum=0.937, Weight_decay=0.0005, other unlisted hyperparameters are the official default values;

[0094] (3) Data input: Input the created infrared photovoltaic hot spot defect dataset into the network model optimized and improved based on YOLOv11n. The specific files include: the dataset structure folder specified by YOLOv11 for infrared photovoltaic hot spot defects, the pre-trained weights of the YOLOv11 network structure model (.pt), the configuration file of the network model optimized and improved based on YOLOv11n (.yaml), and the training and validation dataset path (.yaml).

[0095] (4) Network model training: Run the training file (train.py) provided by Ultralytics in the terminal to train the infrared photovoltaic hot spot defect dataset. The specific subsequent steps are as follows: The network model first reads the width and height information (w, h) of the images (imgs) and corresponding labeled bounding boxes (bboxes) in the training set; then scales the maximum value of (w, h) in each image proportionally to the specified size img_size (since the read bboxes are relative coordinates, no modification is needed); then multiplies by the scaled (w, h) to change the bboxes from relative coordinates to absolute coordinates; then filters the bboxes and retains the bboxes whose (w, h) are both greater than or equal to two pixels; then uses K-means clustering to obtain n anchors; then uses a genetic algorithm to randomly mutate the (w, h) of the anchors (the fitness is calculated using the anchor_fitness method and then evaluated). If the mutation is good, the result will be assigned to the anchors; otherwise, it will be skipped. The default mutation count is 1000. Then, the anchors obtained from the mutation are sorted by area and returned to obtain the bounding box prediction value with the highest confidence. The IoU threshold is set to 0.7. Finally, the loss between the predicted value and the true value is calculated using the loss function, and backpropagation is performed until the preset number of iterations (epochs) is reached.

[0096] (5) Network Model Validation: Run the validation file (val.py) provided by Ultralytics in the terminal to validate the infrared photovoltaic hot spot defect dataset. Specifically, the following steps are performed: Load the optimal weight file best.pt generated after the network model training is completed into the validation file and run it; print the network model's performance metrics on the validation set in the terminal, including precision (the ratio of correctly detected positive samples to all detected positive samples), recall (the ratio of correctly detected positive samples to all actual positive samples), and average precision (mAP, used to evaluate the average precision of multi-class object detection models, specifically including mAP@50 and mAP@50:95). A comparison of experimental results metrics of the network model before and after optimization based on YOLOv11n is shown below. Figure 3 , 4 As shown in Figures 5 and 6, compared to the original YOLOv11n network model, the network model of this invention improves Precision, Recall, mAP@50, and mAP@50:95 by 3.5%, 2.6%, 5.6%, and 4.8%, respectively, with all indicators significantly outperforming YOLOv11n; Figure 7 , 8 As shown in Figure 9, its bounding box regression loss (box_loss), classification loss (class_loss), and distribution concentration loss (DFL_loss) also decrease and converge faster than YOLOv11n, indicating that the network model learns the basic features better.

[0097] S7. Input the photovoltaic hot spot defect test set into the network model to perform bounding box and confidence inference for photovoltaic hot spot defect targets, including the following steps: Run the inference test file (test.py) in the terminal to perform inference testing on the infrared photovoltaic hot spot defect dataset. Specifically, the following steps will be performed: Load the optimal weight file best.pt generated after the network model training is completed into the inference test file, then import the image samples or sample sets to be tested and run the test; output the test result image for each sample, including defect location, defect category, and confidence information. The inference test results based on the YOLOv11n network model are as follows: Figure 10 (a) The confidence score of the inference test based on the optimized and improved network model of YOLOv11n is relatively the best, such as Figure 10 As shown in (b).

[0098] In summary, this invention demonstrates that it can improve the accuracy of photovoltaic hot spot defect detection in photovoltaic power plants.

[0099] Example 2: A photovoltaic panel hot spot defect target detection system based on YOLOv11n optimization and improvement is provided, such as... Figure 11As shown, this embodiment mainly includes:

[0100] Image acquisition unit: Acquires images of photovoltaic hot spot defects;

[0101] Image processing unit: performs image annotation and data augmentation on photovoltaic hot spot defect images;

[0102] Dataset processing unit: Based on image-annotated and data-augmented photovoltaic hot spot defect image samples, a dataset is constructed, which includes a training set, a validation set, and a test set;

[0103] Network model building unit: Using YOLOv11n as the original network model, an ADown network is introduced into the backbone network to replace the traditional convolutional layers in the shallow, intermediate, and deep layers. The original SPPF network in the deep layers is improved to an MDCR network, and the original C2PSA network is improved to an EMA network. EMA networks are introduced into the small-scale and medium-scale feature detection branches of the neck network, and an MDCR network is introduced into the large-scale feature detection branch.

[0104] Network model performance training and validation unit: The training and validation sets of photovoltaic hot spot defects are input into the improved network model to train and validate the model.

[0105] Network model inference target unit: Input the photovoltaic hot spot defect test set into the network model to infer the bounding box and confidence of the photovoltaic hot spot defect target.

[0106] Finally, it should be noted that the above descriptions are merely preferred embodiments of the present invention, mainly highlighting the basic design process and inventive features. However, the scope of protection of the present invention is not limited to the above embodiments. Those skilled in the art should understand that within the technical scope disclosed in the present invention, further modifications can still be made to the technical solutions described in the above embodiments, or equivalent substitutions can be made to some of the technical features involved in the technical solutions. However, all such modifications or substitutions should be covered within the scope of protection of the present invention.

Claims

1. A method for detecting hot spot defects in photovoltaic panels based on YOLOv11n optimization and improvement, characterized in that the method... include: S1. Collect infrared photovoltaic hot spot defect image samples; S2. Next, perform image annotation and data augmentation preprocessing; S3. The preprocessed infrared photovoltaic hot spot defect image samples are further processed into a dataset; S4. Construct a network model based on the optimized and improved YOLOv11n; S5. Calculate the loss function; S6. Input the photovoltaic hot spot defect training set and validation set into the network model based on the above-mentioned improvement for training and validation; S7. Input the photovoltaic hot spot defect test set into the network model to perform bounding box and confidence inference for photovoltaic hot spot defect targets.

2. The photovoltaic panel hot spot defect target detection method based on YOLOv11n optimization and improvement according to claim 1, characterized in that, Step S1 further includes: fusing five publicly available datasets of UAV infrared photovoltaic samples with multiple altitudes and multiple rotation angles into a multi-source dataset.

3. The photovoltaic panel hot spot defect target detection method based on YOLOv11n optimization and improvement according to claim 2, characterized in that, Step S2 includes: annotating the multi-source dataset obtained in step S1 using an annotation tool; and performing data augmentation processing on the annotated multi-source dataset samples, including flipping, rotating, adjusting brightness, and adjusting saturation.

4. The photovoltaic panel hot spot defect target detection method based on YOLOv11n optimization and improvement according to claim 3, characterized in that, Step S3 includes: further dividing the multi-source dataset samples after data augmentation processing in step S2 into training set, validation set and test set according to the proportion to obtain photovoltaic hot spot defect dataset.

5. The photovoltaic panel hot spot defect target detection method based on YOLOv11n optimization and improvement according to claim 1, characterized in that, Step S4 specifically includes: In the backbone network layers, traditional convolutional layers are replaced with adaptive downsampling networks; The spatial pyramid pooling network in the backbone network layer is improved into a multi-expansion channel refinement network, and the multi-expansion channel refinement network is also introduced into the large-scale feature detection branch of the neck network layer. The channel-parallel spatial attention network in the backbone network layer is improved into an efficient multi-scale attention module, and the efficient multi-scale attention module is also introduced into the small-scale and medium-scale feature detection branches of the neck network layer.

6. The photovoltaic panel hot spot defect target detection method based on YOLOv11n optimization and improvement according to claim 5, characterized in that, The steps for introducing an adaptive downsampling network include: The input features are processed in parallel through two paths: one path uses 3×3 compensated convolution for downsampling; the other path integrates max pooling and point convolution to achieve downsampling.

7. The photovoltaic panel hot spot defect target detection method based on YOLOv11n optimization and improvement according to claim 5, characterized in that, The steps for introducing a multi-expansion channel refinement network include: Input feature partitioning unit: Divides the input multi-channel feature map into four independent branch feature maps along the channel dimension, and captures local and global information at multiple scales through depthwise separable convolution; Depth-separable expansion unit: Each branch is further divided along its respective channel dimension, and the single-channel features with the same dimension are then arranged and fused in the same dimensional order; Feature enhancement unit: The multi-scale feature maps of the depth-separable dilatation unit are fused and upsampled by pointwise convolution, and then inference is accelerated by pointwise convolution and batch normalization and activation function.

8. The photovoltaic panel hot spot defect target detection method based on YOLOv11n optimization and improvement according to claim 5, characterized in that, The steps to introduce an efficient multi-scale attention module include: Input feature grouping unit: Divides the input feature map into channels. Individual characteristics, and Sub-features are reshaped to the batch processing dimension, forming A new batch processing dimension; Parallel sub-network unit: contains Branches and Branches; Branch reference of Global average pooling encodes spatial location information along the horizontal and vertical directions. Convolutional modeling of local cross-channel interactions; Branch through Convolution expands the receptive field, capturing multi-scale spatial structure information; Cross-spatial learning unit: The outputs of the two branches are processed separately. Global average pooling, after After activation, two spatial attention maps are generated through matrix dot product, and then aggregated. The d function outputs the final attention weights, which are multiplied element-wise with the original input feature map to obtain a weighted feature map that can be directly embedded into a deep network.

9. The photovoltaic panel hot spot defect target detection method based on YOLOv11n optimization and improvement according to claim 1, characterized in that, The loss function in step S5 includes: Bounding box regression loss: used to optimize the difference between the predicted bounding box and the true bounding box; Classification loss: This part is used to optimize the model's prediction accuracy for the target category, ensuring that the model can correctly identify which category an object in an image belongs to. It is calculated using cross-entropy loss. Distribution concentration loss: mainly addresses the class imbalance problem in object detection, improving the model's performance in handling small targets and difficult samples.

10. A photovoltaic panel hot spot defect target detection system based on YOLOv11n optimization and improvement, capable of performing the target detection method as described in any one of claims 1-9, comprising: Image acquisition unit: Acquires images of photovoltaic hot spot defects; Image processing unit: performs image annotation and data augmentation on photovoltaic hot spot defect images; Dataset Construction Unit: Based on image annotation and data augmentation of photovoltaic hot spot defect image samples, a dataset is constructed, which includes a training set, a validation set, and a test set; Network model building unit: Using YOLOv11n as the original network model, an adaptive downsampling network is introduced into the backbone network to replace the traditional convolutional layers in the shallow, middle and deep layers. The original spatial pyramid pooling network in the deep layer is improved into a multi-dilated channel refinement network, and the channel parallel spatial attention network is improved into an efficient multi-scale attention module. Efficient multi-scale attention modules are introduced into the small-scale and medium-scale feature detection branches of the neck network, respectively, and a multi-dilation channel refinement network is introduced into the large-scale feature detection branch. Network model performance training and validation unit: Input the photovoltaic hot spot defect training set and validation set into the network model building unit for training and validation; Network model inference target unit: Input the photovoltaic hot spot defect test set into the network model construction unit to infer the bounding box and confidence of the photovoltaic hot spot defect target.