Introduction

Digital fundus imaging in ophthalmology is a principal step in computer-aided diagnosis and treatment of various pathologies like diabetic retinopathy, hypertension, glaucoma, obesity, and retinal artery occlusion [1]. Hence, precise and accurate segmentation of the retinal blood vessels is becoming an essential task for analysis and treatment of these diseases. However, steadfast extraction of vessels encounters several challenges [2, 3] such as retinal blood vessels which have an extensive range of widths and tortuosity; excluding blood vessels, it also embraces some other structures like the optic disc and fovea which interrupt the vessel segmentation. As the thin vessels have lower contrast compared to background, they create a problem in the detection process. Therefore, many researchers have worked to address these issues but still vessel segmentation is a challenging task. The segmentation process can be divided into two categories, viz., supervised methods and unsupervised methods.

Supervised methods are dependent on classification of pixels where each pixel is classified into two groups, vessels and non-vessels. Here, classifiers are trained by supervised learning with data from manually labeled images [4]. In [2], a novel method has been proposed by the author for automatic segmentation of the retinal blood vessels. First, the radial projection method locates the vessel centerlines that include low-contrast and thin vessels. Then the steerable complex wavelet is modified to give better enhanced vessels under different scales and then the feature vector is constructed to represent the vessel pixels by line strength. In the next stage, large vessels are extracted with the help of semi-supervised self-training approach. The final segmentation output is obtained by the combination of two types of vessels. Marin et al. [3] proposed a supervised method where a 7D feature vector is extracted from the input retinal images and given as input to the neural network. The classification result obtained from neural network is thresholded to classify the pixels as vessels or non-vessels. In [4], the author introduced a method using 2D Gabor wavelet and supervised classification where the method classifies each image pixel either as vessel or non-vessel based on pixels feature vector. The author in [5] explained a new supervised method by utilizing a decision tree-based ensemble classifier to extract the retinal blood vessels. Vega et al. [6] applied an automated segmentation method that utilizes a Lattice Neural Network with Dendritic Processing (LNNDP) to extract the retinal blood vessels from the ophthalmoscope images. Roychowdhury et al. [7] introduced a three-stage novel retinal blood vessel segmentation algorithm using fundus photographs. Fraz et al. [8] introduced a supervised method using ensemble classifier of bagged decision trees to extract vessels of 9- to 10-year-old children of different ethnic origin. In [9], Tan et al. proposed an automated method that segments exudates, hemorrhages, and microaneurysms using a single convolutional neural network. In [10], the author proposed a supervised method that all together locates and segments the vessels, optic disc, and fovea using a seven-layer convolutional neural network. In [11], Aslani et al. illustrated a supervised method for blood vessel segmentation using ensemble RF classifier and based on multifeature analysis.

Unsupervised learning is a kind of machine learning procedure used to appeal inferences from data sets entailing of input data without labeled responses. Unsupervised methods were presented in [12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29]. Zhao et al. [12] proposed a retinal blood vessels segmentation method based on level set and region growing method, where first the extracted green channel image is enhanced using CLAHE and 2D Gabor wavelet transform followed by an anisotropic diffusion filter that smoothed the enhanced image and preserves the vessel boundary. The thin and large vessels are then extracted by region growing and level set method respectively. The final segmentation output is obtained by the union of the results obtained from both the methods. An automated method for blood vessel extraction using a combination of vessel centerline detection and morphological bit plane slicing was elaborated by Fraz et al. [13]. In [14], Fraz et al. explained a unique combination of the vessel skeleton extraction and application of bit planes on morphologically enhanced fundus images for blood vessel extraction. In [15], the author elaborated a novel method for blood vessel extraction by taking a pair of zero-mean Gaussian filter and first-order derivative of Gaussian filter. Cinsdikici et al. [16] offered a hybrid scheme using ant-based clustering and MF algorithm that improves the accuracy and true/false ratios of the subsequent images. In the method explained in [17], the retinal blood vessels are detected by optimizing the parameters of the matched filter by means of genetic algorithm. In [18], Azzopardi et al. presented a novel method for blood vessel detection by using a non-linear bar-selective COSFIRE filter to detect the retinal blood vessels. Budai et al. [19] illustrated a novel method for blood vessel segmentation to segment the specular reflexes of thick vessels that are invisible in lower-resolution fundus images. A new blood vessel extraction algorithm using improved matched filtering is proposed by Odstrcilik et al. [20] for accurate identification of retinal vasculature in a wide range of vessel widths. Mapayi et al. [21] presented a method for blood vessel extraction using a local adaptive thresholding technique based on gray level co-occurrence matrix (GLCM) energy information. A new Binary Hausdorff Symmetry (BHS) measure for automatic seed selection along with the EDSRG algorithm is proposed by Panda et al. [22] for blood vessel extraction from fundus images. In [23], an unsupervised method uses an iterative vessel segmentation algorithm that segments the major vessels foremost, followed by addition of improved vessel branches by adaptive thresholding in iterative steps. A “Ribbon of Twins” active contour model is proposed in [24], for retinal blood vessel segmentation that uses two pairs of contours to capture each vessel edge. In [25], Tan et al. explained a method that extracts the blood vessel using the Ramer-Douglas-Peucker algorithm. In [26], the author introduced a method that initially locates the center point and width of the vessel using a Gaussian filter, and in the next phase, both the Gaussian filter and extended Kalman filter are used for optimal linear estimation of the next possible location of the blood vessel. A multiscale analysis-based method, using multipass region growing procedure [27], is used to extract retinal blood vessel from both red-free and fluorescein fundus images. In [28], Mendonca et al. presented a pixel processing-based approach for vessel extraction from fundus images. In [29], Farokhain et al. proposed a method that extracts the blood vessels by designing a bank of Gabor filter and then use imperialism competitive algorithm for automatic parameter selection.

Though these approaches have revealed their novel performance for retinal blood vessel segmentation, there are some limitations comprising connectivity loss for the blood vessels and thin vessels which are not extracted accurately that need to be rectified. Thus, there is a necessity of a common technique with less complexity and high segmentation accuracy in detection of both large and thin vessels. In this present article, an unsupervised local adaptive thresholding technique is proposed for extraction of retinal blood vessels. In the former step, the green channel of the image is enhanced using an exclusive combination of contrast-limited adaptive histogram equalization (CLAHE) [30] and gamma correction. The blood vessels are then extracted using local adaptive thresholding followed by morphological cleaning for getting the final vessel-extracted image. This approach outperforms most of the existing supervised and unsupervised approach with high segmentation accuracy. It also performs better in detection of both thick and thin vessels.

The rest of this paper is structured as follows. The “Methodology” section describes the proposed segmentation method. The “Results and Discussions” section explains experimental evaluations and comparisons. At last, the “Conclusions” section elaborates the conclusion part.

Methodology

This paper introduces an unsupervised method for extraction of retinal blood vessels based on a local adaptive thresholding technique [31]. The extracted green channel is enhanced using gamma correction and CLAHE on which segmentation course is applied to extract retinal blood vessels. Along with vessels, some non-vessels are identified and that can be removed with the help of a post-processing phase. Figure 1 shows the flowchart for the proposed segmentation method.

Fig. 1
figure 1

Block diagram of the proposed method

Pre-processing

In order to attain higher performance accuracy, it is crucial to have an actual pre-processing step. Use of pre-processing methods makes the system more robust mainly utilizing image enhancement, noise removal, etc. So, before preparing the image for next stage in the segmentation process, the pre-processing is an essential step [32]. In fundus image analysis, it can be observed that the green channel of the RGB representation exhibits best contrast, while the red channel is saturated with the lowest contrast and the blue channel is very noisy and suffers from poor dynamic range. Hence, for the course of segmentation, the green channel is selected as the blood vessels which can be accurately identified and reveals maximum contrast [33]. Figure 3a, b represents the input retinal image (original image) and the extracted green channel image respectively.

Gamma Correction

The power-law transformation can be given by the expression

$$ O=\mathrm{C}{\mathrm{I}}^{\gamma } $$
(1)

where O = output, C and γ are positive constants, and I = input.

The method used to correct power-law response phenomena is named as gamma correction. Gamma correction is imperative in presenting an image exactly on a monitor. Images that are not corrected can look either bleached out or too dark. With varying the value of gamma, not only the brightness but also the ratios of red-to-green-to-blue changes are found. In this paper, the values of C and γ are taken as 1 and 0.8, respectively, because below this value the contrast of the particular image is reduced and above that value the image get darker to an unacceptable level [34]. Output images at different values of gamma (γ) are shown in Fig. 2. Figure 3c shows the output image using gamma correction.

Fig. 2
figure 2

Segmented images at different values of gamma (γ) and C = 1. a γ = 0.3. b γ = 0.6. c γ = 0.8. d γ = 1.5

Fig. 3
figure 3

a Original image. b Green channel image. c Gamma corected image. d Contrast limited adaptive histogram equalized image

Contrast-Limited Adaptive Histogram Equalization

Contrast-limited adaptive histogram equalization is originally developed for medical imaging and gives successful result in enhancing low-contrast images. CLAHE is an improved version of the adaptive histogram equalization (AHE) that divides the image into small regions and works on individual constituency where the contrast of respective small constituency is amplified so that the histogram of the output image corresponds to the histogram specified by the distribution parameter. The small adjacent sections are then joined using bilinear interpolation which overwhelms the artificially induced limits [35]. Over noise amplification can be avoided by limiting the contrast of the individual homogeneous region. This is used to equally distribute the intensity values of the image and makes the hidden features more visible [36]. Figure 3d represents output of the contrast-limited adaptive histogram equalization.

Vessel Extraction Using Adaptive Threshold Surface

Thresholding is the process of altering the grayscale image into binary image. Mainly two types of thresholding techniques are there such as global thresholding and local thresholding. In global thresholding, a global threshold value is defined and all the pixels having greater values than the declared threshold value are set to 1 or foreground and the rest of the pixels are set to 0 or background [37]. In local thresholding, the thresholding is rested on the local image characteristics and a threshold surface is built which is a function on the image domain. Although various researchers have proposed many global thresholding methods, but due to its incompatibility in many real time images, the local thresholding methods are taken in to consideration.

From the existing local thresholding methods, it can be found that the used parameters are required to be adjusted separately for different intensity images and also the values of these parameters vary significantly for various images [38]. Here, we have used a local adaptive thresholding method based on the maximization and minimization of an energy function that consists of a data term and a regularization term [39] in the absence of manual adjustment of parameters. The data term boosts the threshold surface to transect the image surface at high-gradient location and the regularization term which enforces smoothness on the threshold surface. There are two conditions considered for segmentation depending on data and regularization term as follows: when the data term leads over the regularization term, the threshold surface undergoes from discontinuity and false segmentation. However, when the regularization term dominates over the data term, then it suffers from under segmentation. The weighting parameters control the impact of the data term and regularization term in the energy functional. The variational minimax optimization algorithm is adopted to obtain the threshold surface, weighting parameter, and saddle point with the help of energy function. This saddle point is picked by making the energy functional concave with respect to the weighting parameters and convex with respect to the threshold surface [40].

Let IE(x, y) and T(x, y) represent the enhanced image and threshold function respectively.

The adaptive threshold T(x, y) segments the image into a label image that is [41].

$$ L\left(x,y\right)=\left\{\begin{array}{c}1,\kern0.75em if\ {\mathrm{I}}_E\left(x,y\right)>T\left(x,y\right)\\ {}0,\kern1em if\ {\mathrm{I}}_E\left(x,y\right)\le T\left(x,y\right)\end{array}\right. $$
(2)

The energy functional can be expressed as

$$ F\left(T;\omega \right)=\sqrt{1-{\omega}^2}D(T)+\upomega \mathrm{R}(T) $$
(3)

where ω, the weighting parameter, lies between 0 and 1. D(T) is the data term and R(T) is the regularization term and can be given as [42]

$$ D(T)=\frac{1}{2}\iint e\left(x,y\right){\left({\mathrm{I}}_E\left(x,y\right)-T\left(x,y\right)\right)}^2\mathrm{dxdy} $$
(4)

where e(x, y) is an edge-sensitive component and function of an image gradient term and it lies between 0 and 1. If e is high then it indicates the presence of edges.

$$ e\left(x,y\right)=\frac{{\left|\nabla {\mathrm{I}}_E\left(x,y\right)\ \right|}^q}{\max \left({\left|\nabla {\mathrm{I}}_E\left(x,y\right)\ \right|}^q\right)} $$
(5)
$$ R(T)=\iint {\left|\mathrm{\nabla T}\left(x,y\right)\right|}^2\mathrm{dxdy} $$
(6)

The q value is taken as 1. The threshold surface is optimized by searching the minmax solution that minimizes the energy cost function F, and due to its concave and convex nature with respect to ω and T, the min and max are duals of each other and we can change the order of min and max. The obtained optimum solution is

$$ {T}^{\ast }=\arg \underset{\omega }{\max}\underset{T}{\min }F\left(T;\omega \right)=\arg \underset{T}{\max}\underset{\omega }{\min }F\left(T;\omega \right) $$
(7)

T is first initialized as IE. If maximum iterations are not reached, then first, D(T) and R(T) are computed using Eqs. (2) and (3), then the cost function F is differentiated with respect to ω and equating it to 0 to obtained maximum; ω is obtained which can be given as [42]

$$ {\upomega}^{\ast }=\frac{\mathrm{R}\left(\mathrm{T}\right)}{\sqrt{\mathrm{D}{\left(\mathrm{T}\right)}^2+\mathrm{R}{\left(\mathrm{T}\right)}^2}} $$
(8)

Again, F is minimized using gradient descent technique for T keeping ω for ω to be fixed and the process continued until the minimum solution is reached. The equation can be expressed as follows [43]:

$$ \frac{\mathrm{\partial T}}{\mathrm{\partial t}}\left(x,y\right)=\sqrt{1-{\left({\omega}^{\ast}\right)}^2}\left(e\left(x,y\right)\left({\mathrm{I}}_E\left(x,y\right)-T\left(x,y\right)\right)\right)+{\omega}^{\ast}\left({\nabla}^2T\left(x,y\right)\right) $$
(9)

Finally, by using the local adaptive thresholding method with variational minimax optimization, the blood vessels are extracted and the image is obtained after the segmentation method is shown in Fig. 4a.

Fig. 4
figure 4

Blood vessels segmentation of proposed method (a) output of adaptive thresholding, (b) output of median filter, and (c) output of morphological cleaning

Post-processing

Post-processing is the last step of the proposed method where the required segmentation output is obtained from the local adaptive thresholding method. First, a median filter is applied to eliminate salt and pepper noise. Due to presence of noise, sometimes the isolated pixels are misclassified as vessel pixels which can be eliminated with the help of morphological cleaning operation. This operation removes all the pixels wholly encircled by vessel points but not considered as part of a vessel. This is completed by considering that each pixel with at least six neighbors marked as vessel points must also belong to a vessel [13, 44]. Figure 4b, c represents the output images after median filtering and morphological cleaning. The segmentation result of different images of both DRIVE and CHASE_DB1 databases are shown in Fig. 5.

Fig. 5
figure 5

Segmentation results for DRIVE and CHASE_DB1 databases. a Original images. b Ground truth images. c Segmented images

Results and Discussions

The performance of the segmentation process is verified and estimated on the publicly available DRIVE (digital retinal images for vessel extraction) [45] and CHASE_DB1 (Child Heart And Health Study in England) [46] databases.

DRIVE database is the most commonly used database. In this database, a canon CR5 non-mydriatic 3CCD camera with a 45° field of view (FOV) is used to acquire the images where each image taken using 8 bits per color plane at 584× 565pixels. The FOV of each image is circular with a diameter of approximately 540 pixels where the images have been cropped around the FOV. For each image, the mask is available that portrays the FOV. The database contains total of 40 images which are divided into a training and a test set where each of them includes 20 images. Here, the images are JPEG compressed. The retinal images of both of the eyes of each child are recorded with a hand-held NM-200-D fundus camera prepared by Nidek Co. Ltd., Gamagori, Japan. The images are apprehended at 30° field of view (FOV) with a resolution of 1280× 960 pixels. The images are taken in subdued lighting using flash and illumination setting of 3. The levels are adjusted by the operator. The images are saved in tagged image file (TIF) format. The data set of images is characterized by nonuniform background illumination, poor-contrast blood vessels as compared with the background, and a wider arteriole having a bright strip running down the center termed as central vessel reflex.

In order to enumerate the algorithm performance of the proposed method, the segmentation output is compared with the manually segmented image by computing the following four parameters such as true positive (TP), false negative (FN), true negative (TN), and false positive (FP). If the pixel is counted as vessel in both ground truth and segmented image, then it is known as TP, and if it is counted as non-vessel, then it is termed as TN. On the other hand, if the pixel is classified as vessel in the ground truth image and non-vessel in the segmented image, then it is termed as FN. Similarly, when the pixel is classified as vessel in the segmented image and non-vessel in the ground truth image, then it is termed as FP [47].

The performance of the proposed method is calculated in terms of sensitivity (Se), specificity (Sp), positive predictive value (PPV), negative predictive value (NPV), false discovery rate (FDR), Matthews’s correlation coefficient (MCC), Jaccard’s index, and Dice coefficient and accuracy (ACC). The mathematical form of performance metrics for retinal blood vessels segmentation is given in Table 1 [48]. The sensitivity can be defined as the ratio of correctly classified vessel pixels to the total number of vessel pixels in the ground truth image. The specificity is defined as the total number of counted non-vessel pixels divided by the total number of non-vessel pixels in the ground truth image. The positive predictive value is the ratio of pixels appropriately categorized as vessel pixels that are true vessel pixels. The negative predictive value is the ratio of pixels classified as non-vessel that are counted correctly. The false discovery rate is the predictable proportion of false positives among all significant hypotheses. Matthews’s correlation coefficient is used as a part of the value of binary classifications. The Jaccard index neglects the true negatives and relates the true positives to the number of pairs that belong to the same class. The Dice coefficient is defined as the harmonic mean of precision and sensitivity. The accuracy is the measure of capability to classify the amount of conventionality of the resulted image to the manually segmented image [49].

Table 1 Performance metrics for retinal blood vessel extraction

The performance matrices are calculated by taking gamma value (0.8) and number of iterations (140) for both DRIVE and CHASE_DBI databases which are listed in Tables 2 and 3 respectively. These two values are set for obtaining the maximum average accuracies in both the databases. The different gamma values are obtained by calculating the accuracy for both the databases which are shown in Fig. 6. From Fig. 6, it is found that the maximum accuracy is achieved at gamma value of 0.8. The performance matrices are calculated for every image of both the databases by using the formula presented in Table 1 and then the values are averaged in order to obtain a single performance measure.

Table 2 Performance evaluation on the DRIVE database
Table 3 Performance evaluation on the CHASE_DB1 database
Fig. 6
figure 6

Accuracy of the segmentation process as a function of gamma. a DRIVE database. b CHASE_DB1 database

Out of all the performance matrices, Se, Sp, and ACC are taken as measures of algorithm’s performance to compare the proposed method with other state-of-the-art algorithms. Table 4 represents the comparison of proposed method with different supervised and unsupervised methods given by Ricci et al. [1], You et al. [2], Marin et al. [3], Soares et al. [4], Fraz et al. [5], Vega et al. [6], Roychowdhury et al. [7], Tan et al. [10], Aslani et al. [11], Zhao et al. [12], Fraz et al. [13], Fraz et al. [14], Zhang et al. [15], Cinsdikici et al. [16], AI-Rawi et al. [17], Azzopardi et al. [18], Budai et al. [19], Odstrcilik et al. [20], Mapayi et al. [21], Panda et al. [22], Roychowdhury et al. [23], AI-Diri et al. [24], Tan et al. [25], Martinez-Perez et al. [27], Mendonca et al. [28], and Farokhain et al. [29] for DRIVE database. Table 5 shows the comparison of presented method in terms of Se, Sp, and ACC with the published method reported by Fraz et al. [5], Roychowdhury et al. [7], Fraz et al. [8], Azzopardi et al. [18], and Roychowdhury et al. [23] for CHASE_DB1 database. In method [2], in the case of some pathological fundus images in the border of the optic disc, several spots are falsely counted as vessels. The level set and region growing method [12], in some cases, result in inaccurate segmentation as the active contour moves toward the pathological regions for some abnormal images. The method proposed by Soares et al. [4] cannot identify the thin vessels properly and takes only local information. The method using bit planes and centerline detection [13] is less suitable for younger aged fundus images. In the MF-FODG method [15], some unwanted structures are not eliminated completely, and in the output obtained from MF/ant technique [16], the obtained blood vessels are thicker as compared to the blood vessels present in the ground truth image. As compared to the other existing methods, the proposed method can extract retinal blood vessels more precisely from the DRIVE database. The proposed method is robust and easier to implement as compared to other methods. It can also identify both large and thin vessels accurately. The presented method performs better for child fundus images. However, in the case of some pathological images, it is unable to handle the connectivity which can lead to inaccurate segmentation results. The segmentation performances of Marin et al. [3], Azzopardi et al. [18], Odstrcilik et al. [20], Budai et al. [19], Fraz et al. [13], Vega et al. [6], Cinsdikici et al. [16], Fraz et al. [14], Tan et al. [10], Aslani et al. [11], AI-Diri et al. [24], Tan et al. [25], Martinez-Perez et al. [27], Mendonca et al. [28], and Farokhain et al. [29] are obtained from the original literature. The segmentation performances of Zhang et al. [15], Soares et al. [4], and You et al. [2] are obtained from Zhao et al. [12], whereas Fraz et al. [5] and Roychowdhury et al. [7] are obtained from Azzopardi et al. [18].

Table 4 Segmentation performance comparisons of different methods on the DRIVE database
Table 5 Segmentation performance comparisons of different methods on the CHASE_DB1 database

Figure 7 represents the comparison of proposed method with other existing methods in DRIVE database. From Fig. 7, it is observed that the proposed method is able to extract both large and thin vessels by achieving higher accuracy than other existing methods. Figures 8 and 9 show the comparison of segmentation result of large and thin vessels on selected region respectively. The proposed method is tested on the sub-images containing large and thin vessels. It is found that the proposed method extract both the vessels precisely with average Se, Sp, and ACC of 0.8309, 0.9777, and 0.9436 for large vessels and 0.761, 0.970 and 0.954 for thin vessels respectively. The performance matrices for selected region of large and thin blood vessels are presented in Table 6.

Fig. 7
figure 7

Segmentation results of first retinal image from the DRIVE database using different methods. a Original image. b Ground truth image of the first observer. c Cinsdikici et al. [16]. d AI-Rawi et al. [17]. e Zhang et al. [15]. f Mapayi et al. [21]. g Panda et al. [22]. h Soares et al. [4]. i Proposed method

Fig. 8
figure 8

Detection of large blood vessels on selected sub-region. a Marked sub-region. b Ground truth image of the first observer. c Cinsdikici et al. [16]. d AI-Rawi et al. [17]. e Zhang et al. [15]. f Mapayi et al. [21]. g Panda et al. [22]. h Soares et al. [4]. i Proposed method

Fig. 9
figure 9

Detection of thin blood vessels on selected sub-region. a Marked sub-region. b Ground truth image of the first observer. c Cinsdikici et al. [16]. d AI-Rawi et al. [17]. e Zhang et al. [15]. f Mapayi et al. [21]. g Panda et al. [22]. h Soares et al. [4]. i Proposed method

Table 6 Performance evaluation on sub-image

Conclusions

An unsupervised iterative method is proposed for extraction of blood vessels followed by two enhancement techniques before the segmentation process. The blood vessels are then extracted using an adaptive threshold surface derived from variational minimax optimization. The use of double enhancement technique gives a better result in enhancement of blood vessels. Both large and thin blood vessels are extracted precisely with sensitivity, specificity, and accuracy of 0.830, 0.977, and 0.943 for large vessels and 0.761, 0.970, and 0.954 for thin vessels respectively. It achieves an average accuracy of 0.957 and 0.952 for DRIVE and CHASE_DB1 databases respectively. The advantage of the proposed method is that it does not require user intervention and manual segmentation for training because it is found unsupervised in nature. At the same time, the method is robust and easier to implement as compared to other methods. It is also effective in detecting both thick and thin vessels with good values of sensitivity and specificity. The drawback of the proposed method is that in case of some pathological images, it is unable to handle the connectivity, which can lead to inaccurate segmentation results. The manifestation of the proposed method has important clinical implication for different ophthalmological diseases like screening of diabetic retinopathy, evaluation of retinopathy prematurity, computer-assisted laser surgery, and vessel diameter estimation. It is expected that this problem will be resolved in the future by examining different deep learning techniques to evaluate the connectivity of the segmented retinal vessels.