Method for detecting, identifying and analyzing residues in cavity of circuit board
By employing a multi-stage collaborative analysis method combining X-ray imaging, chemical colorimetric reactions, and spectral detection, the accuracy problem of detecting residues inside circuit board cavities was solved, enabling efficient identification and classification of complex residues.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-15
- Publication Date
- 2026-03-17
AI Technical Summary
Existing technologies lack effective zoning, classification, and consistency verification mechanisms when detecting residues inside circuit board cavities, resulting in insufficient accuracy and reliability of analysis results. In particular, they are prone to missed detections and misjudgments in complex residue situations.
A multi-stage, multi-source collaborative analysis method combining X-ray imaging with chemical colorimetric reactions and spectral detection was adopted. Suspected residual areas were located by the difference in image grayscale, chemical colorimetric reagents were applied to screen the areas to be analyzed, dynamic subset division was performed based on the colorimetric reaction intensity and contour features, and the consistency of components was verified by energy dispersive spectroscopy and spectral detection to optimize the set of areas to be analyzed.
It significantly improves the accuracy of classifying residues in circuit board cavities, reduces missed detections and misjudgments, and achieves systematic differentiation and classification of diffusion-type and adhesion-type residues.
Smart Images

Figure CN121678724A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of circuit board testing technology, specifically a method for detecting, identifying, and analyzing residues inside a circuit board cavity. Background Technology
[0002] As a core component of electronic devices, the cleanliness of circuit boards during the manufacturing process directly affects the reliability and long-term stability of the products. Especially in circuit boards involving cavity structures such as high-density interconnects and packaging substrates, various contaminants such as solder paste, flux, etching solution, and organic decomposition products may remain after processing. If these residues are not effectively detected and removed, they may cause failures such as decreased insulation resistance, corrosion, or even short circuits during subsequent applications, affecting the performance and lifespan of the products.
[0003] Currently, the main technologies for detecting residues inside circuit board cavities are to illuminate the surface of the circuit board with visible light and use an industrial camera to collect reflected light images. Abnormal areas are then identified based on visual features such as color, texture, and contrast. Alternatively, X-rays can be used to penetrate materials and form grayscale difference images on a detector, thereby revealing the internal structure of the cavity.
[0004] However, existing technologies still have the following limitations: existing technical solutions mostly use single or simple serial detection methods, which can usually only analyze pre-selected locations and fail to effectively integrate image morphological features, chemical colorimetric reactions and component analysis data, resulting in one-sided basis for residue judgment. For complex residue situations where they are spatially adjacent or have overlapping components, there is a lack of effective zoning, classification and consistency verification mechanisms, and the accuracy and reliability of the analysis results need to be improved. Summary of the Invention
[0005] To overcome the shortcomings of the prior art, embodiments of the present invention provide a method for detecting, identifying, and analyzing residues inside a circuit board cavity, which can effectively solve the problems involved in the prior art.
[0006] The objective of this invention can be achieved through the following technical solution: a method for detecting, identifying and analyzing residues inside a circuit board cavity, comprising: S1, acquiring an X-ray image of a circuit board sample, locating all suspected residue areas based on image grayscale differences, and generating a spatial set containing the coordinate positions of each suspected residue area.
[0007] S2. Apply chemical colorimetric reagents to the spatial set, and based on the colorimetric reaction intensity of each suspected residual area and the contour characteristics of the X-ray image, screen and integrate the set of areas to be analyzed according to the residue matching status.
[0008] S3. Based on the spatial characteristics of residue diffusion, the set of regions to be analyzed is divided into at least one subset, wherein different subsets are allowed to contain the same regions to be analyzed.
[0009] S4. By using energy dispersive spectroscopy and spectral detection, the elemental composition and spectral distribution of each region to be analyzed are obtained to analyze the candidate residue categories involved in each region to be analyzed. Based on the consistency of candidate residue categories within the same subset, the accuracy of the subset division is judged, and the subset division is dynamically adjusted until the consistency requirements are met.
[0010] S5. Based on the subset partitioning results, output the specific residue category for each subset.
[0011] Compared with the prior art, the embodiments of the present invention have at least the following advantages or beneficial effects: (1) The present invention integrates X-ray imaging, chemical colorimetric reaction, energy spectrum analysis and spectral detection in sequence, combining morphological localization, chemical response and component determination, overcoming the limitations of existing single or discrete detection methods. This multi-stage, multi-information source collaborative analysis significantly reduces the missed detection and misjudgment caused by missing or one-sided information.
[0012] (2) This invention quantifies the intensity of color reaction and the sharpness of image contours, and integrates the regions to be analyzed based on the dual-condition screening rule of strong color or blurred contours, effectively filtering out non-target interference structures, thereby optimizing the quality of the set of regions to be analyzed.
[0013] (3) The present invention performs dynamic subset division based on spatial proximity and contour features, and performs consistency verification and iterative adjustment in combination with the results of component analysis, thus constructing a closed loop of spatial clustering and component verification. This ensures that the subsets used for category determination have a high degree of consistency in spatial distribution and material composition, realizes the systematic distinction and classification of diffusion-type residues and attachment-type residues, and improves the accuracy of category determination. Attached Figure Description
[0014] The present invention will be further described with reference to the accompanying drawings, but the embodiments in the drawings do not constitute any limitation on the present invention. For those skilled in the art, other drawings can be obtained based on the following drawings without creative effort.
[0015] Figure 1 This is a schematic diagram of the method flow of the present invention.
[0016] Figure 2 This is a flowchart illustrating the logic for determining the contour sharpness feature quantity in this invention.
[0017] Figure 3 This is a flowchart illustrating the process of analyzing candidate residue categories in each region to be analyzed in this invention. Detailed Implementation
[0018] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0019] Reference Figure 1 As shown, the present invention provides a method for detecting, identifying and analyzing residues inside a circuit board cavity, including: S1, acquiring an X-ray image of a circuit board sample, locating all suspected residue areas based on image grayscale differences, and generating a spatial set containing the coordinate positions of each suspected residue area.
[0020] The specific process of locating all suspected residual areas based on image grayscale differences is as follows: the acquired X-ray image is subjected to noise reduction and grayscale normalization processing to obtain a standard grayscale image.
[0021] In the standard grayscale image, a background area with no residue inside the circuit board cavity structure is determined, and the average grayscale value of the background area is calculated as the background reference value.
[0022] It should be noted that the background area without residue is a continuous region of pure background initially determined based on the morphological characteristics of the cavity structure in the standard grayscale image.
[0023] In the continuous region of the pure background, multiple regions with uniform area are divided as candidate background regions.
[0024] For each candidate background region, calculate the grayscale variance of all pixels within it, and select the candidate background region with the smallest grayscale variance as the background region.
[0025] The arithmetic mean of the gray values of all pixels in the background area is calculated, and the obtained average value is used as the average gray value of the background area, i.e., the background reference value.
[0026] In the standard grayscale image, all connected pixels whose grayscale values are continuously higher than the background reference value are initially identified as potential regions.
[0027] In this embodiment, the standard grayscale image is binarized and segmented using the background reference value as a grayscale threshold. Pixels with grayscale values higher than the grayscale threshold are classified as foreground pixels, and the remaining pixels are classified as background pixels. Subsequently, a connected component analysis method is used to extract all sets of foreground pixels that are connected to each other. Each such set constitutes an initial suspected region.
[0028] While grayscale thresholding can quickly locate regions of difference, it can also introduce isolated points or tiny connected regions caused by image noise or edge effects. Most of these regions are not real remnants.
[0029] Based on this, for each initial suspected region, a structural element is set based on the image resolution and the minimum expected size of the residue. Morphological opening operation is used for processing. All regions that are retained after processing are determined as all suspected residue regions. The coordinates of the circumscribed rectangle vertex or the geometric centroid coordinates of each suspected residue region are calculated, recorded, and the spatial set is generated.
[0030] It should be noted that the shape and size of the structural element are determined based on the number of pixels in the image per unit length and the minimum physical size of the residue allowed by the process. For example, if the image resolution is 20 pixels per millimeter and the minimum residue size to be detected by the process is 0.1 millimeters, then the size of the structural element can be set as a square with a side length of not less than 2 pixels.
[0031] The morphological opening operation sequentially performs erosion and dilation operations on each initial suspected region to smooth the region boundaries, separate weak connections, and remove small discrete points. The regions that remain connected after the above processing are the final suspected residual regions.
[0032] It should also be noted that the spatial set specifically refers to: for each of the suspected residual regions, calculating the coordinates of the circumscribed rectangle vertex or the coordinates of the geometric centroid.
[0033] The coordinates of the circumscribed rectangle vertices are obtained by determining the coordinates of the opposite diagonal vertices of the smallest regular rectangle that can completely enclose the pixel set of the region.
[0034] The geometric centroid coordinates are obtained by calculating the arithmetic mean of all pixel coordinates within the region. The coordinate information of all suspected residual regions is recorded and a structured data set, namely the spatial set, is generated.
[0035] Through the above step S1, the spatial location information of all suspected residual areas in the circuit board cavity has been obtained. Based on this, in order to further distinguish the actual residues and preliminarily determine the type of residues, it is necessary to combine chemical colorimetric reactions and image morphological features for collaborative analysis and screening.
[0036] S2. Apply chemical colorimetric reagents to the spatial set, and based on the colorimetric reaction intensity of each suspected residual area and the contour characteristics of the X-ray image, screen and integrate the set of areas to be analyzed according to the residue matching status.
[0037] The intensity of the colorimetric reaction is specifically manifested as follows: after applying a chemical colorimetric reagent and reaching a preset reaction time, an image acquisition device with fixed light source conditions and shooting parameters is used to acquire color digital images of each suspected residual area under standard lighting conditions.
[0038] It should be noted that the preset reaction time is obtained through prior experiments by taking the time required for the reagent to react with each known target residue under standard temperature, humidity and concentration conditions, and then selecting the reaction time that takes the longest to achieve complete color development and setting it as the uniform preset reaction time.
[0039] The color image is converted from the RGB color space to the HSV color space.
[0040] For each suspected residual area, extract the saturation component values of all pixels within its corresponding image area and calculate their average value as the average saturation of that area.
[0041] In this embodiment, the average saturation is specifically achieved through the following steps: for each suspected residual region in the spatial set, it is located in the image that has completed color space conversion based on its determined coordinate position or pixel set.
[0042] Then, iterate through each pixel in the area and read its saturation component value in the HSV color space.
[0043] Finally, the arithmetic mean of all extracted saturation component values is calculated to obtain the average saturation of the region.
[0044] Pixels with saturation component values greater than the average saturation within the region are selected to form a color-connected region, and the pixel area of the color-connected region is calculated. The pixel area of the color-connected region is obtained directly by counting the total number of pixels contained in the set.
[0045] Obtain the pixel area corresponding to this region in the X-ray image.
[0046] Based on the ratio of the average saturation to the area of the colorimetric connected region, the colorimetric reaction intensity level of the suspected residual region is determined, and the colorimetric reaction intensity level is divided into strong or weak.
[0047] The colorimetric reaction intensity level classification is achieved through the following process: calculate the median value of the average saturation of all suspected residual areas, record it as the reference saturation, and compare the average saturation of any suspected residual area to be judged with the reference saturation.
[0048] Calculate the median value of the area ratio of the colored connected regions of all suspected residual areas, and record it as the baseline area ratio. Then compare the area ratio of the colored connected regions of any suspected residual area to be determined with the baseline area ratio.
[0049] When a region simultaneously satisfies that its average saturation is greater than or equal to the reference saturation and its color-connected region area ratio is greater than or equal to the reference area ratio, the color-reaction intensity level of the region is determined to be strong.
[0050] Otherwise, the colorimetric reaction intensity level of the area is determined to be weak.
[0051] It should be noted that an average saturation greater than or equal to the median baseline value of the entire region indicates that the region as a whole exhibits a color purity higher than the typical level, which is a direct manifestation of a strong color rendering response. On the other hand, a color rendering connected region area ratio greater than or equal to the median baseline value means that the high-purity color rendering part occupies a relatively large proportion in the region, and the color rendering response is not only strong but also widely distributed.
[0052] When a suspected residual area meets both of the above conditions, it is confirmed from both the overall colorimetric concentration and the spatial distribution range that its colorimetric reaction has a significant intensity, thus constituting a dual reliable basis for determining its strong level.
[0053] Based on this, in order to further improve the accuracy and reliability of screening and avoid misjudgment that may be caused by a single feature criterion, morphological contour features based on X-ray images are introduced as another independent auxiliary judgment dimension.
[0054] Reference Figure 2 As shown, in a preferred embodiment of the present invention, the contour features of the X-ray image are specifically as follows: for each suspected residual region in the spatial set, the corresponding image region is extracted from the standard grayscale image.
[0055] Calculate the grayscale gradient magnitude of all pixels within the image region and take the average value to obtain the internal average gradient of the region.
[0056] It should be noted that the Sobel operator is used to calculate the gray-level gradient values of the pixel in the horizontal and vertical directions respectively. The square root of the sum of the squares of the horizontal and vertical gradient values of each pixel is taken as the gradient magnitude of each pixel. After traversing all pixels in the region and repeating the above process, the gray-level gradient magnitudes of all pixels are arithmetically averaged. The result is the internal average gradient of the region.
[0057] For the contour edge pixels of this region, calculate the average grayscale gradient magnitude of the contour edge pixels to obtain the average edge gradient of this region.
[0058] It should be noted that the contour edge pixels are based on the set of pixel coordinates corresponding to the region in the standard grayscale image. The Canny edge detection algorithm is used to extract and identify all the pixels that constitute the outer contour of the region. The set of pixels is the contour edge pixel set.
[0059] The Canny edge detection algorithm works as follows: First, the image is Gaussian filtered to suppress noise; then, the gradient magnitude and direction of the image are calculated, and non-maximum suppression is performed along the gradient direction to refine the edges; finally, hysteresis thresholding is performed by setting high and low thresholds to detect and connect the edges to form a continuous set of edge pixels with a single pixel width.
[0060] For each pixel in the set of pixels on the contour edge, the average gradient of the edge is calculated in the same way as the average gradient of the interior.
[0061] The difference between the edge average gradient and the interior average gradient is calculated to obtain the absolute gradient difference.
[0062] The ratio of the absolute gradient difference to the internal average gradient is calculated to obtain the contour sharpness feature.
[0063] In this embodiment, the contour sharpness feature defined by the above calculation is a normalized index used to quantify the clarity of the contour of suspected residual areas.
[0064] Considering that the absolute gradient difference represents the intensity of change at the edge, the gray-scale transition amplitude from the interior of the region to the boundary can be quantified. The larger the transition, the clearer the boundary.
[0065] The internal average gradient reflects the inherent gray-scale fluctuations or background noise level within the region; the smaller the value, the more uniform the region.
[0066] Therefore, by calculating the ratio of the two, a normalized measure of edge salience relative to internal uniformity is achieved. The larger the ratio, the sharper and clearer the contour.
[0067] Within the spatial set, all other regions that satisfy the geometric proximity condition with the current region to be determined are identified, forming its neighboring region set.
[0068] It should be noted that the geometric proximity condition specifically refers to: using the geometric centroid coordinates of each region to represent its spatial position, calculating the Euclidean distance between the centroids of the current region and other regions in the spatial set, and determining that the geometric proximity condition is met when the Euclidean distance between two regions is less than or equal to a preset distance threshold. The preset distance threshold is determined adaptively based on the size of the current region to ensure that the proximity range matches the size of the region itself, and is exemplarily set as the square root of the area of the current region.
[0069] Calculate the average value of the contour sharpness feature of all regions in the neighboring region set, and use it as a reference value for local background sharpness.
[0070] The contour sharpness feature of the region to be determined is compared with the local background sharpness reference value.
[0071] If the contour sharpness feature is greater than or equal to a preset multiple of the local background sharpness reference value, then the contour feature of the region to be judged is determined to be sharp.
[0072] Otherwise, the contour features of the region to be determined are deemed to be blurry.
[0073] In a preferred embodiment of the present invention, the preset multiple is set based on statistical analysis of a known sample set. Specifically, a sample set containing multiple typical residue states is collected, wherein the true contour features of each sample region have been pre-calibrated by other verification methods. The ratio of the contour sharpness feature of all regions in the sample set that are calibrated as having sharp contours to the corresponding local background sharpness reference value is calculated to obtain a set of ratio data. The minimum value of the set of ratio data is taken as the preset multiple.
[0074] In this embodiment, sharp contours and blurry contours have clear physical meanings and causes, as follows: Sharp contours refer to the characteristics of clear edges and steep grayscale transitions in the image of suspected residual areas. This characteristic usually corresponds to the following physical situations: the residue is solid and dense, mostly adhering residues, such as metal particles or inorganic crystals, or the residue has not undergone obvious diffusion, wetting or mutual dissolution with the substrate, and the boundary remains physically separated.
[0075] Blurred outlines refer to the characteristics of suspected residual areas in an image, such as diffused edges and gradual grayscale transitions. This characteristic usually corresponds to the following physical conditions: the residue is liquid or has flowed, diffused and infiltrated, and is mostly diffused residue, such as flux residue and organic contaminants.
[0076] Based on the above-mentioned contour features, combined with the colorimetric reaction intensity levels mentioned above, a dual basis for comprehensive evaluation of each suspected residual area is formed.
[0077] This invention performs dynamic subset division based on spatial proximity and contour features, and combines the results of component analysis for consistency verification and iterative adjustment, thus constructing a closed loop of spatial clustering and component verification. This ensures that the subsets used for final category determination have a high degree of consistency in spatial distribution and material composition, achieving a systematic distinction and classification of diffusion-type and attachment-type residues, and improving the accuracy of category determination.
[0078] In a preferred embodiment of the present invention, the specific process of screening and integrating the set of regions to be analyzed based on residue matching is as follows:
[0079] Screening is conducted based on the intensity level of the colorimetric reaction and the contour characteristics of each suspected residual area.
[0080] When the colorimetric intensity level of a region is determined to be strong, or its outline features are determined to be blurry, the region is integrated into the set of regions to be analyzed.
[0081] It should be noted that the above screening logic is based on a dual criterion design for the characteristics of the target residue. In order to balance the sensitivity and coverage of the detection, the technical considerations are as follows:
[0082] First, when the intensity of the colorimetric reaction in a certain area is determined to be strong, it indicates that the area has produced a significant and stable colorimetric reaction to the chemical colorimetric reagent. This directly provides chemical evidence that the area contains the target residue or its analogue, which is the core basis for determining it as an area requiring special attention.
[0083] Secondly, some residues, such as liquid flux, may appear as blurred outlines with diffused edges in X-ray images due to their physical state or miscibility with the substrate. Their chemical colorimetric reaction intensity may not reach a strong level due to uneven concentration distribution. If screening is based solely on colorimetric intensity, such residues are easily missed.
[0084] Therefore, using fuzzy profile features as an independent inclusion condition can effectively capture potential residues with suspicious morphological features but whose chemical colorimetric signals do not reach a strong level, thereby improving the detection method's coverage of diverse residue types and its overall sensitivity.
[0085] In summary, this invention employs a dual-path screening strategy that utilizes either strong colorimetric reactions or ambiguous contour features. This strategy identifies typical target substances through strong chemical signals and also identifies potentially risky areas with atypical chemical signals through characteristic morphological signals. This design ensures that the final integrated set of regions to be analyzed can more comprehensively and reliably cover all potential residual areas in the circuit board cavity that require further attention and analysis.
[0086] Conversely, if the colorimetric intensity level of the region is determined to be weak and its contour features are determined to be sharp, then the region will not be integrated into the set of regions to be analyzed.
[0087] It should be noted that setting the exclusionary dual conditions of weak colorimetric reaction intensity and sharp contour features is a key step in the complementary screening strategy to improve the specificity of the results. The technical basis for this setting is that a weak colorimetric reaction indicates that the region lacks the significant chemical response characteristics that the target residue should have, while a sharp contour usually points to a solid, dense physical structure that is distinct from the substrate and has not diffused. Due to their physicochemical properties, such structures usually do not react strongly with the target colorimetric agent. Excluding regions that meet both conditions can significantly filter out interference caused by non-target high-density inclusions.
[0088] S3. Based on the spatial characteristics of residue diffusion, the set of regions to be analyzed is divided into at least one subset, wherein different subsets are allowed to contain the same regions to be analyzed.
[0089] The specific basis for the division is as follows: taking each region to be analyzed as the center, based on the spatial distribution relationship, other regions to be analyzed that satisfy the geometric proximity condition with the central region are assigned to the same initial subset corresponding to the central region.
[0090] The logic of dividing the same initial subset by geometric proximity conditions is consistent with the above logic of constructing a set of neighboring regions by geometric proximity conditions.
[0091] For any initial subset, if it contains both regions whose contour features are determined to be sharp and regions whose contour features are determined to be blurry, then the initial subset is split into two new subsets. One subset contains all regions whose contour features are sharp and is labeled as the first type subset, and the other subset contains all regions whose contour features are blurry and is labeled as the second type subset.
[0092] It should be noted that the above splitting operation is based on the following technical considerations: the sharpness or blurriness of the contour features is directly related to the different physical states of the residues and their diffusion or distribution patterns in space. Mixing regions with different contour features in the same subset of analysis will blur their inherent spatial correlation and interfere with the effective tracing and assessment of diffusion sources, pathways, or unified pollution events.
[0093] After classifying based on the consistency of contour features, the most suitable mathematical methods for each type of feature can be applied to conduct independent diffusion space characteristic analysis, thereby obtaining more accurate and physically meaningful conclusions.
[0094] After completing the subset division, in order to verify the rationality of the division results at the material composition level and to ensure that the regions within the same subset have homologous residue characteristics, it is necessary to further analyze the chemical properties of the regions to be analyzed contained in each subset.
[0095] It should be noted that, since different subsets are allowed to contain the same region to be analyzed during the partitioning process, when the final category is output, if a region to be analyzed is assigned to multiple subsets and these subsets are determined to have different specific residue categories, it will be preferentially assigned to the subset that is consistent with its contour feature label and has the closest spatial centroid distance. That is, for regions with sharp contour features, it will be assigned to the first subset with the closest geometric centroid distance, and for regions with blurred contour features, it will be assigned to the second subset with the closest geometric centroid distance.
[0096] S4. By using energy dispersive spectroscopy and spectral detection, the elemental composition and spectral distribution of each region to be analyzed are obtained to analyze the candidate residue categories involved in each region to be analyzed. Based on the consistency of candidate residue categories within the same subset, the accuracy of the subset division is judged, and the subset division is dynamically adjusted until the consistency requirements are met.
[0097] S5. Based on the subset partitioning results, output the specific residue category for each subset.
[0098] Reference Figure 3 As shown, the specific process of analyzing the candidate residue categories involved in each region to be analyzed is as follows:
[0099] The elemental composition data of each region to be analyzed is obtained by energy dispersive spectroscopy, and the functional group characteristic data is obtained by spectral detection.
[0100] As a preferred embodiment of the present invention, the energy spectrum analysis employs X-ray photoelectron spectroscopy (XPS). A monochromatic X-ray beam is focused onto the region to be analyzed for irradiation. A high-sensitivity electron spectrometer is used to measure and record the distribution of photoelectron kinetic energy excited from the sample surface to obtain the XPS spectrum. Subsequently, the XPS spectrum is deconvolved, background subtracted, and peak position fitted. Based on the characteristic combination energy, the corresponding element type and chemical state are identified, and the relative atomic percentage content of each element is calculated based on the characteristic peak intensity. Thus, elemental composition data containing information on element type, chemical state, and relative content are obtained.
[0101] In a preferred embodiment of the present invention, the spectral detection employs Fourier transform infrared spectroscopy, focusing an infrared beam onto the region to be measured, measuring and recording the interference pattern signal after infrared light transmission or reflection, and obtaining the characteristic absorption spectrum of the region in the infrared band after Fourier transform. Subsequently, the absorption spectrum is preprocessed, including but not limited to baseline correction and smoothing and noise reduction, and compared with a standard substance infrared spectral database. By analyzing the wavenumber position, peak shape, and relative intensity of the characteristic absorption peaks, the specific chemical bonds and functional group types present in the region are identified, thereby obtaining the functional group characteristic data.
[0102] The elemental composition data and the functional group characteristic data are compared with a pre-stored residue characteristic database.
[0103] Based on the comparison results, a list of candidate categories containing at least one possible type of residue is generated for the area to be analyzed.
[0104] It should be noted that the pre-stored residue characteristic database stores standardized characteristic data entries for several known residues; each entry includes at least:
[0105] Residue identification information is used to uniquely identify the type of residue.
[0106] Elemental composition characteristics data, including the types of elements contained in the residue, the characteristic chemical states of each element, and the typical relative atomic percentage range of each element.
[0107] Functional group characteristic data, including the specific chemical bond types present in the residue, the types of functional groups, and the wavenumber range, peak shape description, and relative intensity range of the corresponding characteristic absorption peaks in the infrared characteristic absorption spectrum.
[0108] Expected contour morphology data refers to the spatial contour features presented in X-ray images, such as, but not limited to, geometric shapes like circles and ellipses.
[0109] The standard saturation range refers to the statistical distribution range of color saturation in the corresponding region of the image of a type of residue under standard imaging conditions.
[0110] The pre-stored residue characteristic database is constructed through the following steps: First, typical residue samples known in the relevant process are collected, and they are cleaned, dried, crushed and homogenized to prepare standard samples suitable for energy dispersive spectroscopy and spectroscopic analysis.
[0111] Then, feature data collection was performed: For each standard sample, the following steps were taken:
[0112] The elemental composition data, including element types, chemical states, and relative abundances, were obtained using X-ray photoelectron spectroscopy as described above.
[0113] The functional group characteristic data were obtained by using Fourier transform infrared spectroscopy and the aforementioned method.
[0114] Digital images of standard samples are acquired using X-ray imaging or microscopic imaging techniques. Their contour information is then extracted through image processing, and the expected contour morphology data is generated by quantification. The saturation value of the pixels within the contour area is then calculated.
[0115] Repeated measurements were performed on multiple samples of the same residue type to obtain the range of data fluctuations and ensure the representativeness and stability of the characteristic data.
[0116] Next, the collected raw feature data is normalized, calibrated, and formatted. Discriminating feature parameters are extracted, and the maximum and minimum values of the collected saturation values are statistically analyzed and defined as standard saturation intervals, forming structured feature data entries.
[0117] Finally, the residues are classified according to their source, chemical properties, or process relevance. The identification information, elemental composition characteristics, functional group characteristics, expected profile morphology data, and other auxiliary information corresponding to each residue type are associated and stored to form a residue characteristic database.
[0118] Based on the above comparison, the generated candidate category list is a structured dataset that includes not only the matching residue identifiers such as names or numbers, but also details the conformity between the measured data of the current area and the database entries in terms of element type, chemical state, and characteristic functional groups. Optionally, it also includes the typical physical state of the candidate residue, such as solid or liquid, as supplementary analytical information.
[0119] In a preferred embodiment of the present invention, the consistency determination process for candidate residue categories within the same subset specifically comprises:
[0120] For the first subset, obtain a list of candidate residue categories for all regions to be analyzed within the subset, and search for common candidate residue categories. If they exist, determine that the division of the subset meets the consistency requirement and has the accuracy of division, and output the common candidate residue categories as the specific residue categories for all regions to be analyzed within the subset.
[0121] It should be noted that the determination and output of specific residue categories are processed according to the following rules based on the number of common candidate categories retrieved:
[0122] When only one common candidate residue category exists, that category is directly output as a unified specific residue category for all regions to be analyzed within that subset.
[0123] When multiple common candidate residue categories exist, the most representative category is selected as the final output. This selection process is based on the intensity index of the chemical colorimetric reaction, and the specific steps are as follows:
[0124] The average saturation value is extracted from the colorimetric reaction intensity data obtained in the preceding step S2 for each region to be analyzed.
[0125] For each common candidate category, the standard saturation range corresponding to that candidate category is queried from the pre-stored residue feature database.
[0126] The average saturation value is compared with the standard saturation range corresponding to each of the common candidate residue categories.
[0127] The absolute difference between the average saturation value and the median of each standard saturation interval is calculated. The candidate category with the smallest absolute difference is identified as the category whose average saturation value is closest to its standard interval, and is selected as the specific residue category for that area.
[0128] For the second subset, based on the list of candidate residue categories for all regions to be analyzed within the subset, the mainstream candidate residue category for the subset is determined. Simultaneously, the expected contour shape of the mainstream candidate residue category is queried, and an overall similarity analysis is performed between it and the contour shape of the smallest bounding polygon of the subset. If the overall similarity exceeds a preset similarity threshold, the division of the subset is determined to meet the consistency requirement and has the accuracy of division. The mainstream candidate residue category is then output as the specific residue category for all regions to be analyzed within the subset.
[0129] It should be noted that the above determination process is implemented through the following steps: statistically analyze the frequency of each category in the candidate residue category list of all regions to be analyzed within the second subset, and determine the category with the highest frequency as the mainstream candidate residue category.
[0130] The preset similarity threshold can be adaptively adjusted according to the specific application scenario and the required degree of discrimination. For example, for a specific liquid flux residue that usually presents an approximately circular diffusion feature in X-ray images, its expected outline shape is defined as nearly circular. In practical applications, if it is necessary to improve the detection sensitivity, the preset similarity threshold can be set to 0.8; if it is necessary to improve the detection specificity, the preset similarity threshold can be set to 0.9.
[0131] This invention quantifies the intensity of color reaction and the sharpness of image contours, and integrates the regions to be analyzed based on a dual-condition screening rule that prioritizes strong color or blurred contours. This effectively filters out non-target interference structures, thereby optimizing the quality of the set of regions to be analyzed.
[0132] In a preferred embodiment of the present invention, the specific process of dynamically adjusting the subset partitioning until the consistency requirement is met is as follows:
[0133] For the first subset that does not meet the consistency requirement, split it into two or more new subsets, such that the intersection of the candidate residue category lists of all regions in each new subset is not empty;
[0134] It should be noted that the basis and technical purpose of the first type of subset splitting operation mentioned above is to reconstruct the original subset based on the potential commonalities in the material properties of each region, so that its internal components tend to be consistent in category. The specific process is as follows: traverse the candidate residue category list of all regions to be analyzed within the first type of subset, identify and extract the common candidate categories existing in multiple region lists, use the identified common candidate categories as the core clustering basis, and classify all regions to be analyzed containing the common candidate categories into the same new subset.
[0135] For the second type of subset that does not meet the consistency requirement, the direction of the difference between the minimum bounding polygon outline shape and the expected outline shape of the subset is used as the adjustment direction of the subset, and the second type of subset is split in this way.
[0136] The new subsets formed after the adjustment are re-evaluated for consistency, and the process is repeated iteratively until all subsets are determined to meet the consistency requirements or only isolated regions remain to be analyzed.
[0137] It should be noted that the above dynamic adjustment process is implemented through the following steps:
[0138] A contour comparison algorithm is used to overlay and analyze the minimum bounding polygon with the expected contour to identify areas where there is a significant spatial deviation between the two.
[0139] Guided by the morphological difference regions identified above, the atomic set is spatially segmented. For example, if a major over-diffusion direction is identified, the region in the diffusion core area and the region in the over-diffusion extension area within the atomic set are split into two new subsets along the vertical direction of the diffusion front or the natural boundary. During the split, it is ensured that the new subsets maintain spatial connectivity.
[0140] For each new subset generated after splitting, the aforementioned candidate category determination and contour similarity analysis consistency judgment process is re-executed. For new subsets that still do not meet the consistency requirements, the next round of difference identification and splitting is performed based on their own new minimum bounding polygon and the corresponding expected contour.
[0141] The adjustment stops when the overall similarity exceeds the preset similarity threshold or when the remaining subsets that failed the judgment cannot be split again.
[0142] It should be noted that "cannot be further split" means that the subset contains only one region to be analyzed. In this case, the category with the highest frequency in the candidate category list of that region is directly determined as its specific residue category.
[0143] It should also be noted that the iterative adjustment process is further equipped with a maximum iteration threshold, which is adaptively adjusted according to the system accuracy requirements. For such subsets that terminate early, the candidate category with the highest frequency of occurrence within them is used as the final determination category.
[0144] This invention integrates X-ray imaging, chemical colorimetric reaction, energy dispersive spectroscopy, and spectral detection in sequence, combining morphological localization, chemical response, and composition determination. This overcomes the limitations of existing single or discrete detection methods. The collaborative analysis of multiple stages and multiple information sources significantly reduces missed detections and misjudgments caused by missing or incomplete information.
[0145] The above description is merely an example and illustration of the structure of the present invention. Those skilled in the art can make various modifications or additions to the specific embodiments described, or use similar methods to replace them, as long as they do not deviate from the structure of the invention or exceed the scope defined by the present invention, they should all fall within the protection scope of the present invention.
Claims
1. A method for detecting and identifying residues in a circuit board cavity, characterized by, The method comprises the following steps: S1, obtaining an X-ray image of a circuit board sample, locating all suspected residual areas based on the image gray difference, and generating a spatial set containing the coordinates of each suspected residual area; S2, applying a chemical color developing reagent to the spatial set, screening and integrating the set of areas to be analyzed according to the color development reaction intensity of each suspected residual area and the contour characteristics of the X-ray image, and according to the matching condition of the residual; S3, dividing the set of areas to be analyzed into at least one subset according to the diffusion space characteristics of the residual, wherein different subsets may contain the same area to be analyzed; S4, obtaining the element composition and spectral distribution of each area to be analyzed through energy spectrum analysis and spectral detection to analyze the candidate residual categories involved in each area to be analyzed, judging the accuracy of the division of each subset based on the consistency of the candidate residual categories in the same subset, and dynamically adjusting the subset division until the consistency requirement is met; S5, based on the subset division result, outputting the specific residual category of each subset.
2. The method of claim 1, wherein the method further comprises: The specific process of locating all suspected residual areas based on image gray difference is as follows: The obtained X-ray image is subjected to noise reduction and gray normalization to obtain a standard gray image; In the standard gray image, the background area without residual in the cavity structure of the circuit board is determined, and the average gray value of the background area is calculated as the background reference value; In the standard gray image, all connected pixel sets with continuous gray values higher than the background reference value are preliminarily identified as initial suspected areas; For each initial suspected area, a structure element is set based on the image resolution and the minimum expected size of the residual, and a morphological opening operation is performed to process, and all areas remaining after processing are determined as the total suspected residual areas, and the coordinates of the top points of the circumscribed rectangles or the geometric centroids of each suspected residual area are calculated, recorded and the spatial set is generated.
3. The method of claim 1, wherein the method further comprises: The color development reaction intensity performance is as follows: After applying the chemical color developing reagent and reaching the preset reaction time, a color image of each suspected residual area is obtained; The color image is converted from RGB color space to HSV color space; For each suspected residual area, the saturation component values of all pixel points in its corresponding image area are extracted, and the average value is calculated as the average saturation of the area; Screening the pixels in the area with saturation component values greater than the average saturation to form a color development connected area, and calculating the pixel area of the color development connected area; Obtain the corresponding pixel area of the area in the X-ray image; Based on the average saturation and the area ratio of the color development connected area, the color development reaction intensity level of the suspected residual area is determined, and the color development reaction intensity level is divided into strong or weak.
4. The method of claim 3, wherein the method further comprises: The color development reaction intensity level is divided by the following process: Calculate the median value of the average saturation of all suspected residual areas, denoted as the reference saturation, and compare the average saturation of any suspected residual area to be judged with the reference saturation; Calculate the median value of the area ratio of the color-developed connected region of all suspected residual regions, denoted as the reference area ratio, and compare the area ratio of any suspected residual region to be determined with the reference area ratio; When the region simultaneously satisfies that its average saturation is greater than or equal to the reference saturation, and its area ratio of the color-developed connected region is greater than or equal to the reference area ratio, determine that the color development reaction intensity level of the region is strong; Otherwise, determine that the color development reaction intensity level of the region is weak.
5. The method of claim 3, wherein the method further comprises: The contour feature of the X-ray image is specifically: For each suspected residual region in the spatial set, extract its corresponding image region in the standard gray image; Calculate the average value of the gray gradient amplitudes of all pixel points in the image region, and obtain the internal average gradient of the region; For the contour edge pixels of the region, calculate the average value of the gray gradient amplitudes of the contour edge pixels, and obtain the edge average gradient of the region; Calculate the difference between the edge average gradient and the internal average gradient to obtain the absolute gradient difference; Calculate the ratio of the absolute gradient difference to the internal average gradient to obtain the contour sharpness feature quantity; In the spatial set, determine all other regions that satisfy the geometric proximity condition with the current region to be determined, to form a set of adjacent regions; Calculate the average value of the contour sharpness feature quantities of all regions in the set of adjacent regions as a local background sharpness reference value; Compare the contour sharpness feature quantity of the region to be determined with the local background sharpness reference value; If the contour sharpness feature quantity is greater than or equal to a preset multiple of the local background sharpness reference value, determine that the contour feature of the region to be determined is sharp; Otherwise, determine that the contour feature of the region to be determined is blurred.
6. The method of claim 5, wherein the method further comprises: The specific process of screening and integrating the set of regions to be analyzed according to the matching state of the residual is: Screening based on the determination results of the color development reaction intensity level and the contour feature of each suspected residual region; When the color development reaction intensity level of the region is determined to be strong, or the contour feature of the region is determined to be blurred, integrate the region into the set of regions to be analyzed; Conversely, if the color development reaction intensity level of the region is determined to be weak, and the contour feature of the region is determined to be sharp, do not integrate the region into the set of regions to be analyzed.
7. The method of claim 5, wherein the method further comprises: The specific process of dividing the set of regions to be analyzed into at least one subset according to the diffusion space characteristics of the residual is: Taking each region to be analyzed as the center, based on the spatial distribution relationship, other regions to be analyzed that satisfy the geometric proximity condition with the center region are classified into the same initial subset corresponding to the center region; For any initial subset, if it simultaneously contains regions whose contour features are determined to be sharp and regions whose contour features are determined to be blurred, the initial subset is split into two new subsets, one of which contains all regions whose contour features are sharp and is marked as a first type of subset, and the other of which contains all regions whose contour features are blurred and is marked as a second type of subset.
8. The method of claim 7, wherein the method further comprises: The specific process of analyzing the candidate residual categories involved in each region to be analyzed is: The element composition data of each region to be analyzed is obtained by energy spectrum analysis, and the functional group characteristic data is obtained by spectrum detection; The element composition data and the functional group characteristic data are compared with a pre-stored residue characteristic database; Based on the comparison result, a candidate category list containing at least one possible residue type is generated for the region to be analyzed.
9. The method of claim 8, wherein the method further comprises: The consistency determination process of the candidate residue categories in the same subset is specifically: For the first type of subset, the candidate residue category list of all regions to be analyzed in the subset is obtained, and it is checked whether there is a common candidate residue category, if there is, it is determined that the division of the subset meets the consistency requirement, has division accuracy, and outputs the common candidate residue category as the specific residue category of all regions to be analyzed in the subset; For the second type of subset, the mainstream candidate residue category of the subset is determined according to the candidate residue category list of all regions to be analyzed in the subset, and the expected contour shape of the mainstream candidate residue category is queried synchronously, and the overall similarity analysis is performed between the expected contour shape and the minimum circumscribed polygon contour shape of the subset, if the overall similarity exceeds the preset similarity threshold, it is determined that the division of the subset meets the consistency requirement, has division accuracy, and outputs the mainstream candidate residue category as the specific residue category of all regions to be analyzed in the subset.
10. The method of claim 9, wherein the method further comprises: The specific process of dynamically adjusting the subset division until the consistency requirement is met is: For the first type of subset that does not meet the consistency requirement, it is divided into two or more new subsets, so that the intersection of the candidate residue category list of all regions in each new subset is non-empty; For the second type of subset that does not meet the consistency requirement, the difference direction between the minimum circumscribed polygon contour shape and the expected contour shape of the subset is used as the adjustment direction of the subset, and the second type of subset is divided in this way; The new subset set formed after adjustment is re-determined for consistency, and the iteration is performed until all subsets are determined to meet the consistency requirement or only isolated regions to be analyzed are left.
Citation Information
Patent Citations
Multi-layer PCB quality detection method and system
CN120507374A
Printed wiring board and evaluating method therefor thereof
JP1993118822A
Evaluation method and evaluation device for wiring board
JP2023177157A
Method and apparatus for substance identification
US20090129544A1
Spectroscopy for gunshot residue analysis
US20160238522A1
Cited By
Chemical detection system for scraped edge residues of printing tape
CN122084769A