Method for constructing improved defect detection model, defect detection method and system
By improving the defect detection model of the YOLOv8s model, the cross-scale convolution feature fusion module and the adaptive multi-scale feature extraction module, combined with the WIoUv3 loss function, the problem of inability to accurately detect multi-scale defects in the existing technology is solved, and the high accuracy and efficiency of surface defect detection of high-density interconnected printed circuit boards is achieved.
Patent Information
- Application Number
- CN202411982576.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-04-18
AI Technical Summary
Defect detection of existing high-density interconnected printed circuit boards relies on automatic optical detection, and cannot accurately detect multi-scale defects in real time.
The defect detection model based on the improved YOLOv8s model is adopted, and the neck network structure of the object detection model is improved through the cross-scale convolutional feature fusion module (CCFM), and the C2f module is replaced with the adaptive multi-scale feature extraction (AMFE) module, and the WIoUv3 loss function is used to improve the accuracy of defect detection.
The improved defect detection model can effectively improve the accuracy of printed circuit board defect detection, especially in the surface defect detection of high-density interconnected printed circuit boards, improving the accuracy and efficiency of detection.
Smart Images

Figure CN119850579A_ABST
Abstract
Description
Technical Field
[0001] The specification discloses a defect detection model, and in particular refers to a method for constructing an improved defect detection model using a deep learning method and target detection technology, and a method and system for performing defect detection using a defect detection model. Background Art
[0002] Printed circuit boards (PCBs) are important electronic components that facilitate electrical connections of electronic components, and high-density interconnect printed circuit boards (HDI-PCBs) are an important part of this technology. It is known that the surface of a high-density interconnect printed circuit board consists only of copper wires for conductive circuits and insulating areas for isolating circuits. In order to ensure the quality of this printed circuit board product and prevent surface damage caused by production line problems from affecting the performance of electronic devices, surface defect detection is a key process in the production of high-density interconnect printed circuit boards.
[0003] Existing defect detection of high-density interconnected printed circuit boards has long relied on automated optical inspection (AOI). However, existing automated optical inspection methods rely on pre-designed defect standards. Without pre-defined defect standards, defects cannot be detected. Therefore, real-time and accurate detection of multi-scale defects remains an unresolved problem. Summary of the invention
[0004] In view of the fact that the prior art lacks a solution for real-time and accurate detection of multi-scale defects in printed circuit boards, the public book proposes a method for constructing an improved defect detection model, a defect detection method and a system, among which is a method for improving the defect detection model based on an improved specific object detection model (such as a YOLOv8s model). It is concluded that the improved defect detection model can effectively improve the accuracy of printed circuit board defect detection, and can particularly enhance the surface defect detection capability of a high-density interconnect printed circuit board (HDI-PCB).
[0005] In the method of constructing an improved defect detection model, multiple surface images generated by photographing a printed circuit board are first obtained, and then the defects of each surface image are annotated to generate a defect image data set. Then, a cross-scale convolutional feature fusion module (CCFM) is used to improve the structure of the neck network of the object detection model, and then the last C2f module in the object detection model is replaced with an adaptive multi-scale feature extraction (AMFE) module, and the original loss function of the object detection model is replaced with a WIoUv3 loss function, so that the WIoUv3 loss function can be used to obtain an improved defect detection model. Finally, the defect image data set can be used to train and test the improved defect detection model.
[0006] The method for constructing an improved defect detection model as claimed in claim 1, wherein after taking a plurality of surface images of the one or more printed circuit boards, the plurality of surface images are enhanced by preprocessing, wherein each surface image is segmented into a plurality of blocks according to a specific pixel threshold, and then noise is added, brightness, sharpness is randomly changed, and / or flipped one by one or one block at a time.
[0007] Furthermore, the neck network structure of the object detection model is improved based on the cross-scale convolutional feature fusion module by performing a 1×1 convolution operation on the shallow feature map in the backbone of the object detection model to extract shallow multi-scale feature information.
[0008] Furthermore, a weighted technique may be used to upsample the shallow feature map and combine it with the deep feature map in the neck network to enhance the feature representation of the neck network.
[0009] Furthermore, the adaptive multi-scale feature extraction module replaces the 1×1 convolution in the neck of the C2f module with a deformable convolutional network (DCNv3), and then adds a multi-scale attention module (MSAM) to the neck network splicing to construct an adaptive multi-scale feature extraction module.
[0010] According to one embodiment, the object detection model may be a YOLOv8s model, and the YOLOv8s model is used as a reference model, and an improved defect detection model is constructed by constructing an improved defect detection model based on the YOLOv8s model. In addition, the improved defect detection model can be used to detect surface defects of a high-density interconnected printed circuit board.
[0011] According to the disclosed defect detection system, it includes a computer host, and the software running therein controls the illumination light source controller, the illumination light source, the line scanning camera and the lens. The computer host executes the method of constructing the improved defect detection model through a processor.
[0012] In the defect detection method, the improved defect detection model obtained by the method for constructing the improved defect detection model is used to detect surface defects of a high-density interconnected printed circuit board.
[0013] To further understand the features and technical contents of the present invention, please refer to the following detailed description and drawings of the present invention. However, the drawings provided are only for reference and description and are not intended to limit the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] Figure 1 A diagram showing an example of a setup for a defect detection system;
[0015] Figure 2A flow chart showing an embodiment of a method for constructing an improved defect detection model;
[0016] Figure 3 A flow chart showing an embodiment of constructing an AMFE module that replaces a C2f module;
[0017] Figure 4 A diagram showing an embodiment of a deformable convolutional network;
[0018] Figure 5 A flowchart showing an embodiment of the operation of a multi-scale attention module; and
[0019] Figure 6 A flow chart showing an embodiment of training a defect detection model. DETAILED DESCRIPTION
[0020] The public book proposes a method for constructing an improved defect detection model, a defect detection method and a system. According to an embodiment, the method for constructing an improved defect detection model involves a defect detection algorithm based on an improved specific object detection model (such as a YOLOv8s model). The implementation method can propose an algorithm for improving the defect detection model for a high-density interconnect printed circuit board (hereinafter referred to as HDI-PCB).
[0021] Figure 1 A diagram showing an example of a setup for a defect detection system.
[0022] The main components of the defect detection system include a computer host 11 for running the method for constructing an improved defect detection model and the defect detection method, which is provided with electronic components such as a processor and memory for executing relevant software programs, and other electronic devices are controlled by running software in the computer host 11. This example shows that the computer host is electrically connected to an illumination light source controller 12, a line scan camera (such as an 8K line scan camera) 13, a lens 14, an illumination light source 15, a printed circuit board production line 16, a printed circuit board production line observation window 17, and a printed circuit board 18 to be inspected on the production line through various connections.
[0023] When running the method for constructing an improved defect detection model and the method for performing defect detection using a defect detection model, the software-controlled lighting source controller 12 running in the computer host 11 drives the lighting source 15 to turn on and illuminate the printed circuit board 18 on the printed circuit board production line 16, and controls the line scan camera 13 to capture the surface image of the printed circuit board 18 through the lens 14. For the purpose of generating a printed circuit board defect image data set, one or more printed circuit boards can be captured to obtain an image data set. In the stage of training the defect detection model, defect images of the surface of the relevant printed circuit board 18 are collected, and in the defect detection stage, defect detection is performed on the surface image of the printed circuit board 18 obtained by the capture through the defect detection model.
[0024] According to the method of running the improved defect detection model and its efficacy, according to an embodiment, the method can be applied to the surface detection of the HDI-PCB, wherein a defect detection algorithm based on an improved specific object detection model (such as a YOLOv8s model) is adopted, and the resulting defect detection model can improve the accuracy of surface defect detection of the printed circuit board.
[0025] For reference Figure 2 A process diagram showing an embodiment of a method for constructing an improved defect detection model, Figure 3 A flow chart of an embodiment of training an improved defect detection model is shown.
[0026] Through the above system configuration, a software-controlled line scan camera running in a computer host captures a large number of printed circuit board images (step S201). In one configuration example, Figure 1 The illustrated setting example of the printed circuit board defect detection system is that the illumination light source controller 12 and the line scan camera 13 are arranged on the printed circuit board production line observation window 17, and the line scan camera 13 is used to collect the surface defect image of the printed circuit board 18 placed on the production line.
[0027] Next, the image is exported to a computer host, and after the computer host obtains the image, it is pre-processed to enhance the image effect (step S203). According to an embodiment, during the pre-processing process, each surface image (which can be divided into multiple blocks) can be divided into multiple blocks according to a specific pixel threshold, for example, divided into 9 blocks, and then the data enhancement effect is achieved by adding noise, randomly changing brightness, sharpness and / or flipping one by one or one by one.
[0028] Then, the pre-processed images are defect labeled (step S205), wherein a labeling tool is used to label the defective images of the printed circuit board to generate a printed circuit board defective image dataset, and data labels are generated during labeling, which can be stored in a specific format for subsequent training processes. Afterwards, the printed circuit board defective image dataset can be divided into a training set (training data) for training the defect detection model to obtain model parameters, a validation set (validation data) for evaluating the model performance to adjust the parameters, and finally a test set (testing data) for testing the model capability according to the ratio set by the system (e.g., 7:2:1) (step S207).
[0029] In order to construct a defect detection model based on an improved specific object detection model (such as a YOLOv8s model), the improvement utilizes a cross-scale convolutional feature fusion module (hereinafter referred to as CCFM) that can fuse images of different resolutions across scales to improve the neck network structure of the object detection model, which can enhance the detection capability of the defect detection model for images of different scales and obtain a feature map with richer information (step S209).
[0030] According to an embodiment, for the above step S209, the process of improving the neck network structure of the object detection model based on CCFM is to perform a 1×1 convolutional operation on the shallow feature map in the backbone of the object detection model, including a convolution part and a pooling part, to extract shallow multi-scale feature information. Then, the feature map is upsampled using a weighted technique and combined with the deep feature map in the neck network, thereby enhancing the feature representation of the neck network, obtaining more comprehensive information, and significantly reducing the amount of calculation.
[0031] According to an embodiment, the object detection model is such as a YOLOv8s model, which includes a C2f module that allows the YOLOv8s model to obtain richer information while ensuring lightweight. The function of the C2f module is to fuse feature maps of different scales to improve the accuracy of target detection. According to an embodiment, in the method for obtaining an improved defect detection model, the last C2f module in the object detection model can be replaced with an adaptive multiscale feature extraction (Adaptive Multiscale Feature Extraction, hereinafter referred to as AMFE) module (step S211), thereby enhancing the algorithm's ability to adaptively extract multi-scale defect features.
[0032] Furthermore, the AMFE module aims to increase the sampling weights of different sampling points, apply this weighted technology to upsample the obtained shallow feature map, and combine it with the deep feature map in the neck network, so as to enhance the feature representation of the neck network and obtain more comprehensive information, while significantly reducing the amount of calculation, so that the feature extraction capability of complex printed circuit board (such as HDI-PCB) defects is further improved on the basis of the original C2f.
[0033] Afterwards, the original loss function of the object detection model is replaced with the WIoU (Wise-IoU) v3 loss function (step S213). The WIoUv3 loss function uses dynamic non-monotonic frequency modulation (FM) to allocate different gradient gains at different stages of model training, so that the gradient gain allocation strategy that meets the current situation can be used at any time, thereby solving many negative effects in the shielding training process, solving the problem of small target ambiguity and improving the prediction frame accuracy. In this way, an improved lightweight multi-scale defect detection model for printed circuit boards is obtained using the WIoUv3 loss function (step S215).
[0034] The detection model trained through the above steps is an improved defect detection model obtained through optimization procedures such as improving the YOLOv8s neck network structure through cross-scale connections (CCFM), replacing the last C2f module in the YOLOv8s network with an AMFE module, and replacing the original loss function of YOLOv8s with a WIoUv3 loss function.
[0035] According to the embodiment, the YOLOv8s model is used as a benchmark model, and the above process is used to construct an improved defect detection model, that is, a lightweight multi-scale improvement is performed on the basis of YOLOv8s to obtain an improved model.
[0036] Further, in the method of constructing an improved defect detection model, an embodiment of implementing the AMFE module of replacing the last C2f module in the YOLOv8s network described in step S211 can be referred to Figure 3 Display the flowchart.
[0037] The AMFE module is specifically composed of replacing the 1×1 convolution in the neck network of the original C2f module with a deformable convolution network v3 (DCNv3), and then adding a multi-scale attention module (MSAM) that uses an interactive structure and attention mechanism to extract rich and multi-scale information to the neck network to construct the AMFE module.
[0038] In the process of constructing the AMFE module, the computer host obtains the image of the printed circuit board generated by the system, and obtains the feature vector through calculation. The feature vector first generates a feature map through the convolution module (step S301). Then, the feature map is split into two parts through the split layer (step S303) and constructed into a list (step S305). The last element in the list is used as input, and the feature is extracted through three series-connected neck deformable convolutional networks (Bottleneck-DCNv3). The extracted results can be appended to the list (step S307). The output of each neck deformable convolutional network is passed to the next neck deformable convolutional network in turn. Finally, all branches are spliced together using the connection function (step S309), and then the feature information is further extracted through the MSAM module. Finally, the number of channels is adjusted using the convolution module to realize the AMFE module (step S311).
[0039] Furthermore, in step S303 of splitting the feature map into two parts, the neck deformable convolutional network of the first part takes one of the branches as input, and the output of each neck deformable convolutional network is passed to the next neck deformable convolutional network as input. Finally, all branches are spliced through the connection function and then passed through the MSAM attention mechanism module to further extract feature information, and finally the convolution module is used to adjust the number of channels.
[0040] Furthermore, for the operation mode of the deformable convolutional network used in the above process, please refer to Figure 4 The embodiment shown in FIG.
[0041] First, preliminary features are extracted through basic convolution operations to form an input feature map 401, and then a small convolution network 403 is used to divide the input feature map 401 into multiple graphics according to the size of the convolution kernel. According to the example of the icon, it is shown that the small convolution network 403 offsets the multiple graphics divided by the input feature map 401 through an offset field 405 with a channel size of 2N to generate multiple offsets 407 as shown in the figure. In this way, the convolution kernel can learn the offsets in the x and y directions.
[0042] Afterwards, the deformed position corresponding to each pixel in the convolution kernel can be calculated based on the generated multiple offsets 407. This process adds the offset to the original position of each segmented small graphic. Then, a bilinear interpolation method is used to resample the input feature map 401 to obtain the features at the deformed position. The resampled features are fused with the basic convolution output, and finally, an activation function and normalization are used to obtain the processed output feature map 409.
[0043] Figure 5 Flowchart showing an example of running a Multi-Scale Attention Module (MSAM).
[0044] According to the image input by the system, the feature vector is obtained after operation, and the feature map of the given MSAM application is obtained (step S501), and the feature map is linearly projected (step S503) to obtain the corresponding query matrix Q, key matrix K and value matrix V. Then, the channels of the feature map are divided into multiple (such as n) different heads, and multi-scale sliding window dilated attention is performed on the heads with different expansion rates (step S505), that is, the key and value are sparsely selected in the sliding window centered on the query patch, and then self-attention is performed on these representative patches.
[0045] Next, the CONCAT function is used to combine the n different header contents (step S507). After linearization (step S509), average pooling (Avgpool) (step S511) and maximum pooling (Maxpool) (step S513) operations are applied to obtain representative information to reduce the amount of data. After the connection is completed through the convolution operation (step S515), a valid feature descriptor is generated, and the feature information is extracted and output (step S517).
[0046] The head in the MSAM can be defined as Equation 1, where It is The expansion rate of the head, and Represents the feature slice map input to the th head.
[0047] Equation 1:
[0048] .
[0049] The operation of applying average pooling and maximum pooling along the channel axis of the feature map can be defined as Equation 3:
[0050] .
[0051] The process of replacing the original loss function of YOLOv8 with the WIoUv3 loss function is described in Equation 4:
[0052] ;
[0053] ;
[0054] .
[0055] in, and Represents the coordinates of the center point of the real frame, , Represents the coordinates of the center point of the prediction box, Indicates the length difference between the predicted box and the real box, Indicates the height difference between the predicted box and the real box, represents the focusing factor, is a dynamic variable, and are model learning parameters, The degree of outliers is displayed to define the quality of the anchor frame.
[0056] So, through Figures 2 to 5 Describe the constructed improved defect detection model, then Figure 6 The flowchart of the embodiment of using defect image dataset to train and test the improved defect detection model is shown in the figure. In this example, the hardware conditions used for training the model are: i7-12345K CPU, ROG-STRIX-RTX4070TIS GPU, and the Pytorch deep learning framework is used to complete the experiment. The version of Pytorch is 2.3.1, the version of CUDA in the experiment is 12.1, the optimizer is Adam, the training rounds are 400, the number of threads is 12, the training batches are 32, and the learning rate is 1×10 -3.
[0057] according to Figure 6 In the process example shown, in the first stage, a training set obtained by using a defect image dataset in a specific ratio is used to obtain the defect image dataset. Figure 2 The improved defect detection model obtained by the process is trained (step S601). According to the embodiment, the training set is a feature vector obtained by calculating the defect image data set, which is submitted to the defect detection model, and the improved defect detection model is trained using a supervised machine learning algorithm to obtain the defect detection result of the model for the training set and compare the target defect. Therefore, the parameters of the defect detection model can be adjusted or reset according to the comparison result between the defect detection result and the target defect, and the defect detection result is generated again. In this way, the training iteration is performed to obtain the accuracy, recall rate and average precision value of the defect detection model. The training and parameter adjustment are repeatedly performed until the training results have achieved certain results.
[0058] In the second stage, the defect detection model obtained by supervised learning with the training set is used to verify the prediction results of the defect detection model using the verification set (step S603). The verification set is input into the defect detection model, and the verification parameters are set. After calculation, the result of predicting surface defects is obtained, and the floating-point operation number and the frame per second (FPS) of the operation process are obtained. The floating-point operation number and the frame per second of the operation process can be used to evaluate the instruction cycle of the defect detection model, thereby evaluating the performance of the defect detection model. In addition, it can also be evaluated according to the indicators set by the system, such as the accuracy of the model and the error score, so the optimal improved defect detection model can be selected according to the above various indicators.
[0059] In the third stage, the test set is input into the verified optimal improved defect detection model to obtain the surface defect detection result, and the performance of the model can be evaluated (step S605). One method of estimating the model is to compare the test threshold set by the system to evaluate the optimal defect detection model obtained through the above process, and the generalization error of the model can be used to evaluate the detection ability of the defect detection model for surface defect images obtained in the future.
[0060] According to one of the embodiments, the method for evaluating the model performance can use a meanAverage Precision (mAP) as an indicator to evaluate the performance of the defect detection model. When using the defect detection model to detect surface defect images, in addition to determining the categories of all defects in the printed circuit board surface image, the locations of the defects must also be determined.
[0061] Thus, when the defect detection model that passes the performance evaluation is obtained through the test set test (step S607), the defect detection model can be used to detect the surface defects of the printed circuit board and output a bounding box with the highest confidence, thereby completing the detection of the surface defects of the printed circuit board.
[0062] Table 1 shows the performance evaluation experimental results of using or not using various models and modules in the method of training the improved defect detection model. The evaluation indicators include accuracy, recall rate, average detection accuracy and floating-point operations, etc. The verification hyperparameters are set as follows: IoU is set to 0.5, the training batch is set to 1, and the floating-point operations of the main verification model are compared. The ablation experiment results are shown in Table 1.
[0063]
[0064] In this way, according to the disclosure, the improved defect detection model obtained and trained using the above-mentioned embodiments can perform defect detection on the surface image of a specific printed circuit board (such as HDI-PCB), including the surface image of the above-mentioned test set, that is, outputting the HDI-PCB surface defect detection image. The defect detection image may include defects of multiple defect types, and the location of each defect is marked after being processed by the defect detection model.
[0065] According to the above-described embodiment, an improved defect detection model is obtained by optimizing the YOLOv8s neck network structure through cross-scale connection (CCFM), replacing the last C2f module in the YOLOv8s network with an AMFE module, and replacing the original loss function of YOLOv8s with a WIoUv3 loss function. According to the relevant data after implementation, the average accuracy of surface defect prediction of HDI-PCB using the improved defect detection model is 89.6%, which is 2.3% higher than the mean average precision (mAP) of the benchmark model (YOLOv8s), and the number of floating-point operations (such as GFLOPS (gigaFLOPS) floating-point operations) is reduced by 19%. Therefore, in the application field (such as surface defect detection of HDI-PCB, online visual monitoring tasks of HDI-PCB manufacturing process), the detection efficiency can be improved, unqualified materials can be eliminated, the product scrap rate and rework rate caused by material quality problems can be reduced, the production cost can be reduced, and the product quality can be ensured.
[0066] In summary, according to the above description, a method for constructing an improved defect detection model, a defect detection method and system embodiment are described, wherein a printed circuit board defect detection algorithm based on an improved deep learning model (such as YOLOv8) is proposed, and the obtained improved defect detection model is used to detect surface defects of printed circuit boards (such as HDI-PCB), and effectively improves the accuracy of its defect detection, which helps to improve the surface defect detection capability of printed circuit boards. In addition, the method can be used to carry out research on printed circuit board defect classification detection based on deep learning and target detection technology, which helps to improve detection efficiency and promote the development of related printed circuit board defect automatic detection, which is of great significance to related manufacturing industries.
[0067] The contents disclosed above are only preferred feasible embodiments of the present invention, and are not intended to limit the scope of the present invention. Therefore, all equivalent technical changes made using the contents of the present invention's specification and drawings are included in the scope of the present invention.
Claims
1. A method for constructing an improved defect detection model, characterized in that The method includes: Acquire a plurality of surface images generated by photographing one or more printed circuit boards; After marking the defects of each surface image, a defect image data set is generated; A cross-scale convolutional feature fusion module CCFM is used to improve the structure of a neck network of an object detection model; The last C2f module in the object detection model is replaced by an adaptive multi-scale feature extraction AMFE module; An original loss function of the object detection model is replaced with a WIoUv3 loss function, wherein the WIoUv3 loss function adopts dynamic non-monotonic frequency modulation to allocate different gradient gains at different stages of model training; Using the WIoUv3 loss function to obtain an improved defect detection model; and The improved defect detection model is trained and tested with the defect image dataset.
2. The method for constructing an improved defect detection model according to claim 1, wherein: After capturing multiple surface images of the one or more printed circuit boards, the multiple surface images are pre-processed to enhance the image effect, wherein each surface image is divided into multiple blocks according to a specific pixel threshold, and then noise is added, brightness, sharpness and / or flipped one by one or block by block.
3. The method for constructing an improved defect detection model according to claim 1, wherein: The defect image data set is divided into a training set, a verification set and a test set according to a certain ratio, so as to train, verify and test the improved defect detection model.
4. The method for constructing an improved defect detection model according to claim 1, wherein: The structure of the neck network of the object detection model is improved based on the cross-scale convolutional feature fusion module by performing a 1×1 convolution operation on the shallow feature map in the backbone of the object detection model to extract shallow multi-scale feature information.
5. The method for constructing an improved defect detection model according to claim 4, characterized in that: The shallow feature map is upsampled using a weighted technique and combined with the deep feature map in the neck network to enhance the feature representation of the neck network.
6. The method for constructing an improved defect detection model as claimed in claim 1, characterized in that The adaptive multi-scale feature extraction module is constructed by replacing the 1×1 convolution in the neck of the C2f module with a deformable convolutional network DCNv3, and then adding a multi-scale attention module MSAM to the neck network splicing.
7. The method for constructing an improved defect detection model as claimed in claim 6, characterized in that The operation of the deformable convolutional network includes: Extract preliminary features using a basic convolution operation to form an input feature map; Using a small convolutional network to split the input feature map into multiple graphs according to the size of a convolution kernel; Offsetting the multiple graphics divided by the input feature map; Calculate the corresponding deformation position of each pixel in the convolution kernel according to the generated multiple offsets; A bilinear interpolation method is used to resample the input feature map to obtain features at the deformed position. The resampled features are fused with the basic convolution output, and an output feature map is obtained through a startup function and normalization.
8. The method for constructing an improved defect detection model as claimed in claim 6, characterized in that The operation of the multi-scale attention module includes: Given a feature map used by the multi-scale attention module; Linearly project the feature graph to obtain a corresponding query matrix, a key matrix and a value matrix; Dividing the channels of the feature map into a plurality of different heads; Perform multi-scale sliding window dilation attention in the head with different dilation rates; Next, a CONCAT function is used to combine the multiple different header contents; After linearization, average pooling and maximum pooling operations are applied; After convolution operation, the feature information is extracted and output.
9. The method for constructing an improved defect detection model according to any one of claims 1 to 8, characterized in that The object detection model is a YOLOv8s model. The YOLOv8s model is used as a benchmark model. The improved defect detection model is constructed by the method for constructing an improved defect detection model based on the YOLOv8s model.
10. The method for constructing an improved defect detection model as claimed in claim 9, characterized in that The improved defect detection model is used to detect surface defects of a high-density interconnected printed circuit board.
11. A defect detection system, characterized in that The system comprises: A computer host, wherein software running therein controls an illumination light source controller, an illumination light source, a line scan camera and a lens electrically connected to the computer host, wherein a method for constructing an improved defect detection model is executed by a processor in the computer host, comprising: Control the illumination light source controller to drive the illumination light source to illuminate one or more printed circuit boards arranged on a printed circuit board production line, and control the line scan camera to capture a surface image of the printed circuit board through the lens to collect the surface image of the printed circuit board; After marking the defects of each surface image, a defect image data set is generated; A cross-scale convolutional feature fusion module CCFM is used to improve the structure of a neck network of an object detection model; The last C2f module in the object detection model is replaced by an adaptive multi-scale feature extraction AMFE module; An original loss function of the object detection model is replaced with a WIoUv3 loss function, wherein the WIoUv3 loss function adopts dynamic non-monotonic frequency modulation to allocate different gradient gains at different stages of model training; Using the WIoUv3 loss function to obtain an improved defect detection model; and The improved defect detection model is trained and tested with the defect image dataset.
12. The defect detection system according to claim 11, characterized in that: After capturing multiple surface images of the one or more printed circuit boards, the multiple surface images are pre-processed to enhance the image effect, wherein each surface image is divided into multiple blocks according to a specific pixel threshold, and then noise is added, brightness, sharpness and / or flipped one by one or block by block.
13. The defect detection system according to claim 11, characterized in that: The structure of the neck network of the object detection model is improved based on the cross-scale convolutional feature fusion module by performing a 1×1 convolution operation on the shallow feature map in the backbone of the object detection model to extract shallow multi-scale feature information.
14. The defect detection system according to claim 13, characterized in that: The shallow feature map is upsampled using a weighted technique and combined with the deep feature map in the neck network to enhance the feature representation of the neck network.
15. The defect detection system according to claim 11, characterized in that The adaptive multi-scale feature extraction module is constructed by replacing the 1×1 convolution in the neck of the C2f module with a deformable convolutional network (DCNv3), and then adding a multi-scale attention module (MSAM) to the neck network splicing.
16. The defect detection system according to any one of claims 11 to 15, characterized in that The object detection model is a YOLOv8s model. The YOLOv8s model is used as a benchmark model. The improved defect detection model is constructed by the method for constructing an improved defect detection model based on the YOLOv8s model.
17. The defect detection system according to claim 16, characterized in that The improved defect detection model is used to detect surface defects of a high-density interconnected printed circuit board.
18. A defect detection method, characterized in that The method uses the improved defect detection model obtained by the method for constructing an improved defect detection model as claimed in claim 1 to detect surface defects of a high-density interconnected printed circuit board.