CN115270588A - A fluence spectrum distribution calculation modeling, fluence spectrum distribution calculation method and device - Google Patents
A fluence spectrum distribution calculation modeling, fluence spectrum distribution calculation method and device Download PDFInfo
- Publication number
- CN115270588A CN115270588A CN202210928213.5A CN202210928213A CN115270588A CN 115270588 A CN115270588 A CN 115270588A CN 202210928213 A CN202210928213 A CN 202210928213A CN 115270588 A CN115270588 A CN 115270588A
- Authority
- CN
- China
- Prior art keywords
- training
- distribution
- data
- spectrum
- fluence
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000009826 distribution Methods 0.000 title claims abstract description 220
- 238000004364 calculation method Methods 0.000 title claims abstract description 86
- 238000001228 spectrum Methods 0.000 title claims description 172
- 238000012549 training Methods 0.000 claims abstract description 163
- 238000003062 neural network model Methods 0.000 claims abstract description 76
- 239000002245 particle Substances 0.000 claims abstract description 53
- 238000000342 Monte Carlo simulation Methods 0.000 claims abstract description 24
- 238000007781 pre-processing Methods 0.000 claims abstract description 16
- 230000003595 spectral effect Effects 0.000 claims abstract description 15
- 238000010276 construction Methods 0.000 claims abstract description 12
- 238000002347 injection Methods 0.000 claims description 81
- 239000007924 injection Substances 0.000 claims description 81
- 239000011159 matrix material Substances 0.000 claims description 53
- 238000000034 method Methods 0.000 claims description 31
- 238000011156 evaluation Methods 0.000 claims description 21
- 238000012545 processing Methods 0.000 claims description 16
- 230000002285 radioactive effect Effects 0.000 claims description 8
- 238000005094 computer simulation Methods 0.000 claims description 6
- 230000003993 interaction Effects 0.000 claims description 6
- 238000010606 normalization Methods 0.000 claims description 6
- 238000004088 simulation Methods 0.000 claims description 6
- 230000003044 adaptive effect Effects 0.000 claims description 5
- 238000005070 sampling Methods 0.000 claims description 4
- 230000008569 process Effects 0.000 description 10
- 238000004422 calculation algorithm Methods 0.000 description 8
- 210000002569 neuron Anatomy 0.000 description 8
- 238000010586 diagram Methods 0.000 description 5
- 238000005516 engineering process Methods 0.000 description 3
- 239000000463 material Substances 0.000 description 3
- 230000001681 protective effect Effects 0.000 description 3
- 230000005855 radiation Effects 0.000 description 3
- 210000001519 tissue Anatomy 0.000 description 3
- 238000013528 artificial neural network Methods 0.000 description 2
- 210000000988 bone and bone Anatomy 0.000 description 2
- 238000013461 design Methods 0.000 description 2
- 238000007667 floating Methods 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 210000004072 lung Anatomy 0.000 description 2
- 239000000203 mixture Substances 0.000 description 2
- 238000012821 model calculation Methods 0.000 description 2
- 230000000149 penetrating effect Effects 0.000 description 2
- 238000001959 radiotherapy Methods 0.000 description 2
- 239000000243 solution Substances 0.000 description 2
- XLYOFNOQVPJJNP-UHFFFAOYSA-N water Substances O XLYOFNOQVPJJNP-UHFFFAOYSA-N 0.000 description 2
- 210000001015 abdomen Anatomy 0.000 description 1
- 230000004913 activation Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000008901 benefit Effects 0.000 description 1
- 239000004568 cement Substances 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 210000000038 chest Anatomy 0.000 description 1
- 238000002591 computed tomography Methods 0.000 description 1
- 238000013434 data augmentation Methods 0.000 description 1
- 230000003247 decreasing effect Effects 0.000 description 1
- 238000013136 deep learning model Methods 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 210000003128 head Anatomy 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 210000003205 muscle Anatomy 0.000 description 1
- 210000003739 neck Anatomy 0.000 description 1
- -1 neutrons Substances 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 210000004197 pelvis Anatomy 0.000 description 1
- 230000009467 reduction Effects 0.000 description 1
- 230000008439 repair process Effects 0.000 description 1
- 210000004872 soft tissue Anatomy 0.000 description 1
- 238000003325 tomography Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F30/00—Computer-aided design [CAD]
- G06F30/20—Design optimisation, verification or simulation
- G06F30/25—Design optimisation, verification or simulation using particle-based methods
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F30/00—Computer-aided design [CAD]
- G06F30/20—Design optimisation, verification or simulation
- G06F30/27—Design optimisation, verification or simulation using machine learning, e.g. artificial intelligence, neural networks, support vector machines [SVM] or training a model
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/004—Artificial life, i.e. computing arrangements simulating life
- G06N3/006—Artificial life, i.e. computing arrangements simulating life based on simulated virtual individual or collective life forms, e.g. social simulations or particle swarm optimisation [PSO]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T1/00—General purpose image data processing
- G06T1/20—Processor architectures; Processor configuration, e.g. pipelining
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2111/00—Details relating to CAD techniques
- G06F2111/08—Probabilistic or stochastic CAD
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Evolutionary Computation (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Artificial Intelligence (AREA)
- General Health & Medical Sciences (AREA)
- Mathematical Physics (AREA)
- Computational Linguistics (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- Biophysics (AREA)
- Biomedical Technology (AREA)
- Data Mining & Analysis (AREA)
- Life Sciences & Earth Sciences (AREA)
- Health & Medical Sciences (AREA)
- Computer Hardware Design (AREA)
- Geometry (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Medical Informatics (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
Description
技术领域technical field
本发明涉及粒子输运计算领域,尤其涉及一种注量谱分布计算建模、注量谱分布计算方法及装置。The invention relates to the field of particle transport calculations, in particular to a computational modeling of fluence spectrum distribution, a method and a device for calculating fluence spectrum distribution.
背景技术Background technique
粒子注量定义为单位面积垂直通过记录平面的粒子数,注量谱分布是指对记录平面划分多个记录网格,记录每个网格中不同能量区间的注量。无论是放射治疗领域还是辐射防护领域,都需要计算射线在穿透一定结构介质后,所出射的注量谱分布,以方便进行下一步计算。例如对于辐射防护,需要评估射线穿透防护墙后的射线,以评估防护效果;对于放射治疗,需要获得穿透人体后注量谱分布,以进行在体剂量检测等。The particle fluence is defined as the number of particles passing through the recording plane per unit area vertically. The fluence spectrum distribution refers to dividing the recording plane into multiple recording grids and recording the fluence of different energy intervals in each grid. Whether it is in the field of radiotherapy or radiation protection, it is necessary to calculate the distribution of the fluence spectrum emitted by the rays after they penetrate a certain structural medium, so as to facilitate the next step of calculation. For example, for radiation protection, it is necessary to evaluate the radiation behind the protective wall to evaluate the protective effect; for radiation therapy, it is necessary to obtain the fluence spectrum distribution after penetrating the human body for in-body dose detection, etc.
目前,对于注量谱计算主流的技术有:以蒙特卡罗(Monte Carlo)算法为代表的基于粒子相互作用基本原理进行模拟抽样获得出射注量分布的算法;通过卷积(convolution/superposition)算法,利用卷积原理进行计算,例如笔形束卷积算法(PencilBeam convolution/superposition),筒串卷积算法(collapsed coneconvolution/superposition),计算出射注量谱分布。At present, the mainstream technologies for fluence spectrum calculation include: the Monte Carlo algorithm, which is based on the basic principle of particle interaction to obtain the injection fluence distribution through simulated sampling; the convolution/superposition algorithm , use the convolution principle to calculate, such as pencil beam convolution algorithm (PencilBeam convolution/superposition), barrel string convolution algorithm (collapsed coneconvolution/superposition), to calculate the injection volume spectrum distribution.
现有的蒙特卡罗(Monte Carlo)算法为代表的基于粒子相互作用基本原理进行模拟抽样获得出射注量分布的算法,虽然精度高但由于剂量计算中粒子量大,计算效率较低。此外,现有一种注量谱分布计算方法,通过基于深度学习模型构建剂量计算模型,以医疗机器参数为输入,通过水中的剂量信息训练剂量计算模型,实现了自动建模,但剂量计算中神经元数量巨大,因此计算效率不高。The existing Monte Carlo (Monte Carlo) algorithm represents an algorithm based on the basic principle of particle interaction to simulate sampling to obtain the injection dose distribution. Although the accuracy is high, the calculation efficiency is low due to the large amount of particles in the dose calculation. In addition, there is an existing calculation method of fluence spectrum distribution, which realizes automatic modeling by building a dose calculation model based on a deep learning model, using medical machine parameters as input, and training the dose calculation model through dose information in water. The number of elements is huge, so it is not computationally efficient.
发明内容Contents of the invention
本发明提供了一种注量谱分布计算建模、注量谱分布计算方法及装置,以解决注量谱计算中,计算效率和计算精度难以同时保证的技术问题。The invention provides a fluence spectrum distribution calculation modeling, a fluence spectrum distribution calculation method and a device to solve the technical problem that in the fluence spectrum calculation, the calculation efficiency and the calculation accuracy are difficult to guarantee at the same time.
为了解决上述技术问题,第一方面,本发明实施例提供了一种注量谱分布计算建模方法,包括:In order to solve the above technical problems, in the first aspect, the embodiment of the present invention provides a computational modeling method for fluence spectrum distribution, including:
搜集图像数据,根据图像数据完成蒙特卡罗模拟计算,获得训练数据,所述训练数据包括粒子的入射注量谱分布和出射注量谱分布;Collecting image data, completing Monte Carlo simulation calculations according to the image data, and obtaining training data, the training data includes the distribution of the injection dose spectrum and the distribution of the exit dose spectrum of the particles;
根据所述入射注量谱分布,对所述图像数据进行预处理,生成训练输入数据;Preprocessing the image data according to the distribution of the injection dose spectrum to generate training input data;
基于图形处理器构建初始神经网络模型,并根据训练输入数据和训练数据对所述初始神经网络模型进行重复训练和评估,并更新模型参数;Constructing an initial neural network model based on a graphics processor, and repeatedly training and evaluating the initial neural network model according to training input data and training data, and updating model parameters;
直至达到预设条件后,停止训练迭代,保存模型参数,以完成神经网络模型的构建。Until the preset condition is reached, the training iteration is stopped and the model parameters are saved to complete the construction of the neural network model.
本发明通过蒙特卡罗模拟计算,获取粒子的入射注量谱分布和出射注量谱分布,并将蒙特卡罗模拟计算结果作为神经网络模型训练的目标,优化神经网络模型,提高模型计算精度,同时采用经过预处理的图像数据,通过图形处理器构建神经网络模型处理数据,能够并行处理注量谱分布计算中神经网络模型训练或应用产生的大量的神经元计算任务,提高注量谱分布计算效率。The present invention obtains the distribution of the injection dose spectrum and the distribution of the exit dose spectrum of the particles through Monte Carlo simulation calculation, and uses the Monte Carlo simulation calculation result as the target of neural network model training, optimizes the neural network model, and improves the calculation accuracy of the model. At the same time, the preprocessed image data is used to build a neural network model to process data through a graphics processor, which can parallelly process a large number of neuron computing tasks generated by neural network model training or application in the fluence spectrum distribution calculation, and improve the fluence spectrum distribution calculation. efficiency.
进一步地,所述搜集图像数据,根据图像数据完成蒙特卡罗模拟计算,获得训练数据,所述训练数据包括粒子的入射注量谱分布和出射注量谱分布,具体为:Further, the image data is collected, the Monte Carlo simulation calculation is completed according to the image data, and the training data is obtained, and the training data includes the distribution of the injection dose spectrum and the distribution of the exit dose spectrum of the particles, specifically:
搜集图像数据,根据图像数据获取粒子信息,所述粒子信息包括介质条件、源的条件和粒子与介质相互作用的截面数据;Collecting image data, and obtaining particle information according to the image data, the particle information includes medium conditions, source conditions, and cross-sectional data of particle-medium interaction;
随机设置射野条件,并根据粒子信息对粒子进行模拟抽样,完成蒙特卡罗模拟计算,获得粒子的入射注量谱分布和出射注量谱分布;将所述入射注量谱分布和出射注量谱分布作为训练数据。Randomly set shot field conditions, simulate and sample particles according to the particle information, complete Monte Carlo simulation calculations, and obtain the distribution of the input and output fluence spectra of the particles; The spectral distribution is used as training data.
本发明通过图像数据获取粒子信息,并根据粒子信息和随机设置的射野条件完成蒙特卡罗模拟计算,记录蒙特卡罗模拟中的入射注量谱分布和出射注量谱分布,将其作为神经网络模型的训练样本和训练目标,不断优化神经网络模型,提高了神经网络模型计算注量谱分布的精度。The present invention acquires particle information through image data, completes Monte Carlo simulation calculations according to particle information and randomly set field conditions, records the distribution of the injection dose spectrum and the distribution of the exit dose spectrum in the Monte Carlo simulation, and uses it as a neuron The training samples and training targets of the network model are continuously optimized to improve the accuracy of the neural network model in calculating the distribution of the fluence spectrum.
进一步地,所述根据所述入射注量谱分布,对所述图像数据进行预处理,生成训练输入数据,具体为:Further, according to the distribution of the injection dose spectrum, the image data is preprocessed to generate training input data, specifically:
将所述图像数据转换为电子密度分布图,并根据粒子的入射注量谱分布,构建入射注量谱分布矩阵;converting the image data into an electron density distribution map, and constructing an incident fluence spectrum distribution matrix according to the particle fluence spectrum distribution;
基于电子密度分布图,构建空间物理距离矩阵;Based on the electron density distribution map, construct a spatial physical distance matrix;
将所述电子密度分布图、空间物理距离矩阵和入射注量谱分布矩阵进行连接整合,得到训练输入数据。The electron density distribution map, the spatial physical distance matrix and the incident fluence spectrum distribution matrix are connected and integrated to obtain training input data.
本发明通过对图像数据进行预处理,整合图像数据,使得不同量纲的数据在相近的范围内,以使后续神经网络模型的训练过程有更快的收敛速度,提高模型训练效率,提高模型计算注量谱分布的效率。The present invention preprocesses the image data and integrates the image data, so that the data of different dimensions are in a similar range, so that the training process of the subsequent neural network model has a faster convergence speed, improves the model training efficiency, and improves the model calculation. Efficiency of the fluence spectrum distribution.
进一步地,所述基于电子密度分布图,构建空间物理距离矩阵,具体为:Further, the construction of a spatial physical distance matrix based on the electron density distribution map is specifically:
根据电子密度分布图获取电子密度网格每个网格点对应的物理坐标,计算每个网格点与放射源的距离和放射源归一化距离,并构建源距离平方反比因子矩阵;Obtain the physical coordinates corresponding to each grid point of the electron density grid according to the electron density distribution map, calculate the distance between each grid point and the radioactive source and the normalized distance of the radioactive source, and construct the inverse square factor matrix of the source distance;
根据电子密度分布图获取电子密度网格每个网格点对应的物理坐标,计算每个网格点到放射源所在中心轴的垂直距离,构建离轴距离矩阵;Obtain the physical coordinates corresponding to each grid point of the electron density grid according to the electron density distribution map, calculate the vertical distance from each grid point to the central axis of the radioactive source, and construct an off-axis distance matrix;
将所述源距离平方反比因子矩阵和所述离轴距离矩阵进行链接合并,获得空间物理距离矩阵。Linking and merging the source distance inverse square factor matrix and the off-axis distance matrix to obtain a spatial physical distance matrix.
进一步地,在所述基于图形处理器构建初始神经网络模型,并根据训练输入数据和训练数据对所述初始神经网络模型进行重复训练和评估,并更新模型参数之前,还包括:Further, before the initial neural network model is constructed based on the graphics processor, and the initial neural network model is repeatedly trained and evaluated according to the training input data and the training data, and the model parameters are updated, it also includes:
根据所述训练数据获得初始训练集和评估集;obtaining an initial training set and an evaluation set according to the training data;
对所述初始训练集进行扩充,随机抽取初始训练集中的多组入射注量谱分布和对应的出射注量谱分布作为扩充数据集;对扩充数据集中的入射注量谱分布和出射注量谱分布分别进行线性叠加,得到扩充入射注量谱分布和对应的扩充出射注量谱分布,并将所述扩充入射注量谱分布和所述扩充出射注量谱分布加入目标训练集,完成一次数据扩充;Expanding the initial training set, randomly extracting multiple groups of injection dose spectrum distributions and corresponding exit dose spectrum distributions in the initial training set as the expanded data set; The distributions are respectively linearly superimposed to obtain the expanded injection volume spectrum distribution and the corresponding expanded injection volume spectrum distribution, and the expanded injection volume spectrum distribution and the expanded injection volume spectrum distribution are added to the target training set to complete a data expansion;
多次重复数据扩充,直至初始训练集中所有入射注量谱分布和对应的出射注量谱均被抽取过,且所述目标训练集中的样本数量达到预设条件,停止数据扩充,得到目标训练集;所述目标训练集中还包括初始训练集。Repeat the data expansion several times until all the distributions of the injection dose spectra and the corresponding output dose spectra in the initial training set have been extracted, and the number of samples in the target training set reaches the preset condition, stop the data expansion, and obtain the target training set ; The target training set also includes an initial training set.
本发明通过对训练数据进行划分获取初始训练集和评估集,并对初始训练集进行扩充,避免模型的过拟合,尽可能地提升模型的泛化能力。此外,对训练集中的样本进行扩充增加样本数量,提升了样本的多样性,避免了蒙特卡罗模拟计算效率低导致的样本获取效率不高的问题。The present invention obtains an initial training set and an evaluation set by dividing the training data, and expands the initial training set to avoid over-fitting of the model and improve the generalization ability of the model as much as possible. In addition, expanding the samples in the training set increases the number of samples, improves the diversity of samples, and avoids the problem of low sample acquisition efficiency caused by low Monte Carlo simulation calculation efficiency.
进一步地,所述基于图形处理器构建初始神经网络模型,并根据训练输入数据和训练数据对所述初始神经网络模型进行重复训练和评估,并更新模型参数,具体为:Further, the initial neural network model is constructed based on the graphics processor, and the initial neural network model is repeatedly trained and evaluated according to the training input data and training data, and the model parameters are updated, specifically:
基于图形处理器,构建初始神经网络模型,随即设置模型权值,采用自适应梯度方法对初始神经网络模型进行训练迭代;Based on the graphics processor, the initial neural network model is constructed, and then the model weights are set, and the initial neural network model is trained and iterated using the adaptive gradient method;
在训练输入数据集中随机抽取多个数据样本,将所述多个数据样本输入初始神经网络模型,获取模型输出的第一出射注量谱分布;Randomly extracting a plurality of data samples in the training input data set, inputting the plurality of data samples into the initial neural network model, and obtaining the first injection volume spectrum distribution output by the model;
在目标训练集中获取与所述多个数据样本的入射注量谱分布对应的第二出射注量谱分布;Obtaining a second outgoing fluence spectrum distribution corresponding to the incoming fluence spectrum distribution of the plurality of data samples in the target training set;
根据第一出射注量谱分布和第二出射注量谱分布,计算损失值,基于损失值更新模型权值;Calculate the loss value according to the distribution of the first injection dose spectrum and the second distribution of the injection dose spectrum, and update the model weight based on the loss value;
直至训练输入数据中所有数据样本均被抽取过,保存模型权值,基于评估集更新模型权值。Until all the data samples in the training input data are extracted, the model weights are saved, and the model weights are updated based on the evaluation set.
本发明通过图形处理器构建神经网络模型处理数据,能够并行处理大量的神经元计算任务,提高注量谱分布计算效率。同时通过自适应梯度算法进行模型参数的迭代优化,计算出射注量谱分布的损失值,并更新模型的权值,提高模型的精度。The invention uses a graphics processor to construct a neural network model to process data, can process a large number of neuron calculation tasks in parallel, and improves the calculation efficiency of fluence spectrum distribution. At the same time, the iterative optimization of the model parameters is carried out through the adaptive gradient algorithm, the loss value of the injection volume spectrum distribution is calculated, and the weight of the model is updated to improve the accuracy of the model.
进一步地,所述基于评估集更新模型权值,具体为:Further, the updating of model weights based on the evaluation set is specifically:
计算评估集数据样本的当前训练周期的损失值;Calculate the loss value for the current training cycle of the evaluation set data sample;
比较当前训练周期的损失值和上一周期的损失值,若当前训练周期的损失值小于上一周期的损失值,更新保存的模型权值,否则不对模型权值进行更新。Compare the loss value of the current training cycle with the loss value of the previous cycle. If the loss value of the current training cycle is smaller than the loss value of the previous cycle, update the saved model weights, otherwise the model weights are not updated.
本发明通过将经蒙特卡罗模拟计算获得的训练数据作为评估集,评估模型的损失值,对模型的权值进行优化更新,提高模型的精度,提高注量谱分布计算的精度。The invention uses the training data obtained through Monte Carlo simulation calculation as an evaluation set, evaluates the loss value of the model, optimizes and updates the weight value of the model, improves the accuracy of the model, and improves the accuracy of the fluence spectrum distribution calculation.
第二方面,本发明实施例提供了一种注量谱分布计算方法,包括:In a second aspect, an embodiment of the present invention provides a method for calculating a fluence spectrum distribution, including:
获取应用所述的注量谱分布计算建模方法所构建的神经网络模型;Obtaining the neural network model constructed by applying the described fluence spectrum distribution computational modeling method;
获取待检测的第一图像数据,所述第一图像数据包括影像信息或几何信息;并对所述第一图像数据做预处理,得到第一输入数据;Acquiring first image data to be detected, the first image data including image information or geometric information; and performing preprocessing on the first image data to obtain first input data;
将所述第一输入数据输入至所述神经网络模型中,计算出射注量谱分布矩阵;Inputting the first input data into the neural network model to calculate the distribution matrix of the injection volume spectrum;
对所述出射注量谱分布矩阵还原为绝对值,完成出射注量谱分布计算。Restore the distribution matrix of the injection dose spectrum to an absolute value, and complete the calculation of the distribution of the distribution of the injection dose spectrum.
本发明通过根据图像数据进行预处理,获取模型输入数据,并根据神经网络模型计算注量谱分布,提高了注量谱分布计算的效率,并且所述神经网络模型将蒙特卡罗模拟计算的样本作为训练数据,保证了所述神经网络模型计算注量谱分布的精度。The present invention obtains model input data by preprocessing according to the image data, and calculates the fluence spectrum distribution according to the neural network model, thereby improving the efficiency of the calculation of the fluence spectrum distribution, and the neural network model uses the samples calculated by Monte Carlo simulation As the training data, the accuracy of calculating the fluence spectrum distribution by the neural network model is guaranteed.
第三方面,本发明实施例提供了一种注量谱分布计算建模装置,包括:模拟计算模块、数据预处理模块和迭代训练模块;In the third aspect, the embodiment of the present invention provides a fluence spectrum distribution calculation and modeling device, including: a simulation calculation module, a data preprocessing module and an iterative training module;
所述模拟计算模块,用于搜集图像数据,根据图像数据完成蒙特卡罗模拟计算,获得训练数据,所述训练数据包括粒子的入射注量谱分布和出射注量谱分布;The simulation calculation module is used to collect image data, complete Monte Carlo simulation calculation according to the image data, and obtain training data, and the training data includes the distribution of the injection dose spectrum and the distribution of the exit dose spectrum of particles;
所述数据预处理模块,用于根据所述入射注量谱分布,对所述图像数据进行预处理,生成训练输入数据;The data preprocessing module is used to preprocess the image data according to the distribution of the injection dose spectrum to generate training input data;
所述迭代训练模块,用于基于图形处理器构建初始神经网络模型,并根据训练输入数据和训练数据对所述初始神经网络模型进行重复训练和评估,并更新模型参数;直至达到预设条件后,停止训练迭代,保存模型参数,以完成神经网络模型的构建。The iterative training module is used to construct an initial neural network model based on a graphics processor, and perform repeated training and evaluation on the initial neural network model according to training input data and training data, and update model parameters; until preset conditions are reached , stop the training iteration, and save the model parameters to complete the construction of the neural network model.
第四方面,本发明实施例提供了一种注量谱分布计算装置,包括:模型构建模块、数据处理模块、数据计算模块和归一化处理模块;In a fourth aspect, an embodiment of the present invention provides a fluence spectrum distribution computing device, including: a model building module, a data processing module, a data computing module, and a normalization processing module;
所述模型构建模块,用于获取应用所述的注量谱分布计算建模装置所构建的神经网络模型;The model construction module is used to obtain the neural network model constructed by applying the fluence spectrum distribution computing modeling device;
所述数据处理模块,用于获取图像数据,所述图像数据包括影像信息或几何信息;并对所述图像数据做预处理,得到模型输入数据;The data processing module is used to acquire image data, the image data includes image information or geometric information; and preprocesses the image data to obtain model input data;
所述数据计算模块,用于将所述模型输入数据输入至所述神经网络模型中,计算出射注量谱分布矩阵;The data calculation module is used to input the model input data into the neural network model to calculate the injection volume spectrum distribution matrix;
所述归一化处理模块,用于对所述出射注量谱分布矩阵还原为绝对值,完成出射注量谱分布计算。The normalization processing module is used to restore the distribution matrix of the injection dose spectrum to an absolute value, and complete the calculation of the distribution of the distribution of the injection dose spectrum.
附图说明Description of drawings
图1为本发明实施例提供的注量谱分布计算建模方法的一种流程示意图;Fig. 1 is a schematic flow chart of a method for calculating and modeling fluence spectrum distribution provided by an embodiment of the present invention;
图2为本发明实施例提供的步骤102提供的一种流程示意图;Fig. 2 is a schematic flow chart provided by
图3为本发明实施例提供的注量谱分布计算方法的一种流程示意图;FIG. 3 is a schematic flow chart of a calculation method for fluence spectrum distribution provided by an embodiment of the present invention;
图4为本发明实施例提供的注量谱分布计算建模装置的一种结构示意图;Fig. 4 is a schematic structural diagram of a fluence spectrum distribution calculation and modeling device provided by an embodiment of the present invention;
图5为本发明实施例提供的注量谱分布计算装置的一种结构示意图。Fig. 5 is a schematic structural diagram of a fluence spectrum distribution computing device provided by an embodiment of the present invention.
具体实施方式Detailed ways
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without creative efforts fall within the protection scope of the present invention.
实施例一Embodiment one
请参照图1,图1为本发明实施例提供的注量谱分布计算建模方法的一种流程示意图,其主要包括步骤101至步骤103,具体如下:Please refer to FIG. 1. FIG. 1 is a schematic flow chart of the fluence spectrum distribution calculation and modeling method provided by the embodiment of the present invention, which mainly includes
步骤101:搜集图像数据,根据图像数据完成蒙特卡罗模拟计算,获得训练数据,所述训练数据包括粒子的入射注量谱分布和出射注量谱分布。Step 101: Collecting image data, completing Monte Carlo simulation calculations based on the image data, and obtaining training data, the training data includes the distribution of the particle's injection dose spectrum and the distribution of the exit dose spectrum.
在本实施例中,蒙特卡罗模拟计算需要的条件包含三部分:一部分是介质条件(包含介质几何,介质材料,介质的密度),第二部分是源的条件(包含粒子的种类:例如光子、带电粒子、中子,粒子方向,粒子能量),第三部分是粒子与介质相互作用的截面数据,该部分可通过查阅公开的数据库获得,例如美国国家标准与技术研究院(National Institute ofStandards and Technology,NIST)。In this embodiment, the conditions required for Monte Carlo simulation calculations include three parts: one part is the medium condition (comprising medium geometry, medium material, and medium density), and the second part is the condition of the source (comprising the type of particle: for example photon , charged particles, neutrons, particle direction, particle energy), the third part is the cross-sectional data of particle-medium interaction, which can be obtained by consulting public databases, such as the National Institute of Standards and Technology (National Institute of Standards and Technology, NIST).
在本实施例中,对于第一部分,如果所搜集的人体各个部位,根据影像数据密度分布,直接赋予介质密度,然后根据密度范围赋予介质材料(例如0.001~0.044定义为空气,0.044~0.302定义为肺组织,0.302~1.101定义为软组织,1.101~2.088定义为骨组织)如果是设计图纸,则根据图纸还原介质几何分布,介质成分和密度根据图纸材料成分说明直接赋予。对于第二部分,根据源照射范围(射野范围,强度分布),源能量以及种类进行模拟抽样。In this embodiment, for the first part, if the various parts of the collected human body are collected, according to the density distribution of the image data, the medium density is directly assigned, and then the medium material is assigned according to the density range (for example, 0.001~0.044 is defined as air, 0.044~0.302 is defined as For lung tissue, 0.302-1.101 is defined as soft tissue, and 1.101-2.088 is defined as bone tissue). If it is a design drawing, the geometric distribution of the medium is restored according to the drawing, and the composition and density of the medium are directly given according to the material composition description of the drawing. For the second part, analog sampling is performed according to the source irradiation range (field range, intensity distribution), source energy and type.
在本实施例中,搜集图像数据,所述图像数据包含人体各个部位,例如头颈、胸部、腹部、盆腔等不同人体部位的CT/MR影像数据,或者相关设计图纸。In this embodiment, image data is collected, and the image data includes various parts of the human body, such as CT/MR image data of different human body parts such as the head and neck, chest, abdomen, and pelvis, or related design drawings.
作为本发明实施例的一种具体举例,在根据图像数据完成蒙特卡罗模拟计算之前,还包括对所述图像数据进行扩充,具体包括:As a specific example of the embodiment of the present invention, before completing the Monte Carlo simulation calculation according to the image data, it also includes expanding the image data, specifically including:
对收集总数为N的原始图像数据按顺序进行编号;Sequentially number the original image data collected with a total number of N;
把按顺序排列的编号进行打乱;Scramble the numbers arranged in sequence;
从打乱的编号中顺序抽取B个编号,并根据抽取的编号获取对应的原始图像数据;Sequentially extract B numbers from the scrambled numbers, and obtain corresponding original image data according to the extracted numbers;
通过对所述抽取的B个图像数据进行线性叠加,获取新的图像数据;Acquiring new image data by linearly superimposing the extracted B pieces of image data;
当所有原始图像数据均被遍历完成一次影像数据扩充;When all original image data are traversed to complete an image data expansion;
多次重复影像数据扩充,生成新的图像数据,直到生成满足需求的新图像数据数量。Repeat the expansion of image data multiple times to generate new image data until the amount of new image data that meets the requirements is generated.
在本实施例中,对原始图像数据进行线性叠加,获取新的图像数据,具体为:In this embodiment, the original image data is linearly superimposed to obtain new image data, specifically:
其中,Ik为所抽取的原始样本图像,xk的叠加权重,为0~1的随机浮点数,同时xk满足以下条件:Among them, I k is the extracted original sample image, the overlay weight of x k is a random floating point number from 0 to 1, and x k satisfies the following conditions:
在本实施例中,根据扩充后的图像数据,采用蒙特卡罗算法,模拟计算训练数据。根据图像数据获取粒子信息,所述粒子信息包括介质条件、源的条件和粒子与介质相互作用的截面数据。In this embodiment, according to the expanded image data, a Monte Carlo algorithm is used to simulate and calculate the training data. The particle information is obtained according to the image data, and the particle information includes medium condition, source condition and cross-section data of interaction between the particle and the medium.
在本实施例中,进行蒙特卡罗模拟计算时,随机设置射野条件,所述射野条件包括射野形状,强度分布,入射角度以及入射能量;根据源的能谱及照射范围对模拟粒子的能量及方向进行抽样,并模拟粒子穿透介质的过程,经过足够数量粒子模拟后(本实施例采用109个粒子模拟完成一个样本),分别记录进入介质前入射注量谱分布以及离开介质的出射注量谱分布作为训练数据。In this embodiment, when performing Monte Carlo simulation calculations, the field conditions are randomly set, and the field conditions include field shape, intensity distribution, incident angle, and incident energy; The energy and direction of the sample are sampled, and the process of particles penetrating the medium is simulated. After a sufficient number of particle simulations (10 9 particles are used in this embodiment to simulate a sample), the distribution of the incident fluence spectrum before entering the medium and leaving the medium are recorded respectively. The injection dose spectrum distribution of is used as training data.
在本实施例中,通过图像数据获取粒子信息,并根据粒子信息和随机设置的射野条件完成蒙特卡罗模拟计算,记录蒙特卡罗模拟中的入射注量谱分布和出射注量谱分布,将其作为神经网络模型的训练样本和训练目标,不断优化神经网络模型,提高了神经网络模型计算注量谱分布的精度。In this embodiment, the particle information is acquired through the image data, and the Monte Carlo simulation calculation is completed according to the particle information and the randomly set field conditions, and the distribution of the injection dose spectrum and the distribution of the exit dose spectrum in the Monte Carlo simulation are recorded. Using it as the training sample and training target of the neural network model, the neural network model is continuously optimized, and the accuracy of the neural network model to calculate the distribution of the fluence spectrum is improved.
步骤102:根据所述入射注量谱分布,对所述图像数据进行预处理,生成训练输入数据。Step 102: Perform preprocessing on the image data according to the distribution of the injection dose spectrum to generate training input data.
请参照图2,图2为本发明实施例提供的步骤102提供的一种流程示意图,其主要包括步骤201至步骤203,具体如下:Please refer to FIG. 2. FIG. 2 is a schematic flow diagram of
步骤201:将所述图像数据转换为电子密度分布图,并根据粒子的入射注量谱分布,构建入射注量谱分布矩阵。Step 201: converting the image data into an electron density distribution map, and constructing an incident fluence spectral distribution matrix according to the incident fluence spectral distribution of particles.
在本实施例中,根据影像或几何信息,转换为电子密度分布图,所述影像图像为CT(Computed Tomography,电子计算机断层扫描)图像,根据采集CT图像的机器的HU-电子密度转换曲线把CT图像的HU值转换成电子密度分布。(或者根据MR(Magnetic Resonance,磁共振)影像信息,根据不同介质赋予电子密度,例如:空气:0.001,肺组织:0.4,脂肪组织:0.9,水:1.0,肌肉组织:1.05,骨组织:1.69。或者可以根据已知的结构几何,例如根据机房防护墙图纸赋予厚度以及对应水泥墙电子密度,或者医用直线加速器机头结构,例如多页光栅的结构位置等)把电子密度分布插值成100×100×100(长×宽×高),每个网格物理尺寸为0.5cm×0.5cm×0.5cm。In this embodiment, according to the image or geometric information, it is converted into an electron density distribution map, the image image is a CT (Computed Tomography, computerized tomography) image, according to the HU-electron density conversion curve of the machine that collects the CT image The HU value of the CT image is converted into an electron density distribution. (Or according to MR (Magnetic Resonance, Magnetic Resonance) image information, give electron density according to different media, for example: air: 0.001, lung tissue: 0.4, fat tissue: 0.9, water: 1.0, muscle tissue: 1.05, bone tissue: 1.69 Or the electron density distribution can be interpolated into 100× according to the known structural geometry, such as giving the thickness according to the drawing of the protective wall of the computer room and the electron density of the corresponding cement wall, or the structure of the head of the medical linear accelerator, such as the structural position of the multi-page grating, etc. 100×100 (length×width×height), the physical size of each grid is 0.5cm×0.5cm×0.5cm.
在本实施例中,构建粒子进入模体前的入射注量谱分布矩阵F具体为:粒子注量定义为单位面积垂直通过记录平面的粒子数,注量谱分布是指对记录平面划分多个记录网格,记录每个网格中不同能量区间的注量。构建一个网格数量为100×100×100(长×宽×能量)的矩阵,其中空间物理维度尺寸为50cm×50cm,网格数量为100×100,在空间维度每个网格大小为0.5cm×0.5cm,在能量维度范围为0~20MeV,划分100个区间,每个能量区间间隔为0.2MeV。分别记录各个记录网格各个能量区间内粒子的注量获得入射注量谱分布矩阵Fin。入射注量谱可以有以下办法获得,第一种,当已知源种类(例如点源或者平行束源),源的粒子种类(光子或者带电粒子)以及能谱,可以直接根据确定几何关系,根据注量定义,计算源所发出的粒子到进入体模前记录平面入射注量谱分布。第二种根据保存有记录平面的相空间文件(相空间文件是保存记录平面中所有粒子的状态,包括粒子种类、运动方向、能量、以及位置)统计该平面的注量谱分布。In this embodiment, the construction of the incident fluence spectral distribution matrix F before the particles enter the phantom is specifically: the particle fluence is defined as the number of particles passing through the recording plane per unit area vertically, and the fluence spectral distribution refers to dividing the recording plane into multiple Record the grid, and record the fluence of different energy intervals in each grid. Construct a matrix with the number of grids 100×100×100 (length×width×energy), where the spatial physical dimension is 50cm×50cm, the number of grids is 100×100, and the size of each grid in the spatial dimension is 0.5cm ×0.5cm, the energy dimension ranges from 0 to 20MeV, divided into 100 intervals, and the interval between each energy interval is 0.2MeV. The fluence of particles in each energy interval of each recording grid is recorded respectively to obtain the distribution matrix F in of the incident fluence spectrum. The incident fluence spectrum can be obtained in the following ways. First, when the source type (such as point source or parallel beam source), the source particle type (photon or charged particle) and the energy spectrum are known, the geometric relationship can be determined directly according to According to the fluence definition, the particle emitted by the calculation source is recorded before entering the phantom and the plane incident fluence spectral distribution is recorded. The second is to count the fluence spectrum distribution of the plane according to the phase space file that saves the recording plane (the phase space file is to save the state of all particles in the recording plane, including particle type, motion direction, energy, and position).
步骤202:基于电子密度分布图,构建空间物理距离矩阵。Step 202: Construct a spatial physical distance matrix based on the electron density distribution map.
在本实施例中,为了描述电子密度分布所对应的空间位置,根据电子密度网格每个网格点所对应的物理坐标,构建空间物理距离矩阵,矩阵大小为100×100×100(长×宽×高),具体方法如下:In this embodiment, in order to describe the spatial position corresponding to the electron density distribution, according to the physical coordinates corresponding to each grid point of the electron density grid, a spatial physical distance matrix is constructed, and the size of the matrix is 100×100×100 (length× Width × height), the specific method is as follows:
空间物理矩阵包含两部分,一部分是源距离平方反比因子,计算公式如下:The spatial physical matrix consists of two parts, one part is the inverse square factor of the source distance, and the calculation formula is as follows:
其中,rijk为(i,j,k)网格点与放射源距离,r0为放射源归一化(标准化)距离(一般为100cm)。Among them, rijk is the distance between the (i, j, k) grid point and the radioactive source, and r0 is the normalized (standardized) distance of the radioactive source (generally 100cm).
另一部分是离轴距离矩阵,计算公式如下:The other part is the off-axis distance matrix, the calculation formula is as follows:
其中,d为(i,j,k)网格到源所在中心轴的垂直距离,d0为矩阵总长度的一半,本实施例为25cm。Wherein, d is the vertical distance from the (i, j, k) grid to the central axis where the source is located, and d0 is half of the total length of the matrix, which is 25 cm in this embodiment.
最后,将两部分矩阵链接合并成大小为100×100×100×2的空间物理距离矩阵。Finally, the two-part matrix links are merged into a spatial physical distance matrix of size 100×100×100×2.
步骤203:将所述电子密度分布图、空间物理距离矩阵和入射注量谱分布矩阵进行连接整合,得到训练输入数据。Step 203: Connecting and integrating the electron density distribution map, the spatial physical distance matrix and the injection dose spectrum distribution matrix to obtain training input data.
在本实施例中,获取电子密度分布图,空间物理距离矩阵以及入射注量谱分布后,分别将其作为数据通道进行整合,最终输入矩阵为100×100×100×4,为了使训练过程有更快的收敛速度,让不同量纲的数据在相近范围内,例如在0~1之间,对数据按照各自对应最大值进行归一化,电子密度分布最大值为2,入射注量谱分布按照最大值Fmax,in进行归一。In this embodiment, after obtaining the electron density distribution map, the spatial physical distance matrix, and the distribution of the incident fluence spectrum, they are respectively integrated as data channels, and the final input matrix is 100×100×100×4. In order to make the training process efficient Faster convergence speed, so that data of different dimensions are in a similar range, such as between 0 and 1, normalize the data according to their respective maximum values, the maximum value of the electron density distribution is 2, and the distribution of the incident injection spectrum Normalize according to the maximum value F max,in .
步骤103:基于图形处理器构建初始神经网络模型,并根据训练输入数据和训练数据对所述初始神经网络模型进行重复训练和评估,并更新模型参数;直到达到预设条件停止训练迭代,保存模型参数,以完成神经网络模型的构建。Step 103: Construct an initial neural network model based on a graphics processor, and perform repeated training and evaluation on the initial neural network model according to training input data and training data, and update model parameters; stop training iterations until preset conditions are reached, and save the model parameters to complete the construction of the neural network model.
在本实施例中,在所述基于图形处理器构建初始神经网络模型,并根据训练输入数据和训练数据对所述初始神经网络模型进行重复训练和评估,并更新模型参数之前,还包括:In this embodiment, before the initial neural network model is constructed based on the graphics processor, and the initial neural network model is repeatedly trained and evaluated according to the training input data and training data, and before the model parameters are updated, it also includes:
将训练数据中的样本量按9:1的比例分为初始训练集和评估集。The sample size in the training data is divided into an initial training set and an evaluation set at a ratio of 9:1.
对所述初始训练集进行扩充,随机抽取初始训练集中的多组入射注量谱分布和对应的出射注量谱分布作为扩充数据集;对扩充数据集中的入射注量谱分布和出射注量谱分布分别进行线性叠加,得到扩充入射注量谱分布和对应的扩充出射注量谱分布,并将所述扩充入射注量谱分布和所述扩充出射注量谱分布加入目标训练集,完成一次数据扩充;Expanding the initial training set, randomly extracting multiple groups of injection dose spectrum distributions and corresponding exit dose spectrum distributions in the initial training set as the expanded data set; The distributions are respectively linearly superimposed to obtain the expanded injection volume spectrum distribution and the corresponding expanded injection volume spectrum distribution, and the expanded injection volume spectrum distribution and the expanded injection volume spectrum distribution are added to the target training set to complete a data expansion;
多次重复数据扩充,直至初始训练集中所有入射注量谱分布和对应的出射注量谱均被抽取过,且所述目标训练集中的样本数量达到预设条件,停止数据扩充,得到目标训练集;所述目标训练集中还包括初始训练集。Repeat the data expansion several times until all the distributions of the injection dose spectra and the corresponding output dose spectra in the initial training set have been extracted, and the number of samples in the target training set reaches the preset condition, stop the data expansion, and obtain the target training set ; The target training set also includes an initial training set.
作为本实施例的一种具体举例,所述数据扩充具体为:As a specific example of this embodiment, the data expansion is specifically:
对所述初始训练集中总数量为M的入射注量谱分布与所对应的出射注量谱分布按顺序进行编号;Sequentially numbering the distribution of the injection dose spectrum and the corresponding distribution of the injection dose spectrum in the initial training set whose total number is M;
把按顺序排列的编号进行打乱,从打乱的编号中顺序抽取B个编号,并根据编号获取相应的原始样本,所述原始样本为入射注量谱分布与所对应的出射注量谱分布;Scramble the numbers arranged in order, extract B numbers sequentially from the scrambled numbers, and obtain the corresponding original samples according to the numbers. ;
通过对所抽取B个样本继续线性叠加,获取新输入样本Sin及输出样本Sout;Obtain a new input sample S in and an output sample S out by continuing to linearly superpose the extracted B samples;
当所有原始样本均被遍历,完成一次数据扩充。When all original samples are traversed, a data augmentation is completed.
在本实施例中,多次进行数据扩充,进行新样本生成,直到生成满足需要的新注量样本数量。In this embodiment, data expansion is performed multiple times, and new samples are generated until a number of new fluence samples meeting requirements is generated.
作为本实施例的一种具体举例,对所述原始样本进行线性叠加,具体如下:As a specific example of this embodiment, the original samples are linearly superimposed, as follows:
其中Fin,k为所抽取的原始样本入射注量谱分布,Fout,k为所抽取的原始样本出射注量谱分布,yk的叠加权重,为0~1的随机浮点数,同时yk满足以下条件:Among them, F in,k is the distribution of the injection dose spectrum of the original sample extracted, F out,k is the distribution of the injection dose spectrum of the original sample extracted, the superposition weight of y k is a random floating point number from 0 to 1, and y k satisfies the following conditions:
在本实施例中,所述基于图形处理器构建初始神经网络模型,并根据训练输入数据和训练数据对所述初始神经网络模型进行重复训练和评估,并更新模型参数,具体为:In this embodiment, the initial neural network model is constructed based on the graphics processor, and the initial neural network model is repeatedly trained and evaluated according to the training input data and training data, and the model parameters are updated, specifically:
基于图形处理器,构建初始神经网络模型,随即设置模型权值,采用自适应梯度方法对初始神经网络模型进行训练迭代;Based on the graphics processor, the initial neural network model is constructed, and then the model weights are set, and the initial neural network model is trained and iterated using the adaptive gradient method;
在训练输入数据集中随机抽取多个数据样本,将所述多个数据样本输入初始神经网络模型,获取模型输出的第一出射注量谱分布;Randomly extracting a plurality of data samples in the training input data set, inputting the plurality of data samples into the initial neural network model, and obtaining the first injection volume spectrum distribution output by the model;
在目标训练集中获取与所述多个数据样本的入射注量谱分布对应的第二出射注量谱分布;Obtaining a second outgoing fluence spectrum distribution corresponding to the incoming fluence spectrum distribution of the plurality of data samples in the target training set;
根据第一出射注量谱分布和第二出射注量谱分布,计算损失值,基于损失值更新模型权值;Calculate the loss value according to the distribution of the first injection dose spectrum and the second distribution of the injection dose spectrum, and update the model weight based on the loss value;
直至训练输入数据中所有数据样本均被抽取过,保存模型权值;Until all data samples in the training input data have been extracted, save the model weights;
计算评估集数据样本的当前训练周期的损失值;Calculate the loss value for the current training cycle of the evaluation set data sample;
比较当前训练周期的损失值和上一周期的损失值,若当前训练周期的损失值小于上一周期的损失值,更新保存的模型权值,否则不对模型权值进行更新。Compare the loss value of the current training cycle with the loss value of the previous cycle. If the loss value of the current training cycle is smaller than the loss value of the previous cycle, update the saved model weights, otherwise the model weights are not updated.
作为本实施例的一种具体举例,神经网络的构建采用的编码器-解码器的结构,编码器逐渐减少数据维度,识别图像特征,解码器逐步修复物体的细节和数据维度,逐像素进行预测。考虑到剂量计算是三维计算过程,采用三维VisionTransformer模块作为编码器。所述编码器深度为4层,除了第一层编码器的输入为模型输入,每一层编码器为上一层编码器的输出,经过第一层编码器,输出为50×50×50×32,经过第二层编码器,输出为25×25×25×64,经过第三层编码器,输出为12×12×12×128,第四层编码器,输出为6×6×6×256.采用三维三线性上采样结合残差卷积作为解码器。同一层编码器-解码器之间采用特征通道层进行连接,因此解码器输入通道数为解码器的2倍。第四层解码器输入为6×6×6×512,输出为12×12×12×128,第三层解码器输入为12×12×12×256,输出为25×25×25×64,第二层解码器输入为25×25×25×128,输出为50×50×50×32,第一层解码器输入50×50×50×64,输出为100×100×100×16。最后一层输出层通过卷积核大小为1的卷积层把特征层减少到1,为了保证最后输出范围>0,最后输出层采用relu激活函数。As a specific example of this embodiment, the construction of the neural network adopts an encoder-decoder structure, the encoder gradually reduces the data dimension, recognizes image features, and the decoder gradually repairs the details and data dimensions of the object, and predicts pixel by pixel . Considering that the dose calculation is a three-dimensional calculation process, the three-dimensional VisionTransformer module is used as the encoder. The depth of the encoder is 4 layers, except that the input of the encoder of the first layer is the model input, and the encoder of each layer is the output of the encoder of the previous layer. After passing through the encoder of the first layer, the output is 50×50×50× 32. After the second layer of encoder, the output is 25×25×25×64, after the third layer of encoder, the output is 12×12×12×128, and the fourth layer of encoder, the output is 6×6×6× 256. Using 3D Trilinear Upsampling Combined with Residual Convolution as a Decoder. The feature channel layer is used to connect the encoder-decoder of the same layer, so the number of input channels of the decoder is twice that of the decoder. The input of the fourth-layer decoder is 6×6×6×512, the output is 12×12×12×128, the input of the third-layer decoder is 12×12×12×256, and the output is 25×25×25×64, The input of the second-layer decoder is 25×25×25×128, the output is 50×50×50×32, the input of the first-layer decoder is 50×50×50×64, and the output is 100×100×100×16. The last output layer reduces the feature layer to 1 through a convolutional layer with a convolution kernel size of 1. In order to ensure that the final output range is >0, the final output layer uses the relu activation function.
在本实施例中,无论是神经网络模型的训练以及应用,都需要对每个神经元(模型最小计算单元,一般具体形式为y=wx+b,其中y为神经元输出,x为神经元输入,w与b为拟合参数)进行计算,该计算的特点是单个神经元计算简单但数量巨大,对于本发明所构建的神经网络,具体参数量为:30698775。图形处理器(GraphicsProcessingUnit,GPU)的最大优势是具有大量的处理单元,在不需要提高单个处理单元处理速度,可以有效并行计算完成多个神经元的计算任务。从而提高整体计算效率。In this embodiment, no matter the training and application of the neural network model, each neuron (the minimum calculation unit of the model, the general specific form is y=wx+b, where y is the output of the neuron, and x is the output of the neuron input, w and b are the fitting parameters) to calculate, the feature of this calculation is that the calculation of single neuron is simple but the quantity is huge, for the neural network constructed by the present invention, the specific parameter quantity is: 30698775. The biggest advantage of a graphics processor (Graphics Processing Unit, GPU) is that it has a large number of processing units, and it can effectively complete the computing tasks of multiple neurons in parallel computing without increasing the processing speed of a single processing unit. Thereby improving the overall computational efficiency.
在本实施例中,模型的训练过程采用自适应梯度方法进行模型参数迭代优化,设定初始学习速率为5e-4。采用均方差(mean squared error,MSE)作为损失函数,计算模型输出结果与训练样本的MSE损失值。训练过程每次迭代从训练集中随机抽取2个样本输入模型(根据计算机性能可以增加)对MSE求导,计算梯度方向更新模型参数。In this embodiment, the training process of the model adopts the adaptive gradient method to iteratively optimize the model parameters, and the initial learning rate is set to 5e-4. The mean squared error (MSE) is used as the loss function to calculate the MSE loss value of the model output and the training samples. In each iteration of the training process, two samples are randomly selected from the training set and input into the model (it can be increased according to the performance of the computer) to derive the MSE and calculate the gradient direction to update the model parameters.
在本实施例中,具体计算损失值具体如下:In this embodiment, the specific calculation of the loss value is as follows:
其中,yi为真实值即训练样本,yi′为模型输出值。Among them, y i is the real value, that is, the training sample, and y i ′ is the output value of the model.
在本实施例中,当对所有训练集样本都遍历一次后,固定模型参数,计算评估集样本的MSE损失值,并把模型参数进行保存,此时完成模型训练第一个周期。重新根据步骤对训练集继续新一轮扩充,进入训练第二个周期。从第二个周期开始,仅当评估集的MSE损失值比上一周期的MSE损失值更小,才更新保存的模型参数,以保证所保存的模型性能最优。In this embodiment, after traversing all the training set samples once, the model parameters are fixed, the MSE loss value of the evaluation set samples is calculated, and the model parameters are saved. At this time, the first cycle of model training is completed. Continue a new round of expansion of the training set according to the steps again, and enter the second cycle of training. From the second cycle, only when the MSE loss value of the evaluation set is smaller than the MSE loss value of the previous cycle, the saved model parameters are updated to ensure the optimal performance of the saved model.
在本实施例中,当训练周期达到上限(默认设为500)或评估集损失值连续10个周期没有下降则停止训练。In this embodiment, when the training period reaches the upper limit (the default is set to 500) or the loss value of the evaluation set has not decreased for 10 consecutive periods, the training is stopped.
请参照图3,图3为本发明实施例提供的注量谱分布计算方法的一种流程示意图,其主要包括步骤301至步骤304:Please refer to FIG. 3. FIG. 3 is a schematic flowchart of a calculation method for fluence spectrum distribution provided by an embodiment of the present invention, which mainly includes
步骤301:获取应用本发明实施例提供的注量谱分布计算建模方法所构建的神经网络模型;Step 301: Obtain the neural network model constructed by applying the fluence spectrum distribution calculation modeling method provided by the embodiment of the present invention;
步骤302:获取待检测的第一图像数据,所述第一图像数据包括影像信息或几何信息;并对所述第一图像数据做预处理,得到第一输入数据;Step 302: Acquire the first image data to be detected, the first image data includes image information or geometric information; and perform preprocessing on the first image data to obtain first input data;
步骤303:将所述第一输入数据输入至所述神经网络模型中,计算出射注量谱分布矩阵;Step 303: Input the first input data into the neural network model, and calculate the distribution matrix of the injection volume spectrum;
步骤304:对所述出射注量谱分布矩阵还原为绝对值,完成出射注量谱分布计算。Step 304: Restore the distribution matrix of the injection dose spectrum to an absolute value, and complete the calculation of the distribution of the distribution of the injection dose spectrum.
在本实施例中,所述神经网络模型输出数据为穿过电子密度分布所描述的体模后,射线离开体模的出射注量谱分布矩阵,输出网格数量为100×100×100(长×宽×能量)的矩阵,其中空间物理维度尺寸为50cm×50cm,网格数量为100×100,在空间维度每个网格大小为0.5cm×0.5cm,在能量维度范围为0~20MeV,划分100个区间,每个能量区间间隔为0.2MeV。分别记录各个记录网格中各个能量区间内粒子的注量,获得所述的出射注量谱分布矩阵Fout。对于训练数据为了保持输入数据中的入射注量谱分布与输出的出射注量谱分布在数值上的关联,根据产生所述的出射注量谱分布所对应的入射注量谱分布的归一值Fmax,in作为分母,进行归一计算。In this embodiment, the output data of the neural network model is the distribution matrix of the injection dose spectrum of the rays leaving the phantom after passing through the phantom described by the electron density distribution, and the number of output grids is 100×100×100 (long × width × energy) matrix, where the physical dimension of space is 50cm×50cm, the number of grids is 100×100, the size of each grid in the space dimension is 0.5cm×0.5cm, and the range in the energy dimension is 0-20MeV, Divide 100 intervals, each energy interval is 0.2MeV. The fluence of particles in each energy interval in each recording grid is recorded respectively, and the said outgoing fluence spectrum distribution matrix F out is obtained. For the training data, in order to maintain the numerical correlation between the distribution of the injection volume in the input data and the distribution of the output volume distribution in the output, according to the normalized value of the distribution of the injection volume corresponding to the distribution of the output volume F max, in is used as the denominator for normalized calculation.
在本实施例中,经过模型计算输出为归一化的出射注量谱分布矩阵Fout’,根据输入的入射注量谱分布的最大值进行还原为绝对值。In this embodiment, the output of the model calculation is a normalized output fluence spectral distribution matrix F out ', which is restored to an absolute value according to the maximum value of the input input fluence spectral distribution.
作为本实施例的一种具体举例,出射注量谱分布矩阵具体还原步骤为:As a specific example of this embodiment, the specific reduction steps of the distribution matrix of the injection dose spectrum are as follows:
Fout=Fout’*Fmax,in (9)F out =F out '*F max,in (9)
其中,Fin为所述输入的入射注量谱分布,Fmax,in为所述输入的入射注量谱分布的最大值,Fout’为经过模型计算,输出的归一化出射注量谱分布。Wherein, F in is the input injection volume spectrum distribution, F max,in is the maximum value of the input injection volume spectrum distribution, and F out ' is the normalized output volume spectrum calculated by the model distributed.
在本实施例中,通过根据图像数据进行预处理,获取模型输入数据,并根据神经网络模型计算注量谱分布,提高了注量谱分布计算的效率,并且所述神经网络模型将蒙特卡罗模拟计算的样本作为训练数据,保证了所述神经网络模型计算注量谱分布的精度。In this embodiment, by performing preprocessing according to the image data, obtaining model input data, and calculating the fluence spectrum distribution according to the neural network model, the efficiency of the calculation of the fluence spectrum distribution is improved, and the neural network model will be Monte Carlo The simulated and calculated samples are used as training data, which ensures the accuracy of the neural network model in calculating the distribution of the fluence spectrum.
请参照图4,图4为本发明实施例提供的注量谱分布计算建模装置的一种结构示意图,其主要包括模拟计算模块401、数据预处理模块402和迭代训练模块403;Please refer to FIG. 4. FIG. 4 is a schematic structural diagram of a fluence spectrum distribution calculation and modeling device provided by an embodiment of the present invention, which mainly includes a simulation calculation module 401, a data preprocessing module 402 and an iterative training module 403;
所述模拟计算模块401,用于搜集图像数据,根据图像数据完成蒙特卡罗模拟计算,获得训练数据,所述训练数据包括粒子的入射注量谱分布和出射注量谱分布;The simulation calculation module 401 is used to collect image data, complete Monte Carlo simulation calculation according to the image data, and obtain training data, and the training data includes the distribution of the injection dose spectrum and the distribution of the exit dose spectrum of the particles;
所述数据预处理模块402,用于根据所述入射注量谱分布,对所述图像数据进行预处理,生成训练输入数据;The data preprocessing module 402 is configured to preprocess the image data according to the distribution of the injection dose spectrum to generate training input data;
所述迭代训练模块403,用于基于图形处理器构建初始神经网络模型,并根据训练输入数据和训练数据对所述初始神经网络模型进行重复训练和评估,并更新模型参数;直至达到预设条件后,停止训练迭代,保存模型参数,以完成神经网络模型的构建。The iterative training module 403 is configured to construct an initial neural network model based on a graphics processor, and perform repeated training and evaluation on the initial neural network model according to training input data and training data, and update model parameters; until preset conditions are reached After that, stop the training iteration and save the model parameters to complete the construction of the neural network model.
请参照图5,图5为本发明实施例提供的注量谱分布计算装置的一种结构示意图,其主要包括模型构建模块501、数据处理模块502、数据计算模块503和归一化处理模块504;Please refer to FIG. 5. FIG. 5 is a schematic structural diagram of a fluence spectrum distribution calculation device provided by an embodiment of the present invention, which mainly includes a model building module 501, a data processing module 502, a data calculation module 503 and a normalization processing module 504 ;
所述模型构建模块501,用于获取应用所述的注量谱分布计算建模装置所构建的神经网络模型;The model construction module 501 is used to obtain the neural network model constructed by applying the fluence spectrum distribution computing modeling device;
所述数据处理模块502,用于获取图像数据,所述图像数据包括影像信息或几何信息;并对所述图像数据做预处理,得到模型输入数据;The data processing module 502 is configured to acquire image data, the image data includes image information or geometric information; and preprocess the image data to obtain model input data;
所述数据计算模块503,用于将所述模型输入数据输入至所述神经网络模型中,计算出射注量谱分布矩阵;The data calculation module 503 is used to input the model input data into the neural network model to calculate the injection volume spectrum distribution matrix;
所述归一化处理模块504,用于对所述出射注量谱分布矩阵还原为绝对值,完成出射注量谱分布计算。The normalization processing module 504 is used to restore the distribution matrix of the outgoing injection dose spectrum to an absolute value, and complete the calculation of the distribution of the outgoing injection dose spectrum.
在本实施例中,通过根据图像数据进行预处理,获取模型输入数据,并根据神经网络模型计算注量谱分布,提高了注量谱分布计算的效率,并且所述神经网络模型将蒙特卡罗模拟计算的样本作为训练数据,保证了所述神经网络模型计算注量谱分布的精度。In this embodiment, by performing preprocessing according to the image data, obtaining model input data, and calculating the fluence spectrum distribution according to the neural network model, the efficiency of the calculation of the fluence spectrum distribution is improved, and the neural network model will be Monte Carlo The simulated and calculated samples are used as training data, which ensures the accuracy of the neural network model in calculating the distribution of the fluence spectrum.
以上所述的具体实施例,对本发明的目的、技术方案和有益效果进行了进一步的详细说明,应当理解,以上所述仅为本发明的具体实施例而已,并不用于限定本发明的保护范围。特别指出,对于本领域技术人员来说,凡在本发明的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The specific embodiments described above have further described the purpose, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above descriptions are only specific embodiments of the present invention and are not intended to limit the protection scope of the present invention. . In particular, for those skilled in the art, any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included within the protection scope of the present invention.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210928213.5A CN115270588B (en) | 2022-08-03 | 2022-08-03 | Method and device for calculating and modeling fluence spectrum distribution and calculating fluence spectrum distribution |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210928213.5A CN115270588B (en) | 2022-08-03 | 2022-08-03 | Method and device for calculating and modeling fluence spectrum distribution and calculating fluence spectrum distribution |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115270588A true CN115270588A (en) | 2022-11-01 |
CN115270588B CN115270588B (en) | 2023-06-23 |
Family
ID=83748574
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210928213.5A Active CN115270588B (en) | 2022-08-03 | 2022-08-03 | Method and device for calculating and modeling fluence spectrum distribution and calculating fluence spectrum distribution |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115270588B (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110133703A (en) * | 2019-05-15 | 2019-08-16 | 中国辐射防护研究院 | A kind of gamma-rays Dosimetry based on BP neural network and Monte carlo algorithm |
CN112086172A (en) * | 2020-09-14 | 2020-12-15 | 广州瑞多思医疗科技有限公司 | Three-dimensional dose calculation method, computer equipment and readable medium |
CN112086173A (en) * | 2020-09-14 | 2020-12-15 | 广州瑞多思医疗科技有限公司 | Three-dimensional dose calculation method and device, computer equipment and readable medium |
US20220088410A1 (en) * | 2020-09-21 | 2022-03-24 | Elekta, Inc. | Machine learning optimization of fluence maps for radiotherapy treatment |
CN114298177A (en) * | 2021-12-16 | 2022-04-08 | 广州瑞多思医疗科技有限公司 | A kind of expansion and enhancement method, system and readable storage medium suitable for deep learning training data |
-
2022
- 2022-08-03 CN CN202210928213.5A patent/CN115270588B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110133703A (en) * | 2019-05-15 | 2019-08-16 | 中国辐射防护研究院 | A kind of gamma-rays Dosimetry based on BP neural network and Monte carlo algorithm |
CN112086172A (en) * | 2020-09-14 | 2020-12-15 | 广州瑞多思医疗科技有限公司 | Three-dimensional dose calculation method, computer equipment and readable medium |
CN112086173A (en) * | 2020-09-14 | 2020-12-15 | 广州瑞多思医疗科技有限公司 | Three-dimensional dose calculation method and device, computer equipment and readable medium |
US20220088410A1 (en) * | 2020-09-21 | 2022-03-24 | Elekta, Inc. | Machine learning optimization of fluence maps for radiotherapy treatment |
CN114298177A (en) * | 2021-12-16 | 2022-04-08 | 广州瑞多思医疗科技有限公司 | A kind of expansion and enhancement method, system and readable storage medium suitable for deep learning training data |
Non-Patent Citations (2)
Title |
---|
陈朝斌等: "蒙特卡罗方法在放疗计划中的应用", 《核技术》 * |
陈朝斌等: "蒙特卡罗方法在放疗计划中的应用", 《核技术》, no. 01, 10 January 2006 (2006-01-10) * |
Also Published As
Publication number | Publication date |
---|---|
CN115270588B (en) | 2023-06-23 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107330187B (en) | A simulation method of radiation field dose distribution in decommissioning nuclear facilities | |
CN109859817B (en) | Method and system for evaluating risk organ dosimetry in esophageal radiotherapy plan | |
CN115937423B (en) | Three-dimensional intelligent reconstruction method for liver tumor medical image | |
WO2008039215A2 (en) | Deterministic computation of radiation transport for radiotherapy dose calculations and scatter correction for image reconstruction | |
Peng et al. | MCDNet–a denoising convolutional neural network to accelerate Monte Carlo radiation transport simulations: a proof of principle with patient dose from X-ray CT imaging | |
TW201825050A (en) | Medical image-based method for deconstructing tissue element mass ratio and method for establishing geometric model | |
CN102096939B (en) | Medical mass data-oriented multi-resolution volume rendering method | |
CN118015116A (en) | Four-dimensional cone beam CT reconstruction method based on projection-image domain cooperative enhancement | |
CN118411435A (en) | PET image reconstruction method based on prior image and PET image 3D perception method | |
CN115270588B (en) | Method and device for calculating and modeling fluence spectrum distribution and calculating fluence spectrum distribution | |
CN113178242B (en) | Automatic plan optimization system based on coupled generation countermeasure network | |
van Dijk et al. | A novel multichannel deep learning model for fast denoising of Monte Carlo dose calculations: preclinical applications | |
CN118366614B (en) | Boron neutron capture treatment plan curative effect prediction model construction method and device | |
Rutherford et al. | An inception network for positron emission tomography based dose estimation in carbon ion therapy | |
Matej et al. | Performance of a fast maximum likelihood algorithm for fully 3D PET reconstruction | |
Bert et al. | Monte Carlo simulations for medical and biomedical applications | |
Wang et al. | A physically constrained Monte Carlo–Neural Network coupling algorithm for BNCT dose calculation | |
Sturm et al. | 3D-Visualization of particle deposition patterns in the human lung generated by Monte Carlo modeling: methodology and applications | |
CN114566252A (en) | Nuclear medicine activity-dose automatic conversion method based on generation countermeasure network | |
Fu et al. | Fast Monte Carlo dose calculation based on deep learning | |
Qureshi et al. | Determination of optimal number of projections and parametric sensitivity analysis of operators for parallel‐ray transmission tomography using hybrid continuous genetic algorithm | |
Melodia | Deep Learning Estimation of Absorbed Dose for Nuclear Medicine Diagnostics | |
Jiang et al. | Sparse-view CBCT reconstruction using combined DRUNet and HQS | |
Wang et al. | Solid geometrv based modelling of non-uniform attenuation and compton scattering in objects for SPECT imaging systems | |
CN113797450B (en) | A method and device for optimizing the intensity distribution of radiotherapy plans and radiotherapy equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |