Circuit board detection method and system based on adaptive light re-inspection according to defect type

By establishing a mapping relationship between defect types and illumination formulas, adaptive illumination re-inspection is achieved, solving the problem of non-targeted illumination parameter selection in existing technologies and improving the efficiency and accuracy of circuit board inspection.

CN123175972APending Publication Date: 2026-11-27ZHONGSHAN CHENGHAO ELECTRONICS CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202611492820.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-23
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

Existing circuit board inspection systems fail to adaptively select illumination parameters based on preliminary inspection results, resulting in a lack of specificity in secondary inspections, increased inspection time and computational overhead, and an inability to fully leverage the enhancing effect of specific illumination on specific defects.

Method used

A multidimensional mapping relationship between defect types and illumination formulas is established. Illumination parameters are queried through the defect type labels output by the initial detection, and the programmable light source array is controlled to perform secondary illumination. The illumination strategy is optimized by combining closed-loop feedback to achieve adaptive illumination re-inspection.

Benefits of technology

It significantly improves the defect detection rate, reduces the false alarm rate, and increases detection efficiency, adapting to the needs of multi-variety, small-batch production.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123175972A_ABST
    Figure CN123175972A_ABST
Patent Text Reader

Abstract

The application discloses a circuit board detection method and system based on adaptive light re-inspection according to defect types, which comprises the following steps: a preliminary detection module performs preliminary detection on a circuit board, and outputs candidate defect region position coordinates and a defect type label; a corresponding light formula is queried from a defect type-light formula mapping library according to the defect type label, the light formula comprising light source color, light source intensity and incident angle; a programmable light source array is controlled to perform secondary irradiation on the candidate defect region according to the formula and collect images; feature analysis is performed on the defect type label, and a final defect determination result is output; and a closed-loop feedback module compares the final determination result with the preliminary detection result, and when the false positive rate or the false negative rate exceeds a preset threshold, automatically updates the light parameters in the mapping library and synchronizes the light parameters to an adaptive light control module.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of PCBA board testing technology, specifically to a circuit board inspection method and system based on defect type adaptive illumination re-inspection. Background Technology

[0002] As the core carrier of electronic devices, the accuracy of detecting surface and soldering defects on circuit boards directly affects the reliability of end products. Automated optical inspection (AOI) is currently the mainstream inspection method on production lines. Its core challenge lies in the fact that different types of defects have fundamentally different requirements for lighting conditions. Surface scratches and foreign objects have the highest contrast under low-angle dark field lighting, open circuits and missing pads are clearest under high-angle bright field lighting, cold solder joints and poor solder joints require multi-color and multi-angle lighting to highlight their three-dimensional shape, and contaminants and flux residues rely on ultraviolet light to excite fluorescence for effective identification.

[0003] In existing technologies, some solutions attempt to improve detection coverage by switching between multiple light sources. For example, a resin plugging inspection machine with re-inspection function uses white light and ultraviolet light sources in conjunction with a camera for detection and re-inspection, respectively. However, the light source switching in this solution is based on a fixed sequence of inspection stations, rather than adaptively selecting based on the preliminary inspection results. Another patent, CN202010760554.7, discloses a light source device, defect detection method, and defect detection system. This method controls multiple sets of light sources to illuminate sequentially via a PCB board to obtain multiple inspection images, and then uses a photometric stereo vision algorithm to reconstruct the surface. However, this solution applies the same illumination sequence to all inspection areas and lacks the ability to perform targeted secondary inspections based on defect types. There is also an automatic optical re-judgment system, which captures images of defect areas based on defect information and generates color light re-judgment results and fluorescence re-judgment results. However, the selection of the re-judgment light source in this solution is mainly based on the binary logic of color light and fluorescence, without establishing a multi-dimensional mapping relationship between "defect type - illumination formula".

[0004] The common shortcoming of the aforementioned existing technologies is that the detection system does not use the defect type label output from the initial detection as the basis for selecting the illumination parameters for secondary detection. This results in a lack of specificity in the secondary detection, failing to fully utilize the enhancement effect of specific illumination on specific defects and increasing unnecessary detection time and computational overhead. Therefore, there is an urgent need for a circuit board detection scheme that can establish a mapping relationship between "defect type → illumination formula" and achieve adaptive secondary re-inspection. Summary of the Invention

[0005] To address the aforementioned problems, this application provides a circuit board inspection method and system based on defect type-adaptive illumination re-inspection. The specific technical solution of this application is as follows:

[0006] A circuit board inspection method based on defect type adaptive illumination re-inspection includes the following steps: S1: The circuit inspection system performs preliminary inspection on the circuit board through the preliminary inspection module, and then outputs the position coordinates of the candidate defect area and the defect type label; S2: According to the defect type label, the corresponding illumination recipe is queried from the defect type-illumination recipe mapping library, wherein the illumination recipe includes the light source color, light source intensity and incident angle; S3: The programmable light source array is controlled to perform secondary illumination on the candidate defect area according to the queried illumination recipe, and the image after secondary illumination is acquired; S4: Feature analysis is performed on the defect type label, and the final defect judgment result is output.

[0007] Furthermore, the preliminary detection in step S1 is performed on an edge computing device using a lightweight target detection network, and the defect type labels output by the lightweight target detection network include at least one of surface scratches, open circuits, solder joint abnormalities, and contaminants.

[0008] Furthermore, the preliminary detection module adopts a rapid comparison method based on a defect-free reference template, including the following steps: using the gold board image of the same batch and design of the circuit board as a reference, the region with structural differences from the reference template is located through a coarse-to-fine matching strategy, and the position coordinates and preliminary classification results of the difference region are output; the difference region is input into a lightweight target detection network for category prediction, and the suspected defect type label and corresponding confidence level are output; for candidate regions with confidence levels lower than a preset threshold, they are marked as category uncertain, and full illumination mode scanning is directly performed to determine the defect type.

[0009] Furthermore, the mapping relationships in the defect type-lighting recipe mapping library include: surface scratch defects correspond to low-angle dark field lighting and blue or green light; open circuit defects correspond to high-angle bright field lighting and white or red light; solder joint abnormality defects correspond to multi-color multi-angle ring light lighting; and contaminant defects correspond to ultraviolet light lighting.

[0010] Furthermore, the preliminary detection in step S1 is performed on an edge computing device using a lightweight target detection network, and the defect type labels output by the lightweight target detection network include at least one of surface scratches, open circuits, solder joint abnormalities, and contaminants.

[0011] Furthermore, the programmable light source array includes multiple sets of independently controllable LED light source units, and the color, brightness and incident angle of each set of light source units can be adjusted independently, with the incident angle adjustment range being 0° to 85°.

[0012] Furthermore, the circuit board inspection system performs feature analysis based on defect type labels, including the following steps: acquiring secondary images of candidate defect areas after light source switching; selecting the corresponding feature analysis algorithm based on the defect type label; when the defect type label is surface scratch, performing multi-directional, multi-scale edge detection based on Gabor filters, extracting the scratch skeleton, and calculating the scratch length, direction, and depth; when the defect type label is open circuit, performing binarization and connected component analysis on the bright field image, and determining whether the circuit is broken by the skeleton endpoint spacing and reference template difference; when the defect type label is solder joint abnormality, performing red, green, and blue channel separation on the multicolor light image, statistically analyzing the pixel ratio of each channel, inferring the three-dimensional slope distribution of the solder joint, and judging whether there is a hole or insufficient solder based on this; when the defect type label is contaminant, extracting the fluorescence region from the ultraviolet fluorescence image, calculating the fluorescence intensity and area, and comparing it with the standard material spectral library to confirm the contaminant type; and outputting the final defect type, location, size, and confidence level.

[0013] Furthermore, the closed-loop feedback module performs closed-loop feedback optimization, including the following steps: pairing the candidate defect region location, preliminary defect type label, and confidence level output by the preliminary detection module with the final defect type label output by the secondary imaging and fine judgment module according to location; using the secondary fine judgment result as the true label, and counting the number of true positives, false positives, and false negatives according to defect type; calculating the false alarm rate R_FP,d = FP_d / (FP_d + TP_d) and the false negative rate R_FN,d = FN_d / (FN_d + TP_d) according to defect type; when R_FP,d > T_FP,d, updating at least one of the light source color, light source intensity, incident angle, or illumination mode corresponding to the defect type according to the preset false alarm suppression direction; when R_FN,d > T_FN,d, updating at least one of the light source color, light source intensity, incident angle, or illumination mode corresponding to the defect type according to the preset false negative suppression direction; The updated illumination parameters are written into the defect type-illumination recipe mapping library and synchronized to the adaptive illumination control module.

[0014] Furthermore, it also includes step S5: comparing the final defect determination result output in step S4 with the preliminary detection result in step S1, updating the illumination parameter configuration in the defect type-illumination recipe mapping library based on the comparison result, and synchronizing the updated mapping relationship to the adaptive illumination control module.

[0015] A circuit board inspection system based on defect type adaptive illumination re-inspection is disclosed. This system executes the aforementioned circuit board inspection method based on defect type adaptive illumination re-inspection. The circuit board inspection system includes: a preliminary inspection module configured to perform preliminary inspection on the circuit board and output the location coordinates and defect type labels of candidate defect areas; a defect type-illumination recipe mapping library storing the mapping relationship between defect types and illumination parameters, including light source color, light source intensity, and incident angle; an adaptive illumination control module communicatively connected to the preliminary inspection module and the mapping library, configured to query the corresponding illumination recipe from the mapping library according to the defect type label and control a programmable light source array to perform secondary illumination on the candidate defect areas according to the queried illumination parameters; a secondary imaging and fine judgment module configured to acquire images after secondary illumination and output the final defect judgment result; and a closed-loop feedback module configured to compare the final defect judgment result with the output of the preliminary inspection module, and automatically update the illumination parameter configuration in the defect type-illumination recipe mapping library when the false alarm rate or false negative rate exceeds a preset threshold.

[0016] Compared with the prior art, the beneficial effects of the present invention include:

[0017] By establishing a multi-dimensional mapping relationship between "defect type → illumination formula," the illumination parameters for secondary inspection no longer depend on a fixed workstation sequence or a simple color / fluorescence binary logic. Instead, they are precisely matched based on the specific defect type label output from the initial inspection. Specifically, surface scratches correspond to low-angle dark field illumination with blue or green light, open circuits correspond to high-angle bright field illumination with white or red light, solder joint abnormalities correspond to multi-color, multi-angle ring light illumination, and contaminants correspond to ultraviolet light illumination. This fully leverages the enhancement effect of specific illumination on specific defects, significantly improving the defect detection rate and reducing the false alarm rate.

[0018] The preliminary detection module employs a lightweight target detection network executed on an edge computing device. Based on a fast comparison method using a defect-free reference template, it performs coarse-to-fine matching using images from the same batch of gold plates, quickly outputting the location coordinates and defect type labels of candidate defect areas. Adaptive illumination secondary imaging is performed only on candidate defect areas, avoiding the time wasted on full-sequence multi-illumination acquisition of the entire plate, improving detection efficiency by approximately 40% compared to full-process multi-illumination scanning. For candidate areas with confidence levels below a preset threshold, full-illumination mode scanning is directly performed to determine the defect type, ensuring detection reliability.

[0019] Based on the results of secondary precision judgment, the closed-loop feedback module counts the number of true positives, false positives, and false negatives according to the defect type, and calculates the false alarm rate and false negative rate. When the false alarm rate or false negative rate exceeds the preset threshold, it automatically updates at least one of the light source color, intensity, incident angle, or lighting mode corresponding to the defect type in the preset direction, and writes the updated lighting parameters into the mapping library and synchronizes them to the adaptive lighting control module. This enables the system to continuously learn the optimal lighting strategy during operation and adapt to the production needs of multiple varieties and small batches.

[0020] The programmable light source array includes multiple independently controllable LED light source units, supporting multi-dimensional independent adjustment of color, intensity, and incident angle. The incident angle covers a complete range from 0° to 85°, simultaneously meeting the needs of various lighting modes such as dark field lighting, bright field lighting, coaxial lighting, and multi-color ring light lighting. The secondary imaging and precision judgment module selects the corresponding feature analysis algorithm based on the defect type label. For example, it performs Gabor filtering for multi-directional and multi-scale edge detection on surface scratches, binarization and connected component analysis on open circuits, RGB channel separation to infer three-dimensional slope for solder joint anomalies, and ultraviolet fluorescence region extraction for contaminants. Finally, it outputs the defect type, location, size, and confidence level, achieving accurate and reliable defect judgment. Attached Figure Description

[0021] Figure 1 This is a flowchart illustrating a circuit board inspection method and system based on defect type adaptive illumination re-inspection in one embodiment of this application. Detailed Implementation

[0022] The embodiments of this application are described in detail below. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout.

[0023] In the description of this application, it should be noted that the directional terms such as "center", "lateral", "longitudinal", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", "clockwise", and "counterclockwise" indicate the orientation and positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. They should not be construed as limiting the specific protection scope of this application.

[0024] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features. Thus, the use of "first" or "second" to define a feature may explicitly or implicitly include one or more of that feature, and in the description of this application, "at least" means one or more, unless otherwise explicitly specified.

[0025] In this application, unless otherwise expressly specified and limited, the terms "assembly," "connection," and "joining" shall be interpreted broadly. For example, they may refer to a fixed connection, a detachable connection, or an integral connection; they may also refer to a mechanical connection; they may refer to a direct connection or a connection through an intermediate medium; or they may refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in this application according to the specific circumstances.

[0026] In the application, unless otherwise specified and limited, "above" or "below" the second feature can include direct contact between the first and second features, or contact between the first and second features through another feature between them. Furthermore, "above," "below," and "over" the second feature includes the first feature being directly above or diagonally above the second feature, or simply indicates that the first feature is at a higher horizontal level than the second feature. "Above," "below," and "below" the second feature includes the first feature being directly below or diagonally below the second feature, or simply indicates that the first feature is at a lower horizontal level than the second feature.

[0027] The following description, in conjunction with the accompanying drawings, further illustrates specific embodiments of this application, making the technical solution and its beneficial effects clearer and more explicit. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this application, but should not be construed as limiting it.

[0028] like Figure 1 As shown, this invention provides a circuit board inspection method based on defect type adaptive illumination re-inspection, which includes the following steps:

[0029] S1: The circuit inspection system performs preliminary inspection on the circuit board through the preliminary inspection module, and then outputs the location coordinates of candidate defect areas and defect type labels. Specifically, the preliminary inspection module quickly scans and analyzes the circuit board, identifies areas that may have defects, and provides the precise location of these areas in the circuit board coordinate system (e.g., represented by pixel coordinates or physical coordinates). At the same time, it assigns a preliminary defect type label to each candidate area, such as surface scratches, open circuits, abnormal solder joints, or contaminants, so that subsequent targeted light-based re-inspection can be performed based on the defect type.

[0030] S2: Based on the defect type label, query the corresponding illumination recipe from the defect type-illumination recipe mapping library. The illumination recipe includes the light source color, light source intensity, and incident angle. This mapping library pre-stores the correspondence between different defect types and optimal imaging illumination conditions. By querying, the optimal combination of illumination parameters for the current defect type can be quickly obtained, thereby providing suitable illumination conditions for subsequent secondary imaging and making the defect features more obvious in the image.

[0031] S3: Control the programmable light source array to provide secondary illumination to the candidate defect area according to the queried illumination formula, and acquire images after secondary illumination. The programmable light source array can independently adjust the color, brightness, and incident angle of each light source unit according to instructions, thereby forming a specific illumination pattern on the candidate defect area, such as dark field, bright field, ring light, or ultraviolet light, to fully expose the defect features. Then, a high-resolution image after secondary illumination is acquired by a camera for subsequent analysis.

[0032] S4: Perform feature analysis based on the defect type label and output the final defect judgment result. This feature analysis uses corresponding image processing algorithms for different defect types to extract geometric, texture, color and other features of the defect from the secondary image, compares them with the standard, and finally gives a comprehensive judgment result including the existence, type, location, size and confidence level of the defect.

[0033] In one embodiment, the preliminary detection in step S1 is performed on an edge computing device using a lightweight target detection network. The defect type labels output by the lightweight target detection network include at least one of surface scratches, open circuits, solder joint abnormalities, and contaminants. The lightweight target detection network can, for example, adopt structures such as MobileNet-SSD or YOLO-Nano, which reduces the computational resource requirements while ensuring detection accuracy. The edge computing device can be an industrial control computer, an embedded AI module, etc., to achieve real-time preliminary screening on the production line.

[0034] As one embodiment, the preliminary detection module employs a rapid comparison method based on a defect-free reference template, including the following steps:

[0035] Using images of immersion gold (ENIG) PCBs from the same batch and design as a reference, this method employs a coarse-to-fine matching strategy to locate regions with structural differences from the reference template. The results output the coordinates of these differences and preliminary classifications. Coarse matching utilizes normalized cross-correlation or feature point matching for rapid image alignment, while fine matching precisely locates these differences using pixel-level difference or structural similarity measurements.

[0036] The differential regions are input into a lightweight object detection network for category prediction, outputting a suspected defect type label and its corresponding confidence score. This network extracts features and classifies the differential regions, providing the probability that each region belongs to any defect type.

[0037] Candidate regions with a confidence level below a preset threshold are marked as having an uncertain category and are directly subjected to full-illumination mode scanning to determine the defect type. Full-illumination mode scanning refers to sequentially using multiple combinations of different colors, intensities, and angles of light to fully expose defect features, and then determining their true type through subsequent analysis.

[0038] As one embodiment, the mapping relationships in the defect type-lighting recipe mapping library include: surface scratch defects correspond to low-angle dark field illumination and blue or green light. Low-angle dark field illumination can highlight the scattered light from scratches, while blue or green light has shorter wavelengths and higher resolution for fine scratches. Open circuit defects correspond to high-angle bright field illumination and white or red light. High-angle bright field illumination ensures uniform illumination of the circuit surface, while white or red light is sensitive to the reflectivity of metal circuits, facilitating fracture identification. Solder joint anomaly defects correspond to multi-color, multi-angle ring light illumination. Multi-color, multi-angle ring light can illuminate solder joints from different directions, using the reflection differences of the red, green, and blue channels to infer the three-dimensional morphology of the solder joint. Contaminant defects correspond to ultraviolet light illumination. Ultraviolet light can excite certain contaminants to fluoresce, thus creating high contrast with the circuit board background.

[0039] The mapping library stores the corresponding lighting recipe parameter set using the defect type as the index key. Each defect type corresponds to a lighting recipe, which specifies the light source color, intensity level (e.g., 1-10), incident angle range, and illumination mode. An example mapping relationship is as follows:

[0040] The formulation for surface scratches / burrs is: blue light (450–495 nm), intensity level 4, incident angle 10°–30°, dark field illumination mode. Blue light has a short wavelength and a small diffraction limit, making it more effective at resolving minute scratches; the low-angle grazing illumination causes significant shadow scattering at the scratch edges.

[0041] The formula for defects such as open circuits / short circuits / missing pads is: white or red light (620–750 nm), intensity level 6, incident angle 45°–90°, bright field illumination mode. The high-angle bright field makes the planar integrity of the circuit and pads immediately apparent.

[0042] The formula for detecting solder joint defects such as cold solder joints, poor solder joints, and insufficient solder is a combination of red, green, and blue colors, intensity level 5, incident angle 25°–60°, and a multi-angle ring light pattern. Different colored lights illuminate the solder joints from different elevation angles, and the color distribution is analyzed to infer the fullness of the solder joint's three-dimensional shape. Hole defects appear black on the solder joint, while insufficient solder defects lack green and blue information.

[0043] The formulation for contaminant / flux residue defects is as follows: ultraviolet light (200–400 nm), intensity level 8, incident angle 30°–60°, fluorescence excitation mode. Fluoride and organic contaminants fluoresce under ultraviolet light excitation and are clearly visible against a dark background.

[0044] The formulation for internal structural anomalies is: a combination of ultraviolet light and polarized light, intensity level 7, incident angle 45°–70°, polarized fluorescence mode.

[0045] As one embodiment, the preliminary detection in step S1 is performed on an edge computing device using a lightweight target detection network, and the defect type label output by the lightweight target detection network includes at least one of surface scratches, open circuits, solder joint abnormalities, and contaminants.

[0046] In one embodiment, the programmable light source array includes multiple independently controllable LED light source units. The color, brightness, and incident angle of each light source unit can be adjusted independently, with the incident angle adjustment range from 0° to 85°. Each LED light source unit can contain LED chips of various colors such as red, green, blue, white, and ultraviolet. Brightness adjustment is achieved through PWM dimming, and continuous change of the incident angle is achieved through micro servos or mechanical structures, thereby creating a rich variety of lighting modes.

[0047] As one embodiment, the circuit board inspection system performs feature analysis based on defect type labels, including the following steps:

[0048] After the light source switch is completed, acquire secondary images of the candidate defect area. Ensure stable image quality, with no motion blur or overexposure.

[0049] Select the corresponding feature analysis algorithm based on the defect type label. Different defect types correspond to different image processing procedures.

[0050] When the defect type is labeled as surface scratch, multi-directional, multi-scale edge detection based on Gabor filters is performed to extract the scratch skeleton and calculate the scratch length, direction, and depth. Gabor filters can effectively enhance edge information at different directions and scales, and the geometric parameters of the scratch can be obtained through pixel statistics after skeleton extraction.

[0051] When the defect type is labeled as open circuit, binarization and connected component analysis are performed on the bright field image. The line breakage is determined by the skeleton endpoint spacing and the reference template difference. Binarization separates the line from the background, and connected component analysis can find the broken line segments. If the skeleton endpoint spacing exceeds a threshold, it is determined to be an open circuit.

[0052] When the defect type is labeled as solder joint abnormality, the red, green, and blue channels of the multicolor light image are separated, the pixel ratio of each channel is statistically analyzed, the three-dimensional slope distribution of the solder joint is deduced, and based on this, it is determined whether there are holes or insufficient solder. The reflectivity of different colors of light on the surface of the solder joint is related to the slope. By using the channel ratio, the normal direction of the solder joint surface can be reconstructed, thereby identifying holes and solder abnormalities.

[0053] When the defect type is labeled as a contaminant, the fluorescent region is extracted from the ultraviolet fluorescence image, the fluorescence intensity and area are calculated, and compared with a standard material spectral library to confirm the contaminant type. Different contaminants exhibit different fluorescence spectra under ultraviolet light; comparison can determine the type of contaminant.

[0054] Output the final defect type, location, size, and confidence level. Integrate the analysis results into structured data for subsequent processing.

[0055] As one embodiment, the closed-loop feedback module performs closed-loop feedback optimization, including the following steps:

[0056] The candidate defect region location, preliminary defect type label, and confidence level output by the preliminary detection module are paired with the final defect type label output by the secondary imaging and fine judgment module according to location. Nearest neighbor matching or intersection-union ratio matching can be used for pairing to ensure that the preliminary results and final results for the same defect correspond.

[0057] Using the results of the secondary refinement as the true label, the number of true positives, false positives, and false negatives are counted separately according to defect type. A true positive indicates that both the initial detection and the final judgment are of the defect type; a false positive indicates that the initial detection judged it to be the defect type, but the final judgment is other or no defect; a false negative indicates that the initial detection did not judge it to be the defect type, but the final judgment is the defect type.

[0058] The false alarm rate R_FP,d = FP_d / (FP_d + TP_d) and the false negative rate R_FN,d = FN_d / (FN_d + TP_d) are calculated according to the defect type.

[0059] When R_FP,d > T_FP,d, at least one of the following parameters corresponding to the defect type is updated according to the preset false alarm suppression direction: light source color, light source intensity, incident angle, or illumination mode. For example, if the false alarm rate of a certain defect type is high, it indicates that the false defect features are too obvious under the current illumination. The illumination parameters can be adjusted to reduce the contrast or change the angle to suppress the false features.

[0060] When R_FN,d > T_FN,d, at least one of the following is updated according to the preset missed detection suppression direction: light source color, light source intensity, incident angle, or illumination mode corresponding to the defect type. For example, if the missed detection rate is high, it indicates that the current illumination is not sufficient to expose the defect, and the illumination intensity can be increased or the color can be changed to highlight the defect features.

[0061] The updated illumination parameters are written into the defect type-illumination recipe mapping library and synchronized to the adaptive illumination control module. This achieves adaptive optimization of the illumination recipe.

[0062] As one embodiment, the system further includes step S5: comparing the final defect determination result output in step S4 with the preliminary detection result in step S1, updating the illumination parameter configuration in the defect type-illumination recipe mapping library based on the comparison result, and synchronizing the updated mapping relationship to the adaptive illumination control module. Through this closed-loop feedback, the system can continuously accumulate detection experience and continuously improve the detection rate and accuracy of various defects.

[0063] A circuit board inspection system based on defect type adaptive illumination re-inspection is provided, wherein the circuit board inspection system performs the aforementioned circuit board inspection method based on defect type adaptive illumination re-inspection.

[0064] The circuit board testing system includes:

[0065] The preliminary detection module is configured to perform rapid preliminary detection on the circuit board and output the location coordinates of candidate defect areas and defect type labels. The preliminary detection module employs at least one of the following methods: a rapid comparison method based on a defect-free reference template, using a coarse-to-fine matching strategy to locate areas with structural differences from the reference template; a lightweight deep learning object detection network, rapidly outputting the location and approximate category of suspected defects on an edge computing device; and a rapid localization method based on adaptive threshold segmentation and contour analysis.

[0066] The Defect Type-Lighting Recipe Mapping Library stores a multi-dimensional mapping relationship between defect types and lighting parameters, including light source color (wavelength), light source intensity, incident angle, and illumination mode. The mapping relationship includes the following correspondence rules: surface scratches / foreign matter defects correspond to low-angle dark field illumination with blue or green light; open / short circuit defects correspond to high-angle bright field illumination with white or red light; solder joint anomalies correspond to multi-color, multi-angle ring light illumination; contaminant defects correspond to ultraviolet light illumination; and internal structural anomalies correspond to a combination of ultraviolet and polarized light illumination.

[0067] An adaptive illumination control module, communicatively connected to the preliminary detection module and the defect type-illumination recipe mapping library, is configured to receive defect type labels output by the preliminary detection module, query the corresponding illumination recipe from the mapping library, and control the programmable light source array to perform secondary illumination on the candidate defect area according to the queried illumination parameters. The programmable light source array includes multiple independently controllable LED light source units, each with independently adjustable color, brightness, and incident angle, with the incident angle adjustable from 0° to 85°.

[0068] The secondary imaging and precision judgment module is configured to acquire secondary images of the candidate defect area after the adaptive illumination control module completes secondary illumination, perform targeted feature analysis based on the secondary images, and output the final defect judgment result. The targeted feature analysis selects the corresponding analysis algorithm according to the defect type: edge detection and directionality analysis are performed for surface scratch defects; connected component analysis and circuit integrity judgment are performed for open / short circuit defects; multicolor light color distribution analysis and three-dimensional shape inversion are performed for solder joint anomaly defects; and fluorescence intensity distribution analysis is performed for contaminant defects.

[0069] The closed-loop feedback module is configured to compare the final judgment result output by the secondary fine judgment module with the preliminary detection result. When the false alarm rate or false negative rate of the preliminary detection exceeds the preset threshold, the module automatically updates the illumination parameter configuration in the defect type-illumination recipe mapping library and synchronizes the updated mapping relationship to the adaptive illumination control module.

[0070] Compared with the prior art, the beneficial effects of the present invention include:

[0071] By establishing a multi-dimensional mapping relationship between "defect type → illumination formula," the illumination parameters for secondary inspection no longer depend on a fixed workstation sequence or a simple color / fluorescence binary logic. Instead, they are precisely matched based on the specific defect type label output from the initial inspection. Specifically, surface scratches correspond to low-angle dark field illumination with blue or green light, open circuits correspond to high-angle bright field illumination with white or red light, solder joint abnormalities correspond to multi-color, multi-angle ring light illumination, and contaminants correspond to ultraviolet light illumination. This fully leverages the enhancement effect of specific illumination on specific defects, significantly improving the defect detection rate and reducing the false alarm rate.

[0072] The preliminary detection module employs a lightweight target detection network executed on an edge computing device. Based on a fast comparison method using a defect-free reference template, it performs coarse-to-fine matching using images from the same batch of gold plates, quickly outputting the location coordinates and defect type labels of candidate defect areas. Adaptive illumination secondary imaging is performed only on candidate defect areas, avoiding the time wasted on full-sequence multi-illumination acquisition of the entire plate, improving detection efficiency by approximately 40% compared to full-process multi-illumination scanning. For candidate areas with confidence levels below a preset threshold, full-illumination mode scanning is directly performed to determine the defect type, ensuring detection reliability.

[0073] Based on the results of secondary precision judgment, the closed-loop feedback module counts the number of true positives, false positives, and false negatives according to the defect type, and calculates the false alarm rate and false negative rate. When the false alarm rate or false negative rate exceeds the preset threshold, it automatically updates at least one of the light source color, intensity, incident angle, or lighting mode corresponding to the defect type in the preset direction, and writes the updated lighting parameters into the mapping library and synchronizes them to the adaptive lighting control module. This enables the system to continuously learn the optimal lighting strategy during operation and adapt to the production needs of multiple varieties and small batches.

[0074] The programmable light source array includes multiple independently controllable LED light source units, supporting multi-dimensional independent adjustment of color, intensity, and incident angle. The incident angle covers a complete range from 0° to 85°, simultaneously meeting the needs of various lighting modes such as dark field lighting, bright field lighting, coaxial lighting, and multi-color ring light lighting. The secondary imaging and precision judgment module selects the corresponding feature analysis algorithm based on the defect type label. For example, it performs Gabor filtering for multi-directional and multi-scale edge detection on surface scratches, binarization and connected component analysis on open circuits, RGB channel separation to infer three-dimensional slope for solder joint anomalies, and ultraviolet fluorescence region extraction for contaminants. Finally, it outputs the defect type, location, size, and confidence level, achieving accurate and reliable defect judgment.

[0075] In the description of this specification, the terms "an embodiment," "preferred," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of this application. The illustrative expressions of the above terms in this specification do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described can be combined in any suitable manner in one or more embodiments or examples. The connection methods linked in the description of this specification have significant effects and practical utility.

[0076] Based on the above description of the structure and principles, those skilled in the art should understand that this application is not limited to the specific embodiments described above. Improvements and substitutions made using techniques known in the art based on this application all fall within the protection scope of this application and should be defined by the claims.

Claims

1. A circuit board inspection method based on defect type adaptive illumination re-inspection, characterized in that, The method includes the following steps: S1: The circuit inspection system performs preliminary inspection on the circuit board through the preliminary inspection module, and then outputs the location coordinates of the candidate defect area and the defect type label; S2: Query the corresponding lighting recipe from the defect type-lighting recipe mapping library according to the defect type label. The lighting recipe includes light source color, light source intensity and incident angle. S3: Control the programmable light source array to perform secondary illumination on the candidate defect area according to the queried illumination formula, and acquire the image after secondary illumination; S4: Perform feature analysis based on the defect type label and output the final defect determination result.

2. The circuit board inspection method based on defect type adaptive illumination re-inspection according to claim 1, characterized in that, The preliminary detection in step S1 is performed on an edge computing device using a lightweight target detection network. The defect type labels output by the lightweight target detection network include at least one of surface scratches, open circuits, solder joint abnormalities, and contaminants.

3. The circuit board inspection method based on defect type adaptive illumination re-inspection according to claim 2, characterized in that, The preliminary inspection module employs a rapid comparison method based on a defect-free reference template, including the following steps: Using images of gold-plated circuit boards of the same batch and design as a reference, a coarse-to-fine matching strategy is used to locate areas with structural differences from the reference template, and the location coordinates and preliminary classification results of the differences are output. The differential regions are input into a lightweight target detection network for category prediction, and the suspected defect type label and corresponding confidence score are output. Candidate regions with confidence levels below a preset threshold are marked as having an uncertain category and are directly scanned in full illumination mode to determine the defect type.

4. The circuit board inspection method based on defect type adaptive illumination re-inspection according to claim 3, characterized in that, The mapping relationships in the defect type-lighting recipe mapping library include: surface scratch defects correspond to low-angle dark field lighting and blue or green light; open circuit defects correspond to high-angle bright field lighting and white or red light; solder joint abnormality defects correspond to multi-color multi-angle ring light lighting; and contaminant defects correspond to ultraviolet light lighting.

5. The circuit board inspection method based on defect type adaptive illumination re-inspection according to claim 3, characterized in that, The preliminary detection in step S1 is performed on an edge computing device using a lightweight target detection network. The defect type labels output by the lightweight target detection network include at least one of surface scratches, open circuits, solder joint abnormalities, and contaminants.

6. The circuit board inspection method based on defect type adaptive illumination re-inspection according to claim 5, characterized in that, The programmable light source array includes multiple sets of independently controllable LED light source units. The color, brightness, and incident angle of each set of light source units can be adjusted independently, with the incident angle adjustment range being 0° to 85°.

7. The circuit board inspection method based on defect type adaptive illumination re-inspection according to claim 1, characterized in that, The circuit board inspection system performs feature analysis based on defect type labels, including the following steps: After the light source switching is completed, a secondary image of the candidate defect area is acquired; Select the corresponding feature analysis algorithm based on the defect type label; When the defect type label is surface scratch, perform multi-directional multi-scale edge detection based on Gabor filter, extract the scratch skeleton, and calculate the scratch length, direction, and depth; When the defect type label is open circuit, binarization and connected component analysis are performed on the bright field image, and the line is determined to be broken by the skeleton endpoint spacing and reference template difference. When the defect type label is solder joint abnormality, the red, green and blue channels are separated on the multicolor light image, the pixel ratio of each channel is counted, the three-dimensional slope distribution of the solder joint is deduced, and the hole or insufficient solder is judged accordingly. When the defect type is labeled as a contaminant, the fluorescent region is extracted from the ultraviolet fluorescence image, the fluorescence intensity and area are calculated, and the data are compared with the standard material spectral library to confirm the contaminant type. Output the final defect type, location, size, and confidence level.

8. The circuit board inspection method based on defect type adaptive illumination re-inspection according to claim 1, characterized in that, The closed-loop feedback module performs closed-loop feedback optimization, including the following steps: The candidate defect region location, preliminary defect type label, and confidence level output by the preliminary detection module are paired with the final defect type label output by the secondary imaging and fine judgment module according to location. Using the results of the secondary fine-tuning as the true label, the number of true positives, false positives and false negatives are counted separately according to the defect type; The false alarm rate R_FP,d = FP_d / (FP_d + TP_d) and the false negative rate R_FN,d = FN_d / (FN_d + TP_d) are calculated according to the defect type. When R_FP,d > T_FP,d, update at least one of the following according to the preset false alarm suppression direction: light source color, light source intensity, incident angle, or illumination mode corresponding to the defect type. When R_FN,d > T_FN,d, update at least one of the following parameters for the defect type: light source color, light source intensity, incident angle, or illumination mode, according to the preset missing report suppression direction. The updated illumination parameters are written into the defect type-illumination recipe mapping library and synchronized to the adaptive illumination control module.

9. The circuit board inspection method based on defect type adaptive illumination re-inspection according to claim 1, characterized in that, It also includes step S5: comparing the final defect judgment result output in step S4 with the preliminary detection result in step S1, updating the illumination parameter configuration in the defect type-illumination recipe mapping library based on the comparison result, and synchronizing the updated mapping relationship to the adaptive illumination control module.

10. A circuit board inspection system based on defect type adaptive illumination re-inspection, characterized in that, The circuit board inspection system performs the circuit board inspection method based on defect type adaptive illumination re-inspection as described in any one of claims 1 to 9; The circuit board testing system includes: The preliminary inspection module is configured to perform preliminary inspections on the circuit board and output the location coordinates of candidate defect areas and defect type labels; The defect type-lighting recipe mapping library stores the mapping relationship between defect types and lighting parameters, including light source color, light source intensity and incident angle. An adaptive illumination control module, which is communicatively connected to the preliminary detection module and the mapping library, is configured to query the corresponding illumination recipe from the mapping library according to the defect type label, and control the programmable light source array to perform secondary illumination on the candidate defect area according to the queried illumination parameters; And a secondary imaging and fine judgment module, configured to acquire images after secondary illumination and output the final defect judgment result; The closed-loop feedback module is configured to compare the final defect determination result with the output of the preliminary detection module, and automatically update the illumination parameter configuration in the defect type-illumination recipe mapping library when the false alarm rate or false negative rate exceeds a preset threshold.

Citation Information

Patent Citations

  • Light source device, defect detection method and defect detection system

    CN111999313A