Defect target detection network and method
By introducing the twin anomaly attention mechanism sub-network, Focus module and Ghost convolution into the YOLO network, combined with the amoeba convolution, the shortcomings of the traditional YOLO algorithm in detecting small targets and curve defects are solved, and the integrated circuit packaging is significantly improved. Accuracy and speed of defect detection.
Patent Information
- Application Number
- CN202410776135.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-17
- Publication Date
- 2024-10-18
AI Technical Summary
Existing integrated circuit defect detection methods have low efficiency and high false detection rate. Especially when dealing with small targets and curved defects, the traditional YOLO algorithm is difficult to effectively capture defects such as fiber foreign matter, cracks and scratches on the chip.
The twin anomaly attention mechanism sub-network is used, combined with the Focus module and Ghost convolution, to replace the downsampling module of the traditional YOLO network to enhance feature extraction capabilities, and use amoeba convolution in the detection head to adapt to the extraction of curve features.
It significantly improves the detection effect of integrated circuit packaging defects, improves detection accuracy and speed, and is suitable for defect detection in industrial environments.
Smart Images

Figure CN118799266A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing, and in particular to a defect target detection network and method. Background Art
[0002] Integrated circuits are the cornerstone of information technology. With the rapid development of informatization and intelligence, integrated circuits have penetrated into various fields. Chip packaging is an important step in chip production. As the size of integrated circuit chips becomes smaller and the packaging process becomes more complex, there are more opportunities for defects to occur, and companies' requirements for quality are also constantly increasing. Therefore, defect detection has become increasingly important. Manual visual inspection methods are inefficient and unstable, and are being replaced by automatic optical inspection technology. Defect automatic optical inspection technology can accurately identify and locate tiny defects in the integrated circuit packaging and testing process, such as foreign matter, broken edges and corners, scratches, etc., to ensure the quality and reliability of integrated circuits.
[0003] Traditional image processing detection methods require experienced engineers to set complex detection algorithms and parameters according to the characteristics of imaging and defects. The adaptability is limited, and the missed detection rate and false detection rate are difficult to meet customer expectations. Developing methods that are highly applicable, have low usage barriers, and can quickly and accurately detect packaging and testing defects is an urgent problem to be solved. With the development of artificial intelligence technology, more and more deep learning-based methods are being applied to defect detection in integrated circuits. According to the training method, it can be divided into supervised learning, unsupervised learning, and semi-supervised learning. Unsupervised learning cannot directly define the defect type, and the accuracy of semi-supervised learning needs to be improved. Supervised learning is more suitable for practical applications. The supervised learning solution mainly uses target detection methods such as Faster RCNN and YOLO. Among them, the YOLO algorithm is known for its excellent balance between accuracy and speed. Unlike conventional target detection tasks, in defect detection, defects are "abnormal" in the picture, but current methods do not take advantage of this feature. Chip defects are multi-scale, but most targets are small and lack texture features, making them difficult to capture. Chips have strip defects such as fiber foreign matter, cracks, and scratches. Standard square convolution kernels are not conducive to feature extraction of such targets. These characteristics of chip defect detection make the YOLO algorithm still not ideal for chip defect detection. Summary of the invention
[0004] The embodiment of the present invention provides a defect target detection network and method. Using the network for detection can significantly improve the detection effect of integrated circuit packaging defects.
[0005] To achieve the above-mentioned purpose, an embodiment of the present application provides a defect target detection network, including: a twin abnormal attention mechanism subnetwork, a first scale detection subnetwork, a second scale detection subnetwork and a third scale detection subnetwork; the output end of the twin abnormal attention mechanism subnetwork is connected to the input end of the first scale detection subnetwork; the first output end of the first scale detection subnetwork is connected to the first input end of the second scale detection subnetwork, the second output end of the first scale detection subnetwork is connected to the second input end of the second scale detection subnetwork, and the third output end of the first scale detection subnetwork is connected to the first input end of the third scale detection subnetwork; the output end of the second scale detection subnetwork is connected to the second input end of the third scale detection subnetwork;
[0006] The twin abnormal attention mechanism sub-network includes the twin's first Focus module, the twin's second Focus module, the twin's first C2f module, the ACM module and the twin's third Focus module; the first Focus module is connected to the second Focus module; the second Focus module is connected to the first C2f module; the first C2f module is connected to the third Focus module; the third Focus module is connected to the ACM module.
[0007] In a possible implementation, the first Focus module includes a first twin Focus submodule and a second twin Focus submodule that are parallel and share weights; the second Focus module includes a third twin Focus submodule and a fourth twin Focus submodule that are parallel and share weights; the first C2f module includes a first twin C2f submodule and a second twin C2f submodule that are parallel and share weights; the third Focus module includes a fifth twin Focus submodule and a sixth twin Focus submodule that are parallel and share weights;
[0008] Among them, the output end of the first twin Focus submodule is connected to the input end of the third twin Focus submodule; the output end of the third twin Focus submodule is connected to the input end of the first twin C2f submodule; the output end of the first twin C2f submodule is connected to the input end of the fifth twin Focus submodule; the output end of the fifth twin Focus submodule is connected to the first input end of the ACM module; the output end of the second twin Focus submodule is connected to the input end of the fourth twin Focus submodule; the output end of the fourth twin Focus submodule is connected to the input end of the second twin C2f submodule; the output end of the second twin C2f submodule is connected to the input end of the sixth twin Focus submodule; the output end of the sixth twin Focus submodule is connected to the second input end of the ACM module; the output end of the ACM module is connected to the input end of the first scale detection subnetwork.
[0009] In a possible implementation, the output of the ACM module is as follows:
[0010]
[0011] Among them, F∈R B×C×H×W represents the input training image, represents the corresponding reference image, R represents a real number set, B represents the batch number, C represents the image channel, H represents the image height, and W represents the image width. R^(B×C×H×W) describes a four-dimensional tensor in which each element is a real number and the shape of this tensor is determined by the batch size B, the number of image channels C, the image height H, and the image width W. {;} represents the concatenation operation, and f c Represents 1*1 convolution.
[0012] In a possible implementation manner, the first Focus module, the second Focus module, the first C2f module, and the third Focus module are trained using shared weights.
[0013] In a possible implementation, the first scale detection subnetwork includes: a first C2fGhost module, a seventh Focus module, a second C2fGhost module, an eighth Focus module, a third C2fGhost module, an SPPF module, a fourth C2fGhost module, a fifth C2fGhost module, a first splicing module, a first upsampling module, a second splicing module, a second upsampling module and a first AMBC detection module; the input end of the first C2fGhost module is connected to the output end of the twin abnormal attention mechanism subnetwork; the first output end of the fourth C2fGhost module is connected to the first input end of the second scale detection subnetwork; the output end of the fifth C2fGhost module is connected to the second input end of the second scale detection subnetwork; the output end of the SPPF module is connected to the first input end of the third scale detection subnetwork;
[0014] Among them, the first output end of the first C2fGhost module is connected to the input end of the seventh Focus module, and the second output end of the first C2fGhost module is connected to the first input end of the first splicing module; the output end of the seventh Focus module is connected to the input end of the second C2fGhost module; the first output end of the second C2fGhost module is connected to the input end of the eighth Focus module, and the second output end of the second C2fGhost module is connected to the first input end of the second splicing module; the output end of the eighth Focus module is connected to the input end of the third C2fGhost module; the output end of the third C2fGhost module is connected to the input end of the The output end of the SPPF module is connected to the input end of the SPPF module; the output end of the SPPF module is connected to the input end of the first upsampling module; the output end of the first upsampling module is connected to the second input end of the second splicing module; the second splicing module is connected to the input end of the fourth C2fGhost module; the second output end of the fourth C2fGhost module is connected to the input end of the second upsampling module; the output end of the second upsampling module is connected to the second input end of the first splicing module; the output end of the first splicing module is connected to the input end of the fifth C2fGhost module; the output end of the fifth C2fGhost module is connected to the input end of the first AMBC detection module.
[0015] In a possible implementation, a first Conv module, a third splicing module, a sixth C2fGhost module, and a second AMBC detection module; the input end of the first Conv module is connected to the second output end of the first scale detection subnetwork; the second input end of the third splicing module is connected to the first output end of the first scale detection subnetwork; the first output end of the sixth C2fGhost module is connected to the second input end of the third scale detection subnetwork
[0016] Among them, the output end of the first Conv module is connected to the first input end of the third splicing module, the output end of the third splicing module is connected to the input end of the sixth C2fGhost module; the second output end of the sixth C2fGhost module is connected to the input end of the second AMBC detection module.
[0017] In a possible implementation, the second scale detection subnetwork includes a second Conv module, a fourth splicing module, a seventh C2fGhost module and a third AMBC detection module; an input end of the second Conv module is connected to an output end of the second scale detection subnetwork; a first input end of the fourth splicing module is connected to a first output end of the first scale detection subnetwork;
[0018] Among them, the output end of the second Conv module is connected to the first input end of the fourth splicing module; the output end of the fourth splicing module is connected to the input end of the seventh C2fGhost module; the output end of the seventh C2fGhost module is connected to the input end of the third AMBC detection module.
[0019] In a possible implementation, each C2fGhost module includes a first Conv sublayer, a second Conv sublayer, a Split sublayer, a first GhostBottleneck sublayer, a second GhostBottleneck sublayer and a splicing submodule;
[0020] Among them, the output end of the first Conv sublayer is connected to the input end of the Split sublayer; the first output end of the Split sublayer is connected to the input end of the first GhostBottleneck sublayer; the first output end of a GhostBottleneck sublayer is connected to the input end of the second GhostBottleneck sublayer; the first output end of the second GhostBottleneck sublayer is connected to the first input end of the splicing submodule; the second input end of the splicing submodule is respectively connected to the second output ends of the two GhostBottleneck sublayers and the second input end of the Split sublayer; the output end of the splicing submodule is connected to the input end of the second Conv sublayer.
[0021] In a possible implementation, each AMBC detection module includes two amoeba convolution circuit networks.
[0022] In a possible implementation, each AMBC detection module includes a first amoeba convolution circuit network and a second amoeba convolution circuit network; an input end of the first amoeba convolution circuit network is connected to an input end of the second amoeba convolution circuit network;
[0023] Among them, the first amoeba convolution circuit network includes a first AMBConv layer, a second AMBConv layer, a first Conv2d layer and a BoxLoss layer connected in series in sequence; the input end of the first AMBConv layer is connected to the input end of the second amoeba convolution circuit network; the second amoeba convolution circuit network includes a third AMBConv layer, a fourth AMBConv layer, a second Conv2d layer and a ClsLoss layer connected in series in sequence; the input end of the third AMBConv layer is connected to the input end of the first amoeba convolution circuit network.
[0024] Another aspect of the embodiment of the present application provides a defect target detection method, which is implemented by applying the defect target detection as described above.
[0025] Compared with the prior art, the embodiment of the present invention provides a defect target detection network and method, which changes the paradigm of feature extraction of the traditional YOLO network backbone to a twin abnormal attention mechanism sub-network, and compares the features of the chip to be tested and the normal chip in the twin abnormal attention mechanism sub-network, so that the network pays more attention to the abnormal area in the feature extraction and feature fusion of the second half, so as to achieve the purpose of highlighting the defect target and enhance the feature extraction ability of the network. Secondly, for small target defects, the downsampling module in the traditional YOLO network is replaced with a Focus module to retain more detail information. Then, Ghost convolution is added to simplify the network, and the channel output by the Focus module is adjusted; for curve defects, two amoeba convolutions and an ordinary convolution are stacked in the detection head in the traditional YOLO network, and the convolution in the detection head is changed to an amoeba convolution that is more suitable for curve features and other continuous features extraction, so that it becomes an amoeba convolution detection head.
[0026] Through the improvements in the above three aspects, the detection effect of integrated circuit packaging defects can be significantly improved, and defect detection using the defect target detection network provided by the present invention has good application prospects. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 is a schematic diagram of the structure of a defect target detection network provided by an embodiment of the present invention;
[0028] Figure 2 A schematic diagram of the structure of a Focus module is provided according to an embodiment of the present invention;
[0029] Figure 3 A schematic diagram of the structure of a C2fGhost module is provided in one embodiment of the present invention;
[0030] Figure 4 FIG. 1 is a deformation diagram of an amoeba convolution provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0031] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0032] To solve the above problems, see Figure 1 An embodiment of the present invention provides a defect target detection network, including: a twin abnormal attention mechanism subnetwork 1, a first scale detection subnetwork 2, a second scale detection subnetwork 3 and a third scale detection subnetwork 4; the output end of the twin abnormal attention mechanism subnetwork 1 is connected to the input end of the first scale detection subnetwork 2; the first output end of the first scale detection subnetwork 2 is connected to the first input end of the second scale detection subnetwork 3, the second output end of the first scale detection subnetwork 2 is connected to the second input end of the second scale detection subnetwork 3, and the third output end of the first scale detection subnetwork 2 is connected to the first input end of the third scale detection subnetwork 4; the output end of the second scale detection subnetwork 3 is connected to the second input end of the third scale detection subnetwork 4;
[0033] The twin abnormal attention mechanism sub-network 1 includes a twin first Focus module 10, a twin second Focus module 11, a twin first C2f module 12, an ACM module 14 and a twin third Focus module 13; the first Focus module 10 is connected to the second Focus module 11; the second Focus module 11 is connected to the first C2f module 12; the first C2f module 12 is connected to the third Focus module 13; the third Focus module 13 is connected to the ACM module 14.
[0034] The defect target detection network provided in this embodiment is a multi-level, multi-scale defect detection architecture, which realizes accurate detection of subtle defects on complex surfaces such as chips through a variant of the YOLO (You Only Look Once) framework. The core components of this solution include the twin abnormal attention mechanism subnetwork 1, the first scale detection subnetwork 2, the second scale detection subnetwork 3 and the third scale detection subnetwork 4. Each part has a specific function and works together to complete the defect detection task.
[0035] In the twin abnormal attention mechanism sub-network 1, the input image is preprocessed by the twin's first Focus module 10 to retain more detail information, which is particularly important for detecting small target defects. The twin's second Focus module 11 is then used to further refine the feature map to prepare richer visual information for subsequent feature extraction. The twin's first C2f module 12 is a module for feature fusion, which can integrate multi-layer features and improve the network's perception of defects of different scales. The twin's third Focus module 13: is used to further refine features and provide higher quality input for subsequent detection sub-networks. Finally, through the ACM module 14 (Attention Contrastive Mechanism): that is, the abnormal attention mechanism module, the features of the sample to be detected and the normal sample are compared to strengthen the attention to the abnormal area, helping the network to locate the defect more accurately.
[0036] The first scale detection subnetwork 2 is responsible for detecting larger scale defects and is usually located at a shallower level of the network, capable of capturing features of larger objects. The second scale detection subnetwork 3 is located at the middle level of the network and is used to detect medium-scale defects, balancing details and overall information. The third scale detection subnetwork 4 is inside the overall network and focuses on detecting small-scale or detail-level defects, such as tiny scratches, contamination, etc. The three detection head modules corresponding to the three different scale detection subnetworks are designed to detect objects at multiple scales and better cover large and small objects. Each detection head is optimized for targets of different sizes, thereby improving the overall detection accuracy. However, more detection heads will result in slower calculations, so only three are used.
[0037] The YOLO-DD (YOLO-Defect Detect) defect target detection network proposed in this embodiment achieves better detection results in chip defect detection. The chip defect is an "abnormal" existence in the picture, and the network can focus on the defect area through an effective attention mechanism. This embodiment proposes an abnormal attention mechanism (Anomaly Attention Module, AAM), which changes the paradigm of feature extraction of the traditional YOLO network backbone, introduces a twin network structure in the first half of the traditional YOLO network, and compares the features of the chip to be tested and the normal chip, so that the new network pays more attention to the abnormal area in the feature extraction and feature fusion in the second half, so as to achieve the purpose of highlighting the defect target and enhance the feature extraction ability of the network.
[0038] Exemplarily, the first Focus module 10 includes a first twin Focus submodule 101 and a second twin Focus submodule 102 in parallel and sharing weights; the second Focus module 11 includes a third twin Focus submodule 110 and a fourth twin Focus submodule 111 in parallel and sharing weights; the first C2f module 12 includes a first twin C2f submodule 120 and a second twin C2f submodule 121 in parallel and sharing weights; the third Focus module 13 includes a fifth twin Focus submodule 130 and a sixth twin Focus submodule 131 in parallel and sharing weights;
[0039] Among them, the output end of the first twin Focus submodule 101 is connected to the input end of the third twin Focus submodule 110; the output end of the third twin Focus submodule 110 is connected to the input end of the first twin C2f submodule 120; the output end of the first twin C2f submodule 120 is connected to the input end of the fifth twin Focus submodule 130; the output end of the fifth twin Focus submodule 130 is connected to the first input end of the ACM module 14; the output end of the second ... fifth twin Focus submodule 130 is connected to the first input end of the ACM module 14; the output end of the third twin Focus submodule 110 is connected to the input end of the first twin C2f submodule 120; the output end of the third twin C2f submodule 120 is connected to the input end of the fifth twin Focus submodule 130; the output end of the fifth twin Focus submodule 130 is connected to the first input end of the ACM module 14; the output end of the third twin Focus submodule 110 is connected to the input end of the first twin C2f submodule 120; the output end of the third twin C2f submodule 120 is connected to the The output end of block 102 is connected to the input end of the fourth twin Focus sub-module 111; the output end of the fourth twin Focus sub-module 111 is connected to the input end of the second twin C2f sub-module 121; the output end of the second twin C2f sub-module 121 is connected to the input end of the sixth twin Focus sub-module 131; the output end of the sixth twin Focus sub-module 131 is connected to the second input end of the ACM module 14; the output end of the ACM module is connected to the input end of the first scale detection sub-network.
[0040] In this embodiment, chip defects are different from common detection targets. Chip defects and background patterns are easily confused. Most of the features of broken wires are similar to normal welding wires in the background. Foreign objects and welding wires intersect and are difficult to detect. If chip defect detection is regarded as a conventional target detection problem, it will face many difficulties, resulting in low confidence and difficult detection of defective targets. However, these defects are usually more likely to damage chip functions than other defects, and are the focus and difficult targets of chip defect detection. Normal chips have similar textures, welding wires, solder joints, substrates and other pattern features, making defects "abnormal" in the image. Focusing on abnormal areas will facilitate the detection of defective targets.
[0041] Exemplarily, the output of the ACM module 14 is in the following manner:
[0042]
[0043] Among them, F∈R B×C×H×W represents the input training image, represents the corresponding reference image, R represents a real number set, B represents the batch number, C represents the image channel, H represents the image height, and W represents the image width. R^(B×C×H×W) describes a four-dimensional tensor in which each element is a real number and the shape of this tensor is determined by the batch size B, the number of image channels C, the image height H, and the image width W. {;} represents the concatenation operation, and f c Represents 1*1 convolution.
[0044] This embodiment combines the ideas of target detection and anomaly detection, introduces the features of normal chips as prior knowledge, and introduces the anomaly attention mechanism (AAM) into the twin anomaly attention mechanism sub-network 1. All defects on the chip can be regarded as an anomaly. The anomaly attention mechanism is used to compare the chip under test with the normal chip as a reference to capture the abnormal area in the chip under test. Specifically, the anomaly attention mechanism uses a twin network with shared weights to extract the features of the chip under test and the preset normal chip, and then uses the anomaly calculation module (ACM) to calculate and compare the difference features, thereby weakening the unchanged area, highlighting the abnormal area where the defect is located, extracting the chip defect, and then inputting the difference information and the feature map of the chip under test into the subsequent network. The output F of the proposed difference calculation module att It can be expressed by the following formula:
[0045]
[0046] Among them, F∈R B×C×H×W represents the input training image, represents the corresponding reference image, {;} represents the splicing operation, and f c Represents 1*1 convolution. Experiments show that this simple difference calculation module design has the best effect.
[0047] The abnormal attention mechanism used in this embodiment is also lightweight. The difference feature calculation method of the ACM module 14 is simple. At the same time, only one additional calculation is required in the inference stage to pre-store the features of the preset normal chip. The additional calculation amount introduced during inference is very small, and the inference speed can be almost consistent with the baseline model.
[0048] Exemplarily, the first Focus module 10, the second Focus module 11, the first C2f module 12 and the third Focus module 13 are trained using shared weights.
[0049] The abnormal attention mechanism depends on the input training images and reference images, so a twin network structure is used in the front part of the network backbone, and this part of the backbone is trained using shared weights.
[0050] Exemplarily, the first scale detection subnetwork 2 includes: a first C2fGhost module 20, a seventh Focus module 21, a second C2fGhost module 22, an eighth Focus module 23, a third C2fGhost module 24, an SPPF module 25, a fourth C2fGhost module 28, a fifth C2fGhost module 2B, a first splicing module 2A, a first upsampling module 26, a second splicing module 27, a second upsampling module 29 and a first AMBC detection module 2C; the input end of the first C2fGhost module 20 is connected to the output end of the twin abnormal attention mechanism subnetwork; the first output end of the fourth C2fGhost module 28 is connected to the first input end of the second scale detection subnetwork 3; the output end of the fifth C2fGhost module 2B is connected to the second input end of the second scale detection subnetwork 3; the output end of the SPPF module 25 is connected to the first input end of the third scale detection subnetwork 4.
[0051] Among them, the first output end of the first C2fGhost module 20 is connected to the input end of the seventh Focus module 21, and the second output end of the first C2fGhost module 20 is connected to the first input end of the first splicing module 2A; the output end of the seventh Focus module 21 is connected to the input end of the second C2fGhost module 22; the first output end of the second C2fGhost module 22 is connected to the input end of the eighth Focus module 23, and the second output end of the second C2fGhost module 22 is connected to the first input end of the second splicing module 27; the output end of the eighth Focus module 23 is connected to the input end of the third C2fGhost module 24; the output end of the third C2fGhost module 24 is connected to the input end of the third C2fGhost module 24. The output end of the SPPF module 25 is connected to the input end of the first upsampling module 26; the output end of the first upsampling module 26 is connected to the second input end of the second splicing module 27; the second splicing module 27 is connected to the input end of the fourth C2fGhost module 28; the second output end of the fourth C2fGhost module 28 is connected to the input end of the second upsampling module 29; the output end of the second upsampling module 29 is connected to the second input end of the first splicing module 2A; the output end of the first splicing module 2A is connected to the input end of the fifth C2fGhost module 2B; the output end of the fifth C2fGhost module 2B is connected to the input end of the first AMBC detection module 2C.
[0052] Furthermore, when using convolution to downsample an image, fine-grained information is easily lost, resulting in missed detection of small targets. Using the Focus operation as a downsampling operation can better preserve fine-grained information such as texture details of the original image, making the network more friendly to the detection of small targets. Figure 2 As shown in the figure, the Focus operation compresses the information in the spatial domain of the image to the channel domain, halving the spatial scale of the image, and then uses 1×1 convolution to compress the channel, thereby replacing the downsampling convolution. At the same time, replacing convolution with Focus also reduces the number of network parameters by about 10%.
[0053] The Ghost convolution used in the C2f module is a lightweight convolution module that is used to reduce the number of convolution kernels, thereby reducing the number of model parameters. Figure 3 As shown in the figure, a small amount of convolution is performed and expanded for the feature maps with many similar redundant channels in the feature maps obtained by convolution. This module design effectively reduces the number of model parameters and reduces latency while maintaining the similar recognition performance of the original network.
[0054] Each Focus module adopts the strategy of fusion after point-by-point segmentation of feature maps. This operation will produce a high degree of information redundancy in the channel domain, which provides the possibility for further module optimization of the network. In order to make full use of this feature, Ghost convolution is cleverly added to the subsequent network structure. As a convolution method based on feature map channel redundancy, Ghost convolution and Focus operation form a good synergistic and complementary relationship. It can effectively compress the information of the rich detail channel generated by the Focus module. This compression not only reduces redundancy, but also retains key information, thereby improving the utilization of channel information. Subsequently, the "Ghost" feature map generated by Ghost convolution further adjusts the effect of channel fusion and enhances the feature representation ability of the network. Through the coordinated use of the Focus module and the C2fGhost module, this embodiment achieves the simplification of network parameters and the reduction of calculation delay while improving network performance.
[0055] Furthermore, the defects of the chip, such as cracks, scratches, fiber foreign matter, broken wires, etc., are mostly linear and strip-shaped, and their shapes and scales are varied. It is difficult for square convolution to continuously focus on the complete features of such linear defects, and a convolution kernel suitable for such defects is needed. Therefore, the Amoeba Convolution (AMBC) was proposed. The offset of each focus point in the convolution kernel is limited by the position of the previous focus point, and the range of the offset each time is limited, thereby ensuring the continuity of the convolution kernel's attention, which is more conducive to focusing on chip defects. The direction of each offset of the convolution kernel is not restricted, which can make the convolution kernel have higher degrees of freedom in all directions while maintaining continuous offset. Amoeba convolution can fit targets with continuous tubular features, as well as targets with other continuous geometric features. This is in line with the characteristics that integrated circuit defects are continuous and contain multiple geometric features such as curves and points. That is, amoeba convolution can not only fit targets such as cracks, foreign matter, residual wires, but also fit targets such as pollution and wireless. Such as Figure 4 shown.
[0056] Compared with the previous deformable convolution, the continuity characteristics of amoeba convolution are more in line with the characteristics of the chip. Amoeba convolution has better deformation performance and deformation freedom, and is not limited to strip targets. Considering that adding such deformable convolution will increase the time consumption of network training and reasoning at the same time, after experiments, this embodiment replaces the original two convolution layers in the two decoupling branches with amoeba convolution at the detection head position, which can significantly improve the detection effect of the network, while balancing the improvement of detection effect with the increase in network training and reasoning time cost.
[0057] Exemplarily, the second scale detection subnetwork 3 includes a first Conv module 30, a third splicing module 31, a sixth C2fGhost module 32 and a second AMBC detection module 33; the input end of the first Conv module 30 is connected to the second output end of the first scale detection subnetwork 2; the second input end of the third splicing module 31 is connected to the first output end of the first scale detection subnetwork 2; the first output end of the sixth C2fGhost module 32 is connected to the second input end of the third scale detection subnetwork 4;
[0058] Among them, the output end of the first Conv module 30 is connected to the first input end of the third splicing module 31; the output end of the third splicing module 31 is connected to the input end of the sixth C2fGhost module 32; the second output end of the sixth C2fGhost module 32 is connected to the input end of the second AMBC detection module 33.
[0059] Exemplarily, the third scale detection subnetwork includes a second Conv module 40, a fourth splicing module 41, a seventh C2fGhost module 42 and a third AMBC detection module 43; the input end of the second Conv module 40 is connected to the output end of the second scale detection subnetwork 3; the first input end of the fourth splicing module 41 is connected to the first output end of the first scale detection subnetwork 2;
[0060] Among them, the output end of the second Conv module 40 is connected to the first input end of the fourth splicing module 41; the output end of the fourth splicing module 41 is connected to the input end of the seventh C2fGhost module 42; the output end of the seventh C2fGhost module 42 is connected to the input end of the third AMBC detection module 43.
[0061] The high-frequency defects that appear on the chip mainly include small targets (contamination, scratches) and curves (foreign matter, residual lines). Small target defects are generally characterized by small scale and low contrast, and some defects are similar to the chip background texture. For this type of defects, this embodiment designs a small target defect improvement module, and uses the Focus operation as a downsampling module in the network to retain more detail information. Then, Ghost convolution is added to simplify the network, and the channel output by the Focus module is adjusted. Curve defects generally have the characteristics of changeable shapes and scales. This embodiment proposes an amoeba convolution (AMBC), stacks two amoeba convolutions in the detection head, and an ordinary convolution, and changes the convolution in the detection head to an amoeba convolution that is more suitable for extracting curve features and other various continuous features, making it an amoeba convolution detection head (AMBC-Detect).
[0062] Taking a 3×3 2D convolution kernel as an example, for the first AMBC detection module 2C, the second AMBC detection module 33, and the third AMBC detection module 43, the convolution kernel first learns a set of offsets, and then the convolution kernel sampling points are freely offset in two directions starting from the center of the convolution kernel. The 9 grids of the convolution kernel are denoted as K i±c =(x i±c ,y i±c ), where c = 0, 1, 2, 3, 4, K i =(x i ,y i ) represents the center grid coordinate of the convolution kernel, and c represents the deformation stage. When the convolution kernel is deformed, for K i+c To K i+c+1 The single offset is limited to a 3×3 square grid centered at the offset starting point, that is, the single offset in the x-axis direction and the y-axis direction is limited to Δ∈[-1,1]. i To K i+c The total offset of is constrained to accumulate the area where the offset is limited. The total offset in the x-axis direction and the y-axis direction are This ensures the continuity and regionality of the convolution kernel grid selection to match the continuity of the defect target. The changed convolution kernel grid coordinates can be expressed as:
[0063]
[0064] In this embodiment, each chip defect data set is collected from a real industrial environment. After the defect target detection algorithm YOLO-DD is trained and evaluated using the data set, the obtained optimal model weight file can be used to detect chip defects.
[0065] Exemplarily, each C2fGhost module includes
[0066] The first Conv sublayer, the second Conv sublayer, the Split sublayer, the first GhostBottleneck sublayer, the second GhostBottleneck sublayer and a splicing submodule;
[0067] Among them, the output end of the first Conv sublayer is connected to the input end of the Split sublayer; the first output end of the Split sublayer is connected to the input end of the first GhostBottleneck sublayer; the first output end of a GhostBottleneck sublayer is connected to the input end of the second GhostBottleneck sublayer; the first output end of the second GhostBottleneck sublayer is connected to the first input end of the splicing submodule; the second input end of the splicing submodule is respectively connected to the second output ends of the two GhostBottleneck sublayers and the second input end of the Split sublayer; the output end of the splicing submodule is connected to the input end of the second Conv sublayer.
[0068] Exemplarily, each AMBC detection module includes a first amoeba convolution circuit network and a second amoeba convolution circuit network; an input end of the first amoeba convolution circuit network is connected to an input end of the second amoeba convolution circuit network;
[0069] Among them, the first amoeba convolution circuit network includes a first AMBConv layer, a second AMBConv layer, a first Conv2d layer and a BoxLoss layer connected in series in sequence; the input end of the first AMBConv layer is connected to the input end of the second amoeba convolution circuit network; the second amoeba convolution circuit network includes a third AMBConv layer, a fourth AMBConv layer, a second Conv2d layer and a ClsLoss layer connected in series in sequence; the input end of the third AMBConv layer is connected to the input end of the first amoeba convolution circuit network.
[0070] Compared with the prior art, the embodiment of the present invention provides a defect target detection network, which changes the paradigm of feature extraction of the traditional YOLO network trunk to a twin abnormal attention mechanism sub-network 1, and compares the features of the chip to be tested and the normal chip in the twin abnormal attention mechanism sub-network 1, so that the network pays more attention to the abnormal area in the feature extraction and feature fusion of the second half, so as to achieve the purpose of highlighting the defect target and enhance the feature extraction ability of the network. Secondly, for small target defects, the downsampling module in the traditional YOLO network is replaced by the Focus module to retain more detail information. Then, the Ghost convolution is added to simplify the network, and the channel output by the Focus module is adjusted; for curve defects, two amoeba convolutions and an ordinary convolution are stacked in the detection head in the traditional YOLO network, and the convolution in the detection head is changed to an amoeba convolution that is more suitable for curve features and other continuous features. Extraction, so that it becomes an amoeba convolution detection head.
[0071] Through the improvements in the above three aspects, the detection effect of integrated circuit packaging defects can be significantly improved, and defect detection using the defect target detection network provided by the present invention has good application prospects.
[0072] An embodiment of the present invention provides a defect target detection method, which is implemented by using the defect target detection network as described above.
[0073] In one embodiment, the training parameters are basically set by the default training parameters of YOLOv8, the number of iterations is 500, the default early stopping mechanism is used, the image size is 416, the default batch size is 16, the default fixed random seed is 0, the data volume ratio of the training set to the validation set is 7:3, and in the default image enhancement, the HSV enhancement scores are 0.015, 0.7, and 0.4, respectively, the translation and scale transformation scores are 0.1 and 0.5, respectively, the image left-right flip probability and the Mosaic enhancement probability are 0.5 and 1.0, respectively, the default inference IoU threshold is 0.7, and the GPU used is a single-card A4000. The model is trained separately on each data set, and the best result on the validation set in all iterations is taken. This embodiment uses the mAP indicator commonly used in target detection as the evaluation index for the model effect. .5:.05:.95 , abbreviated as mAP. The final performance of YOLO-DD on each dataset achieved 65.5% and 46.8% mAP respectively.
[0074] An embodiment of the present application provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the above-mentioned defect target detection network is run.
[0075] The computer device may be a computing device such as a smart phone, a tablet computer, a desktop computer, and a cloud server. The computer device may include, but is not limited to, a processor and a memory. Those skilled in the art will appreciate that the figure is merely an example of a computer device and does not constitute a limitation on the computer device, and may include more or fewer components than shown in the figure, or a combination of certain components, or different components, such as input and output devices, network access devices, etc.
[0076] The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0077] In some embodiments, the memory may be an internal storage unit of the computer device, such as a hard disk or memory of the computer device. In other embodiments, the memory may also be an external storage device of the computer device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the computer device. Further, the memory may also include both an internal storage unit of the computer device and an external storage device. The memory is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as the program code of the computer program, etc. The memory may also be used to temporarily store data that has been output or is to be output.
[0078] An embodiment of the present application provides a computer program product. When the computer program product is run on a computer device, the computer device implements the steps in the above-mentioned method embodiments when executing the computer device.
[0079] In several embodiments provided in the present application, it is understood that each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved.
[0080] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device to execute all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0081] The above is a preferred embodiment of the present invention. It should be pointed out that a person skilled in the art can make several improvements and modifications without departing from the principle of the present invention. These improvements and modifications are also considered to be within the scope of protection of the present invention.
Claims
1. A defect target detection network, characterized in that: include: Twin abnormal attention mechanism sub-network, first scale detection sub-network, second scale detection sub-network and third scale detection sub-network; The output end of the twin anomaly attention mechanism sub-network is connected to the input end of the first scale detection sub-network; The first output end of the first scale detection sub-network is connected to the first input end of the second scale detection sub-network, the second output end of the first scale detection sub-network is connected to the second input end of the second scale detection sub-network, the third output end of the first scale detection sub-network is connected to the first input end of the third scale detection sub-network; the output end of the second scale detection sub-network is connected to the second input end of the third scale detection sub-network; The twin abnormal attention mechanism sub-network includes the twin's first Focus module, the twin's second Focus module, the twin's first C2f module, the ACM module and the twin's third Focus module; the first Focus module is connected to the second Focus module; the second Focus module is connected to the first C2f module; the first C2f module is connected to the third Focus module; the third Focus module is connected to the ACM module.
2. The defect target detection network according to claim 1, characterized in that: The first Focus module includes a first twin Focus submodule and a second twin Focus submodule in parallel and sharing weights; the second Focus module includes a third twin Focus submodule and a fourth twin Focus submodule in parallel and sharing weights; the first C2f module includes a first twin C2f submodule and a second twin C2f submodule in parallel and sharing weights; the third Focus module includes a fifth twin Focus submodule and a sixth twin Focus submodule in parallel and sharing weights; Among them, the output end of the first twin Focus submodule is connected to the input end of the third twin Focus submodule; the output end of the third twin Focus submodule is connected to the input end of the first twin C2f submodule; the output end of the first twin C2f submodule is connected to the input end of the fifth twin Focus submodule; the output end of the fifth twin Focus submodule is connected to the first input end of the ACM module; the output end of the second twin Focus submodule is connected to the input end of the fourth twin Focus submodule; the output end of the fourth twin Focus submodule is connected to the input end of the second twin C2f submodule; the output end of the second twin C2f submodule is connected to the input end of the sixth twin Focus submodule; the output end of the sixth twin Focus submodule is connected to the second input end of the ACM module; the output end of the ACM module is connected to the input end of the first scale detection subnetwork.
3. The defect target detection network as claimed in claim 1, characterized in that: The output of the ACM module is as follows: Among them, F∈R B×C×H×W represents the input training image, represents the corresponding reference image, R represents a real number set, B represents the batch size, C represents the number of image channels, H represents the image height, W represents the image width, and R B×C×H×W is a four-dimensional tensor in which each element is a real number and the shape of the tensor is determined by the four dimensions B, C, H, and W. {;} represents the concatenation operation, and f c Represents 1*1 convolution.
4. The defect target detection network according to claim 1, characterized in that: The first Focus module, the second Focus module, the first C2f module and the third Focus module are trained using shared weights.
5. The defect target detection network as claimed in claim 1, characterized in that: The first scale detection sub-network includes: a first C2fGhost module, a seventh Focus module, a second C2fGhost module, an eighth Focus module, a third C2fGhost module, an SPPF module, a fourth C2fGhost module, a fifth C2fGhost module, a first splicing module, a first upsampling module, a second splicing module, a second upsampling module and a first AMBC detection module; the input end of the first C2fGhost module is connected to the output end of the twin abnormal attention mechanism sub-network; the first output end of the fourth C2fGhost module is connected to the first input end of the second scale detection sub-network; the output end of the fifth C2fGhost module is connected to the second input end of the second scale detection sub-network; the output end of the SPPF module is connected to the first input end of the third scale detection sub-network; Among them, the first output end of the first C2fGhost module is connected to the input end of the seventh Focus module, and the second output end of the first C2fGhost module is connected to the first input end of the first splicing module; the output end of the seventh Focus module is connected to the input end of the second C2fGhost module; the first output end of the second C2fGhost module is connected to the input end of the eighth Focus module, and the second output end of the second C2fGhost module is connected to the first input end of the second splicing module; the output end of the eighth Focus module is connected to the input end of the third C2fGhost module; the output end of the third C2fGhost module is connected to the input end of the The output end of the SPPF module is connected to the input end of the SPPF module; the output end of the SPPF module is connected to the input end of the first upsampling module; the output end of the first upsampling module is connected to the second input end of the second splicing module; the second splicing module is connected to the input end of the fourth C2fGhost module; the second output end of the fourth C2fGhost module is connected to the input end of the second upsampling module; the output end of the second upsampling module is connected to the second input end of the first splicing module; the output end of the first splicing module is connected to the input end of the fifth C2fGhost module; the output end of the fifth C2fGhost module is connected to the input end of the first AMBC detection module.
6. The defect target detection network according to claim 1, characterized in that: The second scale detection sub-network includes a first Conv module, a third splicing module, a sixth C2fGhost module and a second AMBC detection module; the input end of the first Conv module is connected to the second output end of the first scale detection sub-network; the second input end of the third splicing module is connected to the first output end of the first scale detection sub-network; the first output end of the sixth C2fGhost module is connected to the second input end of the third scale detection sub-network; Among them, the output end of the first Conv module is connected to the first input end of the third splicing module, the output end of the third splicing module is connected to the input end of the sixth C2fGhost module; the second output end of the sixth C2fGhost module is connected to the input end of the second AMBC detection module.
7. The defect target detection network as claimed in claim 1, characterized in that: The third scale detection sub-network includes a second Conv module, a fourth splicing module, a seventh C2fGhost module and a third AMBC detection module; the input end of the second Conv module is connected to the output end of the second scale detection sub-network; the first input end of the fourth splicing module is connected to the first output end of the first scale detection sub-network; Among them, the output end of the second Conv module is connected to the first input end of the fourth splicing module; the output end of the fourth splicing module is connected to the input end of the seventh C2fGhost module; the output end of the seventh C2fGhost module is connected to the input end of the third AMBC detection module.
8. The defect target detection network according to any one of claims 2 to 7, characterized in that: Each C2fGhost module includes a first Conv sublayer, a second Conv sublayer, a Split sublayer, a first GhostBottleneck sublayer, a second GhostBottleneck sublayer and a splicing submodule; Among them, the output end of the first Conv sublayer is connected to the input end of the Split sublayer; the first output end of the Split sublayer is connected to the input end of the first GhostBottleneck sublayer; the first output end of a GhostBottleneck sublayer is connected to the input end of the second GhostBottleneck sublayer; the first output end of the second GhostBottleneck sublayer is connected to the first input end of the splicing submodule; the second input end of the splicing submodule is respectively connected to the second output ends of the two GhostBottleneck sublayers and the second input end of the Split sublayer; the output end of the splicing submodule is connected to the input end of the second Conv sublayer.
9. The defect target detection network according to any one of claims 2 to 7, characterized in that: Each AMBC detection module includes a first amoeba convolution circuit network and a second amoeba convolution circuit network; An input end of the first amoeba convolution circuit network is connected to an input end of the second amoeba convolution circuit network; Among them, the first amoeba convolution circuit network includes a first AMBConv layer, a second AMBConv layer, a first Conv2d layer and a BoxLoss layer connected in series in sequence; the input end of the first AMBConv layer is connected to the input end of the second amoeba convolution circuit network; the second amoeba convolution circuit network includes a third AMBConv layer, a fourth AMBConv layer, a second Conv2d layer and a ClsLoss layer connected in series in sequence; the input end of the third AMBConv layer is connected to the input end of the first amoeba convolution circuit network.
10. A defect target detection method, characterized in that: The method is implemented using the defect target detection network as described in any one of claims 1 to 9.
Citation Information
Patent Citations
Defect detection system and method utilizing template comparison based on twin neural network
CN111179251A
Multi-scale target perception classification method and system based on twin network
CN116912574A
Road defect real-time detection method, system and equipment and storage medium
CN117078591A
Substation defect discrimination method and system
CN117115727A
Strip steel camouflage surface defect detection network and method
CN117392111A
Cited By
PCB defect detection method and device, storage medium and electronic equipment
CN119904429A
