X-ray image defect automatic classification and quantitative analysis system based on artificial intelligence and training method thereof
By employing a multi-module closed-loop collaborative architecture and a two-stage training method, the problems of low efficiency in manual inspection and insufficient accuracy of AI solutions in X-ray image defect analysis are solved, achieving automated and accurate defect classification and quantification, and adapting to the diverse inspection needs of complex workpieces.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GUANGZHOU KEYUAN IND EQUIPMENT INSTALLATION & TESTING TECHNOLOGY CO LTD
- Filing Date
- 2025-11-05
- Publication Date
- 2026-05-05
AI Technical Summary
Existing X-ray image defect analysis technology relies on manual inspection, which is inefficient and easily affected by subjective factors. Conventional AI solutions cannot decouple the workpiece geometry from the defect signal, resulting in large defect identification errors and poor accuracy, which cannot meet the needs of high-precision industrial quality inspection.
It adopts a multi-module closed-loop collaborative architecture, including a geometric basis module, a defect analysis module, a defect synthesis module, a parameter refinement module, and a loss calculation module. Through two-stage training, it realizes automatic classification and quantitative analysis of defect signals. Combined with physical perception rendering and uncertainty quantization, it improves detection accuracy and consistency.
It achieves fully automated classification and quantification of defects in X-ray images, reduces labor costs, improves detection efficiency and accuracy, adapts to diverse defects in different types of workpieces, and meets the requirements of high-efficiency and high-precision industrial quality inspection.
Smart Images

Figure CN121121314B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image analysis technology, specifically to an automatic classification and quantitative analysis system for X-ray image defects based on artificial intelligence. Background Technology
[0002] In existing X-ray image defect analysis technologies, traditional methods rely heavily on manual defect classification and quantification, resulting in significant efficiency bottlenecks. Manual inspection is not only difficult to adapt to batch inspection scenarios and cannot meet the high-efficiency requirements of industrial production, but it is also easily affected by factors such as the subjective experience and fatigue of the inspectors, leading to large defect identification errors and poor consistency. This makes it difficult to meet the standards of high-precision industrial quality inspection and has become an important factor restricting the optimization of the inspection process.
[0003] Conventional AI defect analysis solutions also have technical shortcomings. They fail to effectively decouple the workpiece geometry from defect signals, making defect parameter estimation susceptible to interference from the geometric background and significantly reducing accuracy. Furthermore, these solutions lack a physical perception rendering mechanism, resulting in synthesized defect images that do not conform to the real X-ray imaging patterns. They also have weak parameter correction capabilities, making it difficult to handle the diverse defect types of complex workpieces and achieve accurate defect classification and quantification. This, in turn, restricts their in-depth application and promotion in core areas such as industrial quality inspection. Summary of the Invention
[0004] To address the shortcomings of existing technologies, this invention provides an AI-based automatic classification and quantification analysis system for X-ray image defects and its training method. This solves the problem that conventional AI defect analysis schemes also have technical limitations, failing to effectively decouple the workpiece geometry from defect signals.
[0005] To achieve the above objectives, the present invention provides the following technical solution: an automatic classification and quantitative analysis system for X-ray image defects based on artificial intelligence, comprising:
[0006] The geometric basis module is used to identify the image to be inspected and decouple the geometric structure and defect signal in the image to be inspected, learn the intrinsic structure manifold of the X-ray image of a healthy workpiece, receive the X-ray image to be inspected, and generate a healthy geometric basis and preliminary residuals through geometric decoupling processing.
[0007] The defect analysis module is used to inversely estimate the physical parameters of the defect from the defect signal. It receives the preliminary residual output by the geometric basis module and generates preliminary defect parameters and uncertainty information through parameter estimation processing.
[0008] The defect synthesis module is used to convert abstract defect parameters into image form. It receives the preliminary defect parameters from the defect analysis module and the healthy geometric base from the geometric base module. It combines the healthy geometric information to perform physical perception rendering to generate a synthesized defect map. Then, it fuses the healthy geometric base to obtain a preliminary reconstructed map. At the same time, it generates a secondary residual based on the preliminary reconstructed map and the X-ray image to be detected.
[0009] The parameter refinement module is used to correct the initial defect parameters to obtain accurate results. It receives the initial defect parameters from the secondary residual and the defect analysis module, generates the final defect parameters through parameter correction, and generates the final reconstructed image by combining the final defect parameters with the healthy geometric basis rendering.
[0010] The loss calculation module is used to provide gradient basis for system parameter updates during the training phase. It receives the initial reconstruction graph, the final reconstruction graph, and the uncertainty information output by the defect analysis module, and generates composite loss data through loss calculation and synthesis.
[0011] Each module forms a multi-module closed-loop collaborative architecture through data flow, which collaboratively realizes automatic classification and accurate quantitative analysis of defects in X-ray images.
[0012] Preferably, the weights of the geometric basis module are frozen during the joint training of the AI-based X-ray image defect automatic classification and quantification analysis system, and are implemented using a deep convolutional autoencoder, including an encoder and a decoder, and are pre-trained offline using an X-ray image dataset containing only healthy workpieces.
[0013] Preferably, the defect analysis module is implemented using a deep convolutional network with a multi-head prediction structure, which receives the preliminary residuals and outputs the preliminary parameters and logarithmic uncertainty of the defects.
[0014] Preferably, the defect synthesis module is a differentiable rendering function that performs physical-aware forward collaboration, receives preliminary parameters and a healthy geometric basis, and generates a synthesized defect map based on physical priors.
[0015] Preferably, the parameter refinement module is an additional header of an independent lightweight convolutional network or a defect parsing module, which receives secondary residuals and preliminary parameters, and calculates parameter correction amounts to obtain the final refined parameters.
[0016] Preferably, the secondary residual is calculated from the difference between the preliminary reconstructed image and the original input X-ray image, representing the uninterpreted portion of the defect signal in the current automatic classification and quantification analysis system for X-ray image defects based on artificial intelligence.
[0017] Preferably, the loss calculation module calculates the initial reconstruction loss and the final refining loss based on the initial reconstruction graph, the final reconstruction graph, and the uncertainty, and then synthesizes the composite loss and backpropagates it.
[0018] The training method for an AI-based automatic classification and quantification analysis system of X-ray image defects includes the aforementioned AI-based automatic classification and quantification analysis system of X-ray image defects. Its characteristic is that it employs a two-stage training approach, including: S1, GMA pre-training stage; S2, analysis-synthesis closed-loop joint training stage: through step-by-step training and iterative optimization, the system achieves accurate learning of defect classification and quantification.
[0019] Preferably, the S1 and GMA pre-training specifically involves: using an X-ray image dataset containing only healthy workpieces, training the geometric basis module to minimize the reconstruction loss, enabling the module to learn the intrinsic structural manifold of the healthy workpiece image; after training, freezing all network weights of the geometric basis module; the geometric basis module is implemented using a deep convolutional autoencoder, including an encoder and a decoder.
[0020] Preferably, S2, closed-loop joint training, specifically includes the following sub-steps: S201, Input and geometric decoupling: Take an unlabeled training image containing defects and input it into the frozen geometric basis module to calculate the healthy geometric basis and preliminary residuals; S202, Preliminary parameter estimation: Input the preliminary residuals into the defect analysis module and output the preliminary parameters and logarithmic uncertainty of the defects; S203, Physically-aware rendering: Input the healthy geometric basis and preliminary parameters into the defect synthesis module, perform forward collaborative rendering to generate a synthesized defect map, and use the grayscale information of the healthy geometric basis as physical constraints during rendering; S204, Preliminary reconstruction and secondary residual calculation: Fuse the healthy geometric basis and the synthesized defect map to obtain a preliminary reconstructed map. S205. Calculate the difference between the preliminary reconstructed image and the original training image to obtain the quadratic residual; S206. Iterative Refinement: Input the quadratic residual and preliminary parameters into the parameter refinement module, calculate the parameter correction amount and add it to the preliminary parameters to obtain the final refined parameters; S207. Loss Calculation: Based on the preliminary reconstructed image, the original training image, logarithmic uncertainty, the final refined parameters, and the healthy geometric basis, calculate the preliminary reconstruction loss, the final refinement loss, and synthesize the composite loss; S208. Backpropagation and Parameter Update: Backpropagate the gradient of the composite loss to update the trainable weights of the parameter refinement module, the defect synthesis module, and the defect parsing module; S209. Iteration: Repeat steps S201 to S207 until the model converges.
[0021] This invention provides an automatic classification and quantitative analysis system for X-ray image defects based on artificial intelligence, and its training method. It has the following beneficial effects:
[0022] 1. This invention achieves fully automated classification and quantification of defects in X-ray images through a multi-module closed-loop collaborative architecture. It can complete the entire process of defect signal extraction, parameter estimation, correction and optimization without manual intervention, and output structured parameters such as defect category, center coordinates, size, and orientation angle. This significantly reduces labor costs, improves detection efficiency, avoids subjective errors, and ensures high consistency and accuracy in batch detection scenarios, thus meeting the high-efficiency needs of industrial quality inspection.
[0023] 2. This invention introduces a physical perception rendering and uncertainty quantification mechanism, which significantly improves the accuracy and reliability of defect analysis. The defect synthesis module generates a synthetic defect image that conforms to the laws of X-ray imaging based on the grayscale physical constraints of the geometric base of a healthy workpiece. The reliability of the parameter estimation is evaluated by uncertainty quantification, and the preliminary parameters are corrected by the parameter refinement module using the secondary residual, which effectively reduces the interference of geometric background and makes the defect classification and quantification results more in line with the actual working conditions, thus meeting the requirements of high-precision detection.
[0024] 3. This invention employs a two-stage training strategy to enhance the system's adaptability and generalization ability. The geometric basis module is pre-trained offline using a healthy workpiece dataset and its weights are frozen to accurately learn healthy structural manifolds, avoiding geometric signal interference in defect analysis. The closed-loop joint training stage iteratively optimizes the defect parsing, synthesis, and refinement modules, enabling them to adapt to different types of workpieces and diverse defects. This allows for efficient learning without requiring a large amount of labeled data, expanding the system's application scope in different industrial scenarios. Attached Figure Description
[0025] Figure 1 This is a structural diagram of the present invention;
[0026] Figure 2 This is a schematic diagram of the training method of the present invention. Detailed Implementation
[0027] The technical solutions in 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.
[0028] Example:
[0029] Please see the appendix Figure 1 This invention provides an artificial intelligence-based automatic classification and quantification analysis system for X-ray image defects, comprising:
[0030] The geometry basis module is used to identify the image to be inspected and decouple the geometric structure from the defect signal in the image, learn the intrinsic structure manifold of the X-ray image of a healthy workpiece, and provide a healthy geometric basis during inference. The weights of this module are frozen during joint training of the system.
[0031] Defect analysis module: used to receive preliminary residuals It also directly outputs the preliminary parameters of the defect. And the logarithmic uncertainty u of the model for this estimation result;
[0032] Defect synthesis module: used to receive and geometric basis Based on physical priors, rendering and compositing are performed to generate a composite defect map. ;
[0033] Parameter Refinement Module: Used to receive secondary residuals and preliminary parameters Calculate parameter correction amount This allows us to obtain the final refining parameters. ;
[0034] Loss calculation module: used during the training phase to calculate the loss based on the initial reconstructed graph. Final Reconstructed Diagram And the uncertainty u, calculate the composite loss And propagate in reverse;
[0035] In practical applications, the X-ray image to be detected After geometric decoupling by the geometric basis module, the output healthy geometric basis is... and preliminary residuals Simultaneously, the data flows into the defect analysis module and the defect synthesis module, forming a tightly coupled closed loop of analysis, synthesis, and feedback.
[0036] The function of the geometric basis module is to physically decouple the geometric structure signals and defect anomaly signals in the workpiece image. This module is implemented using a depth convolutional autoencoder, which consists of an encoder. and a decoder constitute,( Used to encode the input image I into a low-dimensional latent vector ,and This is used to reconstruct the image from z. The geometry basis module utilizes an X-ray image dataset containing only healthy workpieces. Offline pre-training is performed, a process designed to minimize the reconstruction loss.
[0037]
[0038] After training, this module has the ability to reconstruct healthy geometric structures when the image to be detected is displayed. During input, the output of the geometry basis module is the healthy geometry basis.
[0039]
[0040] And preliminary residuals Depend on and The difference was calculated, and theoretically only defect anomaly signals were retained:
[0041]
[0042] The defect analysis module is used to analyze the initial residuals. The module directly estimates the physical parameters of the defect inversely. It is implemented using a deep convolutional network with a multi-head prediction structure, including a shared feature extraction backbone. A parameter header and an uncertain head , ( take over And extract features
[0043]
[0044] Parameter header Output preliminary parameters This parameter is a structured vector whose components directly correspond to the quantitative properties of the defect, for example:
[0045]
[0046] Where 'c' is the defect classification label, for example, 01 represents porosity, and 02 represents cracks. Let l be the center coordinates or starting point of the defect, l be the length or radius of the defect, and w be the width. For the direction angle, uncertainty head Output logarithmic uncertainty u for quantization The reliability of the estimation results, where: .
[0047] The defect synthesis module is the core of the system, used to synthesize abstract parameters. This module converts the image back to image space and serves as a bridge for gradient backpropagation throughout the system. It is a differentiable rendering function, unique in that it performs physically-aware forward coordination while receiving defect parameters. and healthy geometric base As input; its output The calculation process for synthesizing the defect map is as follows:
[0048]
[0049] in( In rendering When defining the defect type, a query will be performed. Grayscale information in the defect area; due to The grayscale value is correlated with the physical thickness of the workpiece at that point (the grayscale is darker in thick-walled areas and brighter in thin-walled areas). , ( Using this grayscale value as a physical constraint, dynamic modulation is performed. The contrast and edge blurring of the corresponding defects are adjusted to ensure that the appearance of the synthesized defects matches the real X-ray physical imaging laws; this mechanism can effectively couple the geometric base module and the defect synthesis module deeply.
[0050] The parameter refinement module is used to build the system's feedback and coordination mechanism to refine the initial parameters. Make corrections and perform preliminary reconstruction of the diagram. By and It is obtained by fusion, among which Represents image fusion operations:
[0051]
[0052] Secondary residual From the initial reconstruction diagram With the original input The difference was calculated to be:
[0053]
[0054] This represents the uninterpreted portion of the defect signal currently understood by the system.
[0055] Parameter Refinement Module Receives and Calculate parameter correction amount This module is an additional header for a standalone lightweight convolutional network or defect parsing module, and its computation process can be represented as follows:
[0056]
[0057] Final refining parameters From preliminary parameters With correction amount The result obtained by superposition is the final classification and quantification output of this system:
[0058] .
[0059] The loss calculation module is used during the joint training phase of the system to calculate the self-supervised composite loss based on the outputs of the defect parsing module, defect synthesis module, and parameter refinement module. This module provides the gradient source for the system's backpropagation. The loss calculation module specifically includes two loss calculation functions. First, this module is used to calculate the initial reconstructed graph. With the original input The differences between them, combined with the logarithmic uncertainty u output by the defect analysis module, are used to calculate the initial reconstruction loss. The calculation formula is as follows:
[0060]
[0061] in For an unlabeled training dataset containing defects; this loss function utilizes the uncertainty u. The loss terms are weighted, and then this module is used to calculate the final refined reconstruction graph. With the original input The difference between them is used to calculate the final refining loss. ; ( Based on healthy geometric basis Based on the defect synthesis module The final composite defect map obtained by rendering is:
[0062]
[0063] The calculation formula is as follows:
[0064]
[0065] This loss term is used to drive the parameter refinement module to learn how to correct the initial parameters. The final output of the loss calculation module is the composite loss. For the above two losses and Weighted sum:
[0066]
[0067] in and To balance the weight hyperparameters between the initial estimate and the final refinement.
[0068] Please see the appendix Figure 2 The present invention also provides a training method for an artificial intelligence-based automatic classification and quantitative analysis system for X-ray image defects:
[0069] The training method of this invention adopts a two-stage approach:
[0070] S1, GMA pre-training: This stage corresponds to the offline training of the geometric basis module; using a healthy workpiece image dataset. By minimizing the reconstruction loss For geometric base module and Training is performed; after training, all network weights of the geometric basis module are frozen. S2, Joint Training for Synthetic Closure: This stage is used to train the defect parsing module and the parameter refinement module. This stage uses an unlabeled image dataset containing defects. :
[0071] S201, Input and Geometry Decoupling One of the training images Input into the frozen geometry base module to calculate the healthy geometry base. and preliminary residuals ;
[0072] S202, Preliminary parameter estimation ( Input is sent to the defect analysis module, which outputs preliminary parameters. And logarithmic uncertainty u;
[0073] S203, Physically-Aware Rendering and The data is simultaneously input into the defect synthesis module, where forward collaborative rendering is performed, and a synthesized defect map is output. ;
[0074] S204, Preliminary Reconstruction and Secondary Residual Calculation And further calculation and The second residual between ;
[0075] S205, Iterative Refining ( and The parameter is input to the parameter refinement module, which outputs the parameter correction amount. And calculate the final refining parameters. ;
[0076] S206, Loss Calculation, the loss calculation module is based on... , , u, and Calculate the initial reconstruction loss and final refining loss and synthesize composite loss ;
[0077] S207, Backpropagation and Parameter Update ( The gradient is backpropagated, and the gradient flow passes through the computation graph of the parameter refinement module, the defect synthesis module, and the defect parsing module, updating the trainable weights of these modules.
[0078] S208. Repeat the above steps iteratively until the model converges.
[0079] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. An AI-based automatic classification and quantitative analysis system for X-ray image defects, characterized in that, include: The geometric basis module is implemented using a pre-trained and weighted deep convolutional autoencoder. It is used to receive the X-ray image to be detected, generate a healthy geometric basis that reflects the intrinsic structure of the workpiece through encoding and reconstruction processing, and calculate the difference between the X-ray image to be detected and the healthy geometric basis to generate a preliminary residual. The defect analysis module is implemented using a deep convolutional network with a multi-head prediction structure. It is used to receive the preliminary residual, output the preliminary parameters of the defect through parameter estimation, and quantify the uncertainty information of the reliability of the preliminary parameter estimation results. The defect synthesis module is a differentiable rendering function used to receive the preliminary defect parameters and the healthy geometric base, use the grayscale information of the healthy geometric base as a physical constraint to perform physical perception rendering, generate a synthetic defect map that conforms to the law of X-ray imaging, and fuse the synthetic defect map with the healthy geometric base to obtain a preliminary reconstruction map. At the same time, a secondary residual is generated based on the difference between the preliminary reconstruction map and the X-ray image to be detected. The parameter refinement module is used to receive the secondary residual and the preliminary defect parameters, correct the preliminary defect parameters by calculating the parameter correction amount to generate the final defect parameters, and combine the final defect parameters with the healthy geometric basis to generate the final reconstruction map. The loss calculation module is used to receive the preliminary reconstruction graph, the final reconstruction graph, and the uncertainty information during the training phase, and generate a composite loss by calculating the preliminary reconstruction loss and the final refinement loss for system parameter updates. All the above modules form a closed-loop collaborative architecture through data flow, enabling automatic classification and quantitative analysis of defects in X-ray images.
2. The AI-based automatic classification and quantification analysis system for X-ray image defects according to claim 1, characterized in that, The weights of the geometric basis module are frozen during the joint training of the AI-based X-ray image defect automatic classification and quantification analysis system. They are implemented using a deep convolutional autoencoder, which includes an encoder and a decoder, and are pre-trained offline using an X-ray image dataset containing only healthy workpieces.
3. The AI-based automatic classification and quantification analysis system for X-ray image defects according to claim 1, characterized in that, The defect analysis module is implemented using a deep convolutional network with a multi-head prediction structure, which receives the preliminary residuals and outputs the preliminary parameters and logarithmic uncertainty of the defects.
4. The AI-based automatic classification and quantification analysis system for X-ray image defects according to claim 1, characterized in that, The defect synthesis module is a differentiable rendering function that performs physical-aware forward collaboration, receives preliminary parameters and a healthy geometric basis, and generates a synthesized defect map based on physical priors.
5. The AI-based automatic classification and quantification analysis system for X-ray image defects according to claim 1, characterized in that, The parameter refinement module is an additional header of an independent lightweight convolutional network or a defect parsing module. It receives the secondary residual and preliminary parameters, calculates the parameter correction amount, and obtains the final refined parameters.
6. The AI-based automatic classification and quantification analysis system for X-ray image defects according to claim 1, characterized in that, The secondary residual is calculated from the difference between the preliminary reconstructed image and the original input X-ray image, representing the uninterpreted portion of the defect signal in the current automatic classification and quantification analysis system for X-ray image defects based on artificial intelligence.
7. The AI-based automatic classification and quantification analysis system for X-ray image defects according to claim 1, characterized in that, The loss calculation module calculates the initial reconstruction loss and the final refinement loss based on the initial reconstruction graph, the final reconstruction graph, and the uncertainty, and then synthesizes the composite loss and backpropagates it.
8. A training method for an AI-based automatic classification and quantification analysis system for X-ray image defects, comprising the AI-based automatic classification and quantification analysis system for X-ray image defects as described in claims 1-7, characterized in that... A two-stage training approach is adopted, including: S1, GMA pre-training phase; S2, Analysis of the Synthetic Closed-Loop Joint Training Phase: Through step-by-step training and iterative optimization, the system achieves accurate learning of defect classification and quantification.
9. The training method for the automatic classification and quantitative analysis system for X-ray image defects based on artificial intelligence according to claim 8, characterized in that, The S1 and GMA pre-training specifically involves: using an X-ray image dataset containing only healthy workpieces, training a geometric basis module to minimize the reconstruction loss, enabling the module to learn the intrinsic structural manifold of the healthy workpiece image; After training is complete, freeze all network weights of the geometric basis module; The geometric basis module is implemented using a depthwise convolutional autoencoder, which includes an encoder and a decoder.
10. The training method for the artificial intelligence-based automatic classification and quantification analysis system for X-ray image defects according to claim 8, characterized in that, The S2 and closed-loop joint training specifically includes the following sub-steps: S201. Input and geometry decoupling: Take the unlabeled training image containing defects, input it into the frozen geometric basis module, and calculate the healthy geometric basis and preliminary residuals. S202, Preliminary parameter estimation: Input the preliminary residuals into the defect analysis module, and output the preliminary parameters and logarithmic uncertainty of the defect; S203, Physically-Aware Rendering: Input the healthy geometric base and preliminary parameters into the defect synthesis module, perform forward collaborative rendering to generate a synthesized defect map, and use the grayscale information of the healthy geometric base as physical constraints during rendering. S204. Preliminary Reconstruction and Secondary Residual Calculation: The preliminary reconstruction map is obtained by fusing the healthy geometric basis and the synthetic defect map. The difference between the preliminary reconstruction map and the original training image is calculated to obtain the secondary residual. S205, Iterative Refinement: Input the quadratic residual and the initial parameters into the parameter refinement module, calculate the parameter correction amount and add it to the initial parameters to obtain the final refined parameters; S206. Loss Calculation: Based on the preliminary reconstruction image, the original training image, log uncertainty, final refined parameters, and healthy geometric basis, calculate the preliminary reconstruction loss, the final refined loss, and synthesize the composite loss. S207, Backpropagation and Parameter Update: Backpropagate the gradient of the composite loss to update the trainable weights of the parameter refinement module, defect synthesis module, and defect parsing module. S208. Iteration: Repeat steps S201 to S207 until the model converges.
Citation Information
Patent Citations
Chip defect detection method based on multi-stage feature fusion and dynamic optimization
CN120431015A
System and method for joint detection, localization, segmentation and classification of anomalies in images
WO2024102565A1