A photovoltaic module el image defect detection method

By using the YOLO11n-ADL defect detection model, combined with the DWLite lightweight convolution module, the DSA-PAN dual-scale attention feature fusion module, and the DLC dynamic loss calibration strategy, the problem of detecting small-scale, low-contrast defects in photovoltaic module EL images was solved, achieving high detection accuracy and lightweight deployment.

CN123051891APending Publication Date: 2026-11-06HOHAI UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611256151.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-19
Publication Date
2026-11-06

AI Technical Summary

Technical Problem

Existing technologies are insufficient for effectively detecting small-scale, low-contrast, and difficult-to-detect defects in photovoltaic module EL images. Furthermore, high-precision models require a large number of parameters and computational resources, making it difficult to balance detection accuracy with lightweight deployment.

Method used

The YOLO11n-ADL defect detection model is adopted, combined with the DWLite lightweight convolution module, the DSA-PAN dual-scale attention feature fusion module and the DLC dynamic loss calibration strategy, to perform feature extraction, feature fusion and training optimization, thereby enhancing the feature representation and localization capabilities of small-scale, low-contrast defects.

Benefits of technology

It reduces the number of model parameters and computational cost, while improving detection accuracy and lightweight deployment performance, and enhancing the ability to respond to small-scale, low-contrast, and difficult defects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123051891A_ABST
    Figure CN123051891A_ABST
Patent Text Reader

Abstract

This invention discloses a method for defect detection in photovoltaic module EL images, comprising: inputting a photovoltaic module EL image into a trained YOLO11n-ADL defect detection model to obtain defect detection results for the photovoltaic module EL image; wherein, the YOLO11n-ADL defect detection model is built based on YOLO11n and trained using a DLC dynamic loss calibration strategy, including a feature extraction network, a feature fusion network, and a detection head connected in sequence; the feature extraction network includes a DWLite lightweight convolutional module, and the feature fusion network includes a PAN feature fusion path and a DSA-PAN dual-scale attention feature fusion module in sequence. This invention addresses the problems of large defect scale differences, weak response to small-scale and low-contrast defects, strong interference from grid lines and background textures in photovoltaic module EL images, uneven learning difficulty among different samples, and large number of detection model parameters and computational load.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of photovoltaic module defect detection technology, and particularly relates to a method for detecting defects in photovoltaic module EL images. Background Technology

[0002] Electroluminescence (EL) imaging of photovoltaic (PV) modules can reflect carrier recombination states, electrical transport characteristics, and structural integrity by utilizing differences in luminescence intensity across different regions of the solar cell. When a solar cell suffers structural damage, localized failure, or material anomalies, the corresponding areas in the EL image of the PV module typically appear as dark lines, dark spots, localized blackening, or overall blackening. Therefore, locating internal defects in PV modules based on EL images is an important technique in PV module quality inspection and operational status analysis.

[0003] The defect scale differences in photovoltaic module EL images are significant: microcracks often appear as thin, elongated dark lines or irregular linear shadows; black spots often appear as dot-like, clustered, or localized patchy dark areas; broken and black spots have relatively large target areas but significant morphological variations; small-scale, elongated, and low-contrast defects are easily weakened during multiple convolutions and downsampling processes, and lightweight networks are particularly prone to losing local texture and edge information useful for these weak features; the grid lines, main grids, solder ribbons, and background grayscale fluctuations on the photovoltaic module surface may also appear as linear or striped changes in photovoltaic module EL images, and may interact with cracks. The features of defects such as broken edges are mixed. Conventional multi-scale feature fusion mainly adopts upsampling, downsampling, stitching and convolution integration, which lacks adaptive filtering for effective channels and effective spatial regions. It is easy to pass background texture and irrelevant gray-level fluctuations to the detection head, resulting in poor response to small-scale and low-contrast defects. In addition, there is an imbalance in the learning difficulty between different defect categories and between different samples of the same category. Samples with obvious features or large areas are more likely to be learned by the model first, while difficult samples with small, low contrast or blurred boundaries are prone to missed detection and localization errors.

[0004] Currently, conventional training methods employ relatively fixed sample loss contributions, making it difficult to dynamically coordinate classification loss, bounding box regression loss, and distribution focus loss based on the current learning state. Meanwhile, high-precision models typically have a large number of parameters and computational costs, while excessive lightweighting may weaken the representational ability of weak features. Therefore, a coordinated technical solution is still needed to balance detection accuracy, model lightweighting, and the ability to learn from difficult samples. Summary of the Invention

[0005] The purpose of this invention is to overcome the shortcomings of the prior art and provide a method for detecting defects in photovoltaic module EL images. This method can reduce the number of model parameters and computational load, enhance the feature representation and localization capabilities of small-scale, low-contrast and difficult defects, and achieve a synergistic improvement in detection accuracy and lightweight deployment performance.

[0006] To solve the above-mentioned technical problems, the present invention is implemented using the following solution: This invention provides a method for detecting defects in the EL image of a photovoltaic module, comprising: The photovoltaic module EL image is input into the trained YOLO11n-ADL defect detection model to obtain the photovoltaic module EL image defect detection results. The YOLO11n-ADL defect detection model is built upon YOLO11n. It comprises a feature extraction network, a feature fusion network, and a detection head, connected sequentially. The feature extraction network includes a DWLite lightweight convolutional module for layer-by-layer feature extraction and downsampling of the input photovoltaic module EL image, outputting multi-scale defect features at different spatial scales to the feature fusion network. The feature fusion network includes a PAN feature fusion path and a DSA-PAN dual-scale attention feature fusion module, used for multi-scale feature fusion, channel recalibration, and spatial recalibration of the multi-scale defect features, outputting enhanced defect fusion features to the detection head. The detection head performs defect classification and defect detection box position regression based on the enhanced defect fusion features, outputting the defect category, detection confidence, and defect detection box position. The YOLO11n-ADL defect detection model employs a DLC dynamic loss calibration strategy during training.

[0007] Furthermore, the training of the YOLO11n-ADL defect detection model includes: Step A: Label the defect categories and bounding boxes in the defect regions of the photovoltaic module EL image to construct a defect detection sample set; Step B: Input the photovoltaic module EL images from the defect detection sample set into the feature extraction network of the YOLO11n-ADL defect detection model, which is equipped with the DWLite lightweight convolutional module. Through the feature extraction network, perform layer-by-layer feature extraction and downsampling to obtain multi-scale defect features at different spatial scales. Step C: Input the multi-scale defect features into the PAN feature fusion path of the feature fusion network in the YOLO11n-ADL defect detection model to perform multi-scale feature fusion, and then use the DSA-PAN dual-scale attention feature fusion module to perform channel recalibration and spatial recalibration on the fused features in sequence to obtain defect-enhanced fused features; Step D: Input the defect enhancement fusion features into the detection head of the YOLO11n-ADL defect detection model to perform defect classification and defect detection box position regression; Step E: Repeat steps B to D to train the YOLO11n-ADL defect detection model. During the model training process, the DLC dynamic loss calibration strategy is adopted: adjust the sample weights corresponding to the classification loss, bounding box regression loss, and distribution focus loss according to the learning difficulty of the training samples, obtain the total loss using the adjusted classification loss, bounding box regression loss, and distribution focus loss, and backpropagate and update the model parameters of the YOLO11n-ADL defect detection model based on the total loss to obtain the trained YOLO11n-ADL defect detection model.

[0008] Furthermore, defect categories and bounding boxes are labeled for defect regions in the EL images of photovoltaic modules to construct a defect detection sample set, including: Defect areas in the photovoltaic module EL image are marked with bounding boxes, and defect category labels such as microcracks, breakage, black spots or black patches are assigned to each defect area according to the defect type. Annotation data is generated based on the defect category label and bounding box position corresponding to each defect area, and the annotation data is converted into YOLO format; The labeled photovoltaic module EL images are divided into training set, validation set and test set according to a set ratio, and the photovoltaic module EL images in the training set, validation set and test set are adjusted to a set pixel value; Perform at least one of the following data augmentation processes on the photovoltaic module EL images in the training set: random rotation, horizontal flipping, vertical flipping, and brightness adjustment, to obtain a defect detection sample set.

[0009] Furthermore, layer-by-layer feature extraction and downsampling are performed on the input photovoltaic module EL image to output multi-scale defect features at different spatial scales, including: The DWLite lightweight convolution module takes an input feature map X as input and applies a stride of [value missing] to each input channel of the input feature map X. of Channel-wise convolution is performed, and spatial features are extracted and downsampled for each input channel to obtain channel-wise convolutional features. F dw Channel-wise convolution satisfies:

[0010] Channel-wise convolution features F dw Input a 1×1 pointwise convolution to perform cross-channel information fusion and obtain a lightweight feature map. F outAs input to subsequent layers of the feature extraction network, pointwise convolution satisfies:

[0011] The DWLite lightweight convolution module replaces the standard convolutions in layers 3, 5, and 7 of the YOLO11n backbone network, respectively. The lightweight feature maps output from layers 3, 5, and 7 are processed by subsequent layers of the YOLO11n backbone network to form multi-scale defect features with different spatial scales. Among them, the input feature map X The dimension is C in ×H×W , C in , H and W These are the number of input channels, height, and width, respectively. k The side length of the channel-wise convolution kernel. DWConv(·) Indicates the number of channel groups g = C in Channel-wise convolution, PWConv(·) This represents a 1×1 pointwise convolution.

[0012] Furthermore, multi-scale feature fusion is performed on the multi-scale defect features, including: By using the top-down path of the PAN feature fusion path, the deeper features are upsampled respectively, and the upsampled deep features are fused with the shallow features of the corresponding scale to obtain the first fused feature at each scale. The first fused feature at the shallow scale is downsampled step by step through the bottom-up path of the PAN feature fusion path. The downsampled first fused feature is then fused with the first fused feature output at the corresponding deep scale by the top-down path to obtain the second fused feature F of each scale, which is output to the corresponding DSA dual-scale attention module.

[0013] Furthermore, channel recalibration is performed on multi-scale defect features, including: For the second fusion feature F Global average pooling is performed to obtain channel description vectors. These vectors are then input into a one-dimensional convolution to establish local dependencies between adjacent channels, and channel weights are obtained after sigmoid activation. M c Channel weight M c satisfy:

[0014] The second fusion feature F With channel weight Mc Element-wise multiplication yields the channel recalibration features. F c Channel recalibration features serve as input for spatial recalibration. F c satisfy:

[0015] in, GAP(·) Indicates global average pooling. Conv1D(·) Represents one-dimensional convolution. σ(·) This represents the Sigmoid activation function. This indicates element-wise multiplication.

[0016] Furthermore, the multi-scale defect features are spatially recalibrated to output defect enhancement fusion features, including: Recalibrate the features of each channel along the channel dimension. F c Perform average pooling and max pooling to obtain the average pooling space description graph and the max pooling space description graph; The two spatial description maps are concatenated and then sequentially fed into a 2D convolution and a Sigmoid activation function to obtain the spatial weights. M s Spatial weight M s satisfy:

[0017] Channel recalibration features F c Spatial weights M s Element-wise multiplication yields defect-enhanced fusion features. F out Defect-enhanced fusion features F out satisfy:

[0018] in, AvgPool(·) and MaxPool(·) These represent average pooling and max pooling along the channel dimension, respectively, and [·] represents feature concatenation. Conv2D(·) This represents a two-dimensional convolution.

[0019] Furthermore, the sample weights corresponding to the classification loss, bounding box regression loss, and distribution focus loss are adjusted according to the learning difficulty of the training samples. The total loss is obtained using the adjusted classification loss, bounding box regression loss, and distribution focus loss, including: Determine the first in the current batch i Learning difficulty metric of each prediction unit participating in the loss branch calculationd i And use exponential moving average to update the first t The historical average difficulty of the next iteration Historical average difficulty satisfy:

[0020] Based on learning difficulty metric d i Compared to historical average difficulty The ratio calculation is the unpruned dynamic weight. Unpruned dynamic weights satisfy:

[0021] According to the preset weight lower limit ω min and preset weight limit ω max For undressed dynamic weights Perform cropping to obtain the cropped dynamic weights. ω i Dynamic weights after cropping ω i satisfy:

[0022] Dynamic weights after clipping within the current batch ω i Perform mean normalization to obtain normalized dynamic weights. Normalized dynamic weights satisfy:

[0023] The normalized dynamic weights obtained for the classification loss branch, the bounding box regression loss branch, and the distribution focus loss are respectively... Applying these losses to the corresponding prediction units, we reconstruct the dynamic classification loss, dynamic bounding box regression loss, and dynamic distribution focus loss, and combine them to obtain the total loss.

[0024] in, i and j For the index of the prediction unit participating in the calculation of the current loss branch, β ∈(0,1) is the smoothing coefficient. M This represents the number of prediction units in the current batch that participate in the calculation of the current loss branch. d̄ (t-1) represents the historical average difficulty of the previous iteration. γ >0 represents the difficulty adjustment factor. ε>0 is a preset constant to prevent the denominator from being zero, 0< ω min ≤ ω max , λ box , λ cls and λ dfl These are the combined weights of the classification loss branch, the bounding box regression loss branch, and the distribution focus loss, respectively. , and These are the classification loss, bounding box regression loss, and distribution focus loss after DLC reconstruction, respectively.

[0025] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the above-described photovoltaic module EL image defect detection method.

[0026] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described photovoltaic module EL image defect detection method. Beneficial effects

[0027] The present invention utilizes the DWLite lightweight convolution module, the DSA-PAN dual-scale attention feature fusion module, and the DLC dynamic loss calibration strategy to perform feature extraction, feature fusion, and training optimization, respectively. These components work in tandem and collaboratively to enable the YOLO11n-ADL defect detection model to balance detection accuracy, number of model parameters, computational cost, and lightweight deployment performance.

[0028] The DWLite lightweight convolution module of this invention decouples standard convolution into channel-wise spatial convolution and 1×1 point-wise channel fusion, and selectively sets them in layers 3, 5, and 7 of the YOLO11n backbone network. This can reduce redundant convolution calculations, reduce the number of model parameters and computational cost, while retaining features related to local grayscale changes, fine-grained textures, and edges.

[0029] The DSA-PAN dual-scale attention feature fusion module of this invention takes the multi-scale defect features output by the feature extraction network and performs channel recalibration and spatial recalibration sequentially after PAN multi-scale fusion. This can enhance the response of small-scale, low-contrast and irregular defects, and suppress grid lines, component background textures and irrelevant grayscale fluctuations.

[0030] The DLC dynamic loss calibration strategy of this invention only applies to the model training stage. By adjusting the learning difficulty of the prediction unit, the historical average difficulty, weight pruning, and mean normalization, it dynamically adjusts the loss contribution of each prediction unit in the classification loss, bounding box regression loss, and distribution focus loss, thereby improving the classification and localization learning effect of difficult defects. Attached Figure Description

[0031] Figure 1 This is a framework diagram of a photovoltaic module EL image defect detection method provided in Embodiment 1 of the present invention; Figure 2 This is a schematic diagram of the overall structure of the YOLO11n-ADL defect detection model in a photovoltaic module EL image defect detection method provided in Embodiment 1 of the present invention; Figure 3 This is a schematic diagram of the structure of the DWLite lightweight convolution module in a photovoltaic module EL image defect detection method provided in Embodiment 1 of the present invention; Figure 4 This is a schematic diagram of the DSA dual-scale attention module structure in a photovoltaic module EL image defect detection method provided in Embodiment 1 of the present invention; Figure 5 This is a flowchart of the model training process using the DLC dynamic loss calibration strategy in a photovoltaic module EL image defect detection method provided in Embodiment 1 of the present invention. Figure 6 This is a schematic diagram of the detection result output of the EL image of the photovoltaic module to be detected in a photovoltaic module EL image defect detection method provided in Embodiment 1 of the present invention. Detailed Implementation

[0032] The present invention will be further described below with reference to the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and should not be used to limit the scope of protection of the present invention. Example 1

[0033] like Figure 1 As shown, this embodiment provides a method for detecting defects in photovoltaic module EL images, involving three stages: data preparation (step S1), model construction and training (steps S2 to S5), and model detection output (step S6). Specifically, it includes: Step S1: Obtain EL images of photovoltaic modules containing defects, and label the defect areas in the EL images of photovoltaic modules with defect categories and bounding boxes to construct a defect detection sample set; the defect categories include hidden cracks, breakage, black spots and black patches.

[0034] The input for this embodiment is an EL image of a photovoltaic module acquired on-site. The image can be obtained from an EL imaging device at the photovoltaic power plant site. Before proceeding to this embodiment, existing methods can be used to extract the module region and perform geometric correction to reduce invalid background; however, the above preprocessing does not constitute the main innovation of this invention. Images containing obvious defects are manually selected, and the LabelImg annotation tool is used to annotate the defect regions with bounding boxes and categories, uniformly categorized as hidden cracks, fragmentation, black patches, and black spots. The annotation results are exported in YOLO format readable by the target detection model.

[0035] A self-made defect detection sample set contains 1880 photovoltaic module EL images, divided into training, validation, and test sets at ratios of 60%, 20%, and 20%, respectively. All images were uniformly adjusted to 640×640 pixels before training. To reduce the risk of overfitting, random rotation, horizontal flipping, vertical flipping, and brightness adjustment were applied to the training set. Since a single image can contain multiple defect targets, the number of defect instances is greater than the number of images. In the training, validation, and test sets, the number of hidden crack instances are 1890, 630, and 628, respectively; the number of broken instances are 573, 192, and 190, respectively; the number of black sheet instances are 681, 228, and 228, respectively; and the number of black spot instances are 642, 214, and 213, respectively. This yields the defect detection sample set used for subsequent model training and evaluation.

[0036] Step S2: Construct a YOLO11n-ADL defect detection model based on YOLO11n and configure a DLC dynamic loss calibration strategy for training the model. The model includes a feature extraction network, a feature fusion network and a detection head connected in sequence. The feature extraction network is equipped with a DWLite lightweight convolutional module, and the feature fusion network is equipped with a PAN feature fusion path and a DSA-PAN dual-scale attention feature fusion module. Figure 2 The overall structure of the YOLO11n-ADL defect detection model is shown.

[0037] The model, along the feature processing direction, sequentially includes a feature extraction network, a feature fusion network, and a detection head. The input image size is 640×640×3. The feature extraction network performs layer-by-layer feature extraction and downsampling through the DWLite lightweight convolutional module, outputting multi-scale defect features at different spatial scales. The feature fusion network completes multi-scale fusion, channel recalibration, and spatial recalibration through the PAN feature fusion path and the DSA-PAN dual-scale attention feature fusion module, outputting defect-enhanced fusion features. The detection head performs defect classification and defect detection box position regression based on the defect-enhanced fusion features.

[0038] Let the input feature map be X Its dimensions are C in ×H × W .right X Each input channel is applied independently k × k Channel-wise convolution, followed by 1×1 pointwise convolution to achieve cross-channel information fusion, the calculation process is as follows:

[0039]

[0040] In the formula, X Input feature map; C in Input the number of channels; H and W These are the height and width, respectively. DWConv(·) express g = C in The channel-wise convolution, where g is the number of channel groups in the convolution; F dw Channel-wise convolutional features; PWConv(·) This represents a 1×1 pointwise convolution; F out This is a lightweight feature map.

[0041] The number of parameters for DWLite's lightweight convolution module and standard convolution are as follows:

[0042]

[0043] In the formula, k The side length of the channel-wise convolution kernel; C out Number of output channels; P dw The number of parameters for the DWLite lightweight convolution module; P std The parameter count is the same as that of a standard convolution. The DWLite lightweight convolution module is set as a replacement for the standard convolution module in layers 3, 5, and 7 of the YOLO11n backbone network, respectively, to reduce redundant convolution computations and preserve local grayscale variations, fine-grained textures, and edge features.

[0044] Step S3: Input the photovoltaic module EL images from the defect detection sample set into a feature extraction network equipped with the DWLite lightweight convolutional module, and perform layer-by-layer feature extraction and downsampling through the feature extraction network to obtain multi-scale defect features. Figure 3 The structure of the DWLite lightweight convolution module is shown.

[0045] Step S4: Input the multi-scale defect features into the PAN feature fusion path for multi-scale feature fusion, and then use the DSA-PAN dual-scale attention feature fusion module to perform channel recalibration and spatial recalibration on the fused features in sequence to obtain defect-enhanced fused features.

[0046] Let the second fused feature output by the feature fusion node be... F Its dimensions are C × H × W .right F Perform global average pooling, followed by one-dimensional convolution and sigmoid activation to obtain channel weights, and then combine the channel weights with... F Element-by-element multiplication:

[0047]

[0048] In the formula, GAP(·) represents global average pooling; Conv1D(·) represents one-dimensional convolution; σ(·) This represents the Sigmoid activation function; M c Indicates channel weight; This represents element-wise multiplication; F c This indicates the channel recalibration feature.

[0049] Channel recalibration features F c As input for spatial recalibration, average pooling and max pooling are performed along the channel dimension respectively. The resulting two spatial description maps are concatenated and then sequentially input into a two-dimensional convolution and a sigmoid activation function to obtain spatial weights.

[0050]

[0051] In the formula, AvgPool(·) and MaxPool(·) These represent average pooling and max pooling along the channel dimension, respectively; [·] represents feature concatenation; Conv2D(·) Represents two-dimensional convolution; M s Indicates spatial weights; F out This represents the defect enhancement fusion feature. In one optional implementation, the one-dimensional convolution kernel size is 3, and the two-dimensional convolution kernel size is 7. Through sequential recalibration first for channels and then for space, the DSA-PAN dual-scale attention feature fusion module can highlight channels and spatial regions related to defects and suppress grid lines and background textures. Figure 4The structure of the DSA dual-scale attention module is shown.

[0052] Step S5: Input the defect enhancement fusion features into the detection head to perform defect classification and defect detection box position regression; during model training, the DLC dynamic loss calibration strategy is adopted. According to the learning difficulty of the prediction units participating in the loss calculation, the weights of the prediction units corresponding to the classification loss, bounding box regression loss and distribution focus loss are adjusted respectively. The total loss is obtained by using the three reconstructed losses, and the model parameters of the YOLO11n-ADL defect detection model are updated according to the total loss to obtain the trained defect detection model.

[0053] This example was trained in a Windows 11 environment with an Intel Core i7-12700H processor, an NVIDIA GeForce RTX 5060Ti graphics card with 8GB of VRAM, CUDA 11.8 acceleration environment, Python version 3.11.14, and PyTorch version 2.7.1. The input image was 640×640×3 pixels, the maximum training epochs were 2000, the batch size was 8, the initial learning rate was 0.01, the lrf parameter was 0.01, the momentum coefficient was 0.937, the optimizer was SGD, the number of data loading threads was 4, the number of epochs with mosaic enhancement disabled was 10, and the number of early stopping epochs was 100. Training was terminated when the validation set mAP@0.5:0.95 did not improve for 100 consecutive epochs.

[0054] The DLC dynamic loss calibration strategy is only executed during the training phase and does not participate in the inference process of the image to be detected. Before the introduction of DLC, the total detection loss consists of classification loss, bounding box regression loss, and focal distribution loss.

[0055] In the formula, L box , L cls and L dfl These are the bounding box regression loss, classification loss, and distribution focus loss, respectively. λ box , λ cls and λ dfl These are the combined weights of the three loss branches.

[0056] For any loss branch, let the th branch in the current batch be... i The learning difficulty metric for each prediction unit participating in the loss branch calculation is: d i The historical average difficulty is updated using an exponential moving average:

[0057] In the formula, and These are the historical average difficulties of the current iteration and the previous iteration, respectively. β ∈(0,1) is the preset smoothing coefficient; M This represents the number of prediction units in the current batch that participate in the calculation of the corresponding loss branch. d i For the first i The learning difficulty metric for each prediction unit.

[0058] According to the i Learning difficulty metric for each prediction unit d i Compared to historical average difficulty The ratio is used to calculate the unpruned dynamic weights, and then upper and lower bound pruning and mean normalization are performed sequentially:

[0059]

[0060]

[0061] In the formula, These are the unpruned dynamic weights; γ Preset difficulty adjustment coefficient; ε A preset constant is used to prevent the denominator from being zero; ω i The dynamic weights after clipping; ω min and ω max These are the preset lower and upper limits of the dynamic weights, respectively. These are the dynamic weights after mean normalization; j This refers to the index of the prediction unit within the current batch; β , γ , ε , ω min and ω max These are all preset parameters set before training.

[0062] The above dynamic calibration is performed on the classification loss branch, the bounding box regression loss branch, and the distribution focus loss branch respectively, and the three losses are reconstructed using the normalized dynamic weights of each branch:

[0063]

[0064]

[0065] In the formula, , and These are the classification loss, bounding box regression loss, and distribution focus loss after DLC reconstruction, respectively. S The sum of the target scores for the positive samples; N This represents the total number of prediction units; , and The third of the three branches i Normalized dynamic weights of each prediction unit; L BCE (·) represents the binary cross-entropy loss; p i For the first i Classification prediction for each prediction unit; t i For the corresponding target label; IoU i For the first i The intersection-union ratio of each predicted bounding box to its corresponding ground truth bounding box; ω i base The base weights assigned to the target score; L DFL,i For the first i The distribution focus loss of each prediction unit.

[0066] The three reconstructed loss branches are combined into the total loss:

[0067] In the formula, The total loss is obtained using the DLC dynamic loss calibration strategy. According to... Backpropagation is performed to update the model parameters of the YOLO11n-ADL defect detection model. When the learning difficulty of the current prediction unit is higher than the historical average difficulty, its dynamic weight tends to increase; when the learning difficulty of the current prediction unit is lower than the historical average difficulty, its dynamic weight is suppressed. Weight pruning is used to limit the range of dynamic weights, and mean normalization is used to maintain the stability of the overall loss scale of each loss branch. After the model training is completed, the trained defect detection model is obtained. Figure 5 The flow chart of the DLC dynamic loss calibration method is shown.

[0068] Step S6: Obtain the EL image of the photovoltaic module to be detected, input the EL image of the photovoltaic module to be detected into the trained defect detection model, output the defect category, detection confidence and defect detection box position, and obtain the defect detection result of the photovoltaic module EL image. Figure 6 The detection output results of the EL image of the photovoltaic module to be tested are shown.

[0069] The DWLite lightweight convolutional module in the feature extraction network sequentially performs channel-wise spatial feature extraction and cross-channel information fusion to obtain multi-scale defect features layer by layer; the PAN feature fusion path performs multi-scale fusion of the multi-scale defect features from top to bottom and from bottom to top; the DSA-PAN dual-scale attention feature fusion module then sequentially performs channel recalibration and spatial recalibration to obtain defect enhancement fusion features.

[0070] The defect enhancement fusion feature is input into the detection head, and for each detected target, the defect category, detection confidence, and defect detection box position are output; the defect category is hidden crack, breakage, black sheet, or black spot, thereby obtaining the defect detection result of the photovoltaic module EL image. Example 2

[0071] This embodiment discloses an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the steps of the photovoltaic module EL image defect detection method described in Embodiment 1. Example 3

[0072] This embodiment provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the photovoltaic module EL image defect detection method described in Embodiment 1.

[0073] Those skilled in the art will understand that embodiments of this application can be provided as methods, apparatus, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0074] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0075] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0076] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0077] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.

Claims

1. A method for detecting defects in photovoltaic module EL images, characterized in that, include: Input the EL image of the photovoltaic module into the trained YOLO11n-ADL defect detection model to obtain the defect detection results of the EL image of the photovoltaic module; Among them, the YOLO11n-ADL defect detection model is built on YOLO11n. The YOLO11n-ADL defect detection model includes a feature extraction network, a feature fusion network and a detection head connected in sequence. The feature extraction network includes a DWLite lightweight convolution module, which is used to extract and downsample the input photovoltaic module EL image layer by layer, and output multi-scale defect features of different spatial scales to the feature fusion network. The feature fusion network is configured with a PAN feature fusion path and a DSA-PAN dual-scale attention feature fusion module, which are used to perform multi-scale feature fusion, channel recalibration and spatial recalibration on multi-scale defect features, and output defect enhancement fusion features to the detection head. The detection head is used to classify defects and regress the position of defect detection boxes based on defect enhancement fusion features, and outputs the defect category, detection confidence, and defect detection box position. The YOLO11n-ADL defect detection model employs a DLC dynamic loss calibration strategy during training.

2. The photovoltaic module EL image defect detection method according to claim 1, characterized in that, Training the YOLO11n-ADL defect detection model includes: Step A: Label the defect categories and bounding boxes in the defect regions of the photovoltaic module EL image to construct a defect detection sample set; Step B: Input the photovoltaic module EL images from the defect detection sample set into the feature extraction network of the YOLO11n-ADL defect detection model, which is equipped with the DWLite lightweight convolutional module. Through the feature extraction network, perform layer-by-layer feature extraction and downsampling to obtain multi-scale defect features at different spatial scales. Step C: Input the multi-scale defect features into the PAN feature fusion path of the feature fusion network in the YOLO11n-ADL defect detection model to perform multi-scale feature fusion, and then use the DSA-PAN dual-scale attention feature fusion module to perform channel recalibration and spatial recalibration on the fused features in sequence to obtain defect-enhanced fused features; Step D: Input the defect enhancement fusion features into the detection head of the YOLO11n-ADL defect detection model to perform defect classification and defect detection box position regression; Step E: Repeat steps B to D to train the YOLO11n-ADL defect detection model. During the model training process, the DLC dynamic loss calibration strategy is adopted: adjust the sample weights corresponding to the classification loss, bounding box regression loss, and distribution focus loss according to the learning difficulty of the training samples, obtain the total loss using the adjusted classification loss, bounding box regression loss, and distribution focus loss, and backpropagate and update the model parameters of the YOLO11n-ADL defect detection model based on the total loss to obtain the trained YOLO11n-ADL defect detection model.

3. The photovoltaic module EL image defect detection method according to claim 2, characterized in that, Defect categories and bounding boxes are labeled for defect regions in the EL images of photovoltaic modules, and a defect detection sample set is constructed, including: Defect areas in the photovoltaic module EL image are marked with bounding boxes, and defect category labels such as microcracks, breakage, black spots or black patches are assigned to each defect area according to the defect type. Annotation data is generated based on the defect category label and bounding box position corresponding to each defect area, and the annotation data is converted into YOLO format; The labeled photovoltaic module EL images are divided into training set, validation set and test set according to a set ratio, and the photovoltaic module EL images in the training set, validation set and test set are adjusted to a set pixel value; Perform at least one of the following data augmentation processes on the photovoltaic module EL images in the training set: random rotation, horizontal flipping, vertical flipping, and brightness adjustment, to obtain a defect detection sample set.

4. The photovoltaic module EL image defect detection method according to claim 1, characterized in that, The input photovoltaic module EL image is subjected to layer-by-layer feature extraction and downsampling to output multi-scale defect features at different spatial scales, including: The DWLite lightweight convolution module takes an input feature map X as input and applies a stride of [value missing] to each input channel of the input feature map X. of Channel-wise convolution is performed, and spatial features are extracted and downsampled for each input channel to obtain channel-wise convolutional features. F dw Channel-wise convolution satisfies: ; Channel-wise convolution features F dw Input a 1×1 pointwise convolution to perform cross-channel information fusion and obtain a lightweight feature map. F out As input to subsequent layers of the feature extraction network, pointwise convolution satisfies: ; The DWLite lightweight convolution module replaces the standard convolutions in layers 3, 5, and 7 of the YOLO11n backbone network, respectively. The lightweight feature maps output from layers 3, 5, and 7 are processed by subsequent layers of the YOLO11n backbone network to form multi-scale defect features with different spatial scales. Among them, the input feature map X The dimension is C in ×H×W , C in , H and W These are the number of input channels, height, and width, respectively. k The side length of the channel-wise convolution kernel. DWConv(·) Indicates the number of channel groups g = C in Channel-wise convolution, PWConv(·) This represents a 1×1 pointwise convolution.

5. The photovoltaic module EL image defect detection method according to claim 1, characterized in that, Multi-scale feature fusion of multi-scale defect features includes: By using the top-down path of the PAN feature fusion path, the deeper features are upsampled respectively, and the upsampled deep features are fused with the shallow features of the corresponding scale to obtain the first fused feature at each scale. The first fused feature at the shallow scale is downsampled step by step through the bottom-up path of the PAN feature fusion path. The downsampled first fused feature is then fused with the first fused feature output at the corresponding deep scale by the top-down path to obtain the second fused feature F of each scale, which is output to the corresponding DSA dual-scale attention module.

6. The photovoltaic module EL image defect detection method according to claim 5, characterized in that, Channel recalibration of multi-scale defect features includes: For the second fusion feature F Global average pooling is performed to obtain channel description vectors. These vectors are then input into a one-dimensional convolution to establish local dependencies between adjacent channels, and channel weights are obtained after sigmoid activation. M c Channel weight M c satisfy: ; The second fusion feature F With channel weight M c Element-wise multiplication yields the channel recalibration features. F c Channel recalibration features serve as input for spatial recalibration. F c satisfy: ; in, GAP(·) Indicates global average pooling. Conv1D(·) Represents one-dimensional convolution. σ(·) This represents the Sigmoid activation function. This indicates element-wise multiplication.

7. The photovoltaic module EL image defect detection method according to claim 6, characterized in that, Spatial recalibration of multi-scale defect features is performed to output defect enhancement fusion features, including: Recalibrate the features of each channel along the channel dimension. F c Perform average pooling and max pooling to obtain the average pooling space description graph and the max pooling space description graph; The two spatial description maps are concatenated and then sequentially fed into a 2D convolution and a Sigmoid activation function to obtain the spatial weights. M s Spatial weight M s satisfy: ; Channel recalibration features F c Spatial weights M s Element-wise multiplication yields defect-enhanced fusion features. F out Defect-enhanced fusion features F out satisfy: ; in, AvgPool(·) and MaxPool(·) These represent average pooling and max pooling along the channel dimension, respectively, and [·] represents feature concatenation. Conv2D(·) This represents a two-dimensional convolution.

8. The photovoltaic module EL image defect detection method according to claim 2, characterized in that, The sample weights corresponding to the classification loss, bounding box regression loss, and distribution focus loss are adjusted according to the learning difficulty of the training samples. The total loss is obtained using the adjusted classification loss, bounding box regression loss, and distribution focus loss, including: Determine the first in the current batch i Learning difficulty metric of each prediction unit participating in the loss branch calculation d i And use exponential moving average to update the first t The historical average difficulty of the next iteration Historical average difficulty satisfy: ; Based on learning difficulty metric d i Compared to historical average difficulty The ratio calculation is the unpruned dynamic weight. Unpruned dynamic weights satisfy: ; According to the preset weight lower limit ω min and preset weight limit ω max For undressed dynamic weights Perform cropping to obtain the cropped dynamic weights. ω i Dynamic weights after clipping ω i satisfy: ; Dynamic weights after clipping within the current batch ω i Perform mean normalization to obtain normalized dynamic weights. Normalized dynamic weights satisfy: ; The normalized dynamic weights obtained for the classification loss branch, the bounding box regression loss branch, and the distribution focus loss are respectively... Applying these losses to the corresponding prediction units, we reconstruct the dynamic classification loss, dynamic bounding box regression loss, and dynamic distribution focus loss, and combine them to obtain the total loss. ; in, i and j For the index of the prediction unit participating in the calculation of the current loss branch, β ∈(0,1) is the smoothing coefficient. M This represents the number of prediction units in the current batch that participate in the calculation of the current loss branch. d̄ (t-1) represents the historical average difficulty of the previous iteration. γ >0 represents the difficulty adjustment factor. ε >0 is a preset constant to prevent the denominator from being zero, 0< ω min ≤ ω max , λ box , λ cls and λ dfl These are the combined weights of the classification loss branch, the bounding box regression loss branch, and the distribution focus loss, respectively. , and These are the classification loss, bounding box regression loss, and distribution focus loss after DLC reconstruction, respectively.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the photovoltaic module EL image defect detection method according to any one of claims 1 to 8.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the steps of the photovoltaic module EL image defect detection method according to any one of claims 1 to 8.