# Retinal Vessel Automatic Segmentation Using SegNet

Authors: Xiaomei Xu; Yixin Wang; Yu Liang; Siyuan Luo; Jianqing Wang; Weiwei Jiang; Xiaobo Lai
Journal: Computational and Mathematical Methods in Medicine
 (2022)

---

## Abstract

Extracting retinal vessels accurately is very important for diagnosing some diseases such as diabetes retinopathy, hypertension, and cardiovascular. Clinically, experienced ophthalmologists diagnose these diseases through segmenting retinal vessels manually and analysing its structural feature, such as tortuosity and diameter. However, manual segmentation of retinal vessels is a time-consuming and laborious task with strong subjectivity. The automatic segmentation technology of retinal vessels can not only reduce the burden of ophthalmologists but also effectively solve the problem that is a lack of experienced ophthalmologists in remote areas. Therefore, the automatic segmentation technology of retinal vessels is of great significance for clinical auxiliary diagnosis and treatment of ophthalmic diseases. A method using SegNet is proposed in this paper to improve the accuracy of the retinal vessel segmentation. The performance of the retinal vessel segmentation model with SegNet is evaluated on the three public datasets (DRIVE, STARE, and HRF) and achieved accuracy of 0.9518, 0.9683, and 0.9653, sensitivity of 0.7580, 0.7747, and 0.7070, specificity of 0.9804, 0.9910, and 0.9885,F1 score of 0.7992, 0.8369, and 0.7918, MCC of 0.7749, 0.8227, and 0.7643, and AUC of 0.9750, 0.9893, and 0.9740, respectively. The experimental results showed that the method proposed in this research presented better results than many classical methods studied and may be expected to have clinical application prospects.


---

## Body

## 1. Introduction

Retinal vessel location actually is also important to serve as a structural marker to represent retinal anatomy. For example, prior studies have shown that retinal vessel locations are relatively stable in glaucoma and eyes with different retinal vessel locations correspond to different retinal anatomies, which can affect the diagnostic accuracy of using existing normative data.With the change of lifestyles, the incidence of diseases such as diabetes, glaucoma, and hypertension has increased significantly in the modern society [1]. These diseases may cause retinopathy, and severe cases may result in visual impairment and blindness. And they can be diagnosed noninvasively by analysing the structural features of retinal vessels such as location [4] and tortuosity and diameter [2]. If these structural changes can be detected in the early stage, it will play an important role in the treatment of these diseases [3]. Clinical diagnosis of these diseases is done by experienced ophthalmologists who segment the retinal vessels manually to obtain their structural features. However, the manual segmentation of retinal vessels is tedious and requires a lot of time and energy [8]. The automatic segmentation of retinal vessels can reduce the work intensity of experienced ophthalmologists, and it has objectivity and repeatability. It can also solve the problem effectively that is a lack of experienced ophthalmologists in remote areas. Therefore, the automatic segmentation technology of retinal vessels is of great significance for clinical auxiliary diagnosis and treatment of ophthalmic diseases.Due to the influence of uneven brightness, low contrast, retinopathy, and other retinal structures such as optic disc, automatic segmentation of retinal vessels in color fundus images is a challenging task. However, for its great significance of auxiliary medical treatment, there have been many findings in this field. To extract retinal vessels, Cao et al. proposed a method with matched filtering and automatic threshold and obtained the accuracy of 0.9174 on the DRIVE dataset [6]. Cai et al. presented a retinal vessel segmentation method based on phase stretch transform and multiscale Gaussian filter, which can improve the segmentation accuracy [5]. It is difficult for the thin vessel segmentation. Zhou et al. proposed a method with a line detector, hidden Markov model (HMM), and a denoising approach to resolve this problem. It tested on the DRIVE and STARE datasets and obtained high specificity of 0.9803 and 0.9992 [18]. Most of the above researches showed that thin or low-contrast vessels have low segmentation sensitivity. To improve the segmentation sensitivity, Soomro et al. proposed a method including modules such as principal component analysis-based color-to-gray conversion and scale normalization factors [7]. Khan et al. used some contrast normalization methods to extract the retinal vessels and fused them to obtain the final [21]. These methods which do not need ground truth (hand-labelled) images are unsupervised methods for automatic.In addition to the unsupervised methods, some researchers have proposed supervised methods which need ground truth images to train the classifiers. Huang et al. realized a supervised learning method using an improved U-Net network with 23 convolutional layers, and the accuracy of the DRIVE, STARE, and HRF datasets was 0.9701, 0.9683, and 0.9698, respectively. However, its area under the curve (AUC) was only 0.8895, 0.8845, and 0.8686 [20]. Liang et al. fused the linear features, texture features, and the other features of retinal vessels to train a random forest classifier which realizes automatic segmentation of retinal vessels [9]. Lai et al. effectively fused mathematical morphology, matched filters, scale space analysis, multiscale line detection, and neural network models to achieve retinal vessel segmentation [10]. Fu et al. regarded retinal vessel segmentation as a boundary detection problem and segmented the vessels by combining the convolutional neural network and the connected conditional random field [11]. Orlando et al. proposed a discriminatively trained connected conditional random field model to segment retinal vessels [12]. Liskowski and Krawiec proposed a supervised segmentation method that used a deep neural network to extract retinal vessels from fundus images [13]. However, it is still a great challenge to segment vessels with high segmentation sensitivity and accuracy.Although these methods have obtained some research findings, the performance of most methods still needs to be improved, especially the segmentation accuracy. In this research, a method using SegNet is proposed to obtain higher accuracy and AUC. Contributions of this research are highlighted:(1)
The training samples of fundus image dataset are generally small. A method for amplifying training samples is designed in this research to improve the accuracy and generalization ability of SegNet. It extracts image patches from fundus images and performs affine transformation(2)
The method proposed in this research can effectively improve the performance of retinal vessel segmentations, which not only can reduce oversegmentation on thin vessels but also can segment the vessels near optic disc and lesion area very well(3)
Lots of experiments are conducted on the DRIVE, STARE, and HRF datasets to evaluate the performance of the proposed method. The results show that the accuracy and AUC are higher than many other methodsThis paper is organized as follows. In Section2, the methods and materials are introduced in detail. Evaluation metrics for the proposed method is described in the Section 3. The experimental results and discussions are shown in Section 4. Finally, several conclusions are recapitulated in Section 5.


## 2. Methods and Materials

### 2.1. Materials

The proposed method is evaluated on the international public available datasets DRIVE [22], STARE [23], and HRF [24]. Fundus images of the DRIVE are from the diabetic retinopathy screening project in the Netherlands. They are collected by Canon CR5, and the age of the subjects is from 25 to 90 years old. The dataset consists of 40 color fundus images with resolution of 565×584. It is divided into two subsets including training and testing datasets. Each subset has the following: the training dataset contains 20 fundus images and their retinal vessel binary images which are segmented manually by an expert and the testing dataset contains 20 fundus images and each of them has two binary images which are segmented manually by two experts. In this paper, binary images segmented manually by the first expert are used as the ground truth images.The STARE dataset was collected and published in 2000. It includes 20 fundus images, of which there are 10 images with pathological changes and the others are healthy fundus images. Their resolution is605×700. Each image is segmented manually by two experts, and binary images segmented manually by the first expert are used as the ground truth images. There are 10 test images and 10 training images in the research.The HRF dataset is the highest resolution of all fundus datasets at present. It includes 15 glaucoma retinal fundus, 15 diabetic retinopathy retinal fundus, and 15 healthy retinal fundus with a resolution of3504×2336. Each image has a manual segmentation result. The training dataset contains 36 fundus images including 12 glaucoma retinal fundus, 12 diabetic retinopathy retinal fundus, and 12 healthy retinal fundus. And the left images are the test dataset.In this paper, the machine learning library Keras in Python 3.6 is used to train and test the SegNet model for retinal vessel segmentation. In this research, PyCharm 2020.1 and Anaconda3 2020.2 are used as python IDE, while the back-end software needs tensorflow 1.15.0, Keras 2.3.1, Matplotlib 3.3.4, scikit-learn 0.22.1, and so on. The experimental platform for training and testing is NVIDIA Geforce Titan RTX 24G GPU of the Intel Xeon Silver 4210 2.2G GPU.


### 2.2. Methods

The overall flowchart of the method proposed in this research is shown in Figure1. First, fundus images, which are converted into gray images first, are preprocessed with contrast-limited adaptive histogram equalization (CLAHE) and normalized. Then, training samples are amplified with extracting image patches and affine transformation. Finally, SegNet model is constructed and trained to segment retinal vessels.Figure 1
Structure diagram of the proposed method.


#### 2.2.1. Preprocessing Fundus Images

In order to reduce the background interference and the influence of the noise, enhance the contrast of retinal vessels, accelerate the convergence speed of the algorithm, and improve the learning performance of SegNet model, preprocessing the fundus images is needed as shown in Figure2. Retinal vessel segmentation is a very difficult task to extract thin vessels. According to the preexperiment, it could enhance well the thin vessels’ contrast, using the method that the RGB image is converted to gray image. And considering with the color theory and the feature of each channel image, the color image “img” is converted to “gray” image with the following equation:
(1)gray=imgR×0.299+imgG×0.587+imgB×0.114,where imgR, imgG, and imgB are the red, green, and blue channel components of the image “img” in sequence, respectively.Figure 2
Preprocessing fundus image.
(a)(b)(c)After studying the feature of the converted gray image, to reduce the influence of the noise and to improve the contrast of retinal vessels, they are preprocessed with CLAHE. To facilitate data processing and improve the convergence speed of the model, fundus and their ground truth images are both normalized. They are normalized by Equation (2) and Equation (3), respectively. And the gray value of their pixels will be between 0 and 1.
(2)gray∗=gray−mingraymaxgray−mingray,where gray∗ is the normalized image of the gray image gray.
(3)imggt∗=imggt255,where imggt∗ is the normalized image of the ground truth image imggt.


#### 2.2.2. Amplifying Training Samples

The training samples of fundus image dataset are generally small. However, SegNet architecture has a large number of weight parameters. It needs a large number of training samples to improve their accuracy and generalization ability. If the network is trained directly with the fundus image, it would cause overfitting. So, the training samples should be amplified. Amplifying training sample algorithm includes extracting image patches and affine transformation, and they are described as follows:(1)
Extracting image patches. When extracting image patches, it is necessary to confirm whether the height and width of the reprocessed imagegray∗ can be divided exactly by the height and width of the patch, respectively. If it cannot be divided exactly, the reprocessed image gray∗ should be extended by Equation (4) and Equation (5), and a new image graye∗ will be obtainedThe order of extracting images patches in the proposed method is from left to right and top to bottom, as shown in Figure3. At first, the image patches of the first row are extracted, and then, the other rows are extracted in turn. Finally, the patches set a is obtained and a=a1,a2,⋯,a6,a7,⋯, where ai is an image patch and i is the extracting order.
(4)h′=h+hextend,(5)w′=w+wextend,where h and w are the height and width of the reprocessed image gray∗, respectively; h′ and w′ are the height and width of the new image graye∗, respectively; hextend and wextend are the height and width of the area extended, which are expressed as Equation (6) and Equation (7), respectively.
(6)hextend=hpatch−h%hpatch,(7)wextend=wpatch−w%wpatch,where hpatch and wpatch are the height and width of the image patch, respectively. By comparing and analysing the model training curves and retinal vessel segmentation results under different patch sizes, the final values hpatch and wpatch both are 48 in the proposed method.
(2)
Affine transformation. In order to further expand the size of training samples, each image patch is rotated clockwise with its center point, and the transformation matrixA is shown as follows:
(8)A=cosθ−sinθ0−sinθcosθ0001,where θ represents the angle of rotation and θ=90∘,180∘,270∘.Figure 3
The diagram of the extracting image patches.


#### 2.2.3. Constructing and Training SegNet Model for Retinal Vessel Segmentation

The proposed method achieves end-to-end pixel segmentation with the SegNet model which is shown in Figure4. SegNet developed by Badrinarayanan et al. [29] is an architecture for image segmentation. It is a semantic segmentation network and designed for scene understanding applications which need efficiently both memory and computational time during inference. Compared with other competing architectures such as FCN [30] and DeconvNet [31], it has significantly smaller trainable parameters and plays better performance with competitive inference time and memory-wise.Figure 4
Schematic diagram of the proposed SegNet.In the proposed method, the SegNet architecture includes encoder layer, decoder layer, and softmax layer. In the encoder layer, there are four convolutions and pooling layers. Each convolution used to extract features is followed by a batch normalization for accelerating learning speed, a rectified linear unit (ReLU), and a2×2 maximum pooling operation (step size is 2) for downsampling. In each downsampling, the number of characteristic channels is doubled. In the decoder layer, there are four upsampling layers and four convolutions. After each upsampling is a convolution, and each convolution is followed by batch standardization and ReLU. The last layer of architecture is softmax layer which classifies each pixel using 1×1 convolution.When SegNet is trained, 10-fold cross-validation is used to obtain the optimal model. The samples are divided randomly into ten subsets with the same size, and then set the proportion of training and validation dataset with 9 : 1. The SegNet model is built by the training dataset and adjusted its parameters by the validation dataset. And the optimal model for retinal vessel segmentation is selected, which has the highest accuracy on the validation dataset.In order to improve the imbalance between vessel pixels and nonvessel pixels, a class-balanced cross-entropy loss functionLoss is adopted, as shown in the following equation.
(9)Loss=−∑i=1Nαyilogpi−1−α1−yi×log1−pi,where N is the total number of pixels in the validation dataset, yi is the classification label of the ith pixel in the ground truth image, and yi∈0,1, where 0 is the background pixel and 1 is the vessel pixel. pi is the predicted value of the ith pixel and α is shown in the following equation.
(10)α=∑i=1N1−yiyi.In order to optimize the cross-entropy loss functionLoss and to reduce the burden of debugging parameters, adaptive moment estimation (Adam) method [14] is adopted. The parameters of training are set as follows: the learning rate lr is set 0.001 initially, and it is set with 0.96 of the initial value of every 5 iterations; the iteration period epoch is 10.


## 2.1. Materials

The proposed method is evaluated on the international public available datasets DRIVE [22], STARE [23], and HRF [24]. Fundus images of the DRIVE are from the diabetic retinopathy screening project in the Netherlands. They are collected by Canon CR5, and the age of the subjects is from 25 to 90 years old. The dataset consists of 40 color fundus images with resolution of 565×584. It is divided into two subsets including training and testing datasets. Each subset has the following: the training dataset contains 20 fundus images and their retinal vessel binary images which are segmented manually by an expert and the testing dataset contains 20 fundus images and each of them has two binary images which are segmented manually by two experts. In this paper, binary images segmented manually by the first expert are used as the ground truth images.The STARE dataset was collected and published in 2000. It includes 20 fundus images, of which there are 10 images with pathological changes and the others are healthy fundus images. Their resolution is605×700. Each image is segmented manually by two experts, and binary images segmented manually by the first expert are used as the ground truth images. There are 10 test images and 10 training images in the research.The HRF dataset is the highest resolution of all fundus datasets at present. It includes 15 glaucoma retinal fundus, 15 diabetic retinopathy retinal fundus, and 15 healthy retinal fundus with a resolution of3504×2336. Each image has a manual segmentation result. The training dataset contains 36 fundus images including 12 glaucoma retinal fundus, 12 diabetic retinopathy retinal fundus, and 12 healthy retinal fundus. And the left images are the test dataset.In this paper, the machine learning library Keras in Python 3.6 is used to train and test the SegNet model for retinal vessel segmentation. In this research, PyCharm 2020.1 and Anaconda3 2020.2 are used as python IDE, while the back-end software needs tensorflow 1.15.0, Keras 2.3.1, Matplotlib 3.3.4, scikit-learn 0.22.1, and so on. The experimental platform for training and testing is NVIDIA Geforce Titan RTX 24G GPU of the Intel Xeon Silver 4210 2.2G GPU.


## 2.2. Methods

The overall flowchart of the method proposed in this research is shown in Figure1. First, fundus images, which are converted into gray images first, are preprocessed with contrast-limited adaptive histogram equalization (CLAHE) and normalized. Then, training samples are amplified with extracting image patches and affine transformation. Finally, SegNet model is constructed and trained to segment retinal vessels.Figure 1
Structure diagram of the proposed method.


### 2.2.1. Preprocessing Fundus Images

In order to reduce the background interference and the influence of the noise, enhance the contrast of retinal vessels, accelerate the convergence speed of the algorithm, and improve the learning performance of SegNet model, preprocessing the fundus images is needed as shown in Figure2. Retinal vessel segmentation is a very difficult task to extract thin vessels. According to the preexperiment, it could enhance well the thin vessels’ contrast, using the method that the RGB image is converted to gray image. And considering with the color theory and the feature of each channel image, the color image “img” is converted to “gray” image with the following equation:
(1)gray=imgR×0.299+imgG×0.587+imgB×0.114,where imgR, imgG, and imgB are the red, green, and blue channel components of the image “img” in sequence, respectively.Figure 2
Preprocessing fundus image.
(a)(b)(c)After studying the feature of the converted gray image, to reduce the influence of the noise and to improve the contrast of retinal vessels, they are preprocessed with CLAHE. To facilitate data processing and improve the convergence speed of the model, fundus and their ground truth images are both normalized. They are normalized by Equation (2) and Equation (3), respectively. And the gray value of their pixels will be between 0 and 1.
(2)gray∗=gray−mingraymaxgray−mingray,where gray∗ is the normalized image of the gray image gray.
(3)imggt∗=imggt255,where imggt∗ is the normalized image of the ground truth image imggt.


### 2.2.2. Amplifying Training Samples

The training samples of fundus image dataset are generally small. However, SegNet architecture has a large number of weight parameters. It needs a large number of training samples to improve their accuracy and generalization ability. If the network is trained directly with the fundus image, it would cause overfitting. So, the training samples should be amplified. Amplifying training sample algorithm includes extracting image patches and affine transformation, and they are described as follows:(1)
Extracting image patches. When extracting image patches, it is necessary to confirm whether the height and width of the reprocessed imagegray∗ can be divided exactly by the height and width of the patch, respectively. If it cannot be divided exactly, the reprocessed image gray∗ should be extended by Equation (4) and Equation (5), and a new image graye∗ will be obtainedThe order of extracting images patches in the proposed method is from left to right and top to bottom, as shown in Figure3. At first, the image patches of the first row are extracted, and then, the other rows are extracted in turn. Finally, the patches set a is obtained and a=a1,a2,⋯,a6,a7,⋯, where ai is an image patch and i is the extracting order.
(4)h′=h+hextend,(5)w′=w+wextend,where h and w are the height and width of the reprocessed image gray∗, respectively; h′ and w′ are the height and width of the new image graye∗, respectively; hextend and wextend are the height and width of the area extended, which are expressed as Equation (6) and Equation (7), respectively.
(6)hextend=hpatch−h%hpatch,(7)wextend=wpatch−w%wpatch,where hpatch and wpatch are the height and width of the image patch, respectively. By comparing and analysing the model training curves and retinal vessel segmentation results under different patch sizes, the final values hpatch and wpatch both are 48 in the proposed method.
(2)
Affine transformation. In order to further expand the size of training samples, each image patch is rotated clockwise with its center point, and the transformation matrixA is shown as follows:
(8)A=cosθ−sinθ0−sinθcosθ0001,where θ represents the angle of rotation and θ=90∘,180∘,270∘.Figure 3
The diagram of the extracting image patches.


### 2.2.3. Constructing and Training SegNet Model for Retinal Vessel Segmentation

The proposed method achieves end-to-end pixel segmentation with the SegNet model which is shown in Figure4. SegNet developed by Badrinarayanan et al. [29] is an architecture for image segmentation. It is a semantic segmentation network and designed for scene understanding applications which need efficiently both memory and computational time during inference. Compared with other competing architectures such as FCN [30] and DeconvNet [31], it has significantly smaller trainable parameters and plays better performance with competitive inference time and memory-wise.Figure 4
Schematic diagram of the proposed SegNet.In the proposed method, the SegNet architecture includes encoder layer, decoder layer, and softmax layer. In the encoder layer, there are four convolutions and pooling layers. Each convolution used to extract features is followed by a batch normalization for accelerating learning speed, a rectified linear unit (ReLU), and a2×2 maximum pooling operation (step size is 2) for downsampling. In each downsampling, the number of characteristic channels is doubled. In the decoder layer, there are four upsampling layers and four convolutions. After each upsampling is a convolution, and each convolution is followed by batch standardization and ReLU. The last layer of architecture is softmax layer which classifies each pixel using 1×1 convolution.When SegNet is trained, 10-fold cross-validation is used to obtain the optimal model. The samples are divided randomly into ten subsets with the same size, and then set the proportion of training and validation dataset with 9 : 1. The SegNet model is built by the training dataset and adjusted its parameters by the validation dataset. And the optimal model for retinal vessel segmentation is selected, which has the highest accuracy on the validation dataset.In order to improve the imbalance between vessel pixels and nonvessel pixels, a class-balanced cross-entropy loss functionLoss is adopted, as shown in the following equation.
(9)Loss=−∑i=1Nαyilogpi−1−α1−yi×log1−pi,where N is the total number of pixels in the validation dataset, yi is the classification label of the ith pixel in the ground truth image, and yi∈0,1, where 0 is the background pixel and 1 is the vessel pixel. pi is the predicted value of the ith pixel and α is shown in the following equation.
(10)α=∑i=1N1−yiyi.In order to optimize the cross-entropy loss functionLoss and to reduce the burden of debugging parameters, adaptive moment estimation (Adam) method [14] is adopted. The parameters of training are set as follows: the learning rate lr is set 0.001 initially, and it is set with 0.96 of the initial value of every 5 iterations; the iteration period epoch is 10.


## 2.2.1. Preprocessing Fundus Images

In order to reduce the background interference and the influence of the noise, enhance the contrast of retinal vessels, accelerate the convergence speed of the algorithm, and improve the learning performance of SegNet model, preprocessing the fundus images is needed as shown in Figure2. Retinal vessel segmentation is a very difficult task to extract thin vessels. According to the preexperiment, it could enhance well the thin vessels’ contrast, using the method that the RGB image is converted to gray image. And considering with the color theory and the feature of each channel image, the color image “img” is converted to “gray” image with the following equation:
(1)gray=imgR×0.299+imgG×0.587+imgB×0.114,where imgR, imgG, and imgB are the red, green, and blue channel components of the image “img” in sequence, respectively.Figure 2
Preprocessing fundus image.
(a)(b)(c)After studying the feature of the converted gray image, to reduce the influence of the noise and to improve the contrast of retinal vessels, they are preprocessed with CLAHE. To facilitate data processing and improve the convergence speed of the model, fundus and their ground truth images are both normalized. They are normalized by Equation (2) and Equation (3), respectively. And the gray value of their pixels will be between 0 and 1.
(2)gray∗=gray−mingraymaxgray−mingray,where gray∗ is the normalized image of the gray image gray.
(3)imggt∗=imggt255,where imggt∗ is the normalized image of the ground truth image imggt.


## 2.2.2. Amplifying Training Samples

The training samples of fundus image dataset are generally small. However, SegNet architecture has a large number of weight parameters. It needs a large number of training samples to improve their accuracy and generalization ability. If the network is trained directly with the fundus image, it would cause overfitting. So, the training samples should be amplified. Amplifying training sample algorithm includes extracting image patches and affine transformation, and they are described as follows:(1)
Extracting image patches. When extracting image patches, it is necessary to confirm whether the height and width of the reprocessed imagegray∗ can be divided exactly by the height and width of the patch, respectively. If it cannot be divided exactly, the reprocessed image gray∗ should be extended by Equation (4) and Equation (5), and a new image graye∗ will be obtainedThe order of extracting images patches in the proposed method is from left to right and top to bottom, as shown in Figure3. At first, the image patches of the first row are extracted, and then, the other rows are extracted in turn. Finally, the patches set a is obtained and a=a1,a2,⋯,a6,a7,⋯, where ai is an image patch and i is the extracting order.
(4)h′=h+hextend,(5)w′=w+wextend,where h and w are the height and width of the reprocessed image gray∗, respectively; h′ and w′ are the height and width of the new image graye∗, respectively; hextend and wextend are the height and width of the area extended, which are expressed as Equation (6) and Equation (7), respectively.
(6)hextend=hpatch−h%hpatch,(7)wextend=wpatch−w%wpatch,where hpatch and wpatch are the height and width of the image patch, respectively. By comparing and analysing the model training curves and retinal vessel segmentation results under different patch sizes, the final values hpatch and wpatch both are 48 in the proposed method.
(2)
Affine transformation. In order to further expand the size of training samples, each image patch is rotated clockwise with its center point, and the transformation matrixA is shown as follows:
(8)A=cosθ−sinθ0−sinθcosθ0001,where θ represents the angle of rotation and θ=90∘,180∘,270∘.Figure 3
The diagram of the extracting image patches.


## 2.2.3. Constructing and Training SegNet Model for Retinal Vessel Segmentation

The proposed method achieves end-to-end pixel segmentation with the SegNet model which is shown in Figure4. SegNet developed by Badrinarayanan et al. [29] is an architecture for image segmentation. It is a semantic segmentation network and designed for scene understanding applications which need efficiently both memory and computational time during inference. Compared with other competing architectures such as FCN [30] and DeconvNet [31], it has significantly smaller trainable parameters and plays better performance with competitive inference time and memory-wise.Figure 4
Schematic diagram of the proposed SegNet.In the proposed method, the SegNet architecture includes encoder layer, decoder layer, and softmax layer. In the encoder layer, there are four convolutions and pooling layers. Each convolution used to extract features is followed by a batch normalization for accelerating learning speed, a rectified linear unit (ReLU), and a2×2 maximum pooling operation (step size is 2) for downsampling. In each downsampling, the number of characteristic channels is doubled. In the decoder layer, there are four upsampling layers and four convolutions. After each upsampling is a convolution, and each convolution is followed by batch standardization and ReLU. The last layer of architecture is softmax layer which classifies each pixel using 1×1 convolution.When SegNet is trained, 10-fold cross-validation is used to obtain the optimal model. The samples are divided randomly into ten subsets with the same size, and then set the proportion of training and validation dataset with 9 : 1. The SegNet model is built by the training dataset and adjusted its parameters by the validation dataset. And the optimal model for retinal vessel segmentation is selected, which has the highest accuracy on the validation dataset.In order to improve the imbalance between vessel pixels and nonvessel pixels, a class-balanced cross-entropy loss functionLoss is adopted, as shown in the following equation.
(9)Loss=−∑i=1Nαyilogpi−1−α1−yi×log1−pi,where N is the total number of pixels in the validation dataset, yi is the classification label of the ith pixel in the ground truth image, and yi∈0,1, where 0 is the background pixel and 1 is the vessel pixel. pi is the predicted value of the ith pixel and α is shown in the following equation.
(10)α=∑i=1N1−yiyi.In order to optimize the cross-entropy loss functionLoss and to reduce the burden of debugging parameters, adaptive moment estimation (Adam) method [14] is adopted. The parameters of training are set as follows: the learning rate lr is set 0.001 initially, and it is set with 0.96 of the initial value of every 5 iterations; the iteration period epoch is 10.


## 3. Evaluation Metrics

To evaluate the performance of the proposed method, the evaluation metrics of accuracy, specificity, sensitivity,F1 score (F1), area under the receiver operating characteristic (ROC) curve (AUC), and Matthews correlation coefficient (MCC) are used. Accuracy is the ratio of the pixels segmented correctly to the total pixels of fundus image; specificity is the ratio of the nonvessel pixels segmented correctly to the total of nonvessel pixels; sensitivity is the ratio of the vessel pixels segmented correctly to the total of the vessel pixels. They are calculated as Equations (10)–(13). F1 is calculated with Equation (14) that comprehensively considers the precision and recall of the model; ROC curve is a curve reflecting the relationship between sensitivity and specificity. The closer the curve is to the upper left corner (the smaller x and the larger y); that is, the larger the area below the curve and the higher the AUC value, the higher the segmentation accuracy is. MCC is computed with Equation (15), which measures the performance of unbalanced datasets very well. The value of 1 indicates the perfect segmentation on the test fundus images, while the value of -1 means that the segmentation is completely inconsistent with the ground truth.
(11)Accuracy=TP+TNTP+FN+TN+FP,(12)Specificity=TNTN+FP,(13)Sensitivity=TPTP+FN,(14)F1=2×TP2×TP+FN+FP,(15)MCC=TP×TN−FP×FNTP+FPFN+TPFN+TNFP+TN,where TP represents the vessel pixels classified as vessel pixels, FN represents the vessel pixels classified as nonvessel pixels, TN represents the nonvessel pixels classified as nonvessel pixels, and FP represents the nonvessel pixels classified as vessel pixels.


## 4. Experimental Results

The proposed method is tested and evaluated on the three datasets: DRIVE, STARE, and HRF. The training and test images of the three datasets are explained in Section2.1. To illustrate the training and validation process, the loss curves of the proposed method trained on the three datasets are shown in Figures 5–7, respectively. The abscissa of the graph is the iteration period “Epoch,” and the ordinate is the loss value “LOSS.” Legend “train” represents training, and legend “val” represents validation. From Figures 5–7, it shows that the training loss values of the DRIVE, STARE, and HRF are all smaller than 2 after one epoch. It means that the loss of training and validation both converge quickly, when the proposed method is trained on the three datasets.Figure 5
The loss curves of the proposed method trained on the DRIVE dataset.Figure 6
The loss curves of the proposed method trained on the STARE dataset.Figure 7
The loss curves of the proposed method trained on the HRF dataset.The evaluation metrics results of the DRIVE (20 test images), STARE (10 test images), and HRF (9 test images) are shown in Table1, Table 2, and Table 3, respectively. The statistical scores show that the proposed method performs well all on the three datasets. In terms of retinal vessel segmentation AUC, the minimum value of the DRIVE dataset is 0.9665 and the maximum is 0.9837, while the minimum and maximum of the STARE dataset are 0.9675 and 0.9946 and of the HRF dataset are 0.9651 and 0.9804. In terms of F1 score, the maximum of DRIVE is 0.8452, while STARE is 0.8851 and HRF is 0.8508; in terms of specificity, the minimum of DRIVE is 0.9865, and the minimum value of STARE is 0.9951 and HRF is 0.9954. That all, the proposed method could segment retinal vessels from fundus image well. It is robust to segment the low-resolution images of the DRIVE and STARE datasets and the high-resolution images of the HRF dataset.Table 1
Statistical scores achieved on the DRIVE dataset.
ImagesSensitivitySpecificityF1MCCAccuracyAUCTest010.82200.96730.80640.77670.94830.9803Test020.82900.97660.84520.81880.95450.9824Test030.67930.98550.76990.74540.94080.9692Test040.75070.98520.81280.79030.95390.9685Test050.72660.98650.80190.77990.95130.9706Test060.69490.98610.78110.75780.94500.9665Test070.71800.98620.79400.77190.95070.9679Test080.69190.98610.77380.75230.94920.9706Test090.69140.98620.77020.74960.95150.9690Test100.74950.98150.79480.77060.95380.9724Test110.76290.97700.79570.76770.94920.9681Test120.74600.98300.80010.77640.95330.9780Test130.72890.98160.79220.76510.94580.9686Test140.80220.97790.81530.79120.95720.9818Test150.80860.97730.80670.78430.95980.9814Test160.77200.97910.80790.78160.95200.9806Test170.71120.98360.77810.75450.95000.9756Test180.81370.97250.80340.77760.95420.9816Test190.85220.97340.83270.80950.95880.9837Test200.81000.97470.80120.77730.95710.9823Table 2
Statistical scores achieved on the STARE dataset.
ImagesSensitivitySpecificityF1MCCAccuracyAUCTest010.74510.99240.82090.80870.96830.9902Test020.88860.98180.86970.85420.97190.9931Test030.81170.98830.85580.83880.96680.9907Test040.83330.99270.88410.87090.97280.9942Test050.78350.99220.85090.83670.96760.9912Test060.83900.99070.88510.86930.96950.9946Test070.74850.99330.83330.81970.96330.9912Test080.77790.99510.84400.83690.98010.9930Test090.69280.99250.76460.75600.97490.9878Test100.52160.99090.64700.64270.94830.9675Table 3
Statistical scores achieved on the HRF dataset.
ImagesSensitivitySpecificityF1MCCAccuracyAUC2_h0.73250.99320.85080.78870.95920.98042_g0.70940.98840.82090.75980.96380.97415_dr0.74180.98590.81430.75650.96790.974310_g0.71540.98880.77420.75990.96760.975511_dr0.70630.98790.77820.77820.95960.975412_dr0.68230.98610.75700.73770.95470.970212_g0.71160.98710.77750.75980.96020.971414_h0.69780.98360.77490.76540.96990.979415_h0.66580.99540.77840.77310.98450.9651Meanwhile, the ROC curves of the three datasets tested with the proposed method are shown in Figure8. It can be seen that the ROC curve of the model tested on the STARE dataset is the closest to the upper left corner, and the curve of the model tested on HRF is the lowest. The different datasets have a slight impact on the model, but in general, the model can get good segmentation performance.Figure 8
ROC curves of the proposed method tested on the DRIVE, STARE, and HRF datasets.


## 5. Discussions

Qualitative results of the proposed method are compared with the other methods which are shown in Figures9–11. Figure 9 shows the methods tested on the DRIVE dataset. It can be seen that compared with the other two models, it shows that the segmentation performance of the proposed method is better than other methods, especially the thin vessels and the vessels in the optic disc region. For thin vessels in the fundus image test15, there is oversegmentation in the method proposed by Alom et al. [33], while the method proposed by Guo and Peng [17] also has this problem. In addition, the optic disc has a great influence on the retinal vessel segmentation, and the nonvessel pixels in this region are often mislabelled as vessel pixels, such as the fundus image test19 segmented by Guo and Peng [17]. And it can be seen from Figure 10 that the proposed method has better performance than the three methods proposed by Alom et al. [33], Hu et al. [32], and Guo and Peng [17], especially in thin vessels. For thin vessels in the fundus image test02, compared with its ground truth, there is oversegmentation in the method proposed by Hu et al. [32]. And they are not segmented well in the method proposed by Guo and Peng [17]. While the method proposed by Guo and Peng [17], tested on the HRF dataset shown in Figure 11, it can be found that the thin vessels are not segmented well, too. In short, the proposed method not only reduces oversegmentation on thin vessels but also segments thin vessels or vessels around optic disc well.Figure 9
Qualitative results compared with other methods on the DRIVE dataset: (a) original image, (b) ground truth, (c) Alom et al., (d) Guo and Peng, and (e) the proposed method.Figure 10
Qualitative results compared with other methods on the STARE dataset: (a) original image, (b) ground truth, (c) Alom et al., (d) Hu et al., (e) Guo and Peng, and (f) the proposed method.Figure 11
Qualitative results compared with other methods on the HRF dataset: (a) original image, (b) ground truth, (c) Guo and Peng, and (d) the proposed method.Compared with the other methods on the DRIVE, STARE, and HRF datasets, the quantization results are listed in Table4, Table 5, and Table 6, respectively. These results reveal that the proposed method is superior to many other methods on the three datasets. On the DRIVE dataset, the proposed method has AUC of 0.9750, accuracy of 0.9518, sensitivity of 0.7580, specificity of 0.9804, F1 score of 0.7992, and MCC of 0.7749. And there are 16 methods compared with the proposed method. The AUC of the proposed method is highest except Zhou et al. [18] which is 0.0004 and Wu et al. [19] which is 0.008 better than the proposed method. On the STARE dataset, the proposed method has AUC of 0.9893, accuracy of 0.9683, sensitivity of 0.7747, specificity of 0.9910, F1 score of 0.8369, and MCC of 0.8227. And it is compared with 15 methods in Table 5. The accuracy of the proposed method is highest except Sun et al. [35] which is 0.0031 and Khan et al. [26] which is 0.0277 higher than the proposed method. The proposed method obtains the highest F1 score, MCC, and AUC of all methods shown in Table 5. On the HRF dataset, the proposed method has AUC of 0.9740, accuracy of 0.9653, sensitivity of 0.7070, specificity of 0.9885, F1 score of 0.7918, and MCC of 0.7643. It can be seen from Table 6 that the proposed method obtains the highest specificity, F1 score, MCC, accuracy, and AUC. It proves the superiority of the proposed method.Table 4
Compared with other methods on the DRIVE dataset.
MethodYearSensitivitySpecificityF1 scoreMCCAccuracyAUCNeto et al.2015 [7]0.78060.9629//0.8718/Bahadar et al. [27]20160.74620.9801//0.960750.882Khan et al. [27]20160.7460.980//0.9610.863Khan et al. [28]20170.7540.964//0.9440.859Cao et al.20170.76630.9311//0.9174/Soomro et al.20170.75230.976//0.9432/Cai et al.20190.77870.9701//0.9520/Mehmood et al. [15]20190.7370.976//0.953/Khan et al.20190.7540.964//0.944/Lai et al.20190.78430.9815//0.9457/Yang et al. [34]20190.75600.96960.76730.73650.9421/Zhou et al.20200.72620.9803//0.9475/Khan et al.20200.7970.973/0.7390.9580.885Zhou et al.20200.84320.96810.81630.79050.9520.9754Wu et al.20200.79960.98130.95820.9830Huang et al.20210.80110.98490.8099/0.97010.8895The proposed method20220.75800.98040.79920.77490.95180.9750Table 5
Compared with other methods on the STARE dataset.
MethodYearSensitivitySpecificityF1 scoreMCCAccuracyAUCNeto et al.2015 [7]0.83440.9443//0.8894/Bahadar et al. [25]20160.758050.9627//0.94585/Khan et al. [27]20160.7580.963//0.9510.861Soomro et al.20170.7840.981//0.9614/Khan et al. [28]20170.7520.956//0.9480.854Lai et al.20190.78260.9803//0.9472/Mehmood et al. [15]20190.7410.982//0.957/Khan et al.20190.7910.970//0.9570.880Yang et al. [34]20190.72020.97330.72600.70450.9477/Zhou et al.20200.78650.9730//0.9535/Khan et al.20200.7920.998/0.7070.9960.895Zhou et al.20200.86300.97300.82330.80440.96200.9754Wu et al.20200.79630.98630.96720.9875Huang et al.20210.63290.99670.80490.96830.8845Sun et al.2021//0.82300.80750.97140.9882The proposed method20220.77470.99100.83690.82270.96830.9893Table 6
Compared with other methods on the HRF dataset.
MethodYearSensitivitySpecificityF1 scoreMCCAccuracyAUCYang et al.20190.79150.96760.74490.71250.9517/Khan et al.20200.7320.979/0.7100.9600.863The proposed method20220.70700.98850.79180.76430.96530.9740It is difficult to segment retinal vessels accurately because of uneven illumination, low contrast, and retinopathy. From the experimental results, the performance of the proposed method in retinal vessel segmentation is improved, especially for the thin vessels and the vessels around the optic disc and the lesion area, which there is little oversegmentation. Compared with other methods, it has high MCC, AUC, accuracy, and specificity. However, the proposed method has some limitations. It can be seen from the quantitative data in Tables4–6 that the sensitivity of the proposed method is lower than some methods. From the visualization results, the low sensitivity may be caused by the segmentation discontinuity of retinal vessels. Therefore, in the following study, it will be designed some appropriate postprocessing methods to improve the continuity of retinal vessels, which may improve the sensitivity of the algorithm. In addition, on the DRIVE, STARE, and HRF datasets, the sensitivity of current retinal vessel segmentation methods is generally low. From Tables 4–6, the maximum values of the three datasets are 0.8011, 0.8344, and 0.7915, respectively. Therefore, it is a great challenge to design a more ideal segmentation algorithm to improve the segmentation sensitivity of retinal vessels while maintaining high segmentation accuracy.


## 6. Conclusion and Future Work

It is important to extract retinal vessels accurately for detecting and analysing the progress of many eye diseases. At present, a variety of segmentation methods have been proposed, but most of them have low accuracy for thin vessels and lesion area. To improve the accuracy, a retinal vessel segmentation model with SegNet is constructed. The experimental results show that the proposed method has higher segmentation accuracy than the other methods on the DRIVE, STARE, and HRF datasets. The accuracy of the proposed method tested on the DRIVE, STARE, and HRF datasets is 0.9518, 0.9683, and 0.9653, respectively. It can segment the retinal vessels well but not with the thin vessels with low contrast and lesion area. In addition, the proposed method could provide a new methodological idea for extracting retinal vessels accurately and automatically from fundus images, which can promote the research of retinal vessel automatic segmentation model to serve the clinical practice better. In the future work, vessel’s location, tortuosity, and diameter of fundus structural features will be extracted to predict some fundus diseases such as glaucoma and diabetes, which could improve the efficiency of their clinical diagnosis and treatment.



---

*Source: 3117455-2022-03-26.xml*