A physical constraint deep learning-based material identification method and system
By employing a physically constrained deep learning approach, combined with the Swin-Transformer Unet network and an X-ray dynamic interaction model, the problems of high noise and poor accuracy in traditional methods are solved, achieving high-precision effective atomic number and density image decomposition.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- INST OF HIGH ENERGY PHYSICS CHINESE ACAD OF SCI
- Filing Date
- 2026-02-26
- Publication Date
- 2026-06-09
AI Technical Summary
In the field of material identification, traditional image-domain material decomposition methods suffer from problems such as high noise, blurred details, and poor accuracy. Existing technologies cannot effectively solve the problem of identifying complex and diverse substances.
A physical constraint-based deep learning approach is adopted, which utilizes the Swin-Transformer Unet network combined with an X-ray dynamic interaction model and image-guided training through a fully connected neural network to generate high-precision effective atomic number and density images.
It achieves high-quality effective atomic number and density image decomposition, improves image decomposition accuracy and network generalization ability, and adapts to different material types and scanning conditions.
Smart Images

Figure CN122176465A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of materials testing technology and relates to a material identification method and system based on physical constraint deep learning. By using deep learning to quantitatively analyze and decompose high and low energy reconstructed images obtained by energy-dispersive CT in the image domain and perform high-precision image recovery, it is possible to obtain high-precision and high-quality effective atomic number and density decomposition images of the scanned material in the reconstructed images using energy-dispersive CT. Background Technology
[0002] As a breakthrough technology in X-ray imaging, power spectral CT (PCDCT) based on photon counting detectors has upgraded the imaging dimension with its precise energy resolution capabilities. Its core mechanism involves using a preset energy response threshold of the detector and leveraging the energy-dependent attenuation characteristics of different substances to X-rays to capture X-ray signals penetrating the object by energy range, thereby generating multi-energy projection data and reconstructing the image. Compared to the limitations of traditional CT, which records the attenuation effects of X-rays across the entire energy range, PCDCT's advantage lies in its ability to precisely separate the attenuation information of photons at different energies. This allows each energy region's CT image to carry the material response characteristics at a specific energy level. This multi-dimensional data output enables the images to contain far more material information than traditional CT, laying the foundation for subsequent material resolution and quantitative analysis.
[0003] To extract the physical properties of substances from energy dispersive CT (EDC) data, material decomposition algorithms are a key technological support. The interaction between X-rays and matter is essentially determined by two core parameters: effective atomic number and density. The differences in attenuation coefficients among different substances stem from the differences in the combination of these two parameters. Therefore, in non-destructive testing (NDT) scenarios, the core objective of material identification is to accurately determine these two key indicators. The physical meaning of effective atomic number can be understood as follows: for a given mixture of substances, under a fixed density, if its attenuation behavior under a specific energy of X-rays is completely equivalent to that of a pure element, then the atomic number of that pure element is defined as the effective atomic number of the mixture. Through the precise quantification of these two parameters, not only can accurate identification of different materials be achieved in industrial NDT, significantly improving the reliability of testing; in the biomedical field, it can also provide precise tissue physics parameters for radiotherapy planning, ensuring the accuracy of radiotherapy dose calculation and guaranteeing the safety of clinical treatment.
[0004] In current technologies, traditional image-domain material decomposition algorithms utilize multi-energy image reconstruction, primarily based on the dual-effect model and the fundamental material decomposition model. The dual-effect model mainly relies on the two dominant interactions of X-rays—the photoelectric effect and Compton scattering. However, since this model is an approximation, the exponent of the effective atomic number in the photoelectric effect component is set as an empirical constant. This constant varies with the scan energy and atomic number range, but setting the empirical constant may affect the accuracy of the effective atomic number calculation. Photon-counting detector CT (PCDCT) employs energy-resolved photon counting technology. Although PCDCT gives unique advantages through flexible threshold adjustment, when the coefficients are empirically fixed as constants, its combination with diverse materials and different energy ranges increases the decomposition error. Furthermore, the dual-effect model approximates Compton scattering by fixing the atomic number exponent to 1 and uses the Klein-Nenko formula derived based on the free electron assumption as the energy dependency. Therefore, this approximation of the Compton scattering model also introduces decomposition errors, especially under low-energy conditions where the photoelectric effect dominates. To address the aforementioned issues, our proposed patent (Patent No. ZL 2024115752122, titled "A Substance Identification Method Based on Adaptive Quantitative Decomposition") effectively improves decomposition accuracy by setting an X-ray dynamic interaction model, but it still suffers from some limitations of classical methods. While the proposed method improves decomposition accuracy through a dynamic model, its scattering compensation factor is based on fitting correction factors using elemental atomic cross-section data from the NIST database. When decomposing compounds or mixtures, the effective atomic number value must be interpolated to obtain the corresponding correction factor. This approach ignores the difference between the decay characteristics of compounds and those of individual elements, and the multi-step interpolation and fitting process introduces accumulated errors. Furthermore, polynomial fitting has limited adaptability to complex systems; when dealing with mixtures of compounds with diverse compositions, it is difficult to accurately characterize the nonlinear relationship between the correction factor and the effective atomic number and energy, thus inhibiting further improvement in accuracy to some extent.
[0005] Meanwhile, the decomposition process of effective atomic numbers has common limitations. Both the effective atomic number decomposition and the effective atomic number obtained based on the base material decomposition method are related to the high-low energy ratio of the reconstructed image, and the error propagation process further incorporates this high-low energy ratio. Therefore, the quality of effective atomic number images is poor, and classical methods struggle to address this issue. Summary of the Invention
[0006] To address the issues of high noise, blurred details, and poor accuracy in effective atomic number images obtained by traditional methods, this invention aims to provide a material identification method and system based on physically constrained deep learning. This method can obtain effective atomic number and density images with higher image quality and higher decomposition accuracy in practical applications. Designed to meet the diverse needs of complex samples, this invention utilizes an existing X-ray dynamic physical model (referencing patent document ZL2024115752122, entitled "A Material Identification Method Based on Adaptive Quantitative Decomposition"), enriched with a fully connected neural network. Furthermore, the loss function for further generating the required monoenergetic images from the effective atomic number and density generated by the network is added to the main network. This allows the network to understand the underlying physical laws while undergoing image-guided training, thus adapting to different material types and scanning conditions, and enabling it to function effectively in various complex imaging scenarios.
[0007] The main content of this invention is network design. Based on the existing Swin-Transformer Unet network, this invention adds physical model constraints. Verification has shown that this input module significantly improves the network's training performance and generalization ability.
[0008] The technical solution of this invention is as follows: A material identification method based on physical constraint deep learning, comprising the following steps: Construct multiple simulation models of different shapes and assign them material information; Obtain the projection data of the simulation model; High- and low-energy reconstructed images are generated based on the projection data, and the effective atomic number image and density image of the simulation phantom are used as the basic label image of the corresponding simulation phantom; a reconstructed image at a set energy is generated based on the projection data and used as the monoenergetic label image of the corresponding simulation phantom. Input the basic label image of the simulation phantom into the X-ray dynamic interaction model, and output the monoenergetic image of the simulation phantom at the set energy; calculate the loss value based on the output result and the corresponding label to optimize the X-ray dynamic interaction model, and obtain the MLP-type X-ray dynamic interaction model adapted to the set energy. The high- and low-energy reconstructed images of the simulation model are input into the main network model to obtain effective atomic number images and density images, and then input into the MLP-type X-ray dynamic interaction model to generate monoenergetic images at a set energy for physical constraints, thereby optimizing the main network model. A reconstructed image is generated based on the projection data of the object to be detected and input into the main network model to obtain the effective atomic number image and density image of the object to be detected.
[0009] Preferably, the method for training and optimizing the main network model is as follows: High-energy and low-energy reconstructed images of the simulation phantom are input into the main network model to obtain effective atomic number images and density images; the effective atomic number images and density images output by the main network model are substituted pixel-by-pixel into the X-ray dynamic interaction model to calculate the linear decay coefficient at a set energy; corresponding monoenergetic images are generated based on the linear decay coefficient; and the monoenergetic images are compared with the corresponding monoenergetic label images. Loss calculation yields the physical loss; and the effective atomic number image and density image output by the main network model are compared with the effective atomic number images and density images in the corresponding basic label images. The physical loss and SSIM loss are calculated to obtain the basic loss; the main network model is optimized based on the physical loss and the basic loss.
[0010] Preferably, an end-to-end regression network is constructed using a multilayer perceptron (MLP) as the X-ray dynamic interaction model. This network is used to mine the implicit correlation between the correction factor and the scanning energy and the effective atomic number of the material based on the input scan energy and effective atomic number image and density image, thereby obtaining the photoelectric effect and coherent scattering combined correction factor and the Compton scattering correction factor.
[0011] Preferably, the X-ray dynamic interaction model calculates the linear decay coefficient at a set energy based on the photoelectric effect and coherent scattering combined correction factor, the Compton scattering correction factor and the density of the matter, and generates a corresponding monoenergetic image based on the linear decay coefficient.
[0012] Preferably, random types and intensities of noise are added to the base label image and the single-energy label image; a reconstructed image at a set energy is generated based on the projection data using an energy spectrum generation method.
[0013] Preferably, Swin Unet is used as the main network model to generate the effective atomic number image and density image.
[0014] Preferably, simulation models of different shapes are assigned different material information; the same simulation model is assigned one or more material information.
[0015] A substance identification system based on physical constraint deep learning, characterized in that it includes a sample generation module, a model training module, and a detection module; The sample generation module is used to construct multiple simulation phantoms of different shapes and assign them material information; to perform simulated scanning on the simulation phantoms using the selected detector response function and spectral function to obtain projection data; to generate high- and low-energy reconstructed images based on the projection data, and to use the effective atomic number image and density image of the simulation phantom as the base label image of the corresponding simulation phantom; and to generate a reconstructed image at a set energy based on the projection data as the single-energy label image of the corresponding simulation phantom; wherein, the high- and low-energy reconstructed images, base label images, and single-energy label images of the same simulation phantom constitute a training sample; The model training module is used to train and optimize the X-ray dynamic interaction model and the host network model using training samples. Specifically, the basic label image of the simulation phantom is input into the X-ray dynamic interaction model, which outputs a monoenergetic image of the simulation phantom at a set energy. The loss value is calculated based on the output and the corresponding label to optimize the X-ray dynamic interaction model, resulting in an MLP-type X-ray dynamic interaction model adapted to the set energy. High- and low-energy reconstructed images of the simulation phantom are input into the host network model to obtain effective atomic number and density images, which are then input into the MLP-type X-ray dynamic interaction model to generate monoenergetic images at the set energy for physical constraints, thereby optimizing the host network model. The detection module is used to generate a reconstructed image based on the projection data of the object to be detected and input it into the main network model to obtain the effective atomic number image and density image of the object to be detected.
[0016] A computing device, characterized in that it includes a processor and a memory storing a computer program, wherein the computer program, when run by the processor, executes the method described above.
[0017] A computer-readable storage medium, characterized in that it stores instructions that, when executed on a computer, cause the computer to perform the above-described method.
[0018] The advantages of this invention are as follows: (1) This invention proposes a feasible solution for high-precision quantification of effective atomic number and high-quality image restoration for the first time. After verification, it can obtain better image quality and high-precision decomposition results of effective atomic number and density in the test results of standard samples.
[0019] (2) The present invention can achieve good results in real data by using full simulation data for training, which further verifies the excellent generalization ability of the designed network.
[0020] (3) The present invention utilizes physical constraints to enable the network to understand the physical laws in image-guided learning, so that there is a physical interpretation in image generation. Attached Figure Description
[0021] Figure 1 This is a flowchart of the method of the present invention.
[0022] Figure 2 The structure diagram of the main network model.
[0023] Figure 3 This is a comparison of high-energy and low-energy reconstructed images of simulated images, as well as images decomposed by effective atomic number and density using different methods. Detailed Implementation
[0024] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
[0025] The method flow of the present invention is as follows: Figure 1 As shown, the steps include: Construct multiple simulation models of different shapes and assign them material information; The simulation phantom is scanned using the selected detector response function and spectral function to obtain projection data; High- and low-energy reconstructed images are generated based on the projection data, and the effective atomic number image and density image of the simulation phantom are used as the basic label image of the corresponding simulation phantom; a reconstructed image at a set energy is generated based on the projection data and used as the monoenergetic label image of the corresponding simulation phantom. Input the basic label image of the simulation phantom into the X-ray dynamic interaction model, and output the monoenergetic image of the simulation phantom at the set energy; calculate the loss value based on the output result and the corresponding label to optimize the X-ray dynamic interaction model, and obtain the MLP-type X-ray dynamic interaction model adapted to the set energy. The high- and low-energy reconstructed images of the simulation model are input into the main network model to obtain effective atomic number images and density images, and then input into the MLP-type X-ray dynamic interaction model to generate monoenergetic images at a set energy for physical constraints, thereby optimizing the main network model. A reconstructed image is generated based on the projection data of the object to be detected and input into the main network model to obtain the effective atomic number image and density image of the object to be detected.
[0026] An optional embodiment of the present invention provides a material identification method based on physical constraint deep learning, the process of which is as follows: (1) Construct simulation models with random geometric shapes and randomly assign different materials to these simulation models with random shapes from the material library. The effective atomic number and density of the materials in the material library vary randomly within a range to simulate various irregular materials that appear in real situations.
[0027] (2) Use the existing detector response function and spectral function to perform a simulation scan on the simulation phantom that has been given different material information to obtain the simulated projection data.
[0028] (3) Poisson noise is added to the projection data of the simulation phantom obtained by simulated scanning, and high and low energy reconstructions are performed to obtain high and low energy reconstructed images, which are used as input images for the subsequent main network model (i.e., the main material decomposition network of the material identification method based on physical constraints deep learning). Based on the different material information assigned to the simulation phantom, corresponding effective atomic number images and density images are generated, which are used as the basic label images of the model; at the same time, the projection data at the required single energy is generated through the energy spectrum generation method. The reconstructed images are used as the model's monoenergetic label images. Random types and intensities of noise are added to these label images to mitigate the mismatch between simulation and real data caused by different noise distributions.
[0029] (4) Repeat steps (1)-(3) to generate a sufficient number of noisy data pairs. Divide all data pairs into training and validation sets according to a preset ratio for subsequent model training and performance validation.
[0030] (5) In the calculation of effective atomic number, traditional decomposition methods have poor adaptability of empirical parameters and are prone to introducing errors. The polynomial fitting method of patent ZL 2024115752122 has the problems of discrete fitting limitation, large interpolation error and insufficient adaptability to multiple types of compounds. This invention abandons the idea of pre-set function fitting and uses multilayer perceptron (MLP) to construct the end-to-end regression network of the correction factor in the X-ray dynamic interaction model in the patent. With its excellent nonlinear fitting ability, it adaptively explores the intrinsic relationship between the correction factor and the scanning energy and effective atomic number.
[0031] (6) Using the effective atomic number image and density image of the labeled images in the training set as input, the model is fed into the MLP-based X-ray dynamic interaction model, which generates the set energy. The following monoenergetic image; the generated The monoenergetic image below and its corresponding Single-energy label image making Loss calculation, with this loss as the optimization objective, is used to train and obtain the adaptation energy. The MLP-type X-ray dynamic interaction model.
[0032] (7) Swin-UNet was selected as the main network model for material decomposition. The main network model was used to generate effective atomic number images and density images. Based on the global attention mechanism of Swin-Transformer, the network's ability to learn detailed features in the reconstructed image was enhanced, and the detail recovery accuracy of the effective atomic number image was improved.
[0033] (8) To enable the main network model to learn the physical process of matter decomposition under data-driven conditions, a physical loss is designed based on the trained MLP-type X-ray dynamic interaction model, and a triple loss constraint is formed by combining the basic loss to realize the training of the main network model; specifically, the effective atomic number image and density image generated by the main network model are substituted pixel by pixel into the MLP-type X-ray dynamic interaction model to calculate the energy. The linear decay coefficient is determined, and the corresponding monoenergetic image is generated; the generated monoenergetic image is then compared with the corresponding monoenergetic label image. Loss calculation yields the physical loss; simultaneously, the effective atomic number image and density image generated by the main network are compared with their corresponding base label images. Loss, SSIM loss calculation, to obtain the basic loss; based on physical loss, The loss and SSIM loss are used together as the optimization objectives of the main network model. The network parameters are updated iteratively through gradient backpropagation, which forces the main network model to accurately learn the intrinsic physical laws of the interaction between X-rays and matter and the decomposition of matter based on image features.
[0034] (9) Generate a reconstructed image based on the projection data of the object to be detected and input it into the main network model to obtain the effective atomic number image and density image of the object to be detected.
[0035] Furthermore, the input image used here has a continuous sequence length of 2, which consists of high- and low-energy reconstructed images obtained by scanning and adding noise. These images are saved as two-channel images for fast input during training. The label images consist of two parts: a basic label image, containing effective atomic number and density labels for direct image-guided decomposition, with a sequence length of 2 and saved as a two-channel image; and single-energy image labels for various energies used for physical loss constraints, with a sequence length of 3 during training, representing the three energies of the single-energy loss constraint setting (e.g., 20keV, 30keV, and 100keV), and saved as a three-channel image.
[0036] In one optional embodiment of the present invention, Swin-UNet is used as the main network. Figure 2The left-middle section details the network structure. The network is centered around the Swing Transformer block and consists of four parts: Encoder, Bottleneck, Decoder, and Skip Connection. The feature dimensions and channel dimensions of each module are clearly labeled below. H and W represent the height and width of the input image, and C is the number of basic feature channels in the network. The number of input image channels is fixed at 2, and the number of output channels is also 2.
[0037] like Figure 2 As shown, the encoder is the core of feature extraction. The input is an original image with 2 channels. First, it undergoes a 4×4 image patch partitioning operation, transforming the input into a feature map of H / 4×W / 4×48. Then, it is processed by linear embedding and two consecutive Swin Transformer blocks, updating the feature dimensions to H / 4×W / 4×C. Next, it is downsampled by patch merging, and then features are extracted by two more Swin Transformer blocks. At this point, the feature size is reduced to H / 8×W / 8, and the channel dimension is expanded to 2C. Finally, the operation of "patch merging downsampling + two Swin Transformer blocks" is repeated once to complete the encoder process.
[0038] The bottleneck layer receives the output features from the encoder. To avoid excessive network depth leading to convergence difficulties, only two consecutive Swin Transformer blocks are used. The feature size in this layer remains constant at H / 32×W / 32×8C. Its core function is to enhance deep semantic information without altering the feature scale.
[0039] The decoder and encoder have a completely symmetrical structure. Feature scale recovery is achieved through upsampling (patch expanding), with the feature size being increased by a factor of 2 each time. The core unit of the decoder is "Swin Transformer block + patch expanding". Upsampling is first completed through patch expanding, and then the features are refined through the Swin Transformer block. The H / 32×W / 32×8C features output from the bottleneck layer are gradually restored to a scale that matches the features at each stage of the encoder.
[0040] Skip connections are a hallmark design of the UNet series of networks, and Swin-UNet also uses this structure. Their function is to directly correlate the features output from each stage of the encoder with the corresponding upsampled features in the decoder, supplementing the spatial detail information of the decoder and avoiding information loss during feature transfer.
[0041] The Swin Transformer block is the basic functional unit of the main network. Internally, it follows a fixed process of "Layer Normalization (LN) - Attention Calculation - Residual Connection - Layer Normalization - Multilayer Perceptron (MLP) - Residual Connection". The core is composed of two key modules, Window Multi-Head Self-Attention (W-MSA) and Shift Window Multi-Head Self-Attention (SW-MSA), which ensure efficient calculation of feature associations while avoiding gradient vanishing.
[0042] The core of the W-MSA (Window Multi-Head Self-Attention) module is "calculating attention within a local window" to balance feature extraction performance and computational efficiency. The specific structure and implementation logic are as follows: First, the input H×W×C feature map is divided into non-overlapping local windows of a preset fixed size (7×7 in this design), with each window covering 7×7 feature pixels. Then, within each independent window, multi-head self-attention is calculated—the features are split according to the number of heads, and the association weights of query (Q), key (K), and value (V) are calculated separately. These weights are then weighted to obtain the local attention features for each window. Finally, the features from all windows are concatenated and integrated to output an H×W×C feature with the same dimensions as the input. This module significantly reduces the computational overhead of full-image self-attention by limiting the scope of attention calculation, while preserving local feature associations.
[0043] The SW-MSA (Shifted Window Multi-Head Self-Attention) module is an optimization of W-MSA, designed to address the feature fragmentation problem between W-MSA windows. Its structure is largely the same as W-MSA, with the core difference being the window partitioning strategy: the windows of the previous W-MSA are shifted by half their size (3.5 pixels, actually aligned to integer pixels) in both the horizontal and vertical directions, creating partially overlapping areas between previously non-overlapping windows. After self-attention computation is performed within the shifted windows, feature concatenation and adjustment ensure that the output feature dimensions remain H×W×C. This module achieves feature interaction across the original window boundaries through window shifting, allowing features from adjacent windows to establish relationships, overcoming the limitations of local computation in W-MSA, and making the extracted features more global.
[0044] Both attention modules are followed by an MLP (Multilayer Perceptron) module. The MLP consists of a "1×1 convolution - activation function - 1×1 convolution". The first 1×1 convolution expands the number of feature channels to 4C to enhance expressive power. After introducing non-linearity through the GELU activation function, the second 1×1 convolution restores the number of channels to C, completing the non-linear transformation and dimensionality regression of the features. The entire Swing Transformer block, through the collaboration of W-MSA and SW-MSA, achieves both accurate capture of local features and ensures effective correlation of global features.
[0045] The output layer at the end of the network takes the features processed by the decoder as input, refines the features through 3×3 convolution, adjusts the number of channels to 2 through 1×1 convolution, and finally outputs the result through an activation function to ensure that the number of channels in the output is consistent with that in the input image.
[0046] In determining the effective atomic number, both the dual-effect substance decomposition method and the base material decomposition method require empirical determination of the relevant index. This index dynamically changes with the scanning energy and the effective atomic number of the detected substance, resulting in poor adaptability of empirical parameters. It is prone to introducing errors in flexible energy ranges and diverse substance detection, leading to a decrease in decomposition accuracy. To address this, a patented adaptive decomposition algorithm based on an X-ray dynamic physical model is proposed (refer to patent document ZL 2024115752122, titled "A Substance Identification Method Based on Adaptive Quantitative Decomposition"). The algorithm proposes a calculation model based on the dynamic physical characteristics of X-rays, with the core expression as follows: In the formula, The linear attenuation coefficient is used. The mass density of the material; Effective atomic number; For scanning energy; Used for comprehensive correction of photoelectric effect and coherent scattering; This is the Compton scattering correction factor; , It is a fixed constant.
[0047] In the aforementioned patent, researchers used elemental X-ray interaction cross-section data from the NIST database to obtain the values at different energies through polynomial fitting. , The fitting parameters and surfaces improve the decomposition accuracy to some extent, but this fitting method still has obvious limitations in practical applications. The specific limitations are mainly reflected in the following aspects.
[0048] Traditional polynomial fitting models for constructing correction factor models rely entirely on single-element atomic cross-section data from the NIST database. This results in the model only being able to fit discrete integers corresponding to a single element. This is a typical discrete point fitting method. Its limitations are quite prominent: for non-integer points... The correction factor needs to be obtained indirectly through interpolation; and when detecting multi-element compounds, the mixture's... Then, interpolation is performed, which not only increases the complexity of the operation but also increases the risk of introducing errors.
[0049] In fact, accurately solving for the correction factor in a compound system requires a complete multi-step calculation process: first, the weighted mass decay coefficient of each atom is obtained based on the compound's chemical formula; then, the contribution of the two types of effects to the overall decay coefficient is derived by combining the compound's density; finally, the correction factor is obtained by fitting the relevant formula. However, traditional polynomial fitting skips this accurate calculation process and only approximates the correction factor value through interpolation, which inevitably introduces significant errors. Furthermore, when dealing with multiple types of compounds, the fit of this method decreases significantly, which also introduces decomposition errors.
[0050] To address the limitations of traditional polynomial fitting and achieve high-precision, high-generalization modeling of correction factors, this study abandons the pre-defined function fitting approach and employs a multilayer perceptron (MLP) to construct an end-to-end regression network, thus replacing the traditional polynomial fitting method. MLP possesses powerful nonlinear fitting and mapping capabilities, and can adaptively mine correction factors and... , The implicit relationships between them, and its fully connected architecture can adapt to different energy ranges and material systems, effectively improving the model's adaptability and robustness.
[0051] exist Figure 2 The right side of the image illustrates the physically constrained network structure of this invention. The network employs a fully connected structure, with the inputs to the regression network being the effective atomic number and density, and an input dimension of 2 (corresponding to physical features). The output dimension is 2 (representing the correction function). and The hidden layer consists of three fully connected layers with 128, 64, and 32 neurons respectively, each followed by a ReLU activation function; the output layer is constrained by the Softplus function to ensure that the output value is strictly positive.
[0052] In an optional embodiment of the present invention, an MLP network is used to implement the correction factor. and Accurate fitting, at its core, relies on the deviation between the predicted value and the theoretical true value of the linear decay coefficient as the optimization guide. This deviation drives the continuous iterative adjustment of network parameters, ultimately outputting a correction factor that meets the accuracy requirements. To achieve this core objective, a systematic training process needs to be designed to ensure that the network's fitting effect and generalization ability meet the standards.
[0053] The specific implementation process of network training is as follows: First, select the scan energy. With the effective atomic number of a substance As input variables to the MLP network, they are fed into a pre-defined network structure; after forward propagation within the network, a two-dimensional output is generated, which is the correction factor under the corresponding input conditions. and After obtaining the correction factor, it is compared with the density of the currently detected substance. Substituting all the values into formula (1), the predicted value of the linear attenuation coefficient is obtained through calculation. (Essentially corresponding to the linear decay coefficient value in a monoenergetic image). To achieve iterative optimization of network parameters, the predicted value is selected. Compared with theoretical true value (Essentially corresponding to the linear decay coefficient value in a monoenergetic tag image) The loss is used as the optimization objective. The backpropagation algorithm is used to propagate the loss error to each layer of the network, and the parameters of each layer are iteratively updated until the model reaches the preset training accuracy.
[0054] During network training, if only pure elemental data is used, the network will struggle to adapt to real-world scenarios involving the detection of non-single-element substances, resulting in insufficient generalization ability. Therefore, it is necessary to construct training labels that combine physical realism and numerical accuracy. These labels are calculated using relevant data from the NIST database, primarily employing an element-weighted summation method. The specific calculation expression is as follows: In the formula, Represents the various elements that make up matter; Corresponding to the The mass decay coefficient of the element; This indicates the mass fraction of the element in the substance; This represents the overall density of the compound formed by these elements. Based on this theoretical label, the density used for training the MLP network can be further clarified. The specific form of the loss function is defined as follows: Should The core function of the loss function is to quantify the deviation between the predicted value of the linear decay coefficient and the theoretical label value. This deviation error is then propagated layer by layer to each level of the MLP network through backpropagation, driving continuous adjustment and optimization of the network parameters and gradually reducing the fitting error. With the synergistic effect of the above training process and the loss function strategy, the fitting accuracy of the MLP network will continuously improve, ultimately enabling it to accurately output any energy. Below, and effective atomic number Matching correction factor and Successfully achieved from effective atomic number Density of matter To the corresponding energy The order can accurately convert the linear decay coefficient.
[0055] In an optional embodiment of the present invention, to improve image restoration quality and ensure the network accurately grasps the intrinsic physical laws governing the interaction between X-rays and matter in data-driven image training, thereby improving the decomposition accuracy of effective atomic number and density while maintaining image quality, a composite loss function incorporating physical constraints is designed based on the X-ray dynamic interaction model proposed above. This composite loss function integrates a triple supervision mechanism, leveraging the synergistic effect of physical constraints and data supervision to achieve the triple objectives of data accuracy, structural consistency, and precise control of physical laws. The three losses it includes are the L1 loss for effective atomic number and density, the structural similarity loss, and the... and physical losses The specific mathematical expression is as follows: in, That is, physical loss The parameters in the formula have the following meanings: A graph representing the material parameters predicted by the network. These are the true values of the effective atomic number and density; Represents energy The actual linear attenuation coefficient value corresponding to the single-energy image. And... This is based on formula (1), calculated using the MLP-driven X-ray dynamic interaction model proposed earlier. The prediction parameters generated by the main network are... and By substituting each pixel into the model, the energy can be calculated. The corresponding linear attenuation coefficient is used to generate the corresponding monoenergetic image. During the experiment, combining experience and experimental verification, the physical loss... Material parameter L1 loss and structural similarity loss The weights were set to 0.15, 0.05 and 0.8 respectively.
[0056] In physical loss In the calculation process, single-energy images at three characteristic energy points—20 keV, 30 keV, and 100 keV—were empirically selected for calculation. 20 keV and 30 keV belong to the low-energy range, where the photoelectric effect dominates, and the linear decay coefficients of different substances show significant differences, effectively distinguishing the low-energy decay characteristics of different substances. 100 keV belongs to the high-energy range, where the dominance of the photoelectric effect weakens, Compton scattering strengthens, and the difference in linear decay coefficients between substances narrows, accurately reflecting the decay characteristics of substances under high-energy conditions. The synergistic effect of these three characteristic energy points can approximately characterize the specific decay curves of different substances.
[0057] In summary, the core of the loss function strategy proposed in this section is to embed the X-ray interaction model as a differentiable physical model into the composite loss function. This model is used to verify whether the network's predicted parameters conform to the actual energy spectrum decay law. During network training, the backpropagation mechanism forces the network not only to fit the statistical patterns in the training data but also to learn the real physical processes of X-ray-matter interaction, thereby enhancing the physical derivability of the prediction results and ensuring the dual accuracy of image restoration and parameter decomposition.
[0058] In an optional embodiment of the present invention, a random generation strategy is used to construct a simulated training dataset. The complete implementation process is as follows: First, a two-dimensional random noise matrix with a size of 200×200 pixels is constructed. Gaussian filtering is applied to this matrix for smoothing to obtain a Perlin noise basis with continuous gradient features. After completing the normalization processing and gray-level offset adjustment of the basis, all distinct gray values in the image are extracted. Binarization is performed on each independent gray value to generate a dedicated binary mask, thereby achieving full coverage and non-overlapping segmentation of the original texture image, laying the foundation for subsequent material parameter assignment.
[0059] To achieve precise assignment of values to segmented regions, this study established a physical parameter library based on fixed chemical formulas, encompassing the standard chemical formulas of various common compounds. Each compound corresponds to its own unique effective atomic number. With density There is no need for manual parameter assignment for each substance; the effective atomic number of all compounds is limited to the range of 5 to 20, and the density range is 0 to 3.95 g / cm³. 3 This parameter range can fully cover the physical parameter range of most biological tissues, ensuring the practical adaptability of the training data. Subsequently, through random sampling, a one-to-one correspondence is established between the substances in the parameter library and each binary mask region, completing the assignment of material parameters for all segmented regions.
[0060] It is worth noting that each segmented region defined by the mask is generated through random sampling. Its spatial location, geometry, and size are determined by the statistical characteristics of the initial random noise matrix, without any predefined geometric patterns or fixed positional constraints. Simultaneously, the assignment of material parameters to each discrete segmented region also employs a random sampling mode, effectively preventing deterministic patterns in material combinations within the parameter library, ensuring the randomness and diversity of the training data, and improving the model's generalization ability.
[0061] It is important to note that in this method, the training data for the MLP network used for correction factor fitting and the main network for matter decomposition are completely separated, effectively avoiding information leakage. Specifically, the training data for the MLP network comes from the effective atomic numbers of various substances in the matter parameter database. With density The data, with training labels based on the NIST database and compound-specific information, consist of linear decay coefficients calculated at different energies. The training loss is determined by comparing two sets of linear decay coefficients: one set is a correction factor output from the X-ray dynamic physics model combined with an MLP network. and The calculations show that the other part is the true linear decay coefficient, which is only used by the MLP network to learn specific energies. , With correction factor , The fitting relationship between them does not involve any image data or spatial feature information throughout the process.
[0062] In contrast, the training data for the main body network of matter decomposition consists of synthetic images containing spatial distribution information, generated based on the aforementioned physical parameter library of matter. Its core training objective is to accurately extract the effective atomic number and density parameters of matter from the synthetic images. In summary, the training data types and core uses of the MLP network and the main body network of matter decomposition are completely independent, with no data overlap or information crossover issues. The training of the MLP network relies solely on the inherent physical laws of matter itself, without introducing any spatial features of the synthetic images or task-related information from the main body network. These are two completely separate data dimensions, fundamentally eliminating information leakage.
[0063] An optional embodiment of the present invention provides a substance identification system based on physical constraint deep learning, characterized in that it includes a sample generation module, a model training module, and a detection module; The sample generation module is used to construct multiple simulation phantoms of different shapes and assign them material information; to perform simulated scanning on the simulation phantoms using the selected detector response function and spectral function to obtain projection data; to generate high- and low-energy reconstructed images based on the projection data, and to use the effective atomic number image and density image of the simulation phantom as the base label image of the corresponding simulation phantom; and to generate a reconstructed image at a set energy based on the projection data as the single-energy label image of the corresponding simulation phantom; wherein, the high- and low-energy reconstructed images, base label images, and single-energy label images of the same simulation phantom constitute a training sample; The model training module is used to train and optimize the X-ray dynamic interaction model and the host network model using training samples. Specifically, the basic label image of the simulation phantom is input into the X-ray dynamic interaction model, which outputs a monoenergetic image of the simulation phantom at a set energy. The loss value is calculated based on the output and the corresponding label to optimize the X-ray dynamic interaction model, resulting in an MLP-type X-ray dynamic interaction model adapted to the set energy. High- and low-energy reconstructed images of the simulation phantom are input into the host network model to obtain effective atomic number and density images, which are then input into the MLP-type X-ray dynamic interaction model to generate monoenergetic images at the set energy for physical constraints, thereby optimizing the host network model. The detection module is used to generate a reconstructed image based on the projection data of the object to be detected and input it into the main network model to obtain the effective atomic number image and density image of the object to be detected.
[0064] An optional embodiment of the present invention provides a computing device, characterized in that it includes: a processor and a memory storing a computer program, wherein the computer program is executed by the processor to perform the above-described method.
[0065] An optional embodiment of the present invention provides a computer-readable storage medium, characterized in that it stores instructions that, when executed on a computer, cause the computer to perform the above-described method.
[0066] High- and low-energy reconstructed images of the simulated image, as well as comparison images of effective atomic number and density decomposition using different methods, such as... Figure 3 As shown; arrows indicate the locations of errors generated by other methods. In simulation experiments, this method (SWUnet-physics) is compared with traditional methods (LAN), Unet, Butterfly-net, and Swin-Transformer Unet (SWUnet) without physical constraints. Accuracy comparisons are expressed as a percentage of error.
[0067] Table 1 compares the effective atomic number decomposition results for various materials, where reference values are represented by ref and calculated values by cal. The values represent the mean ± standard deviation of the decomposition, and the values in parentheses represent the percentage of error.
[0068] Table 1 compares the effective atomic number decomposition results of various materials. Table 2 compares the density decomposition results for various materials, where reference values are represented by ref and calculated decomposition values by cal. The values represent the mean ± standard deviation of the decomposition, and the values in parentheses represent the percentage of error.
[0069] Table 2 compares the density decomposition results of various materials. The above are preferred embodiments of the present invention. It should be noted that, for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A material identification method based on physical constraint deep learning, comprising the following steps: Construct multiple simulation models of different shapes and assign them material information; Obtain the projection data of the simulation model; High- and low-energy reconstructed images are generated based on the projection data, and the effective atomic number image and density image of the simulation phantom are used as the basic label image of the corresponding simulation phantom; a reconstructed image at a set energy is generated based on the projection data and used as the monoenergetic label image of the corresponding simulation phantom. Input the basic label image of the simulation phantom into the X-ray dynamic interaction model, and output the monoenergetic image of the simulation phantom at the set energy; calculate the loss value based on the output result and the corresponding label to optimize the X-ray dynamic interaction model, and obtain the MLP-type X-ray dynamic interaction model adapted to the set energy. The high- and low-energy reconstructed images of the simulation model are input into the main network model to obtain effective atomic number images and density images, and then input into the MLP-type X-ray dynamic interaction model to generate monoenergetic images at a set energy for physical constraints, thereby optimizing the main network model. A reconstructed image is generated based on the projection data of the object to be detected and input into the main network model to obtain the effective atomic number image and density image of the object to be detected.
2. The method according to claim 1, characterized in that, The method for training and optimizing the main network model is as follows: High-energy and low-energy reconstructed images of the simulation phantom are input into the main network model to obtain effective atomic number images and density images; the effective atomic number images and density images output by the main network model are substituted pixel-by-pixel into the X-ray dynamic interaction model to calculate the linear decay coefficient at a set energy; corresponding monoenergetic images are generated based on the linear decay coefficient; and the monoenergetic images are compared with their corresponding monoenergetic label images. Loss calculation yields the physical loss; and the effective atomic number image and density image output by the main network model are compared with the effective atomic number images and density images in the corresponding basic label images. The physical loss and SSIM loss are calculated to obtain the basic loss; the main network model is optimized based on the physical loss and the basic loss.
3. The method according to claim 2, characterized in that, An end-to-end regression network was constructed using a multilayer perceptron (MLP) as the X-ray dynamic interaction model. This network was used to mine the implicit correlation between the correction factor and the scanning energy and the effective atomic number and density image of the material based on the input scan energy and effective atomic number image, and to obtain the photoelectric effect and coherent scattering combined correction factor and Compton scattering correction factor.
4. The method according to claim 3, characterized in that, The X-ray dynamic interaction model calculates the linear decay coefficient at a set energy based on the photoelectric effect and coherent scattering combined correction factor, the Compton scattering correction factor and the density of matter, and generates the corresponding monoenergetic image based on the linear decay coefficient.
5. The method according to claim 1, 2, or 3, characterized in that, Random types and intensities of noise are added to the base label image and the monoenergetic label image; a reconstructed image at a set energy is generated based on the projection data using an energy spectrum generation method.
6. The method according to claim 1, 2, or 3, characterized in that, Using Swin Unet as the main network model, the effective atomic number image and density image are generated.
7. The method according to claim 1, characterized in that, Simulation models of different shapes are assigned different material information; the same simulation model is assigned one or more material information.
8. A substance identification system based on physical constraint deep learning, characterized in that, It includes a sample generation module, a model training module, and a detection module; The sample generation module is used to construct multiple simulation phantoms of different shapes and assign them material information; acquire the projection data of the simulation phantoms; generate high- and low-energy reconstructed images based on the projection data, and use the effective atomic number image and density image of the simulation phantoms as the base label images of the corresponding simulation phantoms; generate reconstructed images at a set energy based on the projection data, and use them as the single-energy label images of the corresponding simulation phantoms; wherein, the high- and low-energy reconstructed images, base label images, and single-energy label images of the same simulation phantom constitute a training sample; The model training module is used to train and optimize the X-ray dynamic interaction model and the host network model using training samples. Specifically, the basic label image of the simulation phantom is input into the X-ray dynamic interaction model, which outputs a monoenergetic image of the simulation phantom at a set energy. The loss value is calculated based on the output and the corresponding label to optimize the X-ray dynamic interaction model, resulting in an MLP-type X-ray dynamic interaction model adapted to the set energy. High- and low-energy reconstructed images of the simulation phantom are input into the host network model to obtain effective atomic number and density images, which are then input into the MLP-type X-ray dynamic interaction model to generate monoenergetic images at the set energy for physical constraints, thereby optimizing the host network model. The detection module is used to generate a reconstructed image based on the projection data of the object to be detected and input it into the main network model to obtain the effective atomic number image and density image of the object to be detected.
9. A computing device, characterized in that, include: A processor, a memory storing a computer program, wherein the computer program, when executed by the processor, performs the method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, A storage instruction that, when executed on a computer, causes the computer to perform the method as described in any one of claims 1 to 7.