Search

CN-122023337-A - Defect detection method, system and terminal for ceramic-based printed circuit board based on DETR-Core

CN122023337ACN 122023337 ACN122023337 ACN 122023337ACN-122023337-A

Abstract

The invention discloses a ceramic-based printed circuit board defect detection method, system and terminal based on DETR-Core, firstly, a high-resolution defect image is acquired through an industrial camera, a corresponding data set is constructed, and sample data redundancy is reduced through preprocessing, so that dependence on hardware is reduced. Then, a ceramic-based printed circuit board defect detection model is built based on the DETR-Core, and a PatchCore abnormality score calculation module is designed, so that differences and abnormal areas between samples to be detected and good samples can be analyzed efficiently. The AFA multi-scale feature aggregation module is designed, the characterization capability of the model on fine grain texture defects is enhanced, and the sensitivity and the discrimination capability of the model on abnormal defect areas are improved. Finally, an adaptive multi-head attention mechanism is introduced into the adaptive multi-head attention decoding module, so that the memory, the memory and the computing overhead caused by the multi-head attention mechanism and the multi-scale deformable attention are obviously reduced, the computing consumption and the memory occupation of the model are effectively reduced, and the accuracy of defect detection is improved.

Inventors

  • CHEN CHUNGEN
  • JIANG YUXI
  • GAO YONGLI
  • WEN XING

Assignees

  • 浦江三思光电技术有限公司
  • 上海三思电子工程有限公司

Dates

Publication Date
20260512
Application Date
20260130

Claims (10)

  1. 1. A DETR-Core based ceramic-based printed circuit board defect detection method, the method comprising: step S1, collecting and preprocessing related data of a ceramic circuit board; Step S2, constructing a ceramic-based printed circuit board data set based on the preprocessed ceramic circuit board related data, wherein the ceramic-based printed circuit board data set comprises a good ceramic-based circuit board data set and a ceramic-based circuit board defect data set related to various common circuit defect types, wherein the common circuit defect types comprise circuit cracks, rectangular cracks, circuit damage and circuit offset; step S3, training and obtaining a ceramic-based printed circuit board defect detection model based on DETR-Core based on a ceramic-based printed circuit board data set, wherein the ceramic-based printed circuit board defect detection model comprises a multi-scale feature extraction module, a PatchCore anomaly score calculation module, an AFA multi-scale feature aggregation module and a self-adaptive multi-head attention decoding module; and S4, obtaining a corresponding line defect detection result according to the picture of the ceramic circuit board to be detected by utilizing a ceramic-based printed circuit board defect detection model based on the DETR-Core.
  2. 2. The DETR-Core based ceramic matrix printed circuit board defect detection method of claim 1, wherein step S1 comprises: collecting a high-resolution ceramic circuit board defect image through an industrial camera; And marking the type of the line defect of the ceramic circuit board defect image, cutting the ceramic circuit board defect image into small-size images according to a certain overlapping proportion, cleaning data by using a SIFT algorithm, and eliminating subgraphs with fewer characteristic points.
  3. 3. The DETR-Core based ceramic matrix printed circuit board defect detection method according to claim 1, wherein step S3 comprises: setting an evaluation index, wherein the evaluation index comprises an accuracy rate, a recall rate and an average accuracy mean value; training a DETR-Core based ceramic-based printed circuit board defect detection model using a training set in a ceramic-based printed circuit board dataset; The trained DETR-Core based ceramic-based printed circuit board defect detection model is tested using a test set of ceramic-based printed circuit board data sets and an evaluation index is obtained.
  4. 4. The DETR-Core based ceramic-based printed circuit board defect detection method according to claim 1, wherein the PatchCore anomaly score calculation module is configured to integrate multi-scale features of good sample images of good ceramic-based circuit board datasets extracted by the multi-scale feature extraction module into a multi-scale good feature library, and combine the multi-scale features into a Core subset feature library by adopting a greedy Core set sampling method, and is further configured to perform nearest neighbor search on the multi-scale features of the ceramic-based circuit board images to be detected extracted by the multi-scale feature extraction module and features in the Core subset feature library, and calculate an anomaly score for feature mapping of each scale.
  5. 5. The DETR-Core based ceramic-based printed circuit board defect detection method of claim 4, wherein the integrating the multi-scale features of the good sample images of the good ceramic-based circuit board data sets extracted by the multi-scale feature extraction module into the multi-scale good feature library and combining the same into the Core subset feature library by adopting a greedy Core set sampling method comprises: acquiring ResNet to extract three features with different scales from each good sample image by using pre-training; The multi-scale features of each good sample image are aggregated through self-adaptive average pooling and integrated into a good feature library, and the process expression is as follows: ; ; ; Wherein, the An input picture representing a good sample image; the first of the representations ResNet50 The layer of the material is formed from a layer, ; , , Output feature maps for layers 2,3,4, resNet, respectively; representing an adaptive average pooling layer; Representing the polymerized multi-scale features; Representing the generated good product feature library; and removing redundant features of the good product feature library by adopting a greedy core set sampling method, and finally obtaining a core subset feature library, wherein the process expression is as follows: ; ; Wherein, the And Respectively belonging to good product feature libraries Feature library of core subset Is an element of (2); representing the most similar characteristic elements.
  6. 6. The DETR-Core based ceramic-based printed circuit board defect detection method of claim 5, wherein the performing nearest neighbor search on the multi-scale features of the ceramic-based circuit board picture to be detected extracted by the multi-scale feature extraction module and features in the Core subset feature library, and calculating an anomaly score for the feature map of each scale comprises: calculating the maximum Euclidean distance between the multi-scale features of the input ceramic-based circuit board picture to be detected and the features in the core subset feature library by adopting a nearest neighbor search algorithm The process expression is as follows: ; ; Wherein, the And Respectively representing the input multiscale characteristics of the to-be-detected ceramic-based circuit board picture and the core subset characteristics in a core subset characteristic library; Representing the core subset features most similar to the features of the ceramic-based circuit board picture to be detected; representing Euclidean distance between features of the ceramic-based circuit board picture to be detected and features of the core subset; multiplying Euclidean distance between the characteristics of the ceramic-based circuit board picture to be detected and the characteristics of the core subset by a weight to obtain a final abnormal score, wherein the calculation formula is as follows: ; Wherein, the Representing the pattern between the pattern library of the core subset and the pattern of the ceramic-based circuit board to be detected, The most similar core subset features; Indicating the resulting final anomaly score.
  7. 7. The DETR-Core based ceramic-based printed circuit board defect detection method of claim 6, wherein the AFA multiscale feature aggregation module uses a U-Net network as a base frame, normalizes the anomaly score output by the PatchCore anomaly score computation module by a softmax function, performs weighted fusion with multiscale features of a ceramic-based circuit board picture to be detected in a special attention mechanism form, and then passes through The convolution of the input characteristic channel number is converted into the channel number of the middle hidden layer, then a RepVGG module with structural heavy parameterization is introduced to further polymerize the fused characteristics to obtain polymerized characteristics, and the process expression comprises the following steps: ; ; ; ; ; Wherein, the Representing a softmax function; indicating that the convolution kernel is of size Is a convolution of (1); A representation RepVGG module; representing a bilinear upsampling function; Representing a flat function; Representing characteristic stitching; a convolution downsampling representing a step size of 2; 、 、 representing three different scale feature maps, respectively.
  8. 8. The DETR-Core based ceramic-based printed circuit board defect detection method of claim 7, wherein the adaptive multi-headed attention decoding module learns correlations between characteristic channels by dynamic partial convolution and adaptively calculates an optimal channel division ratio according to the calculation formula: ; Wherein, the Representing the first of a learnable binary gate vector An element; Indicating the number of channels of the hidden layer; The learned segmentation proportion is applied to the input features, and the input features are segmented into a first feature and a second feature according to channel dimension segmentation: , ; Multi-headed attention decoding of the second feature is expressed as: ; ; ; ; Wherein, the , , Respectively represent the first Of individual heads Is a weight matrix of (2); Represent the first Outputting individual heads; Representing a linear transformation matrix; performing enhancement processing on the second feature subjected to multi-head attention decoding by adopting multi-scale deformable attention, wherein the processing expression is as follows: ; Wherein, the Representing an input feature map starting from scale 1; And Respectively represent the first Individual dimensions and the first Sampling points; And Respectively shown in the first Individual dimensions and the first Attention to the first position under the head Attention weight and offset of each sampling point, using Normalizing the coordinates; Readjusting normalized coordinates To the first A dimension; splicing the second characteristic after multi-head attention decoding and enhancement processing with the first characteristic, and finally outputting a defect area positioning frame and the confidence coefficient of each defect by using two multi-layer perceptron, wherein the process expression is as follows: ; ; ; Wherein, the And Indicating the confidence of the last defect localization position and the corresponding confidence, respectively.
  9. 9. A DETR-Core based ceramic-based printed circuit board defect detection system, the system comprising: The data acquisition module is used for acquiring and preprocessing related data of the ceramic circuit board; The data set construction module is connected with the data acquisition module and is used for constructing a ceramic-based printed circuit board data set based on the preprocessed ceramic circuit board related data, wherein the ceramic-based printed circuit board data set comprises a good ceramic-based circuit board data set and ceramic-based circuit board defect data sets related to various common circuit defect types, and the common circuit defect types comprise circuit cracks, rectangular cracks, circuit damage and circuit offset; The model training module is connected with the data set construction module and is used for training and obtaining a ceramic-based printed circuit board defect detection model based on DETR-Core based on the ceramic-based printed circuit board data set, wherein the ceramic-based printed circuit board defect detection model comprises a multi-scale feature extraction module, an AFA multi-scale feature aggregation module and a self-adaptive multi-head attention decoding module; and the defect detection module is connected with the model training module and is used for obtaining a corresponding line defect detection result according to the picture of the ceramic circuit board to be detected by utilizing the ceramic-based printed circuit board defect detection model based on the DETR-Core.
  10. 10. An electronic terminal is characterized by comprising one or more memories and one or more processors; the one or more memories are used for storing computer programs; the one or more processors being connected to the memory for running the computer program to perform the method of any one of claims 1 to 8.

Description

Defect detection method, system and terminal for ceramic-based printed circuit board based on DETR-Core Technical Field The invention belongs to the technical field of PCB defect detection, and particularly relates to a method, a system and a terminal for detecting defects of a ceramic-based printed circuit board based on DETR-Core. Background Ceramic substrates have found wide application in the fields of optoelectronic devices, electric vehicles, high power electronics, and the like, due to their excellent thermal conductivity, load carrying capacity, and mechanical strength. However, in the large-scale high-precision manufacturing process, the ceramic-based printed circuit board has fine defects such as circuit breakage, offset, leakage printing, partial falling and the like easily caused by complex process and extremely strict requirements on precision, so that the consistency and reliability of products are affected. Although the automatic optical detection technology taking machine vision as a core can acquire images through a high-speed camera and perform defect identification by combining image processing and a pattern recognition algorithm, the technology has more mature progress, but has higher equipment cost and higher manual training requirement, so that the popularization of the technology in small and medium enterprises is limited. In recent years, deep learning techniques have shown great potential in the field of industrial defect detection. By constructing and training an image recognition network aiming at a specific application scene and optimizing the network structure and algorithm, the deep learning method has a remarkable breakthrough in improving the accuracy and instantaneity of a general model, and particularly has an excellent result in the aspect of target recognition. Despite the advances in application of deep learning in industrial inspection in other fields, high-precision inspection research for micro-line defects of ceramic-based printed circuit boards is still lacking. This problem arises mainly from the special material properties of the ceramic substrate, the process characteristics and the low resolution of defects, which present a great challenge for inspection. In addition, the production of ceramic-based printed circuit boards has high requirements on the real-time performance of a detection system, and quick response must be realized while the detection precision is ensured. Therefore, how to realize the light weight and high efficiency of the model on the premise of ensuring the detection effect has become a core problem for pushing the breakthrough of the ceramic-based printed circuit board automatic detection technology. Disclosure of Invention Aiming at the defects of the prior art, the invention provides a method, a system and a terminal for detecting the defects of a ceramic-based printed circuit board based on DETR-Core, which are used for solving the technical problems that the traditional defect detection mainly depends on manual visual inspection, the efficiency is low, the automatic optical detection equipment is high in manufacturing cost, and the dependence on hardware is strong. To achieve the above and other related objects, the present invention provides a method for detecting defects of a ceramic-based printed circuit board based on a DETR-Core, which includes the steps of collecting and preprocessing related data of the ceramic-based printed circuit board, the step of constructing a ceramic-based printed circuit board data set related to a plurality of common line defect types based on the preprocessed related data of the ceramic-based printed circuit board, wherein the common line defect types include line breaks, rectangular breaks, line damages and line offsets, the step of obtaining a ceramic-based printed circuit board defect detection model based on the DETR-Core based on training of the ceramic-based printed circuit board data set, the ceramic-based printed circuit board defect detection model including a plurality of feature extraction modules, texture enhancement modules and cross convolution modules, and the step of obtaining a corresponding line defect detection result based on the related data of the ceramic-based printed circuit board to be detected using the ceramic-based printed circuit board defect detection model based on the DETR-Core, and the step of S4. In an embodiment of the invention, the step S1 comprises the steps of collecting a high-resolution ceramic circuit board defect image through an industrial camera, marking the type of line defect on the ceramic circuit board defect image, cutting the ceramic circuit board defect image into small-size images according to a certain overlapping proportion, cleaning data by using a SIFT algorithm, and eliminating subgraphs with fewer characteristic points. In an embodiment of the present invention, step S3 includes: Setting an evaluation index, wherein the evaluation index comprises