Gamma ray imaging method based on self-attention mechanism
The gamma-ray imaging method based on the self-attention mechanism solves the imaging shortcomings of traditional techniques in a wide energy range, realizes the generation and accurate positioning of high-resolution spatial distribution images of radioactive sources, and meets the imaging needs of various unknown radioactive materials.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-04
- Publication Date
- 2026-04-07
AI Technical Summary
Traditional gamma-ray imaging technology cannot achieve high-precision, non-contact, real-time radioactive source localization over a wide energy range. Especially in nuclear facilities where the nuclide types, energy ranges, and distribution areas of unknown radioactive materials are uncertain, a single imaging technology cannot cover continuous high-sensitivity imaging from 50keV to 3000keV.
A gamma-ray imaging method based on a self-attention mechanism is adopted. By training an imaging network, the transport process and energy deposition events of gamma rays in the imaging detector are simulated. High-resolution images of the spatial distribution of radioactive sources are generated by using feature encoding, cascaded self-attention mechanism and feature reconstruction module.
It achieves high-resolution spatial distribution image reconstruction of radioactive sources over a wide energy range, improves adaptability and generalization to unseen data, accurately reconstructs complex gamma-ray interaction data, and enhances the robustness of the imaging network and image quality.
Smart Images

Figure CN121806090A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of nuclear radiation detection and imaging, and in particular to a gamma-ray imaging method based on a self-attention mechanism. Background Technology
[0002] Radioactive material imaging technology has significant application value in fields such as nuclear medicine diagnosis, environmental radiation safety and monitoring, nuclear safety inspection, nuclear waste management, nuclear facility decommissioning and decontamination, nuclear emergency response, industrial flaw detection, and nuclear fuel cycle support. With the increasing demand for public safety and radiation protection, the need for high-precision, non-contact, real-time imaging technology for locating radioactive sources is becoming increasingly urgent. Traditional gamma-ray imaging techniques mainly employ coded aperture imaging and Compton imaging, based on the photoelectric effect and Compton scattering principle, respectively. Due to the different interaction cross-sections, each imaging method has its optimal imaging energy range. Coded aperture imaging is suitable for imaging low-energy regions below approximately 1000 keV, but its imaging resolution is poor for high-energy regions. For medium- and high-energy gamma rays, the Compton imaging method, with its mechanical collimation-free design, allows the detector to receive photons that would otherwise be blocked by the collimator; however, the Compton imaging method only has high imaging efficiency for medium- and high-energy regions above approximately 250 keV. However, in nuclear facilities, the types of radionuclides, energy ranges, and distribution areas of unknown radioactive materials are uncertain. For this application scenario, gamma-ray imaging should have characteristics such as wide energy range, wide field of view, and high efficiency. A single gamma-ray imaging technique cannot cover the wide energy range of 50keV to 3000keV for continuous high-sensitivity imaging. Therefore, multiple imaging methods are generally combined to improve the overall imaging performance. Summary of the Invention The purpose of this application is to provide a gamma-ray imaging method based on a self-attention mechanism, which can obtain high-resolution images of the spatial distribution of radiation sources, with short imaging time and a wide imaging energy range. Furthermore, its application in computer hardware can improve the operating efficiency of the computer hardware.
[0003] To achieve the above objectives, this application provides the following solution: Firstly, this application provides a gamma-ray imaging method based on a self-attention mechanism, comprising: Acquire gamma-ray interaction data; The gamma-ray interaction data is input into a trained imaging network to generate a spatial distribution image of the radiation source; the imaging network includes a feature encoding module, a cascaded self-attention mechanism module, a stitching module, and a feature reconstruction module connected in sequence; The training process of the imaging network includes: establishing an imaging detector simulation model; setting up radioactive sources with different spatial distributions in space; using the Monte Carlo method to simulate the transport process and energy deposition events of gamma rays emitted by the radioactive sources in the imaging detector simulation model; obtaining gamma-ray interaction data corresponding to the spatial distribution of each radioactive source; using the gamma-ray interaction data corresponding to the spatial distribution of each radioactive source as the training dataset; using the spatial distribution as the label; training the imaging network; and obtaining the trained imaging network.
[0004] According to the specific embodiments provided in this application, this application has the following technical effects: This application provides a gamma-ray imaging method based on a self-attention mechanism. By using the Monte Carlo method to simulate the transport process and energy deposition events of gamma rays in an imaging detector simulation model, it more accurately simulates the actual physical process of gamma-ray imaging, enabling the trained imaging network to more accurately reconstruct the spatial distribution image of the radiation source. Furthermore, since the training dataset includes radiation sources with different spatial distributions, it improves the imaging network's adaptability and generalization ability to unseen data. In addition, the feature encoding module and feature reconstruction module enable the imaging network to effectively process high-dimensional gamma-ray interaction data and transform it into a high-quality image of the spatial distribution of the radiation source. The cascaded self-attention mechanism module allows the imaging network to focus on the most important parts of the input data, enabling it to handle complex gamma-ray interaction data and effectively capture key features in the gamma-ray interaction data, thereby improving the quality of the generated spatial distribution image of the radiation source. Attached Figure Description
[0005] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0006] Figure 1 This is a schematic flowchart of a gamma-ray imaging method based on a self-attention mechanism in one embodiment of this application; Figure 2 An imaging network structure diagram of a gamma-ray imaging method based on a self-attention mechanism provided in an embodiment of this application; Figure 3 for Figure 2 The feature reconstruction module structure diagram in the imaging network structure diagram; Figure 4 Spatial distribution images of different energies and numbers of radioactive sources; Figure 5A spatial distribution image of the number of different gamma-ray interaction events for a single 662 keV radiation source; Figure 6 A spatial distribution image of real gamma-ray interaction data; Figure 7 A schematic diagram of the functional modules of a gamma-ray imaging device based on a self-attention mechanism provided in an embodiment of this application; Figure 8 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation
[0007] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0008] To make the objectives, features and advantages of this application more apparent and understandable, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0009] In one exemplary embodiment, such as Figure 1 As shown, a gamma-ray imaging method based on a self-attention mechanism is provided. This method is executed by a computer device, specifically by a terminal or server alone, or by both a terminal and a server. In this embodiment, the method includes steps 101 to 102. Wherein: Step 101: Obtain gamma-ray interaction data.
[0010] Step 102: Input the gamma-ray interaction data into the trained imaging network to generate a spatial distribution image of the radiation source; the imaging network includes a feature encoding module, a cascaded self-attention mechanism module, a stitching module, and a feature reconstruction module connected in sequence, such as... Figure 2 As shown.
[0011] The training process of the imaging network includes: establishing an imaging detector simulation model; setting up radioactive sources with different spatial distributions in space; using the Monte Carlo method to simulate the transport process and energy deposition events of gamma rays emitted by the radioactive sources in the imaging detector simulation model; obtaining gamma-ray interaction data corresponding to the spatial distribution of each radioactive source; using the gamma-ray interaction data corresponding to the spatial distribution of each radioactive source as the training dataset; using the spatial distribution as the label; training the imaging network; and obtaining the trained imaging network.
[0012] This application uses Geant4 software to model an arbitrary gamma-ray imaging detector structure and enables the tracking of secondary photons using an optical physics list. Simultaneously, it sets multi-medium surface optical parameters to cover the entire process of refraction, reflection, absorption, and photoelectric conversion, obtaining gamma-ray interaction data. By implementing steps 101 to 102 above, this application obtains a high-resolution image of the spatial distribution of the radiation source, with short imaging time and a wide imaging energy range. The imaging detector simulation model is a scintillator detector simulation model, a semiconductor detector simulation model, or a gas detector simulation model. The structure of the imaging detector simulation model is a multi-layered two-dimensional positional imaging detector, a three-dimensional positional imaging detector, or a gamma-ray imaging detector with an irregular structure.
[0013] In another exemplary embodiment of this application, the gamma-ray interaction data includes the coordinates of the gamma-ray interaction event and the deposition energy of the gamma-ray interaction event. The coordinates of the gamma-ray interaction event are the coordinates of the point of interaction (x, y, z); the deposition energy of the gamma-ray interaction event is the deposition energy e at the point of interaction.
[0014] The gamma-ray interaction data includes single-point interaction data, two-point interaction data, and multi-point interaction data. The single-point interaction data includes the interaction point coordinates (x, y, z) and the deposition energy e. The two-point interaction data includes the first interaction point coordinates (x1, y1, z1), the first interaction point deposition energy e1, the second interaction point coordinates (x2, y2, z2), and the second interaction point deposition energy e2. The coordinates of the gamma-ray interaction event include the first interaction point coordinates (x1, y1, z1) and the second interaction point coordinates (x2, y2, z2); the deposition energy of the gamma-ray interaction event includes the first interaction point deposition energy e1 and the second interaction point deposition energy e2. The multi-point interaction data includes n interaction point coordinates (x1, y1, z1), (x2, y2, z2), ..., (x... n y n , z n And the energy deposited at n action points e1, e2, ..., e n ; The coordinates of the gamma-ray interaction event include the coordinates of n points of action (x1, y1, z1), (x2, y2, z2), ..., (x... n y n , z n The deposition energy of the gamma-ray interaction event includes the deposition energies of n interaction points e1, e2, ..., e n .
[0015] Step 102, during the training process of the imaging network: the gamma-ray interaction data corresponding to the spatial distribution of each radiation source is used as the training dataset, specifically including: A three-dimensional voxel coordinate system is established based on the physical dimensions of the imaging detector simulation model.
[0016] The simulation model of the imaging detector is divided into multiple voxel grids, and the spatial range and center coordinates of each voxel grid are determined.
[0017] The voxel grid corresponding to a gamma-ray interaction event is determined based on the spatial extent of each voxel grid and the coordinates of the gamma-ray interaction event.
[0018] The coordinates of the gamma-ray interaction event are replaced with the center coordinates of the voxel grid corresponding to the gamma-ray interaction event to obtain the coordinates of the preprocessed gamma-ray interaction event.
[0019] The deposition energy of the gamma-ray interaction event is obtained by superimposing Gaussian random perturbation values on the deposition energy of the gamma-ray interaction event.
[0020] Preprocessed gamma-ray interaction data are obtained based on the coordinates and deposition energies of the preprocessed gamma-ray interaction events.
[0021] The preprocessed gamma-ray interaction data corresponding to the spatial distribution of each radiation source were used as the training dataset.
[0022] Specifically, the precise three-dimensional spatial coordinates of the gamma-ray interaction event are voxelized or mapped onto corresponding cells of a predefined three-dimensional discrete digital grid that matches the physical structure of the actual detector. Simultaneously, the deposited energy in the gamma-ray interaction event is... This energy is accumulated into the energy count of that mapping cell. Subsequently, to accurately simulate the energy resolution limitations of real imaging detectors caused by factors such as electronic noise, a Gaussian random perturbation value conforming to its physical characteristics is superimposed on the accumulated raw energy value in each grid cell. The mean of this Gaussian random perturbation value is zero, and the standard deviation of the Gaussian random perturbation value is... It is a function of energy, that is This was done to simulate the energy broadening effect. Ultimately, a simulated energy dataset with statistical broadening characteristics was generated, which highly matches real experimental measurements. .
[0023] In another exemplary embodiment of this application, such as Figure 2As shown, the cascaded self-attention mechanism module includes a first self-attention mechanism module and a second self-attention mechanism module; step 102 specifically includes the following steps 201 to 205.
[0024] Step 201: The gamma-ray interaction data is input into the feature encoding module to obtain a high-dimensional feature vector sequence; wherein, the feature encoding module is a one-dimensional convolutional layer. Unlike related technologies that use 2D convolution to spatially model image data, this application directly performs convolutional encoding on the preprocessed gamma-ray interaction data, including the coordinates of gamma-ray interaction events and the deposition energy of the gamma-ray interaction events. By sliding the convolution kernel along the time series dimension of the gamma-ray interaction events, it maps them to a high-dimensional feature space, achieving end-to-end semantic transformation from gamma-ray interaction events to imaging.
[0025] Step 202: The high-dimensional feature vector sequence is input into the first self-attention mechanism module to obtain the first intermediate feature sequence. The first self-attention submodule models the relationships between the features within the sequence to generate the first intermediate feature sequence.
[0026] Step 203: The first intermediate feature sequence is input into the second self-attention mechanism module to obtain the second intermediate feature sequence. The second self-attention submodule, based on the aforementioned first intermediate feature sequence, performs deeper relationship modeling to generate the second intermediate feature sequence. The deep logical relationships of the overall gamma-ray interaction event time series are integrated to generate a feature representation with high-level semantics.
[0027] Step 204: Input the first intermediate feature sequence and the second intermediate feature sequence into the splicing module to obtain the final feature sequence.
[0028] Step 205: Input the final feature sequence into the feature reconstruction module to generate a spatial distribution image of the radioactive source.
[0029] In another exemplary embodiment of this application, such as Figure 2 As shown, in steps 202 and 203, the calculation process of the first self-attention mechanism module and the second self-attention mechanism module specifically includes the following steps 301 to 305.
[0030] Step 301: The input features are used to generate a query matrix through a first convolutional layer, a key matrix through a second convolutional layer, and a value matrix through a third convolutional layer; wherein, the input features are the high-dimensional feature vector sequence or the first intermediate feature sequence; the weights of the first convolutional layer and the weights of the second convolutional layer are the same.
[0031] Step 302: Based on the query matrix and the key matrix, the attention score matrix is obtained using the formula E=QK; where E is the attention score matrix, Q is the query matrix, and K is the key matrix.
[0032] Step 303, using the formula The attention score matrix is row-normalized to obtain the row attention matrix: where A row Here, is the row attention matrix, softmax is the normalized exponential function, and dim = 1 indicates that the softmax is calculated along the last dimension.
[0033] Step 304, using the formula The column normalization of the row attention matrix yields the final attention matrix; where, A final Let S be the final attention matrix, where a is the row index, b is the column index, and S is the column index. b This represents the sum of the elements in column b. To prevent local minima caused by division by zero, A is the total number of rows in the row attention matrix.
[0034] Step 305: Based on the value matrix and the final attention matrix, use the formula... The output features are obtained; where V is the value matrix and O is the output feature; wherein the output feature is the first intermediate feature sequence or the second intermediate feature sequence.
[0035] In another exemplary embodiment of this application, such as Figure 3 As shown, the feature reconstruction module includes a linear layer, a max-pooling layer, and a decoder submodule connected in sequence; the decoder submodule includes cascaded upsampling units; the upsampling unit includes a convolutional layer, a batch normalization layer, an activation layer, and an upsampling layer connected in sequence. This application includes Q upsampling units, where Q=4. Step 205 specifically includes steps 401 to 402.
[0036] Step 401: The final feature sequence is input into the linear layer and the max-pooling layer to obtain a pooled feature vector. Specifically, the max-pooling layer extracts a feature that can represent the entire time series of complex gamma-ray interaction events, identifying the most critical and representative features in the entire interaction. This achieves data dimensionality reduction and aggregates variable-length sequence information into a highly condensed, fixed-length global feature vector. The global feature vector is globally invariant to the time series of gamma-ray interaction events, meaning that changes in the order of input events will not affect the final imaging result.
[0037] Step 402: The pooled feature vector is input into the decoder to generate a spatial distribution image of the radioactive source. Specifically, the decoder gradually restores the spatial resolution through multi-level upsampling and feature decoding operations, and finally reconstructs a high-precision two-dimensional image representing the spatial distribution of the radioactive source, realizing an end-to-end mapping from abstract features to physical spatial coordinates.
[0038] In an exemplary embodiment, the training process of the imaging network further includes optimizing the trained imaging network using the following formula: .
[0039] .
[0040] .
[0041] in, The total loss value of the trained imaging network. The mean squared error loss value of the trained imaging network is used to measure the pixel-level difference between the spatial distribution image of the radioactive source generated by the trained imaging network and the real spatial distribution image of the radioactive source. The relative entropy loss value of the trained imaging network is used to measure the statistical difference between the spatial distribution image of the radioactive source generated by the trained imaging network and the real spatial distribution image of the radioactive source. These are the weighting coefficients for relative entropy loss. This is a true spatial distribution image of the radioactive sources. ; The spatial distribution image of the radiation source generated by the trained imaging network. ; This represents the number of pixels in the spatial distribution image of the radiation source. The height of the spatial distribution image of the radiation source. The width of the image representing the spatial distribution of the radiation sources is used to ensure that the imaging network can reproduce the spatial distribution of the radiation sources as accurately as possible at the pixel level. This is the index of pixels in the image representing the spatial distribution of the radiation source. The first image shows the true spatial distribution of radioactive sources. pixel value, The first image generated by the trained imaging network showing the spatial distribution of radioactive sources. pixel value, The first in the true spatial distribution image of radioactive sources The intensity value at each pixel location, i.e., the discrete probability distribution formed by each pixel in the spatial distribution image of the radiation source; The first image of the spatial distribution of radioactive sources generated by the trained imaging network. Intensity value at each pixel location The intensity values in the spatial distribution image of the radiation source generated by the trained imaging network. The intensity values represent the actual spatial distribution of the radioactive source.
[0042] During the training process, gamma-ray interaction data and the corresponding spatial distribution of each radiation source are used as inputs. The AdamW optimization algorithm is used for training, and the network parameters after training are saved to obtain the trained imaging network.
[0043] The spatial distribution of the radioactive sources was obtained through simulation using Geant4 software. The spatial distribution was represented by a 180×180 two-dimensional matrix, where the locations of the radioactive sources were marked as 1, and all other locations were marked as 0. To simulate the spatial resolution and inherent ambiguity effects of a real detector system, the ground truth matrix was further processed with Gaussian blur, and its full width at half maximum (FWHM) was set to 4.
[0044] The training objective of imaging networks is to find an optimal set of intrinsic model parameters. (Including network weights W and biases b), minimize the total loss value. This optimization process is implemented using the backpropagation algorithm, and the specific steps are as follows: Gradient calculation: Calculate the total loss value in each training iteration. Imaging network parameters gradient According to the chain rule, this gradient is a weighted sum of the mean squared error loss and the relative entropy loss.
[0045] Parameter Update: After calculating the gradient, the AdamW optimizer is used to update the imaging network parameters. Updates are performed. By iteratively executing forward propagation, loss calculation, gradient calculation, and parameter updates on the training dataset, the imaging network parameters θ are gradually adjusted to adjust the total loss value. It tends to converge to a minimum value.
[0046] In one exemplary embodiment, this application evaluates the imaging network, such as Figure 4 As shown, focus on the spatial distribution images of different energies and the number of radioactive sources; such as Figure 5 As shown, this image depicts the spatial distribution of the number of different gamma-ray interaction events focusing on a single 662 keV radioactive source; Figure 6As shown, the spatial distribution image of the radiation source is presented based on real gamma-ray interaction data. Here, Ground Truth represents the true spatial distribution of the radiation source, SBP represents the Simple Back-Projection method, MLEM represents the Maximum Likelihood Expectation Maximization method, and Proposed Network represents the method of this application. For a single 662 keV Cs-137 radiation source, both the traditional image reconstruction methods Simple Back-Projection (SBP) and Maximum Likelihood Expectation Maximization (MLEM) were applied for imaging. Experimental results show that both methods produce significant artifacts in the spatial distribution images of the radiation source, especially in regions far from the radiation source. While the MLEM method, due to its multiple iterative optimizations, produces a clearer image to some extent with SBP, its edges remain blurred, and residual noise is relatively high.
[0047] When processing a single Co-60 source at 1173 keV, the number of effective Compton events available for reconstructing the spatial distribution image of the source is significantly reduced because high-energy photons are more difficult to capture effectively by the detector. Under these low-event conditions, the imaging performance of traditional methods deteriorates further, making it difficult to accurately reconstruct the spatial distribution of the source. However, the imaging network proposed in this application can stably predict the location of the source even under low gamma-ray interaction events, producing a clear spatial distribution image with fewer artifacts. This result demonstrates that this application overcomes the dependence of traditional imaging methods on a large number of Compton events, exhibiting greater robustness and application potential.
[0048] Furthermore, in mixed dual-source scenarios, when the two sources are close together and the number of interaction events they collect differs significantly, traditional methods struggle to distinguish them, often misidentifying them as a single, extended dual-source region. This application, however, can clearly distinguish the spatial distribution of two different energy sources, successfully achieving accurate localization and separation of the two sources. By introducing a self-attention mechanism, the imaging network in this application can effectively capture the global correlation between Compton events, thereby achieving higher-quality image reconstruction.
[0049] Based on the same inventive concept, such as Figure 7 As shown, this application also provides a gamma-ray imaging device based on a self-attention mechanism. The device includes: The data acquisition module 701 is used to acquire gamma-ray interaction data.
[0050] The imaging module 702 is used to input the gamma-ray interaction data into the trained imaging network to generate a spatial distribution image of the radiation source; the imaging network includes a feature encoding module, a cascaded self-attention mechanism module and a feature reconstruction module connected in sequence.
[0051] The training process of the imaging network includes: establishing an imaging detector simulation model; setting up radioactive sources with different spatial distributions in space; using the Monte Carlo method to simulate the transport process and energy deposition events of gamma rays emitted by the radioactive sources in the imaging detector simulation model; obtaining gamma-ray interaction data corresponding to the spatial distribution of each radioactive source; using the gamma-ray interaction data corresponding to the spatial distribution of each radioactive source as the training dataset; using the spatial distribution as the label; training the imaging network; and obtaining the trained imaging network.
[0052] The imaging network of this application obtains the correlation between various gamma-ray interaction events, performs end-to-end processing on the gamma-ray interaction events, and directly reconstructs a high-resolution image of the spatial distribution of radiation sources, thus obtaining clear imaging results.
[0053] In one exemplary embodiment, a computer device is provided, which may be a server or a terminal, and its internal structure diagram may be as follows. Figure 8 As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs stored in the non-volatile storage media. The database stores gamma-ray interaction data. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network. When the computer program is executed by the processor, it implements a gamma-ray imaging method based on a self-attention mechanism.
[0054] Those skilled in the art will understand that Figure 8The structures shown are merely block diagrams of some structures related to the present application and do not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than shown in the figures, or combine certain components, or have different component arrangements. In an exemplary embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.
[0055] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0056] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0057] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. Furthermore, those skilled in the art will recognize that, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A gamma-ray imaging method based on a self-attention mechanism, characterized in that, The method includes: Acquire gamma-ray interaction data; The gamma-ray interaction data is input into a trained imaging network to generate a spatial distribution image of the radiation source; the imaging network includes a feature encoding module, a cascaded self-attention mechanism module, a stitching module, and a feature reconstruction module connected in sequence; The training process of the imaging network includes: establishing an imaging detector simulation model; setting up radioactive sources with different spatial distributions in space; using the Monte Carlo method to simulate the transport process and energy deposition events of gamma rays emitted by the radioactive sources in the imaging detector simulation model; obtaining gamma-ray interaction data corresponding to the spatial distribution of each radioactive source; using the gamma-ray interaction data corresponding to the spatial distribution of each radioactive source as the training dataset; using the spatial distribution as the label; training the imaging network; and obtaining the trained imaging network.
2. The gamma-ray imaging method based on self-attention mechanism according to claim 1, characterized in that, The cascaded self-attention mechanism module includes a first self-attention mechanism module and a second self-attention mechanism module; The gamma-ray interaction data is input into a trained imaging network to generate a spatial distribution image of the radiation source, specifically including: The gamma-ray interaction data is input into the feature encoding module to obtain a high-dimensional feature vector sequence; wherein, the feature encoding module is a one-dimensional convolutional layer; The high-dimensional feature vector sequence is input into the first self-attention mechanism module to obtain the first intermediate feature sequence; The first intermediate feature sequence is input into the second self-attention mechanism module to obtain the second intermediate feature sequence; The first intermediate feature sequence and the second intermediate feature sequence are input into the splicing module to obtain the final feature sequence; The final feature sequence is input into the feature reconstruction module to generate a spatial distribution image of the radioactive source.
3. The gamma-ray imaging method based on self-attention mechanism according to claim 1, characterized in that, The calculation process of the first self-attention mechanism module and the second self-attention mechanism module specifically includes: The input features are used to generate a query matrix through a first convolutional layer, a key matrix through a second convolutional layer, and a value matrix through a third convolutional layer; wherein the input features are the high-dimensional feature vector sequence or the first intermediate feature sequence; the weights of the first convolutional layer and the weights of the second convolutional layer are the same; Based on the query matrix and the key matrix, the attention score matrix is obtained using the formula E=QK; where E is the attention score matrix, Q is the query matrix, and K is the key matrix. Using formula The attention score matrix is row-normalized to obtain the row attention matrix: where A row Here, represents the row attention matrix, and softmax is the normalized exponential function. Using formula The column normalization of the row attention matrix yields the final attention matrix; where, A final Let S be the final attention matrix, where a is the row index, b is the column index, and S is the column index. b This represents the sum of the elements in column b. To prevent local minima caused by division by zero, A is the total number of rows in the row attention matrix; Based on the value matrix and the final attention matrix, the formula is used. The output features are obtained; where V is the value matrix and O is the output feature; wherein the output feature is the first intermediate feature sequence or the second intermediate feature sequence.
4. The gamma-ray imaging method based on self-attention mechanism according to claim 1, characterized in that, The feature reconstruction module includes a linear layer, a max pooling layer, and a decoder submodule connected in sequence; the decoder submodule includes cascaded upsampling units; the upsampling unit includes a convolutional layer, a batch normalization layer, an activation layer, and an upsampling layer connected in sequence.
5. The gamma-ray imaging method based on self-attention mechanism according to claim 1, characterized in that, The gamma-ray interaction data includes the coordinates of the gamma-ray interaction events and the deposition energy of the gamma-ray interaction events. The training dataset uses gamma-ray interaction data corresponding to the spatial distribution of each radiation source, specifically including: A three-dimensional voxel coordinate system is established based on the physical dimensions of the imaging detector simulation model; The simulation model of the imaging detector is divided into multiple voxel grids, and the spatial range and center coordinates of each voxel grid are determined. Based on the spatial extent of each voxel grid and the coordinates of the gamma-ray interaction event, determine the voxel grid corresponding to the gamma-ray interaction event; Replace the coordinates of the gamma-ray interaction event with the center coordinates of the voxel mesh corresponding to the gamma-ray interaction event to obtain the coordinates of the preprocessed gamma-ray interaction event. The deposition energy of the gamma-ray interaction event is obtained by superimposing the Gaussian random perturbation value on the deposition energy of the gamma-ray interaction event; Based on the coordinates and deposition energy of the preprocessed gamma-ray interaction events, the preprocessed gamma-ray interaction data are obtained. The preprocessed gamma-ray interaction data corresponding to the spatial distribution of each radiation source were used as the training dataset.
6. The gamma-ray imaging method based on self-attention mechanism according to claim 1, characterized in that, Also includes: The trained imaging network is optimized using the following formula: ; ; ; in, The total loss value of the trained imaging network. The mean squared error loss value of the trained imaging network. The relative entropy loss value of the trained imaging network. These are the weighting coefficients for relative entropy loss. This is a true spatial distribution image of the radioactive sources. The spatial distribution image of the radiation source generated by the trained imaging network. This represents the number of pixels in the spatial distribution image of the radiation source. This is the index of pixels in the image representing the spatial distribution of the radiation source. The first image shows the true spatial distribution of radioactive sources. pixel value, The first image generated by the trained imaging network showing the spatial distribution of radioactive sources. pixel value, The first in the true spatial distribution image of radioactive sources Intensity value at each pixel location The first image of the spatial distribution of radioactive sources generated by the trained imaging network. Intensity value at each pixel location The intensity values in the spatial distribution image of the radiation source generated by the trained imaging network. The intensity values represent the actual spatial distribution of the radioactive source.
7. The gamma-ray imaging method based on self-attention mechanism according to claim 1, characterized in that, The imaging detector simulation model is a scintillator detector simulation model, a semiconductor detector simulation model, or a gas detector simulation model.
8. The gamma-ray imaging method based on self-attention mechanism according to claim 1, characterized in that, The simulation model of the imaging detector has a structure of multi-layered two-dimensional position imaging detector, three-dimensional position imaging detector, or gamma-ray imaging detector with irregular structure.