Automatic Intrahepatic Biliary Segmentation Based Image Processing Techniques using Magnetic Resonance Images

A set of tubes known as bile ducts connects the liver to an organ below it directly that is called Gallbladder. The dilation of a bile duct is an important indicator regarding any serious issue in the human body. Number of reasons may cause bile duct dilation, such as: stones, tumors which commonly occur due to pancreas or papilla of vater. In this paper, the main contributions are: 1) a novel framework that consists of three phases to be applied on a set of Magnetic Resonance Imaging (MRI) images 2) an extracted set of features with their accurate values that express the condition of the biliary trees from the MRI images. Such dataset can be used in several applications to determine whether a bile duct is dilated or not. The dataset is organized as the following: half of the MRI images are for normal bile ducts, while the other half is for dilated bile ducts. To extract the useful features to diagnose the medical condition of the bile ducts from the MRI images, we implemented and applied the proposed framework that is started by using the enhanced active contour technique without edges in combination with Denoising Convolutional Neural Networks (DnCNN) to perform the segmentation and features extraction process. After that, the output of the segmentation process is the segmented biliary tree that will be used later to extract the needful features to make a diagnostic decision whether there is a dilation or not by comparing the features values of the normal versus the dilated bile ducts. We applied the feed forward neural network with backpropagation training algorithm for classification purposes. According to the experiments, the overall accuracy of the proposed framework was 90.00%. Such approach improves and increases the accuracy of the physicians’ diagnostic decisions which is considered as of significant importance for treatment and cure.


Introduction
Bile duct is a set of tubes that connect the liver gallbladder with the pancreas [1][2][3]. Bile duct dilation is one of the important factors that the physicians count on to diagnose if there are any issues, for instance a cancer on the gallbladder. There are several reasons that lead to a dilation of the bile duct such as stones, tumors which commonly occur due to pancreas or papilla of vater [4][5].
The biliary tree consists of three organs: 1) the gallbladder, 2) intrahepatic bile ducts and 3) extrahepatic bile ducts [6]. Bile is composed of two components: 1) the pile pigments 2) the bile salts which help emulsify the fat. They allow the human body to turn fat into micelles which can then be absorbed in the ileum [7]. The Gallbladder momentarily stores the bile that is produced by the human liver and transferred via the common hepatic duct and the cystic duct [8][9][10] The major goal of the gallbladder is to get rid of the bile, and this is accomplished by a hormone, called cholecystokinin (CCK), that causes the bile to leave the gallbladder [11][12]. The CCK causes the gallbladder to contract and squeeze all the bile right back out to flow through the cystic duct, and continue through the common bile duct which is the last component of what is known as: the biliary tree [13].
It is obvious that the normal bile duct diameter is in the range of 4-8 mm [15]. The dilation of bile duct increases the risk of cholangiocarcinoma and can be caused due to several reasons. The most common cause of dilated bile duct is the obstruction of the biliary tree, which is caused, in turn, by tumors, stones and benign strictures. However, the reasons that lead to the dilated bile ducts are either congenital or acquired dilations without obstruction that can associate with abnormalities of junction between the pancreatic duct and the bile duct. Anyhow, the dilation of the bile duct can be symptoms-free, therefore it is important for the physician to check whether there is a dilation in the bile duct or not, in order to make the diagnostic decision reliable enough for further process [16].
In this paper we introduce a three phase's framework to extract the needed features to diagnose the dilation of the biliary ducts. The first phase is the preprocessing of the image, and it starts by resizing the MRI image. After that, the image is converted to gray scale and sharpened [17][18]. Finally, the image is de-noised by using a convolution neural network [19]. The second phase is called the segmentation phase that applies the contour without edges technique [20] on the enhanced MRI image from the preprocessing phase. The main goal of the segmentation phase is to segment the bile duct. The third phase, which is called the features extraction, is applied to extract the needful features of the segmented bile duct. Those features and their values from the 40-MRI images form the dataset that can be used in several machine learning based medical applications for bile ducts diagnose.
The set of MRI images has been collected from King Hussein Medical Center-Jordan. Half of those images is for dilated bile ducts, while the other half is for normal bile ducts.
The rest of this paper is organized as the following: Section 2 reviews the related work on image processing based biliary tree segmentation and extraction. The proposed framework and the results are presented and discussed in section 3. Finally, section 4 concludes this paper and presents some future directions.

Literature Review
Many researchers have proposed several works regarding bile dilation. However, there is a lack of studies regarding bile duct dilation using MRI images as most of the studies are focused on CT images.
Medical images are considered as a very important resource that provides us with priceless information for medical decisions and scenarios, especially when combined with deep learning techniques [21]. For Magnetic Resonance Images (MRI) of the biliary tree, it is very important to remove any type of noise as a preprocessing step, since such noise would obstruct disease diagnose [22]. [23] mentioned that a new age of images-based diseases diagnose is starting, since it reviews the most recent evolving techniques in the field of medical images processing, especially those techniques related to the de-noising stages with deep learning approaches. Several deep learning techniques were introduced in a wide range of professional research to measure the dilation of the bile duct. Neural Networks are considered as pioneer techniques in the field of machine learning, and it has several applications with images processing starting from the backpropagation neural networks up to the Convolutional Neural Networks Fig.1 Anatomy of biliary tree and bile duct [14].
(CNN) [24]. Some research provided exciting proofs and interpretations regarding the behavior of the neural network weights in general and in the backpropagation networks in particular [25][26]. Another researches introduced a valuable study about the applications of neural networks in features extraction and features selection [27]. However, the performance of the CNN machines in the applications of images, and especially in images denoising was significant. [28] provided a review about the concept of deep learning emphasizing the crucial role of the deep learning techniques in the radiology based medical practices. One of those techniques is the De-noising CNN (DnCNN). We noticed that none of the known MR images approaches applied the DnCNN to get rid of any noise in the MR images, especially for bile duct measurement. However, the DnCNN was thoroughly applied with MR images for other human organs [29][30][31]. Hence, the approach in this research can be considered as the first one that uses DnCNN to remove noise from bile duct MR images. [32] introduced a fruitful study about processing the Magnetic Resonance cholangiopancreatography (MRCP) images to measure the bile duct diameter. The authors in [33] followed an approach to check the efficiency of the DnCNN by introducing some artificial noise to be corrected, and in the results, they obtained very small variations. Moreover, [34] introduced a new technique for deep learning de-noising that is based mainly on two stages.
Various approaches and techniques were applied to handle the liver and the bile tree. Those techniques used various kinds of images such as ultrasound images, magnetic resonance imaging (MRI), computed tomography (CT), MR cholangiopancreatography (MRCP), etc. However, the MRI is considered as an evolving technique and it has been widely accepted and used in the medical treatment of the biliary related diseases [35]. One of the very common techniques in this manner is the Contour Segmentation Technique (CST) to measure the contour, volume of liver or the bile tree. In this research we applied this technique especially for the intrahepatic biliary duct diameter, which we noticed that the Contour Segmentation Technique was not used before to perform such kind of functions. In [36] the CST technique was applied with 4D models for liver anatomy in order to perform the surgical resection properly and to avoid any unusual anatomy related to the needed information about the biliary during the surgery. Such kind of information is not available via CT images nor via MRI. And hence the 4D models are considered as the most appropriate techniques. Nevertheless, the approach that was proposed by [37] is also considered as an efficient technique that applies the 3D imaging for computer assisted surgical planning. In contrast, [38] suggested a special scheme that uses the MRI to measure the liver volume accurately through three main stages. The main tool here to define the boundaries of the liver was the contour segmentation method. Similarly, [39] mentioned the effect of MRI based techniques and the development of its role in data conquest and data analysis. They found that MRI encountered a major advancement in the research areas and medical treatment techniques regarding the biliary duct in particular. Also [40] suggested an approach to assess the biliary duct via MRI and MRCP images similarly to what was introduced by [41]. Other approaches introduced ultrasound-based techniques on the extrahepatic bile duct to detect the probable duct dilation and consequently diagnose the primary neuroendocrine [42]. And similarly, an ultrasound-based technique was used by [43] for the assessment of the biliary duct In this study, and according to the related work review, it was clear that the proposed framework here will be the first one that applies the DnCNN technique in combination with the CST to handle the intrahepatic biliary ducts from the MRI images, and to extract a useful set of features and values that expresses the diagnostic condition of this organ.

Methods and Experiments
In this study, we applied the suggested framework on a set of MRI images. The implementation of the framework was carried out using MATLAB 2019b software. Figure 2 illustrates the framework and its three main phases to perform image processing and segmentation for features extraction.

Dataset
As mentioned earlier, the dataset 1was generated according to 40 raw MRI images that were collected from King Hussein Medical Center (Amman-Jordan). The range of the participants' ages is 40 -65 years old. A surgeon stated the dilation level of each bile duct in the images; and accordingly the bile duct in each image was labeled as Normal or Dilated Taking into consideration that the diameter of a normal bile duct ranges from 4mm up to 8mm [15]. Hence, we have two categories of the images: 20 dilated MRI images and 20 normal MRI images.

Preprocessing
As figure 2 illustrates, this phase is the first phase of the introduced framework. It starts by sending the MRI image into a cascade process in order to prepare the image for the next phase which is: biliary tree and bile duct automatic segmentation. In the first step of the pre-processing phase, the MRI image is resized and set the height × width to be 512×512. Then, the image is converted into gray level to be sharpened, as shown in the following equation: After that the gray scaled image is fed into the trained neural network in order to remove any existing noise by using feed-forward De-noising Convolution Neural Network (DnCNN) [19], as shown in figure 3.a.
This technique is based mainly on handling Gaussian de-noising with any noise level. DnCNN implicitly removes the latent noise-free image in the heading layers of the DnCNN. In short, DnCNN sends the image into several stages:


Set the convolution filter size to 3 × 3.  Set the receptive field size to 35 × 35 and applies Gaussian de-noising.  Apply residual learning to train residual mapping based on three layers (Convolution layer, Relu Layer and BN layer).
Finally, DnCNN trained in an end-to-end fashion.
Where (Θ) is the trained parameters, N represents the number of images, x i , y i represent the noise-free image for training and R(y i ; Θ) represents the residual learning [19].
After that, the process of image enhancement is initiated via histogram equalization which is considered as a technique for contrast adjustment that provides better image quality without any information loss [44], as what Figure 3.b shows. Equation 3 below illustrates the histogram equalization technique: where CDF is the cumulative distribution function, CDF min is the minimum non-zero value of the cumulative distribution function, M and N are the width and the height of the image respectively, and L is the number of the used gray level.
Then, an image complement is applied to prepare the MRI image for the next enhancement in order to distinctively separate the biliary tree from the surrounded component of the image by applying De-Hazing technique. De-Hazing technique is used to reduce the atmospheric haze. It simply starts by estimating the atmospheric light. After that, it estimates and refines the transmission map, and finally it restores the image [45][46]. Figure 3.c illustrates the output MRI image after applying the De-Hazing technique.
The last step of preprocessing phase is illustrated in figure 3.c. It involves the complement of the image once again in order to prepare it for the second phase, which is the segmentation phase.

Segmentation
Once the preprocessing phase is performed properly, the image is ready for segmentation. The segmentation process starts with the creation of a black mask image that has the same size of the preprocessed image. Figure 4.a illustrates the white rectangle that is considered as a start point of the process inside the mask image, which is called a seed for the adopted segmentation technique.
The main problem that we face through constructing the mask that contains the seed inside it, is the appropriate position to plant the seed. Therefore, several experiments have been applied, and finally we found that the exact location to plant the seed is 10 pixels to the left side of the MRI image center.
As you can see from figure 4.a, the location of the seed (the white rectangle) is identified according to the following equations: where W, H are the width and the height of the mask image respectively. This location is guaranteed for all images we have as the starting point of the segmentation. However, identifying the exact location of the seed solves part of the problem only. The other part is solved by setting the proper size of the seed. The size of the seed is important because, in some cases, the seed does not reach the bile duct properly, thus, the segmentation process does not start at all. Therefore, to overcome this problem we adjust the size of the seed. The following equation shows the coordinate of adapted size of the seed. Figure 4.a shows the seed planted in the exact location as mentioned before. 1 = 2 − 10, 2 = 2 + 10, At this level, the segmentation is ready to be launched. In this manner, the enhanced active contour technique was adopted for the segmentation process [20]. The advantage of this technique is that it defects objects with undefined boundaries by gradient or smooth boundary. Moreover, the enhanced active contour technique is able to work even if the image still contains some noise [20]. Figure 4.b shows the segmentation process at iteration number (60, 340, 500 and 850) The active contour technique works according to the following equation: Where C represents the curve of the biliary tree, the constants c 1 , c 2 are the averages of u 0 inside and outside C respectively, u 0 represents the image gradient, and µ, λ are two positive parameters.
The main requirement of the enhanced active contour technique is to identify the number of needed iterations in advance. Therefore, several experiments were applied on both dilated and normal MRI images. We found that the needed numbers of iterations are 400 to extract the biliary tree from normal MRI images and 850 from dilated MRI images. As you can see from figure 4.c, the main output of this phase is the recognized biliary tree in the image under consideration.
Once the biliary tree was segmented successfully, the process of extracting the bile duct can be initiated. This is accomplished by using connected components or binary large object (blob) technique. The blob technique is based on two major parameters which are: perimeter and circularity. Therefore, once we apply the blob technique, several blob's will be generated from the segmented biliary tree, and hence the biggest connected component between the clustered blob's is identified as the bile duct. Figure 4.d shows the extracted bile duct from the biliary tree image.

Features Selection
The most important part of this research is to identify the features that affect the medical diagnosis about patient whether s/he has a dilated bile duct or not.
It is well known that the normal bile duct diameter falls in the range 4-8mm [15]. The diameter of the bile duct can be specified via its width and height according to the furthest distance between two points of the width and the height. Here, we labeled the width as minor axis, and the height as major axis. Moreover, the area of the bile duct is considered as an important factor in the medical diagnosis since the normal bile duct has a different area in comparison with what the dilated bile duct has. Also, by looking at the images, we found that the structure of the biliary tree of the dilated bile duct provides more information than what the normal bile duct does. In particular, the right hepatic duct and the left hepatic duct appear clearly in the MRI images of the dilated bile duct [47]. Therefore, the area of the biliary tree will be considered as a feature. Also, the compactness will be considered as a crucial feature. Equation 9 illustrates the compactness equation: Where P represents the perimeter, and a represents the area. The image in figure 4.e shows the difference in structure between the normal and the dilated bile ducts.

Results and Discussion
In this research, we applied several image processing techniques in order to extract the biliary tree along with the bile duct from MRI images. The proposed framework shows the selected features from the MRI image. The last phase of the introduced framework, as you can see from figure 2. Its major aim is to extract useful features about the segmented biliary tree and bile duct that was produced from the segmentation phase. Hence, after the successful implementation of this phase, five features were extracted: 1-Major Axis (MJA) 2-Minor Axis (MIA) 3-Intrahepatic Biliary Area (IBA) 4-Bile Duct Area (BDA) and 5-Compactness (CMP).
The major axis and the minor axis are the longest distance between the pixels in the bile duct horizontally and vertically, respectively, as shown in figure 9.
Intrahepatic biliary area is the area of the entire biliary tree. This feature, in particular, is important, because if the right and the left hepatic ducts on the liver are clear in the extracted biliary tree, then it is possible to conclude that: there is an expansion indicator in the common bile duct [1]. The other feature is the area of the bile duct that shows the difference between the normal and abnormal size of the bile duct. The last feature is the compactness that shows how the pixels are close to each other. Therefore, if the right and left bile duct are clear in the processed image, then the compactness will be greater than the compactness of the image that does not show them.
Hence, the main output of the introduced framework is a novel dataset of five features that describe the diagnostic condition of the biliary duct in the human body. Such dataset is very useful to develop a learning machine for concrete diagnostic decisions and early of some diseases, which is considered as of significant importance for treatment and cure.

Features analysis
After extracting the desired feature from all MRI images an alaysis applied to illustrate the correlation between the extracted features and the clinical measurements. Figure 11 (a)-(e) shows the correlation between the extracted features and the clinical measurements.

Risk determination
Once we extracted the needed features and their values are accurately measured, the dataset is ready to be used in a learning machine application. In this paper we will develop a classification machine by applying a binary classification technique, which is the feed forward neural network with backpropagation training algorithm. This machine will be able to distinguish between normal and dilated bile duct.  Table (III-V) shows the confusion matrices of the average training, validation and testing results after training the neural network 10 times. 70% of the MRI images in the dataset utilized for training, 15% utilized for validation and finally 15% utilized for testing.   Table VI shows the overall accuracy of the proposed framework. The confusion matrix shows that the framework overall accuracy is 90% and the overall error is 10%. Based on the accuracy, the sensitivity and specificity are as follows: = + , (10) = + , (11) So, according to the above equations and the overall accuracy information that came out from the confusion matrix, we found that the sensitivity result is 90% and the specificity result is 90%.

Conclusion
In this paper, a novel automated framework has been proposed and implemented for recognizing biliary tree and bile ducts to support physicians' related diagnostic decisions regarding the dilation issues.
The MRI images were collected from King Hussein Medical Center (Jordan -Amman) such that: the first half of the images is for normal bile ducts. Whereas, the other half includes dilated bile ducts. Each MRI image was labeled by specialists in the medical field.
A number of valuable features were extracted after implementing the framework. The features are: 1) Major Axis (MJA) 2) Minor Axis (MIA) 3) Intrahepatic Biliary Area (IBA) 4) Bile Duct Area (BDA) and 5) Compactness (CMP). The results show that: the values of the extracted features have different ranges, which reveal a promise for further research and applications. For future direction, more images will be added to the dataset. Moreover, with an expansively huge training dataset, data mining and machine learning techniques can be adopted