Photovoltaic silicon wafer defect detection method and device, computer equipment and storage medium
By optimizing the YOLOv8s model for photovoltaic silicon wafer defect detection, using the target image set to train the model and combining the CBAM attention module, the problem of low accuracy of the existing detection methods is solved, and more efficient and robust defect detection is achieved.
Patent Information
- Application Number
- CN202411742870.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-05-06
AI Technical Summary
The existing photovoltaic silicon wafer defect detection methods rely on the selection of thresholds, resulting in low detection accuracy and high requirements for users.
The optimized YOLOv8s model is used for defect detection, the model is trained through the target image set, and the backbone network, feature fusion network and detection module are used to identify the defect location and type of the silicon wafer, and combined with the CBAM attention module to improve the model's performance and generalization capabilities.
It improves the accuracy of photovoltaic silicon wafer defect detection, reduces dependence on experienced personnel, and enhances the adaptability and robustness of detection.
Smart Images

Figure CN119941618A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer vision technology, and in particular to a photovoltaic silicon wafer defect detection method, device, computer equipment and storage medium. Background Art
[0002] In the photovoltaic industry, baskets are used to carry solar silicon wafers. After a series of complex process flows, these wafers need to be strictly inspected for their status in the baskets. The inspection mainly includes: whether the silicon wafers are attached with liquid, and whether there are missing wafers, fragments, misaligned teeth, etc. If the basket inspection and processing steps are ignored, the liquid-carrying silicon wafers, fragments, etc. will flow into the next process and have a serious impact, resulting in a decrease in the A-grade rate of the product and a decrease in production capacity. Therefore, the basket inspection link plays an important role in ensuring the production efficiency and product quality of the photovoltaic industry.
[0003] In the prior art, a tilted camera is used to take pictures of a vertically placed flower basket during movement. The silicon wafer reflects light so that it appears as a uniform gray band on the image, and the edge is a black line. Through horizontal recognition and grayscale difference, it can be identified whether there is liquid, debris, misaligned teeth, or missing pieces in the flower basket.
[0004] The above method mainly calculates the grayscale difference between adjacent pixels. If the difference exceeds a certain threshold, it is considered that there is a grayscale change in the area and the target, that is, the defect position of the silicon wafer, is detected. However, there are still some problems in the actual flower basket detection process. The specific problems are as follows: Traditional grayscale value detection is overly dependent on the selection of thresholds, which requires multiple experiments to determine, increasing the cost of use and placing high requirements on users. In actual applications, it is necessary to select appropriate image processing technology and parameters according to specific needs and scenarios, and there is a problem of low accuracy. Summary of the invention
[0005] Based on this, it is necessary to provide a photovoltaic silicon wafer defect detection method, device, computer equipment and storage medium that can improve the accuracy of the detection method in response to the above-mentioned technical problems.
[0006] In a first aspect, the present application provides a photovoltaic silicon wafer defect detection method, which is applied to a blanking basket loaded with photovoltaic silicon wafers, and the method comprises:
[0007] The defect detection model is trained by a target image set to obtain a trained defect detection model; the target image set includes a blanking basket image with defect locations and defect types marked;
[0008] Inputting the unloading basket image to be detected into the trained defect detection model to obtain the defect position and defect type of the silicon wafer in the unloading basket image to be detected; the defect type includes missing wafer, fragment, misaligned wafer and liquid-carrying defect of the silicon wafer;
[0009] Wherein, the defect detection model is an optimized YOLOv8s model, and the optimized YOLOv8s model includes a backbone network, a feature fusion network and a detection module;
[0010] The backbone network includes a first feature layer, a second feature layer, a third feature layer and a fourth feature layer connected in sequence; the first feature layer is used to convert the blanking flower basket image into an initial feature map; the second feature layer is used to convert the initial feature map into a first feature map; the third feature layer is used to convert the first feature map into a second feature map; the fourth feature layer is used to convert the second feature map into a third feature map; the second feature layer and the third feature layer include a CBAM attention module;
[0011] The feature fusion network includes a first fusion layer, a second fusion layer and a third fusion layer; the first fusion layer is used to upsample the third feature map and fuse it with the second feature map to obtain a fifth feature map; the second fusion layer is used to extract features and upsample the fifth feature map and fuse it with the first feature map to obtain a fourth feature map; the third fusion layer is used to fuse the fourth feature map, the fifth feature map and the third feature map to obtain a sixth feature map;
[0012] The detection module includes three decoupling heads, which are used to obtain corresponding detection result feature maps according to the fourth feature map, the fifth feature map and the sixth feature map; the detection result feature maps are used to represent the defect types of silicon wafers in the blanking basket image, and the coordinates and sizes of the defect positions of the silicon wafers.
[0013] In one embodiment, before training the defect detection model using the target image set, the method further includes:
[0014] Obtain the original data set consisting of the images of the cutting flower basket;
[0015] Performing graphic segmentation on each of the blanking flower basket images in the original data set to obtain a plurality of target images;
[0016] The defect positions and defect types of the silicon wafers are marked on the plurality of target images to obtain a target image set.
[0017] In one embodiment, the target image set includes a test data set, a training data set, and a verification data set, and the target image obtained by segmentation is annotated with respect to the defect position and defect type of the silicon wafer to obtain the target image set, including:
[0018] Use the data annotation tool Labelmg to label the target image with the corresponding defect location label according to the defect location, and label the corresponding defect type label according to the defect type;
[0019] Storing target images corresponding to each of the defect type labels into multiple folders;
[0020] Randomly extracting a preset proportion of target images from each of the folders as a training data set;
[0021] The remaining target images in each of the folders are extracted, and a test data set and a verification data set are obtained according to the remaining target images.
[0022] In one embodiment, obtaining a test data set and a verification data set according to the remaining target images includes:
[0023] Performing size quantization processing on the target images remaining in each of the folders to obtain target images with uniform sizes;
[0024] A test data set and a validation data set are determined according to the target images with uniform sizes.
[0025] In one embodiment, the step of training the defect detection model using the target image set to obtain a trained defect detection model includes:
[0026] Initialize the training parameters of the defect detection model;
[0027] Inputting the training data set into the defect detection model to obtain a defect detection result of the training data set;
[0028] Calculating a loss function of a defect detection model based on the defect detection results and defect type labels of a training data set;
[0029] According to the calculation result of the loss function, the training parameters of the defect detection model are updated to obtain a trained defect detection model.
[0030] In one embodiment, the step of training the defect detection model using the target image set to obtain a trained defect detection model further includes:
[0031] Adjusting the hyperparameters of the trained defect detection model using the validation data set;
[0032] The performance of the trained defect detection model is evaluated using the test data set.
[0033] In a second aspect, the present application also provides a photovoltaic silicon wafer defect detection device, comprising:
[0034] A model training module is used to train the defect detection model through a target image set to obtain a trained defect detection model; the target image set includes a blanking basket image with defect locations and defect types marked;
[0035] A defect detection module is used to input the image of the blanking basket to be detected into the trained defect detection model to obtain the defect position and defect type of the silicon wafer in the image of the blanking basket to be detected; the defect type includes missing wafers, fragments, misaligned wafers and liquid defects of the silicon wafers;
[0036] Wherein, the defect detection model is an optimized YOLOv8s model, and the optimized YOLOv8s model includes a backbone network, a feature fusion network and a detection module;
[0037] The backbone network includes a first feature layer, a second feature layer, a third feature layer and a fourth feature layer connected in sequence; the first feature layer is used to convert the blanking flower basket image into an initial feature map; the second feature layer is used to convert the initial feature map into a first feature map; the third feature layer is used to convert the first feature map into a second feature map; the fourth feature layer is used to convert the second feature map into a third feature map; the second feature layer and the third feature layer include a CBAM attention module;
[0038] The feature fusion network includes a first fusion layer, a second fusion layer and a third fusion layer; the first fusion layer is used to upsample the third feature map and fuse it with the second feature map to obtain a fifth feature map; the second fusion layer is used to extract features and upsample the fifth feature map and fuse it with the first feature map to obtain a fourth feature map; the third fusion layer is used to fuse the fourth feature map, the fifth feature map and the third feature map to obtain a sixth feature map;
[0039] The detection module includes three decoupling heads, which are used to obtain corresponding detection result feature maps according to the fourth feature map, the fifth feature map and the sixth feature map; the detection result feature maps are used to represent the defect types of silicon wafers in the blanking basket image, and the coordinates and sizes of the defect positions of the silicon wafers.
[0040] In a third aspect, the present application further provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements any one of the methods described in the first aspect when executing the computer program.
[0041] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements any of the methods described in the first aspect.
[0042] In a fifth aspect, the present application further provides a computer program product, comprising a computer program, which implements any of the methods in the first aspect when executed by a processor.
[0043] The above-mentioned photovoltaic silicon wafer defect detection method, device, computer equipment storage medium and computer program product train the defect detection model through the target image set to obtain a trained defect detection model; the target image set includes a blanking basket image with defect positions and defect types marked; the blanking basket image to be detected is input into the trained defect detection model to obtain the defect position and defect type of the silicon wafer in the blanking basket image to be detected. The defect types include missing wafers, fragments, misaligned wafers and liquid defects of silicon wafers. Among them, the defect detection model is an optimized YOLOv8s model, and the optimized YOLOv8s model includes a backbone network, a feature fusion network and a detection module. The optimized YOLOv8s model is used for defect detection, which does not rely on experienced personnel to try multiple experiments to determine the threshold, and the performance and generalization ability of the model are improved through the CBAM attention module, which further improves the accuracy of detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0045] Figure 1 A schematic diagram of a process of detecting defects in a photovoltaic silicon wafer according to an embodiment;
[0046] Figure 2 is a schematic diagram of a process of obtaining a target image set in one embodiment;
[0047] Figure 3 A schematic diagram of a process of obtaining a training data set, a test data set, and a verification data set through a target image set in one embodiment;
[0048] Figure 4 A schematic diagram of a process for training a defect detection model in one embodiment;
[0049] Figure 5 A schematic diagram of a defect detection model in one embodiment;
[0050] Figure 6 is a structural block diagram of a photovoltaic silicon wafer defect detection device in one embodiment;
[0051] Figure 7FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0052] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0053] In one embodiment, Figure 1 As shown, a photovoltaic silicon wafer defect detection method is provided, which is mainly used to classify the appearance defects of photovoltaic silicon wafers in the blanking basket. In this embodiment, the method includes the following steps 102 to 106. Among them:
[0054] Step 102, training the defect detection model using the target image set to obtain a trained defect detection model.
[0055] The target image set includes a blanking basket image with defect locations and defect types marked. The blanking basket image is an image of a blanking basket loaded with photovoltaic silicon wafers. The target image set is obtained by segmenting and defect marking the blanking basket image.
[0056] Step 104 , input the image of the blanking basket to be detected into the trained defect detection model to obtain the defect position and defect type of the silicon wafer in the image of the blanking basket to be detected.
[0057] Among them, the defect types include missing wafers, fragments, misaligned wafers and liquid inclusion defects. Missing wafers refer to the presence of holes or gaps on the wafer. This defect may be caused by problems in the material preparation process, such as holes or missing materials in the wafer manufacturing process. Missing wafers will cause the structure of photovoltaic silicon wafers to be incomplete, affecting the performance of battery modules. Fragments refer to cracks or breakages on the silicon wafer. This defect may be caused by the material being broken by impact or pressure during transportation or processing. Fragmented silicon wafers cannot work properly and may cause the efficiency of battery modules to decrease or fail completely. Misaligned wafers: refers to the situation where the position or direction of the silicon wafer is wrong during the preparation process. This defect may be caused by improper operator operation or mechanical failure, such as the silicon wafer being placed in the wrong position or direction. Misaligned wafers will cause the performance of photovoltaic silicon wafers to decrease and reduce the efficiency of battery modules. Liquid inclusion: refers to the presence of liquid or moisture on the silicon wafer. This defect may be caused by improper removal of moisture during material preparation or packaging. Liquid inclusion will affect the performance of photovoltaic silicon wafers, may cause the efficiency of battery modules to decrease or fail completely, and may accelerate the aging and damage of silicon wafers.
[0058] The defect detection model is an optimized YOLOv8s model, which includes a backbone network, a feature fusion network, and a detection module.
[0059] The backbone network includes the first feature layer, the second feature layer, the third feature layer and the fourth feature layer connected in sequence. The first feature layer is used to convert the blanking flower basket image into the initial feature map; the second feature layer is used to convert the initial feature map into the first feature map; the third feature layer is used to convert the first feature map into the second feature map; the fourth feature layer is used to convert the second feature map into the third feature map; the second and third feature layers include the CBAM attention module, which is mainly used to capture important information in the input sequence and ignore unimportant information to improve the detection performance and generalization ability of the model.
[0060] Specifically, the backbone network includes a Conv_1 module, a Conv_2 module, a C2f_1 module, a CBAM_1 module, a Conv_3 module, a C2f_2 module, a CBAM_2 module, a Conv_4 module, a C2f_3 module, a CBAM_3 module, a Conv_5 module, a C2f_4 module, a CBAM_4 module, and an SPPF module, which are connected in sequence.
[0061] Conv_1 constitutes the first feature layer P0, which is used to convert the blanking flower basket image into the initial feature map S0; Conv_2 module, C2f_1 module, CBAM_1 module, Conv_3 module, C2f_2 module, CBAM_2 module constitute the second feature layer, which is used to convert the initial feature map S0 into the first feature map S1; Conv_4 module, C2f_3 module, CBAM_3 module constitute the third feature layer, which is used to convert the first feature map S1 into the second feature map S2; Conv_5 module, C2f_4 module, CBAM_4 module, SPPF module constitute the fourth feature layer, which is used to convert the second feature map S2 into the third feature map S3. The size of the initial feature map S0 is [160, 160, 32], the size of the first feature map S1 is [80, 80, 64], the size of the second feature map S2 is [40, 40, 128], and the size of the third feature map S3 is [80, 80, 256].
[0062] Among the modules of the backbone network, the Conv module is a basic module commonly used in convolutional neural networks, which is mainly composed of convolutional layers, BN layers and activation functions. The convolutional layer is used to extract local spatial information from the input features, the BN layer is used to normalize the distribution of eigenvalues in the neural network, and the activation function is used to introduce nonlinear transformation capabilities to the neural network.
[0063] The main function of the C2f module is to increase the depth and receptive field of the network. Using the residual connection gradient flow can more effectively extract feature information in the image.
[0064] The SPPF module is a spatial pyramid pooling module that is used to process and reasonably utilize the feature maps extracted by the network to generate multi-scale feature maps suitable for detection tasks, which can further improve the detection performance.
[0065] The CBAM module is a lightweight convolutional attention module that combines channel and spatial attention mechanisms to adaptively refine intermediate feature maps, effectively helping information to pass through the network by learning to strengthen or suppress relevant feature information. Its main function is to improve the performance of the model, enabling the model to better understand and utilize information in the image, thereby obtaining more accurate results.
[0066] The feature fusion network adopts the PAN-FPN structure, adds a bottom-up pyramid behind the FPN module, introduces the path aggregation method, fuses the shallow low-resolution but weak semantic information features with the deep high-resolution but rich semantic information features, and transmits the feature information along a specific path, and transmits the strong positioning features of the low layer. By designing feature maps of different scales, it can better adapt to target detection tasks of different sizes. Among them, the feature fusion network for optimizing the YOLOv8s model includes the first fusion layer, the second fusion layer, and the third fusion layer. The first fusion layer is used to upsample the third feature map and fuse it with the second feature map to obtain the fifth feature map S5. The second fusion layer is used to extract and upsample the fifth feature map, and fuse it with the first feature map to obtain the fourth feature map S4. The third fusion layer is used to fuse the fourth feature map S4, the fifth feature map S5, and the third feature map S3 to obtain the sixth feature map S6. The size of the fourth feature map S4 is [80, 80, 64], the size of the fifth feature map S5 is [40, 40, 128], and the size of the sixth feature map S6 is [20, 20, 256], which are used to fuse feature information of different levels in the backbone network.
[0067] The detection module includes three decoupling heads, which are used to obtain corresponding detection result feature maps according to the fourth feature map S4, the fifth feature map S5 and the sixth feature map S6. The detection result feature maps are used to represent the defect type of the silicon wafer in the blanking basket image, and the coordinates and sizes of the defect position of the silicon wafer in the blanking basket image.
[0068] The above-mentioned photovoltaic silicon wafer defect detection method trains the defect detection model through the target image set to obtain a trained defect detection model; the target image set includes a blanking basket image with defect positions and defect types marked; the blanking basket image to be detected is input into the trained defect detection model to obtain the defect position and defect type of the silicon wafer in the blanking basket image to be detected. The defect types include missing wafers, fragments, misaligned wafers and liquid defects of silicon wafers. Among them, the defect detection model is an optimized YOLOv8s model, and the optimized YOLOv8s model includes a backbone network, a feature fusion network and a detection module. The optimized YOLOv8s model is used for defect detection, which does not rely on experienced personnel to try multiple experiments to determine the threshold, and the performance and generalization ability of the model are improved through the CBAM attention module, which further improves the accuracy of detection.
[0069] In an exemplary embodiment, Figure 2 As shown, before training the defect detection model with the target image set, the method further includes the following steps 202 to 206. Among them:
[0070] Step 202, obtaining an original data set consisting of blanking flower basket images.
[0071] Among them, the unloading basket images that constitute the original data set are multiple images of unloading baskets loaded with photovoltaic silicon wafers captured by industrial cameras.
[0072] Step 204 , performing graphic segmentation on each blanking flower basket image in the original data set to obtain a plurality of target images.
[0073] Specifically, a sliding segmentation method is used to perform graphic segmentation on each blanking flower basket image to obtain multiple target images of the same size.
[0074] Step 206 , marking the defect positions and defect types of the silicon wafers for the multiple target images to obtain a target image set.
[0075] Specifically, the location and type of the defect are annotated by a data annotation tool, the annotated target images are classified and saved, and a training data set, a test data set, and a verification data set of the defect detection model are obtained from the target images as a target image set.
[0076] In this embodiment, an original data set consisting of blanking basket images is obtained; each blanking basket image in the original data set is segmented to obtain multiple target images; the defect positions and defect types of silicon wafers are annotated on the multiple target images to obtain a target image set. By performing graphic segmentation on the blanking basket images, target images suitable for model training can be obtained, thereby improving the accuracy of the defect detection model.
[0077] In an exemplary embodiment, Figure 3 As shown, the target image set includes a test data set, a training data set and a verification data set, and the target image obtained by segmentation is annotated with the defect position and defect type of the silicon wafer to obtain the target image set, which specifically includes the following steps 302 to 308. Among them:
[0078] Step 302: Using the data labeling tool Labelmg, the target image is labeled with a corresponding defect location label according to the defect location, and a corresponding defect type label according to the defect type.
[0079] Specifically, a labeling anchor box is generated through the data labeling tool Labelmg, and each defect position and its corresponding defect type in the target image are labeled. The coordinates of the center point of the labeling anchor box, as well as the width and height of the labeling anchor box are used as the defect position label, and the preset defect type number is used as the corresponding defect type label.
[0080] The preset defect type numbers correspond to the pre-stored defect types one by one. In this embodiment, the pre-stored defect types include missing wafers, fragments, misaligned wafers and liquid defects of silicon wafers.
[0081] Step 304: store the target images corresponding to the defect type labels into multiple folders.
[0082] Specifically, for the target images corresponding to each defect type label, folders named as defect types are respectively established, each target image is stored in the corresponding folder, and the number of target images corresponding to each defect type label is counted.
[0083] Step 306: randomly extract a preset proportion of target images from each folder as a training data set.
[0084] Specifically, the number of target images in each folder is counted, and 20% of the target images are randomly selected from each folder as a training data set.
[0085] Step 308: extract the remaining target images in each folder, and obtain a test data set and a verification data set based on the remaining target images.
[0086] Specifically, the remaining target images in each folder are quantized to obtain target images with uniform sizes; and the test data set and the verification data set are determined based on the target images with uniform sizes.
[0087] Exemplarily, an image processing library (such as OpenCV, PIL, etc.) is used to load the target image and adjust it to the target size. The image size can be adjusted by cropping, scaling, or padding. For each target image of uniform size, 50% of them are set as the test data set, and the remaining 50% are set as the validation data set.
[0088] In this embodiment, the target image is marked with corresponding defect location labels according to the defect location, and corresponding defect type labels according to the defect type by using the data annotation tool Labelmg; the target images corresponding to each of the defect type labels are stored in multiple folders; a preset proportion of target images are randomly extracted from each of the folders as a training data set; the remaining target images in each of the folders are extracted, and a test data set and a verification data set are obtained based on the remaining target images. By annotating the location and defect type of silicon wafer defects in the target image, the model can learn the correct representation of silicon wafer defect location and defect type, so that similar silicon wafer defect targets can be accurately detected and identified. And by annotating the location and defect type of silicon wafer defects in the target image, the performance of the defect detection model can be evaluated with the annotated target image, and the accuracy, recall rate and other indicators of the model can be calculated to evaluate the detection capability of the model and the accuracy of defect type recognition.
[0089] In an exemplary embodiment, Figure 4 As shown, the defect detection model is trained by the target image set to obtain a trained defect detection model, which specifically includes the following steps 402 to 408. Among them:
[0090] Step 402, initializing the training parameters of the defect detection model.
[0091] Specifically, all weight values, bias values, and batch normalization scale factor values of the defect detection model are initialized, the initial learning rate of the defect detection model is set to 0.0005, and the size of the blanking basket image input to the defect detection model is 640*640.
[0092] Step 404: input the training data set into the defect detection model to obtain the defect detection result of the training data set.
[0093] The defect detection result is obtained by decoding the detection result feature map, including the defect position and defect type of the silicon wafer in each target image.
[0094] Step 406 , calculating the loss function of the defect detection model according to the defect detection results and the defect type labels of the training data set.
[0095] Specifically, the defect type in the defect detection result is compared with the defect type label in the training data set, and the loss function of the defect detection model is calculated.
[0096] Among them, the loss function of the defect detection model includes the category classification loss function and the bounding box regression loss function:
[0097] The category classification loss function uses cross entropy loss, as shown in the following formula (1):
[0098]
[0099] Where N is the number of images, C is the number of categories, and y n,c is the cth value of the defect type label of target image n, p n,c It is the value of the cth defect type in the defect detection result output by the defect detection model of the target image.
[0100] The bounding box regression loss function consists of two parts: DFL Loss and CIOU Loss. The calculation formula of DFL Loss is shown in the following formula (2):
[0101] DFL(S i , S i+1 )=-((y i+1 -y)log(S i )+(yy i )log(S i+1 )) (2)
[0102] In the form of cross entropy, the probability of the two positions closest to the y coordinate y of the center point of the anchor box marked in the defect position label is optimized, so that the network can focus on the distribution of the neighboring area of the target position more quickly. i Indicates defect detection results.
[0103] The calculation formula of CIOU Loss is shown in the following formulas (3)-(5):
[0104]
[0105]
[0106] Where IOU represents the intersection-over-union ratio between the defect detection result and the labeled anchor box, x,y are the coordinates of the center point of the defect detection result, and x gt ,y gt is the center point coordinate of the annotation anchor box, W g and H g is the width and height of the minimum rectangular box formed by the defect detection result and the labeled anchor box, α is a hyperparameter, w and h are the width and height of the defect detection result respectively. v represents the GIoU value between the two bounding boxes, that is, the generalized intersection-over-union ratio. W gt and h gt Indicates the width and height of the annotation anchor box.
[0107] Step 408, updating the training parameters of the defect detection model according to the calculation result of the loss function to obtain a trained defect detection model.
[0108] Specifically, the calculation results of the loss function are used to update the weights of the defect detection model through back propagation and gradient descent algorithms.
[0109] In this embodiment, the training parameters of the defect detection model are initialized; the training data set is input into the defect detection model to obtain the defect detection results of the training data set; the loss function of the defect detection model is calculated according to the defect detection results and the defect type labels of the training data set; according to the calculation result of the loss function, the training parameters of the defect detection model are updated to obtain a trained defect detection model. The YOLOv8s model is trained with the target image set to obtain a trained defect detection model, and the trained defect detection model is used to perform defect detection on the blanking flower basket image, which can improve the accuracy of the detection method.
[0110] In an exemplary embodiment, the defect detection model is trained by a target image set to obtain a trained defect detection model, and the hyperparameters of the trained defect detection model are adjusted by a validation data set; and the performance of the trained defect detection model is evaluated by a test data set.
[0111] The validation set helps the defect detection model select the best model parameters, avoid overfitting, and determine when to terminate training. The test set is used to ultimately evaluate the generalization ability of the defect detection model. After the defect detection model is trained and validated, the test set is used to evaluate the performance of the defect detection model in actual use.
[0112] like Figure 5 As shown, Figure 5 The following is a schematic diagram of the results of the defect detection model of the present application detecting the defect type and defect position of the silicon wafer in the blanking basket image in an embodiment. According to the output of the defect detection model, the defect types of missing wafers, fragments, misaligned wafers and liquid-carrying wafers and the corresponding defect positions are determined respectively. As shown in Table 1 below, the detection performance comparison between the defect detection model of the present application and YOLOV8s without the CBAM attention module is shown.
[0113] Table 1 Comparison of detection performance between the defect detection model of this application and the YOLOV8s model
[0114]
[0115] It can be seen from Table 1 that when the defect detection model in this application detects the defect type and defect position of the silicon wafer in the blanking basket, the optimized YOLOv8s model in this application can improve the overall detection accuracy compared with the YOLOv8s model that does not include the CBAM attention module in the backbone network.
[0116] Compared with the existing YOLOv8s model, the optimized YOLOv8s model of this application has the following advantages for defect detection:
[0117] 1. Traditional grayscale threshold detection relies on experienced personnel to conduct multiple experiments to determine the threshold, which is insufficient in adaptability. The photovoltaic silicon wafer defect detection method in this application is based on deep learning, which can automatically learn the features of the blanking basket image and reduce a lot of experimental time.
[0118] 2. Compared with traditional detection, it can reduce the interference caused by light source changes and silicon wafer line marks, improve detection accuracy, and learn the highly abstract features of data through layers of abstraction, which makes it less dependent on input, more robust to structural and surface changes, and can cope with complex scenes. Therefore, it has better adaptability than traditional detection methods.
[0119] 3. Deep learning has powerful representation capabilities and can fit complex nonlinear relationships. This gives it stronger generalization capabilities in solving practical problems and can capture the multi-level features and structures of data.
[0120] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0121] Based on the same inventive concept, the embodiment of the present application also provides a photovoltaic silicon wafer defect detection device for implementing the photovoltaic silicon wafer defect detection method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more photovoltaic silicon wafer defect detection device embodiments provided below can refer to the limitations of the photovoltaic silicon wafer defect detection method above, and will not be repeated here.
[0122] In an exemplary embodiment, Figure 6 As shown, a photovoltaic silicon wafer defect detection device 600 is provided, including a model training module 601 and a defect detection module 602, wherein:
[0123] The model training module 601 is used to train the defect detection model through the target image set to obtain a trained defect detection model.
[0124] The target image set includes images of blanking baskets with defect locations and defect types marked.
[0125] The defect detection module 602 is used to input the blanking basket image to be detected into the trained defect detection model to obtain the defect position and defect type of the silicon wafer in the blanking basket image to be detected.
[0126] Among them, defect types include missing silicon wafers, fragments, misaligned wafers and liquid defects.
[0127] The defect detection model is an optimized YOLOv8s model, which includes a backbone network, a feature fusion network, and a detection module.
[0128] The backbone network includes a first feature layer, a second feature layer, a third feature layer and a fourth feature layer connected in sequence. The first feature layer is used to convert the blanking flower basket image into an initial feature map; the second feature layer is used to convert the initial feature map into a first feature map; the third feature layer is used to convert the first feature map into a second feature map; the fourth feature layer is used to convert the second feature map into a third feature map; the second feature layer and the third feature layer include a CBAM attention module.
[0129] The feature fusion network includes a first fusion layer, a second fusion layer and a third fusion layer. The first fusion layer is used to upsample the third feature map and fuse it with the second feature map to obtain the fifth feature map; the second fusion layer is used to extract features and upsample the fifth feature map and fuse it with the first feature map to obtain the fourth feature map; the third fusion layer is used to fuse the fourth feature map, the fifth feature map and the third feature map to obtain the sixth feature map.
[0130] The detection module includes three decoupling heads, which are used to obtain corresponding detection result feature maps according to the fourth feature map, the fifth feature map and the sixth feature map. The detection result feature maps are used to represent the defect type of the silicon wafer in the blanking basket image, and the coordinates and sizes of the defect position of the silicon wafer.
[0131] The photovoltaic silicon wafer defect detection device 600 in this embodiment trains the defect detection model through the target image set to obtain a trained defect detection model; the target image set includes a blanking basket image with defect positions and defect types marked; the blanking basket image to be detected is input into the trained defect detection model to obtain the defect position and defect type of the silicon wafer in the blanking basket image to be detected. The defect types include missing wafers, fragments, misaligned wafers and liquid defects of silicon wafers. Among them, the defect detection model is an optimized YOLOv8s model, and the optimized YOLOv8s model includes a backbone network, a feature fusion network and a detection module. The optimized YOLOv8s model is used for defect detection, which does not rely on experienced personnel to try multiple experiments to determine the threshold, and the performance and generalization ability of the model are improved through the CBAM attention module, which further improves the accuracy of detection.
[0132] In an exemplary embodiment, the model training module 601 is also used to obtain an original data set consisting of blank flower basket images;
[0133] Performing graphic segmentation on each of the blanking flower basket images in the original data set to obtain a plurality of target images;
[0134] The defect positions and defect types of the silicon wafers are marked on the plurality of target images to obtain a target image set.
[0135] In an exemplary embodiment, the model training module 601 is further used to mark the target image with corresponding defect location labels according to the defect location and mark the corresponding defect type labels according to the defect type through the data labeling tool Labelmg;
[0136] Storing target images corresponding to each of the defect type labels into multiple folders;
[0137] Randomly extracting a preset proportion of target images from each of the folders as a training data set;
[0138] The remaining target images in each of the folders are extracted, and a test data set and a verification data set are obtained according to the remaining target images.
[0139] In an exemplary embodiment, the model training module 601 is further used to perform size quantization processing on the target images remaining in each of the folders to obtain target images with uniform sizes;
[0140] A test data set and a validation data set are determined according to the target images with uniform sizes.
[0141] In an exemplary embodiment, the model training module 601 is also used to initialize the training parameters of the defect detection model;
[0142] Inputting the training data set into the defect detection model to obtain a defect detection result of the training data set;
[0143] Calculating a loss function of a defect detection model based on the defect detection results and defect type labels of a training data set;
[0144] According to the calculation result of the loss function, the training parameters of the defect detection model are updated to obtain a trained defect detection model.
[0145] In an exemplary embodiment, the model training module 601 is further used to adjust the hyperparameters of the trained defect detection model through the validation data set;
[0146] The performance of the trained defect detection model is evaluated using the test data set.
[0147] Each module in the photovoltaic silicon wafer defect detection device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0148] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Figure 7 As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a method for detecting defects in photovoltaic silicon wafers is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0149] Those skilled in the art will understand that Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0150] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.
[0151] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0152] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0153] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0154] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0155] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be construed as limiting the scope of the present application. It should be noted that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A photovoltaic silicon wafer defect detection method, characterized in that: A material basket for loading photovoltaic silicon wafers, the method comprising: The defect detection model is trained by a target image set to obtain a trained defect detection model; the target image set includes a blanking basket image with defect locations and defect types marked; Inputting the unloading basket image to be detected into the trained defect detection model to obtain the defect position and defect type of the silicon wafer in the unloading basket image to be detected; the defect type includes missing wafer, fragment, misaligned wafer and liquid-carrying defect of the silicon wafer; Wherein, the defect detection model is an optimized YOLOv8s model, and the optimized YOLOv8s model includes a backbone network, a feature fusion network and a detection module; The backbone network includes a first feature layer, a second feature layer, a third feature layer and a fourth feature layer connected in sequence; the first feature layer is used to convert the blanking flower basket image into an initial feature map; the second feature layer is used to convert the initial feature map into a first feature map; the third feature layer is used to convert the first feature map into a second feature map; the fourth feature layer is used to convert the second feature map into a third feature map; the second feature layer and the third feature layer include a CBAM attention module; The feature fusion network includes a first fusion layer, a second fusion layer and a third fusion layer; the first fusion layer is used to upsample the third feature map and fuse it with the second feature map to obtain a fifth feature map; the second fusion layer is used to extract features and upsample the fifth feature map and fuse it with the first feature map to obtain a fourth feature map; the third fusion layer is used to fuse the fourth feature map, the fifth feature map and the third feature map to obtain a sixth feature map; The detection module includes three decoupling heads, which are used to obtain corresponding detection result feature maps according to the fourth feature map, the fifth feature map and the sixth feature map; the detection result feature maps are used to represent the defect types of silicon wafers in the blanking basket image, and the coordinates and sizes of the defect positions of the silicon wafers.
2. The method according to claim 1, characterized in that Before training the defect detection model using the target image set, the method further includes: Obtain the original data set consisting of the images of the cutting flower basket; Performing graphic segmentation on each of the blanking flower basket images in the original data set to obtain a plurality of target images; The defect positions and defect types of the silicon wafers are marked on the plurality of target images to obtain a target image set.
3. The method according to claim 2, characterized in that The target image set includes a test data set, a training data set, and a verification data set. The defect positions and defect types of the silicon wafers are marked on the plurality of target images to obtain the target image set, including: Use the data annotation tool Labelmg to label the target image with the corresponding defect location label according to the defect location, and label the corresponding defect type label according to the defect type; Storing target images corresponding to each of the defect type labels into multiple folders; Randomly extracting a preset proportion of target images from each of the folders as a training data set; The remaining target images in each of the folders are extracted, and a test data set and a verification data set are obtained according to the remaining target images.
4. The method according to claim 3, characterized in that The step of obtaining a test data set and a verification data set according to the remaining target images comprises: Performing size quantization processing on the target images remaining in each of the folders to obtain target images with uniform sizes; A test data set and a validation data set are determined according to the target images with uniform sizes.
5. The method according to claim 4, characterized in that The defect detection model is trained by the target image set to obtain a trained defect detection model, including: Initialize the training parameters of the defect detection model; Inputting the training data set into the defect detection model to obtain a defect detection result of the training data set; Calculating a loss function of a defect detection model based on the defect detection results and defect type labels of a training data set; According to the calculation result of the loss function, the training parameters of the defect detection model are updated to obtain a trained defect detection model.
6. The method according to claim 5, characterized in that The step of training the defect detection model by using the target image set to obtain a trained defect detection model further includes: Adjusting the hyperparameters of the trained defect detection model using the validation data set; The performance of the trained defect detection model is evaluated using the test data set.
7. A photovoltaic silicon wafer defect detection device, characterized in that: The device comprises: A model training module is used to train the defect detection model through a target image set to obtain a trained defect detection model; the target image set includes a blanking basket image with defect locations and defect types marked; A defect detection module is used to input the image of the blanking basket to be detected into the trained defect detection model to obtain the defect position and defect type of the silicon wafer in the image of the blanking basket to be detected; the defect type includes missing wafers, fragments, misaligned wafers and liquid defects of the silicon wafers; Wherein, the defect detection model is an optimized YOLOv8s model, and the optimized YOLOv8s model includes a backbone network, a feature fusion network and a detection module; The backbone network includes a first feature layer, a second feature layer, a third feature layer and a fourth feature layer connected in sequence; the first feature layer is used to convert the blanking flower basket image into an initial feature map; the second feature layer is used to convert the initial feature map into a first feature map; the third feature layer is used to convert the first feature map into a second feature map; the fourth feature layer is used to convert the second feature map into a third feature map; the second feature layer and the third feature layer include a CBAM attention module; The feature fusion network includes a first fusion layer, a second fusion layer and a third fusion layer; the first fusion layer is used to upsample the third feature map and fuse it with the second feature map to obtain a fifth feature map; the second fusion layer is used to extract features and upsample the fifth feature map and fuse it with the first feature map to obtain a fourth feature map; the third fusion layer is used to fuse the fourth feature map, the fifth feature map and the third feature map to obtain a sixth feature map; The detection module includes three decoupling heads, which are used to obtain corresponding detection result feature maps according to the fourth feature map, the fifth feature map and the sixth feature map; the detection result feature maps are used to represent the defect types of silicon wafers in the blanking basket image, and the coordinates and sizes of the defect positions of the silicon wafers.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Highway fast detection image pavement disease detection method based on deep fusion convolutional neural network
CN117197084A
Polarization image road target detection method based on YOLOv8 improvement
CN117351448A
Wafer surface defect detection method based on YOLOv8 improvement
CN117422700A
Underwater target detection method
CN117876856A
On-line defect identification system for battery piece in flower basket
CN118032803A