Memory optimization method of intelligent monte carlo calculation model and bnct treatment planning system

By optimizing particle swarm optimization, structural contribution assessment, and mixed precision quantization, the problem of excessive memory consumption in the intelligent Monte Carlo computation model was solved, enabling stable operation and high-precision calculation on conventional equipment, making it suitable for BNCT treatment planning systems.

CN122111686BActive Publication Date: 2026-07-24ZHEJIANG BORONG NEUTRON TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ZHEJIANG BORONG NEUTRON TECHNOLOGY CO LTD
Filing Date
2026-04-27
Publication Date
2026-07-24

AI Technical Summary

Technical Problem

The intelligent Monte Carlo computation model consumes too much memory when dealing with high-dimensional and complex problems, leading to memory overflow during the calculation process. It cannot run stably on conventional computing devices, especially in the BNCT treatment planning system, where it is difficult to meet the requirements of fast calculation and accuracy.

Method used

By optimizing particle swarm optimization, structural contribution assessment, mixed precision quantization, and embedding coding, the model's memory footprint is reduced while ensuring no loss of computational accuracy.

Benefits of technology

While ensuring computational accuracy, the model's memory footprint has been reduced, enabling stable operation on conventional computing devices and making it suitable for various computing application scenarios, especially the BNCT treatment planning system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122111686B_ABST
    Figure CN122111686B_ABST
Patent Text Reader

Abstract

The application provides a memory optimization method of an intelligent Monte Carlo calculation model and a BNCT treatment planning system. The method comprises the following steps: obtaining an initial number of particle energy groups; obtaining a plurality of energy group screening schemes based on the initial number of particle energy groups to form an energy group particle group; wherein each energy group particle corresponds to a group of energy group screening schemes; performing fitness evaluation on the energy group particles to search for an optimal energy group screening scheme in the iteration process of the energy group particle group; obtaining a training data set based on the optimal energy group screening scheme, and performing contribution evaluation on the structure of the intelligent Monte Carlo calculation model based on the training data set to obtain a structure optimization model; and performing mixed precision quantization on the structure optimization model to obtain a memory-optimized intelligent Monte Carlo calculation model. The application can reduce the memory occupation of the intelligent Monte Carlo calculation model, ensure that the model can stably run on a conventional computing device, and be suitable for various computing application scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of machine learning technology, and relates to a memory optimization method for an intelligent Monte Carlo computation model and a BNCT treatment planning system. Background Technology

[0002] Intelligent Monte Carlo computational models are a novel computational paradigm that deeply integrates artificial intelligence technology with traditional Monte Carlo methods. Its core idea is to leverage machine learning to overcome the efficiency bottlenecks and accuracy limitations of traditional Monte Carlo methods when dealing with high-dimensional and complex problems. By introducing deep learning capabilities, intelligent Monte Carlo computational models achieve "more accurate, faster, and smarter" particle transport simulation and prediction in fields such as nuclear reactor design, radiation shielding optimization, and medical dosing calculations.

[0003] However, intelligent Monte Carlo computational models face the problem of excessive memory consumption. They must handle the massive amounts of data generated by the massive random sampling and detailed grid scoring of traditional Monte Carlo methods, while also loading the large number of weight parameters required for real-time inference by deep neural networks. This combination easily leads to memory overflow during operation, affecting the actual computational performance of intelligent Monte Carlo computational models. Therefore, optimizing the memory usage of intelligent Monte Carlo computational models is a technical problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0004] This application provides a memory optimization method for an intelligent Monte Carlo computational model and a BNCT treatment planning system to solve the technical problem of how to optimize the memory of an intelligent Monte Carlo computational model.

[0005] In a first aspect, this application provides a memory optimization method for an intelligent Monte Carlo computing model, the method comprising:

[0006] Obtain the initial number of particles in the energy swarm;

[0007] Multiple energy swarm selection schemes are obtained based on the initial number of the particle energy swarm to form an energy swarm particle swarm; wherein, each energy swarm particle corresponds to a set of energy swarm selection schemes.

[0008] Fitness evaluation is performed on the energy swarm particles to search for the optimal energy swarm selection scheme during the iteration process of the energy swarm particles;

[0009] A training dataset is obtained based on the optimal energy group screening scheme, and the contribution of the structure of the intelligent Monte Carlo computing model is evaluated based on the training dataset to obtain a structure optimization model.

[0010] The structure optimization model is subjected to mixed precision quantization to obtain a memory-optimized intelligent Monte Carlo computing model.

[0011] In some embodiments of the first aspect of this application, fitness evaluation of the energy group particles includes:

[0012] The first evaluation dataset is obtained based on the initial number of particle energy groups;

[0013] Obtain the number of particle swarm screenings in each swarm particle, and obtain the corresponding second evaluation dataset based on the number of particle swarm screenings;

[0014] The first prediction loss of the intelligent Monte Carlo computation model is obtained based on the first evaluation dataset.

[0015] The second prediction loss of the intelligent Monte Carlo computation model is obtained based on the second evaluation dataset;

[0016] The fitness of the corresponding swarm particles is evaluated based on the number of particles selected for swarm screening, the first prediction loss, and the second prediction loss.

[0017] In some embodiments of the first aspect of this application, evaluating the contribution of the intelligent Monte Carlo computational model to the structure based on the training dataset includes:

[0018] The intelligent Monte Carlo computing model is abstracted into a corresponding layer-data dependency graph, where the model layer of the intelligent Monte Carlo computing model is the data node and the data dependency relationship between the data nodes is the dependency edge.

[0019] The contribution of the dependent edges is evaluated based on the training dataset, and redundant structures of the intelligent Monte Carlo computation model are determined and pruned based on the contribution to obtain the optimized structure model.

[0020] In some embodiments of the first aspect of this application, evaluating the contribution of the dependency edges based on the training dataset includes:

[0021] The third prediction loss of the intelligent Monte Carlo computation model is obtained based on the training dataset.

[0022] Each of the aforementioned dependent edges is deleted sequentially, and the fourth prediction loss of the corresponding intelligent Monte Carlo computation model is obtained based on the training dataset;

[0023] The contribution of the deleted dependency edges is evaluated based on the third and fourth predicted losses.

[0024] In some embodiments of the first aspect of this application, determining and removing redundant structures of the intelligent Monte Carlo computing model based on the contribution includes:

[0025] The contribution of each dependent edge is compared with a preset contribution threshold to identify dependent edges whose contribution is lower than the contribution threshold as redundant edges.

[0026] Based on the redundant edges, determine the data type, shape, range, and corresponding data nodes of the edges, so as to identify and remove redundant structures in the corresponding intelligent Monte Carlo computing model.

[0027] In some embodiments of the first aspect of this application, performing hybrid precision quantization on the structural optimization model includes:

[0028] A hierarchical precision sensitivity analysis is performed on the structural optimization model to determine the high-precision sensitive layer and the low-precision sensitive layer.

[0029] Floating-point precision quantization is used for high-precision sensitive layers, while integer precision quantization is used for low-precision sensitive layers.

[0030] In some embodiments of the first aspect of this application, the method further includes:

[0031] Whether to perform embedding encoding is selected based on the input data features of the intelligent Monte Carlo computation model; wherein...

[0032] If the input data features are discrete features, the input data features are embedded and encoded to extract features based on the embedded and encoded data features;

[0033] If the input data features are continuous features, the input data features are not embedded and encoded, so that feature extraction is performed based on the input data features.

[0034] In some embodiments of the first aspect of this application, when the input data features of the intelligent Monte Carlo computing model are neutron incident flow features, the neutron incident flow features are embedded and encoded to obtain a continuous embedding vector; the continuous embedding vector is used to characterize the spatial voxel position, incident direction and neutron energy group where the neutron incident flow exists.

[0035] In some embodiments of the first aspect of this application, the method further includes:

[0036] The memory-optimized intelligent Monte Carlo computation model is trained using the training dataset to correct the prediction accuracy deviation caused by the memory optimization process.

[0037] Secondly, this application provides a BNCT treatment planning system, wherein the system is deployed with an intelligent Monte Carlo computational model optimized for memory using the method described in the first aspect; the intelligent Monte Carlo computational model predicts the corresponding neutron outflow and neutron flux based on the neutron incident flow of each voxel grid; wherein the neutron outflow of the previous voxel grid is directly used as the neutron incident flow of the next voxel grid.

[0038] As described above, the memory optimization method for the intelligent Monte Carlo computational model and the BNCT treatment planning system provided in this application have the following beneficial effects:

[0039] This application optimizes the memory usage of the intelligent Monte Carlo computational model by considering its training data, model structure, data storage format, and feature extraction. While ensuring the computational accuracy of the intelligent Monte Carlo model, this application reduces its memory footprint, ensuring stable operation on conventional computing devices and making it suitable for various computing applications.

[0040] Based on this, this application provides a BNCT treatment plan generation system deployed with an intelligent Monte Carlo computational model. This system can fully meet the clinical safety requirements of BNCT treatment plan systems for dosage calculation accuracy, avoiding the risk of treatment plan deviation due to accuracy loss. Furthermore, this system effectively solves the memory overload problem caused by the simultaneous loading of numerous dedicated computational models in scenarios involving multiple human tissues and diverse boron concentration distributions during BNCT treatment plan generation, laying a core foundation for the clinical application of BNCT treatment technology. Attached Figure Description

[0041] Figure 1 The diagram shows an application scenario of the memory optimization method for the intelligent Monte Carlo computing model provided in this application embodiment.

[0042] Figure 2 The diagram shows a flowchart illustrating the memory optimization method for the intelligent Monte Carlo computing model provided in this embodiment.

[0043] Figure 3 The diagram shown is a flowchart illustrating the fitness evaluation process for the energy swarm particles provided in an embodiment of this application.

[0044] Figure 4 The diagram shows a flowchart illustrating the contribution evaluation of the structure of the intelligent Monte Carlo computation model based on the training dataset provided in this application embodiment.

[0045] Figure 5 The diagram shows a layer-data dependency graph and a schematic diagram of graph pruning corresponding to an intelligent Monte Carlo computing model provided in an embodiment of this application.

[0046] Figure 6 The diagram shows a flowchart of evaluating the contribution of the dependent edges based on the training dataset, as provided in an embodiment of this application. Detailed Implementation

[0047] The following specific examples illustrate the implementation of this application. Those skilled in the art can easily understand other advantages and effects of this application from the content disclosed in this specification. This application can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of this application. It should be noted that, unless otherwise specified, the following embodiments and features in the embodiments can be combined with each other.

[0048] It should be noted that in the following description, reference is made to the accompanying drawings, which illustrate several embodiments of this application. It should be understood that other embodiments may also be used, and changes in mechanical composition, structure, electrical system, and operation may be made without departing from the spirit and scope of this application. The following detailed description should not be considered limiting, and the scope of the embodiments of this application is defined only by the claims of the published patent. The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the application. Spatial terms such as “upper,” “lower,” “left,” “right,” “below,” “below,” “lower part,” “above,” “upper part,” etc., may be used herein to illustrate the relationship between one element or feature shown in the figures and another element or feature.

[0049] Furthermore, as used herein, the singular forms “a,” “an,” and “the” are intended to include the plural forms as well, unless the context indicates otherwise. It should be further understood that the terms “comprising,” “including,” indicate the presence of the stated feature, operation, element, component, item, kind, and / or group, but do not preclude the presence, occurrence, or addition of one or more other features, operations, elements, components, items, kinds, and / or groups. The terms “or” and “and / or” as used herein are to be interpreted inclusively, or mean any one or any combination thereof.

[0050] Traditional Monte Carlo simulation methods often face bottlenecks such as the "curse of dimensionality" and low sampling efficiency in simulating high-dimensional spaces, complex systems, or rare events. Each step in the traditional simulation process often involves complex physical processes (such as collision reactions in particle transport), requiring enormous computational resources and time, resulting in low computational efficiency and making it difficult to meet the needs of practical computing applications.

[0051] To address the inefficiency of traditional Monte Carlo simulations, intelligent Monte Carlo computing technology has emerged. This technology utilizes deep learning models for offline training and learning of complex physical calculations, transforming intricate physical equations into network weights. Consequently, in actual simulations, the intelligent Monte Carlo computing model only requires a single forward propagation to directly output the results of the physical process (e.g., given the energy of the incident neutron and the medium material, it directly outputs the reaction cross section or exit parameters). This transforms the physical solution process, which previously required extensive interpolation and complex calculations, into extremely fast artificial intelligence inference. Therefore, by learning from a large amount of high-precision simulation data, the intelligent Monte Carlo computing model achieves a new balance between computational speed and result accuracy. It can be deployed on computing devices such as GPUs and is widely used in complex computational fields such as medical dosing calculations and nuclear reactor design.

[0052] However, intelligent Monte Carlo computational models face severe memory challenges in practical applications. For example, they must store the massive counting grids and particle history data generated by traditional Monte Carlo methods when solving physical equations, while also loading the parameters of deep neural networks used to accelerate computation. This cumulative effect of multiple resource consumption easily leads to memory overflow, limiting the intelligent Monte Carlo computational model to hardware resource bottlenecks such as GPU memory when pursuing high-precision simulations, thus hindering its application in various complex computational scenarios.

[0053] For example, in the clinical application of BNCT, the treatment planning system is a key component ensuring the safety and effectiveness of treatment. Its core function is to accurately calculate the neutron transport process within the body tissue based on information such as the patient's anatomical structure and boron concentration distribution, obtaining the neutron flux and dose distribution in tumor and normal tissues, providing data support for the formulation of clinical treatment plans. In traditional treatment planning systems, the calculation of the neutron transport process mainly relies on the traditional Monte Carlo method. The traditional Monte Carlo method can obtain high-precision flux and dose calculation results by simulating the random motion, collision, and capture of a large number of neutrons. However, completing a single clinical treatment plan Monte Carlo calculation often takes half an hour, which severely restricts the efficiency of BNCT treatment in clinical applications and makes it difficult to meet the clinical needs for rapid formulation and real-time adjustment of treatment plans. Therefore, by utilizing an intelligent Monte Carlo computational model to learn the correspondence between neutron incident flow, neutron outflow, and neutron flux, the model can quickly predict the corresponding neutron outflow and neutron flux based on the neutron incident flow for each voxel grid. Specifically, the outflow from the previous voxel grid is directly used as the incident flow for the next voxel grid, and the neutron flux for the entire voxel model is solved sequentially, thus calculating the corresponding BNCT treatment dose. Because the model's prediction process is extremely fast, its computation speed is several times faster than the traditional Monte Carlo method, effectively overcoming the efficiency bottleneck of traditional methods.

[0054] However, if the intelligent Monte Carlo computational model is to be practically applied to the BNCT treatment planning system, whether it is deployed on computing devices such as GPUs or CPUs, it will also face serious memory problems:

[0055] First, because neutron flux data exhibits a large number of degrees of freedom after being discretized in space, angle, and energy group, the training data is extremely large, leading to a significant increase in the number of network layers in the model. Furthermore, this training data suffers from a significant distribution imbalance, with vastly different proportions of outflow data at different orders of magnitude. Traditional data processing methods (such as logarithmic transformation and weighted loss functions) can only make local adjustments at the numerical level and cannot fundamentally eliminate the impact of distribution imbalance on prediction accuracy. To address this issue, existing technologies employ molecular network training strategies and introduce masked data to distinguish data features and divide them into subsets. However, the introduction of masked data further increases the model's memory footprint, directly resulting in a significant increase in the memory usage of the intelligent Monte Carlo computation model corresponding to a single set of voxel mesh materials.

[0056] Secondly, BNCT treatment involves a wide variety of human tissue materials, and the boron concentration distribution varies significantly among different tissues. To ensure computational accuracy for each tissue and boron concentration distribution scenario, it is necessary to train a dedicated intelligent Monte Carlo computational model for each scenario. However, loading trained models for all scenarios results in massive memory consumption, far exceeding the memory capacity of conventional computing devices such as GPUs. This severely limits the practical application of intelligent Monte Carlo computational models in BNCT treatment planning systems.

[0057] To at least address the aforementioned technical issues, this application proposes a memory optimization method for intelligent Monte Carlo computational models. This method can reduce the memory footprint of the intelligent Monte Carlo computational model while ensuring its computational accuracy, thereby ensuring stable operation of the model on conventional computing devices. It is applicable to various particle transport computational application scenarios, including BNCT treatment plan generation.

[0058] Figure 1 This diagram illustrates an application scenario of the memory optimization method for the intelligent Monte Carlo computing model provided in this embodiment. The memory optimization device 1 for the intelligent Monte Carlo computing model can be used to implement the memory optimization method for the intelligent Monte Carlo computing model provided in this embodiment, but the application scenarios of the memory optimization method for the intelligent Monte Carlo computing model provided in this embodiment are not limited to this. Figure 1 The memory optimization device 1 of the intelligent Monte Carlo computing model shown is as follows. Figure 1 As shown, the memory optimization device 1 for the intelligent Monte Carlo computing model includes a model storage device 11, a processor 12, and a display device 13. The memory optimization method for the intelligent Monte Carlo computing model provided in this application embodiment can be applied to the processor 12. Wherein, Figure 1The processor 12 can be a single processor, a processor cluster consisting of multiple processors, or a cloud computing center, etc., and is not specifically limited here.

[0059] For example, when the memory optimization device 1 of the intelligent Monte Carlo computational model is applied to BNCT treatment, the intelligent Monte Carlo computational model can use the hardware computing resources of the model storage device 11 to predict the corresponding neutron outflow and neutron flux for the neutron incident flow of each voxel grid on a large scale. Wherein, the model storage device 11 can be a GPU, then the intelligent Monte Carlo computational model can utilize the parallel computing resources of the GPU to form a set of parallel tasks, thereby quickly obtaining the neutron flux of the entire voxel model and displaying it on the display terminal 13. Simultaneously, in order to reduce the memory occupied by the intelligent Monte Carlo computational model running on the GPU, the processor 12 can execute the memory optimization method of the intelligent Monte Carlo computational model provided in this application embodiment to optimize the memory of the intelligent Monte Carlo computational model on the GPU, reducing the memory occupied by the model, thereby ensuring that the GPU memory can guarantee the stable operation of the intelligent Monte Carlo computational model.

[0060] The technical solutions in the embodiments of this application will be described in detail below with reference to the accompanying drawings.

[0061] The following embodiments of this application provide a memory optimization method for intelligent Monte Carlo computing models, which, for example, can be achieved through... Figure 1 The processor 12 shown is used to implement this. Figure 2 The diagram shows a flowchart illustrating the memory optimization method for the intelligent Monte Carlo computing model provided in this embodiment. Figure 2 As shown, the memory optimization method for the intelligent Monte Carlo computing model includes steps S1 to S5.

[0062] Step S1: Obtain the initial number of particles in the energy cluster.

[0063] Step S2: Based on the initial number of particle swarms, obtain multiple sets of swarm selection schemes to form a swarm particle group; wherein, each swarm particle corresponds to a set of swarm selection schemes.

[0064] In some embodiments, the number of particle energy clusters is an adjustable parameter that varies with the application scenario, particle type, and accuracy requirements. By dividing the continuous particle energy into finite particle energy clusters, the infinite-dimensional transport equations are transformed into a solvable discrete set of equations, thereby helping intelligent Monte Carlo computational models to perform offline training and learning of complex physical transport processes. However, overly fine energy cluster partitioning increases the computational resources and memory consumption for subsequent model training. Therefore, this application optimizes the energy cluster partitioning from the data source and constructs a training dataset based on it, thereby reducing memory consumption while ensuring the model's prediction accuracy.

[0065] In some embodiments, the initial number of particle energy groups is set to n. Multiple energy group selection schemes are obtained by randomly determining whether n particle energy groups are selected, and the i-th energy group selection scheme is used as the i-th energy group particle energy group. This forms an energy swarm particle group. In fact, each energy swarm particle represents a possible energy swarm combination scheme. Furthermore, multiple energy swarm selection schemes should exhaust all possible combinations of particle energy swarms.

[0066] Step S3: Perform fitness evaluation on the energy swarm particles to search for the optimal energy swarm screening scheme during the iteration process of the energy swarm particle swarm.

[0067] In some embodiments, this application uses "minimum number of particle swarms and model prediction accuracy loss not exceeding a preset threshold" as the optimization objective. It then evaluates the fitness of multiple swarm particles and uses a particle swarm optimization algorithm to iteratively update the positions and velocities of the swarm particles. During the iteration process, each swarm particle adjusts its motion direction based on its own historical best position and the group's best position, thereby continuously searching for the optimal swarm selection scheme that satisfies the optimization objective. In this embodiment, its own historical best position refers to the best historical position for the same swarm particle (the optimal solution for a set of individual swarm selection schemes), while the group's best position refers to the optimal solution for the swarm of particles (i.e., the optimal swarm selection scheme).

[0068] Figure 3 The diagram shown is a schematic representation of the process for evaluating the fitness of the energy swarm particles provided in an embodiment of this application. Figure 3 As shown, the fitness evaluation of the energy group particles includes steps S31 to S35.

[0069] Step S31: Obtain the first evaluation dataset based on the initial number of particle energy groups.

[0070] In some embodiments, high-precision deterministic transport calculation methods and Monte Carlo calculation methods can be used to generate the required label data, such as the particle flux distribution corresponding to the initial number of particle energy groups, thereby forming a massive amount of data pairs, which can be used as the first evaluation dataset.

[0071] Step S32: Obtain the number of particle swarm screenings in each swarm particle, and obtain the corresponding second evaluation dataset based on the number of particle swarm screenings.

[0072] In some embodiments, the number of particle swarms selected in each swarm particle during each iteration is obtained, and a large number of data pairs can also be obtained based on the above embodiments, which can be used as the corresponding second evaluation dataset.

[0073] It should be noted that the specific acquisition method depends on the specific application scenario of the intelligent Monte Carlo computational model. Those skilled in the art can choose any method to obtain the corresponding data pair based on the specific application data of the intelligent Monte Carlo computational model, and this application does not impose any restrictions on this. For example, when applied to the field of BNCT therapy, the particle energy group is the neutron energy group. The Monte Carlo computational method can accurately generate the two labeled data corresponding to the neutron energy group (neutron incident flow) – neutron outflow and neutron flux – and thus form a data pair of neutron incident flow – neutron outflow and neutron flux, which can be used as an evaluation dataset.

[0074] Step S33: Obtain the first prediction loss of the intelligent Monte Carlo computation model based on the first evaluation dataset.

[0075] Step S34: Obtain the second prediction loss of the intelligent Monte Carlo computation model based on the second evaluation dataset.

[0076] Step S35: Evaluate the fitness of the corresponding swarm particles based on the particle swarm screening quantity, the first prediction loss, and the second prediction loss.

[0077] In some embodiments, both the first evaluation dataset and the second evaluation dataset are supervised learning samples for the intelligent Monte Carlo computational model. Specifically, the input data from the first evaluation dataset and the second evaluation dataset are respectively input into the intelligent Monte Carlo computational model to obtain the corresponding predicted output data. By comparing the deviation between the predicted output data and the true label data in the first evaluation dataset or the second evaluation dataset, the first prediction loss and the second prediction loss corresponding to the model can be calculated. Finally, the fitness of the corresponding energy group particle is evaluated based on the number of neutron energy group screenings, the second prediction loss of the model, and the third prediction loss of the model. The calculation of the fitness is specifically shown in Equation (1).

[0078] (1)

[0079] in, Let be the fitness of the i-th energy group particle. Let be the number of energy groups selected from the particles in the i-th energy group. For the second predicted loss, The first predicted loss, and These are the weighting coefficients.

[0080] That is, during the iteration process of the energy group particle swarm, the fitness of each energy group particle is calculated by equation (1) in order to continuously search for the optimal energy group particle, that is, the optimal energy group screening scheme.

[0081] It should be noted that the specific number of iterations can be set as needed, and this application does not impose any restrictions on it.

[0082] Step S4: Obtain a training dataset based on the optimal energy group screening scheme, and evaluate the contribution of the intelligent Monte Carlo computing model to the structure based on the training dataset to obtain a structure optimization model.

[0083] In some embodiments, a high-quality dedicated training dataset can be regenerated based on the optimal energy group selection scheme. This training dataset reduces the amount and dimensionality of training data from the source, while maximizing the rationality of energy group partitioning, reducing the model's memory requirements, and ensuring the model's prediction accuracy.

[0084] Furthermore, after obtaining the training dataset, the contribution of the intelligent Monte Carlo computation model structure can be evaluated based on the training dataset, thereby enabling deep compression of the network architecture with large data volume and many parameters. Without losing the core prediction accuracy, the model parameter size can be significantly reduced, further improving the memory optimization effect. Figure 4 This diagram illustrates the process of evaluating the contribution of the intelligent Monte Carlo computation model's structure based on the training dataset, as provided in an embodiment of this application. Figure 4 As shown, the contribution evaluation of the structure of the intelligent Monte Carlo computation model based on the training dataset includes steps S41 to S42.

[0085] Step S41: Abstract the intelligent Monte Carlo computing model into a corresponding layer-data dependency graph. The layer-data dependency graph uses the model layer of the intelligent Monte Carlo computing model as data nodes and the data dependency relationship between data nodes as dependency edges.

[0086] In some embodiments, the intelligent Monte Carlo computing model is not a single, fixed architecture, but rather a heterogeneous computing graph driven by physical problems and connected by data flow graphs. That is, the structures of intelligent Monte Carlo computing models in different application domains are actually not the same. However, for intelligent Monte Carlo computing models with different structures, they can all be abstracted into corresponding layer-data dependency graphs, with each model layer in the model as a data node and the data dependencies between different data nodes as dependency edges. In other words, dependency edges reflect the data flow and interaction relationships between layers. In this way, the inherent link logic of the intelligent Monte Carlo computing model can be clearly represented through the layer-data dependency graph, clarifying the functional relationships between each layer and the connections between layers.

[0087] In some embodiments, the intelligent Monte Carlo computational model may include an input layer, a feature extraction layer, and an output layer. For example... Figure 5As shown, the input layer, feature extraction layer, and output layer are considered as data nodes, and each dependency edge represents the data dependency relationship between the data nodes. Here, Xz represents the z-th input. The feature extraction layer extracts features from the input data to predict the corresponding z-th output data Yz, which is then output via the input-output layer. A fully connected layer or other neural networks can be used as the feature extraction layer, depending on the application scenario. This application only uses Xz as an example. Figure 5 Provide an example.

[0088] Step S42: Evaluate the contribution of dependent edges based on the training dataset, and determine and remove redundant structures in the intelligent Monte Carlo computing model based on the contribution to obtain the structure optimization model.

[0089] In some embodiments, redundant structures, such as redundant neurons or redundant weight parameters, may exist in different intelligent Monte Carlo computational models. These redundant structures can affect the computational efficiency of the model and consume excessive amounts of unnecessary memory. Therefore, after abstracting the intelligent Monte Carlo model into a layer-data dependency graph, this application evaluates the contribution of dependency edges in the graph based on the training dataset to determine redundant structures. Figure 6 The diagram shows a flowchart illustrating the process of evaluating the contribution of the dependent edges based on the training dataset, as provided in an embodiment of this application. Figure 6 As shown, evaluating the contribution of the dependent edges based on the training dataset includes steps S421 to S423.

[0090] Step S421: Obtain the third prediction loss of the intelligent Monte Carlo computation model based on the training dataset.

[0091] Step S422: Delete each of the dependent edges in sequence, and obtain the fourth prediction loss of the corresponding intelligent Monte Carlo computing model based on the training dataset.

[0092] Step S423: Evaluate the contribution of the deleted dependency edge based on the third predicted loss and the fourth predicted loss.

[0093] In some embodiments, the third prediction loss of the intelligent Monte Carlo computational model is calculated using the acquired training dataset. Then, each dependency edge in the layer-data dependency graph is deleted sequentially, and the corresponding fourth prediction loss after the dependency edge is deleted is obtained. Subsequently, the contribution of the deleted dependency edge is evaluated by the third prediction loss and the fourth prediction loss, thereby accurately defining the functional contribution value of each corresponding structure. The calculation of the contribution is specifically shown in Equation (2).

[0094] (2)

[0095] in, The contribution after deleting the Nth edge, The fourth predicted loss after deleting the Nth edge, This is the third predicted loss.

[0096] Furthermore, the lower the contribution of the deleted dependency edge, the smaller the impact of deleting the corresponding structure on the model prediction, meaning the more significant the redundancy attribute of the structure. Therefore, a contribution threshold can be preset, and the contribution of each dependency edge can be compared with the preset contribution threshold. Dependency edges with a contribution lower than the contribution threshold are identified as redundant edges. Then, based on the redundant edges, the data type, shape, range, and corresponding data nodes of the edges are determined. This allows for the identification and removal of redundant structures in the corresponding intelligent Monte Carlo computing model, thereby obtaining a structure-optimized model. For example, the upstream and downstream data nodes of an edge can accurately pinpoint the network layer that generates the data, and the shape of the edge can determine whether it connects to a fully connected layer or a convolutional layer, etc., thus identifying the corresponding structure as a redundant structure, removing it, and using the model after removing the redundant structure as the structure-optimized model.

[0097] It should be noted that those skilled in the art can implement the specific method for determining the redundant structure based on the data type, shape, range, and corresponding data nodes of the edges themselves, and this application does not impose any restrictions on this.

[0098] Based on the above Figure 5 For example, equation (2) can be used to evaluate the contribution of dependent edges in the feature extraction layer, thereby removing redundant edges.

[0099] Furthermore, after removing redundant structures from the intelligent Monte Carlo computational model and obtaining the corresponding optimized model, the model needs to be trained using the training dataset, i.e., fine-tuned, to verify the fixity of the input and output dimensions and the loss of prediction accuracy. This corrects the prediction accuracy deviation generated by the intelligent Monte Carlo computational model during memory optimization, ensuring that the simplified model meets the prediction performance requirements while significantly reducing the parameter size.

[0100] Step S5: Perform mixed precision quantization on the structure optimization model to obtain a memory-optimized intelligent Monte Carlo computing model.

[0101] In some embodiments, based on the structural optimization achieved by relying on graph pruning, the data storage format can also be optimized, that is, the structural optimization model is subjected to mixed precision quantization, including performing hierarchical precision sensitivity analysis on the structural optimization model to determine high-precision sensitive layers and low-precision sensitive layers; using floating-point precision quantization for high-precision sensitive layers; and using integer precision quantization for low-precision sensitive layers.

[0102] In fact, this application employs hybrid quantization technology to compress the accuracy of model parameters. Its core is "hierarchical precision differentiation design," which can accurately match the precision-sensitive characteristics of different levels of the structure-optimized model, that is, the pruned intelligent Monte Carlo computation model, thus ensuring core prediction accuracy while compressing memory.

[0103] In some embodiments, for core layers that directly affect prediction accuracy (such as the output layer and feature extraction layers near the output layer), parameter accuracy has a significant impact on the prediction results. These are high-precision sensitive layers, and 32-bit or 16-bit floating-point quantization is used to ensure that the core prediction accuracy is not lost. For feature extraction layers near the input layer, their main function is to initially extract data features, and parameter accuracy has a smaller impact on the final prediction results. These are low-precision sensitive layers, and 8-bit integer quantization is used to compress parameter accuracy to the maximum extent. Finally, the quantized model is calibrated and fine-tuned using the training dataset to correct accuracy deviations caused during memory optimization, ensuring that the quantized model meets application requirements in terms of prediction accuracy while significantly reducing memory usage.

[0104] Furthermore, since intelligent Monte Carlo computational models are often applied in complex computational scenarios, their input data is often discrete. In such cases, if traditional fully connected layers are used to process high-dimensional discrete data, the "fully connected" structure often necessitates increasing the number of network layers and neurons to ensure feature extraction capabilities. However, the number of weight parameters is typically equal to "input dimension × number of neurons," and with the addition of bias terms, this leads to a significant increase in the size of the model's weight parameters, ultimately occupying most of the model's memory space. This memory redundancy problem is particularly prominent when processing high-dimensional sparse data. Therefore, this application addresses the different input data features of intelligent Monte Carlo computational models by selecting whether to perform embedding encoding, i.e., introducing embedding layers instead of fully connected layers to process the input data features, thereby fundamentally reducing the number of weight parameters and achieving efficient memory reduction in the model.

[0105] In some embodiments, the choice is made regarding whether to perform embedding encoding based on the input data features of the intelligent Monte Carlo computation model. Specifically, if the input data features are discrete, embedding encoding is performed on the input data features to extract features based on the embedded and encoded data features; if the input data features are continuous, embedding encoding is not performed on the input data features to extract features based on the input data features. That is, when the input data features of the intelligent Monte Carlo computation model are discrete, this application chooses to introduce an embedding layer to perform embedding encoding, thereby compressing the sparse, high-dimensional discrete input into a low-dimensional dense vector, thereby improving the computational efficiency of subsequent feature extraction and significantly reducing the model size and memory usage.

[0106] For example, when the intelligent Monte Carlo computational model is applied to the field of BNCT therapy, it can be used to predict the corresponding neutron outflow and neutron flux based on the neutron incident flow for each voxel grid. In this case, because the neutron flow data has a large number of degrees of freedom after being discretized in space, angle, and energy groups, its corresponding neutron incident flow feature vector naturally possesses the discrete property of "high-dimensional sparsity": the vector dimension is jointly determined by "the number of spatial positions × the number of incident directions × the number of neutron energy groups," and only the positions corresponding to "the existence of incident particle flow" in the incident flow feature vector are valid non-zero values, while the vast majority of other dimensions are zero. Therefore, targeting the core characteristics of neutron incident flow data, this application introduces an embedding layer to encode these high-dimensional, discrete incident flow feature vectors into low-dimensional, dense, continuous embedding vectors. These continuous embedding vectors represent the spatial voxel positions, incident directions, and neutron energy groups where neutron incident flows exist. This eliminates the need for layer-by-layer extraction of incident flow features, significantly reducing model size and memory usage. At the same time, the low-dimensional, dense, continuous vectors can improve the computational efficiency of subsequent feature extraction and, through training, capture the semantic relationships between different incident flow features (such as the closer spatial locations and energy groups of incident flow vectors), laying the foundation for accurate prediction of subsequent outflow and neutron flux.

[0107] It should be noted that this application only limits the use of an embedding layer for embedding encoding when the intelligent Monte Carlo computing model processes discrete data. This application does not restrict the network structure or other model structure used in the subsequent feature extraction layer.

[0108] The scope of protection for the memory optimization method of the intelligent Monte Carlo computing model described in this application is not limited to the execution order of the steps listed in this embodiment. Any solution implemented by adding, subtracting, or replacing steps in the prior art based on the principles of this application is included within the scope of protection of this application.

[0109] Therefore, this application optimizes the memory usage of the intelligent Monte Carlo computing model by considering its training data, model structure, data storage format, and feature extraction. This approach reduces the model's memory footprint while ensuring its computational accuracy, enabling stable operation on conventional computing devices and making it suitable for various computing applications.

[0110] Based on this, this application also provides a BNCT treatment planning system. The system is deployed with a memory-optimized intelligent Monte Carlo computational model derived from the above embodiments. This intelligent Monte Carlo computational model predicts the corresponding neutron outflow and neutron flux based on the neutron incident flow of each voxel grid; wherein the neutron outflow of the previous voxel grid is directly used as the neutron incident flow of the next voxel grid.

[0111] Furthermore, the BNCT treatment planning system provided in this application embodiment can run on a GPU computing terminal. The intelligent Monte Carlo computational model deployed in this system can utilize the parallel computing capabilities of the GPU to quickly predict the neutron emission flux and neutron flux of multiple voxel grids, significantly improving iterative convergence efficiency and hardware utilization. This system fully meets the clinical safety requirements for dose calculation accuracy in BNCT treatment planning systems, avoiding the risk of treatment plan deviations due to accuracy loss. Moreover, this system effectively solves the memory overload problem caused by the simultaneous loading of numerous dedicated computational models in scenarios involving multiple human tissues and diverse boron concentration distributions during BNCT treatment plan generation, laying a core foundation for the clinical application of BNCT treatment technology and possessing high application value.

[0112] The above embodiments are merely illustrative of the principles and effects of this application and are not intended to limit this application. Any person skilled in the art can modify or alter the above embodiments without departing from the spirit and scope of this application. Therefore, all equivalent modifications or alterations made by those skilled in the art without departing from the spirit and technical concept disclosed in this application should still be covered by the claims of this application.

Claims

1. A BNCT treatment planning system, characterized in that, The system is deployed with a memory-optimized intelligent Monte Carlo computation model; the intelligent Monte Carlo computation model predicts the corresponding neutron outflow and neutron flux based on the neutron incident flow of each voxel grid; the neutron outflow of the previous voxel grid is directly used as the neutron incident flow of the next voxel grid; wherein, obtaining the memory-optimized intelligent Monte Carlo computation model includes: Obtain the initial number of particles in the energy swarm; Multiple energy swarm selection schemes are obtained based on the initial number of the particle energy swarm to form an energy swarm particle swarm; wherein, each energy swarm particle corresponds to a set of energy swarm selection schemes. Fitness evaluation is performed on the energy swarm particles to search for the optimal energy swarm selection scheme during the iteration process of the energy swarm particles; A training dataset is obtained based on the optimal energy swarm selection scheme, and the contribution of the intelligent Monte Carlo computation model to the structure is evaluated based on the training dataset to obtain a structure-optimized model. This includes: abstracting the intelligent Monte Carlo computation model into a corresponding layer-data dependency graph, where the model layer of the intelligent Monte Carlo computation model is the data node, and the data dependency relationship between the data nodes is the dependency edge; evaluating the contribution of the dependency edge based on the training dataset, and determining and removing redundant structures of the intelligent Monte Carlo computation model based on the contribution to obtain the structure-optimized model. The structural optimization model is subjected to mixed precision quantization to obtain a memory-optimized intelligent Monte Carlo computing model; wherein, the mixed precision quantization of the structural optimization model includes: performing hierarchical precision sensitivity analysis on the structural optimization model to determine high-precision sensitive layers and low-precision sensitive layers; using floating-point precision quantization for high-precision sensitive layers; and using integer precision quantization for low-precision sensitive layers.

2. The BNCT treatment planning system according to claim 1, characterized in that, The fitness assessment of the energy group particles includes: The first evaluation dataset is obtained based on the initial number of particle energy groups; Obtain the number of particle swarm screenings in each swarm particle, and obtain the corresponding second evaluation dataset based on the number of particle swarm screenings; The first prediction loss of the intelligent Monte Carlo computation model is obtained based on the first evaluation dataset. The second prediction loss of the intelligent Monte Carlo computation model is obtained based on the second evaluation dataset; The fitness of the corresponding swarm particles is evaluated based on the number of particles selected for swarm screening, the first prediction loss, and the second prediction loss.

3. The BNCT treatment planning system according to claim 1, characterized in that, Evaluating the contribution of the dependent edges based on the training dataset includes: The third prediction loss of the intelligent Monte Carlo computation model is obtained based on the training dataset. Each of the aforementioned dependent edges is deleted sequentially, and the fourth prediction loss of the corresponding intelligent Monte Carlo computation model is obtained based on the training dataset; The contribution of the deleted dependency edges is evaluated based on the third and fourth predicted losses.

4. The BNCT treatment planning system according to claim 1, characterized in that, Determining and removing redundant structures from the intelligent Monte Carlo computation model based on the contribution level includes: The contribution of each dependent edge is compared with a preset contribution threshold to identify dependent edges whose contribution is lower than the contribution threshold as redundant edges. Based on the redundant edges, determine the data type, shape, range, and corresponding data nodes of the edges, so as to identify and remove redundant structures in the corresponding intelligent Monte Carlo computing model.

5. The BNCT treatment planning system according to claim 1, characterized in that, Also includes: Whether to perform embedding encoding is selected based on the input data features of the intelligent Monte Carlo computation model; wherein... If the input data features are discrete features, the input data features are embedded and encoded to extract features based on the embedded and encoded data features; If the input data features are continuous features, the input data features are not embedded and encoded, so that feature extraction is performed based on the input data features.

6. The BNCT treatment planning system according to claim 1, characterized in that, When the input data features of the intelligent Monte Carlo computing model are neutron incident flow features, the neutron incident flow features are embedded and encoded to obtain continuous embedding vectors; The continuous embedding vector is used to characterize the spatial voxel position, incident direction, and neutron energy group where a neutron incident flow exists.

7. The BNCT treatment planning system according to claim 1, characterized in that, Also includes: The memory-optimized intelligent Monte Carlo computation model is trained using the training dataset to correct the prediction accuracy deviation caused by the memory optimization process.