GPU-Accelerated Monte Carlo Simulation Method, Device, Equipment and Medium for Human Body Model
By establishing a photonic electronic physical model on the GPU, the GPU accelerated photoelectric coupling transport Monka program is solved, and the calculation accuracy problem caused by the approximate processing of the GPU Monka program in the prior art is solved, and efficient acceleration simulation of the human face element model is realized, ensuring the accuracy and acceleration effect of the calculation results.
Patent Information
- Application Number
- CN202410454213.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-16
- Publication Date
- 2025-05-27
- Estimated Expiration
- 2044-04-16
AI Technical Summary
Existing GPU Moncache programs often use approximation processing in physical processes, which affects the calculation accuracy, and there is no GPU-accelerated Moncache program for human facet models.
By establishing a complete photonic electronic physical model, the GPU accelerated photoelectric coupled transport Monka program is shortened, and the calculation time of the human voxel model and the perpendicular model in Monte Carlo simulation is performed, and the performance optimization of geometric transport data processing is carried out to realize the transport of particles in the voxel model and the tetrahedral deformer model.
On the premise of ensuring the accurate simulation calculation results, a good acceleration effect was achieved, which solved the calculation accuracy problem caused by the approximate processing of existing GPU Moncache programs in physical processes, and realized the GPU-accelerated Moncache simulation of human face element models.
Smart Images

Figure CN118446877B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of Monte Carlo calculation technology, and in particular, to a GPU-accelerated Monte Carlo simulation method, device, equipment and medium for a human body model. Background Art
[0002] The voxel model is often limited by calculation efficiency in radiation dose calculation, especially the inapplicability of the NURBS (Non-Uniform Rational B-Spline) type in the Monte Carlo program and the low calculation efficiency of the PM (Polygonal Mesh) type. Although the proposed principle of accelerating the calculation of the voxel model based on tetrahedral meshing provides a solution to this problem and significantly improves the calculation speed, with the continuous progress of hardware technology, the traditional CPU (Central Processing Unit) acceleration method has gradually reached its performance limit. The GPU (Graphics Processing Unit), with its powerful floating-point operation ability and memory bandwidth, has become a new driving force for promoting the improvement of radiation dose calculation performance.
[0003] However, although there are currently some Monte Carlo programs based on GPU acceleration, they often perform approximate processing on physical processes, affecting the calculation accuracy. More importantly, there has not yet been a GPU-accelerated program based on the voxel model, which limits the further application of the GPU in the field of radiation dose calculation. Summary of the Invention
[0004] The present application provides a GPU-accelerated Monte Carlo simulation method, device, equipment and medium for a human body model to solve problems such as that existing GPU Monte Carlo programs often use approximate processing in physical processes, affecting the calculation accuracy, and there is no GPU-accelerated Monte Carlo program for the human voxel model.
[0005] The first aspect embodiment of the present application provides a GPU-accelerated Monte Carlo simulation method for a human body model, including the following steps: obtaining the target range of the Monte Carlo simulation time photoelectric coupling transport Monte Carlo program of the human body model; based on at least one physical model and the physical process of each physical model according to the target range of the photoelectric coupling transport Monte Carlo program, performing cross-section calculation to obtain the particle transport step length of the photoelectric coupling transport Monte Carlo program; determining the target acceleration method of the particle according to the type of the human body model, and accelerating the transport of the particle in the human body model based on the target acceleration method and the particle transport step length.
[0006] Optionally, cross-section calculations are performed based on at least one physical model and the physical processes of each physical model to obtain the particle transport step length of the optoelectronic coupling transport Monte Carlo program, including: calculating the mean free path and step length of each physical reaction process respectively; if a collision is identified during the physical reaction process, resampling the total number of mean free paths of the physical reaction process corresponding to the minimum step length; calculating the particle transport step length based on the total number of mean free paths of the physical reaction process corresponding to the minimum step length, the total number of mean free paths of the physical reaction processes without collision, and the mean free path of the physical reaction processes with collision.
[0007] Optionally, the types of human body models include voxel models and surface element models. Determining the target acceleration method of particles according to the type of human body model includes: if the type of the human body model is a voxel model, the target acceleration method is the GPU acceleration method based on the voxel model; if the type of the human body model is a surface element model, the target acceleration method is the GPU acceleration method based on the surface element model.
[0008] Optionally, the GPU acceleration method based on the voxel model includes: identifying whether the materials of adjacent voxels in the voxel model are the same; if the materials of adjacent voxels are the same, maintaining the particle transport step length of photons; if the materials of adjacent voxels are different, recalculating the particle transport step length of photons entering the voxel.
[0009] Optionally, the GPU acceleration method based on the surface element model includes: obtaining the tetrahedron model of the surface element model; constructing the tetrahedron model into an accelerated tree structure, where the accelerated tree structure hierarchically organizes the objects in three-dimensional space into a tree structure; using the accelerated tree structure to accelerate the transport of particles in the surface element model.
[0010] Optionally, constructing the tetrahedron model into an accelerated tree structure includes: calculating the surface area of the bounding box of each node of the tetrahedron model, where the bounding box of a node is the smallest enclosing volume that encloses all objects inside the node, and the surface area of the bounding box is used to estimate the cost value of the ray intersecting with the node; determining the position of the splitting plane or axis of each node, and splitting the tetrahedron model according to the surface area of the bounding box of each node and the position of the splitting plane or axis; determining the node structure and the number of child nodes according to the splitting result, and constructing the accelerated tree structure based on the node structure and the number of child nodes.
[0011] In a second aspect embodiment of the present application, a GPU-accelerated Monte Carlo simulation device for a human body model is provided, including: an acquisition module, configured to acquire a target range of a Monte Carlo simulation time optoelectronic coupling transport Monte Carlo program for the human body model; a calculation module, configured to perform cross-section calculation based on at least one physical model and the physical process of each physical model according to the target range of the optoelectronic coupling transport Monte Carlo program, to obtain a particle transport step length of the optoelectronic coupling transport Monte Carlo program; an acceleration module, configured to determine a target acceleration method for particles according to the type of the human body model, and accelerate the transport of particles in the human body model based on the target acceleration method and the particle transport step length.
[0012] Optionally, the calculation module further includes: calculating the mean free path and step length of each physical reaction process respectively; if a collision is recognized during the physical reaction process, resampling the total number of mean free paths of the physical reaction process corresponding to the minimum step length; calculating the particle transport step length according to the total number of mean free paths of the physical reaction process corresponding to the minimum step length, the total number of mean free paths of the physical reaction processes without collision, and the mean free paths of the physical reaction processes with collision.
[0013] In a third aspect embodiment of the present application, an electronic device is provided, including: a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor executes the program to implement the GPU-accelerated Monte Carlo simulation method for a human body model as described in the above embodiments.
[0014] In a fourth aspect embodiment of the present application, a computer-readable storage medium is provided, on which a computer program or instruction is stored, and the computer program or instruction is executed by a processor to implement the GPU-accelerated Monte Carlo simulation method for a human body model as described in the above embodiments.
[0015] In a fifth aspect embodiment of the present application, a computer program product is provided, on which a computer program or instruction is stored, and when the computer program or instruction is executed, it is used to implement the GPU-accelerated Monte Carlo simulation method for a human body model as described in the above embodiments.
[0016] Therefore, the present application includes the following beneficial effects:
[0017] In the embodiments of the present application, a GPU-accelerated Monte Carlo program for optoelectronic coupling transport is established by building a complete photon-electron physical model, which shortens the Monte Carlo simulation calculation time of the human voxel model and the surface element model, and optimizes the performance in aspects such as geometric transport data processing, realizes the transport of particles in the voxel model and the tetrahedral surface element model, verifies the correctness of the results and the acceleration effect. For the voxel model and the surface element model, a good acceleration effect is achieved on the premise of ensuring the accuracy of the simulation calculation results. Thus, the technical problems that the existing GPU Monte Carlo program often adopts approximate processing in the physical process, affecting the calculation accuracy, and there is no GPU-accelerated Monte Carlo program for the human surface element model are solved.
[0018] Additional aspects and advantages of the present application will be given in part in the following description, become apparent in part from the following description, or be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The above-mentioned and / or additional aspects and advantages of the present application will become apparent and easy to understand from the following description of the embodiments in conjunction with the drawings, in which:
[0020] Figure 1 is a flowchart of a GPU-accelerated Monte Carlo simulation method for a human model according to an embodiment of the present application;
[0021] Figure 2 is a schematic diagram of a photon-electron physical process according to an embodiment of the present application;
[0022] Figure 3 is a schematic diagram of a non-crossing boundary algorithm according to an embodiment of the present application;
[0023] Figure 4 is a schematic diagram of a crossing boundary algorithm according to an embodiment of the present application;
[0024] Figure 5 is a schematic diagram of the construction of a surface element model acceleration structure according to an embodiment of the present application;
[0025] Figure 6 is a flowchart of a GPU-accelerated Monte Carlo simulation method for a human model according to an embodiment of the present application;
[0026] Figure 7 is an example diagram of a GPU-accelerated Monte Carlo simulation device for a human model according to an embodiment of the present application;
[0027] Figure 8 is a schematic diagram of the structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0028] Embodiments of the present application will be described in detail below. Examples of the embodiments are shown in the accompanying drawings, where the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below by referring to the drawings are exemplary and are intended to explain the present application, and should not be construed as limiting the present application.
[0029] Radiation dose calculation plays an important role in radiation effect research, and its applications widely involve fields such as medical radiotherapy, accident emergency irradiation, occupational irradiation, and internal and external environmental irradiation. In these different application scenarios, the calculation of human radiation dose requires both high calculation accuracy and short calculation time. Currently, the main methods for calculating human radiation dose are the deterministic method, the analytical method, the general Monte Carlo method, and the fast Monte Carlo method, and each method has its own advantages and disadvantages. The deterministic method, the analytical method, and the fast Monte Carlo method are relatively fast in calculation speed, but due to approximation processing in physical models, geometric shapes, and material properties, there are compromises in calculation accuracy.
[0030] The Monte Carlo method is hailed as the "gold standard" for radiation dose calculation and is highly regarded because it can simulate and obtain accurate solutions to problems. However, the Monte Carlo method takes a long time in calculation, which to a certain extent limits its application in fields with high time requirements such as clinical radiotherapy. Therefore, how to find a radiation dose calculation method that not only has high accuracy but also can shorten the calculation time has become an urgent task in current research.
[0031] Monte Carlo simulation calculation based on a computer human model is an indispensable key means for evaluating human dose. The development of the human digital model has evolved from a mathematical model to a voxel model and then to a surface element model. Although the mathematical model is simple, the description of human organs and tissues is too rough, resulting in insufficient accuracy of the calculation results, and its application has gradually declined. The voxel model and the surface element model have become the mainstream in current practical applications. The voxel model is composed of a large number of cubes of the same size and can be finely constructed according to human CT, magnetic resonance imaging, or cadaver color pictures, significantly improving the calculation accuracy.
[0032] The surface element model, as a newly emerging computer human model, uses NURBS or PM to construct a closed geometric body and finely depicts the contours of human tissues and organs. Its mathematical smoothness and deformability endow the surface element model with the dual advantages of pose adjustment and high resolution. Not only can each part of the model move and deform to achieve the same pose as the actual human body, but the spatial resolution has no lower limit, and the tissue and organ structures can be depicted with any accuracy as required, maintaining a smooth contour. The combination of the surface element model and motion capture technology is expected to accurately reproduce real human movements and promote the refinement process of dose calculation.
[0033] However, the surface element model still faces challenges in applications. The NURBS type cannot be directly used in Monte Carlo programs due to data format limitations, while the PM type can be directly input into some programs, but its computational efficiency is low. This is because when performing particle transport inside the surface element model, it is necessary to compare with the positions of all surface elements one by one to determine the geometric step length of particle transport. Research shows that the direct calculation of the surface element model takes much longer than that of the voxel model. For this reason, the computational acceleration principle of the surface element model based on tetrahedral meshing is proposed in related technologies. The PM surface element space is decomposed into small tetrahedral meshes, which simplifies the position comparison during particle transport and significantly improves the computational speed, making it comparable to the voxel model. Despite significant progress, there is still room for further optimization to promote the wider application of the surface element model in radiation dose calculation.
[0034] With the continuous progress of computer hardware, the computational efficiency of Monte Carlo program simulations has been significantly improved. However, although the CPU performance doubles every 18 months following Moore's law by optimizing performance through methods such as integrating more transistors and increasing the clock frequency, the actual improvement in program performance brought about by hardware updates is still insufficient. At the same time, considering factors such as energy consumption and computational cost, the CPU encounters bottlenecks in the operation of Monte Carlo programs.
[0035] In recent years, the rapid development of GPU technology has provided new possibilities for accelerating Monte Carlo programs. Compared with the CPU, the GPU has more powerful single-precision floating-point operation capabilities and memory bandwidth, and is easier to maintain and lower in cost. Although a series of photon transport programs based on GPU acceleration have been developed abroad, most of them make approximations in the processing of physical processes, especially in low-energy photon photoelectric effect, Compton scattering, and pair production. These approximations may lead to inaccuracies in the calculation results, especially in situations where high-precision simulations are required.
[0036] It is worth noting that although GPU acceleration has broad application prospects in the field of Monte Carlo programs, there is currently no mainstream GPU program that realizes acceleration based on the surface element model. The surface element model, as a refined human body computational model, has important applications in dose assessment.
[0037] The GPU-accelerated Monte Carlo simulation method, device, equipment, and medium for a human body model according to the embodiments of the present application will be described below with reference to the accompanying drawings. In view of the problem that the GPU Monte Carlo program in the above-mentioned background art uses approximate processing in the photon-electron physical process, resulting in limited simulation calculation accuracy, the present application provides a GPU-accelerated Monte Carlo simulation method for a human body model. In this method, a GPU-accelerated optoelectronic coupling transport Monte Carlo program for establishing a complete photon-electron physical model is used to shorten the Monte Carlo simulation calculation time of the human voxel model and the surface element model, and performance optimizations such as geometric transport data processing are carried out to realize the transport of particles in the voxel model and the tetrahedral surface element model, verify the correctness of the results and the acceleration effect. For the voxel model and the surface element model, on the premise of ensuring the accuracy of the simulation calculation results, a good acceleration effect is achieved. Thus, the problems that the existing GPU Monte Carlo program often uses approximate processing in the physical process, affecting the calculation accuracy, and there is no GPU-accelerated Monte Carlo program for the human surface element model are solved.
[0038] Specifically, Figure 1 FIG. is a schematic flowchart of a GPU-accelerated Monte Carlo simulation method for a human body model provided by an embodiment of the present application.
[0039] As Figure 1 shown, the GPU-accelerated Monte Carlo simulation method for a human body model includes the following steps:
[0040] In step S101, the target range of the optoelectronic coupling transport Monte Carlo program during the Monte Carlo simulation of the human body model is obtained.
[0041] Among them, Monte Carlo simulation is a calculation method that can obtain numerical results through repeated random sampling, and the optoelectronic coupling transport Monte Carlo program can be a program for simulating the optoelectronic coupling transport process.
[0042] It can be understood that the embodiments of the present application obtain the target range of the optoelectronic coupling transport Monte Carlo program during the Monte Carlo simulation of the human body model. By setting an accurate target range, it is possible to focus on the key area, thereby providing more accurate and valuable simulation results and providing strong support for practical applications.
[0043] In step S102, according to the target range of the optoelectronic coupling transport Monte Carlo program, at least one physical model and the physical process of each physical model, cross-section calculation is performed based on at least one physical model and the physical process of each physical model to obtain the particle transport step length of the optoelectronic coupling transport Monte Carlo program.
[0044] Among them, the physical model can be a simplified representation of the actual physical phenomenon, used to describe, explain, or predict its behavior. The cross-section can be an important parameter describing the probability of particle-matter interaction. The particle transport step length can be the distance that a particle moves from one position to the next during the acceleration or transmission process.
[0045] It can be understood that by determining the physical model and physical process according to the target range in the embodiments of the present application, the pertinence and accuracy of the simulation are ensured. By performing cross-section calculation, a more accurate interaction probability can be obtained, thereby improving the reliability of the simulation. By obtaining the particle transport step length based on the physical model and cross-section calculation, it can be ensured that while maintaining sufficient accuracy, the calculation amount is reduced as much as possible, and the simulation efficiency is improved.
[0046] Specifically, as Figure 2 shown, by selecting a suitable physical model, bremsstrahlung and ionization radiation include continuous and discrete processes, annihilation includes stationary and discrete processes, and multiple scattering is a continuous process. The physical models and applicable energy ranges corresponding to each physical process are shown in Table 1 below. Among them, for the photon physical process, the Livermore low-energy model provided by Geant4 is mainly referred to. Compared with the fact that the cross-section of the Geant4 standard physical model in the low-energy part mainly relies on parameterized calculation, the Livermore low-energy model directly uses the shell reaction cross-section information of nuclides, and the result is more accurate. The energy that can be simulated by photons is also lower. The lower limit of energy simulation for the nuclide range with Z between 1 and 99 is 100 eV. The multiple scattering model mainly uses the multiple scattering Urban physical model based on Lewis theory. The advantage of this model is that it is applicable to various charged particles including electrons.
[0047] Table 1 Range Table of Photon and Electron Physical Models
[0048] Physical process Physical model Energy range Photoelectric effect Livermore 0.1 KeV to 100 MeV Compton effect Livermore 1.02 MeV to 100 MeV Pair production Livermore 0.1 KeV to 100 MeV Bremsstrahlung Seltzer - Berger 1 keV to 100 MeV Ionization Moller - Bhabha 100 eV to 100 MeV Multiple scattering Urban 100 eV to 100 MeV Positron annihilation Two - photon model 100 eV to 100 MeV
[0049] It should be noted that the physical process mainly included in human body dose calculation is the photon-electron coupled transport process. The photon physical process is essentially a process in which photons react with atomic nuclei and extranuclear electrons. The former includes pair production and photonuclear reaction, and the latter includes elastic scattering, photoelectric effect, and Compton scattering. In the three processes of photoelectric effect, Compton scattering, and pair production, photoelectrons, scattered electrons, and recoil positron-electron pairs will be generated respectively. The electron physical process includes bremsstrahlung, ionization, multiple scattering, and positron annihilation. Among them, bremsstrahlung and positron annihilation can generate secondary photons.
[0050] In the embodiments of the present application, sectional calculations are performed based on at least one physical model and the physical processes of each physical model to obtain the particle transport step length of the optoelectronic coupling transport Monte Carlo program, including: calculating the mean free path and the step length of each physical reaction process respectively; if a collision is identified during the physical reaction process, resampling the total number of mean free paths corresponding to the physical reaction process with the minimum step length; calculating the particle transport step length based on the total number of mean free paths corresponding to the physical reaction process with the minimum step length, the total number of mean free paths of the physical reaction processes without collisions, and the mean free paths of the physical reaction processes with collisions.
[0051] Among them, the mean free path can be the average of the various free paths that a particle may pass through between two consecutive collisions, and the step length can represent the distance or time increment by which a particle moves during a specific physical reaction process.
[0052] It can be understood that in the embodiments of the present application, by accurately calculating the mean free path and the step length and making appropriate adjustments when a collision occurs, the motion trajectory and behavior of particles can be accurately simulated. During the simulation process, the total number of mean free paths corresponding to the physical reaction process with the minimum step length, the total number of mean free paths of the physical reaction processes without collisions, and the mean free paths of the physical reaction processes with collisions are comprehensively considered, so as to be able to calculate the accurate particle transport step length, realizing the accurate simulation of the motion trajectory and behavior of particles, and providing strong support for physical research and applications.
[0053] Specifically, in the general Monte Carlo program, the transport of particles is simulated in step loops. Usually, the calculation formula for the step length size is as follows:
[0054] s = n λ ·λ
[0055] Among them, λ is the mean free path of the particle, and n λ is the number of mean free paths of the particle transported in the medium, and its value is calculated as follows:
[0056] n λ = -log(η)
[0057] Among them, η is a random number between (0, 1).
[0058] It should be noted that most general Monte Carlo programs such as MCNP, FLUKA, and EGS usually use the total cross-section method to calculate the collision points of particles in geometric materials during particle transport simulation.
[0059] In the embodiments of the present application, the step length is calculated and transported by the sectional cross-section method of Geant4. The calculation process is as follows: First, calculate the mean free path of each physical reaction process (λ 1 , λ 2 , λ3 ...), and the step size of each step (s 1 , s 2 , s 3 ...); then the size of the minimum step size (s i ) is used as the step size corresponding to the collision point in the physical reaction process; if a collision occurs, the physical reaction process n corresponding to the minimum step size λi is resampled; the n λj ' of other processes is calculated as follows:
[0060]
[0061] where n λj ' is the new total number of mean free paths corresponding to the jth physical reaction process without collision; l is the step size of the previous step; λ(x) is the mean free path of the jth physical reaction process in the material where the collision point x is located.
[0062] To compare the advantages and disadvantages of the two step size calculation algorithms, assume that both algorithms have gone through n steps and crossed the geometric boundary m times, and at the same time assume that the time for obtaining the step size mean free path each time is T λ , and the time for generating a single random number is T δ , then the total time of the total cross-section method and the partial cross-section method are n[3T λ + 2T δ + m[3T λ + 2T δ and [n[3T λ + T δ + 2T δ + m×3T λ .
[0063] In summary, the two algorithms are the same in the number of mean free path data accesses, but in terms of the number of random number generations, the ratio of the total cross-section method to the partial cross-section method within the same geometry is 2n / (n + 2), and the ratio of the total cross-section method to the partial cross-section method when crossing the geometric boundary is 1 + 2T δ / 3T λ . Therefore, in the actual application of using the digital voxel model for dose calculation, the number of voxels in the human body model is usually in the millions, and the number of simulated particles is in the tens of millions. The number of random numbers required by the partial cross-section method will be greatly reduced, thereby further reducing the time overhead and improving the calculation speed.
[0064] In step S103, determine the target acceleration mode of the particle according to the type of the human body model, and accelerate the transport of the particle in the human body model based on the target acceleration mode and the particle transport step size.
[0065] Among them, the types of human body models can include voxel models and surface element models. The target acceleration method can be an acceleration strategy adopted during the particle acceleration process according to specific requirements and goals. For example, according to factors such as particle type, energy requirements, and acceleration path, linear acceleration, circular acceleration, or other types of acceleration structures can be selected.
[0066] It can be understood that the embodiments of the present application determine the target acceleration method of particles according to the type of human body model, which can ensure that the movement of particles in the model is more in line with the actual situation. Accelerating the transportation of particles in the human body model based on the target acceleration method and the particle transport step length can improve the simulation accuracy, optimize the particle transport efficiency, and expand the application scope.
[0067] In the embodiments of the present application, determining the target acceleration method of particles according to the type of human body model includes: if the type of human body model is a voxel model, the target acceleration method is the GPU acceleration method based on the voxel model; if the type of human body model is a surface element model, the target acceleration method is the GPU acceleration method based on the surface element model.
[0068] Among them, the voxel model can be a three-dimensional modeling method based on voxels. Among them, a voxel can be the smallest unit in the three-dimensional space segmentation of digital data. GPU acceleration can be a technology that uses the parallel processing ability of the GPU to provide acceleration for computer processing tasks. The surface element model can be used to describe the geometric characteristics of three-dimensional space entities using tiny surface units or surface elements.
[0069] It can be understood that in the embodiments of the present application, when the type of human body model is determined to be a voxel model, the GPU acceleration method based on the voxel model is adopted; when the surface element model is determined to be the type of human body model, the GPU acceleration method based on the surface element model is selected, which can maximize the advantages of different model types and improve the efficiency and accuracy of simulation.
[0070] In the embodiments of the present application, the GPU acceleration method based on the voxel model includes: identifying whether the materials of adjacent voxels in the voxel model are the same; if the materials of adjacent voxels are the same, maintaining the particle transport step length of photons; if the materials of adjacent voxels are different, recalculating the particle transport step length of photons entering the voxel.
[0071] Among them, adjacent voxels can be voxel units that are directly adjacent in spatial position, and photons can be quanta of electromagnetic radiation.
[0072] It can be understood that in the embodiments of the present application, by comparing the materials of adjacent voxels, it can be determined whether the transport step length of photons in the voxel model needs to be adjusted. If the materials of adjacent voxels are the same, the current particle transport step length is maintained; if the materials are different, the step length may need to be recalculated to more accurately simulate the behavior of photons at the interface of different materials.
[0073] Specifically, for the digital human voxel model, the GPU program needs to implement a refined cubic geometry transport method. This includes accurately determining the spatial position relationship between a point and a cube, calculating the distance from the point along its movement direction to the cube, and determining the shortest distance from an internal point to the cube surface. These calculations are crucial for determining the actual step size during the step size sampling process, ensuring the accuracy of the simulation.
[0074] Meanwhile, considering the influence of computer single-precision and double-precision data types, a radial tolerance error δ is introduced to handle the uncertainty on the geometric interface. When a particle is near the geometric interface and its relative distance may be within the range of ±δ, the voxel ID to which it belongs, i.e., N - 1 or N, is determined according to the movement direction of the photon.
[0075] The cross-boundary algorithm is an optimization of the voxel model geometry transport algorithm. If the materials of adjacent voxels are the same, photons can pass through these geometric boundaries without hindrance and without pausing, greatly reducing the number of repeated reaction cross-section samplings for voxels of the same material during the transport process, thus significantly shortening the calculation time and improving the acceleration efficiency.
[0076] For example, taking the adult male reference human AM as an example, the number of voxels in the human geometry is 1,946,375, and a total of 140 organs or tissues are divided in the whole body. Each organ or tissue in the human body contains a large number of voxels of the same material. In the non-cross geometric boundary transport algorithm, as Figure 3 shown, when a particle enters a new voxel n, it is necessary to obtain the geometric material of the new voxel n, recalculate the step size using the material information at the interface point A, and when reaching the next voxel n + 1, obtain the geometric material of the voxel n + 1 and calculate a new step size at the interface B, and so on. When the cross-geometric boundary algorithm is adopted, as Figure 4 shown, after obtaining the geometric material of the new voxel n, it is judged whether it is the same as the material of the departing voxel n - 1. If it is the same, the step size sampling is not redone, and the particle continues to be transported along the original movement direction with a longer step size and is directly transported to point B, and so on; when entering a new organ or tissue and the geometric material of its voxel n + 1 changes, the step size is resampled. Therefore, the historical information of the geometry considered in this algorithm reduces the number of times of recalculating the step size, that is, reduces the number of memory accesses and the number of operands, achieving the effect of calculation acceleration.
[0077] In the embodiment of the present application, the GPU acceleration method based on the facet model includes: obtaining the tetrahedron model of the facet model; constructing the tetrahedron model into an accelerated tree structure, where the accelerated tree structure hierarchically organizes the objects in the three-dimensional space into a tree structure; and using the accelerated tree structure to accelerate the transport of particles in the facet model.
[0078] Among them, the acceleration tree structure can be a data structure used to accelerate spatial queries and calculations.
[0079] It can be understood that in the embodiments of this application, obtaining the tetrahedron model of the voxel model is to represent the geometric form in three-dimensional space more meticulously; constructing the acceleration tree structure is to accelerate the transport process of particles in the voxel model by hierarchically organizing objects, which can reduce unnecessary calculations and inspections and improve the performance and accuracy of the simulation.
[0080] Specifically, considering that the direct use of the Monte Carlo program for dose calculation in the voxel model is very slow, based on the acceleration principle of the voxel model calculation based on tetrahedral meshing in related technologies, the TetGen program was developed using the C++ language to achieve the rapid tetrahedralization of the voxel model. Since the voxel model is obtained by uniformly arranging voxels of the same size, the voxel in which a point is located in the voxel model can be quickly obtained according to the position of the particle, and the material information can be obtained for step size sampling.
[0081] However, in the tetrahedron model, each tetrahedron has its own characteristics, which results in the need to traverse all tetrahedrons each time during the transport process to determine the tetrahedron information where the particle is located. At the same time, calculating the distance from an external particle to the surface of the tetrahedron model also requires traversing all tetrahedrons to find the tetrahedron that intersects along the ray direction and has the shortest distance. These two traversal processes are time-consuming.
[0082] Facing the challenge of the efficiency of data traversal processing, constructing an acceleration structure has become an effective solution. The acceleration structure can significantly reduce the search time and improve the query efficiency by hierarchically organizing data, thereby accelerating the execution of complex computing tasks. This can not only reduce the time complexity but also help save storage space and provide support for the implementation of efficient algorithms.
[0083] Therefore, it is considered to organize all tetrahedrons of the tetrahedron model into an acceleration tree structure to significantly reduce the time complexity of traversal. When constructing such a tree structure, factors such as construction time, memory usage, and traversal efficiency need to be weighed.
[0084] Finally, the BVH (Bounding Volume Hierarchy) that supports dynamic update is selected as the acceleration structure. BVH has a wide range of applications in the fields of computer graphics and computer vision. By hierarchically organizing objects in three-dimensional space, it can effectively accelerate tasks such as ray tracing, collision detection, and rendering. By enclosing the objects in the scene in the boundary volumes of the hierarchical structure, unnecessary object tests are reduced, thereby significantly improving the algorithm efficiency.
[0085] In the embodiment of the present application, the tetrahedron model is constructed into an acceleration tree structure, including: calculating the surface area of the bounding box of each node of the tetrahedron model, where the bounding box of the node is the smallest enclosing volume that encloses all the objects inside the node, and the surface area of the bounding box is used to estimate the cost value of the ray intersecting with the node; determining the position of the splitting plane or axis of each node, and splitting the tetrahedron model according to the surface area of the bounding box of each node and the position of the splitting plane or axis; determining the node structure and the numbers of the child nodes according to the splitting result, and constructing an acceleration tree structure based on the node structure and the numbers of the child nodes.
[0086] Among them, the node structure can be the organization method of each node in the acceleration tree structure.
[0087] It can be understood that in the embodiment of the present application, by accurately calculating the surface area of the bounding box of each node in the tetrahedron model, the optimal position of the splitting plane or axis is scientifically determined, and then the tetrahedron model is efficiently split. Based on the splitting result, the node structure and the numbers of the child nodes are determined, so as to construct an efficient acceleration tree structure. This structure cleverly organizes the objects in the three-dimensional space into layers, enabling the target object or area to be quickly and accurately located in the subsequent query or calculation process, and significantly improving the processing speed.
[0088] Specifically, as Figure 5 shown, SAH (Surface Area Heuristic) is an efficient optimization method dedicated to constructing acceleration data structures such as BVH. Its core goal is to select the best node splitting strategy, thereby significantly improving the efficiency of calculations such as traversal and intersection. In SAH, the surface area of each node is a key parameter, usually obtained by calculating the surface area of its bounding box. The bounding box, as the smallest enclosing volume of all the objects inside the node, its surface area is used as an important indicator to evaluate the potential cost of the ray intersecting with the node.
[0089] During the process of constructing the BVH tree, each node needs to carefully select the splitting method. This includes determining the best position of the splitting plane or axis, and by traversing all possible splitting cases to find the splitting method with the minimum cost. However, considering the limited stack depth of the GPU, the recursive depth of their processing of the tree structure is limited. An overly deep tree may exceed the processing capacity of the GPU, so it is necessary to linearize the BVH tree, which is achieved by using a structure array to save the information of all tetrahedrons and adding the numbers of the child nodes to the node structure of the tree, so as to ensure efficient traversal and calculation on the GPU.
[0090] The GPU-accelerated Monte Carlo simulation method for a human body model proposed according to the embodiments of the present application shortens the Monte Carlo simulation calculation time of the human voxel model and the surface element model by establishing a GPU-accelerated optoelectronic coupling transport Monte Carlo program with a complete photon-electron physical model, and optimizes the performance in aspects such as geometric transport data processing, realizing the transport of particles in the voxel model and the tetrahedral surface element model, verifying the correctness of the results and the acceleration effect. For the voxel model and the surface element model, a good acceleration effect is achieved on the premise of ensuring the accuracy of the simulation calculation results. Thus, it solves the problems that the existing GPU Monte Carlo program often uses approximate processing in the physical process, affecting the calculation accuracy, and there is no GPU-accelerated Monte Carlo program for the human surface element model, etc.
[0091] Next, the GPU-accelerated Monte Carlo simulation method for the human body model will be specifically described in combination with Figure 6 as follows:
[0092] First, pre-allocate memory space on the GPU, and transfer data such as source terms, cross-sections, constants, random number seeds, geometries, statistics, and materials generated during CPU program initialization to the pre-allocated memory through CUDA system data transfer functions; then, implement three particle transport kernel functions for photons, positrons, and electrons on the graphics card device side, and corresponding transport functions can be called according to the particle types in the incident particle or secondary particle array; after the above kernel functions are implemented, select appropriate device kernel function configurations on the CPU host side, and pre-allocate several secondary particle arrays to each thread, and then call the transport kernel functions according to the initial incident particles and their secondary particle types, and perform simulations according to the principle of last-in-first-out. Note that it is necessary to determine the material where the particle is located, sample the physical step length, and at the same time determine the geometric step length with the boundary to determine the reaction type. In different models, different particle transport methods are adopted according to the model type.
[0093] In summary, for the dose calculation of the human body model, the physical model adopted in the embodiments of the present application is more refined and reasonable, realizing the GPU-accelerated Monte Carlo simulation for the tetrahedral surface element model, and at the same time, realizing the GPU-accelerated simulation calculation for the voxel model and the surface element model.
[0094] Secondly, refer to the drawings to describe the GPU-accelerated Monte Carlo simulation device for the human body model proposed according to the embodiments of the present application.
[0095] Figure 7 is a block diagram of the GPU-accelerated Monte Carlo simulation device for the human body model according to the embodiments of the present application.
[0096] As Figure 7 shown, the GPU-accelerated Monte Carlo simulation device 10 for the human body model includes: an acquisition module 100, a calculation module 200, and an acceleration module 300.
[0097] Among them, the acquisition module 100 is used to acquire the target range of the Monte Carlo simulation time photoelectric coupling transport Monte Carlo program of the human body model; the calculation module 200 is used to perform cross-section calculation based on at least one physical model and the physical process of each physical model according to the target range of the photoelectric coupling transport Monte Carlo program, and obtain the particle transport step length of the photoelectric coupling transport Monte Carlo program; the acceleration module 300 is used to determine the target acceleration method of the particles according to the type of the human body model, and accelerate the transport of the particles in the human body model based on the target acceleration method and the particle transport step length.
[0098] In the embodiment of the present application, the calculation module 200 further includes: respectively calculating the mean free path and the step length of each physical reaction process; if it is recognized that a collision occurs in the physical reaction process, resampling the total number of mean free paths of the physical reaction process corresponding to the minimum step length; calculating the particle transport step length according to the total number of mean free paths of the physical reaction process corresponding to the minimum step length, the total number of mean free paths of the physical reaction process without collision, and the mean free path of the physical reaction process with collision.
[0099] It should be noted that the foregoing explanation of the embodiment of the GPU-accelerated Monte Carlo simulation method for the human body model also applies to the GPU-accelerated Monte Carlo simulation device for the human body model in this embodiment, and will not be elaborated here.
[0100] The GPU-accelerated Monte Carlo simulation device for the human body model proposed according to the embodiment of the present application shortens the Monte Carlo simulation calculation time of the human voxel model and the surface element model by establishing a GPU-accelerated photoelectric coupling transport Monte Carlo program with a complete photon-electron physical model, and optimizes the performance in aspects such as geometric transport data processing, realizes the transport of particles in the voxel model and the tetrahedral surface element model, and verifies the correctness of the results and the acceleration effect. For the voxel model and the surface element model, a good acceleration effect is achieved on the premise of ensuring the accuracy of the simulation calculation results. Thus, the problems that the existing GPU Monte Carlo program often uses approximate processing in the physical process, affecting the calculation accuracy, and there is no GPU-accelerated Monte Carlo program for the human surface element model are solved.
[0101] Figure 8 The structural schematic diagram of the electronic device provided for the embodiment of the present application. The electronic device may include:
[0102] A memory 801, a processor 802, and a computer program stored on the memory 801 and executable on the processor 802.
[0103] When the processor 802 executes the program, it implements the GPU-accelerated Monte Carlo simulation method for the human body model provided in the above embodiment.
[0104] Further, the electronic device further includes:
[0105] A communication interface 803 for communication between the memory 801 and the processor 802.
[0106] The memory 801 is used to store computer programs that can run on the processor 802.
[0107] The memory 801 may include a high-speed RAM (Random Access Memory) memory, and may also include a non-volatile memory, such as at least one disk memory.
[0108] If the memory 801, the processor 802, and the communication interface 803 are implemented independently, the communication interface 803, the memory 801, and the processor 802 can be interconnected through a bus and complete communication with each other. The bus can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of simplicity of representation, Figure 8 only a thick line is shown in the figure, but it does not mean that there is only one bus or one type of bus.
[0109] Optionally, in a specific implementation, if the memory 801, the processor 802, and the communication interface 803 are integrated on a chip, the memory 801, the processor 802, and the communication interface 803 can complete communication with each other through an internal interface.
[0110] The processor 802 may be a CPU (Central Processing Unit), or an ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present application.
[0111] The embodiments of the present application further provide a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, the above-mentioned GPU-accelerated Monte Carlo simulation method for a human body model is implemented.
[0112] The embodiments of the present application further provide a computer program product, on which a computer program or instruction is stored, and when the computer program or instruction is executed by a processor, the above-mentioned GPU-accelerated Monte Carlo simulation method for a human body model is implemented.
[0113] In the description of this specification, the descriptions referring to terms such as "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. mean that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of this application. In this specification, the schematic expressions of the above terms are not necessarily directed to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described can be combined in a suitable manner in any one or N embodiments or examples. In addition, without contradiction, those skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples.
[0114] In addition, the terms "first" and "second" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, the features defined with "first" and "second" can explicitly or implicitly include at least one of such features. In the description of this application, the meaning of "N" is at least two, such as two, three, etc., unless otherwise specifically defined.
[0115] Any process or method description shown in the flowchart or described in other ways herein can be understood as representing a module, segment, or part of code including one or N executable instructions for implementing a customized logical function or process, and the scope of the preferred embodiments of this application includes additional implementations, where the functions can be executed in a manner that is not in the order shown or discussed, including in a substantially simultaneous manner according to the involved functions or in a reverse order, which should be understood by those skilled in the art to which the embodiments of this application belong.
[0116] It should be understood that each part of this application can be implemented by hardware, software, firmware, or a combination thereof. In the above embodiments, the N steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, any one or a combination of the following well-known technologies in the art can be used: discrete logic circuits having logic gate circuits for implementing logical functions on data signals, application-specific integrated circuits having appropriate combinational logic gate circuits, programmable gate arrays, field-programmable gate arrays, etc.
[0117] Those of ordinary skill in the art of this technology can understand that all or part of the steps carried by the methods of the above embodiments can be completed by instructing relevant hardware through a program, and the program can be stored in a computer-readable storage medium. When the program is executed, it includes one or a combination of the steps of the method embodiments.
[0118] Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and should not be construed as limiting the present application. Those of ordinary skill in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of the present application.
Claims
1. A GPU accelerated Monte Carlo simulation method for a human body model, characterized in that: The following steps are involved: Obtain the target range of the photocoupled transport Monte Carlo procedure during Monte Carlo simulation of the human body model; According to at least one physical model and the physical process of each physical model in the target range of the photoelectric coupled transport Monte Carlo program, a sub-section calculation is performed based on the at least one physical model and the physical process of each physical model to obtain a particle transport step length of the photoelectric coupled transport Monte Carlo program; A target acceleration mode for particles is determined according to the type of the human body model, and the transport of particles in the human body model is accelerated based on the target acceleration mode and the particle transport step, wherein the types of human body models include voxel models and surface models, and the GPU acceleration method based on the surface model includes: obtaining a tetrahedron model of the surface model; constructing the tetrahedron model into an acceleration tree structure, wherein the acceleration tree structure hierarchically organizes objects in a three-dimensional space into a tree structure; and utilizing the acceleration tree structure to accelerate the transport of particles in the surface model.
2. The GPU accelerated Monte Carlo simulation method for a human body model according to claim 1, characterized in that: The performing of cross-section calculation based on the at least one physical model and the physical process of each physical model to obtain the particle transport step length of the photoelectric coupled transport Monte Carlo procedure comprises: Calculate the mean free path and step length of each physical reaction process respectively; If a collision is identified during the physical reaction process, the total number of mean free paths of the physical reaction process corresponding to the minimum step length is resampled; The particle transport step length is calculated based on the total number of mean free paths of the physical reaction process corresponding to the minimum step length, the total number of mean free paths of the physical reaction process without collision, and the mean free path of the physical reaction process with collision.
3. The GPU accelerated Monte Carlo simulation method for a human body model according to claim 1, characterized in that: The step of determining a target acceleration mode of particles according to the type of the human body model comprises: If the type of the human body model is the voxel model, the target acceleration method is a GPU acceleration method based on the voxel model; If the type of the human body model is the facet model, the target acceleration method is a GPU acceleration method based on the facet model.
4. The GPU accelerated Monte Carlo simulation method for a human body model according to claim 3, characterized in that: The GPU acceleration method based on voxel model includes: Identifying whether materials of adjacent voxels in the voxel model are the same; If the materials of the adjacent voxels are the same, the particle transport step length of the photons is maintained; If the materials of the adjacent voxels are not the same, the particle transport step length for the photons to enter the voxels is recalculated.
5. The GPU accelerated Monte Carlo simulation method for a human body model according to claim 1, characterized in that: The step of constructing the tetrahedron model into an accelerated tree structure comprises: Calculating the bounding box surface area of each node of the tetrahedron model, wherein the bounding box of a node is the minimum bounding volume surrounding all objects inside the node, and the bounding box surface area is used to estimate the cost value of the intersection of the ray and the node; Determine the position of the segmentation plane or axis of each node, and segment the tetrahedron model according to the surface area of the bounding box of each node and the position of the segmentation plane or axis; The node structure and the sub-node numbers are determined according to the segmentation result, and the acceleration tree structure is constructed based on the node structure and the sub-node numbers.
6. A GPU accelerated Monte Carlo simulation device for a human body model, characterized in that: include: An acquisition module, used for acquiring a target range of an optocoupled transport Monte Carlo procedure during Monte Carlo simulation of a human body model; A calculation module, configured to perform cross-sectional calculation based on at least one physical model and the physical process of each physical model according to the target range of the photoelectric coupled transport Monte Carlo program, so as to obtain a particle transport step length of the photoelectric coupled transport Monte Carlo program; An acceleration module is used to determine a target acceleration mode for particles according to the type of the human body model, and accelerate the transport of particles in the human body model based on the target acceleration mode and the particle transport step, wherein the types of human body models include voxel models and surface element models, and a GPU acceleration method based on the surface element model includes: obtaining a tetrahedron model of the surface element model; constructing the tetrahedron model into an acceleration tree structure, wherein the acceleration tree structure hierarchically organizes objects in a three-dimensional space into a tree structure; and utilizing the acceleration tree structure to accelerate the transport of particles in the surface element model.
7. The GPU accelerated Monte Carlo simulation device for a human body model according to claim 6, characterized in that: The calculation module also includes: Calculate the mean free path and step length of each physical reaction process respectively; If a collision is identified during the physical reaction process, the total number of mean free paths of the physical reaction process corresponding to the minimum step length is resampled; The particle transport step length is calculated based on the total number of mean free paths of the physical reaction process corresponding to the minimum step length, the total number of mean free paths of the physical reaction process without collision, and the mean free path of the physical reaction process with collision.
8. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the GPU accelerated Monte Carlo simulation method for a human body model as described in any one of claims 1 to 5.
9. A computer-readable storage medium having a computer program or instruction stored thereon, characterized in that: When the computer program or instruction is executed, the GPU accelerated Monte Carlo simulation method for a human body model as described in any one of claims 1 to 5 is implemented.
10. A computer program product having a computer program or instructions stored thereon, characterized in that: When the computer program or instruction is executed, the GPU accelerated Monte Carlo simulation method for a human body model as described in any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Monte Carlo particle transport calculation method and system suitable for neutron therapy
CN117238383A
Boron neutron capture therapy dose calculation method based on GPU Monte Carlo algorithm
CN117457085A