Method for establishing improved defect detection model, defect detection method and system
Patent Information
- Application Number
- TW114100406
- Authority / Receiving Office
- TW · TW
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2025-01-06
- Publication Date
- 2026-10-21
- Estimated Expiration
- 2045-01-05
AI Technical Summary
Conventional automated optical inspection methods for high-density interconnect printed circuit boards (HDI-PCBs) lack the ability to detect multi-scale defects in a timely and accurate manner without pre-defined criteria, leading to inefficiencies in defect detection.
An improved defect detection model is constructed using a YOLOv8s model, enhanced with a cross-scale convolutional feature fusion module, a self-adjusting multi-scale feature extraction module, and a WIoUv3 loss function, along with a deformable convolutional network and multi-scale attention module, to enhance feature representation and accuracy.
The improved model achieves a 2.3% higher average accuracy rate and 19% reduction in computational load, effectively detecting HDI-PCB surface defects, reducing scrap rates and production costs while ensuring product quality.
Smart Images

Figure TWG2TB001917032_001 
Figure TWG2TB001917032_002 
Figure TWG2TB001917032_003
Abstract
Description
Technical Field
[0001] The specification discloses a defect detection model, specifically a method for constructing an improved defect detection model using deep learning methods and object detection technology, and a method and system for performing defect detection using the defect detection model. Prior Technology
[0002] Printed circuit boards (PCBs) are essential electronic components that facilitate electrical connections between electronic parts, and high-density interconnect printed circuit boards (HDI-PCBs) are a crucial part of this technology. It is known that the surface of a high-density interconnect printed circuit board consists only of copper traces for conductive circuits and insulating areas for isolating circuits. To ensure the quality of this printed circuit board product and prevent surface damage caused by production line issues from affecting the performance of electronic devices, surface defect detection is a critical process in the manufacture of high-density interconnect printed circuit boards.
[0003] Defect detection in conventional high-density interconnect printed circuit boards has long relied on automated optical inspection (AOI). However, conventional automated optical inspection methods depend on pre-designed defect criteria. Without pre-defined defect criteria, defects cannot be detected. Therefore, timely and accurate detection of multi-scale defects remains an unresolved issue. Summary of the Invention
[0004] In view of the lack of prior art solutions for the real-time and accurate detection of multi-scale defects in printed circuit boards, this disclosure proposes a method, method and system for constructing an improved defect detection model. The method is based on improving a specific object detection model (such as the YOLOv8s model) to improve the defect detection model. It is found that the improved defect detection model can effectively improve the accuracy of defect detection in printed circuit boards, and can particularly enhance the surface defect detection capability of a high-density interconnect printed circuit board (HDI-PCB).
[0005] In the method for constructing an improved defect detection model, multiple surface images of a printed circuit board are first obtained. Defects in each surface image are then labeled to generate a defect image dataset. Next, a cross-scale convolutional feature fusion (CCFM) module is used to improve the structure of the neck network of the object detection model. The last C2f module in the object detection model is then replaced with a self-adjusting multi-scale feature extraction (AMFE) module, and the original loss function of the object detection model is replaced with the WIoUv3 loss function. Thus, the improved defect detection model can be obtained using the WIoUv3 loss function. Finally, the improved defect detection model can be trained and tested using the defect image dataset.
[0006] In this process, after capturing multiple surface images of one or more printed circuit boards, the image effects of the multiple surface images are enhanced through preprocessing. Each surface image is divided into multiple blocks according to a specific pixel threshold value, and noise is added to each image or block by block, and the brightness, sharpness and / or flipping are randomly changed.
[0007] Furthermore, the improved neck network structure of the object detection model based on the cross-scale convolutional feature fusion module is achieved by performing a 1×1 convolution operation on the shallow feature maps in the backbone of the object detection model to extract shallow multi-scale feature information.
[0008] Furthermore, a weighted technique can 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 self-adjusting 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 after splicing.
[0010] According to one embodiment, the object detection model can be a YOLOv8s model. Using this YOLOv8s model as a baseline model, an improved defect detection model is constructed based on the YOLOv8s model. Furthermore, the improved defect detection model can be used to detect surface defects on a high-density interconnect printed circuit board.
[0011] The disclosed defect detection system includes a computer host that controls a lighting source controller, a lighting source, a line scan camera, and a lens via software running therein. The computer host executes the method for constructing an improved defect detection model via a processor.
[0012] The defect detection method includes using the improved defect detection model derived from the method of constructing the improved defect detection model to detect surface defects on high-density interconnect printed circuit boards.
[0013] To further understand the features and technical content of the present invention, please refer to the following detailed description and drawings of the present invention. However, the drawings provided are for reference and illustration only and are not intended to limit the present invention. Simple Explanation of the Diagram
[0014] Figure 1 shows an embodiment of the defect detection system setup.
[0015] Figure 2 shows a flowchart of an embodiment of the method for constructing an improved defect detection model;
[0016] Figure 3 shows a flowchart of an embodiment for constructing an AMFE module to replace the C2f module;
[0017] Figure 4 shows an embodiment of the deformable convolutional network;
[0018] Figure 5 shows a flowchart of an embodiment of the multi-scale attention module operation; and
[0019] Figure 6 shows a flowchart of an embodiment of training a defect detection model. Implementation
[0020] The following specific embodiments illustrate the implementation of the present invention. Those skilled in the art can understand the advantages and effects of the present invention from the content disclosed in this specification. The present invention can be implemented or applied through other different specific embodiments, and various details in this specification can also be modified and changed based on different viewpoints and applications without departing from the concept of the present invention. Furthermore, the accompanying drawings of the present invention are for simple illustrative purposes only and are not depictions of actual dimensions; this is stated in advance. The following embodiments will further describe the relevant technical content of the present invention in detail, but the disclosed content is not intended to limit the scope of protection of the present invention.
[0021] It should be understood that while terms such as "first," "second," and "third" may be used in this document to describe various components or signals, these components or signals should not be limited by these terms. These terms are primarily used to distinguish one component from another, or one signal from another. Furthermore, the term "or" as used herein should, as appropriate, include any combination of one or more of the related listed items.
[0022] The disclosure proposes a method, method and system for constructing an improved defect detection model. According to the embodiments, the method for constructing an improved defect detection model relates to a defect detection algorithm based on an improved object detection model (such as the YOLOv8s model). The implementation method can propose an improved defect detection model algorithm for a high-density-interconnect printed circuit board (hereinafter referred to as HDI-PCB).
[0023] Figure 1 shows an example of the setup of the defect detection system.
[0024] The main components of the defect detection system include a computer host 11 that runs a method for constructing and improving defect detection models and defect detection methods. This host includes electronic components such as a processor and memory that execute relevant software programs. The software programs running on the computer host 11 control other electronic devices. This example shows the computer host electrically connected via various wiring connections to a lighting source controller 12, a line scan camera (such as an 8K line scan camera) 13, a lens 14, a lighting source 15, a printed circuit board production line 16, a viewing window 17 for the printed circuit board production line, and a printed circuit board 18 to be inspected on the production line.
[0025] When running the method of constructing and improving the defect detection model and the method of using the defect detection model to perform defect detection, the software program running in the computer host 11 controls the lighting source controller 12 to drive 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. With the purpose of generating a set of printed circuit board defect images, one or more printed circuit boards can be captured to obtain an image 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, the defect detection model is used to perform defect detection on the captured surface images of the printed circuit board 18.
[0026] Based on the method for running the improved defect detection model and its effectiveness, according to the embodiment, the method can be applied to the surface inspection of the HDI-PCB, wherein a defect detection algorithm based on an improved object detection model (such as the YOLOv8s model) is used, and the resulting defect detection model can improve the accuracy of surface defect detection of the printed circuit board.
[0027] Figure 2 shows a flowchart of an embodiment of the method for constructing an improved defect detection model, and Figure 3 shows a flowchart of an embodiment for training an improved defect detection model.
[0028] With the above system settings, the software program running in the computer host controls the line scan camera to capture a large number of images of printed circuit boards (step S201). In one setup example, as shown in the embodiment of the printed circuit board defect detection system shown in FIG1, the illumination source controller 12 and the line scan camera 13 are set on the observation window 17 of the printed circuit board production line, and the surface defect images of the printed circuit boards 18 placed on the production line are acquired by the line scan camera 13.
[0029] Next, the image is exported to the computer host. After the computer host obtains the image, it performs preprocessing to enhance the image effect (step S203). According to the embodiment, during the preprocessing process, each surface image (which can be divided into multiple blocks) can be divided into multiple blocks according to a specific pixel threshold value, for example, into 9 blocks. Then, the data enhancement effect is achieved by adding noise, randomly changing the brightness and sharpness, and / or flipping the image or blocks one by one.
[0030] Next, defect labeling is performed on the preprocessed images (step S205). A labeling tool is used to annotate the defect images of the printed circuit board, generating a printed circuit board defect image dataset. Data labels are also generated during labeling, which can be stored in a specific format for subsequent training. Then, according to a system-defined ratio (e.g., 7:2:1), the printed circuit board defect image dataset can be divided into a training set (for training the defect detection model to obtain model parameters), a validation set (for evaluating model performance to adjust parameters), and finally, a testing set (for testing the model's capabilities) (step S207).
[0031] In order to construct a defect detection model based on an improved specific object detection model (such as the YOLOv8s model), the improvement utilizes a cross-scale convolutional feature fusion module (CCFM) that can fuse images of different resolutions across scales to improve the neck network structure of the object detection model. This can enhance the defect detection model's ability to detect images of different scales and obtain feature maps with richer information (step S209).
[0032] According to the embodiment, regarding step S209 above, the process of improving the neck network structure of the object detection model based on CCFM involves performing a 1×1 convolutional operation on the shallow feature maps in the object detection model backbone, including a convolution part and a pooling part, to extract shallow multi-scale feature information. Then, a weighted technique is used to upsample the feature maps and combine them with the deep feature maps in the neck network, thereby enhancing the feature representation of the neck network, obtaining more comprehensive information, and significantly reducing the computational load.
[0033] According to an embodiment, the object detection model, such as the YOLOv8s model, includes a C2f module that allows the YOLOv8s model to obtain richer information while maintaining its lightweight nature. The role of the C2f module is to fuse feature maps of different scales to improve the accuracy of object detection. According to an embodiment, in the method for obtaining the improved defect detection model, the last C2f module in the object detection model can be replaced with an Adaptive Multiscale Feature Extraction (AMFE) module (step S211), thereby enhancing the algorithm's adaptive extraction capability for multiscale defect features.
[0034] Furthermore, the purpose of the AMFE module is to increase the sampling weights of different sampling points. This weighting technique is applied to upsample the obtained shallow feature map and combine it 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 computational load. This further improves the feature extraction capability of complex printed circuit board (such as HDI-PCB) defects on the basis of the original C2f.
[0035] Next, 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, ensuring that the gradient gain allocation strategy is appropriate for the current situation at any given time. This addresses many negative impacts during mask training, solves the problem of blurring small targets, and improves the accuracy of the prediction boxes. Thus, an improved lightweight multi-scale printed circuit board defect detection model is obtained using the WIoUv3 loss function (step S215).
[0036] The detection model trained through the above steps is an improved defect detection model derived from optimization procedures such as cross-scale connectivity (CCFM) to improve the YOLOv8s neck network structure, replacing the last C2f module in the YOLOv8s network with an AMFE module, and replacing the original loss function of YOLOv8s with the WIoUv3 loss function.
[0037] According to the embodiment, the YOLOv8s model is used as the baseline model, and the above process is used to construct an improved defect detection model, that is, a lightweight multi-scale improvement is carried out on the basis of YOLOv8s to obtain the improved model.
[0038] Further, in the method for constructing an improved defect detection model, the embodiment of replacing the AMFE module of the last C2f module in the YOLOv8s network as described in step S211 above can be referred to the flowchart shown in Figure 3.
[0039] The AMFE module is specifically constructed by 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 interactive structures and attention mechanisms to extract rich and multi-scale information to the neck network after splicing.
[0040] In the process of constructing the AMFE module, the computer host obtains the image of the printed circuit board generated by the system, calculates the feature vector, and first generates a feature map using a convolution module (step S301). Next, the feature map is split into two parts by a split layer (step S303) and constructed into a list (step S305). The last element in the list is used as input and processed by three concatenated neck deformable convolutional networks (Bottleneck-DCNv3) for feature extraction. The extracted results are appended to the list (step S307). The output of each neck deformable convolutional network is sequentially passed to the next neck deformable convolutional network. Finally, a connection function is used to concatenate all branches together (step S309). The MSAM module further extracts feature information, and finally, the number of channels is adjusted using the convolution module to realize the AMFE module (step S311).
[0041] Furthermore, in step S303, which splits the feature map into two parts, the neck deformable convolutional network of the first part takes one of its 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 concatenated by a connection function and then the attention mechanism module of MSAM is used to further extract feature information. Finally, the number of channels is adjusted using a convolutional module.
[0042] Furthermore, regarding the operation of the deformable convolutional network used in the above process, please refer to the embodiment diagram shown in Figure 4.
[0043] First, preliminary features are extracted using basic convolutional operations to form an input feature map 401. Then, a small convolutional network 403 is used to segment the input feature map 401 into multiple shapes according to the size of the convolutional kernel. As illustrated in the example, the small convolutional network 403 uses an offset field 405 with a channel size of 2N to offset the multiple shapes segmented from the input feature map 401, generating multiple offsets 407 as shown in the figure. This allows the convolutional kernel to learn the offsets in both the x and y directions.
[0044] Next, based on the generated offsets 407, the deformed position of each pixel in the convolution kernel can be calculated. 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 then fused with the basic convolution output. Finally, an activation function and normalization are used to obtain the processed output feature map 409.
[0045] Figure 5 shows a flowchart of an example of the operation of the Multi-Scale Attention Module (MSAM).
[0046] The system input image is processed to obtain a feature vector, resulting in a feature map for the given MSAM (step S501). The feature map is then linearly projected (step S503) to obtain the corresponding query matrix Q, key matrix K, and value matrix V. Next, the channels of the feature map are divided into multiple (e.g., n) different heads, and multi-scale sliding window dilated attention is performed on the heads with different expansion rates (step S505). This involves sparsely selecting keys and values within a sliding window centered on a query patch, and then self-attention is applied to these representative patches.
[0047] Next, the CONCAT function is used to combine n different header contents (step S507). After linearization (step S509), average pooling (step S511) and max pooling (step S513) are applied to obtain representative information to reduce the amount of data. After convolution operation (step S515) to complete the connection, an effective feature descriptor is generated, and the feature information is extracted and output (step S517).
[0048] The head in the MSAM can be defined by Equation 1, where It is the first The rate of expansion of the size, and Indicates input to the first Feature slices of the head.
[0049] Equation 1: .
[0050] The feature map of MSAM after attention expansion via a multi-scale sliding window is defined as Equation 2: .
[0051] The operation of applying average pooling and max pooling to the feature map along the channel axis can be defined as shown in Equation 3: .
[0052] The process of replacing the original YOLOv8 loss function with the WIoUv3 loss function is described in Equation 4: ; ; .
[0053] in, and Represents the coordinates of the center point of the true bounding box. , Indicates the coordinates of the center point of the prediction box. This represents the difference in length between the predicted bounding box and the ground truth bounding box. This represents the height difference between the predicted bounding box and the ground truth bounding box. Indicates the focusing coefficient. It is a dynamic variable. and These are the model learning parameters. Display the degree of outliers to define the quality of the anchor frame.
[0054] Thus, the improved defect detection model is described in Figures 2 to 5. Then, Figure 6 shows an implementation flowchart of training and testing the improved defect detection model using a defect image dataset. In this example, the hardware conditions used to train the model are: i7-12345K CPU, ROG-STRIX-RTX4070TIS GPU, and the PyTorch deep learning framework is used to complete the experiment. The PyTorch version is 2.3.1, the CUDA version is 12.1, the optimizer is Adam, the training epochs are 400, the number of threads is 12, the training batch size is 32, and the learning rate is 1×10⁻³.
[0055] According to the flowchart shown in Figure 6, in the first stage, the improved defect detection model obtained through the flowchart in Figure 2 is trained using a training set derived from the defect image dataset at a specific ratio (step S601). According to the embodiment, the training set consists of feature vectors calculated from the defect image dataset, which are submitted to the defect detection model. A supervised machine learning algorithm is used to train the improved defect detection model, yielding the model's defect detection results for the training set. These results are then compared with the target defect. Therefore, the parameters of the defect detection model can be adjusted or reset based on the comparison between the defect detection results and the target defect, and defect detection results can be generated again. This training process is repeated to obtain the accuracy, recall, and average precision of the defect detection model. Training and parameter adjustment are performed repeatedly until the training results reach a certain level.
[0056] In the second stage, the defect detection model trained on the training set using supervised learning is validated using a validation set (step S603). The validation set is input into the defect detection model, validation parameters are set, and the predicted surface defects are obtained after computation, yielding floating-point operations and frames per second (FPS). These floating-point operations and FPS can be used to evaluate the computational speed of the defect detection model, thereby assessing its performance. Furthermore, evaluation can be performed based on system-defined metrics, such as model accuracy and error score. Therefore, the optimal improved defect detection model can be selected based on these various metrics.
[0057] In the third stage, the test set is input into the validated and improved defect detection model to obtain the surface defect detection results, and the model's performance can be evaluated (step S605). One method for estimating the model is to compare it with the test threshold set by the system, thereby evaluating the optimal defect detection model obtained through the above process. The model's generalization error can be used to evaluate the defect detection model's ability to detect surface defect images acquired in the future.
[0058] According to one embodiment, the method for evaluating model performance can use a mean average 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 category of all defects in the printed circuit board surface image, the location of the defects must also be determined.
[0059] Thus, when the defect detection model passes the performance evaluation after testing on the test set (step S607), the defect detection model can detect surface defects on the printed circuit board and output the bounding box with the highest confidence, thus completing the detection of surface defects on the printed circuit board.
[0060] Table 1 shows the performance evaluation results of various models and modules used or not used in the training and improvement of the defect detection model. The evaluation indicators include precision, recall, average detection precision, and floating-point operations. The validation hyperparameters are set as follows: IoU is set to 0.5, training batch is set to 1, and the floating-point operations of the model are mainly validated. The ablation experiment results are compared in Table 1. experimental group YOLOv8s CCFM AMFE WIoUv3 Accuracy (%) Recall rate (%) Average detection accuracy (%) Floating-point operands (MB) 1 √ — — — 89.9 82.1 87.3 28.4 2 √ √ — — 90.2 82.2 87.5 23.0 3 √ — √ — 92.6 82.4 87.8 28.4 4 √ — — √ 89.7 84.1 87.7 28.4 5 √ √ √ — 94.0 82.7 88.4 22.9 6 √ √ — √ 92.3 80.3 87.6 23.0 7 √ — √ √ 90.1 86.4 88.0 28.4 8 √ √ √ √ 96.3 83.1 89.6 22.9
[0061] Thus, according to the disclosure, the improved defect detection model derived and trained using the above embodiments can perform defect detection on surface images of specific printed circuit boards (such as HDI-PCBs), including the surface images of the test set mentioned above, i.e., output HDI-PCB surface defect detection images. The defect detection images may include defects of various types, and the location of each defect is marked after processing by the defect detection model.
[0062] According to the embodiments described above, wherein optimization programs such as improving the YOLOv8s neck network structure by 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 yield an improved defect detection model. According to the relevant data after implementation, the average accuracy rate of surface defect prediction of HDI-PCB using the improved defect detection model reached 89.6%, which was 2.3% higher than the average precision mean (mAP) of the benchmark model (YOLOv8s), and the floating point operations (such as GFLOPS (gigaFLOPS) floating point operation) were reduced by 19%. Therefore, in the fields employed (such as surface defect detection of HDI-PCB, online visual monitoring task of HDI-PCB manufacturing process), it can improve the detection efficiency, exclude unqualified materials, reduce the product scrap rate and rework rate due to material quality problems, reduce the production cost, and ensure the quality of the product.
[0063] In summary, the method of constructing improved defect detection model, the embodiment of defect detection method and system according to the above description, where a printed circuit board defect detection algorithm based on improved deep learning model (such as YOLOv8) is proposed. Moreover, the research on the classification detection of printed circuit board defects based on deep learning-based target detection technology can be carried out through the described method, which helps to improve the detection efficiency and promote the development of automated detection of related printed circuit board defects, which is of great significance to the related manufacturing industry.
[0064] The contents disclosed above are only preferred feasible embodiments of the invention and do not thereby limit the scope of patent application of the invention, so any equivalent technical changes made using the instructions and schematic content of the invention are included in the scope of the application of the invention.
[0065] 11: Computer host 12: Lighting light controller 13: Line scan camera 14: Lens 15: Lighting source 16: Printed circuit board production line 17: Printed circuit board production line observation window 18: Printed circuit board 401: Input feature map 403: Small convolutional networks 405: Offset Field 407: Offset 409: Output Feature Map Steps S201~S215: Flowchart for constructing an improved defect detection model Steps S301~S311: Flowchart for training the improved defect detection model Steps S501~S517: Multi-scale attention module operation process Steps S601~S607: Flowchart for training the defect detection model
Claims
1. A method for constructing an improved defect detection model, comprising: Multiple surface images of one or more printed circuit boards are acquired; defects in each surface image are labeled to generate a defect image dataset; the structure of a neck network of an object detection model is improved using a cross-scale convolutional feature fusion module (CCFM), wherein improving the neck network structure of the object detection model based on the cross-scale convolutional feature fusion module is achieved by performing a 1×1 convolution operation on the shallow feature maps in the backbone of the object detection model to extract shallow multi-scale feature information; the last C2f module in the object detection model is replaced with a self-adjusting multi-scale feature extraction (AMFE) module, wherein a deformable convolutional network (DCNv3) is used to replace the 1×1 convolution in the neck of the C2f module, and a multi-scale attention module (MSAM) is added to the neck network after splicing to construct the self-adjusting multi-scale feature extraction module, wherein the multi-scale attention module utilizes an interactive structure and attention mechanism to extract rich and multi-scale information. The original loss function of the object detection model is replaced with a WIoUv3 loss function, which employs dynamic non-monotonic frequency modulation to allocate different gradient gains at different stages of model training; an improved defect detection model is obtained using the WIoUv3 loss function; and the improved defect detection model is trained and tested using the defect image dataset.
2. The method for constructing an improved defect detection model as described in claim 1, wherein, After capturing multiple surface images of one or more printed circuit boards, the multiple surface images are enhanced through preprocessing, wherein each surface image is divided into multiple blocks according to a specific pixel threshold value, and noise is added to each image or block by block, and brightness, sharpness and / or flipping are randomly changed.
3. The method for constructing an improved defect detection model as described in claim 1, wherein, The defect image dataset is divided into a training set, a validation set, and a test set according to a certain ratio, in order to train, validate, and test the improved defect detection model.
4. The method for constructing an improved defect detection model as described in claim 1, wherein, A weighted technique is 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.
5. The method for constructing an improved defect detection model as described in claim 1, wherein the operation of the deformable convolutional network includes: A basic convolutional operation is used to extract preliminary features, forming an input feature map; The input feature map is segmented into multiple shapes based on the size of a convolutional kernel using a small convolutional network. These multiple shapes are then offset. The deformed position of each pixel within the convolutional kernel is calculated based on the generated offsets. The input feature map is resampled using a bilinear interpolation method to obtain features at the deformed positions. These resampled features are then fused with the base convolutional output, and an output feature map is derived using a start-up function and normalization.
6. The method for constructing an improved defect detection model as described in claim 1, wherein the operation of the multi-scale attention module includes: Given a feature map used by the multi-scale attention module; The feature map is linearly projected to obtain a query matrix, a key matrix, and a value matrix. The channels of the feature map are divided into multiple different headers. Multi-scale sliding window attention is extended in the headers with different expansion rates. Then, the contents of the multiple different headers are combined using a CONCAT function. After linearization, average pooling and max pooling operations are applied. After convolution, feature information is extracted and output.
7. The method for constructing an improved defect detection model as described in any one of claims 1 to 6, wherein the object detection model is a YOLOv8s model, the improved defect detection model is constructed based on the YOLOv8s model using the method for constructing an improved defect detection model as a reference model.
8. The method for constructing an improved defect detection model as described in claim 7, wherein the improved defect detection model is used to detect surface defects on a high-density interconnect printed circuit board.
9. A defect detection system, comprising: A computer host controls an illumination source controller, an illumination source, a line scan camera, and a lens electrically connected to the computer host via software running therein. The computer host executes a method for constructing an improved defect detection model via a processor, including: controlling the illumination source controller to drive the illumination source to illuminate one or more printed circuit boards placed on a printed circuit board production line, and controlling the line scan camera to capture surface images of the printed circuit boards through the lens to acquire surface images of the printed circuit boards; annotating defects in each surface image to generate a defect image dataset; and improving the structure of a neck network of an object detection model using a cross-scale convolutional feature fusion module (CCFM), wherein improving the neck network structure of the object detection model based on the cross-scale convolutional feature fusion module is achieved by performing a 1×1 convolution operation on shallow feature maps in the backbone of the object detection model to extract shallow multi-scale feature information. The last C2f module in the object detection model is replaced with a self-adjusting multi-scale feature extraction (AMFE) module. A deformable convolutional network (DCNv3) replaces the 1×1 convolution in the neck region of the C2f module. A multi-scale attention module (MSAM) is then added to the neck network after concatenation to construct the self-adjusting multi-scale feature extraction module. This multi-scale attention module utilizes interactive structures and attention mechanisms to extract rich and multi-scale information. The original loss function of the object detection model is replaced with a WIoUv3 loss function, which employs dynamic non-monotonic frequency modulation to allocate different gradient gains at different stages of model training. An improved defect detection model is obtained using the WIoUv3 loss function. The improved defect detection model is then trained and tested using the defect image dataset.
10. The defect detection system as described in claim 9, wherein, After capturing multiple surface images of one or more printed circuit boards, the multiple surface images are enhanced through preprocessing, wherein each surface image is divided into multiple blocks according to a specific pixel threshold value, and noise is added to each image or block by block, and brightness, sharpness and / or flipping are randomly changed.
11. The defect detection system as described in claim 9, wherein, A weighted technique is 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.
12. The defect detection system as described in any one of claims 9 to 11, wherein the object detection model is a YOLOv8s model, the improved defect detection model is constructed based on the YOLOv8s model as a baseline model, and the improved defect detection model is constructed on the basis of the YOLOv8s model using the method of constructing the improved defect detection model.
13. The defect detection system as claimed in claim 12, wherein the improved defect detection model is used to detect surface defects on a high-density interconnect printed circuit board.
14. A defect detection method, which uses the improved defect detection model obtained by constructing an improved defect detection model as described in claim 1 to detect surface defects on a high-density interconnect printed circuit board.
Citation Information
Patent Citations
Printed circuit board defect detection method based on improved YOLOv5s
CN114820486A
PCB bare board surface defect detection method based on YOLOv8
CN116823738A
PCB defect detection method, system and equipment and storage medium
CN119048496A
Computer implemented method for processing structured data
US20230281431A1
