X-ray image processing method and device based on deep learning

By using deep learning methods to identify and process haze scattering and stripe artifacts in X-ray inspection of electronic components such as ICs, BGAs, CSPs, and PCBs, high-quality image processing is achieved, the problem of compound artifact interference is solved, and the accuracy and efficiency of inspection are improved.

CN121685488APending Publication Date: 2026-03-17SHENZHEN WISDOMSHOW TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-15
Publication Date
2026-03-17

AI Technical Summary

Technical Problem

Existing technologies struggle to effectively handle the hazy areas formed by metal scattering and the periodic stripe artifacts generated by the coupling of fixture vibration and X-ray pulse frequency in X-ray inspection of electronic components such as ICs, BGAs, CSPs, and PCBs, resulting in reduced defect contrast and poor image processing quality.

Method used

By using deep learning methods, high-probability frequency groups of hazy scattering regions and stripe artifacts are identified. By combining gray-level gradient analysis and frequency comparison, the artifact-covered areas are marked. The deep learning network is then used for regional artifact removal, and a global artifact-removed image is output by combining multi-region weight fusion.

Benefits of technology

It significantly improves the defect contrast and detail clarity of X-ray images, enhances the accuracy of defect detection and the reliability of image analysis, and meets the needs of industrial inspection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121685488A_ABST
    Figure CN121685488A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of X-ray detection, and provides an X-ray image processing method and device based on deep learning, and the method comprises the steps: recognizing a fog scattering region in an X-ray image; performing stripe artifact analysis under coupling combination of different jig vibration frequencies and X-ray pulse frequencies, and identifying a high-probability vibration-pulse frequency group with stripe artifacts; comparing and judging whether the X-ray image has a periodic stripe artifact risk or not; if the X-ray image exists, determining the direction and spacing of the stripe artifacts through gray gradient analysis of the X-ray image, and marking a stripe artifact coverage area; according to the method, a scattering artifact overlapping area is identified through overlapping analysis of a foggy scattering area and a stripe artifact coverage area, regional artifact removal is carried out through a deep learning network, a global artifact-removed image is output in combination with multi-area weight fusion, and the detection precision is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of X-ray detection, and in particular to an X-ray image processing method and device based on deep learning. BACKGROUND

[0002] In the X-ray detection scene of IC, BGA, CSP, PCB and other electronic components, accurately identifying welding defects such as missing welding, false welding and micro-bubbles is the key to ensuring product reliability. Such detection objects often contain high-density metal welding points and complex packaging structures. When X-rays penetrate, they interact with the jig and metal parts of the product, producing Compton scattering. Scattered rays form a fog-like gray defect area in the local area of the image, which is manifested as a local overall gray level rise and a pixel difference narrowing, resulting in a reduced gray contrast between the defect and the background, which severely obscures the characteristics of the micro-defects and affects the subsequent detection accuracy.

[0003] At the same time, the production line detection needs to transmit the product through the jig, and the jig inevitably vibrates during high-speed operation. When the jig vibration frequency and the X-ray pulse frequency meet the coupling condition, the image will appear periodic stripe artifacts, and the regular gray fluctuations of light and dark alternation will further interfere with defect recognition. More importantly, the above two kinds of artifacts often overlap in space - the periodic stripes are easily superimposed with the local fog-like scattering area, forming a composite interference of "fog-like background + periodic stripes".

[0004] Existing image processing techniques are mostly designed to address a single artifact, and do not fully consider the complex scenario of the superposition of the two, resulting in either excessive smoothing that loses defect details or the inability to completely suppress composite artifacts, ultimately resulting in poor image processing quality and difficulty in meeting high-precision detection needs.

[0005] Therefore, the present application provides an X-ray image processing method and device based on deep learning. SUMMARY

[0006] In order to make up for the shortcomings of the prior art and solve at least one technical problem raised in the background art.

[0007] The technical scheme adopted by the present application to solve its technical problems is: an X-ray image processing method based on deep learning, comprising the following steps: Step S10: performing local gray analysis on the X-ray image to identify the fog-like scattering area in the X-ray image; Step S20: performing stripe artifact analysis under different jig vibration frequencies and X-ray pulse frequency coupling combinations to identify the high-probability vibration-pulse frequency group where the stripe artifact appears; Step S30: By comparing the vibration frequency of the fixture and the pulse frequency of the X-ray with the high-probability vibration-pulse frequency group, it is determined whether there is a risk of periodic stripe artifacts in the X-ray image. Step S40: If present, determine the direction and spacing of the stripe artifacts by analyzing the gray-level gradient in the X-ray image, and mark the area covered by the stripe artifacts. Step S50: By analyzing the overlap between the hazy scattering region and the stripe artifact coverage region, identify the overlapping regions of scattering artifacts. Use a deep learning network to remove artifacts from the overlapping regions of scattering artifacts, the hazy scattering region, and the stripe artifact coverage region in different regions. Combine multi-region weight fusion to output a global artifact-free image.

[0008] As a further technical solution of the present invention: the process of identifying hazy scattering regions in X-ray images is as follows: Calculate the global grayscale mean and global grayscale standard deviation of the X-ray image; The X-ray image is divided into several window regions of equal area, and the local gray mean and local gray standard deviation of each window region are calculated. The identification criteria for hazy scattering regions are set based on the global grayscale mean and global grayscale standard of the X-ray image, as well as the local grayscale mean and local grayscale standard deviation of the window region. The identification and judgment criteria include: Recognition criterion 1: Local grayscale mean ≥ global grayscale mean 1.2; Recognition criterion two: Local grayscale standard deviation ≤ global grayscale standard deviation 0.5; If both identification criteria one and two are met simultaneously, the window area will be marked as a fog-like scattering area.

[0009] As a further technical solution of the present invention: the process of identifying the high-probability vibration-pulse frequency group of stripe artifacts is as follows: Detection data from multiple historical X-ray images were acquired, and the X-ray pulse frequency and fixture vibration frequency of each historical X-ray image were integrated into vibration-pulse frequency groups. If the X-ray pulse frequency and the fixture vibration frequency are coupled in the vibration-pulse frequency group, then the vibration-pulse frequency group is marked as the vibration-pulse frequency coupling group. Based on the detection results of whether there are stripe artifacts in the acquired historical X-ray images, the proportion of the occurrence of stripe artifacts in the vibration-pulse frequency coupling group is statistically analyzed to obtain the stripe artifact probability. If the fringe artifact probability reaches the preset fringe artifact probability, then the vibration-pulse frequency coupling group is marked as a high-probability vibration-pulse frequency group.

[0010] As a further technical solution of the present invention: the process of determining whether the X-ray pulse frequency and the fixture vibration frequency in the vibration-pulse frequency group are coupled is as follows: Coupling criterion 1: X-ray pulse frequency = n The vibration frequency of the fixture; Coupling criterion two: |X-ray pulse frequency - fixture vibration frequency| ≤ fixture vibration frequency 10%; If the vibration-pulse frequency group satisfies any coupling criterion, it indicates that the X-ray pulse frequency and the fixture vibration frequency are coupled in the vibration-pulse frequency group.

[0011] As a further technical solution of the present invention: the process for determining whether there is a risk of periodic stripe artifacts in an X-ray image is as follows: The vibration frequency of the fixture and the pulse frequency of the X-ray are integrated into an actual vibration-pulse frequency group. Calculate the Euclidean distance between the actual vibration-pulse frequency group and the high-probability vibration-pulse frequency group to obtain the stripe artifact risk value; If the risk value of the stripe artifact is less than or equal to the risk threshold of the stripe artifact, it means that the high probability vibration-pulse frequency group is similar to the actual vibration-pulse frequency group. If one or more high-probability vibration-pulse frequency groups are similar to the actual vibration-pulse frequency groups, then the X-ray image is judged to have a risk of periodic stripe artifacts.

[0012] As a further technical solution of the present invention: the process of marking the area covered by the stripe artifact is as follows: Calculate the gradients in the x and y directions of the X-ray image, statistically analyze the direction histogram of the absolute values ​​of the gradients, and take the angle corresponding to the peak value of the histogram as the direction of the stripe artifact; Obtain the frequency domain amplitude spectrum of the X-ray image, extract the amplitude projection along the direction perpendicular to the stripes, find the peak horizontal coordinate in the projection, and calculate the stripe artifact spacing. Mark the area covered by the stripe artifacts in the X-ray image based on the direction and spacing of the stripe artifacts.

[0013] As a further technical solution of the present invention: the process of identifying overlapping regions of scattering artifacts is as follows: Obtain the mask_scatter of the hazy scattering region and the mask_stripe of the stripe artifact coverage region, and identify the overlapping regions of the scattering artifacts. : .

[0014] As a further technical solution of the present invention: the process of region-specific artifact removal using a deep learning network is as follows: The X-ray image is segmented into pixel blocks, and for each pixel block, the region to which it belongs is determined based on its coordinates; For each pixel block, the input is fed into the trained U-Net network to obtain the artifact removal output block. After traversing all pixel blocks, artifact removal images of the overlapping scattering artifact region, the hazy scattering region, and the stripe artifact covered region are generated respectively.

[0015] As a further technical solution of the present invention: the process of combining multi-region weighted fusion to output a global artifact-free image is as follows: Based on the severity of artifacts, fusion weights are assigned to overlapping regions of scattering artifacts, hazy scattering regions, and regions covered by stripe artifacts. After fusion, smoothing is performed to obtain the final weight map. The Laplacian pyramid fusion algorithm is used to decompose the artifact-free image of the X-ray image and the overlapping areas of scattering artifacts, the hazy scattering area, and the stripe artifact-covered area into pyramids of different resolutions. At each pyramid level, the images are fused according to the corresponding weight map. Finally, the fused pyramid levels are merged again to output the global artifact-free image.

[0016] A deep learning-based X-ray image processing device includes the following modules: Fog scattering identification module: Performs local grayscale analysis on X-ray images to identify fog scattering regions in the X-ray images; Vibration-pulse frequency analysis module: Analysis of stripe artifacts under the coupling combination of vibration frequencies of different fixtures and X-ray pulse frequencies, and identification of vibration-pulse frequency groups with high probability of stripe artifacts. The stripe artifact risk assessment module determines whether there is a risk of periodic stripe artifacts in the X-ray image by comparing the vibration frequency of the fixture and the pulse frequency of the X-ray with a high-probability vibration-pulse frequency group. Stripe artifact recognition module: If present, determine the direction and spacing of stripe artifacts through gray-level gradient analysis in the X-ray image, and mark the area covered by stripe artifacts; Global artifact removal module: By analyzing the overlap between the hazy scattering region and the stripe artifact coverage region, the overlapping regions of scattering artifacts are identified. A deep learning network is used to remove artifacts in different regions, including the overlapping regions, the hazy scattering region, and the stripe artifact coverage region. Finally, the global artifact-removed image is output by combining multi-region weighted fusion.

[0017] The beneficial effects of this invention are as follows: By locating the hazy scattering area and then using historical data analysis to pinpoint the high-probability frequency group of stripe artifacts, and combining real-time frequency comparison to complete risk prediction, the gray-scale gradient analysis is used to mark the area covered by stripe artifacts. Finally, through region overlap localization and deep learning to remove artifacts by region and weighted fusion, a high-quality image is output. This effectively solves the problem of individual and superimposed interference from metal scattering hazy areas and periodic stripe artifacts, significantly improving the image defect contrast and detail clarity. Furthermore, the risk prediction optimizes the processing flow, and the region-based processing ensures targeting and efficiency, providing high-quality image support for defect assessment in industrial X-ray inspection, and greatly improving the reliability and practicality of X-ray image analysis. Attached Figure Description

[0018] The invention will now be further described with reference to the accompanying drawings.

[0019] Figure 1 This is a flowchart of the steps of the X-ray image processing method based on deep learning described in the embodiments of the present invention; Figure 2 This is a logic judgment diagram of the X-ray image processing method based on deep learning described in the embodiments of the present invention; Figure 3 This is a system block diagram of the X-ray image processing device based on deep learning according to an embodiment of the present invention; Figure 4 This is an overall structural diagram of the components of an X-ray detection device according to an embodiment of the present invention; Figure 5 This is a structural diagram of the X-ray source assembly of an X-ray detection device according to an embodiment of the present invention; Figure 6 This is a structural diagram of a flat panel detector assembly of an X-ray detection device according to an embodiment of the present invention; Figure 7 This is a structural diagram of the upper multiplier chain component of an X-ray detection device according to an embodiment of the present invention; Figure 8 This is a structural diagram of the bottom reflux multiplier chain assembly of an X-ray detection device according to an embodiment of the present invention. Detailed Implementation

[0020] To make the technical means, creative features, objectives and effects of this invention easier to understand, the invention will be further described below in conjunction with specific embodiments.

[0021] Example 1: Please refer to Figures 1-2As shown in the embodiments of the present invention, the X-ray image processing method based on deep learning is mainly aimed at the dynamic inspection scenario of X-ray production lines for electronic components such as ICs, BGAs, CSPs, and PCBs. It focuses on two core problems: first, the formation of localized hazy areas by metal scattering; and second, the coupling of fixture vibration and X-ray pulse frequency to generate periodic stripe artifacts. These two issues easily overlap, leading to reduced defect contrast and poor image processing quality. The present invention mainly uses a process of "identifying hazy areas → analyzing high-probability stripe frequency groups → judging stripe risk → extracting stripe parameters → regional deep learning artifact removal + weighted fusion" to accurately process composite artifacts, ultimately improving X-ray image quality and defect detection accuracy, adapting to the real-time inspection needs of production lines. Specifically, it includes the following steps: Step S10: Perform local grayscale analysis on the X-ray image to identify hazy scattering regions in the X-ray image; In step S10, the process of identifying the hazy scattering region in the X-ray image is as follows: A1, calculate the global gray mean and global gray standard deviation of the X-ray image; A2, divide the X-ray image into several window regions of equal area (e.g., 5...). 5) Traverse the entire X-ray image and calculate the local gray mean and local gray standard deviation for each window region; It should be noted that the window area is divided based on: 5 5. The window area matches typical solder joint sizes (e.g., BGA solder joint diameter 0.3-0.5mm, corresponding to 30-50 pixels). 5. The window area can capture local scattering features. A3. Based on the global grayscale mean and global grayscale standard of the X-ray image, as well as the local grayscale mean and local grayscale standard deviation of the window region, the identification and judgment conditions for the hazy scattering region are set, specifically including: Recognition criterion 1: Local grayscale mean ≥ global grayscale mean 1.2; Recognition criterion two: Local grayscale standard deviation ≤ global grayscale standard deviation 0.5; It should be noted that the judgment criteria are set based on the following: metal scattering increases the number of X-ray photons, raising the local grayscale by more than 20% (the measured average value in the BGA solder joint area is 20%-40% higher than the global average, while the non-metallic area (such as the FR-4 substrate) is only 5%-10% higher). Hazy scattering smooths out pixel differences and significantly reduces the standard deviation (the measured standard deviation in the scattering area is 40%-60% lower than that in the non-scattering area, and the standard deviation in the non-scattering area is even higher due to the presence of defects). The window region that simultaneously meets both identification criteria one and identification criteria two is marked as a fog-like scattering region; Understandably, the significance of step S10 lies in its ability to accurately identify hazy scattering regions by analyzing local and global grayscale features and based on clearly defined criteria. Its core function is to specifically locate localized hazy regions caused by metal scattering. The criteria are set based on measured data to ensure accurate identification. This step provides a precise basis for subsequent region-based artifact removal, preventing hazy scattering from masking defect features, laying the foundation for improving image defect contrast, and meeting the need for precise localization of scattering artifacts in X-ray inspection of electronic components.

[0022] Step S20: Using detection data from multiple historical X-ray images, perform stripe artifact analysis under different combinations of fixture vibration frequencies and X-ray pulse frequencies to identify high-probability vibration-pulse frequency groups where stripe artifacts occur. In step S20, the detection data of the historical X-ray images includes the fixture vibration frequency, X-ray pulse frequency, and detection results of whether there are streak artifacts in the historical X-ray images during acquisition. In step S20, the process of performing stripe artifact analysis under the coupled combination of different fixture vibration frequencies and X-ray pulse frequencies is as follows: The X-ray pulse frequency and fixture vibration frequency of each historical X-ray image are integrated into vibration-pulse frequency groups. Based on whether the X-ray pulse frequency and the fixture vibration frequency are coupled in the vibration-pulse frequency group, the vibration-pulse frequency group is divided into a coupled vibration-pulse frequency group and a non-coupled vibration frequency group, specifically: If the X-ray pulse frequency and the fixture vibration frequency are coupled in the vibration-pulse frequency group, then the vibration-pulse frequency group is marked as the vibration-pulse frequency coupling group. If the X-ray pulse frequency and the fixture vibration frequency are not coupled in the vibration-pulse frequency group, then the vibration-pulse frequency group is marked as the vibration-pulse frequency uncoupled group. The criterion for determining whether the X-ray pulse frequency and the fixture vibration frequency are coupled in the vibration-pulse frequency group is as follows: Coupling criterion 1: X-ray pulse frequency = n The vibration frequency of the fixture (when n=1-5, the stripe amplitude is extremely small and can be ignored when n≥6); Coupling criterion two: |X-ray pulse frequency - fixture vibration frequency| ≤ fixture vibration frequency 10% (frequencies are close); If the vibration-pulse frequency group satisfies any coupling criterion, it indicates that the X-ray pulse frequency and the fixture vibration frequency are coupled in the vibration-pulse frequency group. It should be noted that the coupling judgment conditions are set based on the following: Coupling judgment condition one is based on the harmonic resonance theory of mechanical vibration and the energy superposition effect in X-ray imaging. When the X-ray pulse frequency is exactly an integer multiple of the jig vibration frequency, the system will form harmonic resonance coupling. The 10% frequency deviation threshold in coupling judgment condition two combines the experimental laws of mechanical vibration energy transfer characteristics and moiré effect. When the frequency deviation is reduced to within 10%, the stripe amplitude reaches its maximum value and the artifact continuity is significantly enhanced. Therefore, it can effectively capture high-risk coupling states. In step S20, the process of identifying the high-probability vibration-pulse frequency group in which fringe artifacts appear is as follows: Based on any vibration-pulse frequency coupling group, acquire the historical X-ray image corresponding to the vibration-pulse frequency coupling group. Based on the detection results of whether there are stripe artifacts in the historical X-ray images, calculate the proportion of the number of times stripe artifacts appear in the vibration-pulse frequency coupling group to obtain the stripe artifact probability. In some embodiments, the stripe artifact probability is compared with a preset stripe artifact probability: If the fringe artifact probability reaches the preset fringe artifact probability, then the vibration-pulse frequency coupling group is marked as a high-probability vibration-pulse frequency group. If the fringe artifact probability does not reach the preset fringe artifact probability, then the vibration-pulse frequency coupling group is marked as a low probability vibration-pulse frequency group. It should be noted that the preset stripe artifact probability can be 80%. When the occurrence rate of stripes of a certain frequency combination is ≥80%, the probability of it reappearing in the current detection is ≥75% (statistical confidence level 95%), which has clear risk prediction value; if it is less than 80%, it is highly random and has no practical predictive significance. Understandably, the significance of step S20 lies in the following: Based on historical inspection data, step S20 analyzes the coupling combination of fixture vibration and X-ray pulse frequency to identify high-probability frequency groups of stripe artifacts. By clearly defining coupling criteria to divide frequency groups and using a preset probability threshold with a statistical confidence level of 95% to screen high-risk combinations, its core function is to predict the probability of periodic stripe artifacts occurring in advance. This step utilizes accumulated historical data to achieve proactive risk assessment, avoiding subsequent blind processing and providing a reliable basis for the real-time risk assessment in step S30. It adapts to the need for predicting stripe artifacts in dynamic production line inspections, reduces ineffective processing steps, and improves overall inspection efficiency.

[0023] Step S30: By comparing the vibration frequency of the fixture and the pulse frequency of the X-ray with the high-probability vibration-pulse frequency group, it is determined whether there is a risk of periodic stripe artifacts in the X-ray image. In step S30, the process of determining whether there is a risk of periodic stripe artifacts in the X-ray image is as follows: The vibration frequency of the fixture and the pulse frequency of the X-ray are integrated into an actual vibration-pulse frequency group. Calculate the Euclidean distance between the actual vibration-pulse frequency group and each high-probability vibration-pulse frequency group to obtain the stripe artifact risk value; In some embodiments, the fringe artifact risk value is compared with the fringe artifact risk threshold to identify high-probability vibration-pulse frequency groups that are similar to the actual vibration-pulse frequency groups, specifically: If the risk value of the stripe artifact is less than or equal to the risk threshold of the stripe artifact, it means that the high probability vibration-pulse frequency group is similar to the actual vibration-pulse frequency group. If the risk value of the stripe artifact is greater than the risk threshold of the stripe artifact, it means that the high probability vibration-pulse frequency group is not similar to the actual vibration-pulse frequency group. It should be noted that the risk threshold for stripe artifacts can be 0.5Hz, and the actual fluctuation range of vibration frequency and pulse frequency is ≤0.3Hz (measured on the production line). An error of 0.5Hz can cover normal fluctuations and avoid missed detection. If there is one or more high-probability vibration-pulse frequency groups that are similar to the actual vibration-pulse frequency groups, then the X-ray image is judged to have a risk of periodic stripe artifacts. If no high-probability vibration-pulse frequency group is similar to the actual vibration-pulse frequency group, then the X-ray image is judged to have no risk of periodic stripe artifacts. It should be noted that if there is a risk of periodic stripe artifacts, proceed directly to step S50 to remove artifacts from the hazy scattering area. Understandably, the significance of step S30 lies in its calculation of the Euclidean distance between the actual frequency group and the high-probability frequency group, combined with a reasonable risk threshold, to determine the risk of fringe artifacts. Its core function is based on the high-probability frequency group from step S20, enabling real-time determination of the fringe artifact risk in the current detection image. The 0.5Hz threshold covers the frequency fluctuation range measured on the production line, avoiding missed or false detections. This step clarifies whether the current image requires fringe artifact processing, diverting images without fringe artifact risk directly to the fog area artifact removal stage, optimizing the processing flow, ensuring the efficiency of real-time detection on the production line, and providing a trigger for fringe parameter extraction in step S40, ensuring targeted processing.

[0024] Step S40: If present, determine the direction and spacing of the stripe artifacts by analyzing the gray-level gradient in the X-ray image, and mark the area covered by the stripe artifacts. In step S40, the process of marking the area covered by the stripe artifact is as follows: Calculate the gray-level gradients in the x-axis and y-axis of the X-ray image, and statistically analyze the direction histogram of the absolute values ​​of the gray-level gradients (0°-175°, with each bin in 5° increments). Take the angle corresponding to the peak value of the histogram as the direction of the stripe artifact. Obtain the frequency domain amplitude spectrum of the X-ray image, extract the 1D amplitude projection along the vertical direction of the stripes (e.g., horizontal stripes → vertical direction), find the peak horizontal coordinate upeak (unit: pixels) in the projection, and calculate the stripe artifact spacing d. ; For example, for a 2048-pixel image with a pixel size of 0.01mm and upeak=20, the stripe artifact spacing d=1.024mm; Mark the area covered by the stripe artifacts in the X-ray image according to the direction and spacing of the stripe artifacts; Understandably, the significance of step S40 lies in the following: Step S40 obtains the direction, spacing, and coverage area of ​​the stripe artifacts. Gradient analysis accurately extracts the core parameters of the stripes, and its core function is to provide precise parameter support and region localization for stripe artifact removal. This solves the problem of periodic stripes caused by the coupling of fixture vibration and X-ray pulse frequency, clarifies the specific characteristics and distribution range of the stripe artifacts, and provides precise target information for the region-specific deep learning artifact removal in step S50, ensuring the accuracy of stripe artifact removal.

[0025] Step S50: By analyzing the overlap between the hazy scattering region and the stripe artifact coverage region, identify the overlapping regions of scattering artifacts. Use a deep learning network to remove artifacts from the overlapping regions of scattering artifacts, the hazy scattering region, and the stripe artifact coverage region in different regions. Combine multi-region weight fusion to output a global artifact-free image. In step S50, the process of identifying the overlapping region of scattering artifacts through the overlap analysis of the hazy scattering region and the stripe artifact coverage region is as follows: Obtain the mask for the fog-like scattering region (Obtained from step S10, it is a binary image (1 represents a hazy scattering region, 0 represents a non-scattering region) and a mask for the stripe artifact coverage area.) (Obtained from step S40, it is a binary image (1 represents the area covered by stripe artifacts, 0 represents the area without stripes), and the overlapping areas of scattering artifacts are identified.) : ; In step S50, the process of removing artifacts by region is as follows: Pixel block segmentation of X-ray images (64) 64, with a step size of 32 pixels), for each pixel block, determine the region it belongs to based on the coordinates (overlapping scattering artifact region, hazy scattering region, and stripe artifact covered region). For each pixel block, the input is fed into the trained U-Net network to obtain the artifact removal output block. After traversing all pixel blocks, artifact removal images of the overlapping scattering artifact region, the hazy scattering region, and the stripe artifact covered region are generated respectively. For example, the U-Net network architecture is as follows: Input size: 64×64 pixel block (grayscale image, 1 channel).

[0026] Encoder: 4 downsampling layers, each using 3×3 convolution + ReLU + 2×2 max pooling, with feature channels of 64, 128, 256 and 512 respectively.

[0027] Decoder: 4 upsampling layers, each using 2×2 transposed convolution + 3×3 convolution + ReLU, with feature channels of 256, 128, 64 and 32 respectively.

[0028] Output layer: 1×1 convolution, outputting 64×64 pixel blocks (1 channel). It should be noted that the U-Net network is trained using a large number of X-ray images with artifacts and corresponding clean images, including X-ray images of different electronic components (ICs, BGAs, etc.) and covering a variety of artifact combinations. In step S50, the process of combining multi-region weighted fusion to output a global artifact-free image is as follows: Based on the severity of artifacts, fusion weights are assigned to overlapping regions of scattering artifacts, hazy scattering regions, and regions covered by stripe artifacts. After fusion, smoothing is performed to obtain the final weight map W. The Laplacian pyramid fusion algorithm is used to decompose the artifact-free images of the X-ray image and the overlapping areas of scattering artifacts, the hazy scattering area and the stripe artifact coverage area into pyramids of different resolutions. At each pyramid layer, the images are fused according to the corresponding weight map. Finally, the fused pyramid layers are merged again to output the global artifact-free image. For example, the process of outputting a globally artifact-free image can be: Assign fusion weights: Regions where scattering artifacts overlap: weight value 0.7; Foggy scattering region: weight value 0.5; Stripe artifact coverage area: weight value 0.5; Fusion representation: 0.7 The overlapping region of scattering artifacts is +0.5. The hazy scattering area is +0.5 The stripe artifact-covered areas are fused and then subjected to Gaussian filtering (σ=2 pixels) to eliminate hard boundaries, resulting in the final weight map; It should be noted that the allocation of fusion weights is based on the following criteria: Overlapping scattering artifact regions: weight value 0.7. Since the original image quality is worst in this region, its reliability is lowest. Therefore, during fusion, the restoration results of the deep learning network must be relied upon to the greatest extent, and it is given the highest weight (0.7) to strongly suppress composite artifacts and restore potential defect features. Foggy scattering regions: weight value 0.5. The network is needed to improve contrast, while it is desirable to preserve the underlying structure of the original image that has not been completely destroyed by scattering. Therefore, a moderate weight (0.5) is given, meaning that the underlying structure of the original image and the network's descattering ability are equally relied upon to achieve smooth enhancement. Stripe artifact coverage regions: weight value 0.5. Since stripes are the main source of interference, while the image background information is relatively intact, the destriping effect of the network needs to be significantly relied upon. A moderate weight (0.5) is given, indicating that in this region, the network's denoising output and the original image background are equally important, and the final fusion can effectively remove stripes while preserving details. Constructing Gaussian pyramids: For the X-ray image (I_original) and the three artifact-removed images, construct Gaussian pyramids with a layer count L=5 (adjusted according to image size). Gaussian Pyramid G Obtained through downsampling: ; in, For downsampling; Constructing the Laplacian Pyramid: For each image, the Laplacian Pyramid... Layer L The calculation is as follows: ; in, For upsampling; Constructing a weight pyramid: Construct a Gaussian pyramid (with the same number of layers L) for the weight graph W, obtaining the weight graph W at each layer. ; Merging the Pyramid of Laplace: For each level , Integrating the Laplace coefficient: + + ; in, , , , These are the overlapping regions of scattering artifacts, the hazy scattering region, the region covered by striated artifacts, and the Laplacian pyramid of the X-ray image. layer; The Gaussian pyramid constructed for the weighted graph layer; Starting from the top layer L, the upsampled fused Laplace coefficients are superimposed: ; final, This is the image with global artifact removal; The significance of step S50 is understandable: Step S50 identifies overlapping artifact regions through masking operations, uses the U-Net network to remove artifacts in different regions, and combines this with Laplacian pyramid weight fusion to output a global image. The U-Net network is trained on images with various artifact combinations to adapt to different electronic component inspection scenarios. The weight allocation is set based on the severity of artifacts, and Laplacian pyramid fusion ensures smooth regional transitions. Its core function is to accurately handle composite artifacts of hazy scattering and stripe superposition. Region-based processing ensures targeted removal of different types of artifacts, and weight fusion balances artifact removal effectiveness with image detail preservation, ultimately significantly improving X-ray image quality and defect detection accuracy, fully meeting the dual requirements of processing efficiency and accuracy for real-time inspection of electronic component production lines.

[0029] Example 2, please refer to Figure 3 As shown, based on Embodiment 1, the X-ray image processing device based on deep learning described in this embodiment of the invention includes the following modules: Fog scattering identification module: Performs local grayscale analysis on X-ray images to identify fog scattering regions in the X-ray images; Vibration-pulse frequency analysis module: Analysis of stripe artifacts under the coupling combination of vibration frequencies of different fixtures and X-ray pulse frequencies, and identification of vibration-pulse frequency groups with high probability of stripe artifacts. The stripe artifact risk assessment module determines whether there is a risk of periodic stripe artifacts in the X-ray image by comparing the vibration frequency of the fixture and the pulse frequency of the X-ray with a high-probability vibration-pulse frequency group. Stripe artifact recognition module: If present, determine the direction and spacing of stripe artifacts through gray-level gradient analysis in the X-ray image, and mark the area covered by stripe artifacts; Global artifact removal module: By analyzing the overlap between the hazy scattering region and the stripe artifact coverage region, the overlapping regions of scattering artifacts are identified. A deep learning network is used to remove artifacts in different regions, including the overlapping regions, the hazy scattering region, and the stripe artifact coverage region. Finally, the global artifact-removed image is output by combining multi-region weighted fusion.

[0030] Example 3, please refer to Figures 4-8 As shown, this embodiment of the invention also provides an X-ray detection device, including the following components: X-ray source assembly: Composed of an X-ray source, an X-axis synchronous pulley mechanism, a Y-axis lead screw mechanism, and a Z-axis lead screw mechanism. Through the X, Y, and Z-axis transmission mechanisms, the X-ray source achieves precise movement in three-dimensional space, enabling X-ray inspection of different locations on the product to identify welding defects such as incomplete solder joints, cold solder joints, and bubbles. See details... Figure 5 As shown; Flat panel detector assembly: This includes a flat panel detector, and linked X-axis synchronous belt pulley mechanism, Y-axis lead screw mechanism, and Z-axis lead screw mechanism. Working in conjunction with the X-ray source, it receives X-rays that penetrate the product and converts them into electrical signals, thereby forming an inspection image of the product's internal structure. This provides a basis for defect identification. See details... Figure 6 As shown; The upper multiplier chain assembly consists of a multiplier chain track, a multiplier chain, a blocking and buffer cylinder, a blocking and stopping cylinder, a deceleration sensor, a stop sensor, a multiplier chain drive motor, and a hydraulic damper. It serves as the "conveyor channel" for the product fixture, responsible for feeding the fixture to be tested into the equipment's testing area. Precise deceleration, buffering, and positioning of the fixture are achieved through sensors (deceleration and stopping) and cylinders (blocking and buffering, blocking and stopping). See details... Figure 7 As shown; Bottom Return Multi-Chain Assembly: Primarily consisting of the bottom multi-chain track and transmission structure, it handles the return function of the product fixture. When the product fixture returns via the downstream elevator, it is circulated and transported back to the feed end of the upper multi-chain, forming a cyclical process for production and inspection. See details... Figure 8 As shown.

[0031] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely illustrative of the principles of the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the present invention as claimed. The scope of protection of the present invention is defined by the appended claims and their equivalents.

Claims

1. A deep learning-based X-ray image processing method, characterized by: The method comprises the following steps: Step S10: Local gray scale analysis is performed on the X-ray image to identify fog-like scattering areas in the X-ray image; Step S20: Analysis of stripe artifacts under different jig vibration frequencies and X-ray pulse frequency coupling combinations is performed to identify a high-probability vibration-pulse frequency group in which stripe artifacts appear; Step S30: Whether the X-ray image has a risk of periodic stripe artifacts is determined by comparing the vibration frequency of the jig and the pulse frequency of the X-ray with the high-probability vibration-pulse frequency group; Step S40: If there is, the direction and interval of the stripe artifacts are determined by gray scale gradient analysis in the X-ray image, and the stripe artifact coverage area is marked; Step S50: By overlapping analysis of the fog-like scattering area and the stripe artifact coverage area, a scattering artifact overlapping area is identified, and the scattering artifact overlapping area, the fog-like scattering area, and the stripe artifact coverage area are subjected to regional artifact removal by a deep learning network, and a global de-artifact image is output by combining multi-region weight fusion.

2. The deep learning-based X-ray image processing method according to claim 1, wherein: the process of identifying fog-like scattering areas in the X-ray image comprises: calculating the global gray mean and the global gray standard deviation of the X-ray image; dividing the X-ray image into a plurality of window regions with equal areas, and calculating the local gray mean and the local gray standard deviation of each window region; setting identification judgment conditions for the fog-like scattering areas according to the global gray mean and the global gray standard deviation of the X-ray image and the local gray mean and the local gray standard deviation of the window region; the identification judgment conditions comprise: Recognition determination condition one: local gray mean value ≥ global gray mean value 1.2; Recognition determination condition two: local gray scale standard deviation ≤ global gray scale standard deviation 0.5; if the first and second identification judgment conditions are both met, the window region is marked as a fog-like scattering area.

3. The deep learning-based X-ray image processing method according to claim 2, wherein: the process of identifying a high-probability vibration-pulse frequency group in which stripe artifacts appear comprises: obtaining detection data of a plurality of historical X-ray images, and integrating the X-ray pulse frequency and the jig vibration frequency of each historical X-ray image into a vibration-pulse frequency group; if the X-ray pulse frequency and the jig vibration frequency in the vibration-pulse frequency group are coupled, the vibration-pulse frequency group is marked as a vibration-pulse frequency coupling group; according to the detection results of whether the historical X-ray images have stripe artifacts, the proportion of the number of occurrences of stripe artifacts in the vibration-pulse frequency coupling group is counted to obtain a stripe artifact probability; if the stripe artifact probability reaches a preset stripe artifact probability, the vibration-pulse frequency coupling group is marked as a high-probability vibration-pulse frequency group.

4. The deep learning-based X-ray image processing method according to claim 3, wherein: the process of determining whether the X-ray pulse frequency and the jig vibration frequency in the vibration-pulse frequency group are coupled comprises: Coupling determination condition one: X-ray pulse frequency = n Jig vibration frequency; Coupling determination condition two: |X-ray pulse frequency - tool vibration frequency| < tool vibration frequency 10% if the vibration-pulse frequency group meets any coupling judgment condition, it indicates that the X-ray pulse frequency and the jig vibration frequency in the vibration-pulse frequency group are coupled.

5. The deep learning-based X-ray image processing method according to claim 4, wherein: the process of determining whether the X-ray image has a risk of periodic stripe artifacts comprises: Integrate the vibration frequency of the jig and the pulse frequency of the X-ray into actual vibration-pulse frequency groups; Calculate the Euclidean distance between the actual vibration-pulse frequency group and the high-probability vibration-pulse frequency group to obtain a streak artifact risk value; If the streak artifact risk value is less than or equal to a streak artifact risk threshold, it indicates that the high-probability vibration-pulse frequency group is close to the actual vibration-pulse frequency group; If one or more high-probability vibration-pulse frequency groups are close to the actual vibration-pulse frequency group, it is determined that the X-ray image has a periodic streak artifact risk.

6. The deep learning-based X-ray image processing method according to claim 1, wherein: The process of marking the streak artifact coverage area is: Calculate the X-ray image x-direction and y-direction gradients, count the direction histogram of the gradient absolute value, and take the angle corresponding to the histogram peak value as the streak artifact direction; Obtain the frequency domain amplitude spectrum of the X-ray image, extract the amplitude projection along the perpendicular direction of the streak, find the peak horizontal coordinate in the projection, and calculate the streak artifact spacing; Mark the streak artifact coverage area in the X-ray image according to the streak artifact direction and spacing.

7. The deep learning-based X-ray image processing method according to claim 6, wherein: The process of identifying the scatter artifact overlap area is: Obtain the mist scattering area mask Mask_scatter and the stripe artifact covering area mask Mask_stripe, and identify the scattering artifact overlapping area : .

8. The deep learning-based X-ray image processing method according to claim 1, wherein: The process of removing artifacts in different regions through a deep learning network is: Segment the X-ray image into pixel blocks, and for each pixel block, determine the region to which it belongs according to the coordinates; For each pixel block, input it into the trained U-Net network to obtain a de-artifact output block, and after traversing all the pixel blocks, generate de-artifact images for the scatter artifact overlap area, the fog-like scatter area, and the streak artifact coverage area, respectively.

9. The deep learning-based X-ray image processing method according to claim 1, wherein: The process of combining multi-region weight fusion to output a global de-artifact image is: Assign fusion weights to the scatter artifact overlap area, the fog-like scatter area, and the streak artifact coverage area according to the artifact severity, perform smoothing processing after fusion, and obtain the final weight map; Use the Laplacian pyramid fusion algorithm to decompose the X-ray image and the de-artifact images of the scatter artifact overlap area, the fog-like scatter area, and the streak artifact coverage area into different resolution pyramids, fuse them on each pyramid layer according to the corresponding weight map, and finally recombine the fused pyramid layers to output the global de-artifact image.

10. The X-ray image processing apparatus based on deep learning, characterized by: Comprise the following modules: A fog-like scatter identification module that performs local grayscale analysis on the X-ray image to identify the fog-like scatter area in the X-ray image; A vibration-pulse frequency analysis module that analyzes the streak artifact under different combinations of jig vibration frequency and X-ray pulse frequency to identify high-probability vibration-pulse frequency groups in which the streak artifact appears; A streak artifact risk judgment module that compares the vibration frequency of the jig and the pulse frequency of the X-ray with the high-probability vibration-pulse frequency groups to determine whether the X-ray image has a periodic streak artifact risk. Stripe artifact identification module: if present, determine the stripe artifact direction and interval by gray level gradient analysis in the X-ray image, and mark the stripe artifact coverage area; Global de-artifact processing module: through the overlapping analysis of the fog-like scattering area and the stripe artifact coverage area, identify the scattering artifact overlapping area, and through the deep learning network, remove the artifacts in the scattering artifact overlapping area, the fog-like scattering area and the stripe artifact coverage area in the region, and combine the multi-region weight fusion to output the global de-artifact image.