Circuit board element layout design defect detection method and device and storage medium
Through the combination of high-resolution camera and X-ray equipment, the defect detection model of the autoencoder model and the defect detection model is carried out to carry out multi-stage circuit board component layout design defect detection, solving the problems of high detection complexity and low accuracy in the existing technology, and achieving more Efficient and more accurate circuit board component layout design defect detection.
Patent Information
- Application Number
- CN202410934599.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-12
- Publication Date
- 2024-11-01
AI Technical Summary
The existing circuit board component layout design defect detection methods are complex, resource consumption is high, and the accuracy is low. It cannot effectively detect internal hidden defects, and there are many false detection and missed detection.
Using high-resolution cameras and X-ray equipment combined with autoencoder model and defect detection model, the surface and internal images of the circuit board are obtained through multi-stage detection process and comprehensive calibration rules, and the consistent and differential data sets are separated, and the preliminary and component layout are input. Design a defect detection model, combine expert annotation to conduct comprehensive inspection and calibration.
It improves the accuracy and reliability of defect detection of circuit board component layout design, reduces false detection and missed detection rates, enhances the detection ability of internal and external defects, and ensures the accuracy and reliability of detection results.
Smart Images

Figure CN118883597A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of PCB defect detection, and in particular to a circuit board component layout design defect detection method, device and storage medium. Background Art
[0002] Printed Circuit Board (PCB) is a core component of electronic products, and its design and manufacturing quality directly affect the performance and reliability of electronic products. The components on the circuit board include active components (such as integrated circuits, diodes and transistors), passive components (such as resistors, capacitors and inductors), connection components (such as connectors and terminal blocks) and other components (such as transformers, relays and crystal oscillators). Circuit board component layout refers to the reasonable arrangement of electronic components on the circuit board. When designing the layout, it is necessary to follow the principles of functionality and signal integrity, thermal management, power supply and grounding design, electromagnetic compatibility (EMC) and manufacturing process. With the increasing miniaturization and high density of electronic products, the layout of components on the circuit board has become more and more complex. Design defects may lead to reduced product performance or even failure of the entire system.
[0003] In existing research, a Chinese patent with application number CN202210081797.7 proposes a method, device and storage medium for detecting design defects of component layout of circuit boards. By detecting whether there are design defects of component layout of circuit boards in a three-dimensional simulation scene. The method includes: generating a detection line according to the circuit board layout design specification; generating detection data according to the detection line, target components and multiple components assembled on the circuit board, including obtaining the type information, three-dimensional model and position information of the components, comparing whether the projection of the detection line and the components on the first plane parallel to the circuit board coincide; generating detection data to indicate the defect when the projection coincides. The method can discover and correct layout design defects in the early stage of production, avoid rework and scrap in the later stage of production, and reduce production costs. However, the method is highly complex and requires a high level of technology to construct a three-dimensional simulation scene and run the detection algorithm; and the resource consumption is large when running the method, and a large amount of computing resources and time are required to process three-dimensional data and run complex algorithms; the initial investment and maintenance costs are high. The Chinese patent with application number CN202210694133.8 proposes a printed circuit board defect detection model training method and a defect detection method. The design document information (including layer information and area block location information) and scanned images of the printed circuit board are obtained; based on these data, learning samples are generated, each sample includes a local image and manually marked label information (layer information, area block location information and defect information); a sample library is established to collect and store learning samples of multiple printed circuit boards; the basic model is trained using the learning samples in the sample library to obtain a defect detection model. The training process includes a first learning submodule that performs preliminary learning based on the image and defect information to generate an intermediate model, a second learning submodule that learns the layer information and area block location information in the label, and combines these feature information with the intermediate model to re-learn the sample image, and finally obtains a printed circuit board defect detection model. Finally, the image of the printed circuit board to be detected and its layer information and / or area block location information are obtained, and input into the pre-trained printed circuit board defect detection model, and the model outputs the detection result. However, the training effect of the model is highly dependent on the quality and diversity of the sample library. If the sample is insufficient or the quality is not high, the model performance may be limited. The design document information (such as layer information and area block location information) must be accurate. Any error will cause deviations in the generated learning samples and model training, thereby affecting the accuracy of the detection results. Scholar Liu Zhihang built a PCB defect image super-resolution reconstruction model based on improved SRGAN and a lightweight PCB defect detection model based on improved YOLOv5s in "Super-resolution Reconstruction and Defect Detection of Printed Circuit Board Images Based on Deep Learning". The improved SRGAN model uses VIT and high-frequency extraction modules to build a generator network, and uses VIT and inverted residual modules to build a discriminator to generate high-quality reconstructed images and reduce the model space complexity.Although the super-resolution reconstruction model in this method can improve image quality, in some cases, the reconstructed high-resolution image may introduce artifacts or distortion, affecting the subsequent defect detection results.
[0004] In summary, although visual image detection is widely used in circuit board component layout design defect detection, it also has limitations. Visual images are mainly used for surface detection and cannot penetrate the inside of the circuit board. Therefore, internal hidden defects cannot be detected. At the same time, false detection and missed detection occur from time to time, and the overall accuracy of circuit board component layout design defect detection needs to be improved.
[0005] To this end, a circuit board component layout design defect detection method, device and storage medium are proposed. Summary of the invention
[0006] The object of the present invention is to provide a circuit board component layout design defect detection method, device and storage medium. First, the original design file of the circuit board to be detected is obtained, and a component layout rule library is established. Then, a high-resolution camera is used to capture and preprocess the image to obtain a first preprocessed image to be detected. The trained first autoencoder model is used to divide it into a first consistent layout data set and a first difference layout data set. The first consistent layout data set is input into a preliminary defect detection model, and a first defect detection result is output. The circuit board is scanned using an X-ray device to obtain an X-ray image, and the preprocessed X-ray image is divided into a second consistent layout data set and a second difference layout data set using a trained second autoencoder model. The second consistent layout data set is input into an X-ray defect detection model, and a second defect detection result is output. The first and second difference layout data sets are input into an expert annotation system to obtain an expert annotation result. Finally, according to all the detection results and expert annotation results, a comprehensive layout design defect detection result is obtained, and calibration is performed through the component layout rule library to obtain a final calibration result.
[0007] To achieve the above object, the present invention provides the following technical solutions:
[0008] As a first aspect of the present application, the present application provides a circuit board component layout design defect detection method, comprising:
[0009] Acquire the original design file of the circuit board to be tested to obtain a first design file;
[0010] Acquire various design parameters and layout rules in the first design file, and establish a component layout rule library;
[0011] Using a high-resolution camera to capture a surface image of the circuit board to be inspected to obtain a first surface image;
[0012] Preprocessing the first surface image to obtain a first preprocessed image to be inspected;
[0013] Using the trained first autoencoder model, the first pre-processed image to be inspected is divided into a first consistent layout data set and a first difference layout data set;
[0014] Inputting the first consistent layout data set into a trained preliminary defect detection model, and outputting a first defect detection result;
[0015] Scan the circuit board to be inspected using an X-ray device to obtain an internal structure image to obtain an X-ray image;
[0016] Using the trained second autoencoder model, the preprocessed X-ray image is divided into a second consistent layout data set and a second difference layout data set;
[0017] Inputting the second consistent layout data set into the trained X-ray defect detection model to obtain a second defect detection result;
[0018] Inputting the first difference layout data set and the second difference layout data set into an expert annotation system to obtain an expert annotation result;
[0019] Obtaining a comprehensive layout design defect detection result according to the first defect detection result, the second defect result and the expert annotation result;
[0020] The integrated layout design defect detection result is calibrated according to the component layout rule library to obtain an integrated layout design defect detection calibration result.
[0021] Furthermore, the circuit boards to be tested are multiple circuit boards produced in the same batch according to the same first design file.
[0022] Further, the first design file has passed the design check and simulation check;
[0023] The design check includes: pin connection error check, power and ground rule check, component size check, spacing requirement check, high-frequency signal routing length check, path check, thermal design check and heat dissipation requirement check;
[0024] The simulation check specifically includes: using SPICE simulation to verify the electrical performance of the circuit design in the first design file; using 3D simulation tools to perform mechanical simulation to check the mechanical compatibility of component layout; performing thermal analysis to check the heat dissipation path and thermal management solution of high-heat components.
[0025] Furthermore, it also includes:
[0026] Collecting a specified number of circuit board surface images, the circuit board surface images include normal and different defect categories, annotating the circuit board surface images, annotating the defect categories and defect locations, and obtaining an annotated circuit board image set; the annotated circuit board image set is used to train the preliminary defect detection model and the first autoencoder model; the annotated defect categories include component layout design defects and manufacturing defects;
[0027] A specified number of X-ray images of the inside of a circuit board are collected, wherein the X-ray images of the inside of the circuit board include normal images and images of different defect categories, and the X-ray images of the inside of the circuit board are labeled with defect categories and defect locations to obtain a labeled X-ray image set; the labeled X-ray image set is used to train the X-ray defect detection model and the second autoencoder model.
[0028] Further, using the trained first autoencoder model to divide the first preprocessed image to be inspected into the first consistent layout data set and the first difference layout data set, and using the trained second autoencoder model to divide the preprocessed X-ray image into the second consistent layout data set and the second difference layout data set are specifically:
[0029] Training the first autoencoder model using the labeled circuit board image set;
[0030] Reconstruct the first pre-processed image to be inspected using the trained first autoencoder model, and calculate a first reconstruction error; if the first reconstruction error is less than a preset threshold, classify the corresponding first pre-processed image to be inspected into the first consistent layout data set; otherwise, classify the corresponding first pre-processed image to be inspected into the first different layout data set;
[0031] Training the second autoencoder model using the labeled X-ray image set;
[0032] Use the trained second autoencoder model to reconstruct the preprocessed X-ray image and calculate the second reconstruction error; if the second reconstruction error is less than a preset threshold, the corresponding preprocessed X-ray image is included in the second consistent layout data set; otherwise, the corresponding preprocessed X-ray image is included in the second difference layout data set.
[0033] Further, inputting the first consistent layout data set into the trained preliminary defect detection model, and outputting the first defect detection result further comprises: inputting the first consistent layout data set into the trained preliminary defect detection model to obtain a preliminary defect detection result; extracting a region of interest according to the preliminary defect detection result to obtain a region of interest data set, wherein the region of interest data set includes all defect regions marked in the preliminary detection result;
[0034] Inputting the region of interest data set into a trained component layout design defect detection model for defect detection to obtain the first defect detection result; the training process of the component layout design defect detection model includes:
[0035] A specified number of circuit board surface images are collected, wherein the circuit board surface images include normal and different defect categories, and the circuit board surface images are annotated with defect categories and defect locations to obtain an annotated circuit board image set; and the component layout design defect detection model is trained using the annotated circuit board image set.
[0036] Furthermore, the preliminary defect detection model is a YOLOv5 model; and the component layout design defect detection model is a Faster R-CNN model.
[0037] Further, the integrated layout design defect detection result is calibrated according to the component layout rule library, and the integrated layout design defect detection calibration result is obtained, including:
[0038] The integrated layout design defect detection result includes a defect type and a defect location; a defect area is obtained according to the defect location; the first consistent layout data set and the second consistent layout data set are recorded as an original image set; for each defect d in the integrated layout design defect detection result i , define a rectangular area B (d i ):
[0039] For each of the defects d i , according to the rectangular area B(d i ) intercepting a sub-image from the corresponding original image set; obtaining a plurality of defect context images;
[0040] According to the parameters in the component layout rule library, a comprehensive calibration rule is defined to eliminate non-component layout design defects; the comprehensive calibration rule includes a component spacing calibration rule, an electrical connection calibration rule and a layout consistency calibration rule;
[0041] For each defect d in the comprehensive layout design defect detection result i , apply the comprehensive calibration rule to obtain a set of calibration results:
[0042] A={C dist (d i ),C conn (d i ),C layout (d i )};
[0043] Wherein, A represents the calibration result set; i represents the index of the defect; d i represents the defect in the i-th integrated layout design defect detection result; C dist represents the component spacing calibration rule; C conn Indicates the electrical connection calibration rule; C layout representing said layout consistency calibration rule;
[0044] Extract the minimum allowable spacing D of components from the component layout rule library min ; For each of the defects d in the comprehensive layout design defect detection result i , according to the corresponding defect context image, calculate the actual distance D of the involved components act ;
[0045] The component spacing calibration rules are specifically as follows:
[0046]
[0047] Extracting electrical connection rules from the component layout rule library, including component pairs that must be connected or prohibited from being connected;
[0048] For each of the defects d i , check whether the electrical connections involved comply with the regulations;
[0049] The electrical connection calibration rules are specifically as follows:
[0050]
[0051] For each of the defects d in the comprehensive layout design defect detection result i , extract the layout information L of each component from its corresponding defect context image act ; Extract the layout information L corresponding to the component from the component layout rule library design ;
[0052] The layout consistency calibration rules are specifically as follows:
[0053]
[0054] If the calibration result set meets the determination condition, the corresponding defect is removed from the comprehensive layout design defect detection result to obtain the comprehensive layout design defect detection calibration result;
[0055] The judgment condition is: C dist (d i )=1 and C conn (d i )=1 and C layout(d i )=1.
[0056] As a second aspect of the present application, the present application provides a circuit board component layout design defect detection device, comprising:
[0057] A design rule extraction unit is used to obtain the original design file of the circuit board to be tested to obtain a first design file; obtain various design parameters and layout rules in the first design file to establish a component layout rule library;
[0058] A surface image acquisition unit, used for acquiring a surface image of the circuit board to be inspected using a high-resolution camera to obtain a first surface image;
[0059] A surface image preprocessing unit, used for preprocessing the first surface image to obtain a first preprocessed image to be inspected;
[0060] A first autoencoder division unit, configured to divide the first pre-processed image to be inspected into a first consistent layout data set and a first difference layout data set using a trained first autoencoder model;
[0061] a component layout design defect detection unit, configured to input the first consistent layout data set into a trained component layout design defect detection model and output a first defect detection result;
[0062] An X-ray image acquisition unit, used to use an X-ray device to scan the circuit board to be inspected, obtain an internal structure image, and obtain an X-ray image;
[0063] An X-ray surface image preprocessing unit, used for preprocessing the X-ray image;
[0064] A second autoencoder division unit, configured to divide the preprocessed X-ray image into a second consistent layout data set and a second difference layout data set using a trained second autoencoder model;
[0065] An X-ray defect detection unit, configured to input the second consistent layout data set into a trained X-ray defect detection model to obtain a second defect detection result;
[0066] an expert annotation unit, configured to input the first difference layout data set and the second difference layout data set into an expert annotation system to obtain an expert annotation result;
[0067] A comprehensive detection result unit, used to obtain a comprehensive layout design defect detection result according to the first defect detection result, the second defect result and the expert marking result;
[0068] The calibration unit is used to calibrate the comprehensive layout design defect detection result according to the component layout rule library to obtain a comprehensive layout design defect detection calibration result.
[0069] As a third aspect of the present application, the present application provides a computer-readable storage medium, wherein the storage medium stores a computer program, and the computer program is used to execute the above-mentioned circuit board component layout design defect detection method.
[0070] Compared with the prior art, the present invention has the following beneficial effects:
[0071] 1. The present invention introduces an autoencoder model to improve the accuracy of defect detection. Since circuit board defects are usually irregular, and the same circuit board may have different types of defects, and the same defects also have diversity in features such as shape, size and color, the trained preliminary defect detection model can only detect specific types of defects. Therefore, a method that can detect defects of various styles is needed to avoid missed detections. When the image to be inspected is significantly different from the training sample, directly using the trained preliminary defect detection model for defect detection will result in reduced model accuracy. By reconstructing the preprocessed image and calculating the reconstruction error through the trained autoencoder model, the image to be inspected can be effectively distinguished, the detection process can be optimized, and it helps to improve the accuracy of defect detection in the overall component layout design.
[0072] 2. The present invention adopts a multi-stage detection process, and realizes efficient and accurate defect detection through the combination of a preliminary defect detection model and a component layout design defect detection model. Since component layout design defects and manufacturing defects may show similar features in appearance, it is often difficult to distinguish them intuitively in circuit board detection, which can easily lead to misdetection. The preliminary defect detection model in the present invention can comprehensively identify various defects in circuit board images, including component layout design defects and manufacturing defects. The preliminary defect detection model is used to extract regions of interest, concentrate on processing potential defect areas, and reduce interference from irrelevant areas, thereby improving the accuracy of detection. The component layout design defect detection model is trained based on circuit board surface images, which include normal circuit boards and circuit boards with various types of layout design defects. The model focuses on detecting component layout design defects and has higher pertinence. This model can effectively filter false detections and missed detections, and significantly improve the accuracy of component layout design defect detection.
[0073] 3. The present invention introduces comprehensive calibration rules and calibrates the comprehensive layout design defect detection results according to the component layout rule base, thereby effectively improving the accuracy and reliability of detection. This method accurately distinguishes and excludes non-component layout design defects by defining and applying component spacing calibration rules, electrical connection calibration rules, and layout consistency calibration rules, reducing false detection rates and missed detection rates, ensuring that only true component layout design defects are identified, and reducing interference from irrelevant defects. By defining a rectangular area containing the surrounding area for each defect and capturing a defect context image, fine-grained analysis can be performed to provide more detailed and comprehensive detection results. The defect context image includes not only the defect itself, but also the surrounding layout information, which helps to more accurately analyze and locate defects and improve the accuracy of detection. Overall, the reliability and accuracy of component layout design defect detection are effectively improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0074] Figure 1 A schematic diagram of a circuit board production process provided by an embodiment of the present invention;
[0075] Figure 2 A circuit board component layout design defect detection method diagram provided by an embodiment of the present invention;
[0076] Figure 3 A schematic diagram of a first surface image provided by an embodiment of the present invention;
[0077] Figure 4 A schematic diagram of a first surface image after preprocessing provided by an embodiment of the present invention;
[0078] Figure 5 A circuit board defect classification diagram provided by an embodiment of the present invention;
[0079] Figure 6 A circuit board manufacturing defect classification diagram provided by an embodiment of the present invention;
[0080] Figure 7 A structural diagram of a circuit board component layout design defect detection device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0081] 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.
[0082] Embodiment 1:
[0083] Circuit board production process Figure 1As shown, it includes design and layout, material procurement, cutting and drilling, lamination and lamination, electroplating, imaging, etching, pad coating application, screen printing, surface treatment, electrical testing and assembly. Design and layout is the first and most critical step, which involves creating the design and layout of the circuit board to ensure that all electronic components can be arranged reasonably to meet the requirements of circuit function, signal integrity, thermal management and electromagnetic compatibility. Good design and layout can improve performance and reliability, reduce production costs, enhance manufacturability, and improve product quality and consistency. Therefore, design and layout play a vital role in the entire circuit board production process.
[0084] Electronics manufacturing factory A focuses on the production of core components for high-end consumer electronic products, including smartphone motherboards, tablet motherboards, and core circuit boards for IoT devices. In order to ensure that each batch of newly designed circuit boards has no layout design defects before mass production, the factory applies a circuit board component layout design defect detection method during the small-scale trial production stage, including:
[0085] See also Figure 2 In S10, the original design file of the circuit board to be tested is obtained to obtain a first design file; each design parameter and layout rule in the first design file is obtained to establish a component layout rule library;
[0086] The process of establishing the component layout rule library in the embodiment of the present application is described in detail below: First, the original design file of the circuit board to be tested is obtained from the design department or design database. This original design file contains detailed design information of the circuit board, including component layout, wiring rules and material specifications. Parse the original design file and extract all design parameters and layout rules from it. For example, the specific location, connection method and electrical parameters of the component. Based on the extracted design parameters and layout rules, establish a component layout rule library. This component layout rule library contains all specifications and standards for testing circuit board design, which is used in the subsequent defect detection process.
[0087] Furthermore, the circuit boards to be tested are multiple circuit boards produced in the same batch according to the same first design file.
[0088] Circuit boards produced in the same batch are produced using the same design files and component layout rules, avoiding quality fluctuations caused by differences in design files or production processes and ensuring the quality consistency of each circuit board.
[0089] Further, the first design file has passed the design check and simulation check;
[0090] The design check includes: pin connection error check, power and ground rule check, component size check, spacing requirement check, high-frequency signal routing length check, path check, thermal design check and heat dissipation requirement check;
[0091] The simulation check specifically includes: using SPICE simulation to verify the electrical performance of the circuit design in the first design file; using 3D simulation tools to perform mechanical simulation to check the mechanical compatibility of component layout; performing thermal analysis to check the heat dissipation path and thermal management solution of high-heat components.
[0092] If there are systematic errors in the design file, these errors will be repeated on all circuit boards produced based on the design file. Troubleshooting the problems in the design file in advance can prevent these systematic errors from spreading in mass production, reduce large-scale rework and material waste, and avoid wasting resources on defect detection. Simulation checks can detect potential problems in the design before actual production, including problems in electrical performance, mechanical compatibility, and thermal management, so that corrections can be made in the design stage. Through design checks and simulation checks, the rationality and accuracy of the first design file are ensured, the credibility of the component layout rule base is improved, and the data foundation is laid for defect detection of subsequent circuit board products.
[0093] See also Figure 2 In S20, a high-resolution camera is used to collect a surface image of the circuit board to be inspected to obtain a first surface image, such as Figure 3 As shown;
[0094] See also Figure 2 S30, preprocessing the first surface image to obtain a first preprocessed image to be inspected;
[0095] As a specific implementation method of this embodiment, the first surface image is taken by a line scan camera, and the preprocessing includes image denoising, image enhancement, grayscale conversion, binarization, edge detection, morphological processing, image alignment and local cropping, and finally all are processed into binary images to eliminate the influence of unbalanced illumination. For the sake of convenience, a defect image and a normal image are selected to form an image pair (defect image-standard image), such as Figure 4 As shown, Figure 4 The 4 preprocessed images in the figure contain two groups of image pairs (the two above are one group, and the two below are one group). The left side are defect images, and the right side are standard images (no defects).
[0096] See also Figure 2 In S40, using the trained first autoencoder model to divide the first pre-processed image to be inspected into a first consistent layout data set and a first difference layout data set;
[0097] Furthermore, it also includes:
[0098] A specified number of circuit board surface images are collected, wherein the circuit board surface images include normal and different defect categories, and the circuit board surface images are annotated with defect categories and defect locations to obtain an annotated circuit board image set; the annotated circuit board image set is used to train the preliminary defect detection model and the first autoencoder model; the annotated defect categories include component layout design defects and manufacturing defects, such as Figure 5 and Figure 6 As shown;
[0099] Component layout design defects fall into several categories, including component location defects, component spacing and density defects, component orientation defects, electrical and signal integrity defects, and thermal and power management defects. On the other hand, manufacturing defects mainly include unreasonable pad size, via location and size issues, irregular wiring, overly dense layout, unreasonable soldering surface design, incorrect manufacturing spacing, unreasonable stacking design, insufficient manufacturing tolerance design, and unreasonable via filling.
[0100] A specified number of X-ray images of the inside of a circuit board are collected, wherein the X-ray images of the inside of the circuit board include normal images and images of different defect categories, and the X-ray images of the inside of the circuit board are labeled with defect categories and defect locations to obtain a labeled X-ray image set; the labeled X-ray image set is used to train the X-ray defect detection model and the second autoencoder model.
[0101] By collecting and annotating circuit board surfaces and X-ray images including normal and different defect categories, we obtain annotated circuit board image sets and annotated X-ray image sets, which are used to train preliminary defect detection models and autoencoder models, providing a data basis for subsequent detection models and autoencoder models. This diverse training data can help the model learn a wider range of features, so that it can more accurately identify and classify different types of defects in practical applications, which can significantly improve the accuracy and reliability of the model. Comprehensive defect annotation covers component layout design defects and manufacturing defects, giving the detection system comprehensive detection capabilities. Rich annotated data enhances the generalization ability of the model, reduces false detections and missed detections, and improves production efficiency.
[0102] Further, using the trained first autoencoder model to divide the first preprocessed image to be inspected into the first consistent layout data set and the first difference layout data set, and using the trained second autoencoder model to divide the preprocessed X-ray image into the second consistent layout data set and the second difference layout data set are specifically:
[0103] Training the first autoencoder model using the labeled circuit board image set;
[0104] Reconstruct the first pre-processed image to be inspected using the trained first autoencoder model, and calculate a first reconstruction error; if the first reconstruction error is less than a preset threshold, classify the corresponding first pre-processed image to be inspected into the first consistent layout data set; otherwise, classify the corresponding first pre-processed image to be inspected into the first different layout data set;
[0105] Training the second autoencoder model using the labeled X-ray image set;
[0106] Use the trained second autoencoder model to reconstruct the preprocessed X-ray image and calculate the second reconstruction error; if the second reconstruction error is less than a preset threshold, the corresponding preprocessed X-ray image is included in the second consistent layout data set; otherwise, the corresponding preprocessed X-ray image is included in the second difference layout data set.
[0107] Since the pattern of defects is often unpredictable, it is difficult to describe the defects directly. At present, the defect categories collected and labeled still cannot cover all types, resulting in unsatisfactory detection results of the model for new defect types. Therefore, it is necessary to divide the images to be detected in advance. The first autoencoder model is trained using a set of labeled circuit board images. The model learns the normal feature patterns of the circuit board surface image. The second autoencoder model is trained using a set of labeled X-ray images. The model learns the normal feature patterns of the circuit board internal structure image. If the first reconstruction error is less than the preset threshold, it means that the pre-processed image to be inspected is consistent with the normal circuit board feature pattern learned by the model, otherwise, it means that the pre-processed image to be inspected is significantly different from the training data. Similarly, the pre-processed X-ray image is divided into the second consistent layout data set and the second difference layout data set. It helps to improve the accuracy of overall defect detection.
[0108] See also Figure 2 In S50, inputting the first consistent layout data set into a trained preliminary defect detection model, and outputting a first defect detection result;
[0109] Further, inputting the first consistent layout data set into the trained preliminary defect detection model, and outputting the first defect detection result further comprises: inputting the first consistent layout data set into the trained preliminary defect detection model to obtain a preliminary defect detection result; extracting a region of interest according to the preliminary defect detection result to obtain a region of interest data set, wherein the region of interest data set includes all defect regions marked in the preliminary detection result;
[0110] Inputting the region of interest data set into a trained component layout design defect detection model for defect detection to obtain the first defect detection result; the training process of the component layout design defect detection model includes:
[0111] A specified number of circuit board surface images are collected, wherein the circuit board surface images include normal and different defect categories, and the circuit board surface images are annotated with defect categories and defect locations to obtain an annotated circuit board image set; and the component layout design defect detection model is trained using the annotated circuit board image set.
[0112] In this embodiment, each region is marked with a border of a different color (indicating a different category) and is attached with an ID tag.
[0113] By inputting the first consistent layout data set into the preliminary defect detection model, first performing comprehensive defect category detection (manufacturing defects and component layout design defects) and extracting areas of interest, and then using the component layout design defect detection model for fine detection, the detection accuracy and efficiency can be significantly improved. The preliminary defect detection model quickly screens potential defect areas, optimizes the detection process, and concentrates computing resources on key areas. The component layout design defect detection model trained by annotating the circuit board image set has the ability to refine classification and identify various component layout design defects, which is more targeted, eliminates interference from other types of defects, reduces false detections and missed detections, and improves the detail and accuracy of the detection results.
[0114] Furthermore, the preliminary defect detection model is a YOLOv5 model; and the component layout design defect detection model is a Faster R-CNN model.
[0115] By using YOLOv5 as the preliminary defect detection model and Faster R-CNN as the component layout design defect detection model, the speed and accuracy of detection are significantly improved. The YOLOv5 model quickly screens potential defect areas, which is suitable for real-time detection tasks and greatly improves the efficiency of preliminary detection; the Faster R-CNN model performs fine detection of these areas and provides high-precision defect identification and positioning. The multi-level detection process optimizes the use of computing resources and reduces unnecessary computing burden. YOLOv5 quickly detects a wide range of defects, and Faster R-CNN performs fine-grained classification and positioning, achieving a balance between detection speed and accuracy. The two models complement each other to enhance the robustness and adaptability of the system, enabling the detection system to efficiently and accurately identify and classify various complex defects.
[0116] See also Figure 2 In S60, scanning the circuit board to be inspected using an X-ray device to obtain an internal structure image to obtain an X-ray image;
[0117] The combination of surface images and X-ray images can cover both surface and internal defects of the circuit board. Surface images are mainly used to detect problems such as component layout, pin connections, and surface solder joints. X-ray images can reveal internal connection problems, solder joint quality, interlayer alignment, component shielding, heat dissipation paths for high-heat components, and layout problems of interlayer through holes and blind vias. These problems are difficult to detect in surface images, but through in-depth inspection of X-ray images, potential errors in the design can be discovered and corrected. Combined analysis of surface images and X-ray images can provide comprehensive design inspection results, optimize component layout design, ensure reasonable internal and external structures, and improve the overall performance and quality of the circuit board.
[0118] See also Figure 2 In S70, using the trained second autoencoder model to divide the preprocessed X-ray image into a second consistent layout data set and a second difference layout data set;
[0119] See also Figure 2 In S80, inputting the second consistent layout data set into a trained X-ray defect detection model to obtain a second defect detection result;
[0120] See also Figure 2 In S90, inputting the first difference layout data set and the second difference layout data set into an expert annotation system to obtain an expert annotation result;
[0121] Obtaining a comprehensive layout design defect detection result according to the first defect detection result, the second defect result and the expert annotation result;
[0122] The integrated layout design defect detection result is calibrated according to the component layout rule library to obtain an integrated layout design defect detection calibration result.
[0123] Further, the integrated layout design defect detection result is calibrated according to the component layout rule library, and the integrated layout design defect detection calibration result is obtained, including:
[0124] The integrated layout design defect detection result includes a defect type and a defect location; a defect area is obtained according to the defect location; the first consistent layout data set and the second consistent layout data set are recorded as an original image set; for each defect d in the integrated layout design defect detection result i , define a rectangular area B (d i ):
[0125] For each of the defects d i , according to the rectangular area B(d i) intercepting a sub-image from the corresponding original image set; obtaining a plurality of defect context images;
[0126] As a possible implementation method in this embodiment:
[0127] B(d i )={(x,y)|x min ≤x≤x max ,y min ≤y≤y max};
[0128] Wherein, x represents the horizontal coordinate of the rectangular area, and y represents the vertical coordinate of the rectangular area; min 、x max ,y min and max Determined by the center position of the defect and the specified size of the surrounding area; x min represents the left boundary coordinate of the rectangular area; x max Represents the right boundary coordinate of the rectangular area; y min Represents the lower boundary coordinate of the rectangular area; y max Represents the upper boundary coordinates of the rectangular area;
[0129] According to the parameters in the component layout rule library, a comprehensive calibration rule is defined to eliminate non-component layout design defects; the comprehensive calibration rule includes a component spacing calibration rule, an electrical connection calibration rule and a layout consistency calibration rule;
[0130] For each defect d in the comprehensive layout design defect detection result i , apply the comprehensive calibration rule to obtain a set of calibration results:
[0131] A={C dist (d i ),C conn (d i ),C layout (d i )};
[0132] Wherein, A represents the calibration result set; i represents the index of the defect; d i represents the defect in the i-th integrated layout design defect detection result; C dist represents the component spacing calibration rule; C conn Indicates the electrical connection calibration rule; C layout representing said layout consistency calibration rule;
[0133] Extract the minimum allowable spacing D of components from the component layout rule library min; For each of the defects d in the comprehensive layout design defect detection result i , according to the corresponding defect context image, calculate the actual distance D of the involved components act ;
[0134] The component spacing calibration rules are specifically as follows:
[0135]
[0136] Extracting electrical connection rules from the component layout rule library, including component pairs that must be connected or prohibited from being connected;
[0137] For each of the defects d i , check whether the electrical connections involved comply with the regulations;
[0138] The electrical connection calibration rules are specifically as follows:
[0139]
[0140] For each of the defects d in the comprehensive layout design defect detection result i , extract the layout information L of each component from its corresponding defect context image act ; Extract the layout information L corresponding to the component from the component layout rule library design ;
[0141] The layout consistency calibration rules are specifically as follows:
[0142]
[0143] If the calibration result set meets the determination condition, the corresponding defect is removed from the comprehensive layout design defect detection result to obtain the comprehensive layout design defect detection calibration result;
[0144] The judgment condition is: C dist (d i )=1 and C conn (d i )=1 and C layout (d i )=1.
[0145] In this embodiment, a feasible specific method is provided:
[0146] The layout consistency calibration rule is specifically: extracting the layout information L of each component from the original image set act , including position (x, y coordinates), rotation angle and size;
[0147]
[0148] Extract the layout information L of the corresponding component from the first design file in the component layout rule library design , including position (x, y coordinates), rotation angle and size;
[0149]
[0150] Wherein, i represents the index of the defect in the comprehensive layout design defect detection result; j represents the index of the component; represents the jth component of the i-th defect in the comprehensive layout design defect detection result; represents the abscissa of the jth element in the original image set corresponding to the i-th defect; represents the ordinate of the jth element in the original image set corresponding to the i-th defect; represents the rotation angle of the jth element in the original image set corresponding to the i-th defect, represents the size of the jth component in the original image set corresponding to the i-th defect; represents the abscissa of the jth component in the first design file corresponding to the i-th defect; The ordinate of the jth component in the first design file corresponding to the i-th defect; represents the rotation angle of the jth component in the first design file corresponding to the i-th defect, represents the size of the jth component in the first design file corresponding to the i-th defect;
[0151] Calculate the Euclidean distance between each component position in the first design file and the actual layout (original image set):
[0152]
[0153]
[0154] in, The difference in the abscissa of the jth component representing the i-th defect; The difference in the ordinate of the jth component representing the i-th defect; Represents the position difference of the jth component of the ith defect.
[0155] Calculate the difference in rotation angle of each component in the first design file and the actual layout (original image set):
[0156]
[0157] Calculate the difference in rotation size of each component between the first design file and the actual layout (original image set):
[0158]
[0159] in, The rotational dimensional difference of the jth component representing the ith defect.
[0160] Comprehensive layout consistency determination:
[0161]
[0162] Among them, T position is the defined component spacing threshold; T angle is the defined component rotation angle threshold; T size The size threshold of the defined component.
[0163] By calibrating the comprehensive layout design defect detection results according to the component layout rule library, non-component layout design defects can be effectively eliminated and the false detection rate can be reduced. The calibration process is based on clear component layout rules, such as component spacing, electrical connections, and layout consistency. By comparing the detection results with these predefined rules, false detections can be identified and eliminated. This approach utilizes the previously defined component spacing, electrical connections, and layout consistency calibration rules to further verify and screen the detection results, thereby improving the accuracy of defect detection.
[0164] This circuit board component layout design defect detection method uses high-resolution cameras and X-ray equipment for image acquisition, combined with trained autoencoder models and defect detection models, to achieve high-precision, multi-level defect detection, significantly improving the accuracy and comprehensiveness of detection, eliminating the interference of other types of defects, and focusing more on the identification of component layout design problems, reducing the false detection rate and missed detection rate of component layout design defects, and improving the accuracy of circuit board component layout design defects. The introduction of automated detection processes and expert annotation systems has improved detection efficiency and the authority of results, and calibrated the comprehensive defect detection results through the component layout rule library to ensure compliance with design standards and reduce production risks. This method promptly discovers and corrects potential problems in the small-scale trial production stage, avoiding the risk of quality problems in large-scale production. Through data-driven continuous improvement, reliable quality assurance is provided for electronic product manufacturing.
[0165] Embodiment 2:
[0166] Electronics manufacturing factory B mainly produces core circuit boards for various smart devices. Electronics manufacturing factory B applies a circuit board component layout design defect detection device, such as Figure 7 As shown, including:
[0167] A design rule extraction unit is used to obtain the original design file of the circuit board to be tested to obtain a first design file; obtain various design parameters and layout rules in the first design file to establish a component layout rule library;
[0168] A surface image acquisition unit, used for acquiring a surface image of the circuit board to be inspected using a high-resolution camera to obtain a first surface image;
[0169] A surface image preprocessing unit, used for preprocessing the first surface image to obtain a first preprocessed image to be inspected;
[0170] A first autoencoder division unit, configured to divide the first pre-processed image to be inspected into a first consistent layout data set and a first difference layout data set using a trained first autoencoder model;
[0171] a component layout design defect detection unit, configured to input the first consistent layout data set into a trained component layout design defect detection model and output a first defect detection result;
[0172] An X-ray image acquisition unit, used to use an X-ray device to scan the circuit board to be inspected, obtain an internal structure image, and obtain an X-ray image;
[0173] An X-ray surface image preprocessing unit, used for preprocessing the X-ray image;
[0174] A second autoencoder division unit, configured to divide the preprocessed X-ray image into a second consistent layout data set and a second difference layout data set using a trained second autoencoder model;
[0175] An X-ray defect detection unit, configured to input the second consistent layout data set into a trained X-ray defect detection model to obtain a second defect detection result;
[0176] an expert annotation unit, configured to input the first difference layout data set and the second difference layout data set into an expert annotation system to obtain an expert annotation result;
[0177] A comprehensive detection result unit, used to obtain a comprehensive layout design defect detection result according to the first defect detection result, the second defect result and the expert marking result;
[0178] The calibration unit is used to calibrate the comprehensive layout design defect detection result according to the component layout rule library to obtain a comprehensive layout design defect detection calibration result.
[0179] This embodiment conducted multiple groups of comparative experiments. Experimental Group 1 used the complete distribution detection method (preliminary detection model + component layout design detection model) in Example 1 to detect component layout design defects on the circuit board; Experimental Group 2 removed the X-ray image acquisition and processing steps, and the remaining steps were the same as Experimental Group 1 (only based on the circuit board surface image). Experimental Group 3 removed the step of calibration according to the layout rule library, and the remaining steps were the same as Experimental Group 1. Experiment 4 used a single model detection method (preliminary detection model) to detect component layout design defects on the circuit board, and the remaining steps were the same as Experimental Group 1; Experiment 5 used a single model detection method (component layout design detection model) to detect component layout design defects on the circuit board, and the remaining steps were the same as Experimental Group 1.
[0180] Table 1. Comparative experimental data table
[0181]
[0182] By comparing the experimental data in Table 1, it can be verified that the method in Example 1 is superior in detection accuracy, efficiency and automation. Experimental Group 1 performs best in all indicators, proving the effectiveness and practicality of this method in practical applications.
[0183] Taking experimental group 2 as an example, the confusion matrix of this experimental group is shown in Table 2.
[0184] Table 2. Confusion matrix table of experimental group 2
[0185] Prediction: Normal Prediction: Defects Actual: Normal 48 2 Actual: Defects 9 41
[0186] In this experiment, the detection system classified a total of 100 circuit boards, of which 50 were actually normal circuit boards and the other 50 were actually defective circuit boards. Of the actually normal circuit boards, 48 were correctly classified as normal, but 2 were misclassified as defective (false detection). Of the defective circuit boards, 41 were correctly identified as defective, but 9 were misclassified as normal (missed detection). Therefore, the number of missed detections and the number of false detections in Experimental Group 2 were 9, and the overall detection accuracy was 89%.
[0187] By completing comprehensive PCB component layout design defect detection early in the design process, defective PCBs can be prevented from being mass-produced, ensuring that the design is as defect-free as possible before going into production. This helps to significantly reduce production costs.
[0188] Embodiment three:
[0189] In order to ensure that the newly designed smart home device circuit boards have no layout design defects before mass production, the smart home device manufacturing factory C decided to use a computer program to automatically perform the circuit board component layout design defect detection method. The program is stored in a computer-readable storage medium and executed by the factory's computer system.
[0190] Specifically, it is a computer-readable storage medium, which stores a computer program, and the computer program is used to execute the above-mentioned circuit board component layout design defect detection method.
[0191] A storage medium such as a solid state drive (SSD) or a memory card stores a computer program in advance, which is developed by a professional software development team based on the circuit board component layout design defect detection method in Example 1. The storage medium is inserted into the main computer of the factory detection system.
[0192] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A circuit board component layout design defect detection method, characterized in that: include: Acquire the original design file of the circuit board to be tested to obtain a first design file; Acquire various design parameters and layout rules in the first design file, and establish a component layout rule library; Using a high-resolution camera to capture a surface image of the circuit board to be inspected to obtain a first surface image; Preprocessing the first surface image to obtain a first preprocessed image to be inspected; Using the trained first autoencoder model, the first pre-processed image to be inspected is divided into a first consistent layout data set and a first difference layout data set; Inputting the first consistent layout data set into a trained preliminary defect detection model, and outputting a first defect detection result; Scan the circuit board to be inspected using an X-ray device to obtain an internal structure image to obtain an X-ray image; Using the trained second autoencoder model, the preprocessed X-ray image is divided into a second consistent layout data set and a second difference layout data set; Inputting the second consistent layout data set into the trained X-ray defect detection model to obtain a second defect detection result; Inputting the first difference layout data set and the second difference layout data set into an expert annotation system to obtain an expert annotation result; Obtaining a comprehensive layout design defect detection result according to the first defect detection result, the second defect result and the expert annotation result; The integrated layout design defect detection result is calibrated according to the component layout rule library to obtain an integrated layout design defect detection calibration result.
2. A circuit board component layout design defect detection method according to claim 1, characterized in that: The circuit boards to be tested are multiple circuit boards produced in the same batch according to the same first design file.
3. A circuit board component layout design defect detection method according to claim 1, characterized in that: The first design file has passed the design check and the simulation check; The design check includes: pin connection error check, power and ground rule check, component size check, spacing requirement check, high-frequency signal routing length check, path check, thermal design check and heat dissipation requirement check; The simulation check specifically includes: using SPICE simulation to verify the electrical performance of the circuit design in the first design file; using 3D simulation tools to perform mechanical simulation to check the mechanical compatibility of component layout; performing thermal analysis to check the heat dissipation path and thermal management solution of high-heat components.
4. A circuit board component layout design defect detection method according to claim 1, characterized in that: Also includes: Collecting a specified number of circuit board surface images, the circuit board surface images include normal and different defect categories, annotating the circuit board surface images, annotating the defect categories and defect locations, and obtaining an annotated circuit board image set; the annotated circuit board image set is used to train the preliminary defect detection model and the first autoencoder model; the annotated defect categories include component layout design defects and manufacturing defects; A specified number of X-ray images of the inside of a circuit board are collected, wherein the X-ray images of the inside of the circuit board include normal images and images of different defect categories, and the X-ray images of the inside of the circuit board are labeled with defect categories and defect locations to obtain a labeled X-ray image set; the labeled X-ray image set is used to train the X-ray defect detection model and the second autoencoder model.
5. A circuit board component layout design defect detection method according to claim 1, characterized in that: Using the trained first autoencoder model to divide the first pre-processed image to be inspected into the first consistent layout data set and the first difference layout data set, and using the trained second autoencoder model to divide the pre-processed X-ray image into the second consistent layout data set and the second difference layout data set are specifically: Training the first autoencoder model using the labeled circuit board image set; Reconstruct the first pre-processed image to be inspected using the trained first autoencoder model, and calculate a first reconstruction error; If the first reconstruction error is less than a preset threshold, the corresponding first pre-processed image to be inspected is included in the first consistent layout data set; otherwise, the corresponding first pre-processed image to be inspected is included in the first different layout data set; Training the second autoencoder model using the labeled X-ray image set; Reconstruct the preprocessed X-ray image using the trained second autoencoder model, and calculate a second reconstruction error; If the second reconstruction error is less than a preset threshold, the corresponding preprocessed X-ray image is included in the second consistent layout data set; otherwise, the corresponding preprocessed X-ray image is included in the second different layout data set.
6. A circuit board component layout design defect detection method according to claim 1, characterized in that: Inputting the first consistent layout data set into the trained preliminary defect detection model, and outputting the first defect detection result further includes: inputting the first consistent layout data set into the trained preliminary defect detection model to obtain a preliminary defect detection result; extracting a region of interest according to the preliminary defect detection result to obtain a region of interest data set, wherein the region of interest data set includes all defect regions marked in the preliminary detection result; Inputting the region of interest data set into a trained component layout design defect detection model for defect detection to obtain the first defect detection result; the training process of the component layout design defect detection model includes: A specified number of circuit board surface images are collected, wherein the circuit board surface images include normal and different defect categories, and the circuit board surface images are annotated with defect categories and defect locations to obtain an annotated circuit board image set; and the component layout design defect detection model is trained using the annotated circuit board image set.
7. A circuit board component layout design defect detection method according to claim 6, characterized in that: The preliminary defect detection model is the YOLOv5 model; the component layout design defect detection model is the Faster R-CNN model.
8. A circuit board component layout design defect detection method according to claim 1, characterized in that: The integrated layout design defect detection result is calibrated according to the component layout rule library, and the integrated layout design defect detection calibration result is obtained, comprising: The integrated layout design defect detection result includes a defect type and a defect location; a defect area is obtained according to the defect location; the first consistent layout data set and the second consistent layout data set are recorded as an original image set; for each defect d in the integrated layout design defect detection result i , define a rectangular area B (d i ): For each of the defects d i , according to the rectangular area B(d i ) intercepting a sub-image from the corresponding original image set; obtaining a plurality of defect context images; According to the parameters in the component layout rule library, a comprehensive calibration rule is defined to eliminate non-component layout design defects; the comprehensive calibration rule includes a component spacing calibration rule, an electrical connection calibration rule and a layout consistency calibration rule; For each defect d in the comprehensive layout design defect detection result i , apply the comprehensive calibration rule to obtain a set of calibration results: A={C dist (d i ),C conn (d i ),C layout (d i )}; Wherein, A represents the calibration result set; i represents the index of the defect; d i represents the defect in the i-th integrated layout design defect detection result; C dist represents the component spacing calibration rule; C conn Indicates the electrical connection calibration rule; C layout representing said layout consistency calibration rule; Extract the minimum allowable spacing D of components from the component layout rule library min ; For each of the defects d in the comprehensive layout design defect detection result i , according to the corresponding defect context image, calculate the actual distance D of the involved components act ; The component spacing calibration rules are specifically as follows: Extracting electrical connection rules from the component layout rule library, including component pairs that must be connected or prohibited from being connected; For each of the defects d i , check whether the electrical connections involved comply with the regulations; The electrical connection calibration rules are specifically as follows: For each of the defects d in the comprehensive layout design defect detection result i , extract the layout information L of each component from its corresponding defect context image act ; Extract the layout information L corresponding to the component from the component layout rule library design ; The layout consistency calibration rules are specifically as follows: If the calibration result set meets the determination condition, the corresponding defect is removed from the comprehensive layout design defect detection result to obtain the comprehensive layout design defect detection calibration result; The judgment condition is: C dist (d i )=1 and C conn (d i )=1 and C layout (d i )=1.
9. A circuit board component layout design defect detection device, characterized in that: include: A design rule extraction unit, used to obtain an original design file of the circuit board to be tested, and obtain a first design file; Acquire various design parameters and layout rules in the first design file, and establish a component layout rule library; A surface image acquisition unit, used for acquiring a surface image of the circuit board to be inspected using a high-resolution camera to obtain a first surface image; A surface image preprocessing unit, used for preprocessing the first surface image to obtain a first preprocessed image to be inspected; A first autoencoder division unit, configured to divide the first pre-processed image to be inspected into a first consistent layout data set and a first difference layout data set using a trained first autoencoder model; a component layout design defect detection unit, configured to input the first consistent layout data set into a trained component layout design defect detection model and output a first defect detection result; An X-ray image acquisition unit, used to use an X-ray device to scan the circuit board to be inspected, obtain an internal structure image, and obtain an X-ray image; An X-ray surface image preprocessing unit, used for preprocessing the X-ray image; A second autoencoder division unit, configured to divide the preprocessed X-ray image into a second consistent layout data set and a second difference layout data set using a trained second autoencoder model; An X-ray defect detection unit, configured to input the second consistent layout data set into a trained X-ray defect detection model to obtain a second defect detection result; an expert annotation unit, configured to input the first difference layout data set and the second difference layout data set into an expert annotation system to obtain an expert annotation result; A comprehensive detection result unit, used to obtain a comprehensive layout design defect detection result according to the first defect detection result, the second defect result and the expert marking result; The calibration unit is used to calibrate the comprehensive layout design defect detection result according to the component layout rule library to obtain a comprehensive layout design defect detection calibration result.
10. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and the computer program is used to execute the circuit board component layout design defect detection method described in any one of claims 1 to 8.
