Circuit board defect analysis method based on visual inspection

Through the dynamic reference image and gradient directional map difference method, the problem of balancing the false alarm rate and missed detection rate in circuit board production is solved, adaptive detection of the production process is achieved, and production efficiency and quality control accuracy are improved.

CN120594532AInactive Publication Date: 2025-09-05深圳市丹宇电子有限公司
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202511093760.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-06
Publication Date
2025-09-05
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing visual inspection methods are difficult to adapt to both normal process variations and sudden real defects in circuit board production, resulting in a difficult balance between false alarm rate and missed detection rate, and a lack of adaptability to dynamic changes in the production process.

Method used

The dynamic reference image and gradient directional map difference method is adopted. By obtaining the image of the circuit board adjacent to the circuit board as a reference, the difference of the gradient directional map is calculated to determine whether the circuit board has defects. The continuous diagnosis of the defect nature and the stability monitoring of the production process are combined.

Benefits of technology

It effectively suppresses false positive alarms, distinguishes random failures from systematic faults, improves the operational efficiency of the production process and the predictability of quality control, and adapts to non-continuous production conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120594532A_ABST
    Figure CN120594532A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image processing and mode recognition, and discloses a circuit board defect analysis method based on visual inspection, which comprises the following steps: acquiring an image of a previous qualified circuit board immediately before a current to-be-detected circuit board as a dynamic reference image, the method comprises the following steps: acquiring a dynamic reference image of a to-be-detected circuit board, converting a current to-be-detected circuit board image and the dynamic reference image into gradient directional diagrams representing structural edge direction information, generating a structural difference image by calculating the difference between the two gradient directional diagrams, and judging defects based on the structural difference image. The automatic adaptation to the continuous process variation in the production process is realized; and meanwhile, differential comparison is carried out in a structural direction information domain, so that misjudgment caused by random position jitter of the component in a tolerance range is avoided, and reliable identification of defects is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a circuit board defect analysis method based on visual detection, belonging to the technical field of image processing and pattern recognition. Background Art

[0002] Currently, automatic optical inspection technology is widely used in the production quality control of printed circuit boards. This technology identifies graphic defects on the product surface by comparing the real-time image of the circuit board to be tested with a pre-set standard reference image. This comparison method based on static reference images provides a basic path for the automated detection of circuit board defects, and to a large extent replaces traditional manual visual inspection, thereby improving detection efficiency.

[0003] However, the effectiveness of static reference comparison methods relies on a high degree of consistency in the production process, which is inconsistent with the dynamic reality of modern electronic manufacturing. Continuous production processes are subject to numerous normal variations that are acceptable within process specifications. These include minor component positional jitter caused by equipment vibration, or subtle changes in substrate color and reflective properties due to different material batches. When the inspection system compares real-time images containing these normal variations with a fixed reference image, it identifies these differences as defects, generating a large number of false positive alarms that disrupt the stable operation of the production line. To alleviate this problem, existing technologies typically make adjustments in two directions: one is to increase image acquisition resolution and the complexity of analysis algorithms in an attempt to more finely distinguish differences. However, this often makes the system more sensitive to normal minor variations, potentially increasing misjudgments. The other is to relax the tolerance threshold for defect judgment, but this directly reduces the system's ability to identify true minor defects and increases the risk of missed defects.

[0004] Specifically, the existing technology has the following main deficiencies: 1. It is difficult for the detection system to effectively distinguish between image differences caused by normal process fluctuations and image differences caused by real product defects, making it difficult to balance the false alarm rate and missed detection rate; 2. For the slow and continuous drift of equipment parameters in the production process, the system lacks an automatic adaptation mechanism and requires manual intervention to update the reference benchmark, which affects the continuity of production; 3. The establishment of the detection logic relies on a static reference standard, which does not match the dynamic changing properties of the production process itself. Therefore, how to establish a visual inspection and analysis method that can adapt to the normal process variations in the production process without relying on a fixed reference template and maintain reliable recognition capabilities for random and sudden real structural defects has become the technical problem to be solved by the present invention. Summary of the Invention

[0005] The present invention provides a circuit board defect analysis method based on visual inspection, the main purpose of which is to solve the problem that the existing inspection method cannot adapt to normal process variations and accurately identify sudden real defects at the same time due to its reliance on fixed reference templates.

[0006] To achieve the above objectives, the present invention provides a circuit board defect analysis method based on visual inspection, comprising: Acquire an image of a current circuit board to be tested, and acquire an image of a previous circuit board immediately preceding the current circuit board to be tested as a dynamic reference image; Align the image of the current circuit board to be tested with the dynamic reference image; Calculating the gradient direction map of the aligned current circuit board image and the dynamic reference image respectively, wherein the gradient direction map is a data map representing the structural edge direction information of each pixel position in the image; The difference between the two gradient direction images is calculated to generate a structural difference image; and based on whether there is a residual area in the structural difference image, it is determined whether the current circuit board to be tested has defects.

[0007] Preferably, the alignment process is achieved by identifying a plurality of reference points on the image of the current circuit board to be tested and the dynamic reference image, and performing a global affine transformation based on the coordinates of the plurality of reference points.

[0008] Preferably, the gradient direction map is calculated by applying a Sobel operator to the image to extract the gradient direction information of each pixel.

[0009] Preferably, the step of determining whether the current circuit board to be tested has defects is specifically as follows: when there are one or more connected areas in the structural difference image whose brightness value exceeds a first threshold and whose number of pixels is greater than a second threshold, the connected area is determined to be a residual area, and based on this, it is determined that the current circuit board to be tested has defects.

[0010] Preferably, when determining whether the current circuit board to be tested has a defect, it also includes: locking the defect position of the defect on the current circuit board to be tested; and detecting whether there are subsequent defects at the defect positions of one or more subsequent circuit boards; and generating diagnostic information characterizing the nature of the defect based on whether the defect reappears at the defect position.

[0011] Preferably, the step of generating diagnostic information characterizing the nature of the defect is specifically as follows: if the defect is not detected again at the defect location of a preset number of subsequent circuit boards, diagnostic information is generated that the defect is a random failure; if the number of times the defect is detected at the defect location of the preset number of subsequent circuit boards exceeds a failure judgment number threshold, diagnostic information is generated that the defect is a systematic failure.

[0012] Preferably, the method further includes: performing a global statistical analysis on the structural difference image to generate a process stability index; and outputting a process stability warning signal when the time series variation trend of the process stability index meets a preset degradation condition.

[0013] Preferably, the step of generating the process stability index is specifically as follows: calculating the overall pixel value standard deviation of the structural difference image as the process stability index; pixel value standard deviation Calculated by the following formula: ,in, is the total number of pixels in the structural difference image, For the The pixel value of each pixel, is the average value of all pixels in the image.

[0014] Preferably, it also includes: monitoring the time interval between the images of the current circuit board to be tested and the previous circuit board; when the time interval exceeds a production beat threshold, suspending the use of the image of the previous circuit board as a dynamic reference image, and instead capturing and storing a sequence of multiple subsequent circuit board images after the production line is restarted; performing internal, continuous structural difference image calculations on the multiple subsequent circuit board images in the sequence to generate a differential energy sequence; and when the value in the differential energy sequence is lower than a stable state threshold, reconstructing the image of the last circuit board in the sequence into a new dynamic reference image.

[0015] Preferably, an initialization step is also included, which is performed when the production line is started for the first time or the model of the circuit board to be tested is changed, including: obtaining images of an initial plurality of consecutive circuit boards; and setting the image of the last circuit board in the initial plurality of consecutive circuit boards as the first dynamic reference image for executing the step of obtaining a dynamic reference image.

[0016] Compared with the prior art, the present invention has the following beneficial effects: 1. The present invention obtains the previous circuit board image immediately preceding the current circuit board under test as a dynamic reference image and calculates the structural difference between the two images. This allows normal process variations that occur continuously and within tolerance during the production process, such as slow overall shifts in component position or shape due to equipment wear or material batch differences, to be offset in the differential comparison. Furthermore, by converting the comparison object from pixel brightness values ​​to a gradient direction map that is insensitive to small displacements, random but acceptable geometric position jitter between adjacent boards will not produce a significant residual signal in the structural difference image. This processing method avoids the problem of prior arts that misjudges normal process fluctuations as defects due to reliance on a fixed reference template, and can effectively suppress the generation of false positive alarms without sacrificing the ability to detect sudden real defects.

[0017] 2. After determining that the current circuit board under test has a defect, the present invention does not stop at the single-point judgment, but focuses on the location of the defect and performs subsequent detection on the same location of one or more subsequent circuit boards. By analyzing whether the defect recurs in a time series, the system's output information adds a judgment dimension on the nature of the defect; this approach enables the system to distinguish between random failure events and persistent systemic failures caused by malfunctions in the production process, thereby providing production managers with an objective basis for deciding whether to immediately stop the production line for investigation, avoiding production capacity losses caused by taking unified line shutdown measures to deal with all defects, and improving the overall operating efficiency of the production process.

[0018] 3. The method of the present invention can also perform global statistical analysis on the structural difference image, convert the low-intensity background residual signal that does not constitute a defect into an indicator for quantifying the overall stability of the production process, and monitor the time series change trend of the indicator; because the production process usually goes through a degradation stage with reduced equipment accuracy and gradually increased random disturbances before a systematic failure occurs and the first defect is generated, and this stage will be reflected in the continuous increase in the statistical value of the background residual signal, therefore, the present method can output a warning signal about the decline in process stability in advance before actual defective products are produced, so that managers have the opportunity to carry out preventive intervention, thereby moving the quality control node from post-inspection to process warning.

[0019] 4. The present invention monitors the time interval between images of adjacent circuit boards to identify whether a planned or unplanned interruption has occurred in the production line. When the time interval exceeds the production rhythm threshold, the system will suspend the use of the image before the interruption as a reference, and instead capture a sequence of multiple circuit board images after the restart. After confirming that the production process has entered a new stable state by continuous differential comparison between the images within the sequence, the last image in the sequence is reconstructed as a new dynamic reference. This mechanism enables the method to autonomously respond to the step-by-step changes in equipment status caused by the start and stop of the production line, avoiding batch misjudgments caused by inconsistency between the reference baseline and the state after restart, and ensuring the applicability and reliability of the detection method under non-continuous production conditions. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 A schematic flow chart of a circuit board defect analysis method based on visual inspection according to the present invention; Figure 2 An example diagram of the time series change of the process stability indicator S of the present invention; Figure 3 This is a schematic diagram of the system functional modules of a circuit board defect analysis method based on visual inspection of the present invention. DETAILED DESCRIPTION

[0021] In order to make the objectives, technical solutions and advantages of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below. It should be understood that the specific embodiments described here are part of the embodiments of the present invention, rather than all the embodiments. They are only used to explain the present invention and should not constitute any limitation on the scope of protection of the present invention.

[0022] The present invention discloses a circuit board defect analysis method based on visual inspection, whose operation process is configured as follows: first, an image of the current circuit board to be tested and an image of a previously qualified circuit board immediately preceding it are obtained as dynamic reference images; then, within a graphic structure information domain, the two images are aligned, transformed and differentially calculated to generate a structural differential image representing structural differences, and defect judgment is performed based on the structural differential image; as an extension of the core process, the method also integrates a continuous diagnosis mechanism for defect properties, a quantitative early warning mechanism for production process stability, and an adaptive baseline reconstruction mechanism for production line start-up and shutdown conditions; in the production and inspection process of a circuit board, there are generally two types of non-defective image changes, one of which is the process drift that occurs slowly and continuously on the time axis due to equipment wear or environmental temperature change, and the other is the random component position jitter between adjacent boards due to transmission mechanism vibration or placement error. To cope with this situation, the method first captures the current circuit board to be tested through a dynamic reference acquisition step. The system then retrieves a real-time image of the board and retrieves an image of a previous board that was temporarily stored in memory and immediately preceded the current board under test and was judged to be qualified. This image of the previous board is used as a dynamic reference image. This procedure allows process drift information that varies continuously and slowly in time to be suppressed as common-mode information in the subsequent differential process because it exists in both the image under test and the reference image. To further eliminate the impact of random position jitter, the system aligns the two images by identifying multiple reference points and performing a global affine transformation. It then applies a gradient operator, such as a Sobel operator, to the current board under test image and the dynamic reference image to generate two corresponding gradient directional maps. The gradient directional map is a data map where the value of each coordinate point represents the directional information of the structural edge at that point on the original image. Since the geometric edge direction of a component does not change due to slight translation within the tolerance range of its overall structure, the difference caused by position jitter is significantly reduced in the dimension of the gradient directional map.

[0023] After converting to the information domain of the gradient directional map, the system calculates the difference between the two gradient directional maps to generate a structural difference image; on the structural difference image, any new edge direction introduced by real sudden structural defects, such as newly added solder, broken circuits or missing components, which did not exist in the previously qualified board, will appear as a residual signal with a higher brightness value; the system performs binarization processing and connected domain analysis on the structural difference image. When it detects that there are one or more connected areas in the image whose brightness value exceeds a first threshold and whose number of pixels is greater than a second threshold, the connected area is determined to be a residual area, and based on this, it is determined that the current circuit board to be tested has defects; the specific values ​​of the first threshold and the second threshold are determined by an offline calibration procedure, which includes inputting a set of images containing typical defect samples into the system, and calculating the brightness and area of ​​the residual area corresponding to them on the structural difference image, and then selecting the residual area that can effectively distinguish real defects from background noise. The distinguished brightness and area statistics are used as the setting values ​​of the first threshold and the second threshold; when the system determines that there is a defect at a specific location of the current circuit board to be tested, in order to determine the root cause of the defect, the method will automatically trigger a subsequent diagnostic process; when faced with a newly discovered defect, it is necessary to determine whether it is an occasional random failure or a systematic failure caused by equipment failure to decide whether production needs to be suspended; to provide a basis for this decision, after issuing an initial alarm, the system will lock the defect position coordinates of the defect on the image of the current circuit board to be tested, and when one or more subsequent circuit boards pass through, the visual analysis resources will be focused on the defect location to perform subsequent defect detection; the system counts the number of times the defect recurs at the same location in a preset number of subsequent circuit boards, and compares it with a failure judgment number threshold. If the number of recurrences does not exceed the threshold, the system generates diagnostic information that the defect is a random failure; otherwise, it generates diagnostic information that the defect is a systematic failure.

[0024] Furthermore, in order to monitor the health status of the production process, the method is also configured to utilize the image data generated during the defect detection process. Under some working conditions, the production process will experience a stability degradation stage with gradually increasing random disturbances before an obvious systematic failure occurs. To capture this trend, after generating each structural difference image, the system not only performs a local defect analysis for locating high-brightness residual areas, but also performs a global statistical analysis on the image in parallel to generate a process stability index. Specifically, the system calculates the standard deviation of the overall pixel value of the structural difference-image , as a process stability indicator, the calculation of this indicator follows the formula ,in, is the total number of pixels in the structural difference image, For the The pixel value of each pixel is is the average value of all pixel values ​​in the image; the system will continuously calculate The values ​​constitute a time series, and by monitoring the changing trend of the time series, when it is monitored that the value of the indicator continues to exceed the normal fluctuation baseline calibrated according to the data of the stable production stage or its growth slope exceeds the preset deterioration condition, the system will output a process stability early warning signal.

[0025] In industrial production environments, planned or unplanned interruptions of production lines are common working conditions. After the equipment has been shut down and restarted, its physical state often changes in a step-like manner, resulting in significant differences between the qualified boards after the restart and the qualified boards before the shutdown. Direct comparison will lead to misjudgment. To ensure the applicability of the method under non-continuous production conditions, the system has a built-in reference baseline dynamic reconstruction mechanism, which continuously monitors the time interval between the images of two adjacent circuit boards through a timer; when the time interval does not exceed a production beat threshold set according to the normal beat of the production line, the system adopts a standard dynamic reference comparison process; when the time interval exceeds the production beat threshold, the system determines that a timing break has occurred in the production line, and suspends the use of the previous circuit board image before the interruption as a dynamic reference image, and instead captures and stores a sequence of multiple subsequent circuit board images after the production line is restarted; then, the system compares the sequence by The system performs internal continuous structural differential image calculations on multiple subsequent circuit board images to generate a differential energy sequence. When the values ​​in the differential energy sequence are continuously lower than a stable state threshold at which a characterization process has entered a stable state, the system reconstructs the image of the last circuit board in the stable sequence into a new dynamic reference image. In order to enable the entire defect analysis method to be effectively started, the system also includes an initialization step, which is executed when the production line is started for the first time or when the model of the circuit board to be tested is changed. At this stage, the system is configured to automatically acquire the initial continuous images of multiple circuit boards, and after capturing a preset number of boards, it is assumed that the initial debugging and fluctuation stages of the production line have been completed, and then the image of the last circuit board in the initial sequence is set as the first dynamic reference image for executing subsequent dynamic reference image acquisition and comparison steps, thereby completing the initial anchoring of the entire timing differential chain.

[0026] Example 1: In a high-density circuit board manufacturing process for producing automotive safety control units, there are two types of process changes in the production environment. First, a nozzle of the solder paste printing equipment gradually wears out due to continuous work, resulting in a slow and unidirectional overall increase in the size of the solder joints on all circuit boards within the continuous production cycle, but within the permitted range of process tolerances; second, the operation of other equipment around the production line triggers a continuous slight vibration of the conveyor mechanism, resulting in each current circuit board to be tested entering the inspection station having random position jitter in translation and rotation compared to its previous circuit board; when a circuit board to be tested carrying a tiny defective solder bridge formed by solder particle splashing enters the inspection station, the system obtains its image The system then takes the image of the qualified circuit board and the image of the previous qualified circuit board that has been stored and is immediately preceding it as a dynamic reference image. Given that the progressive increase in solder joint size is a continuous change, the difference in solder joint size between the circuit board under test and the dynamic reference image is minimal. This slow process drift factor is treated as common-mode information and offsets each other in the subsequent differential processing. After aligning the two images through a global affine transformation, the system does not directly compare pixel brightness values. Instead, it applies the Sobel operator to each image, converting them into gradient directional maps that are insensitive to small geometric displacements. Since random position jitter only changes the coordinates of the components but not their own structural edge directions, the difference signal intensity caused by the jitter is significantly suppressed in the two gradient directional maps.

[0027] The system then calculates the difference between the two gradient orientation maps to generate a structural difference image. In this structural difference image, background residual signals generated by non-defective process fluctuations—process drift and position jitter—are maintained at a low intensity level close to zero. The tiny but sudden solder bridge defect introduces a new structural edge direction that does not exist at the corresponding position in the dynamic reference image, forming a high-contrast residual region in the structural difference image. After analyzing the brightness value and number of pixels in this residual region and confirming that they exceed preset first and second thresholds, the system ultimately determines that the circuit board under test is defective and outputs a signal for removal. This method adapts to continuous process evolution through a dynamic reference in time. Furthermore, by comparing in the structural direction information domain, it maintains stability against random geometric perturbations, freeing the identification of true structural defects from the constraints of detection methods that balance process adaptability with defect sensitivity.

[0028] Example 2: In order to verify the performance of the method of the present invention in suppressing process fluctuations and identifying real defects, a comparative experiment was set up. The experiment was established on a digital test platform consisting of 1000 frames of serialized circuit board images, which were generated by programmatic processing of an image of a standard circuit board. The experiment set up a detection method that used direct pixel differential comparison of each frame of the image to be tested with a fixed standard image as a control group, and a method that used the analysis method based on the difference between the dynamic reference image and the gradient direction map described in the present invention as a test group. During the experiment, in order to simulate the common non-defective process variations in the production line, two disturbances were applied to all 1000 frames of serial images. One of them was continuous process drift, which was performed by comparing the brightness values ​​of all solder joints in each frame of the image with the previous frame. The first is a 0.05% increment; the second is random position jitter, which is achieved by applying a random translation within the range of ±1 pixel in the horizontal and vertical directions, and a random rotation within the range of ±0.1 degrees to each frame of the image; in addition, to test the defect recognition ability, a solder bridge with a size of 3×3 pixels is implanted as a real structural defect in the images of the three specific positions of the 250th, 500th and 750th frames in the sequence; the first and second thresholds used in the experimental group method are set to strike a balance between system sensitivity and false alarm rate. By analyzing the receiver operating characteristic curves under different threshold settings on an independent calibration image set, a threshold combination is selected that can maintain the detection rate of real defects above 99.9% while suppressing the false alarm rate caused by background noise to below 0.1%.

[0029] During the test, the control group's detection method began to produce misjudgments early in the sequence. As the sequence number increased, the background noise intensity of its differential image continued to rise due to the accumulation of continuous process drift, resulting in the majority of normal circuit boards being judged as defective after approximately 100 frames in the sequence. In contrast, the experimental group's detection method used the immediately preceding frame as a dynamic reference, offsetting the continuous process drift in the differential analysis. Furthermore, through comparison in the gradient directional map information domain, high-frequency random position jitter did not produce significant residual signals in the structural difference image, resulting in no misjudgments for circuit boards without true defects throughout the test sequence. When processing the 250th, 500th, and 750th frames containing true defects, the experimental group's structural difference images showed clear, bright signals at the corresponding positions, thus detecting all three true defects. See Table 1 for specific comparative test results.

[0030] Table 1: Performance comparison of the two detection methods under different working conditions.

[0031] Experimental data show that the method disclosed in the present invention can maintain the stability of the detection baseline and separate real structural defects from process fluctuations in a complex interference environment with continuous process drift and random position disturbances.

[0032] Example 3: This example combines Figures 1 to 3 , a circuit board defect analysis method based on visual inspection is described, such as Figure 1 As shown in the figure, the process starts with the image acquisition step, that is, obtaining the image of the current circuit board to be tested and the image of the previous qualified board adjacent to it as a dynamic reference. Subsequently, the system aligns the two images by performing a global affine transformation based on multiple reference points. Then, the system applies the Sobel operator to the aligned image to convert the image into a data map representing the structural edge direction information, that is, calculating the gradient direction map. On this basis, the difference between the two gradient direction maps is calculated to highlight the structural differences, thereby generating a structural differential image. The core of the process is the defect judgment link, which checks whether there is a residual area in the structural differential image whose brightness and area exceed the preset threshold. If not, it is judged to be qualified and the process ends. If there is a defect, the system On the one hand, the defect position is locked and the subsequent integrated module is triggered, namely the defect nature connection diagnosis mechanism. This mechanism analyzes whether the defect recurs by performing connection detection on the same position of the subsequent circuit board, and generates diagnostic information on whether the defect is a random failure or a systematic failure based on whether the number of repetitions exceeds the failure judgment threshold. On the other hand, regardless of whether there is a defect, the process will trigger another integrated module in parallel, namely the process stability early warning mechanism. This mechanism performs global statistical analysis on the structural difference image to generate a process stability quantitative index, and determines whether the time series trend of the index meets the preset degradation condition. If not, the process is stable. If so, a process stability early warning signal is output.

[0033] like Figure 2 As shown, the figure represents the process stability index The time series changes of the circuit board are shown in Figure 2, where the horizontal axis is the serial number of the circuit board and the vertical axis is the standard deviation calculated based on the structural difference image. The figure contains three key curves: the solid line represents the process stability index calculated in real time The thick dashed line below represents the normal baseline based on stable production data. , the thin dotted line above represents the warning threshold. As can be seen from the figure, at the beginning of the sequence, the indicator The value fluctuates below the normal baseline, indicating that the process is stable, and as the number of circuit boards increases, the indicator The values ​​showed a continuously increasing deterioration trend and successively broke through the normal baseline and warning threshold. This process intuitively demonstrated that this method can achieve early warning of the health status of the production process by monitoring the process stability indicators before producing actual defective products.

[0034] like Figure 3 As shown in the figure, the architecture is centered on a core analysis engine, which receives aligned image data from an image acquisition and alignment module and obtains an acquisition / reconstruction reference baseline for comparison from a dynamic reference baseline manager. After performing the main differential and judgment operations, the core analysis engine sends the generated structural differential image data to a process stability analyzer and the identified defect data to a defect property diagnostic device. At the same time, the final judgment result is directly output to a diagnosis and early warning output module. After completing their respective analyses, the process stability analyzer and the defect property diagnostic device respectively feed back the generated early warning signals and diagnostic information to the diagnosis and early warning output module, which finally integrates all input information to form a unified external output.

[0035] Example 4: When a new circuit board model is first put into production, the inspection system needs to establish a series of key threshold benchmarks related to its internal judgment logic to match the inherent characteristics of the current production line and products. Without this benchmark, the system will not be able to strike a balance between missed detections and false alarms during normal operation. To establish this benchmark, before mass production begins, the production line is set to perform an initial calibration run involving 200 circuit boards. During this run, the system's defect judgment function is suspended, and its task is transformed into the collection and statistical analysis of process data. The system first records the time intervals between the images of the 200 consecutive circuit boards passing through, and based on this time series data, calculates the average value of the interval time. and standard deviation , and then, the system's production cycle threshold is programmed to be This setting provides a statistically significant decision boundary for the subsequent identification of production interruptions. At the same time, the system performs alignment, gradient direction map conversion, and difference processing on each circuit board in the calibration run, thereby generating a sequence of 199 structural difference images. For each structural difference image in this sequence, the system calculates the standard deviation of its overall pixel value. , thus obtaining a set containing 199 A process stability sample sequence of values; based on this sample sequence, the system calculates its average value and standard deviation , based on which, the early warning baseline for monitoring the stability of the production process is set as , and the stable state threshold used to determine whether the production line enters a stable state after restart is set to This procedure provides a data anchor point derived from the current stable operating status of the production line itself for subsequent process warning and start-stop adaptive functions.

[0036] At the end of this calibration run, the operator placed and removed a non-conductive dust particle from the same location on two consecutive boards. When processing the first board, the system, through its subsequent defect detection mechanism, identified the event as a single occurrence and generated diagnostic information for a random failure. No anomalies were detected on the second board. This process provides a basis for setting the failure threshold to 1 to distinguish between transient interference and continuous equipment or material failure. After completing this calibration run, all core judgment parameters of the system were given initial values ​​based on the statistical characteristics of the run, allowing it to enter the subsequent regular production inspection process in a calibrated state.

[0037] Example 5: During a production process that has been continuously operating using the method of the present invention, the lighting system in the workshop where the production line is located was maintained, and some lighting fixtures above the inspection stations were replaced. This caused the overall brightness and color temperature of the captured image to continuously shift compared to the initial system calibration state. This change in the lighting environment will affect the baseline grayscale of the subsequent differential image. To cope with this working condition, the system is configured to automatically perform an adaptive calibration of the lighting environment baseline before the start of daily production. When the procedure is initiated, the system first captures an image of a standard whiteboard placed in the inspection area and calculates the grayscale histogram statistical features of the image. The system compares the real-time statistical features with the baseline features stored during the initial calibration. If the deviation between the two exceeds a preset tolerance range, the system calculates and generates a set of brightness and contrast adjustment parameters based on this deviation to compensate for the current lighting changes. In the subsequent routine inspection process, all newly captured images of the current circuit board to be tested and the dynamic reference image are first subjected to a lighting normalization process using this set of adjustment parameters before being sent to the alignment and gradient analysis steps, thereby compensating for the impact of changes in the external lighting environment on the defect detection algorithm.

[0038] Example 6: Before applying the inspection method of the present invention to a new type of circuit board with high-density and refined wiring features, an offline algorithm parameter optimization and calibration procedure must be performed to adapt to the specific image features of the new type of circuit board and to be able to identify the types of minor defects that may appear. The procedure begins with the construction of a calibration image set. The engineer first obtains a physical good product of the new type of circuit board as a reference and collects its high-resolution digital image. Then, using image processing tools, a series of minor defects with clear geometric features are implanted one by one on the reference image. The series of defects covers the model with diameters ranging from 2 to 10 pixels. Pseudo-solder beads, simulated scratches with a width of 1 to 3 pixels, and component offsets with a rotation angle of 0.2 to 1.0 degrees are used to generate a calibration image set containing rich and annotated defect information. This image set is used to configure the gradient direction map generation step at the core of the system. Specifically, different kernel sizes, such as 3×3 and 5×5 Sobel operators, are used to process all images in the calibration set. By comparing the signal-to-noise ratio of various tiny defects in the structural difference images generated by different kernel sizes, a kernel size that can effectively distinguish between noise and weak defect signals during use for this refined circuit board is finally determined as a fixed configuration.

[0039] After determining the configuration of the gradient operator, all images in the calibration image set are processed based on this configuration to generate corresponding structural difference images, and the brightness values ​​and number of pixels corresponding to the residual areas of all annotated defects are counted. Finally, by analyzing these statistical data and applying the analysis method of the receiver operating characteristic curve, a set of first and second thresholds that can effectively separate all known defect types from normal image background fluctuations are determined. After completing this procedure, the inspection system is loaded with a set of data-verified algorithm parameters for this new model of circuit board, which provides a foundation for its subsequent online inspection performance.

[0040] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.

[0041] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not limiting. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention.

Claims

1. A circuit board defect analysis method based on visual inspection, characterized in that: include: Acquire an image of a current circuit board to be tested, and acquire an image of a previous circuit board immediately preceding the current circuit board to be tested as a dynamic reference image; Align the image of the current circuit board to be tested with the dynamic reference image; Calculating the gradient direction map of the aligned current circuit board image and the dynamic reference image respectively, wherein the gradient direction map is a data map representing the structural edge direction information of each pixel position in the image; The difference between the two gradient direction images is calculated to generate a structural difference image; and based on whether there is a residual area in the structural difference image, it is determined whether the current circuit board to be tested has defects.

2. A circuit board defect analysis method based on visual inspection according to claim 1, characterized in that: The alignment process is achieved by identifying multiple reference points on the image of the current circuit board to be tested and the dynamic reference image, and performing a global affine transformation based on the coordinates of the multiple reference points.

3. The circuit board defect analysis method based on visual inspection according to claim 1, characterized in that: The gradient direction map is calculated by applying the Sobel operator to the image to extract the gradient direction information of each pixel.

4. The circuit board defect analysis method based on visual inspection according to claim 1, characterized in that: The step of determining whether the current circuit board to be tested has defects is specifically as follows: when there are one or more connected areas in the structural difference image whose brightness value exceeds a first threshold and whose number of pixels is greater than a second threshold, the connected area is determined to be a residual area, and based on this, it is determined that the current circuit board to be tested has defects.

5. The circuit board defect analysis method based on visual inspection according to claim 1, characterized in that: When determining whether the current circuit board to be tested has a defect, the method also includes: locking the defect position of the defect on the current circuit board to be tested; and performing subsequent defect detection on the defect position of one or more subsequent circuit boards that follow; and generating diagnostic information characterizing the nature of the defect based on whether the defect reappears at the defect position.

6. A circuit board defect analysis method based on visual inspection according to claim 5, characterized in that: The steps of generating diagnostic information characterizing the nature of the defect are specifically as follows: if the defect is not detected again at the defect location of a preset number of subsequent circuit boards, then generating diagnostic information that the defect is a random failure; if the number of times the defect is detected at the defect location of the preset number of subsequent circuit boards exceeds a failure determination number threshold, then generating diagnostic information that the defect is a systematic failure.

7. The circuit board defect analysis method based on visual inspection according to claim 1, characterized in that: The method also includes: performing global statistical analysis on the structural difference image to generate a process stability index; and outputting a process stability early warning signal when the time series change trend of the process stability index meets a preset degradation condition.

8. The circuit board defect analysis method based on visual inspection according to claim 7, characterized in that: The steps for generating the process stability index are as follows: calculating the overall pixel value standard deviation of the structural difference image as the process stability index; pixel value standard deviation Calculated by the following formula: ,in, is the total number of pixels in the structural difference image, For the The pixel value of each pixel, is the average value of all pixels in the image.

9. The circuit board defect analysis method based on visual inspection according to claim 1, characterized in that: Also includes: Monitor the time interval between the images of the current circuit board under test and the previous circuit board; When the time interval exceeds a production cycle threshold, the use of the previous circuit board image as a dynamic reference image is suspended, and instead a sequence of multiple subsequent circuit board images after the production line is restarted is captured and stored; internal, continuous structural difference image calculations are performed on the multiple subsequent circuit board images in the sequence to generate a differential energy sequence; and when the value in the differential energy sequence is lower than a stable state threshold, the image of the last circuit board in the sequence is reconstructed into a new dynamic reference image.

10. The circuit board defect analysis method based on visual inspection according to claim 1, characterized in that: It also includes an initialization step, which is performed when the production line is started for the first time or the model of the circuit board to be tested is changed, including: obtaining images of an initial plurality of consecutive circuit boards; and setting the image of the last circuit board in the initial plurality of consecutive circuit boards as the first dynamic reference image for executing the step of obtaining a dynamic reference image.

Citation Information

Cited By

  • Power transmission line intelligent inspection method and system based on unmanned aerial vehicle and cloud side cooperation

    CN120976809A