A Defect Detection Method for Photovoltaic Cell Modules Based on an Improved YOLOv7 Model

By improving the feature fusion part of the YOLOv7 model, combining the GCSC module and the BF-FPN structure, and adopting the F-cat operation, the problem of insufficient identification of tiny and weak defects in photovoltaic cell module inspection by the YOLOv7 model was solved, and high-precision defect detection was achieved.

CN116363113BActive Publication Date: 2026-03-13HEBEI UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-10
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

The existing YOLOv7 model has difficulty effectively identifying tiny and weak defects in photovoltaic cell module defect detection, resulting in insufficient detection accuracy.

Method used

The improved YOLOv7 model enhances feature fusion capabilities, compensates for information loss, and improves detection performance by introducing a GCSC module into the feature fusion part, combining channel self-attention and spatial self-attention modules, and adopting a BF-FPN structure and F-cat operation.

Benefits of technology

It significantly improves the recall and precision rates of photovoltaic cell module defect detection, with a recall rate of 96.7% and a precision rate of 98.4%, effectively avoiding missed detections and false detections.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116363113B_ABST
    Figure CN116363113B_ABST
Patent Text Reader

Abstract

This invention presents a defect detection method for photovoltaic cell modules based on an improved YOLOv7 model. The method improves the feature fusion part of the YOLOv7 model while keeping the feature extraction and classification / regression parts unchanged. A global channel and spatial context information module is embedded into the feature fusion part of the original YOLOv7 model, and two cross-scale fusion branches are added. When fusing shallow and deep features, each input feature is assigned a learnable weight. The weighted features are then concatenated to obtain the defect detection model, which is then used for defect detection in photovoltaic cell modules. This method captures global context information from both channel and spatial dimensions, establishing connections between channels and pixels to highlight the features of minute and subtle defects. Furthermore, deep information is incorporated during shallow feature fusion, and shallow information is incorporated during deep feature fusion, thus compensating for semantic and detailed information lost during information transmission and improving the localization and classification performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of photovoltaic cell module defect detection technology, specifically a photovoltaic cell module defect detection method based on an improved YOLOv7 model. Background Technology

[0002] Photovoltaic modules are composed of multiple solar cells. During the production of solar cells, defects can occur due to human error, excessive machine pressure, raw material contamination, and other process factors. These defects can significantly reduce the energy conversion efficiency of the cells, thus affecting the stability of the photovoltaic module and even the entire photovoltaic system. Therefore, defect detection of solar cells is essential. Defects in solar cells generally reside inside the cell and cannot be identified by the naked eye or conventional images. Electroluminescence (EL) imaging technology has become an important means of detecting process defects in solar cells.

[0003] Deep learning-based defect detection not only saves significant manpower costs but also offers higher accuracy compared to manual inspection and image processing methods, boasting advantages such as speed, precision, and low cost. The Yolo algorithm, employing regression, is characterized by its speed and simple network architecture. Yolo predicts based on the entire image, unlike other sliding window detection frameworks which rely on local image information for inference, thus achieving higher detection accuracy. The YOLOv7 algorithm, as a next-generation YOLO network, effectively balances detection accuracy and inference performance, making it suitable for defect detection of photovoltaic (PV) modules in industrial settings. However, during the deepening of convolutional neural networks, multiple downsampling leads to excessively small feature sizes, resulting in the loss of much texture information and, consequently, tiny, subtle features with a limited number of pixels. Directly reducing the number of network layers results in insufficient semantic information in deeper layers, directly impacting the network's detection results. PV modules typically exhibit tiny, subtle defects such as broken grids, linear defects, and microcracks. In the PVEL-AD dataset, these tiny defects account for over 40%, representing a significant challenge in PV module defect detection.

[0004] Therefore, this application improves the YOLOv7 model and proposes a defect detection method for photovoltaic cell modules based on the improved YOLOv7 model, which can better identify small and weak defects and improve detection accuracy. Summary of the Invention

[0005] To address the shortcomings of existing technologies, the technical problem this invention aims to solve is to propose a defect detection method for photovoltaic cell modules based on an improved YOLOv7 model.

[0006] The technical solution adopted by the present invention to solve the aforementioned technical problem is as follows:

[0007] A method for defect detection of photovoltaic cell modules based on an improved YOLO v7 model, characterized by the following steps:

[0008] Step 1: Acquire EL images of defective photovoltaic cell modules, perform data augmentation and normalization on the images; annotate the images and add defect type labels;

[0009] Step 2: Construct a defect detection model based on the YOLOv7 model. The YOLOv7 model consists of three parts: feature extraction, feature fusion, and classification / regression. The feature fusion part of the YOLOv7 model is improved by embedding the GCSC module into the original YOLOv7 model's feature fusion part. Two cross-scale fusion branches are added, and shallow and deep features are fused separately using the F-cat operation to obtain the defect detection model. The GCSC module provides global channel and spatial context information. The F-cat operation assigns a learnable weight to each input feature, and then the weighted features are concatenated.

[0010] Step 3: Use the images obtained in Step 1 to train the defect detection model, and then use the trained defect detection model for defect detection of photovoltaic cell modules.

[0011] Furthermore, the feature fusion section includes an SPPCSPC module, an UP module, a cat operation, an ELAN-W module, a GCSC module, an F-cat operation, and an MP-2 module. The output of the last ELAN module in the feature extraction section is sequentially processed by the SPPCSPC module and the UP module, and then subjected to a cat operation with the output of the third ELAN module in the feature extraction section, which is processed by a CBS module, to obtain the first fused feature. This first fused feature is sequentially processed by the ELAN-W module, the first GCSC module, and the UP module, and then combined with the output of the second ELAN module in the feature extraction section, which is processed by a CBS module, and the output of the SPPCSPC module. The features obtained from the two UP modules undergo an F-cat operation to obtain the second fused feature. The second fused feature is then processed through the ELAN-W module and the second GCSC module to obtain the first enhanced feature. The first enhanced feature is then processed through the MP-2 module, and after a cat operation with the output of the first GCSC module, it is processed through the ELAN-W module to obtain the second enhanced feature. The second enhanced feature is then processed through the MP-2 module, and after an F-cat operation with the output of the SPPCSPC module and the output of the second GCSC module, it is processed through the ELAN-W module to obtain the third enhanced feature. These three enhanced features serve as inputs to the classification and regression part.

[0012] Furthermore, the GCSC module includes a serial channel self-attention module and a spatial self-attention module. The input feature F of the channel self-attention module is subjected to global average pooling and global max pooling to obtain features U and I. The transpose of features U and I is multiplied and then passed through the Softmax function to obtain the channel self-attention feature map H. After a reshaping operation, feature F is multiplied by the channel self-attention feature map H to obtain feature E. After a reshaping operation, feature E is added to feature F to obtain the output of the channel self-attention module. The input feature A of the spatial self-attention module is subjected to three 1×1 convolution operations to reduce its dimensionality, resulting in features B, C, and D. Features B and C are reshaped and then subjected to feature mapping operations, and then passed through the Softmax function to obtain the spatial self-attention feature map S. After a reshaping operation, feature D is aggregated with the spatial self-attention feature map S, then reshaped again and added to feature A to obtain the output of the spatial self-attention module.

[0013] Furthermore, the feature extraction part includes a CBS module, an ELAN module, an MP-1 module, and an ELAN module; after the input image passes through four CBS modules, it passes through the ELAN module, MP-1 module, ELAN module, MP-1 module, ELAN module, MP-1 module, and ELAN module in sequence.

[0014] Furthermore, the CBS module includes a convolutional layer, a normalization layer, and an activation layer connected in sequence; the ELAN module includes seven CBS modules. The input of the ELAN module passes through five CBS modules sequentially, and after a cat operation is performed with the output of the first CBS module, the output of the third CBS module, and the features obtained by passing the input of the ELAN module through one CBS module, the input passes through another CBS module to obtain the output of the ELAN module; the MP-1 module is divided into two branches, one branch consists of a max pooling layer and a CBS module, and the other branch consists of two CBS modules. The results of the two branches are cated to obtain the output of the MP-1 module; the input of the SPPC module passes through three serial CBS modules and then through three parallel max pooling layers. The outputs of the three max pooling layers are cat-operated with the output of the third CBS module, then passed through two more CBS modules. The outputs of the input to the SPPCSPC module are cat-operated with the features obtained from a CBS module, then passed through another CBS module to obtain the output of the SPPCSPC module. The UP module consists of one CBS module and one upsampling layer. The ELAN-W module has the same architecture as the ELAN module, except that the number of convolutional layer channels in the last CBS module of the ELAN module remains unchanged, while the number of convolutional layer channels in the last CBS module of the ELAN-W module is halved. The MP-2 module has the same architecture as the MP-1 module, except that the number of convolutional layer channels in the MP-1 module is the same as the number of input feature channels, while the number of convolutional layer channels in the MP-2 module is twice the number of input feature channels.

[0015] Compared with the prior art, the beneficial effects of the present invention are:

[0016] 1. This invention improves the YOLOv7 model by adding a Global Channel and Spatial Context Information (GCSC) module to the feature fusion part of the YOLOv7 model. This module includes a channel self-attention module and a spatial self-attention module. The channel self-attention module captures the relationship between any two channels in a non-local manner, highlighting important channels. The spatial self-attention module adaptively captures the relationship between any two pixels in the entire image from a spatial dimension. The GCSC module combines the channel self-attention module and the spatial self-attention module, adaptively capturing rich global contextual information from both the channel and spatial dimensions. It establishes relationships between channels and pixels from a global perspective, thereby highlighting the feature information of small and weak defects while suppressing redundant background feature interference, effectively improving the detection performance of the original YOLOv7 model for small and weak defects.

[0017] 2. The feature fusion part adopts a BF-FPN structure instead of the original PA-FPN structure. The PA-FPN structure, due to the numerous convolutional layers, upsampling, and downsampling operations during the top-down and bottom-up fusion processes, suffers from significant information loss. Upsampling increases resolution, but semantic information is easily lost during convolutional layers, reducing detection and classification performance. Small, weak target information can easily overlap with background information during upsampling, leading to misclassification and missed detection. Downsampling, on the other hand, reduces resolution, and detail information is easily lost during convolutional layers, reducing detection and localization performance. Furthermore, much small, weak target information is weakened or even lost during downsampling. The BF-FPN structure adds two cross-scale fusion branches to the top-down and bottom-up approaches. During shallow feature fusion, upsampled deep information is added to enhance semantic information; during deep feature fusion, downsampled shallow information is added to enhance detail information. This compensates for the semantic and detail information lost during information transfer, improving both detection and localization performance.

[0018] 3. In feature fusion, the F-cat operation is used instead of the cat operation. The cat operation directly concatenates features of different scales. Since features of different scales contribute differently to detection, directly performing the cat operation leads to ineffective combination of features of different scales and results in redundant feature aggregation. The F-cat operation introduces an effective fusion factor based on the cat operation. The F-cat operation assigns a learnable weight to each input feature. As the network is continuously trained and iterated, the parameters of the weights are updated, thus more simply and effectively fusing features of different resolutions. This allows for the full fusion of deep semantic information and shallow detail information, thereby improving detection performance.

[0019] 4. This invention utilizes deep learning methods for detection, avoiding the inefficiency and uncertainty of manual detection. Furthermore, compared to traditional image processing methods, it eliminates the need for manual feature extraction, offering advantages such as speed, high accuracy, and robustness. Testing on the large-scale photovoltaic module EL dataset PVEL-AD shows a recall rate of 96.7% and a precision rate of 98.4%, effectively preventing false negatives and missed detections. Attached Figure Description

[0020] Figure 1 This is a structural diagram of the defect detection model;

[0021] Figure 2 Here is a structural diagram of the CBS module;

[0022] Figure 3 This is a structural diagram of the ELAN module;

[0023] Figure 4 This is a structural diagram of the MP-1 module;

[0024] Figure 5 Here is a structural diagram of the SPPCSPC module;

[0025] Figure 6 Here is a structural diagram of the UP module;

[0026] Figure 7 This is a structural diagram of the ELAN-W module;

[0027] Figure 8 Here is a structural diagram of the GCSA module;

[0028] Figure 9 Here is a structural diagram of the PAM module;

[0029] Figure 10 Here is a structural diagram of the REP module;

[0030] Figure 11 Here is a structural diagram of the CBM module;

[0031] Figure 12 This is a comparison chart of the detection results of the present invention; Detailed Implementation

[0032] Specific embodiments are given below with reference to the accompanying drawings. These specific embodiments are only used to illustrate the technical solutions of the present invention in detail, and are not intended to limit the scope of protection of this application.

[0033] This invention relates to a defect detection method for photovoltaic cell modules based on an improved YOLO v7 model, comprising the following steps:

[0034] Step 1: Building the dataset

[0035] 1) First, EL images of defective photovoltaic cell modules are acquired using an industrial camera with near-infrared detection; then, data enhancement is performed using methods such as rotation, flipping, and cropping; finally, all images are normalized to a size of 1024×1024 pixels.

[0036] 2) Manually label the defect areas of all images using LabelImg and add defect type labels; divide all images into training and validation sets at a ratio of approximately 1:5, with 3665 images in the training set and 17280 images in the test set; the defects include four categories: broken grids, black spots, linear defects, and hidden cracks. The training set contains 2957 broken grids, 1028 black spots, 981 linear defects, and 1260 hidden cracks, while the test set contains 22636 broken grids, 3877 black spots, 1585 linear defects, and 2897 hidden cracks.

[0037] Step 2: Improve the YOLOv7 model to obtain a defect detection model;

[0038] See Figure 1 The YOLOv7 model consists of three parts: feature extraction, feature fusion, and classification regression. This invention mainly improves the feature fusion part, while the structure of the feature extraction and classification regression parts remains consistent with the original YOLOv7 model.

[0039] The feature extraction part (backbone) includes the CBS module, ELAN module, MP-1 module, and ELAN module; after the input image passes through the four CBS modules, it passes through the ELAN module, MP-1 module, ELAN module, MP-1 module, ELAN module, MP-1 module, and ELAN module in sequence.

[0040] The feature fusion section (neck) adopts a BF-FPN structure, adding two cross-scale fusion branches to the existing top-down and bottom-up branches. During shallow feature fusion, deep information (upsampled by four times) is added to enhance semantic information, while shallow information (downsampled by four times) is added to enhance detail information. This compensates for information loss during information transmission and improves the localization and classification performance. An effective fusion factor is added during the fusion of shallow and deep features (F-cat operation) to more effectively fuse deep semantic information and shallow detail information, enhancing the model's expressive power and improving its ability to detect small and weak targets. The feature fusion section includes the SPPCSPC module, UP module, cat operation, ELAN-W module, GCSC module, F-cat operation, and MP-2 module. The output of the last ELAN module in the feature extraction section is sequentially processed by the SPPCSPC module and the UP module, and then subjected to a cat operation with the output of the third ELAN module obtained through a CBS module to obtain the first fused feature. This first fused feature is then sequentially processed by the ELAN-W module, the first GCSC module, and the UP module, and then combined with the output of the second ELAN module obtained through a CBS module and the output of the SPPCSPC module obtained through two UP modules. An F-cat operation is performed to obtain the second fused feature. This second fused feature is then processed through the ELAN-W module and the second GCSC module to obtain the first enhanced feature. This first enhanced feature is then processed through the MP-2 module, and after a cat operation with the output of the first GCSC module, it is processed through the ELAN-W module to obtain the second enhanced feature. This second enhanced feature is then processed through the MP-2 module, and after an F-cat operation with the output of the SPPCSPC module and the output of the second GCSC module, it is processed through the two MP-2 modules to obtain the third enhanced feature. The feature fusion part mainly obtains three enhanced features, which serve as inputs to the classification and regression part.

[0041] The classification and regression part consists of three branches, which predict three enhanced features respectively and output prediction results at three different scales; each branch includes a REP module and a CBM module connected in sequence.

[0042] The CBS module consists of a convolutional layer (Conv), a normalization layer (BN), and an activation layer (SiLU) connected in sequence. See [link to CBS module]. Figure 2The ELAN module consists of seven CBS modules. The input to the ELAN module passes through five CBS modules sequentially. After a cat operation is performed with the output of the first CBS module, the output of the third CBS module, and the features obtained from the input of the ELAN module after passing through one CBS module, the input passes through another CBS module to obtain the output of the ELAN module. See [link to documentation]. Figure 3 The ELAN module's role is to increase depth significantly to improve accuracy and make the network easier to optimize. The MP-1 module consists of two branches: one branch comprises a max-pooling layer and a CBS module, and the other branch consists of two CBS modules. The results from both branches are processed using a cat operation to achieve downsampling. See [link to documentation]. Figure 4 The MP-2 module has the same architecture as the MP-1 module, the difference being that the MP-1 module has the same number of convolutional layer channels as the input feature channels, while the MP-2 module has twice the number of convolutional layer channels as the input feature channels. The SPPCSPC module increases the receptive field, allowing the algorithm to adapt to images of different resolutions. It obtains different receptive fields through max pooling. The input to the SPPCSPC module first passes through three sequential CBS modules, then through three parallel max pooling layers with strides of 5, 9, and 13, and then performs a cat operation with the output of the third CBS module. After passing through two more CBS modules, it performs a cat operation with the input of the SPPCSPC module and the features obtained from passing through one CBS module. Finally, it passes through one CBS module to obtain the output of the SPPCSPC module. See [link to relevant documentation]. Figure 5 The UP module is used for upsampling, and it consists of a CBS module and an upsampling layer (Upsample). See [link / reference]. Figure 6 The ELAN-W module has the same architecture as the ELAN module, the difference being that the number of convolutional layer channels in the last CBS module of the ELAN module remains the same, while the number of convolutional layer channels in the last CBS module of the ELAN-W module is halved. See [link to ELAN module documentation]. Figure 7 The `cat` operation is a concatenation operation, which directly concatenates features. The F-cat operation introduces an effective fusion factor on the basis of the `cat` operation. It assigns a learnable weight to each input feature and then concatenates the weighted features. As the network is continuously trained and iterated, the weights are updated, thus more simply and effectively fusing features of different resolutions. This allows for the full fusion of deep semantic information and shallow detail information such as texture and position information, thereby improving detection performance.

[0043] The GCSC module is a global channel and spatial context information module, comprising a serially connected channel self-attention module (GCSA) and spatial self-attention module (PAM). The GCSC module adaptively captures rich global context information from both channel and spatial dimensions, establishing connections between channels and pixels, thereby suppressing background noise and enhancing feature representation. In convolutional neural networks, average pooling better suppresses background noise, while max pooling extracts texture features. The GCSA module combines average and max pooling, allowing the network to suppress background noise while preserving texture information of minor defects during the deepening process. The input to the GCSA module is feature F, which undergoes global average pooling (GAP) and global max pooling (GMP) to obtain features U and I. The transpose of U and I is multiplied and then passed through a softmax function to obtain the channel self-attention feature map H. Feature F is reshaped and multiplied by the channel self-attention feature map H to obtain feature E. Feature E is reshaped and then added to feature F to obtain the output of the channel self-attention module. See [link to relevant documentation]. Figure 8 The GCSA module employs nonlocal operations to capture the interrelationship between any two channels globally, highlighting important channels and thus enhancing feature representation. The spatial self-attention module takes feature A as input, which undergoes three 1×1 convolution operations for dimensionality reduction, yielding features B, C, and D. Features B and C are then reshaped, followed by a feature mapping operation (Affinity), and then passed through a Softmax function to obtain the spatial self-attention feature map S. Feature D, after being reshaped, is aggregated with the spatial self-attention feature map S, then reshaped again and added to feature A to obtain the output of the spatial self-attention module. See [link to relevant documentation]. Figure 9 The spatial self-attention module can capture contextual information from the entire image, establish the positional relationship between each pixel and other pixels, and pay more attention to the spatial location of defects.

[0044] The first branch of the REP module contains a 1×1 convolutional layer and a BN layer. The second branch contains a 3×3 convolutional layer and a BN layer. If the number of input and output channels and their dimensions are the same, add another branch consisting of a BN layer. The results of all branches are summed to obtain the output of the REP module. See [link to REP module]. Figure 10 The CBM module consists of convolutional layers, batch normalization (BN) layers, and sigmoid layers. (See [link / reference]). Figure 11 .

[0045] Step 3: Train the defect detection model and use the trained defect detection model for defect detection of photovoltaic cell modules;

[0046] 1) Parameter settings

[0047] The system used was Ubuntu 22.04 with an Intel Core i7 series CPU (3.7GHz) and an RTX 3090 graphics card. The deep learning framework used was PyTorch 1.8.0. Stochastic Gradient Descent (SGD) was used to update the network parameters, with a weight decay value of 0.0001 and a momentum value of 0.9. To prevent the model from overshooting the optimum, the gradient was clipped to the interval [-2, +2]. The initial learning rate was 0.01 with exponential decay, where the decay exponent was 0.9. The batch size was set to 24, and the iteration period was 300.

[0048] 2) Training of the defect detection model

[0049] The defect detection model is trained using the training set obtained in the first step, and the loss is calculated using a loss function. The loss function consists of three parts: coordinate loss, target confidence loss, and classification loss. The coordinate loss uses CIoU loss, while the target confidence loss and classification loss both use BCEWithLogitsLoss (binary cross-entropy loss with log). The model parameters are updated through backpropagation until the loss converges, thus completing the training of the defect detection model.

[0050] 3) Testing of the defect detection model

[0051] The validation set obtained in the first step is input into the trained defect detection model to obtain the prediction results of all validation samples; all prediction results are statistically analyzed; and different models are compared. The comparison results are detailed in Table 1.

[0052] Table 1 Comparison of test results

[0053]

[0054] As shown in the table, the recall and accuracy of the method of the present invention are higher than those of the YOLOv5 series models and the original YOLOv7 model. Higher recall and detection rates mean lower false negatives and false positives. The AP50 and mAP50 metrics are also higher than those of the other two types of models. Higher AP50 and mAP50 mean that the network can locate the defect more accurately, which verifies the effectiveness of the method of the present invention.

[0055] Any aspects not covered in this invention are applicable to existing technologies.

Claims

1. A photovoltaic cell module defect detection method based on an improved YOLO v7 model, characterized in that, The method comprises the following steps: Step 1: Collecting the EL image of the defective photovoltaic cell module, performing data enhancement and normalization processing on the image, labeling the image and adding a defect type label; Step 2: Constructing a defect detection model based on a YOLOv7 model; the YOLOv7 model comprises three parts of feature extraction, feature fusion and classification regression, the feature fusion part of the YOLOv7 model is improved, a GCSC module is embedded in the feature fusion part of the original YOLOv7 model, and two cross-scale fusion branches are added, the F-cat operation is used to fuse the shallow and deep features respectively, and a defect detection model is obtained; the GCSC module is a global channel and spatial context information; the F-cat operation assigns a learnable weight to each input feature, and then splices the features with the assigned weights; The feature fusion part comprises an SPPCSPC module, an UP module, a cat operation, an ELAN-W module, a GCSC module, an F-cat operation and an MP-2 module; the output of the last ELAN module of the feature extraction part is sequentially subjected to the SPPCSPC module and the UP module, and then subjected to the cat operation with the feature obtained by the CBS module from the output of the third ELAN module of the feature extraction part, to obtain a first fusion feature; the first fusion feature is sequentially subjected to the ELAN-W module, the first GCSC module and the UP module, and then subjected to the F-cat operation with the feature obtained by the CBS module from the output of the second ELAN module of the feature extraction part and the feature obtained by the two UP modules from the output of the SPPCSPC module, to obtain a second fusion feature; the second fusion feature is subjected to the ELAN-W module and the second GCSC module, to obtain a first enhanced feature; the first enhanced feature is subjected to the MP-2 module, subjected to the cat operation with the output of the first GCSC module, and then subjected to the ELAN-W module, to obtain a second enhanced feature; the second enhanced feature is subjected to the MP-2 module, subjected to the F-cat operation with the output of the SPPCSPC module and the output of the second GCSC module obtained by the two MP-2 modules, and then subjected to the ELAN-W module, to obtain a third enhanced feature; the three enhanced features are used as the input of the classification regression part; Step 3: Training the defect detection model by using the image obtained in step 1, and using the trained defect detection model for photovoltaic cell module defect detection.

2. The method for detecting defects in photovoltaic cell modules based on the improved YOLO v7 model according to claim 1, characterized in that, The GCSC module comprises a serial channel self-attention module and a spatial self-attention module; input features F of the channel self-attention module are subjected to global average pooling and global maximum pooling to obtain features U and I, the transposed features U and I are multiplied to obtain a channel self-attention feature map H through a Softmax function; the features F are multiplied with the channel self-attention feature map H after a reshaping operation to obtain features E; the features E are added with the features F after a reshaping operation to obtain the output of the channel self-attention module; the input features A of the spatial self-attention module are subjected to three 1x1 convolution operations to obtain features B, C and D; the features B and C are subjected to a reshaping operation and then a feature mapping operation, and then a spatial self-attention feature map S is obtained through a Softmax function; The features D are aggregated with the spatial self-attention feature map S after a reshaping operation, and then added with the features A after a reshaping operation to obtain the output of the spatial self-attention module.

3. The method for detecting defects in photovoltaic cell modules based on the improved YOLO v7 model according to claim 1, characterized in that, The feature extraction part comprises a CBS module, an ELAN module, an MP-1 module and an ELAN module; the input image is sequentially subjected to four CBS modules, and then sequentially subjected to an ELAN module, an MP-1 module, an ELAN module, an MP-1 module, an ELAN module, an MP-1 module and an ELAN module.

4. The method for detecting defects in photovoltaic cell modules based on the improved YOLO v7 model according to claim 3, characterized in that, The CBS module comprises a convolution layer, a normalization layer and an activation layer connected in sequence; the ELAN module comprises seven CBS modules, the input of the ELAN module is sequentially subjected to five CBS modules, and then subjected to a cat operation with the output of the first CBS module, the output of the third CBS module and the features obtained by the input of the ELAN module through a CBS module to obtain the output of the ELAN module through a CBS module; the MP-1 module comprises two branches, one branch is composed of a maximum pooling layer and a CBS module, and the other branch is composed of two CBS modules, and the results of the two branches are subjected to a cat operation to obtain the output of the MP-1 module; The input of the SPPCSPC module is subjected to three serial CBS modules, and then subjected to three parallel maximum pooling layers, the outputs of the three maximum pooling layers are subjected to a cat operation with the output of the third CBS module, and then subjected to two CBS modules, and then subjected to a cat operation with the features obtained by the input of the SPPCSPC module through a CBS module to obtain the output of the SPPCSPC module through a CBS module; the UP module comprises a CBS module and an up-sampling layer; the ELAN-W module has the same architecture as the ELAN module, the number of channels of the convolution layer of the last CBS module of the ELAN module is unchanged, and the number of channels of the convolution layer of the last CBS module of the ELAN-W module is halved; the MP-2 module has the same architecture as the MP-1 module, the number of channels of the convolution layer of the MP-1 module is the same as the number of channels of the input features, and the number of channels of the convolution layer of the MP-2 module is twice the number of channels of the input features.

Citation Information

Patent Citations

  • Infrared image weak and small target detection method based on improved YOLO v3

    CN112101434A

  • Solar cell panel defect detection method and system, storage medium and terminal

    CN114862814A