一种肝脏变形预测方法、系统及电子设备Method, system and electronic equipment for predicting liver deformation
技术领域Technical field
本申请属于医学图像处理技术领域,特别涉及一种肝脏变形预测方法、系统及电子设备。This application belongs to the technical field of medical image processing, and in particular relates to a liver deformation prediction method, system and electronic equipment.
背景技术Background technique
肝脏腹腔镜手术因其手术创伤小、对患者危害轻等特点,已被广泛地使用在腹腔手术中。腹腔镜手术导航通过获得患者术前数据,得到肝脏病灶区域和附近的血管位置等信息,同术中的腹腔镜图像相结合,可以有效地在腹腔镜狭小的视野里获得更多信息,指导医生完成手术规划,并减少意外情况发生,逐渐成为医生的得力助手。由于手术过程中需要患者腹部充气,产生气腹压和腹部器官之间的挤压,引起腹部器官发生变形,术前数据和术中图像往往不是准确的线性对应关系,使用刚性配准算法,无法将术前数据和术中信息有效统一,易对医生实际手术操作产生错误引导。术中重新采集患者病灶信息亦是不现实的,只能通过腹腔镜图像获得部分器官表面,大部分传统的非刚性配准也很难用于在实际的使用中。Laparoscopic liver surgery has been widely used in abdominal surgery due to its characteristics of small surgical trauma and low harm to patients. Laparoscopic surgery navigation obtains the patient's preoperative data, and obtains information such as the location of the liver lesion area and nearby blood vessels. Combined with the intraoperative laparoscopic images, it can effectively obtain more information in the narrow field of view of the laparoscopic, and guide the doctor Complete the surgical planning and reduce the occurrence of accidents, and gradually become the doctor's right-hand man. Because the patient’s abdomen needs to be inflated during the operation, pneumoperitoneum pressure and squeezing between the abdominal organs will cause the abdominal organs to deform. The preoperative data and the intraoperative image are often not in an accurate linear correspondence. The rigid registration algorithm cannot be used. Effectively unify the pre-operative data and intra-operative information, which is easy to lead the doctors to the actual operation of the operation. It is also unrealistic to reacquire patient lesion information during the operation. Only part of the organ surface can be obtained through laparoscopic images. Most of the traditional non-rigid registration is also difficult to use in actual use.
目前主流的模拟肝脏在腹腔镜的变形是使用生物力学模型。生物力学模型可以用较小的不规则单元体精准地表示肝脏的复杂结构,并且可以计算精准的肝脏物理变形,但是由于庞大的参数和计算量,导致了结果准确但耗时 很长,降低耗时但精度低的问题,往往不能做到实时的效果。同时作为求解生物力学模型条件的边界条件,在术中条件下也很难获得和确定。The current mainstream simulation of liver deformation in laparoscopy is to use a biomechanical model. The biomechanical model can accurately represent the complex structure of the liver with smaller irregular unit bodies, and can calculate precise physical deformation of the liver. However, due to the huge parameters and calculations, the results are accurate but time-consuming and reduce the consumption. The problem of time but low accuracy often cannot achieve real-time results. At the same time, as the boundary conditions for solving the conditions of the biomechanical model, it is difficult to obtain and determine under the conditions in the operation.
发明内容Summary of the invention
本申请提供了一种肝脏变形预测方法、系统及电子设备,旨在至少在一定程度上解决现有技术中的上述技术问题之一。The present application provides a liver deformation prediction method, system, and electronic equipment, which aim to solve at least one of the above technical problems in the prior art to a certain extent.
为了解决上述问题,本申请提供了如下技术方案:In order to solve the above problems, this application provides the following technical solutions:
一种肝脏变形预测方法,包括以下步骤:A method for predicting liver deformation includes the following steps:
步骤a:获取肝脏四面体的变形数据;Step a: Obtain the deformation data of the liver tetrahedron;
步骤b:对所述肝脏四面体的变形数据进行重采样插值和预处理,生成肝脏数据集;Step b: performing re-sampling interpolation and preprocessing on the deformation data of the liver tetrahedron to generate a liver data set;
步骤c:根据肝脏数据集构建卷积神经网络,所述卷积神经网络在获取肝脏表面位移后,对肝脏整体变形进行预测。Step c: Construct a convolutional neural network based on the liver data set, and the convolutional neural network predicts the overall liver deformation after obtaining the liver surface displacement.
本申请实施例采取的技术方案还包括:在所述步骤a中,所述获取肝脏四面体的变形数据具体为:从术前患者的肝脏CT图像中分割获得肝脏数据,对所述肝脏数据重建获得肝脏表面三角形网格,并生成对应的肝脏四面体网格;随机在肝脏表面选择设定大小的区域作为零位移边界条件,模拟肝脏与相邻器官相固定的地方,施加一定大小的力到另一个随机的设定大小的区域,给予肝脏变形的动力;使用Elmer算法计算变形后的结果,得到对应点的位移矢量信息;并移除肝脏数据中最大位移大于一定大小的区域。The technical solution adopted in the embodiment of the present application further includes: in the step a, the obtaining the deformation data of the liver tetrahedron specifically includes: obtaining liver data from the liver CT image of the preoperative patient, and reconstructing the liver data Obtain the liver surface triangle mesh, and generate the corresponding liver tetrahedral mesh; randomly select a set size area on the liver surface as the zero-displacement boundary condition, simulate the place where the liver is fixed to the adjacent organs, and apply a certain amount of force to Another randomly set size area gives the liver the power to deform; the Elmer algorithm is used to calculate the deformed result to obtain the displacement vector information of the corresponding point; and the area with the largest displacement greater than a certain size in the liver data is removed.
本申请实施例采取的技术方案还包括:在所述步骤b中,所述对肝脏四面体的变形数据进行重采样插值和预处理具体为:首先,将肝脏重采样到 64×64×64的规则网格中,计算规则网格中每个点到肝脏最近表面点的距离,并设在肝脏表面外的点到肝脏最近表面点的距离为正,在肝脏表面内的点到肝脏最近表面点的距离为负;然后,将肝脏零位移点的部分标记出来,与非肝脏内部点加以区分;对于规则网格,每一个点包含三重信息五个数据,分别为:矢量的三个方向、距离肝脏表面的最近距离以及是否为零位移点。The technical solution adopted in the embodiment of the present application further includes: in the step b, the re-sampling, interpolation and pre-processing of the deformation data of the liver tetrahedron are specifically: first, re-sampling the liver to 64×64×64 In a regular grid, calculate the distance from each point in the regular grid to the nearest surface point of the liver, and set the distance from the point outside the liver surface to the nearest surface point of the liver to be positive, and the point on the liver surface to the nearest surface point of the liver The distance of is negative; then, the part of the liver zero displacement point is marked to distinguish it from the non-liver internal points; for the regular grid, each point contains five data of triple information, namely: the three directions of the vector, the distance The closest distance to the liver surface and whether it is the zero displacement point.
本申请实施例采取的技术方案还包括:在所述步骤c中,所述卷积神经网络包括编码器和解码器,使用编码器降低分辨率并学习数据特征,使用跳跃连接,将前端信息复制到解码器,解码器使用平均池化来降低数据分辨率提高通道数;解码器有三个上采样,采用最临近插值,将分辨率提高一倍,使得网络的输出分辨率与输入分辨率相同。The technical solution adopted by the embodiment of the application further includes: in the step c, the convolutional neural network includes an encoder and a decoder, the encoder is used to reduce the resolution and learn data characteristics, and the jump connection is used to copy the front-end information To the decoder, the decoder uses average pooling to reduce the data resolution and increase the number of channels; the decoder has three up-sampling and uses the nearest interpolation to double the resolution so that the output resolution of the network is the same as the input resolution.
本申请实施例采取的技术方案还包括:所述步骤c后还包括:构建损失函数,得到最优化的卷积神经网络;损失函数添加了额外的下采样位移估计与标签对应的下采样相误差计算;误差函数表达为:The technical solution adopted in the embodiment of the application further includes: after the step c, it also includes: constructing a loss function to obtain an optimized convolutional neural network; the loss function adds an additional down-sampling displacement estimation and the down-sampling phase error corresponding to the label Calculation; the error function is expressed as:
上述公式中,u
i为解码器在分辨率为i时额外输出的部分,u
tar,i为标签数据为对应分辨率下采样结果,
为对应分辨点的个数,如果点在肝脏外面,则O(p)=0;分辨率i∈(64,32,16,8),最后的损失函数作为不同分辨率的加权和:
In the above formula, u i is the extra output part of the decoder when the resolution is i, u tar,i is the label data is the downsampling result of the corresponding resolution, For the number of corresponding resolution points, if the point is outside the liver, then O(p)=0; resolution i∈(64,32,16,8), and the final loss function is used as the weighted sum of different resolutions:
上述公式中,选取权重λ
64=λ
32=λ
16=λ
8=1。
In the above formula, select the weights λ 64 = λ 32 = λ 16 = λ 8 = 1.
本申请实施例采取的另一技术方案为:一种肝脏变形预测系统,包括:Another technical solution adopted by the embodiment of the present application is: a liver deformation prediction system, including:
数据获取模块:用于获取肝脏四面体的变形数据;Data acquisition module: used to acquire deformation data of the liver tetrahedron;
数据处理模块:用于对所述肝脏四面体的变形数据进行重采样插值和预处理,生成肝脏数据集;Data processing module: used to resample, interpolate and preprocess the deformation data of the liver tetrahedron to generate a liver data set;
网络构建模块:用于根据肝脏数据集构建卷积神经网络,所述卷积神经网络在获取肝脏表面位移后,对肝脏整体变形进行预测。The network construction module is used to construct a convolutional neural network based on the liver data set, and the convolutional neural network predicts the overall liver deformation after obtaining the liver surface displacement.
本申请实施例采取的技术方案还包括:所述数据获取模块获取肝脏四面体的变形数据具体为:从术前患者的肝脏CT图像中分割获得肝脏数据,对所述肝脏数据重建获得肝脏表面三角形网格,并生成对应的肝脏四面体网格;随机在肝脏表面选择设定大小的区域作为零位移边界条件,模拟肝脏与相邻器官相固定的地方,施加一定大小的力到另一个随机的设定大小的区域,给予肝脏变形的动力;使用Elmer算法计算变形后的结果,得到对应点的位移矢量信息;并移除肝脏数据中最大位移大于一定大小的区域。The technical solution adopted in the embodiment of the present application further includes: the data acquisition module acquiring the deformation data of the liver tetrahedron is specifically: segmenting and acquiring liver data from the liver CT image of the preoperative patient, and reconstructing the liver data to obtain the liver surface triangle Grid, and generate the corresponding liver tetrahedral grid; randomly select a set size area on the liver surface as the zero displacement boundary condition, simulate the place where the liver is fixed to the neighboring organs, and apply a certain amount of force to another random Set the size of the area to give the liver deformation power; use the Elmer algorithm to calculate the deformed result to obtain the displacement vector information of the corresponding point; and remove the area with the largest displacement greater than a certain size in the liver data.
本申请实施例采取的技术方案还包括:所述数据处理模块对肝脏四面体的变形数据进行重采样插值和预处理具体为:首先,将肝脏重采样到64×64×64的规则网格中,计算规则网格中每个点到肝脏最近表面点的距离,并设在肝脏表面外的点到肝脏最近表面点的距离为正,在肝脏表面内的点到肝脏最近表面点的距离为负;然后,将肝脏零位移点的部分标记出来,与非肝脏内部点加以区分;对于规则网格,每一个点包含三重信息五个数据,分别为:矢量的三个方向、距离肝脏表面的最近距离以及是否为零位移点。The technical solution adopted in the embodiment of the application further includes: the data processing module performs re-sampling, interpolation and pre-processing on the deformation data of the liver tetrahedron. Specifically: First, re-sampling the liver into a 64×64×64 regular grid , Calculate the distance from each point in the regular grid to the nearest surface point of the liver, and set the distance from the point outside the liver surface to the nearest surface point of the liver to be positive, and the distance from the point on the liver surface to the nearest surface point of the liver to be negative ; Then, mark the part of the liver zero displacement point to distinguish it from the non-liver internal points; for a regular grid, each point contains five data of triple information, namely: the three directions of the vector and the nearest to the liver surface The distance and whether it is the zero displacement point.
本申请实施例采取的技术方案还包括:所述卷积神经网络包括编码器和解码器,使用编码器降低分辨率并学习数据特征,使用跳跃连接,将前端信息复制到解码器,解码器使用平均池化来降低数据分辨率提高通道数;解码器有三个上采样,采用最临近插值,将分辨率提高一倍,使得网络的输出分辨率与输入分辨率相同。The technical solution adopted in the embodiment of the application also includes: the convolutional neural network includes an encoder and a decoder, the encoder is used to reduce the resolution and learn data characteristics, and the skip connection is used to copy the front-end information to the decoder, and the decoder uses Average pooling is used to reduce the data resolution and increase the number of channels; the decoder has three upsampling and uses nearest interpolation to double the resolution so that the output resolution of the network is the same as the input resolution.
本申请实施例采取的技术方案还包括网络优化模块,所述网络优化模块用于构建损失函数,得到最优化的卷积神经网络;损失函数添加了额外的下采样位移估计与标签对应的下采样相误差计算;误差函数表达为:The technical solution adopted in the embodiment of the present application also includes a network optimization module, which is used to construct a loss function to obtain an optimized convolutional neural network; the loss function adds additional downsampling displacement estimation and downsampling corresponding to the label Phase error calculation; the error function is expressed as:
上述公式中,u
i为解码器在分辨率为i时额外输出的部分,u
tar,i为标签数据为对应分辨率下采样结果,
为对应分辨点的个数,如果点在肝脏外面,则O(p)=0;分辨率i∈(64,32,16,8),最后的损失函数作为不同分辨率的加权和:
In the above formula, u i is the extra output part of the decoder when the resolution is i, u tar,i is the label data is the downsampling result of the corresponding resolution, For the number of corresponding resolution points, if the point is outside the liver, then O(p)=0; resolution i∈(64,32,16,8), and the final loss function is used as the weighted sum of different resolutions:
上述公式中,选取权重λ
64=λ
32=λ
16=λ
8=1。
In the above formula, select the weights λ 64 = λ 32 = λ 16 = λ 8 = 1.
本申请实施例采取的又一技术方案为:一种电子设备,包括:Another technical solution adopted in the embodiments of the present application is: an electronic device, including:
至少一个处理器;以及At least one processor; and
与所述至少一个处理器通信连接的存储器;其中,A memory communicatively connected with the at least one processor; wherein,
所述存储器存储有可被所述一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行上述的肝脏变形预测方法的以下操作:The memory stores instructions executable by the one processor, and the instructions are executed by the at least one processor, so that the at least one processor can perform the following operations of the aforementioned liver deformation prediction method:
步骤a:获取肝脏四面体的变形数据;Step a: Obtain the deformation data of the liver tetrahedron;
步骤b:对所述肝脏四面体的变形数据进行重采样插值和预处理,生成肝脏数据集;Step b: performing re-sampling interpolation and preprocessing on the deformation data of the liver tetrahedron to generate a liver data set;
步骤c:根据肝脏数据集构建卷积神经网络,所述卷积神经网络在获取肝脏表面位移后,对肝脏整体变形进行预测。Step c: Construct a convolutional neural network based on the liver data set, and the convolutional neural network predicts the overall liver deformation after obtaining the liver surface displacement.
相对于现有技术,本申请实施例产生的有益效果在于:本申请实施例的肝脏变形预测方法、系统及电子设备在腹腔镜图像下获得部分肝脏表面的位移后,使用卷积神经网络获得肝脏全部表面和肝脏内部结构的位移信息;本申请对肝脏整体的位移有很有效的预测效果,并可大幅度减少预测所用的时间。Compared with the prior art, the beneficial effects produced by the embodiments of the present application are: the liver deformation prediction method, system and electronic equipment of the embodiments of the present application obtain the displacement of part of the liver surface under the laparoscopic image, and then use the convolutional neural network to obtain the liver Displacement information of the entire surface and internal structure of the liver; this application has a very effective prediction effect on the overall displacement of the liver, and can greatly reduce the time used for prediction.
附图说明Description of the drawings
图1是本申请实施例的肝脏变形预测方法的流程图;FIG. 1 is a flowchart of a method for predicting liver deformation according to an embodiment of the present application;
图2为卷积神经网络结构图;Figure 2 is a structure diagram of a convolutional neural network;
图3是本申请实施例的肝脏变形预测系统的结构示意图;Fig. 3 is a schematic structural diagram of a liver deformation prediction system according to an embodiment of the present application;
图4是本申请实施例提供的肝脏变形预测方法的硬件设备结构示意图。Fig. 4 is a schematic diagram of the hardware device structure of the liver deformation prediction method provided by an embodiment of the present application.
具体实施方式Detailed ways
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅用以解释本申请,并不用于限定本申请。In order to make the purpose, technical solutions, and advantages of this application clearer and clearer, the following further describes the application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the application, and are not used to limit the application.
请参阅图1,是本申请实施例的肝脏变形预测方法的流程图。本申请实施例的肝脏变形预测方法包括以下步骤:Please refer to FIG. 1, which is a flowchart of a method for predicting liver deformation according to an embodiment of the present application. The liver deformation prediction method of the embodiment of the present application includes the following steps:
步骤100:获取肝脏四面体的变形数据;Step 100: Obtain deformation data of the liver tetrahedron;
步骤100中,肝脏四面体变形数据的获取方式具体为:从术前患者的肝脏CT图像中分割获得肝脏数据,对肝脏数据重建获得肝脏表面三角形网格,并生成对应的肝脏四面体网格。随机在肝脏表面选择设定大小的区域(本申请设定该区域为2.5-5.5cm,具体可根据实际操作进行设定)作为零位移边界条件,模拟肝脏与相邻器官相固定的地方,施加一定大小的力(本申请设定为0.5-1.5N,具体可根据实际操作进行设定)到另一个随机的设定大小的区域(本申请设定该区域为2.5-3.5cm,具体可根据实际操作进行设定),给予肝脏变形的动力。使用Elmer软件计算变形后的结果,可以得到对应点的位移矢量信息。移除肝脏数据中最大位移大于一定大小的区域(本申请设定该区域为15cm,具体可根据实际操作进行设定),因为不符合实际的情况。In step 100, the method for acquiring liver tetrahedral deformation data is specifically: segmenting to obtain liver data from a preoperative patient's liver CT image, reconstructing the liver data to obtain a triangular mesh of the liver surface, and generating a corresponding liver tetrahedral mesh. Randomly select an area of set size on the liver surface (this application sets the area to be 2.5-5.5cm, which can be set according to actual operation) as the zero displacement boundary condition to simulate the place where the liver and adjacent organs are fixed, and apply A certain amount of force (this application is set to 0.5-1.5N, which can be set according to actual operation) to another randomly set size area (this application sets the area to be 2.5-3.5cm, which can be specified according to Set by actual operation) to give the liver the power to deform. Using Elmer software to calculate the deformed result, the displacement vector information of the corresponding point can be obtained. Remove the area where the maximum displacement is larger than a certain size in the liver data (this area is set to 15cm in this application, which can be set according to actual operation), because it does not meet the actual situation.
步骤200:对肝脏四面体的变形数据进行重采样插值和预处理,生成肝脏数据集;Step 200: Perform resampling, interpolation and preprocessing on the deformation data of the liver tetrahedron to generate a liver data set;
步骤200中,重采样插值和预处理具体包括:首先,将肝脏重采样到边长0.3cm的64×64×64的规则网格中,计算规则网格中每个点到肝脏最近表面点的距离,并设在肝脏表面外的点到肝脏最近表面点的距离为正,在肝脏表面内的点到肝脏最近表面点的距离为负。然后,将肝脏零位移点的部分标记出来,与非肝脏内部点加以区分(因为两者位移矢量都为零矢量)。对于规则网格,每一个点包含三重信息五个数据,分别为:矢量的三个方向、距离肝脏表面的最近距离和是否为零位移点。In step 200, the re-sampling interpolation and pre-processing specifically include: first, the liver is re-sampled into a 64×64×64 regular grid with a side length of 0.3 cm, and the distance from each point in the regular grid to the nearest surface point of the liver is calculated. The distance, and suppose that the distance from a point outside the liver surface to the nearest surface point of the liver is positive, and the distance from a point inside the liver surface to the nearest surface point of the liver is negative. Then, mark the part of the liver zero displacement point to distinguish it from the non-liver internal point (because both displacement vectors are zero vectors). For a regular grid, each point contains five data of triple information, namely: the three directions of the vector, the closest distance to the liver surface, and whether it is a zero displacement point.
步骤300:根据肝脏数据集构建卷积神经网络;Step 300: Construct a convolutional neural network according to the liver data set;
步骤300中,卷积神经网络结构如图2所示,其中上面数字表示通道数,下面数字表示分辨率。位移场的学习过程中,肝脏一部分的变形,不仅会影响周围点的位移,也有可能对整个肝脏造成影响。所以在网络中每个输入点都有可能会作用于输出点,即每个输出点必须有一个跨越整个输入的接受域。本申请实施例中的卷积神经网络结构类似U-net结构,网络输入的数据大小为64×64×64×5,网络输出的是肝脏部分的位移矢量,即为64×64×64×3。卷积神经网络包括编码器和解码器两个部分,使用编码器降低分辨率并学习数据特征,并使用跳跃连接,将前端信息复制到解码器部分,解码器使用平均池化来降低数据分辨率提高通道数。与U-Net不同,本网络使用三维输入数据,所有卷积都是在三维空间中计算的。解码器有三个上采样,采用最临近插值,将分辨率提高一倍,确保网络的输出分辨率与输入分辨率相同。卷积核大小为3,padding=1,卷积后使用SoftSign函数作为激活函数。In step 300, the structure of the convolutional neural network is shown in FIG. 2, where the upper number represents the number of channels, and the lower number represents the resolution. During the learning process of the displacement field, the deformation of a part of the liver will not only affect the displacement of the surrounding points, but may also affect the entire liver. Therefore, each input point in the network may act on the output point, that is, each output point must have a receptive domain that spans the entire input. The structure of the convolutional neural network in the embodiment of this application is similar to the U-net structure. The input data size of the network is 64×64×64×5, and the output of the network is the displacement vector of the liver, which is 64×64×64×3 . The convolutional neural network includes two parts: encoder and decoder. The encoder is used to reduce the resolution and learn data characteristics, and the jump connection is used to copy the front-end information to the decoder part. The decoder uses average pooling to reduce the data resolution Increase the number of channels. Unlike U-Net, this network uses three-dimensional input data, and all convolutions are calculated in three-dimensional space. The decoder has three upsamplings, and uses nearest interpolation to double the resolution to ensure that the output resolution of the network is the same as the input resolution. The size of the convolution kernel is 3, padding=1, and the SoftSign function is used as the activation function after convolution.
步骤400:卷积神经网络在获取肝脏表面位移后,对肝脏整体变形进行预测;Step 400: After obtaining the liver surface displacement, the convolutional neural network predicts the overall liver deformation;
步骤400中,卷积神经网络可以在获取部分肝脏表面位移后,对肝脏整体的位移有很有效的预测效果,并大幅度减少预测所用的时间。In step 400, the convolutional neural network can have a very effective prediction effect on the overall liver displacement after acquiring part of the liver surface displacement, and greatly reduce the time used for prediction.
步骤500:构建损失函数,得到最优化的卷积神经网络;Step 500: Construct a loss function to obtain an optimized convolutional neural network;
步骤500中,损失函数添加了额外的下采样位移估计与标签对应的下采样相误差计算,使得网络可以在编码器和最底层更专注于降低误差,解码器更专注于提高分辨率。误差函数表达为:In step 500, the loss function adds an additional down-sampling displacement estimation and the down-sampling phase error calculation corresponding to the label, so that the network can focus more on reducing errors at the encoder and the bottom layer, and the decoder can focus more on improving resolution. The error function is expressed as:
公式(1)中,u
i为解码器在分辨率为i时额外输出的部分,u
tar,i为标签数据为对应分辨率下采样结果,
为对应分辨点的个数,如果点在肝脏外面,则O(p)=0。分辨率i∈(64,32,16,8),最后的损失函数作为不同分辨率的加权和:
In formula (1), u i is the extra output part of the decoder when the resolution is i, u tar,i is the label data which is the downsampling result of the corresponding resolution, For the number of corresponding resolution points, if the points are outside the liver, then O(p)=0. Resolution i∈(64,32,16,8), and the final loss function is used as the weighted sum of different resolutions:
公式(2)中,选取权重λ
64=λ
32=λ
16=λ
8=1。
In formula (2), the weight λ 64 =λ 32 =λ 16 =λ 8 =1 is selected.
请参阅图3,是本申请实施例的肝脏变形预测系统的结构示意图。本申请实施例的肝脏变形预测系统包括数据获取模块、数据处理模块、网络构建模块、网络优化模块。Please refer to FIG. 3, which is a schematic structural diagram of a liver deformation prediction system according to an embodiment of the present application. The liver deformation prediction system of the embodiment of the present application includes a data acquisition module, a data processing module, a network construction module, and a network optimization module.
数据获取模块:用于获取肝脏四面体的变形数据;其中,肝脏四面体变形数据的获取方式具体为:从术前患者的肝脏CT图像中分割获得肝脏数据,对肝脏数据重建获得肝脏表面三角形网格,并生成对应的肝脏四面体网格。随机在肝脏表面选择设定大小的区域(本申请设定该区域为2.5-5.5cm,具体可根据实际操作进行设定)作为零位移边界条件,模拟肝脏与相邻器官相固定的地方,施加0.5-1.5N的力到另一个随机的设定大小的区域(本申请设定该区域为2.5-3.5cm,具体可根据实际操作进行设定),给予肝脏变形的动力。使用Elmer软件计算变形后的结果,可以得到对应点的位移矢量信息。移除肝脏数据中最大位移大于15cm的区域,因为不符合实际的情况。Data acquisition module: used to acquire the deformation data of the liver tetrahedron; the method of acquiring the liver tetrahedron deformation data is specifically: segmenting the liver data from the liver CT images of the preoperative patient, and reconstructing the liver data to obtain the liver surface triangle network Grid and generate the corresponding liver tetrahedral mesh. Randomly select an area of set size on the liver surface (this application sets the area to be 2.5-5.5cm, which can be set according to actual operation) as the zero displacement boundary condition to simulate the place where the liver and adjacent organs are fixed, and apply The force of 0.5-1.5N to another randomly set size area (this application sets the area to be 2.5-3.5cm, which can be set according to actual operation) to give the liver the power to deform. Using Elmer software to calculate the deformed result, the displacement vector information of the corresponding point can be obtained. Remove the area where the maximum displacement is greater than 15cm in the liver data, because it does not meet the actual situation.
数据处理模块:用于对肝脏四面体的变形数据进行重采样插值和预处理,生成肝脏数据集;其中,重采样插值和预处理具体包括:首先,将肝脏 重采样到边长0.3cm的64×64×64的规则网格中,计算规则网格中每个点到肝脏最近表面点的距离,并设在肝脏表面外的点到肝脏最近表面点的距离为正,在肝脏表面内的点到肝脏最近表面点的距离为负。然后,将肝脏零位移点的部分标记出来,与非肝脏内部点加以区分(因为两者位移矢量都为零矢量)。对于规则网格,每一个点包含三重信息五个数据,分别为:矢量的三个方向、距离肝脏表面的最近距离和是否为零位移点。Data processing module: used to resample, interpolate and preprocess the deformation data of the liver tetrahedron to generate a liver data set; among them, the resample interpolation and preprocessing specifically include: First, resample the liver to 64 with a side length of 0.3cm In a ×64×64 regular grid, calculate the distance from each point in the regular grid to the nearest surface point of the liver, and set the distance from the point outside the liver surface to the nearest surface point of the liver to be positive, and the point inside the liver surface The distance to the nearest surface point of the liver is negative. Then, mark the part of the liver zero displacement point to distinguish it from the non-liver internal point (because both displacement vectors are zero vectors). For a regular grid, each point contains five data of triple information, namely: the three directions of the vector, the closest distance to the liver surface, and whether it is a zero displacement point.
网络构建模块:用于根据肝脏数据集构建卷积神经网络,卷积神经网络在获取部分肝脏表面位移后,对肝脏整体变形进行预测;其中,卷积神经网络结构如图2所示,其中上面数字表示通道数,下面数字表示分辨率。位移场的学习过程中,肝脏一部分的变形,不仅会影响周围点的位移,也有可能对整个肝脏造成影响。所以在网络中每个输入点都有可能会作用于输出点,即每个输出点必须有一个跨越整个输入的接受域。本申请实施例中的卷积神经网络结构类似U-net结构,网络输入的数据大小为64×64×64×5,网络输出的是肝脏部分的位移矢量,即为64×64×64×3。卷积神经网络包括编码器和解码器两个部分,使用编码器降低分辨率并学习数据特征,并使用跳跃连接,将前端信息复制到解码器部分,解码器使用平均池化来降低数据分辨率提高通道数。与U-Net不同,本网络使用三维输入数据,所有卷积都是在三维空间中计算的。解码器有三个上采样,采用最临近插值,将分辨率提高一倍,确保网络的输出分辨率与输入分辨率相同。卷积核大小为3,padding=1,卷积后使用SoftSign函数作为激活函数。Network building module: used to construct a convolutional neural network based on the liver data set. The convolutional neural network predicts the overall liver deformation after obtaining part of the liver surface displacement; among them, the convolutional neural network structure is shown in Figure 2, where the above The number indicates the number of channels, and the number below indicates the resolution. During the learning process of the displacement field, the deformation of a part of the liver will not only affect the displacement of the surrounding points, but may also affect the entire liver. Therefore, each input point in the network may act on the output point, that is, each output point must have a receptive domain that spans the entire input. The structure of the convolutional neural network in the embodiment of this application is similar to the U-net structure. The input data size of the network is 64×64×64×5, and the output of the network is the displacement vector of the liver, which is 64×64×64×3 . The convolutional neural network includes two parts: encoder and decoder. The encoder is used to reduce the resolution and learn data characteristics, and the jump connection is used to copy the front-end information to the decoder part. The decoder uses average pooling to reduce the data resolution Increase the number of channels. Unlike U-Net, this network uses three-dimensional input data, and all convolutions are calculated in three-dimensional space. The decoder has three upsamplings, and uses nearest interpolation to double the resolution to ensure that the output resolution of the network is the same as the input resolution. The size of the convolution kernel is 3, padding=1, and the SoftSign function is used as the activation function after convolution.
网络优化模块:用于构建损失函数,得到最优化的卷积神经网络;其中,损失函数添加了额外的下采样位移估计与标签对应的下采样相误差计 算,使得网络可以在编码器和最底层更专注于降低误差,解码器更专注于提高分辨率。误差函数表达为:Network optimization module: used to construct the loss function to obtain the optimized convolutional neural network; among them, the loss function adds additional down-sampling displacement estimation and label-corresponding down-sampling phase error calculation, so that the network can be in the encoder and the bottom layer More focused on reducing errors, the decoder is more focused on improving resolution. The error function is expressed as:
公式(1)中,u
i为解码器在分辨率为i时额外输出的部分,u
tar,i为标签数据为对应分辨率下采样结果,
为对应分辨点的个数,如果点在肝脏外面,则O(p)=0。分辨率i∈(64,32,16,8),最后的损失函数作为不同分辨率的加权和:
In formula (1), u i is the extra output part of the decoder when the resolution is i, u tar,i is the label data which is the downsampling result of the corresponding resolution, For the number of corresponding resolution points, if the points are outside the liver, then O(p)=0. Resolution i∈(64,32,16,8), and the final loss function is used as the weighted sum of different resolutions:
公式(2)中,选取权重λ
64=λ
32=λ
16=λ
8=1。
In formula (2), the weight λ 64 =λ 32 =λ 16 =λ 8 =1 is selected.
经数据实验证明,本申请提出的卷积神经网络具有较高的可靠性,可用于实际应用中。Data experiments prove that the convolutional neural network proposed in this application has high reliability and can be used in practical applications.
图4是本申请实施例提供的肝脏变形预测方法的硬件设备结构示意图。如图4所示,该设备包括一个或多个处理器以及存储器。以一个处理器为例,该设备还可以包括:输入系统和输出系统。Fig. 4 is a schematic diagram of the hardware device structure of the liver deformation prediction method provided by an embodiment of the present application. As shown in Figure 4, the device includes one or more processors and memory. Taking a processor as an example, the device may also include: an input system and an output system.
处理器、存储器、输入系统和输出系统可以通过总线或者其他方式连接,图4中以通过总线连接为例。The processor, the memory, the input system, and the output system may be connected by a bus or in other ways. In FIG. 4, the connection by a bus is taken as an example.
存储器作为一种非暂态计算机可读存储介质,可用于存储非暂态软件程序、非暂态计算机可执行程序以及模块。处理器通过运行存储在存储器中的非暂态软件程序、指令以及模块,从而执行电子设备的各种功能应用以及数据处理,即实现上述方法实施例的处理方法。As a non-transitory computer-readable storage medium, the memory can be used to store non-transitory software programs, non-transitory computer executable programs, and modules. The processor executes various functional applications and data processing of the electronic device by running non-transitory software programs, instructions, and modules stored in the memory, that is, realizing the processing methods of the foregoing method embodiments.
存储器可以包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需要的应用程序;存储数据区可存储数据等。此外,存储器可以包括高速随机存取存储器,还可以包括非暂态存储器,例如至少一个磁盘存储器件、闪存器件、或其他非暂态固态存储器件。在一些实施例中,存储器可选包括相对于处理器远程设置的存储器,这些远程存储器可以通过网络连接至处理系统。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。The memory may include a program storage area and a data storage area, where the program storage area can store an operating system and an application program required by at least one function; the data storage area can store data and the like. In addition, the memory may include a high-speed random access memory, and may also include a non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state storage devices. In some embodiments, the memory may optionally include a memory remotely provided with respect to the processor, and these remote memories may be connected to the processing system through a network. Examples of the aforementioned networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
输入系统可接收输入的数字或字符信息,以及产生信号输入。输出系统可包括显示屏等显示设备。The input system can receive input digital or character information, and generate signal input. The output system may include display devices such as a display screen.
所述一个或者多个模块存储在所述存储器中,当被所述一个或者多个处理器执行时,执行上述任一方法实施例的以下操作:The one or more modules are stored in the memory, and when executed by the one or more processors, the following operations of any of the foregoing method embodiments are performed:
步骤a:获取肝脏四面体的变形数据;Step a: Obtain the deformation data of the liver tetrahedron;
步骤b:对所述肝脏四面体的变形数据进行重采样插值和预处理,生成肝脏数据集;Step b: performing re-sampling interpolation and preprocessing on the deformation data of the liver tetrahedron to generate a liver data set;
步骤c:根据肝脏数据集构建卷积神经网络,所述卷积神经网络在获取肝脏表面位移后,对肝脏整体变形进行预测。Step c: Construct a convolutional neural network based on the liver data set, and the convolutional neural network predicts the overall liver deformation after obtaining the liver surface displacement.
上述产品可执行本申请实施例所提供的方法,具备执行方法相应的功能模块和有益效果。未在本实施例中详尽描述的技术细节,可参见本申请实施例提供的方法。The above-mentioned products can execute the methods provided in the embodiments of the present application, and have functional modules and beneficial effects corresponding to the execution methods. For technical details not described in detail in this embodiment, please refer to the method provided in the embodiment of this application.
本申请实施例提供了一种非暂态(非易失性)计算机存储介质,所述计算机存储介质存储有计算机可执行指令,该计算机可执行指令可执行以下操作:The embodiments of the present application provide a non-transitory (non-volatile) computer storage medium. The computer storage medium stores computer-executable instructions, and the computer-executable instructions can perform the following operations:
步骤a:获取肝脏四面体的变形数据;Step a: Obtain the deformation data of the liver tetrahedron;
步骤b:对所述肝脏四面体的变形数据进行重采样插值和预处理,生成肝脏数据集;Step b: performing re-sampling interpolation and preprocessing on the deformation data of the liver tetrahedron to generate a liver data set;
步骤c:根据肝脏数据集构建卷积神经网络,所述卷积神经网络在获取肝脏表面位移后,对肝脏整体变形进行预测。Step c: Construct a convolutional neural network based on the liver data set, and the convolutional neural network predicts the overall liver deformation after obtaining the liver surface displacement.
本申请实施例提供了一种计算机程序产品,所述计算机程序产品包括存储在非暂态计算机可读存储介质上的计算机程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,使所述计算机执行以下操作:The embodiment of the present application provides a computer program product, the computer program product includes a computer program stored on a non-transitory computer-readable storage medium, the computer program includes program instructions, when the program instructions are executed by a computer To make the computer do the following:
步骤a:获取肝脏四面体的变形数据;Step a: Obtain the deformation data of the liver tetrahedron;
步骤b:对所述肝脏四面体的变形数据进行重采样插值和预处理,生成肝脏数据集;Step b: performing re-sampling interpolation and preprocessing on the deformation data of the liver tetrahedron to generate a liver data set;
步骤c:根据肝脏数据集构建卷积神经网络,所述卷积神经网络在获取肝脏表面位移后,对肝脏整体变形进行预测。Step c: Construct a convolutional neural network based on the liver data set, and the convolutional neural network predicts the overall liver deformation after obtaining the liver surface displacement.
本申请实施例的肝脏变形预测方法、系统及电子设备在腹腔镜图像下获得部分肝脏表面的位移后,使用卷积神经网络获得肝脏全部表面和肝脏内部结构的位移信息;本申请对肝脏整体的位移有很有效的预测效果,并可大幅度减少预测所用的时间。The liver deformation prediction method, system and electronic equipment of the embodiments of the present application obtain the displacement of part of the liver surface under the laparoscopic image, and then use the convolutional neural network to obtain the displacement information of the entire liver surface and the internal structure of the liver; Displacement has a very effective prediction effect and can greatly reduce the time used for prediction.
对所公开的实施例的上述说明,使本领域专业技术人员能够实现或使用本申请。对这些实施例的多种修改对本领域的专业技术人员来说将是显而易见的,本申请中所定义的一般原理可以在不脱离本申请的精神或范围的情况下,在其它实施例中实现。因此,本申请将不会被限制于本申请所示的这 些实施例,而是要符合与本申请所公开的原理和新颖特点相一致的最宽的范围。The foregoing description of the disclosed embodiments enables those skilled in the art to implement or use this application. Various modifications to these embodiments will be obvious to those skilled in the art, and the general principles defined in this application can be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application will not be limited to the embodiments shown in this application, but should conform to the widest scope consistent with the principles and novel features disclosed in this application.