Multi-energy X-ray material identification method and system based on pixel-level spatial resolution
The problem of fusing spatial structure and energy spectrum correlation information in multi-energy X-ray data was solved by using energy-space graphs and energy-space message passing neural networks (ESMPNN), achieving high-precision, robust classification and small-sample learning capabilities for low atomic number materials.
Patent Information
- Application Number
- CN202511515434.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-22
- Publication Date
- 2026-01-09
Smart Images

Figure CN121305202A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of digital image processing technology. Specifically, it relates to a pixel-level spatial resolution method and system for identifying multi-energy X-ray materials. It is based on an energy-space graph neural network and is particularly suitable for high-precision pixel-level classification of materials with low atomic numbers (Low-Z) and similar physical densities. Background Technology
[0002] Accurate and non-destructive identification of material composition is a key technological challenge in fields such as life sciences, materials science, industrial non-destructive testing, medical diagnostics, and public safety. X-ray imaging is widely used due to its high penetrating power, but traditional single-energy X-ray imaging techniques mainly rely on differences in density or effective atomic number between materials to create contrast. When dealing with low-Z materials composed of elements such as carbon, hydrogen, and oxygen, such as various types of wood, polymers, or biological soft tissues, the differences in density and atomic number between them are extremely small, resulting in single-energy X-ray images often displaying similar grayscale values, making effective differentiation difficult.
[0003] For ideal monochromatic X-rays, the transmission intensity follows the Beer-Lambert law: I(E) = I0(E)e -μ(E)d Where I0(E) is the incident intensity, μ(E) is the linear attenuation coefficient, and d is the material thickness. In a dual-energy system, the influence of thickness can be eliminated and material characteristic parameters obtained by calculating the ratio of attenuation coefficients at different energies, R(Ei,Ej) = μ(Ei) / μ(Ej). However, actual X-ray sources are multicolor continuous spectra, making the calculation of R a complex nonlinear problem that requires consideration of various factors such as detector response and spectral distribution.
[0004] To address this issue, multi-energy X-ray imaging technology was proposed. This technology utilizes energy-resolved photon counting detectors to acquire attenuation information of an object across multiple independent energy ranges. The linear attenuation coefficients of X-rays with energy (i.e., energy spectrum characteristics) differ among different materials, providing a physical basis for distinguishing materials with similar compositions.
[0005] Currently, the mainstream method for processing multi-energy data is based on physical model-based material decomposition algorithms, such as Basis Material Decomposition (BMD). This type of method attempts to decompose measured attenuation information into the equivalent thickness or concentration of several pre-selected base materials (such as water and bone). However, this method has significant drawbacks: First, its performance is highly dependent on the accuracy of the physical model and prior knowledge of the base materials; for samples with complex or unknown compositions, model mismatch can lead to a severe decrease in decomposition accuracy. Second, this method is very sensitive to inherent non-ideal effects of the detector, such as charge sharing, pulse accumulation, and K-fluorescence escape, which can introduce spectral distortion and interfere with the accuracy and stability of the decomposition results. Third, the algorithms typically involve solving complex nonlinear equations, resulting in high computational costs.
[0006] With the development of artificial intelligence technology, some studies have begun to apply deep learning models, especially Convolutional Neural Networks (CNNs), to process multi-energy images. CNNs have achieved great success in processing Euclidean data with regular grid structures (such as standard images). However, when directly applied to multi-energy imaging data, CNN models have inherent limitations: they typically process images of different energy ranges as independent input channels. This "channel-independent processing" approach cannot fully model the physical correlation between different energy responses at the same spatial location. While their inherent convolutional operations are good at extracting local spatial features, they struggle to effectively capture and characterize the intrinsic physical correlation between different energy responses at the same spatial location. Multi-energy data is essentially a complex spatial-spectral hybrid structure, and its physical properties are inherent in the combined effects of pixel spatial adjacency relationships and spectral line features across energy dimensions. The traditional CNN architecture cannot fully exploit these non-Euclidean intrinsic correlations, limiting its performance ceiling in fine-grained material identification tasks.
[0007] In summary, existing technologies lack a data processing method that can effectively integrate spatial structure information and energy spectrum correlation information from multi-energy X-ray data without heavily relying on precise physical models. As a result, it cannot meet the urgent need for high-precision and robust classification of low-Z, near-density materials. Summary of the Invention
[0008] The purpose of this invention is to provide a pixel-level spatially resolved multi-energy X-ray material identification method based on graph neural networks. By constructing an energy-space graph structure and designing an Energy-Spatial Message Passing Neural Network (ESMPNN), a deep fusion of spatial and energy spectrum information is achieved, thereby significantly improving the accuracy, robustness, and data utilization efficiency of classifying low atomic number and near-density materials, while reducing the dependence on precise physical models.
[0009] To address the problem that existing CNN models cannot effectively model the intrinsic physical relationships between pixels in terms of spatial location and energy dimension, this invention proposes a novel energy-space graph construction method. By establishing first-type edges (spatial edges) and second-type edges (energy spectrum edges), non-Euclidean spatial-energy spectrum data is structured, enabling graph neural networks to simultaneously process spatial texture information and energy spectrum 'fingerprint' information. Furthermore, the energy-aware message passing mechanism designed in this invention uses the energy dimension difference as a parameter for message calculation, allowing the model to learn the physical laws of energy response, thereby achieving deep fusion of the two types of information.
[0010] To achieve the above objectives, the present invention provides a pixel-level spatially resolved multi-energy X-ray material identification method, comprising:
[0011] S1: Acquire multi-energy X-ray image data of the sample under test in at least two energy ranges, wherein the multi-energy X-ray image data includes the physical feature value of each pixel in each energy range;
[0012] S2: Select an effective pixel region from the multi-energy X-ray image data as the analysis unit, and construct an energy-space map based on the analysis unit;
[0013] S3: Input the energy-space graph into a pre-trained graph neural network model to generate a feature representation that can characterize the material properties of the effective pixel region through multiple rounds of message passing and aggregation. Then, output the material category to which the effective pixel region belongs through a classifier.
[0014] Constructing an energy-space map specifically includes:
[0015] S21: Define each pixel point in each energy interval within the effective pixel area as a node of the energy-space map, and assign the node a physical feature value to the pixel point;
[0016] S22: Establish a first type of edge in the energy-space graph to connect nodes that are adjacent in space within the same energy range;
[0017] S23: As Figure 2C As shown, a second type of edge is established in the energy-space graph to connect nodes that are at the same pixel spatial coordinates but in different energy ranges;
[0018] In the message transmission process of step S3, the energy dimension difference between nodes is introduced as one of the input parameters for message calculation.
[0019] The physical characteristic value is the linear attenuation coefficient.
[0020] The material of the sample to be tested is wood, polymer, or biological tissue.
[0021] Step S1 specifically includes:
[0022] S11: Use a multi-energy X-ray imaging system to scan the sample to be tested and obtain its raw image data in N different energy ranges, where N≥2;
[0023] S12: Preprocess the raw image data;
[0024] S13: Calculate the physical characteristic value of each pixel in each energy range based on the original image data, and use it as multi-energy X-ray image data.
[0025] Step S2 further includes: assigning weights to the first type of edge and / or the second type of edge.
[0026] Step S3 specifically includes:
[0027] S31: The graph neural network model obtains the feature representation of each node by iteratively updating the energy-space graph through multiple rounds of message passing, and thus obtains the final feature representation of each node; in each round of message passing, the feature representation of each specified node is calculated by aggregating messages from all neighboring nodes, and the messages from each neighboring node to the specified node are obtained by using the energy dimension difference between nodes and the feature representations of the specified node and neighboring nodes in the previous round of message passing as input parameters for message calculation;
[0028] S32: After multiple rounds of message passing, the graph neural network model aggregates the final feature representations of all nodes in the graph into a fixed-dimensional graph-level feature vector through a graph pooling operation, which serves as a feature representation that can characterize the material properties of the effective pixel region.
[0029] S33: The graph neural network model feeds the graph-level feature vector into a classifier and outputs the material category to which the corresponding effective pixel region belongs.
[0030] Pre-trained graph neural network models, specifically including:
[0031] S301: Acquire multi-energy X-ray image data of all known material samples in at least two energy ranges; obtain each analysis unit by performing sliding window processing on the multi-energy X-ray image data of all samples, and construct an energy-space map based on each analysis unit to generate a dataset containing multiple energy-space maps;
[0032] S302: Divide the generated dataset into a training set, a validation set, and a test set. Use the training set to train the graph neural network model, where the energy-space map is used as input and the material category of the sample is used as the label, until training is completed. At this point, a pre-trained graph neural network model is obtained. This graph neural network model is used to output the material category to which the effective pixel region belongs based on the energy-space map.
[0033] The graph neural network model has the ability to learn from small samples: when the training data accounts for only 0.1% of the total data, the classification accuracy reaches more than 85%; the physical prior knowledge encoded by the graph structure reduces the dependence on the number of training samples.
[0034] The graph neural network model adopts an adaptive learning rate scheduling strategy, which includes the ReduceLROnPlateau learning rate optimizer, which automatically reduces the learning rate when the accuracy of the validation set does not improve for 10 consecutive epochs.
[0035] On the other hand, the present invention provides a multi-energy X-ray material identification system, comprising:
[0036] The data interface module is configured to acquire multi-energy X-ray image data of the sample under test in at least two energy ranges, wherein the multi-energy X-ray image data includes the physical feature value of each pixel in each energy range;
[0037] The graph construction module is configured to select an effective pixel region from multi-energy X-ray image data as an analysis unit, and construct an energy-space graph based on this analysis unit; and
[0038] The classification decision module has a built-in graph neural network model, which is configured to process the energy-space graph using a pre-trained graph neural network model to generate a feature representation that can characterize the material properties of the effective pixel region through multiple rounds of message passing and aggregation. Then, the classifier outputs the material category to which the effective pixel region belongs.
[0039] The graph construction module is configured as follows:
[0040] Each pixel within each energy range of the effective pixel region is defined as a node of the energy-space map, and the node is assigned a physical feature value for the pixel.
[0041] A first type of edge is established in the energy-space graph to connect nodes that are spatially adjacent within the same energy range;
[0042] A second type of edge is established in the energy-space graph to connect nodes that are at the same pixel spatial coordinates but in different energy ranges.
[0043] The graph construction module is configured to use the linear decay coefficient of a pixel in the corresponding energy range as the physical feature value of the node.
[0044] The energy-space message passing neural network includes multiple message passing layers, pooling layers, and a classifier. The multiple message passing layers perform multiple rounds of message passing, iteratively updating the feature representation of each node on the energy-space graph, thus obtaining the final feature representation of each node. In each message passing layer, the feature representation of each specified node is calculated by aggregating messages from all neighboring nodes, with the messages from each neighboring node to the specified node using the energy dimension difference between nodes and the feature representations of the specified node and its neighbors from the previous round of message passing as input parameters for message calculation. The pooling layer aggregates the final feature representations of all nodes into a fixed-dimensional graph-level feature vector. The classifier determines the material category of the corresponding effective pixel region based on the graph-level feature vector.
[0045] On the other hand, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described above.
[0046] Compared with the prior art, the multi-energy X-ray material identification method of the present invention has the following beneficial effects:
[0047] 1. Significantly Improved Classification Accuracy: Thanks to the innovative energy-space graph structure and energy-sensing message passing mechanism of this invention, deep coupling of spatial and energy spectrum information is achieved, enabling the model to capture subtle features ignored by traditional methods. In a classification experiment targeting seven types of wood with highly similar physical properties, the method of this invention achieved a classification accuracy of over 99% based on a 3×3 effective pixel region, far exceeding that of traditional methods.
[0048] 2. Robust and independent of precise physical models: As a data-driven method, this invention learns discriminative features directly from data, without the need for pre-setting complex physical models of material decomposition or relying on precise base material databases. This makes it more universally applicable to materials with unknown or complex compositions and exhibits stronger robustness to system noise such as detector non-ideal effects.
[0049] 3. High data efficiency and excellent few-shot learning capability: By encoding physical prior knowledge through a graph structure, this invention reduces its dependence on the number of training samples. It maintains excellent performance even with a limited number of training samples. Experiments show that by constructing a unique energy-space graph structure, this invention enables the model to effectively utilize physical prior knowledge, achieving a classification accuracy of over 85% even with very few training samples (e.g., only 0.1%), demonstrating excellent few-shot learning capability. During model training, learning rate optimizers such as ReduceLROnPlateau can be used to further optimize the convergence process. This is of significant value in practical applications where the cost of acquiring labeled data is high.
[0050] 4. Achieve pixel-level fine recognition: This invention can perform material recognition within an extremely small effective pixel area (down to a single pixel), providing extremely high spatial resolution and making it possible to perform non-destructive characterization of material microstructure and precise location of defects. Attached Figure Description
[0051] Figure 1 This is a flowchart of a pixel-level spatially resolved multi-energy X-ray material identification method according to the present invention.
[0052] Figures 2A-2C This is a schematic diagram of a method for constructing an energy-space map from multi-energy X-ray image data blocks according to an embodiment of the present invention. The schematic diagram shows data of a 3×3 effective pixel region in three different energy layers (Energy 1, 2, 3), and illustrates how these pixels are mapped to graph nodes, and how spatial connection edges (xy direction) and energy spectrum connection edges (z direction) are established between nodes. Detailed Implementation
[0053] To more clearly illustrate the technical solution of the present invention, the accompanying drawings used in the description of the embodiments are briefly introduced below.
[0054] like Figure 1 As shown, this invention provides a pixel-level spatially resolved multi-energy X-ray material identification method, which is based on an energy-space graph neural network and includes the following steps:
[0055] Step S1: Acquire multi-energy X-ray image data of the sample under test in at least two energy ranges;
[0056] The multi-energy X-ray image data includes the physical characteristic values of each pixel in each energy range; the material of the sample to be tested is a low atomic number material, including wood, polymers, or biological tissue.
[0057] Step S1 specifically includes:
[0058] Step S11: Use a multi-energy X-ray imaging system to scan the sample to be tested and obtain its raw image data in N (N≥2) different energy ranges.
[0059] Step S12: Preprocess the original image data (e.g., flat field correction);
[0060] Step S13: Calculate the physical feature value of each pixel in each energy range based on the original image data, and use it as multi-energy X-ray image data. Preferably, the physical feature value is a linear attenuation coefficient.
[0061] Step S2: Select an effective pixel region from the multi-energy X-ray image data as an analysis unit, and construct an energy-space map based on the analysis unit;
[0062] Constructing an energy-space map specifically includes:
[0063] Step S21: As Figure 2A As shown, each pixel within each energy range of the effective pixel region is defined as a node of the energy-space map, and the node is assigned a physical feature value of the pixel.
[0064] Thus, each node is uniquely determined by its pixel spatial coordinates and energy range index, and is assigned the physical feature value in step S1.
[0065] Step S22: As Figure 2B As shown, a first type of edge (i.e., spatial edge) is established in the energy-space graph to connect nodes that are adjacent in space within the same energy range;
[0066] The first type of edge is used to encode the spatial structural continuity and texture features inside the material.
[0067] In this embodiment, spatially adjacent nodes refer to each node and the nodes that are adjacent to it in the orthogonal direction.
[0068] Step S23: As Figure 2C As shown, a second type of edge (i.e., energy spectrum edge) is established in the energy-space graph to connect nodes that are at the same pixel spatial coordinates but in different energy ranges;
[0069] The second type of edge is used to encode the unique energy spectrum response characteristics of a substance, namely the "fingerprint" information of X-ray attenuation as energy changes.
[0070] Therefore, two types of edges with different properties are established between nodes to characterize the inherent dual correlation in the data, namely, spatial structural continuity and energy spectrum response characteristics.
[0071] Optionally, step S2 further includes: assigning weights to the first type of edge and / or the second type of edge. For example, the weight of a spatial edge can be set as a constant, and the weight of an energy spectrum edge can be set based on the proximity relationship of energy ranges or other prior physical knowledge.
[0072] Step S3: Input the energy-space map into a pre-trained graph neural network (GNN) model to generate a feature representation that can characterize the material properties of the effective pixel region through multiple rounds of message passing and aggregation. Then, output the material category to which the effective pixel region belongs through a classifier.
[0073] In this embodiment, the feature representation that can characterize the material properties of the effective pixel region is preferably a graph-level feature vector with a fixed dimension.
[0074] In the message transmission process of step S3, the energy dimension difference between nodes is introduced as one of the input parameters for message calculation.
[0075] Step S3 specifically includes:
[0076] Step S31: The graph neural network model (GNN) iteratively updates the feature representation of each node on the energy-space graph by performing multiple rounds of message passing, thus obtaining the final feature representation of each node. In each round of message passing, the feature representation of each specified node is calculated by aggregating messages from all neighboring nodes, and the messages from each neighboring node to the specified node are obtained using the energy dimension difference between nodes and the feature representations of the specified node and neighboring nodes in the previous round of message passing as input parameters for message calculation. Neighboring nodes include those connected by spatial edges and those connected by energy spectrum edges.
[0077] In the l-th round of message passing, i.e., in the l-th message passing layer (l=0,...,L-1) of the graph neural network, the update process of the feature representation of a specified node vi is as follows:
[0078] Step S311: Using the energy dimension difference Δp between nodes ij The feature representations of the specified node and neighboring nodes during the previous round of message passing are used as input parameters for message calculation to obtain the messages from each neighboring node to the specified node vi.
[0079] Message m' from node vj to the specified node vi ji The formula for calculating (l+1) is:
[0080] m' ji (l+1) = M(l)([h i (l) || h j (l) || e ji || Δpij ])
[0081] Where || denotes vector concatenation, e ji Let Δp be the edge feature from neighbor node vj to specified node vi, which is a scalar; ij The energy dimension difference between nodes, i.e., the relative positional difference between a specified node vi and its neighboring node vj in the energy hierarchy, h i (l) is the feature representation of the specified node vi obtained during the previous round of message passing, h j (l) is the feature representation of the neighbor node vj updated in the previous round of message passing, M(l) is the message calculation function of the l-th message passing layer, which is a multi-layer perceptron (MLP) in this invention; i is the ordinal number of the specified node, and j is the ordinal number of the neighbor node.
[0082] The edge feature e pointing from neighbor node vj to the specified node vi ji It is obtained by calculating the index difference between a specified node vi and its neighboring node vj on the energy layer.
[0083] The edge feature e from neighbor node vj pointing to the specified node vi ji The specific calculation formula is as follows:
[0084] e ji = p i – p j ,
[0085] Where, p i p is the index (or ordinal number) of the energy layer where the specified node vi is located. j It is the index (or ordinal number) of the energy layer where the neighboring node vj is located.
[0086] Step S312: Aggregate messages from all neighboring nodes to the specified node vi to obtain the message aggregation value of the specified node vi;
[0087] The message aggregation value of the specified node vi is:
[0088] m' i (l+1) = Σ j∈N(i) m' ji (l+1),
[0089] Where N(i) represents the set of neighboring nodes of a specified node vi, i is the ordinal number of the specified node, j is the ordinal number of the neighboring nodes, and m' ji (l+1) represents the message from neighbor node vj to the specified node vi.
[0090] Step S313: Update the feature representation of the specified node obtained in the l-th round of message passing;
[0091] The characteristic representation h of the specified node during the l-th round of message passing. i (l+1) is:
[0092] h i (l+1) = SiLU(LayerNorm(l)(m' i (l+1)))
[0093] Where, m' i (l+1) is the message aggregation value of the specified node vi. LayerNorm(l) is the layer normalization operation, which is used to stabilize the training process and accelerate model convergence. SiLU is an activation function, short for Sigmoid-weighted Linear Unit, which is used to introduce nonlinearity in neural networks.
[0094] Step S32: After multiple rounds of message passing, the graph neural network model (GNN) aggregates the final feature representations of all nodes in the graph into a fixed-dimensional graph-level feature vector through a graph pooling operation (such as global summation, averaging, or maximization), which serves as a feature representation that can characterize the material properties of effective pixel regions.
[0095] Step S33: The graph neural network model feeds the graph-level feature vector into a classifier (such as a fully connected network) and outputs the material category to which the corresponding effective pixel region belongs.
[0096] Thus, the message passing mechanism enables the final feature representation of each node to simultaneously contain its local spatial context information and complete energy spectrum dependence information.
[0097] Accordingly, the graph neural network model (GNN) employs an energy-space message-passing neural network (ESMPNN); the energy-space message-passing neural network includes multiple message-passing layers, pooling layers, and a classifier. The message-passing framework is a standard component of graph neural networks, proposed by Gilmer et al. in 2017. The innovations of this invention lie in its specific adaptation and improvement for multi-energy X-ray data: 1. a graph construction strategy; 2. an energy-aware message-passing mechanism, explicitly introducing the energy dimension difference Δp during the message-passing process. ij As one of the input parameters for message computation; 3. The overall algorithm flow is specifically designed for multi-energy X-ray imaging.
[0098] The multi-layer message passing layer is used to perform multiple rounds of message passing, iteratively updating the feature representation of each node on the energy-space graph, and then obtaining the final feature representation of each node. In each message passing layer, the feature representation of each specified node is calculated by aggregating messages from all neighboring nodes, and the messages from each neighboring node to the specified node are obtained by using the energy dimension difference between nodes and the feature representations of the specified node and neighboring nodes in the previous round of message passing as input parameters for message calculation. The neighboring nodes include spatial neighboring nodes connected by spatial edges and energy spectrum neighboring nodes connected by energy spectrum edges.
[0099] The pooling layer is used to aggregate the final feature representations of all nodes into a fixed-dimensional graph-level feature vector. The graph-level feature vector is a single vector representing the entire 3×3 region. For example, the new feature of node v(x,y,2) will be the result of aggregating its own old features with information from its spatial neighbors v(x-1,y,2), v(x+1,y,2), v(x,y-1,2), v(x,y+1,2) and spectral neighbors v(x,y,1), v(x,y,3). Here, x and y are pixel coordinates, and 1, 2, and 3 represent different energy layers.
[0100] The classifier is used to determine the material category of the corresponding effective pixel region based on the graph-level feature vector.
[0101] Pre-trained graph neural network models, specifically including:
[0102] Step S301: Obtain multi-energy X-ray image data of all known material samples in at least two energy ranges; obtain each analysis unit by performing sliding window processing on the multi-energy X-ray image data of all samples, and construct an energy-space map based on each analysis unit to generate a dataset containing multiple energy-space maps.
[0103] In this embodiment, the dataset contains millions of energy-space maps.
[0104] Step S302: Divide the generated dataset into a training set, a validation set, and a test set. Use the training set to train the graph neural network model, with the energy-space map as input and the material category of the sample as the label, until training is complete. At this point, a pre-trained graph neural network model is obtained. This graph neural network model is used to output the material category to which the effective pixel region belongs based on the energy-space map.
[0105] The model was trained using the cross-entropy loss function and the AdamW optimizer until its performance on the validation set was optimal.
[0106] Furthermore, pre-training a graph neural network model may also include evaluating the pre-trained graph neural network model on an independent test set.
[0107] When the graph neural network model is pre-trained, it has the ability to learn from small samples: when the training data accounts for only 0.1% of the total data, the classification accuracy reaches more than 85%; the physical prior knowledge encoded by the graph structure reduces the dependence on the number of training samples.
[0108] When the graph neural network model is pre-trained, the graph neural network model adopts an adaptive learning rate scheduling strategy, which includes the ReduceLROnPlateau scheduler, which automatically reduces the learning rate when the accuracy of the validation set does not improve for 10 consecutive epochs.
[0109] Based on the above-mentioned multi-energy X-ray material identification method, the realized multi-energy X-ray material identification system includes:
[0110] The data interface module is configured to acquire multi-energy X-ray image data of the sample under test in at least two energy ranges;
[0111] The graph construction module is configured to select an effective pixel region from multi-energy X-ray image data as an analysis unit, and construct an energy-space graph based on the analysis unit.
[0112] The classification decision module has a built-in graph neural network model, which is configured to process the energy-space graph using a pre-trained graph neural network model to generate a feature representation that can characterize the material properties of the effective pixel region through multiple rounds of message passing and aggregation. Then, the classifier outputs the material category to which the effective pixel region belongs.
[0113] The specific details of acquiring multi-energy X-ray image data of the sample under test in at least two energy ranges are consistent with step S1 above. The graph construction module is configured to use the linear attenuation coefficient of the pixel in the corresponding energy range as the physical feature value of the node.
[0114] The graph construction module is configured as follows:
[0115] Each pixel within each energy range of the effective pixel region is defined as a node of the energy-space map, and the node is assigned a physical feature value for the pixel.
[0116] In the energy-space graph, a first type of edge (i.e., a spatial edge) is established to connect nodes that are adjacent in space within the same energy range;
[0117] A second type of edge (i.e., energy spectrum edge) is established in the energy-space graph to connect nodes that are at the same pixel spatial coordinates but in different energy ranges.
[0118] The specific structure of the graph neural network model is consistent with that described above. Specifically, the graph neural network model (GNN) employs an energy-space message passing neural network (ESMPNN); the energy-space message passing neural network includes multiple message passing layers, pooling layers, and a classifier.
[0119] The multi-layer message passing layer is used to perform multiple rounds of message passing, iteratively updating the feature representation of each node on the energy-space graph, and then obtaining the final feature representation of each node. In each message passing layer, the feature representation of each specified node is calculated by aggregating messages from all neighboring nodes, and the messages from each neighboring node to the specified node are obtained by using the energy dimension difference between nodes and the feature representations of the specified node and neighboring nodes in the previous round of message passing as input parameters for message calculation.
[0120] The pooling layer is used to aggregate the final feature representations of all nodes into a fixed-dimensional graph-level feature vector. The graph-level feature vector is a single vector representing the entire 3×3 region. For example, the new feature of node v(i,j,2) will be the result of aggregating its own old features with information from its spatial neighbors v(i-1,j,2), v(i+1,j,2), v(i,j-1,2), v(i,j+1,2) and spectral neighbors v(i,j,1), v(i,j,3).
[0121] The classifier is used to determine the material category of the corresponding effective pixel region based on the graph-level feature vector.
[0122] The present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described above.
[0123] Experimental results:
[0124] This experiment will demonstrate how to apply the method of this invention to perform high-precision classification of seven low-Z, near-density wood samples, thereby achieving classification of multiple types of wood.
[0125] Step S1: Acquire multi-energy X-ray image data of the sample under test in at least two energy ranges;
[0126] In step S11, the multi-energy X-ray imaging system employs an X-ray imaging system comprising a microfocus tungsten target X-ray source and an energy-resolution cadmium telluride (CdTe) photon counting detector. Through multiple exposures and adjustment of the energy threshold of the photon counting detector, photon count images of the sample in four consecutive energy ranges (10-15 keV, 15-20 keV, 20-25 keV, 25-30 keV) are acquired as raw image data. After flat-field correction of the raw image data in step S22, the linear attenuation coefficient value of each pixel in each energy range is calculated in step S13 according to the Beer-Lambert law, forming four-channel multi-energy image data.
[0127] Here, the scanning object can be seven types of wood samples (including Dalbergia bariensis, Dalbergia retusa, and Dalbergia cochinchinensis), which are used to pre-train the graph neural network model. In the actual measurement of the object to be tested, the scanning object is a sample of unknown material.
[0128] Step S2: Select an effective pixel region from the multi-energy X-ray image data as an analysis unit, and construct an energy-space map based on the analysis unit;
[0129] Reference Figures 2A-2C The principle shown is used to process the aforementioned multi-energy image data. Taking a 3×3 effective pixel region as an example, this effective pixel region contains a total of 9 spatial locations.
[0130] Nodes: Due to the 4 energy ranges, the 3×3 effective pixel region is constructed as a graph containing 9 × 4 = 36 nodes. Each node v(i,j,k) represents the pixel at spatial location (i,j) in the k-th energy range, and its initial feature is the linear decay coefficient value of that point.
[0131] Edges include first-type edges (i.e., spatial edges) and second-type edges (i.e., energy spectrum edges). Spatial edges (such as...) Figure 1 (Solid lines in each plane are shown): Within each energy interval (k=1,2,3,4), an undirected edge is established between each node v(i,j,k) and its orthogonal neighbor nodes (such as v(i-1,j,k), v(i+1,j,k), v(i,j-1,k), v(i,j+1,k)), with the edge weight set to 1.
[0132] Spectral edge (e.g.) Figure 1(As shown by the dashed lines connecting different planes): For each spatial location (i,j), connections are established between its four corresponding nodes v(i,j,1), v(i,j,2), v(i,j,3), and v(i,j,4) in energy order. For example, undirected edges are established between v(i,j,1) and v(i,j,2), between v(i,j,2) and v(i,j,3), and between v(i,j,3) and v(i,j,4). These edges can be assigned specific weights to reflect the correlation of the energy responses.
[0133] In the case of seven known types of wood samples, a dataset containing millions of energy-space graphs was generated based on each analysis unit by processing the images of all samples using a sliding window approach. This dataset was then used to pre-train a graph neural network model.
[0134] Step S3: Input the energy-space map into a pre-trained graph neural network (GNN) model to generate a feature representation that can characterize the material properties of the effective pixel region through multiple rounds of message passing and aggregation. Then, output the material category to which the effective pixel region belongs through a classifier.
[0135] Energy-space message passing neural network (ESMPNN) was used as the classification model.
[0136] The model takes an energy-space graph as input. Internally, it contains multiple message-passing layers. In each layer, the feature vector of each node is updated based on the feature vectors of all its neighboring nodes (spatial and spectral neighbors). For example, the new feature of node v(i,j,2) will be the result of aggregating its old features with information from v(i-1,j,2), v(i+1,j,2), v(i,j-1,2), v(i,j+1,2) (spatial neighbors) and v(i,j,1), v(i,j,3) (spectral neighbors). After L layers of message passing, the features of all nodes are fully integrated with the spatial and spectral information within their neighborhood.
[0137] Subsequently, a global max pooling layer aggregates the final feature vectors of the 36 nodes in the graph into a single graph-level feature vector representing the entire 3×3 region. Finally, a linear classifier uses this feature vector to predict the wood species of the center point of the region.
[0138] When pre-training the graph neural network model, the generated dataset containing millions of energy-space graphs is divided into training, validation, and test sets. The model is trained using the cross-entropy loss function and the AdamW optimizer until optimal performance is achieved on the validation set.
[0139] The final experimental results are shown in Tables 1-4.
[0140] Table 1: Comparison of classification accuracy (%) of different methods under single-pixel conditions
[0141]
[0142] Table 2: Comparison of classification accuracy (%) of different methods under the condition of analysis cell size = 2×2
[0143]
[0144] Table 3: Comparison of classification accuracy (%) of different methods under the condition of analysis cell size = 3×3
[0145]
[0146] Table 4: Classification accuracy (%) under different training data proportions
[0147]
[0148] Table 5: Ablation Experiment
[0149]
[0150] In Tables 1-3 above, "training set percentage 0.8" refers to the proportion of the training set in the entire dataset. In this comparative experiment, the dataset was randomly divided into training, validation, and test sets in a strict 8:1:1 ratio.
[0151] The difference between analysis unit 1, analysis unit 2, and analysis unit 3 lies in the size of the analysis unit. Analysis unit 1 refers to a 1×1 pixel region, while analysis unit 3 refers to a 3×3 pixel region. As the analysis unit size increases from 1×1 to 3×3, the classification accuracy (OA) of all methods significantly improves. This demonstrates that fusing spatial information from neighboring pixels (i.e., increasing the pixel region size) is crucial for improving recognition accuracy, which is one of the core advantages of the method of this invention.
[0152] DVSM: Deep Support Vector Machine;
[0153] GAT: Graph Attention Network;
[0154] GCN: Graph Convolutional Network;
[0155] GIN: Graph Isomorphism Network;
[0156] GraphSAGE: Graph Sampling and Aggregation Network. It is usually simply referred to as GraphSAGE.
[0157] The method of this invention (ESMPNN) assigns different weights to different types of edges when constructing the energy-space graph. In particular, the weights of the "second type edges" (energy connection edges) connecting different energy layers are set based on prior physical knowledge, and these weights encode the correlations in the energy dimension.
[0158] ESMPNN without energy layers: This is a simplified model of the method (ESMPNN) of this invention, and its purpose is to verify the effectiveness of setting multiple energy layers.
[0159] The ESMPNN(edge_attr==1) method is a simplified model of the method (ESMPNN) of this invention, designed to verify the effectiveness of assigning specific physical weights to "energy connection edges" in this invention. `edge_attr==1` means "edge attribute equals 1". In this method, the weights of all edges (including spatial and energy connection edges) are uniformly set to 1. This is equivalent to removing the physically prior weight information designed in this invention, making all connections equally important.
[0160] As shown in Tables 1-4, compared with the prior art, the multi-energy X-ray material identification method of the present invention has the following beneficial effects:
[0161] Significantly improved classification accuracy: The invention's unique energy-space graph structure explicitly encodes spatial adjacency relationships and energy spectrum dependencies into a graph topology, enabling graph neural networks to capture and decouple these two intertwined physical information in an unprecedented way. In a classification experiment targeting seven types of wood with highly similar physical properties, the method of this invention achieved a classification accuracy exceeding 99% based on a 3×3 effective pixel region, far surpassing traditional methods.
[0162] Robust and independent of precise physical models: As a data-driven method, this invention learns discriminative features directly from data, without the need for pre-defined complex physical models of material decomposition or reliance on precise base material databases. This makes it more universally applicable to materials with unknown or complex compositions and exhibits stronger robustness to system noise such as detector non-ideal effects.
[0163] High data efficiency: Because the model can efficiently utilize the structured information contained in the data, this invention maintains excellent performance even with a limited number of training samples. Experiments show that even when the amount of training data is reduced to an extremely low level, the model's classification accuracy is still significantly better than other baseline models, which is of great value in practical applications where the cost of acquiring labeled data is high.
[0164] Achieving pixel-level fine recognition: This invention can perform material recognition within an extremely small effective pixel area (as small as a single pixel), providing extremely high spatial resolution and enabling non-destructive characterization of material microstructure and precise location of defects.
[0165] In summary, the method of this invention constructs a novel energy-space graph data structure and utilizes the powerful relational reasoning capabilities of graph neural networks to achieve deep fusion of spatial and energy spectrum information, thereby significantly improving the accuracy, robustness, and data utilization efficiency of classifying low atomic number and near-density materials, while reducing the dependence on precise physical models.
[0166] Those skilled in the art will understand that the above embodiments are merely preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A pixel-level spatially resolved multi-energy X-ray material identification method, characterized in that, include: Step S1: Acquire multi-energy X-ray image data of the sample under test in at least two energy ranges, wherein the multi-energy X-ray image data includes the physical feature value of each pixel in each energy range; Step S2: Select an effective pixel region from the multi-energy X-ray image data as an analysis unit, and construct an energy-space map based on the analysis unit; Step S3: Input the energy-space graph into a pre-trained graph neural network model to generate a feature representation that can characterize the material properties of the effective pixel region through multiple rounds of message passing and aggregation. Then, output the material category to which the effective pixel region belongs through a classifier. In step S2, an energy-space map is constructed, specifically including: Step S21: Define each pixel in each energy range within the effective pixel area as a node in the energy-space map, and assign the node a physical feature value for the pixel. Step S22: Establish a first type of edge in the energy-space graph to connect nodes that are spatially adjacent within the same energy range; Step S23: Establish a second type of edge in the energy-space graph to connect nodes that are at the same pixel spatial coordinates but in different energy ranges; In the message transmission process of step S3, the energy dimension difference between nodes is introduced as one of the input parameters for message calculation.
2. The multi-energy X-ray material identification method according to claim 1, characterized in that, The physical characteristic value is the linear attenuation coefficient.
3. The multi-energy X-ray material identification method according to claim 1, characterized in that, The material of the sample to be tested is wood, polymer, or biological tissue.
4. The multi-energy X-ray material identification method according to claim 2, characterized in that, Step S1 specifically includes: Step S11: Use a multi-energy X-ray imaging system to scan the sample to be tested and obtain its raw image data in N different energy ranges, where N≥2; Step S12: Preprocess the raw image data; Step S13: Calculate the physical feature value of each pixel in each energy range based on the original image data, and use it as multi-energy X-ray image data.
5. The multi-energy X-ray material identification method according to claim 1, characterized in that, Step S2 further includes: assigning weights to the first type of edge and / or the second type of edge.
6. The multi-energy X-ray material identification method according to claim 1, characterized in that, Step S3 specifically includes: Step S31: The graph neural network model obtains the feature representation of each node by iteratively updating the energy-space graph through multiple rounds of message passing, and thus obtains the final feature representation of each node; in each round of message passing, the feature representation of each specified node is calculated by aggregating messages from all neighboring nodes, and the messages from each neighboring node to the specified node are obtained by using the energy dimension difference between nodes and the feature representations of the specified node and neighboring nodes in the previous round of message passing as input parameters for message calculation; Step S32: After multiple rounds of message passing, the graph neural network model aggregates the final feature representations of all nodes in the graph into a fixed-dimensional graph-level feature vector through a graph pooling operation, which serves as a feature representation that can characterize the material properties of effective pixel regions. Step S33: The graph neural network model feeds the graph-level feature vector into a classifier and outputs the material category to which the corresponding effective pixel region belongs.
7. The multi-energy X-ray material identification method according to claim 1, characterized in that, Pre-trained graph neural network models, specifically including: Step S301: Obtain multi-energy X-ray image data of all known material samples in at least two energy ranges; obtain each analysis unit by performing sliding window processing on the multi-energy X-ray image data of all samples, and construct an energy-space map based on each analysis unit to generate a dataset containing multiple energy-space maps; Step S302: Divide the generated dataset into a training set, a validation set, and a test set. Use the training set to train the graph neural network model, where the energy-space map is used as input and the material category of the sample is used as the label, until training is completed. At this point, a pre-trained graph neural network model is obtained. This graph neural network model is used to output the material category to which the effective pixel region belongs based on the energy-space map.
8. The multi-energy X-ray material method according to claim 1, characterized in that, The graph neural network model has the ability to learn from small samples: when the training data accounts for only 0.1% of the total data, the classification accuracy reaches more than 85%; the physical prior knowledge encoded by the graph structure reduces the dependence on the number of training samples.
9. The multi-energy X-ray material method according to claim 1, characterized in that, The graph neural network model adopts an adaptive learning rate scheduling strategy, which includes the ReduceLROnPlateau learning rate optimizer, which automatically reduces the learning rate when the accuracy of the validation set does not improve for 10 consecutive epochs.
10. A pixel-level spatially resolved multi-energy X-ray material identification system, characterized in that, include: The data interface module is configured to acquire multi-energy X-ray image data of the sample under test in at least two energy ranges, wherein the multi-energy X-ray image data includes the physical feature value of each pixel in each energy range; The graph construction module is configured to select an effective pixel region from multi-energy X-ray image data as an analysis unit, and construct an energy-space graph based on the analysis unit. and The classification decision module has a built-in graph neural network model, which is configured to process the energy-space graph using a pre-trained graph neural network model to generate a feature representation that can characterize the material properties of the effective pixel region through multiple rounds of message passing and aggregation. Then, the classifier outputs the material category to which the effective pixel region belongs. The graph construction module is configured as follows: Each pixel within each energy range of the effective pixel region is defined as a node of the energy-space map, and the node is assigned a physical feature value for the pixel. A first type of edge is established in the energy-space graph to connect nodes that are spatially adjacent within the same energy range; A second type of edge is established in the energy-space graph to connect nodes that are at the same pixel spatial coordinates but in different energy ranges.
11. The multi-energy X-ray material identification system according to claim 10, characterized in that, The graph construction module is configured to use the linear decay coefficient of a pixel in the corresponding energy range as the physical feature value of the node.
12. The multi-energy X-ray material identification system according to claim 10, characterized in that, The energy-space message passing neural network includes multiple message passing layers, pooling layers, and a classifier; The multi-layer message passing layer is used to perform multiple rounds of message passing, iteratively updating the feature representation of each node on the energy-space graph, and then obtaining the final feature representation of each node; In each message passing layer, the feature representation of each specified node is calculated by aggregating messages from all neighboring nodes. The messages from each neighboring node to the specified node are obtained by using the energy dimension difference between nodes and the feature representations of the specified node and its neighbors from the previous message passing round as input parameters for message calculation. The pooling layer is used to aggregate the final feature representations of all nodes into a fixed-dimensional graph-level feature vector. The classifier is used to obtain the material category to which the corresponding effective pixel region belongs based on the graph-level feature vector.
13. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the method described in any one of claims 1-9.