Photovoltaic cell module defect detection method and system

By introducing the EMA attention mechanism into the YOLOv8-nano model, the feature extraction and fusion capabilities are enhanced, the problem of low accuracy in defect detection of photovoltaic cell components is solved, and more efficient defect identification and classification are achieved.

CN117764959BActive Publication Date: 2024-10-15JIANGNAN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311807106.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-26
Publication Date
2024-10-15
Estimated Expiration
2043-12-26

AI Technical Summary

Technical Problem

Existing photovoltaic cell module defect detection accuracy is not high and cannot effectively classify and identify multiple defects.

Method used

Using the detection model based on YOLOv8-nano, the YOLOv8n-EMA model is constructed by introducing the EMA attention mechanism in the Backbone module, and combined with multi-scale feature extraction and fusion, to detect photovoltaic cell component defects.

Benefits of technology

The accuracy of photovoltaic module defect detection is improved, and the network's learning ability of defect features is enhanced through the EMA attention mechanism. The experiment shows good verification results on the PVEL-AD data set.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117764959B_ABST
    Figure CN117764959B_ABST
Patent Text Reader

Abstract

The present invention relates to a photovoltaic cell assembly defect detection method and system, wherein the method comprises: step S1: acquiring image data about a photovoltaic cell assembly; step S2: constructing a detection model, the detection model is constructed based on YOLOv8‑nano, and includes a Backbone module, a Neck module and a Head module connected in sequence; an EMA attention mechanism is added to the Backbone module to obtain a YOLOv8n‑EMA model; step S4: training the YOLOv8n‑EMA model by minimizing a loss function, so that the YOLOv8n‑EMA model converges; step S5: using the converged YOLOv8n‑EMA model to perform defect detection on the image data of the photovoltaic cell assembly. The YOLOv8n‑EMA model of the present invention improves the ability to learn defect features, thereby improving the accuracy of defect detection of photovoltaic cell assemblies.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of photovoltaic cell assembly defect detection, and in particular to a photovoltaic cell assembly defect detection method and system. Background Art

[0002] Photovoltaic cell modules are the core components of photovoltaic power generation. The quality of photovoltaic cell modules will directly affect their lifespan and the efficiency of photoelectric conversion. Although the manufacturing process of crystalline silicon solar cells and modules is relatively mature, products will also have defects of varying degrees during the production process. Since there are many types of defects in photovoltaic cell modules and the scale of each defect is inconsistent, there is currently no unified classification standard to classify defects. The main focus is on detecting five types of defects that seriously affect the conversion efficiency of photovoltaic cell modules and are more common in production: cracks (Carck), star cracks (Star_crack), broken grids (Finger), black core (Black_core), and thick lines (Thick_line).

[0003] At present, many scholars are committed to defect detection of photovoltaic cell modules. For example, in terms of traditional image processing technology, Zhang Hanjin et al. proposed a combination of bimodal method and maximum inter-class method, and used grayscale histogram to detect the difference between solar cell background and defect parts. Chen et al. designed a structural similarity measure (SSM) function and used non-maximum suppression method to extract candidate crack defects. Tsai et al. proposed a self-reference scheme for solar cell defect detection based on Fourier image reconstruction technology. By evaluating the grayscale difference between the original image and the reconstructed image. This method can effectively detect cracks. In terms of image processing combined with machine learning, Liu Lei et al. used integral projection and grayscale centroid algorithm to obtain the characteristics of solar cell defects, and proposed a support vector machine algorithm with radial basis as kernel function to identify and classify defects. Yu Zijia proposed a solar cell crack defect classification detection algorithm that uses particle swarm algorithm to optimize support vector machine. Demant et al. proposed a classification and recognition method based on local descriptors and support vector machines, which realized the effective detection of photoluminescence (PL) images and infrared (IR) images of small-particle silicon wafers. In the field of deep learning target detection, Fu et al. proposed a novel end-to-end target detection network ELCN-YOLOv7, which improved the accuracy of defect detection in original EL images and reduced model parameters. Luo Wei et al. proposed a solar cell defect detection algorithm YOLOv5s-CG based on the YOLOv5s algorithm. On the basis of improving the network structure, the GIOU loss function was used to evaluate the detection effect.

[0004] The above method does not have high accuracy in detecting defects in photovoltaic cell modules. Summary of the invention

[0005] Therefore, the technical problem to be solved by the present invention is to overcome the problem of low accuracy in defect detection of photovoltaic cell modules in the prior art.

[0006] In order to solve the above technical problems, the present invention provides a photovoltaic cell assembly defect detection method, comprising:

[0007] Step S1: Acquire image data about a photovoltaic cell assembly;

[0008] Step S2: constructing a detection model, wherein the detection model is constructed based on YOLOv8-nano, and includes a Backbone module, a Neck module, and a Head module connected in sequence, wherein the Backbone module is used to extract multi-scale features, the Neck module is used to fuse the multi-scale features extracted by the Backbone module, and the Head module is used to perform regression prediction on the multi-scale features fused by the Neck module;

[0009] Adding the EMA attention mechanism to the Backbone module to obtain the YOLOv8n-EMA model;

[0010] Step S3: training the YOLOv8n-EMA model by minimizing the loss function to make the YOLOv8n-EMA model converge;

[0011] Step S4: Use the converged YOLOv8n-EMA model to perform defect detection on the image data of the photovoltaic cell module.

[0012] In one embodiment of the present invention, data enhancement processing is performed on the image data in step S1, and the data enhancement processing methods include Mosaic, Mixup and MedianBlur.

[0013] In one embodiment of the present invention, the Backbone module in step S2 includes a first CBS module, a second CBS module, a first C2f module, a third CBS module, a second C2f module, a fourth CBS module, a first C2f-EMA module, a fifth CBS module, a second C2f-EMA module and an SPPF module connected in sequence.

[0014] In one embodiment of the present invention, the Neck module in step S2 includes a first UpSample layer, a first Concat layer, a third C2f module, a second UpSample layer, a second Concat layer, a fourth C2f module, a sixth CBS module, a third Concat layer, a fifth C2f module, a seventh CBS module, a fourth Concat layer and a sixth C2f module connected in sequence, wherein the output of the SPPF module is connected to the input of the fourth Concat layer, the output of the first C2f-EMA module is connected to the input of the first Concat layer, the output of the third C2f module is connected to the input of the third Concat layer, and the output of the second C2f module is connected to the input of the second Concat layer.

[0015] In one embodiment of the present invention, the Head module in step S2 includes a first Detect module, a second Detect module and a third Detect module, wherein the first Detect module is connected to the output of the fourth C2f module, the second Detect module is connected to the output of the fifth C2f module, and the third Detect module is connected to the output of the fourth Concat layer.

[0016] In one embodiment of the present invention, the first C2f-EMA module and the second C2f-EMA module each include an eighth CBS module, a Split layer, a first BottleNeck module, a fifth Concat layer, an EMA module and a ninth CBS module connected in sequence, wherein the output of the first BottleNeck module is further connected to the second BottleNeck module, the output of the second BottleNeck module is further connected to the third BottleNeck module, and the outputs of the second BottleNeck module and the third BottleNeck module are both connected to the input of the fifth Concat layer;

[0017] The structures of the first to sixth C2f modules are the same as those of the first C2f-EMA module and the second C2f-EMA module, and there is no EMA module.

[0018] In one embodiment of the present invention, the EMA module includes a Groups module, and the Groups module is sequentially connected to the first convolutional layer, the X average pooling layer, and the Y average pooling layer;

[0019] The first convolutional layer is sequentially connected to a first average pooling layer, a Softmax layer, and a first Matmul layer;

[0020] The X average pooling layer is sequentially connected to the joint module, the second convolutional layer, the first Sigmoid layer, and the first Re-weight layer;

[0021] The Y average pooling layer is sequentially connected to the joint module, the third convolution layer, the second Sigmoid layer, the first Re-weight layer, the GN layer, the second average pooling layer, the first Softmax layer, the second Matmul layer, the addition layer, the second Softmax layer, and the second Re-weight layer;

[0022] Among them, the output of the first convolution layer is connected to the input of the second Matmul layer, the output of the first Matmul layer is connected to the input of the addition layer, the output of the GN layer is connected to the input of the first Matmul layer, and the joint module includes the sixth Concat layer and the fourth convolution layer.

[0023] In one embodiment of the present invention, the first Detect module to the third Detect module include a first branch and a second branch connected in parallel, the first branch includes a tenth CBS module, a fifth convolutional layer and a Bbox Loss layer connected in sequence, and the second branch includes an eleventh CBS module, a sixth convolutional layer and a Cls Loss layer connected in sequence;

[0024] The SPPF module includes a twelfth CBS module, a first maximum pooling layer, a second maximum pooling layer and a third maximum pooling layer connected in sequence, and the outputs of the first maximum pooling layer, the second maximum pooling layer and the third maximum pooling layer are all connected to the seventh Concat layer and the thirteenth CBS module.

[0025] In one embodiment of the present invention, the first to thirteenth CBS modules each include a seventh convolutional layer, a BN layer, and a SiLu layer connected in sequence.

[0026] In order to solve the above technical problems, the present invention provides a photovoltaic cell assembly defect detection system, which is characterized by comprising:

[0027] Acquisition module: used to acquire image data about photovoltaic cell components;

[0028] Construction module: used to construct a detection model, which is built based on YOLOv8-nano and includes a Backbone module, a Neck module and a Head module connected in sequence, wherein the Backbone module is used to extract multi-scale features, the Neck module is used to fuse the multi-scale features extracted by the Backbone module, and the Head module is used to perform regression prediction on the multi-scale features fused by the Neck module;

[0029] Adding the EMA attention mechanism to the Backbone module to obtain the YOLOv8n-EMA model;

[0030] Convergence module: used to train the YOLOv8n-EMA model by minimizing the loss function to make the YOLOv8n-EMA model converge;

[0031] Detection module: used to perform defect detection on the image data of photovoltaic cell modules using the converged YOLOv8n-EMA model.

[0032] The above technical solution of the present invention has the following advantages compared with the prior art:

[0033] The present invention introduces the EMA attention mechanism into the Backbone module of YOLOv8-nano to improve the feature extraction capability of the original network and enhance the network's ability to learn defect features, thereby further improving the accuracy of defect detection in photovoltaic cell modules. It is verified and compared on the PVEL-AD public dataset, and the experimental effect is good. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] In order to make the contents of the present invention more clearly understood, the present invention is further described in detail below based on specific embodiments of the present invention in conjunction with the accompanying drawings.

[0035] Figure 1 is a flow chart of the method of the present invention;

[0036] Figure 2 Schematic diagram of the YOLOv8n-EMA model structure in an embodiment of the present invention;

[0037] Figure 3 Schematic diagram of the structure of the C2f-EMA module in an embodiment of the present invention;

[0038] Figure 4 is a schematic diagram of the structure of a C2f module in an embodiment of the present invention;

[0039] Figure 5 It is a schematic diagram of the structure of the SPPF module in an embodiment of the present invention;

[0040] Figure 6 : is a schematic diagram of the structure of the EMA attention mechanism in an embodiment of the present invention;

[0041] Figure 7 It is a schematic diagram of the structure of the Detect module in an embodiment of the present invention;

[0042] Figure 8 It is a schematic diagram of the CBS module structure in an embodiment of the present invention. DETAILED DESCRIPTION

[0043] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments so that those skilled in the art can better understand the present invention and implement it, but the embodiments are not intended to limit the present invention.

[0044] Embodiment 1

[0045] Reference Figure 1 As shown, the present invention relates to a photovoltaic cell assembly defect detection method, comprising:

[0046] Step S1: Acquire image data about a photovoltaic cell assembly;

[0047] Step S2: construct a detection model, which is based on YOLOv8-nano (Yolov8 has 4 versions according to the model size. This embodiment adopts the smallest version YOLO8-nano, abbreviated as yolov8n, and improves on it), including a Backbone module, a Neck module and a Head module connected in sequence, wherein the Backbone module mainly extracts multi-scale features by convolution, the Neck module fuses the multi-scale features extracted by the Backbone module to improve the detection accuracy, and the Head module performs final regression prediction on the fused multi-scale features;

[0048] Adding the EMA attention mechanism to the Backbone module to obtain the YOLOv8n-EMA model;

[0049] Step S3: converge the YOLOv8n-EMA model by minimizing the loss function;

[0050] Step S4: Use the converged YOLOv8n-EMA model to perform defect detection on the image data of the photovoltaic cell module.

[0051] See also Figure 2 The Backbone module in step S2 includes a first CBS module, a second CBS module, a first C2f module, a third CBS module, a second C2f module, a fourth CBS module, a first C2f-EMA module, a fifth CBS module, a second C2f-EMA module and an SPPF module connected in sequence. Figure 8The CBS module of this embodiment is composed of convolution, normalization layer (BN layer) and SiLU activation function (SiLU layer). Convolution is used to extract features. The BN layer is normalized and then nonlinear fitting is performed through the SiLU activation function to extract features. The C2f module processes the feature layer in blocks, extracts features from one part, and splices the other part after keeping it unchanged, enriching the gradient flow during back propagation, while enhancing the network's ability to extract features and further increasing its depth. The SPPF module is a spatial pooling pyramid module, which is used to further extract multi-scale features and improve detection accuracy.

[0052] The Neck module in step S2 includes a first UpSample layer, a first Concat layer, a third C2f module, a second UpSample layer, a second Concat layer, a fourth C2f module, a sixth CBS module, a third Concat layer, a fifth C2f module, a seventh CBS module, a fourth Concat layer and a sixth C2f module connected in sequence, wherein the output of the SPPF module is connected to the input of the fourth Concat layer, the output of the first C2f-EMA module is connected to the input of the first Concat layer, the output of the third C2f module is connected to the input of the third Concat layer, and the output of the second C2f module is connected to the input of the second Concat layer.

[0053] The Head module in step S2 includes a first Detect module, a second Detect module and a third Detect module, wherein the first Detect module is connected to the output of the fourth C2f module, the second Detect module is connected to the output of the fifth C2f module, and the third Detect module is connected to the output of the fourth Concat layer. The Detect module performs the final regression prediction on the fused features through convolution.

[0054] See also Figure 3 , the first C2f-EMA module and the second C2f-EMA module both include an eighth CBS module, a Split layer, a first BottleNeck module, a fifth Concat layer, an EMA module and a ninth CBS module connected in sequence, wherein the output of the first BottleNeck module is also connected to the second BottleNeck module, the output of the second BottleNeck module is also connected to the third BottleNeck module, and the outputs of the second BottleNeck module and the third BottleNeck module are both connected to the input of the fifth Concat layer. The structures of the first C2f module to the sixth C2f module in this embodiment are the same as those of the first C2f-EMA module and the second C2f-EMA module, and there is no EMA module (see Figure 4). It is worth mentioning that the C2f module, as a feature extraction module, contains complex background information in addition to the target to be detected in the original image. This excessive background information may act as interference and guide the model to converge in the wrong direction. In order to increase the weight of the target information in the extracted feature map and reduce the attention to the background features, this embodiment automatically assigns weights by using the EMA attention mechanism, and ultimately suppresses excessive background information. In general attention mechanisms, channel dimensionality reduction methods are used to avoid large amounts of computation, while the EMA attention mechanism uses grouping and cross-space learning methods. On the one hand, it can reduce the amount of computation, and on the other hand, it makes the attention map have short-range and long-range dependencies, and has pixel-level attention to high-level abstract features.

[0055] See also Figure 6 , the EMA module includes a Groups module, which is sequentially connected to the first convolutional layer (conv(3x) layer), the X average pooling layer (X Avg Pool layer), and the Y average pooling layer (Y Avg Pool layer); the conv(3x) convolutional layer is sequentially connected to the first average pooling layer (Avg Pool layer), the Softmax layer, and the first Matmul layer, where conv(3x) represents a 3x3 convolutional layer, the X Avg Pool layer performs average pooling operations along the X direction of the feature map, and the Y The AvgPool layer represents the average pooling operation along the Y direction of the feature map; the X average pooling layer is connected to the joint module, the second convolution layer, the first Sigmoid layer, and the first Re-weight layer in sequence; the Y average pooling layer is connected to the joint module, the third convolution layer, the second Sigmoid layer, the first Re-weight layer, the GN layer, the second average pooling layer, the first Softmax layer, the second Matmul layer, the addition layer, the second Softmax layer, and the second Re-weight layer in sequence; wherein the output of the first convolution layer is connected to the input of the second Matmul layer, the output of the first Matmul layer is connected to the input of the addition layer, and the output of the GN layer is connected to the input of the first Matmul layer, and the joint module includes the sixth Concat layer and the fourth convolution layer. The Groups module represents the grouping of the original feature map in the channel direction, which can avoid the information loss caused by the channel dimension reduction adopted by the traditional attention on the one hand, and reduce the amount of calculation on the other hand. The GN layer is Group Normalization, which enables the normalization operation to be effectively performed even when the batch size is very small. The Matmul layer is a simple tensor multiplication operation.

[0056] See also Figure 7, the first Detect module to the third Detect module of this embodiment include a first branch and a second branch connected in parallel, the first branch includes a tenth CBS module, a fifth convolutional layer and a Bbox Loss layer (used to calculate the regression loss) connected in sequence, and the second branch includes an eleventh CBS module, a sixth convolutional layer and a Cls Loss layer (used to calculate the classification loss) connected in sequence.

[0057] See also Figure 5 The SPPF module of this embodiment includes a twelfth CBS module, a first maximum pooling layer, a second maximum pooling layer and a third maximum pooling layer connected in sequence, and the outputs of the first maximum pooling layer, the second maximum pooling layer and the third maximum pooling layer are all connected to the seventh Concat layer and the thirteenth CBS module.

[0058] The following is a detailed introduction to this embodiment:

[0059] First, the data set is established: the data set used in this embodiment is the PVEL-AD data set jointly released by Hebei University of Technology and Beijing University of Aeronautics and Astronautics. This data set is used to benchmark the abnormal defect detection method of photovoltaic cells. It contains 36,543 near-infrared images with various internal defects and heterogeneous backgrounds, including 1 type of non-abnormal images and 12 different categories of abnormal defect images, such as cracks (linear and star-shaped), broken grids, black cores, misalignment, thick lines, scratches, fragments, broken corners and material defects.

[0060] The present invention preprocesses the data set: first, the present invention only detects five common defects in the data set, namely linear cracks, star-shaped cracks, broken grids, black cores, and thick lines. Therefore, 3700 images containing these defects are screened out from the data set and divided into a training set and a test set at a ratio of 8:2, with 2960 images in the training set and 740 images in the test set.

[0061] Next is the model building stage. The present invention builds a YOLOv8n-EMA model for defect detection of photovoltaic battery arrays. The network structure of the YOLOv8n-EMA model can be divided into three parts: Backbone module, Neck module and Head module. Before the Backbone module, the input image data is preprocessed, including online data enhancement such as Mosaic, Mixup, MedianBlur, and the image is scaled to a size of 640x640. In the Backbone module, it first passes through a CBS module, which includes a 3x3 convolution with a step size of 2 (corresponding to Figure 8The seventh convolutional layer in the network) is used to downsample the image. Subsequently, the input image is feature extracted by double downsampling convolution combined with the C2f module. The number of channels in each stage will be doubled, and the size of the feature map will be reduced to half of the original size. The C2f module combines the ideas of CSPNet and E_ELAN networks to divide the feature map into two parts according to the channel dimension. One part is directly concat, and the other part is further extracted through n BottleNeck modules. The result of each BottleNeck is concat, and finally the dimension is reduced through 1x1 dimensionality reduction convolution to reduce the number of parameters and reconstruct the channel dimension. Since there is redundancy of feature information in the channel dimension during the feature extraction stage, by dividing it into two feature maps for different processing, the redundant features can be reduced while retaining a part of the low semantic information of the original feature map. The present invention adds an EMA attention mechanism after the Concat of the C2f module, suppresses background information by paying attention to the spliced ​​feature map, concentrates more feature information on the target, and improves the performance of target detection. The specific C2f-EMA structure is as follows Figure 3 shown.

[0062] The EMA (Efficient Multi-scale Attention) attention mechanism aims to retain information on each channel and reduce computational overhead. It reshapes some channels into batch dimensions and groups the channel dimensions into multiple sub-features so that spatial semantic features are evenly distributed in each feature group. Each group of features passes through two parallel sub-networks. One of the parallel sub-networks is a 1x1 convolution kernel ( Figure 6 The fourth convolutional layer in ), processed in the same way as the CA attention mechanism, to extract the attention map of the spatial dimension; the other is a 3x3 convolution kernel ( Figure 6 The conv(3x) layer in the network is used to aggregate multi-scale spatial structure information, expand the receptive field and encode global spatial information. The feature maps of the two branches are then used to generate a channel attention mechanism in the channel direction, and information is exchanged across spatial dimensions during the process. Finally, the two attention maps are fused into one attention map, which has short-range and long-range dependencies, more global context information, and pixel-level attention to high-level abstract features. Its detailed structure is shown in the figure. Figure 6 shown.

[0063] For the Neck module of the network, considering that target detection should not only care about semantic information, but also pay attention to the shallow information of the image accurate to the pixel point. Therefore, it is necessary to fuse the network layers in the Backbone network so that it has both deep semantic information and shallow texture information. The specific fusion method is: restore the deep semantic information to the size of the previous level feature map through upsampling, and splice it with the previous level feature map in the channel dimension, while retaining the deep semantic information and shallow texture information. After splicing, feature extraction is performed through C2f and semantic and texture information is further fused. Similarly, in the top-down path, the low-level feature map is downsampled through a convolution with a step size of 2, spliced ​​with the deep feature map, and then C2f is used to further extract features and fuse features.

[0064] In the Head module of the network, two pure convolutions are used to convert the number of channels into the output required for classification and regression. During training, anchors are first assigned to the true annotation box in each label through a positive and negative sample dynamic allocation strategy, and then the anchors and the true annotation box are used to calculate the loss. The network is trained by minimizing the loss function. The loss function of YOLOv8-nano is calculated by the classification and regression branches in the Head module. The classification branch mainly calculates the classification loss, which is calculated by the cross entropy loss function, as shown in formula (1):

[0065]

[0066] Where N represents the number of samples, which is the number of true bounding boxes, K represents the number of categories, in this data set K = 5, and y ic Indicates whether the i-th sample belongs to category c. If it belongs to category c, then y ic =1, otherwise 0. ic It represents the probability that the predicted sample belongs to the category.

[0067] In the regression branch, CIoU loss and DFL loss are mainly calculated. The DFL loss regresses the bounding box predicted by the network in a probabilistic way and predicts the distribution probability of the predicted bounding box. The specific formula is shown in formula (2):

[0068] DFL(p(i),p(i+1))=-[(y i+1 -y)·log(p(i))+(yy i )·log(p(i+1))] (2)

[0069] Taking the interval [0,16], the predicted location labels l,r,t,b generally fall within a subinterval [i,i+1] of [0,16], so the network predicts 17 sigmoids as the probability of the location falling within the interval node. In formula 2, y i and i+1 are two predicted values ​​near the label y, and p(i) and p(i+1) are the probabilities of the corresponding predicted values.

[0070] The CIoU loss further refines the four coordinate values ​​of the bounding box obtained by DFL loss regression. Its formulas are as follows (3) to (5):

[0071]

[0072] Where L CIoU represents CIoU loss, ρ 2 (b,b gt ) represents the Euclidean distance between the center point of the predicted box and the true box, and c represents the diagonal distance of the minimum closure area that can contain both the predicted box and the true box.

[0073] Finally, the loss function of the entire network is the sum of the cross entropy loss of classification, the DFL loss of regression, and the CIoU loss.

[0074] Finally, the evaluation index of the target detection network can be mainly evaluated from three indicators: mean average precision (mAP), model computing power (GFLOPs), and model prediction time (ms). When calculating mAP, three indicators can be derived: accuracy (Precision) and regression rate (Recall). The accuracy is used to measure the false detection rate of the model, while the regression rate is used to measure the missed detection rate of the model. The formulas for accuracy and recall are shown in (6) and (7):

[0075]

[0076] Among them, TP represents a true positive example, FN represents a false negative example, and FP represents a false positive example. The formula for average precision is shown in (8):

[0077]

[0078] AP represents the average accuracy of a single category, which is the area under the Precision-Recall curve. mAP represents the average accuracy of all categories. The larger the mAP value, the better the performance of the model in terms of accuracy. The formula of mAP is shown in (9):

[0079]

[0080] When evaluating model performance, IOU represents the degree of overlap between the predicted box and the true labeled box. Different IOU thresholds are usually used to determine whether the prediction result is correct. When IOU is greater than or equal to the set threshold, the prediction is considered correct. When IOU is less than the set threshold, the prediction is considered wrong. In this invention, two indicators, mAP@0.5 (IOU threshold is 0.5) and mAP@0.5-0.95 (IOU threshold is 0.5 to 0.95), are used to evaluate the performance of the model in terms of accuracy.

[0081] Model computing power (GFLOPs) refers to the number of floating-point operations performed by the model during a forward propagation, usually measured in billion floating-point operations per second. Model computing power is used to evaluate the computing resource consumption of the model. Lower computing power requirements are more suitable for devices or scenarios with limited memory or computing power.

[0082] The speed of model prediction is the time it takes to detect an image after the model is trained for detection. It can be measured in milliseconds or FPS. When the former is used, the smaller the value, the better the performance; when the latter is used, the larger the value, the better the performance.

[0083] The experimental environment of the present invention is shown in Table 1, the experimental parameter settings are shown in Table 2, and the comparison between the original model and the improved model is shown in Table 3.

[0084] Table 1

[0085] equipment Version GPU NVIDIA GeForce RTX 3060, 12288MiB Python 3.9.17 Pytorch 2.0.0 CUDA 11.8 YOLOv8 version 0.114

[0086] Table 2

[0087] parameter value Epoch 300 Batch 16 Workers 8 Pretrained False Optimizer SGD Close_mosaic 30

[0088] Table 3

[0089] Model mAP@0.5 / % mAP@0.5-0.95 / % Parameters / M FLOPs / G Time / ms YOLOv8n 90.6 62.3 3M 8.1 3.6 YOLOv8n-EMA 91.6 62.5 3.1M 8.8 4.2

[0090] Embodiment 2

[0091] This embodiment provides a photovoltaic cell assembly defect detection system, including:

[0092] Acquisition module: used to acquire image data about photovoltaic cell components;

[0093] Construction module: used to construct a detection model, which is built based on YOLOv8-nano and includes a Backbone module, a Neck module and a Head module connected in sequence, wherein the Backbone module is used to extract multi-scale features, the Neck module is used to fuse the multi-scale features extracted by the Backbone module, and the Head module is used to perform regression prediction on the multi-scale features fused by the Neck module;

[0094] Adding the EMA attention mechanism to the Backbone module to obtain the YOLOv8n-EMA model;

[0095] Convergence module: used to train the YOLOv8n-EMA model by minimizing the loss function to make the YOLOv8n-EMA model converge;

[0096] Detection module: used to perform defect detection on the image data of photovoltaic cell modules using the converged YOLOv8n-EMA model.

[0097] Embodiment 3

[0098] This embodiment 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 implements the steps of the photovoltaic cell module defect detection method described in Embodiment 1 when executing the computer program.

[0099] Embodiment 4

[0100] This embodiment provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the photovoltaic cell assembly defect detection method described in the first embodiment are implemented.

[0101] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of complete hardware embodiments, complete software embodiments, or embodiments in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code. The scheme in the embodiments of the present application can be implemented in various computer languages, for example, object-oriented programming language Java and literal scripting language JavaScript, etc.

[0102] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0103] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0104] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0105] Although the preferred embodiments of the present application have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.

[0106] Obviously, the above embodiments are merely examples for clear explanation and are not intended to limit the implementation methods. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the implementation methods here. The obvious changes or modifications derived from these are still within the protection scope of the invention.

Claims

1. A photovoltaic cell assembly defect detection method, characterized in that: include: Step S1: Acquire image data about a photovoltaic cell assembly; Step S2: constructing a detection model, wherein the detection model is constructed based on YOLOv8-nano, and includes a Backbone module, a Neck module, and a Head module connected in sequence, wherein the Backbone module is used to extract multi-scale features, the Neck module is used to fuse the multi-scale features extracted by the Backbone module, and the Head module is used to perform regression prediction on the multi-scale features fused by the Neck module; Adding the EMA attention mechanism to the Backbone module to obtain the YOLOv8n-EMA model; Step S3: training the YOLOv8n-EMA model by minimizing the loss function to make the YOLOv8n-EMA model converge; Step S4: using the converged YOLOv8n-EMA model to perform defect detection on the image data of the photovoltaic cell module; The Backbone module in step S2 includes a first CBS module, a second CBS module, a first C2f module, a third CBS module, a second C2f module, a fourth CBS module, a first C2f-EMA module, a fifth CBS module, a second C2f-EMA module and an SPPF module connected in sequence; The Neck module in step S2 includes a first UpSample layer, a first Concat layer, a third C2f module, a second UpSample layer, a second Concat layer, a fourth C2f module, a sixth CBS module, a third Concat layer, a fifth C2f module, a seventh CBS module, a fourth Concat layer and a sixth C2f module connected in sequence, wherein the output of the SPPF module is connected to the input of the fourth Concat layer, the output of the first C2f-EMA module is connected to the input of the first Concat layer, the output of the third C2f module is connected to the input of the third Concat layer, and the output of the second C2f module is connected to the input of the second Concat layer; The Head module in step S2 includes a first Detect module, a second Detect module and a third Detect module, wherein the first Detect module is connected to the output of the fourth C2f module, the second Detect module is connected to the output of the fifth C2f module, and the third Detect module is connected to the output of the fourth Concat layer; The first C2f-EMA module and the second C2f-EMA module each include an eighth CBS module, a Split layer, a first BottleNeck module, a fifth Concat layer, an EMA module, and a ninth CBS module connected in sequence, wherein the output of the first BottleNeck module is further connected to the second BottleNeck module, the output of the second BottleNeck module is further connected to the third BottleNeck module, and the outputs of the second BottleNeck module and the third BottleNeck module are both connected to the input of the fifth Concat layer; The structures of the first to sixth C2f modules are the same as those of the first C2f-EMA module and the second C2f-EMA module, and there is no EMA module; The EMA module includes a Groups module, and the Groups module is sequentially connected to the first convolutional layer, the X average pooling layer, and the Y average pooling layer; The first convolutional layer is sequentially connected to a first average pooling layer, a Softmax layer, and a first Matmul layer; The X average pooling layer is sequentially connected to the joint module, the second convolutional layer, the first Sigmoid layer, and the first Re-weight layer; The Y average pooling layer is sequentially connected to the joint module, the third convolution layer, the second Sigmoid layer, the first Re-weight layer, the GN layer, the second average pooling layer, the first Softmax layer, the second Matmul layer, the addition layer, the second Softmax layer, and the second Re-weight layer; Among them, the output of the first convolution layer is connected to the input of the second Matmul layer, the output of the first Matmul layer is connected to the input of the addition layer, the output of the GN layer is connected to the input of the first Matmul layer, and the joint module includes the sixth Concat layer and the fourth convolution layer.

2. The photovoltaic cell assembly defect detection method according to claim 1, characterized in that: The image data in step S1 is subjected to data enhancement processing, wherein the data enhancement processing methods include Mosaic, Mixup and MedianBlur.

3. The photovoltaic cell assembly defect detection method according to claim 1, characterized in that: The first Detect module to the third Detect module include a first branch and a second branch connected in parallel, the first branch includes a tenth CBS module, a fifth convolutional layer, and a Bbox Loss layer connected in sequence, and the second branch includes an eleventh CBS module, a sixth convolutional layer, and a Cls Loss layer connected in sequence; The SPPF module includes a twelfth CBS module, a first maximum pooling layer, a second maximum pooling layer and a third maximum pooling layer connected in sequence, and the outputs of the first maximum pooling layer, the second maximum pooling layer and the third maximum pooling layer are all connected to the seventh Concat layer and the thirteenth CBS module.

4. The photovoltaic cell assembly defect detection method according to claim 1, characterized in that: The first to thirteenth CBS modules each include a seventh convolutional layer, a BN layer, and a SiLu layer connected in sequence.

5. A photovoltaic cell assembly defect detection system, characterized in that: include: Acquisition module: used to acquire image data about photovoltaic cell components; Construction module: used to construct a detection model, which is built based on YOLOv8-nano and includes a Backbone module, a Neck module and a Head module connected in sequence, wherein the Backbone module is used to extract multi-scale features, the Neck module is used to fuse the multi-scale features extracted by the Backbone module, and the Head module is used to perform regression prediction on the multi-scale features fused by the Neck module; Adding the EMA attention mechanism to the Backbone module to obtain the YOLOv8n-EMA model; Convergence module: used to train the YOLOv8n-EMA model by minimizing the loss function to make the YOLOv8n-EMA model converge; Detection module: used to perform defect detection on the image data of photovoltaic cell modules using the converged YOLOv8n-EMA model; The Backbone module in the construction module includes a first CBS module, a second CBS module, a first C2f module, a third CBS module, a second C2f module, a fourth CBS module, a first C2f-EMA module, a fifth CBS module, a second C2f-EMA module and an SPPF module connected in sequence; The Neck module in the building module includes a first UpSample layer, a first Concat layer, a third C2f module, a second UpSample layer, a second Concat layer, a fourth C2f module, a sixth CBS module, a third Concat layer, a fifth C2f module, a seventh CBS module, a fourth Concat layer and a sixth C2f module connected in sequence, wherein the output of the SPPF module is connected to the input of the fourth Concat layer, the output of the first C2f-EMA module is connected to the input of the first Concat layer, the output of the third C2f module is connected to the input of the third Concat layer, and the output of the second C2f module is connected to the input of the second Concat layer; The Head module in the building module includes a first Detect module, a second Detect module and a third Detect module, wherein the first Detect module is connected to the output of the fourth C2f module, the second Detect module is connected to the output of the fifth C2f module, and the third Detect module is connected to the output of the fourth Concat layer; The first C2f-EMA module and the second C2f-EMA module each include an eighth CBS module, a Split layer, a first BottleNeck module, a fifth Concat layer, an EMA module, and a ninth CBS module connected in sequence, wherein the output of the first BottleNeck module is further connected to the second BottleNeck module, the output of the second BottleNeck module is further connected to the third BottleNeck module, and the outputs of the second BottleNeck module and the third BottleNeck module are both connected to the input of the fifth Concat layer; The structures of the first to sixth C2f modules are the same as those of the first C2f-EMA module and the second C2f-EMA module, and there is no EMA module; The EMA module includes a Groups module, and the Groups module is sequentially connected to the first convolutional layer, the X average pooling layer, and the Y average pooling layer; The first convolutional layer is sequentially connected to a first average pooling layer, a Softmax layer, and a first Matmul layer; The X average pooling layer is sequentially connected to the joint module, the second convolutional layer, the first Sigmoid layer, and the first Re-weight layer; The Y average pooling layer is sequentially connected to the joint module, the third convolution layer, the second Sigmoid layer, the first Re-weight layer, the GN layer, the second average pooling layer, the first Softmax layer, the second Matmul layer, the addition layer, the second Softmax layer, and the second Re-weight layer; Among them, the output of the first convolution layer is connected to the input of the second Matmul layer, the output of the first Matmul layer is connected to the input of the addition layer, the output of the GN layer is connected to the input of the first Matmul layer, and the joint module includes the sixth Concat layer and the fourth convolution layer.