Background
Hepatobiliary lithiasis is an important cause of death of benign biliary tract diseases in China. The operation of hepatobiliary calculus is complex, even if regular hepatectomy and choledochoscope in operation are matched, the calculus residue rate after operation is still up to 30%, and part of patients need to carry out twice or even multiple times of biliary tract operation treatment, so that the segmentation and reconstruction of the bile duct image can be intuitively carried out by doctors, and the diagnosis and treatment method has important significance.
In recent years, with the increasing degree of social modernization and information, a large number of researchers have studied image segmentation techniques in CT. Although the medical image segmentation of the biliary duct system is relatively small, in the current image segmentation research of other tissues and organs, the bile duct image segmentation is generally performed by adopting a threshold segmentation method and a region growing segmentation method.
The threshold segmentation is a segmentation technology based on regions, when the gray level ranges of a target region and a background region are different, the image segmentation effect is obvious, however, the threshold segmentation method is sensitive to noise and poor in accuracy, the segmentation result is excessively dependent on the gray level range of the region to be segmented, the region growing segmentation method needs to manually select seed points, automatic segmentation cannot be achieved, and the segmentation efficiency is low.
Disclosure of Invention
In order to solve the above problems in the prior art, the invention provides a bile duct image segmentation method based on deep learning, which solves the problems of noise sensitivity and low efficiency and the like in the prior art through preprocessing operation, preprocessing neural network and post-processing operation, and adopts the following technical scheme:
a bile duct image segmentation method based on deep learning is characterized by comprising the following steps:
s1, acquiring an abdomen CT image, and labeling an intrahepatic dilated bile duct image in the abdomen CT image to obtain a data set;
s2, preprocessing the data set; the preprocessing operation comprises the following steps: setting upper and lower thresholds of a gray value of the data set, calculating to obtain a mean value and a variance of the gray value of the data set, and performing normalization operation on the gray value of the data set according to the obtained mean value and variance; the normalization operation specifically includes:
wherein y is the normalized data set image, x is the data set image before normalization, mu is the mean value of the grey values of the data set, and sigma is the variance of the grey values of the data set;
s3, constructing a 3 DU-Net-based intrahepatic bile duct expansion segmentation model, and training by using the data set to obtain a trained intrahepatic bile duct expansion segmentation model;
the training process specifically comprises: dividing the data set into a training set and a test set; training the intrahepatic expansion bile duct segmentation model by using the training set, wherein a Dice function is used as a loss function of the network, an Adam optimizer is adopted, and the initial learning rate is set to be 1 x 10-4(ii) a Performing model correction on the intrahepatic bile duct dilation segmentation model by using the test set, wherein a Focalloss function is used as a loss function, an SGD (generalized regression) function is used as an optimizer, and the initial learning rate is set to be 1 x 10-5;
S4, acquiring an abdomen CT image to be segmented, preprocessing the abdomen CT image to be segmented, and inputting the preprocessed abdomen CT image to be segmented into the trained intrahepatic cholangiodilation segmentation model to obtain an intrahepatic cholangiodilation image segmentation result.
Further, the pre-processing operation further comprises scaling an image resolution of the data set.
Further, the Dice function is used to characterize the degree of similarity of two contour regions.
The invention has the beneficial effects that:
through preprocessing operation, preprocessing neural network and post-processing operation, the problems of sensitive noise, low efficiency and the like of the existing intrahepatic expanded bile duct segmentation technology are solved, and the segmentation efficiency and accuracy are improved.
Detailed Description
The technical scheme of the invention is further described by combining the drawings and the embodiment:
the embodiment provides a bile duct image segmentation method based on deep learning, which comprises the following steps:
step 1, obtaining an abdomen CT image, and labeling an intrahepatic bile duct dilation image in the abdomen CT image to obtain a data set.
In the embodiment of the application, the intrahepatic dilated bile duct image in the abdominal CT image is labeled in an artificial labeling mode, so that an abdominal CT image data set with intrahepatic dilated bile duct image labeling is obtained.
And 2, preprocessing the data set.
In an embodiment of the present application, the preprocessing operation includes: setting upper and lower thresholds of a gray value of a data set, calculating to obtain a mean value and a variance of the gray value of the data set, and performing normalization operation on the gray value of the data set according to the obtained mean value and variance, wherein the normalization operation specifically comprises the following steps:
wherein y is the normalized data set image, x is the data set image before normalization, μ is the mean value of the grey scale values of the data set, and σ is the variance of the grey scale values of the data set.
The pre-processing operation may also include a scaling operation on the image size of the data set to set the image resolution in all data sets to 256 × 256 × 256.
Step 3, constructing a 3 DU-Net-based intrahepatic bile duct expansion segmentation model, and training by using a data set to obtain a trained intrahepatic bile duct expansion segmentation model;
the intrahepatic bile duct dilation segmentation model comprises a coding part and a decoding part, wherein the coding part is used for extracting and analyzing the features of an input image, and the decoding part is used for restoring the extracted features of the input image.
In the embodiment of the present application, the intrahepatic dilating bile duct segmentation model may adopt a 3DU-Net network, which includes 3 downsampling layers and 3 upsampling layers as shown in fig. 2, wherein the convolution kernel in the sampling layer is 3 × 3.
The training process specifically comprises: dividing a data set into a training set and a testing set; specifically, a training set in an abdominal CT image data set with intrahepatic expansion bile duct image labels is input into the intrahepatic expansion bile duct segmentation model, and feature extraction is carried out on the first convolution layer to obtain a first feature map;
the first feature map is zoomed through a first downsampling layer and is convolved on a second convolution layer to obtain a second feature map;
the second feature map is zoomed through a second downsampling layer and is convolved on a third convolution layer to obtain a third feature map;
the third feature map is scaled through a third downsampling layer and is convolved on a fourth convolution layer to obtain a fourth feature map, and the fourth feature is a bottom feature;
the fourth feature map is subjected to upsampling, fused with the third feature map and subjected to feature recovery in the first deconvolution layer to obtain a fifth feature map;
the fifth feature map is subjected to upsampling, fused with the second feature map and subjected to feature recovery in the second deconvolution layer to obtain a sixth feature map;
and the sixth feature map is subjected to upsampling, fused with the first feature map and subjected to feature recovery in the third deconvolution layer to obtain a model segmentation result.
Using Dice function as loss function of network, adopting Adam optimizer, setting initial learning rate to 1 × 10-4Where the Dice function is understood to be the similarity between two outline regions, A, B represents the point set included in the two outline regions, and is defined as:
obtaining a liver internal expansion bile duct segmentation model which is trained by a training set, and performing model correction on the liver internal expansion bile duct segmentation model by using a testing set, namely retraining, wherein a Focal loss function is used as a loss function, an SGD (generalized partial decomposition) is used as an optimizer, the initial learning rate is set to be 1 multiplied by 10-5Wherein the Focal loss function is specifically as follows:
wherein N is the number of images in the test set, i is the ith image in the test set, and yiLabel class, p, representing the ith image of the test setiIndicates the probability that the ith image is of a real category (i.e. y is 1), α is a weight parameter, logpiAs an initial cross-entropy loss function, (1-p)i)γGamma is the focusing parameter for the sample adjustment factor.
S4, acquiring an abdomen CT image to be segmented, preprocessing the abdomen CT image to be segmented, inputting the preprocessed abdomen CT image to be segmented into the trained intrahepatic bile duct expansion segmentation model, and obtaining an intrahepatic bile duct expansion image segmentation result.
In the implementation of the method, the phenomena of impurity points and missing segmentation of the expanded bile duct in the liver segmented by the existing algorithm can be avoided.
It is to be understood that the invention is not limited to the examples described above, but that modifications and variations may be effected thereto by those of ordinary skill in the art in light of the foregoing description, and that all such modifications and variations are intended to be within the scope of the invention as defined by the appended claims.