Photocell surface defect detection method and system, terminal and medium
By introducing deformable convolutional network and CA attention mechanism in YOLOv8, combined with RT-DETR detection head, and using WIoU and NWD loss, the problem of limited model deployment in photocell surface defect detection is solved, achieving high precision and high efficiency Detection effect, suitable for industrial real-time detection scenarios.
Patent Information
- Application Number
- CN202411255981.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-09
- Publication Date
- 2024-12-03
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the detection of photocell surface defects, model deployment is limited by the computing power of terminal devices, making it difficult to achieve high-precision and efficient detection in industrial real-time detection scenarios.
Based on YOLOv8, a deformable convolutional network and CA attention mechanism are introduced, combined with RT-DETR detection heads, and WIoU and NWD loss are used to enhance the feature extraction and detection capabilities of the model and improve detection speed and accuracy.
It realizes a high-precision and lightweight photocell surface defect detection model, adapts to equipment with limited computing resources, improves detection speed and accuracy, and meets industrial production needs.
Smart Images

Figure CN119068264A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of battery detection, and more specifically, to a method, system, terminal and medium for detecting surface defects of a photovoltaic cell. Background Art
[0002] In recent years, as human beings have become more and more dependent on energy, non-renewable energy such as oil has been used and consumed in large quantities. To meet this challenge, governments, scientists and companies around the world have taken a series of measures to promote the development of renewable energy. Among them, photovoltaic cells, as a device based on the principle of photoelectric conversion, can convert the photon energy in sunlight into electrical energy, namely the photovoltaic effect. This technology has been widely used due to its advantages such as low cost, pollution-free and renewable, and has effectively alleviated the global energy crisis. With the growth of the export volume of photovoltaic modules, the production volume of photovoltaic cells has also been increasing. However, some surface defects may be generated during the production process, and the presence of these defects seriously affects the stability of the photovoltaic power generation system. Therefore, defect detection of photovoltaic cells is a key step to ensure their performance and quality.
[0003] At present, deep learning has been widely used in photovoltaic cell surface defect detection. Compared with traditional machine vision methods, deep learning has significantly improved detection efficiency and accuracy. Detection algorithms are mainly divided into two categories: single-stage and dual-stage. The dual-stage algorithm divides the detection problem into two stages: generating candidate regions and refining the position classification. Although the dual-stage algorithm performs well in detection accuracy, it is slow and not suitable for industrial real-time detection scenarios. Typical algorithms include R-CNN, FastR-CNN, Faster R-CNN, Mask R-CNN, and Cascade R-CNN. The single-stage algorithm directly generates the category and location information of objects in the image, with faster detection speed, but the recognition accuracy and precision are usually slightly lower than the dual-stage algorithm. Representative algorithms include SSD, YOLO series, and DETR series. Although deep learning-based object detection algorithms have made progress in photovoltaic cell surface defect detection, model deployment still faces great challenges due to the computing power limitations of terminal devices. The current research focuses on improving detection accuracy and efficiency while ensuring lightweight processing of the model to adapt to devices with limited computing resources.
[0004] Therefore, how to research and design a photovoltaic cell surface defect detection method, system, terminal and medium that can overcome the above-mentioned defects is a problem that we urgently need to solve. Summary of the invention
[0005] In order to solve the deficiencies in the prior art, the purpose of the present invention is to provide a photovoltaic cell surface defect detection method, system, terminal and medium. Taking YOLOv8 as the baseline, a high-precision and lightweight photovoltaic cell surface defect detection model is established to meet the actual needs of industrial production.
[0006] The above technical objectives of the present invention are achieved through the following technical solutions:
[0007] In a first aspect, a method for detecting surface defects of a photovoltaic cell is provided, comprising the following steps:
[0008] Collect photocell images and annotate the defect types on the photocell images;
[0009] Perform data augmentation on the photovoltaic cell images with defect type annotations to obtain a training set;
[0010] Introduce a deformable convolutional network into the feature extraction network C2f module of YOLOv8 to build a new YOLOv8 model;
[0011] Train the new YOLOv8 model using the training set to obtain a detection model;
[0012] The detection model is used to detect the photocell image to be identified and complete the target detection of photocell surface defects.
[0013] Furthermore, the process of collecting the photocell image and marking the defect type of the photocell image is specifically as follows:
[0014] Use industrial cameras to capture images of photocells;
[0015] Use the labImg tool to manually calibrate the defect types in the photocell image, so that a txt file is generated after each image is calibrated;
[0016] Among them, the txt file contains the category information, center point position coordinates, width and height of the target bounding box; the target bounding box is a marked rectangular box that surrounds the defect.
[0017] Furthermore, the process of data augmentation of the photovoltaic cell image after defect type annotation is specifically as follows:
[0018] Randomly select four photocell images with defect type annotated;
[0019] The resolution of the selected photovoltaic images is reduced to one quarter of the original ones and then merged into a new image. The new image and the photovoltaic images with defect type annotations form a standard image data set to obtain a training set.
[0020] Furthermore, the process of introducing the deformable convolutional network into the feature extraction network C2f module of YOLOv8 is specifically as follows:
[0021] Change the deep feature layer C2f to C2f_DynamicDCNv2;
[0022] Among them, when the feature map with a size of C*H*W reaches the deep feature layer, it undergoes a convolution operation;
[0023] Perform a one-dimensional global average pooling operation in the vertical and horizontal directions to generate feature maps of size C*H*1 and C*1*W respectively;
[0024] And, transform the generated C*1*W feature map and then perform a concat operation.
[0025] Furthermore, the new YOLOv8 model includes a deformable convolution module;
[0026] Among them, the deformable convolution module introduces the CA attention mechanism before obtaining the offset operation, so that the deformable convolution can dynamically adjust the offset.
[0027] Furthermore, the new YOLOv8 model includes a detection head module;
[0028] Among them, the detection head module replaces the detection head in RT-DETR with the detection head in YOLOv8 to combine the real-time detection capability of YOLO and the deep feature understanding capability of RT-DETR.
[0029] Furthermore, the new YOLOv8 model includes a loss function module;
[0030] Among them, the loss function module enhances the model's ability to detect small targets by using the standardized Wasserstein distance as the regression loss function of YOLOv8.
[0031] In a second aspect, a photovoltaic cell surface defect detection system is provided, and the system is applied to implement a photovoltaic cell surface defect detection method as described in any one of the first aspects, including:
[0032] An image acquisition module is used to acquire a photocell image and annotate the photocell image with defect types;
[0033] An image processing module is used to perform data augmentation on the photovoltaic cell images after defect type annotation to obtain a training set;
[0034] Model building module, which is used to introduce the deformable convolutional network into the feature extraction network C2f module of YOLOv8 to build a new YOLOv8 model;
[0035] The model training module is used to train the new YOLOv8 model through the training set to obtain the detection model;
[0036] The defect detection module is used to detect the photocell image to be identified using the detection model to complete the target detection of photocell surface defects.
[0037] In a third aspect, a computer terminal is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, a photovoltaic cell surface defect detection method as described in any one of the first aspects is implemented.
[0038] In a fourth aspect, a computer-readable medium is provided, on which a computer program is stored, and the computer program is executed by a processor to implement a photovoltaic cell surface defect detection method as described in any one of the first aspects.
[0039] Compared with the prior art, the present invention has the following beneficial effects:
[0040] 1. The present invention introduces a self-developed deformable convolutional network into the feature extraction network C2f module of YOLOv8 to enhance the feature extraction capability. Compared with the original DCNv2, the present invention introduces a self-developed CA multi-channel attention mechanism, so that the target offset can be adaptively adjusted, thereby enhancing the ability to locate photocell defects.
[0041] 2. The present invention integrates the head of RT-DETR into YOLOv8, which has the advantages of high-speed processing of traditional neural networks and precise positioning capabilities of Transformer, effectively improving the speed of image post-processing, thereby improving the detection speed;
[0042] 3. This paper adopts the latest WIoU to replace the traditional CIoU, which improves the accuracy of model anchor box screening; at the same time, it introduces NWD loss in the overall regression loss function and uses Gaussian distribution joint measurement to further enhance the ability of small target detection and effectively improve the performance of the model. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] The drawings described herein are used to provide a further understanding of the embodiments of the present invention, constitute a part of this application, and do not constitute a limitation of the embodiments of the present invention. In the drawings:
[0044] Figure 1 is a flow chart of Embodiment 1 of the present invention;
[0045] Figure 2 It is a structural diagram of the DWN-YOLOv8 model in Example 1 of the present invention;
[0046] Figure 3It is a structural diagram of the dynamic deformable convolution (Dynamic DCNv2) in Example 1 of the present invention;
[0047] Figure 4 is a structural diagram of the RT-DETR model in Example 1 of the present invention;
[0048] Figure 5 Schematic diagram of sensitivity analysis of intersection over union (IoU) to large and small defect types in Example 1 of the present invention;
[0049] Figure 6 It is a training result diagram of DWN-YOLOv8 in Example 1 of the present invention;
[0050] Figure 7 It is a system block diagram in Example 2 of the present invention. DETAILED DESCRIPTION
[0051] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with embodiments and drawings. The exemplary embodiments of the present invention and their description are only used to explain the present invention and are not intended to limit the present invention.
[0052] In the field of photovoltaic cell surface defect detection, the computing power of terminal detection equipment is often only a few GFLOPs, and the memory is less than 8GB, while the computing power of mainstream target detection models such as the YOLO series is as high as 40 to 150 GFLOPs. Predicting a 1024×1024 image requires about 16GB of memory. Such computing requirements have exceeded the processing power of terminal detection equipment. Without increasing computing resources, terminal detection equipment cannot guarantee the stable operation of target detection models with huge computing power, and at the same time requires real-time detection speed and high detection accuracy. At present, in industrial detection practice, it still cannot meet the requirements of easy deployment and high precision. For this reason, we need a more accurate, faster and lighter model to meet the actual needs of industrial production. Based on the limitations of existing research, this paper proposes a high-precision and lightweight photovoltaic cell surface defect detection model based on the YOLOv8 baseline, which is named DWN-YOLOv8.
[0053] Embodiment 1: A method for detecting surface defects of a photovoltaic cell, such as Figure 1 As shown, the following steps are included:
[0054] S1: Collect photocell images and annotate the defect types of the photocell images;
[0055] S2: perform data augmentation on the photovoltaic cell images with defect type annotations to obtain a training set;
[0056] S3: Introduce the deformable convolutional network into the feature extraction network C2f module of YOLOv8 to build a new YOLOv8 model;
[0057] S4: Train the new YOLOv8 model using the training set to obtain a detection model;
[0058] S5: Use the detection model to detect the photocell image to be identified, and complete the target detection of photocell surface defects.
[0059] In step S1, an industrial camera can be used to capture a photocell image, and the labImg tool can be used to perform manual data calibration on the defect type in the photocell image, so that a txt file is generated after each image is calibrated; the txt file contains the category information, center point position coordinates, width, and height of the target bounding box; the target bounding box is a marked rectangular box that surrounds the defect.
[0060] In step S2, the process of data augmentation of the photocell images after defect type annotation is specifically as follows: four photocell images after defect type annotation can be randomly selected; the resolution of the selected photocell images is reduced to one-fourth of the original and then merged into a new image, and the new image and the photocell images after defect type annotation form a standard image data set to obtain a training set.
[0061] For example, by adjusting its resolution to 640*640, the number of original images can be expanded to 4 times the original size to achieve the effect of data enhancement.
[0062] In addition, data augmentation can also be achieved by rotational amplification, which is not limited here.
[0063] In step S3, the process of introducing the deformable convolutional network into the feature extraction network C2f module of YOLOv8 is specifically as follows: the deep feature layer C2f is changed into C2f_DynamicDCNv2; wherein, when the feature map of size C*H*W reaches the deep feature layer, it undergoes a convolution operation; a one-dimensional global average pooling operation is performed in the vertical and horizontal directions respectively to generate feature maps of sizes C*H*1 and C*1*W, respectively; and the generated C*1*W feature map is transformed and then concat operation is performed.
[0064] The new YOLOv8 model described in the present invention includes a deformable convolution module, a detection head module and a loss function module.
[0065] As shown in 2, the model introduces the self-developed deformable convolution module and integrates it into the C2f module of Backbone, which significantly enhances the feature extraction capability. At the same time, the detection head of the latest model RT-DETR is integrated into YOLOv8 to speed up the model reasoning speed and improve performance. In addition, the loss function of the model is rebuilt, and WIoU and NWD loss are introduced to replace the traditional regression loss function, which strengthens the small target detection capability and further improves the detection accuracy. The model structure diagram is shown in Figure 2 shown.
[0066] (1) Deformable Convolution Module
[0067] Deformable convolution is a form of learning spatial offset based on traditional convolutional neural network (CNN). Traditional convolution operation is fixed on the image, that is, the receptive field of each element in the convolution kernel on the input image is fixed and cannot adapt to the deformation or distortion in the input image. Deformable convolution introduces learnable offset parameters (Offsets), so that each element in the convolution kernel can be locally translated and deformed on the input image, thereby more flexibly capturing the structural information in the image.
[0068] Considering that the deformable convolution still uses ordinary convolution operation in learning the offset parameter, the present invention introduces the CA attention mechanism before obtaining the offset operation in the past, so that the deformable convolution can dynamically adjust the offset, such as Figure 3 As shown in the figure, the CA (Coordinate Attention) attention mechanism is a new attention mechanism designed for lightweight networks. It aims to effectively integrate position information into channel attention, improve the performance of the model without adding significant additional computational burden. CA uses two one-dimensional global pooling operations to aggregate input features in the vertical and horizontal directions to generate two independent direction-aware feature maps. These feature maps contain detailed information in a specific direction and are further encoded into two attention maps. Each attention map captures the long-range dependencies of the input feature map along a specific spatial direction, thereby retaining basic position information. Multiplying these two attention maps with the input feature map can take into account the importance of different positions in the feature map without adding too much computational burden.
[0069] After introducing this attention mechanism, the network can dynamically adjust the offset parameters according to the importance of different areas in the input image, so that the network can pay more attention to the important structural information in the image, thereby enhancing the model's ability to capture local structural information. The network can also selectively perform deformation operations on specific areas of the input image, thereby reducing unnecessary calculations and improving the computational efficiency of the model.
[0070] (2) Detection head module
[0071] RT-DETR is an end-to-end single-stage detector based on Transformer. Figure 4 As shown in the figure, the detection head decoder part of the system includes an auxiliary prediction head, which is one of the core components of the system. The decoder plays an important role in RT-DETR, mainly responsible for processing the features processed by the hybrid encoder and performing target detection on these features. It uses the powerful ability of Transformer to capture and understand complex patterns in images. It analyzes and weights input features through a self-attention mechanism, so that different objects in the image can be more accurately located and identified. This method enables RT-DETR to provide more accurate detection results than traditional methods while maintaining high speed. The present invention replaces the RT-DETR detection head with YOLOv8, which combines the real-time detection capability of YOLO with the deep feature understanding capability of RT-DETR to create a more powerful target detection model. A large number of previous experiments have shown that the YOLO series will go through two key steps in the post-processing stage: confidence threshold and non-maximum suppression (NMS). However, these two operations increase the computational complexity, thereby reducing the inference speed. The detection head is replaced with RT-DETR, and the self-attention mechanism in the decoder is used to directly predict the category, bounding box position, and object feature vector of each object, eliminating the need for post-processing operations of traditional algorithms. This not only speeds up the inference speed of the model, but also improves accuracy.
[0072] (3) Loss function module
[0073] In industrial environments, there are still some challenges in the scene of photocell surface defect detection. Especially when detecting small defects or faint flaws. Although YOLOv8 uses DFL and CloU for bounding box regression, CloU has some shortcomings: it lacks balanced processing of difficult and easy samples and is not accurate enough in penalizing aspect ratio. WloU is a regression loss function combined with a non-monotonic dynamic focus mechanism. WloU has three versions, among which v1 uses distance as an attention indicator, but it lacks a dynamic optimization mechanism and cannot dynamically adjust the weight of the loss function according to the learning situation during training, resulting in the model's training process being unstable. V2 reduces the weight of easy samples by constructing a monotonic focus coefficient, but the convergence speed is slow. V3 defines an outlier value β, which can adopt the gradient gain allocation strategy that best suits the current situation. The gradient gain allocation strategy reduces the competitiveness of high-quality anchor frames, and also reduces the harmful gradients generated by low-quality anchor frames, so that WIoUv3 can focus on anchor frames of ordinary quality and improve the overall performance of the detector.
[0074] The formula of WloUv1 is expressed as (1)-(3):
[0075] L WIoUv1 =R WIoU ×L IoU (1);
[0076]
[0077] L IoU =1-IoU (3).
[0078] c w 、c h Respectively represent the width and height of the minimum bounding box, b cx , Respectively represent the horizontal coordinate values of the center points of the predicted box and the real box, b cy , Represents the ordinate values of the center points of the predicted box and the real box respectively, and * represents the operation of separating the width and height of the minimum bounding box from the calculation graph, the purpose of which is to eliminate R WIoU The influence of hindering convergence, L IoU Represents the IoU loss function of normal quality, R WIoU Represents a high-quality IoU loss function, where IoU represents the intersection-over-union ratio between the real box and the predicted box.
[0079] The formula of WloUv2 is expressed as (4):
[0080]
[0081] represents the sliding average of the general quality IoU loss function, represents the monotonic focusing coefficient of the general quality IoU loss function, and its gradient gain will increase with L during training. IoU , γ represents the angle coefficient between the predicted box and the real box.
[0082] The WIoUv3 method is introduced in equations (5)-(7):
[0083] L WIoUv3 =r×L WIoUv1 (5);
[0084]
[0085] In equation (6), β represents the non-monotonic focusing coefficient, δ represents the gradient gain, and r represents the prediction box radius, which can be adjusted according to the special model.
[0086] By comparing with various mainstream loss functions, WIoUv3 combines the advantages of EIoU and SIoU. It dynamically introduces a non-monotonic mechanism to consider the quality of anchor boxes, allowing the model to pay more attention to anchor boxes with good quality, thereby improving the target positioning ability. In the context of photovoltaic cell surface defect detection, WIoUv3 dynamically adjusts the loss weight of the detection target and enhances the performance of the model.
[0087] When detecting defects on the surface of photovoltaic cells, it is observed that the sensitivity of the intersection over union (IoU) to objects of different scales varies significantly, such as Figure 5 Specifically, for tiny categories with a size of 6×6 pixels, a slight position shift causes a significant drop in IoU, leading to inaccurate label assignment. However, for larger categories with a size of 36×36 pixels, the IoU changes only slightly even with the same position shift.
[0088] The present invention uses NWD for small target detection, abandoning the traditional intersection over union (IoU) to evaluate the similarity between small targets. This method aims to always capture the distance between distributions. Initially, the method represents the bounding box as a two-dimensional Gaussian distribution. It is worth noting that the central pixel in the bounding box carries more weight, and the importance of the pixel gradually decreases from the center to the boundary. Subsequently, the similarity between the bounding box and the actual situation is calculated and normalized to obtain NWD. It can be expressed by equations (8)-(9):
[0089]
[0090] in, represents the Gaussian Wasserstein distance between two bounding boxes, C is a constant that is closely related to the dataset, is the distance metric. N a and N b It is modeled as a Gaussian distribution by and , where a, b represent a bounding box, cx, cy are the coordinates of the bounding box, and w and h are the width and height of the bounding box, respectively.
[0091] The present invention enhances the model's ability to detect small targets by using the normalized Wasserstein distance (NWD) as the regression loss function of YOLOv8, which can not only dynamically adjust the weight of the loss function, but also take into account the problem of inaccurate detection of small targets due to IoU sensitivity. The model regression function can be expressed as formula (10):
[0092] Loss Regression =α1·WIoUv3+α2·DFL+α3·NWD (10);
[0093] Among them, α1, α2, and α3 are the weights of their respective loss functions, which can be adjusted according to actual conditions. Regression It represents the regression loss function of this model. WIoUv3, DFL and NWD are three types of loss functions respectively.
[0094] The loss function module enhances the model's ability to detect small objects by using the standardized Wasserstein distance as the regression loss function of YOLOv8.
[0095] In the new YOLOv8 model described in the present invention, the original ninth layer C2f is changed to C2f_DynamicDCNv2. When the feature map of size C*H*W reaches the ninth layer, it undergoes a convolution operation, and then performs a one-dimensional global average pooling operation in the vertical and horizontal directions. The formula is as follows:
[0096]
[0097]
[0098] Pooling is performed in the X and Y directions to generate feature maps of size C*H*1 respectively. and a feature map of size C*1*W Transform the generated C*1*W feature map, the feature map and Generate feature map after concat Using the F1 operation, that is, using a 1*1 convolution kernel for dimensionality reduction, the formula is as follows:
[0099]
[0100] Among them, h and w represent the height and width of the feature map, δ represents the activation operation, and f represents the attention vector.
[0101] The final attention vector is obtained through the activation operation, and the attention vector is introduced into the offset generation process in the X and Y directions, so as to achieve the effect of dynamically adjusting the offset and make the original deformable convolution pay more attention to the image information.
[0102] The feature information of the 16th, 19th, and 22nd layers is input as the encoder part to the IoU-aware Query Selection (IoU query mechanism), which constrains the detector to generate high classification scores for features with high IOU and low classification scores for features with low IOU during training. As a result, the model selects prediction boxes with both high classification scores and high IOU scores based on the classification scores. Next, these features are input into the Decoder for decoding. In its Decoder, deformable self-attention is used, which can greatly reduce the amount of calculation. At the same time, this part also uses CUDA operators to speed up the running speed. Finally, high-quality prediction boxes are directly generated, and there is no post-processing step in the reverse reasoning process, which speeds up the reasoning speed.
[0103] The photocell images in the training set are used as the input of the DWN-YOLOv8 model. The DWN-YOLOv8 model is fine-tuned by transfer learning. The dynamic learning rate decay strategy is adopted to continuously train the DWN-YOLOv8 model until the loss function no longer decreases. The best performing weight of the DWN-YOLOv8 model during the training process is saved to obtain the trained model. The maximum number of iterations in the training process is 200, the batch size is 64, the weight optimization adopts the NAG optimizer, the learning rate is preheated by the periodic learning rate adjustment strategy and the Warm-Up method, the initial learning rate is 0.01, the learning rate decay weight is 0.0005, and the way to automatically adjust the learning rate is the cosine annealing learning rate decay method. The training results are shown in the figure. Figure 6 shown.
[0104] Embodiment 2: A photovoltaic cell surface defect detection system, the system is applied to implement a photovoltaic cell surface defect detection method as described in Embodiment 1, such as Figure 7 As shown, it includes an image acquisition module, an image processing module, a model building module, a model training module and a defect detection module.
[0105] Among them, the image acquisition module is used to collect photocell images and annotate the defect types of the photocell images; the image processing module is used to perform data augmentation on the photocell images after defect type annotation to obtain a training set; the model construction module is used to introduce a deformable convolutional network into the feature extraction network C2f module of YOLOv8 to construct a new YOLOv8 model; the model training module is used to train the new YOLOv8 model through the training set to obtain a detection model; the defect detection module is used to use the detection model to detect the photocell images to be identified and complete the target detection of photocell surface defects.
[0106] The present invention also describes a computer terminal, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, a photovoltaic cell surface defect detection method as described in Example 1 is implemented.
[0107] The present invention also describes a computer-readable medium on which a computer program is stored. The computer program is executed by a processor to implement a photovoltaic cell surface defect detection method as described in Example 1.
[0108] Working principle: The new YOLOv8 model recorded in the present invention introduces a self-developed deformable convolution module and integrates it into the C2f module of Backbone, which significantly enhances the feature extraction capability. At the same time, the detection head of the latest model RT-DETR is integrated into YOLOv8 to speed up the model reasoning speed and improve performance. In addition, the loss function of the model is rebuilt, and WIoU and NWD loss are introduced to replace the traditional regression loss function, so as to enhance the small target detection capability and further improve the detection accuracy.
[0109] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in 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.
[0110] 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.
[0111] 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.
[0112] 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 in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0113] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for detecting surface defects of a photovoltaic cell, characterized in that: The following steps are involved: Collect photocell images and annotate the defect types on the photocell images; Perform data augmentation on the photovoltaic cell images with defect type annotations to obtain a training set; Introduce a deformable convolutional network into the feature extraction network C2f module of YOLOv8 to build a new YOLOv8 model; Train the new YOLOv8 model using the training set to obtain a detection model; The detection model is used to detect the photocell image to be identified and complete the target detection of photocell surface defects.
2. A method for detecting surface defects of a photovoltaic cell according to claim 1, characterized in that: The process of collecting the photocell image and marking the defect type of the photocell image is specifically as follows: Use industrial cameras to capture images of photocells; Use the labImg tool to manually calibrate the defect types in the photocell image, so that a txt file is generated after each image is calibrated; Among them, the txt file contains the category information, center point position coordinates, width and height of the target bounding box; the target bounding box is a marked rectangular box that surrounds the defect.
3. A method for detecting surface defects of a photovoltaic cell according to claim 1, characterized in that: The process of data augmentation of the photovoltaic cell image after defect type annotation is specifically as follows: Randomly select four photocell images with defect type annotated; The resolution of the selected photovoltaic images is reduced to one quarter of the original ones and then merged into a new image. The new image and the photovoltaic images with defect type annotations form a standard image data set to obtain a training set.
4. A method for detecting surface defects of a photovoltaic cell according to claim 1, characterized in that: The process of introducing the deformable convolutional network into the feature extraction network C2f module of YOLOv8 is specifically as follows: Change the deep feature layer C2f to C2f_DynamicDCNv2; Among them, when the feature map with a size of C*H*W reaches the deep feature layer, it undergoes a convolution operation; Perform a one-dimensional global average pooling operation in the vertical and horizontal directions to generate feature maps of size C*H*1 and C*1*W respectively; And, transform the generated C*1*W feature map and then perform a concat operation.
5. A method for detecting surface defects of a photovoltaic cell according to claim 1, characterized in that: The new YOLOv8 model includes a deformable convolution module; Among them, the deformable convolution module introduces the CA attention mechanism before obtaining the offset operation, so that the deformable convolution can dynamically adjust the offset.
6. A method for detecting surface defects of a photovoltaic cell according to claim 1, characterized in that: The new YOLOv8 model includes a detection head module; Among them, the detection head module replaces the detection head in RT-DETR with the detection head in YOLOv8 to combine the real-time detection capability of YOLO and the deep feature understanding capability of RT-DETR.
7. A method for detecting surface defects of a photovoltaic cell according to claim 1, characterized in that: The new YOLOv8 model includes a loss function module; Among them, the loss function module enhances the model's ability to detect small targets by using the standardized Wasserstein distance as the regression loss function of YOLOv8.
8. A photovoltaic cell surface defect detection system, characterized in that: The system application implements a photovoltaic cell surface defect detection method as described in any one of claims 1 to 7, comprising: An image acquisition module is used to acquire a photocell image and annotate the photocell image with defect types; An image processing module is used to perform data augmentation on the photovoltaic cell images after defect type annotation to obtain a training set; Model building module, which is used to introduce the deformable convolutional network into the feature extraction network C2f module of YOLOv8 to build a new YOLOv8 model; The model training module is used to train the new YOLOv8 model through the training set to obtain the detection model; The defect detection module is used to detect the photocell image to be identified using the detection model to complete the target detection of photocell surface defects.
9. A computer terminal comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, a photovoltaic cell surface defect detection method as described in any one of claims 1 to 7 is implemented.
10. A computer readable medium having a computer program stored thereon, characterized in that: The computer program is executed by a processor to implement a photovoltaic cell surface defect detection method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Strip steel surface small target defect detection method and system based on super-resolution and YOLOv8
CN116630301A
PCB bare board surface defect detection method based on YOLOv8
CN116823738A
Road defect real-time detection method, system and equipment and storage medium
CN117078591A
Traffic sign board detection method based on improved YOLOv8s
CN117392640A
Traffic sign recognition method, device and equipment and storage medium
CN117671641A
Cited By
Steel structure welding quality detection method and storage medium
CN120219374A
Lightweight model-based chemical instrument identification method, apparatus and device, and medium
CN121617078A
