PCB pad offset prediction method based on feature engineering and storage medium
By combining feature engineering and reweighted support vector machines, the problem of unpredictable PCB board pad offset was solved, enabling the prediction and avoidance of defective products, improving production efficiency and reducing costs.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ARTIFICIAL INTELLIGENCE RES INST OF HEFEI COMPREHENSIVE NAT SCI CENT (ANHUI ARTIFICIAL INTELLIGENCE LAB)
- Filing Date
- 2022-10-24
- Publication Date
- 2026-06-26
AI Technical Summary
Current technology cannot predict PCB board pad misalignment, resulting in defective products being produced before inspection, which increases rework costs.
A feature engineering-based approach is adopted to obtain historical offset detection data of PCB boards, perform data preprocessing and segmentation, calculate manually designed statistical indicators, and construct a reweighted support vector machine for prediction.
It enables the prediction of future PCB board pad offsets, avoids the production of defective products, improves production efficiency, and reduces rework costs.
Smart Images

Figure CN115758254B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of predictive maintenance technology, specifically to a method and storage medium for predicting PCB board pad offset based on feature engineering. Background Technology
[0002] Existing technologies utilize RPN networks for solder joint defect detection and template matching methods for PCB board inspection. These methods are post-production inspections and cannot predict in advance whether defective products will be produced. Algorithms can only identify defects after they have been manufactured, leading to increased rework costs. Summary of the Invention
[0003] The present invention proposes a PCB board pad offset prediction method based on feature engineering, which can solve the problem.
[0004] To achieve the above objectives, the present invention adopts the following technical solution:
[0005] A PCB board pad offset prediction method based on feature engineering includes:
[0006] S1: Obtain historical offset detection data of the PCB board, perform data preprocessing, and use the sliding pane method to segment the data;
[0007] S2: Calculate statistical indicators for manual design;
[0008] S3: Construct a reweighted support vector machine and output the prediction results.
[0009] Furthermore, S1: Obtain historical offset detection data of the PCB board, perform data preprocessing, and use the sliding pane method to segment the data;
[0010] Specifically, it includes the following sub-steps S11 to S13:
[0011] S11: Collect the historical offset time series of PCB boards, and the detection results for each PCB board. There are M pad inspection results, and the inspection result of the i-th pad is... There are two variables: relative offset in the x-direction and relative offset in the y-direction;
[0012] S12: Remove out-of-order values from the historical offset time series; check the order of PCB board numbers and remove out-of-order PCB board coding detection results according to the ascending or descending order of PCB board numbers; finally obtain the historical offset time series. The offset detection result of the PCB board at time t includes the detection results of M pads in the x and y directions;
[0013] S13: Using the sliding pane method, the historical offset time series O is divided into sections with a historical window size of K, a shift step of S, and a prediction window size of T; thus, the historical window offset sequence is obtained. Predicted window offset sequence Then the above historical window offset sequence O t+K and prediction window offset sequence O t+K+T Decomposed to the pad level, i.e., the historical window offset sequence of the i-th pad. and the prediction window offset sequence of the i-th pad
[0014] Historical window offset sequence Predicted window offset sequence When the i-th pad prediction window offset sequence If a deviation occurs in any direction at any time, then The corresponding label is 1, otherwise the label is -1.
[0015] Furthermore, step S2 above, calculating the manually designed statistical indicators, specifically includes the following sub-steps S21 to S22:
[0016] S21: The offset sequence of the history window of the i-th pad || indicates a connection;
[0017] right Calculate the following 14 statistical indicators:
[0018] 1.
[0019] μ is The mean, σ is The variance;
[0020] 2.
[0021] μ is The mean, σ is The variance;
[0022] 3.
[0023] express The absolute value;
[0024] 4.
[0025] 5.
[0026] μ is The mean;
[0027] 6.
[0028] 7.
[0029] arg indicates retrieving the relative index within the sequence;
[0030] 8.
[0031] 9.
[0032] 10.
[0033] 11.
[0034] 12.
[0035] 13. For the mean to be exceeded, i.e., the following occurs: and or and Quantity;
[0036] 14. The number of peaks, i.e., the occurrence of peaks and or and Quantity;
[0037] S22: Yes Repeat the calculation of the above 14 statistical indicators. The final result is a vector consisting of 28 statistical indicators.
[0038] Furthermore, step S3 above: constructing a reweighted support vector machine and outputting the prediction result; specifically includes the following sub-steps S31 to S32:
[0039] S31: Construct a reweighted support vector machine and solve the following formula:
[0040]
[0041]
[0042] ξ n ≥0,ξ n Represents the relaxation amount of the nth sample.
[0043] Let K represent the kernel function, C represent the penalty term for misclassification, and K represent the kernel function. nLet C represent the classification weight of the nth sample; here, C is set to 10, the classification weight s of the sample with label 1 is uniformly set to 10000, and the weight s of the sample with label -1 is uniformly set to 1. Finally, the support vector machine SVM is obtained.
[0044] S32: Use SVM to classify the test samples and output the prediction results.
[0045] On the other hand, the present invention also discloses a computer-readable storage medium storing a computer program, which, when executed by a processor, causes the processor to perform the steps of the method described above.
[0046] As can be seen from the above technical solution, the PCB board pad offset prediction method based on feature engineering of the present invention can predict whether defective products will occur in the future, adjust the parameters of the solder paste printer, and thus avoid producing defective products. The present invention utilizes the historical offset sequence of the PCB board to predict whether the PCB board will experience offset defects in the future, so as to correct them in a timely manner.
[0047] Specifically, this invention can predict PCB board pad offsets based on the statistical characteristics of manually designed reaction offset time series, thus avoiding the production of defective products through timely engineer intervention. Furthermore, the prediction results can be interpreted through statistical features, making the model prediction process easier for engineers to understand. A weighted support vector machine is used to perform a nonlinear transformation of the kernel function on the manually designed features, improving the model's stability. Greater weight is given to offset defects, overcoming the difficulty of extremely scarce offset defect data, thereby achieving time-series prediction of offset defects. Attached Figure Description
[0048] Figure 1 This is a schematic diagram of the structure of the present invention;
[0049] Figure 2 This is a diagram showing the experimental results of an embodiment of the present invention. Detailed Implementation
[0050] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are some embodiments of the present invention, but not all embodiments.
[0051] like Figure 1 As shown in this embodiment, the PCB board pad offset prediction method based on feature engineering includes:
[0052] Step 1: Obtain historical offset detection data of the PCB board, perform data preprocessing, and use the sliding pane method to segment the data.
[0053] Step 2: Calculate the statistical indicators for manual design.
[0054] Step 3: Construct a reweighted support vector machine and output the prediction results.
[0055] S1: Obtain historical offset detection data of the PCB board, perform data preprocessing, and use the sliding pane method to segment the data.
[0056] Specifically, it includes the following sub-steps S11 to S13:
[0057] S11: Collect the historical offset time series of PCB boards, and the detection results for each PCB board. There are M pad inspection results, and the inspection result of the i-th pad is... There are two variables: relative offset in the x-direction and relative offset in the y-direction.
[0058] S12: Remove out-of-order values from the historical offset time series. In actual production, engineers may randomly and manually inspect the printing results, leading to inconsistencies between the printing order and the SPI detection order. Therefore, the order of PCB board numbers is checked, and out-of-order detection results are removed according to the ascending or descending order of the PCB board numbers. This ultimately yields the historical offset time series. The offset detection result of the PCB board at time t includes the detection results of M pads in the x and y directions.
[0059] S13: Using the sliding pane method, the historical offset time series O is divided into windows of size K, with a shift step of S and a prediction window size of T. This yields the historical window offset sequence. Predicted window offset sequence Then the above historical window offset sequence O t+K and prediction window offset sequence O t+K+T Decomposed to the pad level, i.e., the historical window offset sequence of the i-th pad. and the prediction window offset sequence of the i-th pad Historical window offset sequence Predicted window offset sequence When the i-th pad prediction window offset sequence If a deviation occurs in any direction at any time, then The corresponding label is 1; otherwise, the label is -1.
[0060] Further, step S2 above: calculate the statistical indicators designed manually.
[0061] Specifically, it includes the following sub-steps S21 to S22:
[0062] S21: The offset sequence of the history window of the i-th pad || indicates a connection.
[0063] right Calculate the following 14 statistical indicators:
[0064] 1.
[0065] μ is The mean, σ is The variance.
[0066] 2.
[0067] μ is The mean, σ is The variance.
[0068] 3.
[0069] express The absolute value of.
[0070] 4.
[0071] 5.
[0072] μ is The mean.
[0073] 6.
[0074] 7.
[0075] arg indicates retrieving the relative index within the sequence.
[0076] 8.
[0077] 9.
[0078] 10.
[0079] 11.
[0080] 12.
[0081] 13. For the mean to be exceeded, i.e., the following occurs: and or and The quantity.
[0082] 14. The number of peaks, i.e., the occurrence of and or and The quantity.
[0083] S22: Yes Repeat the calculation of the above 14 statistical indicators. The final result is a vector consisting of 28 statistical indicators.
[0084] Among them, step S3 above: construct a reweighted support vector machine and output the prediction results.
[0085] Specifically, it includes the following sub-steps S31 to S32:
[0086] S31: Construct a reweighted support vector machine. Solve the following formula:
[0087]
[0088]
[0089] ξ n ≥0,ξ n Represents the relaxation amount of the nth sample.
[0090] Let C represent the kernel function, C represent the penalty term for misclassification, and s represent the kernel function. n Let C represent the classification weight of the nth sample. Here, C is set to 10, the classification weight s of samples with label 1 is uniformly set to 10000, and the weight s of samples with label -1 is uniformly set to 1. This ultimately yields a Support Vector Machine (SVM).
[0091] S32: Use SVM to classify the test samples and output the prediction results.
[0092] Figure 2 In the text, "Nromal" indicates a good product, and "Abnormal" indicates a defective offset. Figure 2 As can be seen, the method of this invention successfully and accurately predicted 7,071 off-target defective data points from more than 3.5 million prediction data points, while only 76 defective data points were not predicted. Therefore, the method of this invention has a very high classification accuracy, almost never misses off-target defects, and can effectively distinguish between good and defective products.
[0093] In another aspect, the present invention also discloses a computer-readable storage medium storing a computer program, which, when executed by a processor, causes the processor to perform the steps of any of the methods described above.
[0094] In another aspect, the present invention also discloses a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the steps of any of the methods described above.
[0095] In another embodiment provided in this application, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to perform the steps of any of the methods described in the above embodiments.
[0096] It is understood that the system provided in the embodiments of the present invention corresponds to the method provided in the embodiments of the present invention, and the explanation, examples and beneficial effects of the relevant content can be referred to the corresponding parts of the above methods.
[0097] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments described above. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.
[0098] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0099] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for predicting PCB board pad offset based on feature engineering, characterized in that, Includes the following steps, S1: Obtain historical offset detection data of the PCB board, perform data preprocessing, and segment the data using the sliding pane method. This specifically includes the following subdivision steps S11 to S13: S11: Collect the historical offset time series of PCB boards, and obtain the detection results for each PCB board. There are M pad detection results, and the i-th pad detection result... , There are two variables: relative offset in the x-direction and relative offset in the y-direction. S12: Remove out-of-order values from the historical offset time series; check the order of PCB board numbers and remove out-of-order PCB board coding detection results according to the ascending or descending order of PCB board numbers; finally obtain the historical offset time series. , The offset detection result of the PCB board at time t includes the detection results of M pads in the x and y directions; S13: Using the sliding pane method to analyze historical offset time series The window is divided into segments, with a historical window size of K and a shift step of S for each step, and a prediction window size of T. This yields the historical window offset sequence. Predicted window offset sequence ; Then the above historical window offset sequence and prediction window offset sequence Decomposed to the pad level, i.e., the historical window offset sequence of the i-th pad. and the prediction window offset sequence of the i-th pad ; Historical window offset sequence Prediction window offset sequence ; When the i-th pad prediction window offset sequence If a deviation occurs in any direction at any time, then The corresponding label is 1; otherwise, the label is -1. S2: Calculate the statistical indicators of the manual design, which specifically includes the following sub-steps S21 to S22: S21: The offset sequence of the history window of the i-th pad ; Indicates a connection; right Calculate the following 14 statistical indicators: Indicator 1 yes The mean, yes The variance; Indicator 2 yes The mean, yes The variance; Indicator 3 ; express The absolute value; Indicator 4 ; Indicator 5 = yes The mean; Indicator 6 ; Indicator 7 ; arg indicates retrieving the relative index within the sequence; Indicator 8 Indicator 9 = Indicator 10 = Indicator 11 = Indicator 12 = Indicator 13 For the mean to be exceeded, i.e., the following occurs: and ,or and Quantity; Indicator 14 The number of peaks, i.e., the occurrence of peaks and ,or and Quantity; S22: Yes Repeat the calculation of the above 14 statistical indicators; finally, a vector consisting of 28 statistical indicators is obtained. ; S3: Construct a reweighted support vector machine and output the prediction results. This specifically includes the following sub-steps S31 to S32: S31: Construct a reweighted support vector machine and solve the following formula: Let C represent the kernel function, and C represent the penalty term for misclassification. Let C represent the classification weight of the nth sample; here, C is set to 10, the classification weight s of the sample with label 1 is uniformly set to 10000, and the weight s of the sample with label -1 is uniformly set to 1; finally, the support vector machine SVM is obtained. S32: Use SVM to classify the test samples and output the prediction results.
2. A computer-readable storage medium storing a computer program that, when executed by a processor, causes the processor to perform the steps of the method as claimed in claim 1.