\documentclass{sacj}
\bibliographystyle{sacj}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{algorithm}
\usepackage{algorithmic}
\def\NoNumber#1{{\def\alglinenumber##1{}\State #1}\addtocounter{ALG@line}{-1}}
\usepackage{multirow}
\usepackage{graphicx, subfigure}
\usepackage{placeins}
\usepackage{color, colortbl}
\usepackage{url}

\raggedbottom
\begin{document}
\SACJtitle{Segmentation of retinal blood vessels using normalized Gabor filters and automatic thresholding}
\SACJauthor{Mandlenkosi Victor Gwetu}{gwetum@ukzn.ac.za}
\SACJauthor{Jules Raymond Tapamo}{tapamoj@ukzn.ac.za}
\SACJauthor{Serestina Viriri}{viriris@ukzn.ac.za}
\SACJaddress{University of KwaZulu-Natal, South Africa}
\SACJabstract{Although computerized retinal image blood vessel segmentation has been extensively researched, there is still room for improvement in the quality of the segmented images. Since retinal image analysis is still widely used in the diagnosis of  diabetic retinopathy, efficient and accurate image characterization techniques are required. Previous work has mainly focused on improving segmentation accuracy rates with little regard to the false positives that are produced by illumination variation. This research work presents a hybrid approach towards the segmentation of retinal blood vessels. New approaches towards the reduction of background illumination variation are proposed using normalized Gabor filtering. These are the base-offset encoding and a modified version of an existing zero-integral kernel technique. The valley emphasis automatic thresholding scheme is used to segment the Gabor response images. Experiments are conducted on the DRIVE and STARE retinal image data sets. Accuracy rates of up to 94\% are achieved through the zero-integral and base offset methods. This is comparable with results from literature, where the same data sets are segmented using other classification techniques. The median-offset method is found to most effectively reduce background illumination variation.}
\SACJkeywords{retinal blood vessel, normalized Gabor filter, illumination variation, thresholding, segmentation}
%\category{I.2.10}{Computing Methodologies }{ARTIFICIAL INTELLIGENCE}[Vision and Scene Understanding]
%\category{I.4.6}{Computing Methodologies }{IMAGE PROCESSING AND COMPUTER VISION}[Segmentation]
\SACJmaketitle
\section{Introduction}\label{intro}
Humans inherently possess image processing abilities through their complex visual system. The role that the retina plays in this process is substantial as it is estimated that 80\% of all sensory information in humans originates from the retina \cite{hildebrand2011anatomy}. This indicates its importance in our interaction with the physical world and explains why it remains one of the most scientifically explored components of the human body. The retina is located on the posterior hemisphere of the eye and can be clinically examined using an ophthalmoscope \cite{kolb2005}. This instrument projects a light beam through the iris and then magnifies the corresponding reflection from the retina \cite{von1924}. The reflected image which is known as the fundus image, reveals a few prominent tissues such as the optic disk and blood vessels \cite{scheider1992}. 

The diagnosis of disorders such as diabetic retinopathy relies on the analysis of retinal vasculature \cite{kolb2005}. This analysis has traditionally been done with the aid of a process known as fluorescence angiography which requires a patient to be injected with a dye called fluorescein \cite{chanwimaluang2006advanced}. This dye travels through the blood stream and eventually causes the blood vessels in the retina to have high contrast for easier visual analysis. Alternative and less invasive automated digital techniques are now being sought after in order to expedite retinal visual analysis \cite{SiddalingaswamyPhD2011}. These techniques typically rely on a laser digital ophthalmoscope to produce digital fundus images which are then electronically registered and analyzed \cite{manivannan1993digital}.


To analyze blood vessels in electronic  images, it is important to first detect them accurately. Although features such as branching angle, shape and thickness of vessels are essential for diagnosis, their effectiveness can be compromised by inaccurate segmentation. \cite{ricci2007retinal}. Two approaches commonly used for vascular segmentation are supervised and unsupervised segmentation. Supervised segmentation is dependent on a training set and comprises methods such as Support Vector Machines (SVM) \cite{ricci2007retinal} and neural networks \cite{Fraz2012,nekovei1995back}. Unsupervised segmentation is independent of a training set and is exemplified by rule-based methods such as vessel tracking \cite{henriksen2007tracking,yin2012tracking}  and thresholding  \cite{SiddalingaswamyPhD2011,HongQing2004}. The focus of thresholding schemes is the selection of a gray level that optimally segments an object from its background. This optimization problem remains a challenge due to the smooth distribution of gray level frequencies in retinal image histograms. 

Some of the previous work on retinal blood vessel segmentation has used features based on the intensity profile of vessel cross-sections. Examples include the matched filter \cite{zhang2010retinal,chanwimaluang2006hybrid,odstrcilik2013matched} and Gabor filter \cite{SiddalingaswamyPhD2011,rahebi2013combination,li2006gabormultiscale}. Although Gabor filters are an effective line detection tool, they are dependent on response normalization and parameter tuning. Sub-optimal normalization can lead to image blurring, poor contrast and false line detection. Poor parameter selection can lead to the suppression of lines that should otherwise be enhanced. Previous studies have not focused on the effect of normalization on Gabor filter effectiveness and only a few normalization techniques have been proposed \cite{Kyrki2004gabor,azzopardi2013trainable,wu2006gabor}. 

This work investigates the performance of new and existing Gabor filter normalization methods. Different variants of Gabor filter normalization are investigated in the context of Valley Emphasis Thresholding (VET) \cite{ng2006automatic}. This technique was originally designed for  defect detection in industrial artifacts and is, to the best of our knowledge, being applied to blood vessel segmentation for the first time.

The remainder of this paper is structured as follows: Section \ref{liter} gives a review of related previous work while Section \ref{methods} outlines the techniques and methodology used in this study. This is followed by a presentation and discussion of the results obtained. Finally a comparison with previous literature is drawn and possible areas of extension are highlighted.
\subsection{Literature Survey}\label{liter}
Many techniques exist for the segmentation of retinal image blood vessels. They can be broadly categorized as supervised and unsupervised segmentation techniques. Both are dependent on an effective feature set. Previous studies document a detailed review of the various features that have been applied to retinal blood vessel segmentation \cite{chanwimaluang2006advanced,Fraz2012,niemeijer2004comparative}. These studies show that line detection features such as matched filters \cite{chaudhuri1989matched} and Gabor filters \cite{gabor1946theory} are favored for the enhancement of vasculature because vessels are generally linear. They also highlight the DRIVE \cite{niemeijer2004comparative} and STARE \cite{hoover2000matched} data sets as the most commonly used image collections for bench-marking retinal segmentation results. Some of the recent works that utilize line detection filters for vascular segmentation on these data sets are discussed below.

Chaudhuri et al.\ \cite{chaudhuri1989matched} document the first use of matched filters for blood vessel segmentation. The Otsu method \cite{otsu1975threshold} is used for automatic thresholding and a segmentation accuracy of 87.73\% is achieved on the DRIVE data set \cite{Fraz2012}. Hoover et al.\ \cite{hoover2000matched} improve the work of Chaudhuri et al.\ by using a rule-based classification method in addition to local thresholding. A segmentation accuracy of 92.67\% is reported for experiments on the STARE data set. HongQing et al.\ \cite{HongQing2004} apply Gray Level Gradient Co-occurrence Matrix (GLGCM) entropy thresholding to the Matched Filter Response (MFR) image. The results are evaluated by visually inspecting the output based on 3 specimen fundus images\footnote{The source of these images is not specified in \cite{HongQing2004}.}.

Sofka et al.\ \cite{sofka2006matched} improve the detection of low-contrast and narrow vessels through multiscale matched filters in conjuction with confidence and edge measures. The vessel confidence measure calculates the similarity of a MFR to an ideal vessel profile. Receiver Operating Characteristic (ROC) curves  based on both the DRIVE and STARE data sets show that the hybrid method is superior to multiscale MFR alone. Al-Rawi et al.\ \cite{alrawi2007matched} improve the MFR by using optimal filter parameters obtained through an exhaustive search on the DRIVE training image set. A segmentation accuracy of 95.35\% is reported. Zhang et al.\ \cite{zhang2010retinal} generate a Matched Filter Response (MFR) image using fixed parameters and a thresholding scheme that is enhanced by a first order derivative of Gaussian response. Accuracy rates of 93.82\% and 94.84\% are reported for experiments on the DRIVE test set and STARE data set respectively.

Gabor filters use kernels that are Gaussian modulated sinusoidal waves \cite{gabor1946theory,daugman1985uncertainty} while matched filters are based primarily on the Gaussian distribution \cite{chaudhuri1989matched}. Gabor filters therefore have an advantage over matched filters in that they can be used for texture filtering in addition to line detection. This makes them a more suitable option for blood vessel enhancement \cite{SiddalingaswamyPhD2011}. Li et al.\ \cite{li2006gabormultiscale} modify Gabor filters to include a scale parameter in a bid to increase the detection of vessels of varying width. The thresholding scheme of Hoover et al.\ \cite{hoover2000matched} is used to binarize the output image. The results are presented visually and no empirical evidence is given to show the effectiveness of the approach. 

The robustness of Gabor filters has traditionally been ensured through rotation and scale invariance. Kyrki et al.\ \cite{Kyrki2004gabor} highlight the significance of illumination invariance for object recognition and recommend normalized Gabor filters for implementing it. Normalization is achieved through dividing the feature matrix by the Euclidean norm of all the responses at a given pixel. Effectively, this is the normalization by division approach that is discussed in Section \ref{divisive}. Other normalization approaches are not explored in the study. 

Azzopardi et al.\ \cite{azzopardi2013trainable} propose a trainable filter called Combination Of Shifted FIlter REsponses (COSFIRE) for keypoint detection and pattern recognition. In these filters, normalization is important for suppressing constant intensities and ensuring that lines of a specific width have a maximum filter response. The COSFIRE filters are demonstrated on retinal images that are already manually segmented. They are shown to detect vessel of specified widths, bifurcations and crossings. The effectiveness of the filters is however not tested on normal unsegmented retinal images which are more complex. Wu et al.\ \cite{wu2006gabor} use adaptive contrast enhancement that is based on the standard deviation of a Gabor Filter Response (GFR) image window to highlight vessels. Two randomly selected images from the STARE data set are used for parameter training. A tracking segmentation method is tested on the remaining 18 images. An accuracy of 75\% is reported on the small vessels which consistute 42\% of the total vessel pixel count. 

Rangayyan et al.\ \cite{rangayyan2007gabor} improve the orientation sensitivity of Gabor filters by introducing a coherence score to measure the dominant direction of flow in a window. Predetermined wavelengths and a threshold are used to achieve an Area Under the Curve\footnote{A ROC curve.} (AUC)  of 95\% for the DRIVE test set. Osareh et al.\ \cite{osareh2009gabor} rotate Gabor filters through several orientations and wavelengths in search of an optimal response. Classification is done through principal component analysis, Gaussian Mixture Models (GMMs) and SVMs. An AUC of 96.5\% is achieved on the DRIVE test set. Siddalingaswamy et al.\ \cite{siddalingaswamy2010automatic} modify the approach of HongQing et al.\ \cite{HongQing2004} by using Gray level co-occurrence matrix (GLCM) entropy instead of GLGCM entropy and replacing MFR with GFR. Although Gabor filter normalization is not documented in the study, average sensitivity rates of 86.47\% and 85\% are reported for the DRIVE and STARE data sets respectively.

The surveyed literature reveals that not much attention has been given to the development of more effective Gabor filter normalization techniques for vessel segmentation. In most cases, this aspect of the filter design is not mentioned. Image processing literature documents two options for Gabor filter normalization, namely the normalization by division \cite{heeger1993divnorm,stevens2010divnorm,PetkovSubramanian2007motion} and zero integral methods \cite{azzopardi2013trainable,azzopardi2011detection}. This study seeks to demonstrate that Gabor filter normalization is essential to robust vessel enhancement and that it affects the effectiveness of automatic thresholding. Only a few automatic thresholding schemes such as the Otsu method \cite{otsu1975threshold,hoover2000matched} and GLGCM entropy \cite{HongQing2004} have been explored. The VET method \cite{ng2006automatic} has previously been successfully applied to automatic defect detection. In this study, it is applied to vessel segmentation.
\section{Techniques and Methodology}\label{methods}
\subsection{Segmentation System Overview}
\begin{figure}[ht!]
\centering
\includegraphics[width=60mm]{images/RSD3_.jpg}
\caption{Overview of the design of a retinal image segmentation system}
\label{design}
\end{figure}
\FloatBarrier
Figure \ref{design} shows an overview of the segmentation system. The main steps are preprocessing, Gabor filtering and thresholding. Preprocessing prepares the retinal image for filtering by converting its intensities to an inverted gray scale. The intensities are taken from the green channel of the color image as it is known to contain the most contrast \cite{ricci2007retinal}. The inversion is to ensure that the blood vessels are brighter than the background in preparation for further enhancement by the Gabor filter. Different normalization techniques such as zero integral \cite{azzopardi2013trainable} and base-offset normalization are tested in the Gabor filter.

A bank of Gabor filters with varying orientation and wavelength is used. The maximum response from the bank is chosen for each pixel \cite{osareh2009gabor,bhuiyan2007gabor}. In the thresholding phase, the normalized Gabor response image is segmented using the VET method \cite{ng2006automatic}. 
\subsection{Gabor Filter Vessel Enhancement}
Gabor filters convolve images with a sinusoidal Gaussian modulated function that is sensitive to orientation, frequency and bandwidth \cite{daugman1985uncertainty}. The filter response is a complex number with real and imaginary components that are orthogonal \cite{henriksen2007tracking}. This results in four options for representing the filter response, namely the real, imaginary, phase and magnitude components. The real component can be  represented as follows:
\begin{equation}\label{gabor}
\resizebox{.9\hsize}{!}{$
g(x',y',\lambda,\theta,\psi,\sigma,\gamma)=G(x',y',\sigma,\gamma)W(x',\lambda,\psi)\text{,}$}
\end{equation}
where $G$, $W$, $x'$ and $y'$ are defined by the respective equations (\ref{gaussian}-\ref{yc}) below. 
\begin{equation}\label{gaussian}
G(x',y',\sigma,\gamma)=\exp{\left[-\pi\left(\frac{{x'}^{2}}{\sigma}+\frac{\gamma{y'}^{2}}{\sigma}\right)\right]}\text{.}
\end{equation}
\begin{equation}\label{wave}
W(x',\lambda,\psi)=\cos{\left(2\pi\frac{x'}{\lambda}+\psi\right)}\text{.}
\end{equation}
\begin{equation}\label{xc}
x'=x\cos{\theta}+y\sin{\theta}\text{.}
\end{equation}
\begin{equation}\label{yc}
y'=-x\sin{\theta}+y\cos{\theta}\text{.}
\end{equation}
The Gaussian envelope is represented by $G$ while the sinusoidal wave is represented by $W$. The wavelength and phase-offset of the sinusoidal wave are symbolized by $\lambda$ and $\psi$ respectively. The angle of orientation is represented by $\theta$ while the sigma and aspect ratio of the Gaussian envelope are represented by $\sigma$ and $\gamma$   respectively. The co-ordinates of the point to be filtered are represented by $x$ and $y$. The half response bandwidth, $b$ of the Gabor filter is measured in octaves and is used to regulate the spread and shape of the filter. It is related to $\sigma$ and $\lambda$ according to equation (\ref{bandwidth}) \cite{PetkovSubramanian2007motion}. Given $\lambda$ and $b$, it is therefore possible to calculate $\sigma$.
\begin{equation}\label{bandwidth}
\frac{\sigma}{\lambda}=\frac{1}{\pi}\sqrt{\frac{\ln{2}}{2}}\left[\frac{2^b+1}{2^b-1}\right]\text{.}
\end{equation}

Gabor filters are suited for texture segmentation and are known to be a good model of how the human visual system processes light signals \cite{daugman1988}. Their effectiveness is however hindered by the tedious task of parameter selection. Research that implements Gabor filters therefore usually either uses predetermined parameters or has an elaborate optimal parameter selection process. Cross sections of blood vessels which are perpendicular to the direction of blood flow usually have a Gaussian gray level distribution. As such, Gabor filters are seen as effective features for vessel detection.

\subsection{Gabor Filter Parameters}\label{parameters}
The Gabor filter requires several parameters to be tuned based on the context of application. In this study, the real component of the Gabor filter is used due to its observed superior vessel enhancement in comparison with the imaginary, magnitude and phase responses. A phase offset of 0 is used due to the fact that every retinal pixel is overlapped by the center of a kernel window when it is convolved. This means that the peak of the Gabor wave will correspond to the pixel being convolved.

In standard data sets such as the DRIVE and STARE collections, the width of a retina vessel may lie within the range of [2,10] pixels \cite{alrawi2007matched}. In order to detect a complete vessel profile at a given pixel, a wave needs to be centered on the vessel's cross section and be oriented in the direction of the vessel. Additionally, the kernel window needs to be large enough to capture the vessel's neighborhood so that the Gabor filter response is effectively contextualized. A kernel size of 21x21 pixels was used in this study. Kernel sizes larger than this were explored but they did not lead to any improvement in results. The spread of the Gaussian function in the kernel is ensured by using a bandwidth of 0.25 octaves in all experiments. The ellipticity of the Gabor filter is implemented using an aspect ratio of 0.75. The wavelengths that are used in this study are 4, 8 and 12. They are considered individually as well as collectively. Wavelengths of less than 4 pixels were found to be susceptible to noise interference. 

The orientations are rotated by 15 degrees in the range [0, 180) degrees as is the case in previous literature \cite{Fraz2012}. In the case of all 3 wavelengths being used, each combination of wavelength and orientation is considered, resulting in 36 combinations. Each of these wavelength-orientation combinations is used to create a Gabor kernel of size: 21x21 pixels. Every retinal pixel is convolved with each of these kernels, resulting in 36 Gabor filter responses. Non-retinal pixels within the kernel's corresponding image window are not convolved. The response image comprises of the highest Gabor filter response for each pixel. This image is subsequently thresholded in order to yield a binary image.

\subsection{Gabor Filter Normalization }
The GFR may be affected by the general illumination of a pixel's neighborhood. Hence, normalization is essential to ensure invariant responses \cite{Kyrki2004gabor}. In general, normalization has the effect of scaling responses down to a specific range whilst attempting to either preserve desired characteristics of an image or suppress noise.
\subsubsection{Gabor Filter Normalization by Division}\label{divisive}
One of the oldest methods for Gabor filter normalization uses division to scale intensities down. It divides a pixel's GFR by a factor that is derived from its neighborhood \cite{PetkovSubramanian2007motion}. In \cite{stevens2010divnorm}, this factor is the average gray level in a pixel window. The weakness of this approach is that it does not adequately suppress the illumination in the optic disc and the resulting contrast is very low. Figure \ref{rettest2hist}  shows a typical histogram derived from a normalization by division GFR image.  The left skewed histogram distribution  shows the low contrast in the response image. The multiple discontinuities of this histogram make it cumbersome to automatically detect the threshold that optimally separates vessels from the background. 
\begin{figure}[ht!]
\centering
\includegraphics[width=80mm]{images/divhs.png}
\caption{Histogram of a normalization by division Gabor Filter Normalization response image.}
\label{rettest2hist}
\end{figure}
\FloatBarrier
\subsubsection{Zero-Integral Gabor Filter Normalization}
\begin{figure}[ht!]
\centering
\includegraphics[width=60mm]{images/zeroGaborDemo.jpg}
\caption{Gabor kernel superimposed on 2 surfaces of constant intensity.}
\label{zeroDemo}
\end{figure}
\FloatBarrier
Illumination variation is suppressed when regions of constant illumination generate a zero response. In this case, non-zero responses are strictly a result of line detection as opposed to high pixel intensities. Figure \ref{zeroDemo} shows a surface plot of a Gabor filter kernel with a size of 21x21 pixels. This filter has been generated using equation (\ref{gabor}) with a bandwidth of 0.25 Octaves, a wavelength of 8 pixels, an aspect ratio of 0.75 and an orientation of 45 degrees. The filter is superimposed on two surfaces of constant intensity. Surface A represents an image of size 21x21 pixels, each of which has an intensity of 0.5. Surface B represents a slightly darker image of the same size with an intensity of 0.2. If this Gabor filter were illumination invariant it would produce the same response when filtering each surface. It however produces a response of 1.0173 and 0.4069 for surface A and B respectively. An effective normalization method is needed to complement this filter such that it is illumination invariant.

\begin{algorithm}[H]
\begin{algorithmic}[1]
\caption{ Method 1 for calculating Zero-Integral Normalized Gabor Kernel, $K'_{w\times w}$ }
\label{algo:zero1}
\REQUIRE 
$K_{w\times w}$:\hspace{2.5mm}Un-normalized Gabor kernel of

\hspace{2.45cm}size $w \times w$
\ENSURE  
\hspace{2mm}$K'_{w\times w}$:  
\hspace{1mm}Zero-Integral normalized Gabor  

\hspace{2.45cm}kernel of size $w \times w$
\STATE $sum_{+ve}:=0$
\STATE $sum_{-ve}:=0$
\FORALL {pixel$(x,y)$ in $K_{w\times w}$}
\IF{pixel$(x,y) \ge 0$}
\STATE $sum_{+ve}=sum_{+ve}+\text{pixel}(x,y)$
\ELSE
\STATE $sum_{-ve}=sum_{-ve}+\text{pixel}(x,y)$
\ENDIF
\ENDFOR
\FORALL {pixel$(x,y)$ in $K_{w\times w}$}
\IF{pixel$(x,y) \ge 0$}
\STATE $K'_{w\times w}(x,y):=$pixel$(x,y)\times \frac{sum_{-ve}}{sum_{+ve}+sum_{-ve}}$
\ELSE
\STATE $K'_{w\times w}(x,y):=$pixel$(x,y)\times \frac{sum_{+ve}}{sum_{+ve}+sum_{-ve}}$
\ENDIF
\ENDFOR
\end{algorithmic}
\end{algorithm}
The sinusoidal component of the Gabor filter that is represented in equation (\ref{wave}) creates both positive and negative responses within a filter window. An effective way of implementing illumination invariance is ensuring that both the positive and negative responses  sum up to zero \cite{azzopardi2011detection}. This is tantamount to ensuring that the integral of a Gabor filter is zero. 

This study uses two algorithms for implementing zero-integral normalization. Their details are shown in Algorithms \ref{algo:zero1} and \ref{algo:zero2}. The algorithms are inspired by the implementation in \cite{azzopardi2013trainable}, which is designed to work with images that are already segmented. Algorithm \ref{algo:zero2} is same as that specified in \cite{azzopardi2013trainable} while algorithm \ref{algo:zero1} is a modification thereof. The objective of both algorithms is to ensure that a Gabor filter yields the same response for image windows of constant intensity.

In Algorithm \ref{algo:zero1}, the proportion of positive responses is used as a weight for each negative response while the proportion of negative responses is used as a weight for each positive response. This ultimately balances the effect of positive and negative responses when computing the response of a pixel based on its neighborhood. In Algorithm \ref{algo:zero2}, the positive and negative responses are normalized so that they both have an absolute total value of 1, resulting in a zero integral. Effectively these algorithms both work by scaling the positive and negative responses of the Gabor kernel separately such that the sum of all intensities in the kernel is zero. Because algorithm \ref{algo:zero2} scales the positive and negative responses separately, it resembles the original kernel more than the former. It is therefore expected to yield a smoother response image. Algorithm \ref{algo:zero1} on the other hand, swaps the proportions of positive and negative intensities in the kernel. The gradient of the resulting kernel surface is expected to change when it intersects with the plane of zero intensity. Although this will effectively result in the loss of some visual information, it is likely to increase the contrast of the response image.
\begin{algorithm}[H]
\begin{algorithmic}[1]
\caption{ Method 2 for calculating Zero-Integral Normalized Gabor Kernel, $K'_{w\times w}$ }
\label{algo:zero2}
\REQUIRE 
$K_{w\times w}$:\hspace{2.5mm}Un-normalized Gabor kernel of

\hspace{2.45cm}size $w \times w$
\ENSURE  
\hspace{2mm}$K'_{w\times w}$:  
\hspace{1mm}Zero-Integral normalized Gabor  

\hspace{2.45cm}kernel of size $w \times w$
\STATE $sum_{+ve}:=0$
\STATE $sum_{-ve}:=0$
\FORALL {pixel$(x,y)$ in $K_{w\times w}$}
\IF{pixel$(x,y) \ge 0$}
\STATE $sum_{+ve}=sum_{+ve}+\text{pixel}(x,y)$
\ELSE
\STATE $sum_{-ve}=sum_{-ve}+\text{pixel}(x,y)$
\ENDIF
\ENDFOR
\FORALL {pixel$(x,y)$ in $K_{w\times w}$}
\IF{pixel$(x,y) \ge 0$}
\STATE $K'_{w\times w}(x,y):=\frac{ \text{pixel}(x,y)} {sum_{+ve}}$
\ELSE
\STATE $K'_{w\times w}(x,y):=\frac{\text{pixel}(x,y)} {sum_{-ve}}$
\ENDIF
\ENDFOR
\end{algorithmic}
\end{algorithm}

\subsubsection{Base-offset Gabor Filter Normalization}
This study proposes the incorporation of base-offset encoding to Gabor filter normalization in a bid to avert illumination inconsistency and improve vessel enhancement in retinal images.  The base-offset encoding scheme is a common loss-less compression method that is adequate for medical images \cite{brahimi1998lossless}.

A given neighborhood in an image exhibits smoothness when its pixels have a high similarity with each other. In such a case, the difference between the maximum and minimum intensity in the neighborhood is small. This property may be used to efficiently encode the intensities by representing them based on their relative distance from a chosen base intensity. In this study, either the median or mean of an image window is used as the base. Effectively, this technique reduces the importance of the actual intensity whilst emphasizing on its relative intensity within a neighborhood. Algorithm \ref{algo:median} describes the proposed new method in the case of a median offset. The algorithm accepts an input image that has been convolved with the scaled Gabor equation in equation (\ref{sgabor}). 
\begin{equation}\label{sgabor}
\resizebox{.9\hsize}{!}{$
g'(x,y,\lambda,\theta,\psi,\sigma,\gamma)=\sqrt{\frac{\gamma}{2\pi\sigma^{2}}}g(x,y,\lambda,\theta,\psi,\sigma,\gamma)\text{.}$}
\end{equation}
The scale factor represents the inverse of the volume under the Gaussian surface \cite{NikolicGabArea} and this volume is equivalent to the sum of intensities on the surface. The scale factor therefore ensures that the integral of the Gaussian surface in the Gabor kernel window sums up to one. The median is calculated from a window that is cropped around a center pixel and has the same size as the Gabor kernel. This median is used as the base for calculating offsets within the cropped sub-image due to its low rate of information loss during filtering. When it is computed, its value is one of the actual intensities in an image window. The resulting filtered image is therefore likely to have a high resemblance of the original image. This is not the case with bases such as the mean as they do not necessarily correspond to an existing intensity in an image window. The mean yields both negative and positive values like the median when used as a base. This is desirable due to the preservation of relative intensity information within an image window. 

\begin{algorithm}[H]
\begin{algorithmic}[1]

\caption{ Calculation of Median-offset normalized GFR, $I_{MGR}$, of an image, $I_{src}$ }
\label{algo:median}
\REQUIRE 
$I_{src}$:\hspace{6.5mm}Source Image
\REQUIRE 
$K_{w\times w}$:\hspace{2.5mm}Normalized Gabor kernel of

\hspace{2.4cm}size $w \times w$
\ENSURE  
\hspace{1mm}$I_{MGR}$:  
\hspace{2mm}Median-offset normalized Gabor 

\hspace{2.4cm}filter Response image 
\FORALL {pixel$(x,y)$ in $I_{src}$}
\STATE $r_{xy}:=0$
\STATE $C_{w\times w}=$ Square sub-image of $I_{src}$ centered at $(x,y)$ and of width $w$
\STATE $m_{xy}:=C_{w\times w}.median()$
\FOR {$i:=-\frac{w}{2}$ to $\frac{w}{2}$}
\FOR {$j:=-\frac{w}{2}$ to $\frac{w}{2}$}
\STATE $offset:=I_{src}(x+i,y+j)-m_{xy}$
\STATE $r_{xy}:=r_{xy}+\left(offset\times C_{w\times w}(i,j)\right)$
\ENDFOR
\ENDFOR
\STATE $I_{MGR}(x,y):=r_{xy}$
\ENDFOR
\end{algorithmic}
\end{algorithm}
\subsection{Vessel Segmentation}
\subsubsection{Valley Emphasis Thresholding (VET)}
The VET method \cite{ng2006automatic} is a revised version of the Otsu \cite{otsu1975threshold} method and is recommended for detecting defects. The VET method seeks to identify all the local minimum points in a histogram and determine which one maximizes the variance between an object and its background. It can be formulated as follows \cite{ng2006automatic}:
\begin{equation}\label{vet}
\resizebox{.9\hsize}{!}{$
t^{*}=\text{arg}\max\limits_{0 \leq t < L} \lbrace \left(1-p_{t} \right) \left(\omega_{1}(t) \mu_{1}^{2}(t)+ \omega_{2}(t) \mu_{2}^{2}(t)\right) \rbrace \text{,}$}
\end{equation}
where the probability of occurrence of a gray level is defined as:
\begin{equation}\label{pgl}
p_{t}=\frac{n_{i}}{n}\text{.}
\end{equation}
Given an image of $n$ pixels and $L$ distinct gray levels, $n_{i}$ represents the number of pixels with the $i^{th}$ gray level, where $0\leq i < L$. A threshold $t$ divides the gray levels of an image into two clusters $C_{1}=\lbrace0,1,...,t\rbrace$ and $C_{2}=\lbrace t+1, t+2,..., L-1\rbrace$. $C_{1}$ and $C_{2}$ generally symbolize the object of interest and the background respectively. The probabilities of clusters $C_{1}$ and $C_{2}$ are represented by $\omega_{1}$ and $\omega_{2}$ respectively in equation (\ref{pw}). These probabilities are calculated by summing the probabilities of all the gray levels in a cluster.
\begin{equation}\label{pw}
\omega_{1}(t)=\sum\limits_{i=0}^t p_{i} \hspace{5mm}\text{and}\hspace{5mm} \omega_{2}(t)=\sum\limits_{i=t+1}^{L-1} p_{i}\text{.}
\end{equation}
The average gray level index\footnote{Gray levels are numbered from $0$ to $L-1$, therefore $i$ represents the gray level's index as opposed to its value.} of the clusters $C_{1}$ and $C_{2}$ are represented by $\mu_{1}$ and $\mu_{2}$ in equation (\ref{pm}). Each gray level index, $i$ is weighted by its probability, $p_{i}$. The sum of the weighted indicies is normalized by the corresponding cluster probability, $\omega_{1}$ or $\omega_{2}$.
\begin{equation}\label{pm}
\mu_{1}(t)=\sum\limits_{i=0}^t \frac{ip_{i}}{\omega_{1}(t)} \hspace{3mm}\text{and}\hspace{3mm} \mu_{2}(t)=\sum\limits_{i=t+1}^{L-1} \frac{ip_{i}}{\omega_{2}(t)}\text{.}
\end{equation}
When retinal images are effectively normalized, the resulting histograms are usually either unimodal or bimodal. In a unimodal histogram, the background is typically represented by tail while the foreground is depicted by a prominent spike. In a bimodal histogram, the background and foreground are both represented by spikes, the latter being more prominent than the latter. In both unimodal and bimodal histograms, the VET views the foreground and background as separate clusters in the histogram and attempts to find a threshold that optimally delineates them. This threshold is a local minimum that lies between the distributions of the two clusters. The most optimal local minimum has the highest inter-cluster variance. The advantage of VET over the Otsu method is that it is capable of effectively segmenting the foreground and background of images with either unimodal or bimodal histograms. Since background pixels are generally of higher frequency, a bimodal histogram implies a high vessel pixel count while a unimodal one corresponds to an image whose vessels are less prominent. The VET method is therefore a viable option for automatic segmentation. In the context of retinal image segmentation, the foreground is the vessel network while the background is the non-vascular tissue.

\subsection{Segmentation Evaluation}
Automated segmentation is a classification problem and hence its different possible outcomes can be illustrated using a contingency table as shown in Table \ref{contingency}. The ultimate goal of retinal image segmentation is to accurately partition all the pixels as either vessel or non vessel members. If a ground truth standard is made available, it can be used to evaluate a segmentation system's accuracy. In the contingency table, the system's decisions are judged against the ground truth as being either true or false. The desirable system decisions are true positives and true negatives as they occur when the system segments pixels accurately. 
\definecolor{green}{rgb}{0,1,0}
\definecolor{red}{rgb}{1,0.1,0.1}
\begin{table}[H]
\begin{tabular}{ |p{1cm}|p{2.1cm}|p{1.4cm}|p{1.9cm}| }
\cline{3-4}
\multicolumn{2}{c|}{}&\multicolumn{2}{c|}{\textbf{Ground Truth}}\\\cline{3-4}
\multicolumn{2}{c|}{}&Vessel$\downarrow$&Non-Vessel$\downarrow$\\ \hline
\multirow{2}{1.5cm}{\footnotesize\textbf{System Verdict}} &Vessel$\rightarrow$&True +ve\cellcolor{green}&False +ve\cellcolor{red} \\\cline{2-4}
&Non-Vessel$\rightarrow$&False -ve\cellcolor{red}&True -ve\cellcolor{green}\\\hline
\end{tabular}
\caption{Pixel classification contingency table}
\label{contingency}
\end{table}
Let $GV$ and $GN$ represent the ground truth sets of all the vessel and non-vessel pixels respectively. Let $SV$ and $SN$ represent the sets of all pixels classified by the system as pixels and non-pixels respectively. These sets are used to define sensitivity, specificity, accuracy and False Positive Rate (FPR) as shown in equations (\ref{sensitivity}-\ref{fpr}) below.
\begin{equation}\label{sensitivity}
Sensitivity=\frac{|GV\cap SV|}{| GV |}\text{.}
\end{equation}
\begin{equation}\label{specificity}
Specificity=\frac{|GN\cap SN|}{| GN |}\text{.}
\end{equation}
\begin{equation}\label{accuracy}
Accuracy = \frac{|GV\cap SV| +|GN\cap SN|}{ |GV \cup GN|}\text{.}
\end{equation}
\begin{equation}\label{fpr}
FPR = 1 - Specificity\text{.}
\end{equation}
These criteria are used to establish the effectiveness of the different thresholding approaches in this study. They represent the trade-off between true positive and true negative optimization. An effective classifier will have both values close to one. ROC curves can also be used to evaluate segmentation effectiveness. They are a graph plot of sensitivity against the FPR in the context of a regulated parameter. For each value of the regulated parameter within a given range, sensitivity and the FPR are measured and plotted. An effective classifier has an AUC close to one.
\subsection{Data Sets}
The implementation of this study is based on the publicly available DRIVE \cite{niemeijer2004comparative} and STARE \cite{hoover2000matched} data sets. The DRIVE data set consists of 40 color retinal images from different individuals. The images are divided equally into training and testing samples for convenient supervised classification experimentation. The experiments in this study have been performed on the test set to enable comparison with both supervised and unsupervised approaches as is the case in \cite{zhang2010retinal}. To assist with finding the retinal Field Of View (FOV), a mask which identifies the retinal area and circumference is also provided. All the images in the training and testing sets come with a binary classified (gold standard) retinal image prepared by ophthalmology experts. This is useful for comparing computed results against those of human experts. This data set has been used in several previous studies such as \cite{ricci2007retinal,zabihi2010}. It therefore lends itself well as a benchmark for comparative research. 

Other studies such as \cite{rahebi2013combination,li2006gabormultiscale}  
used the STARE data set which is older than the DRIVE data set. Additional experiments are carried out on this set to validate the performance of our methods on a different collection of images. Of the 20 images in the STARE data set, 10 contain pathology. It is of interest to assess the effectiveness of our methods in this context. 

Unlike the DRIVE data set, the STARE data set does not come with a mask to enable convenient isolation of the FOV. The interpretation of true negative classifications is dependent on whether all the pixels in the entire fundus image are considered or just those in the FOV. If the evaluation is limited to pixels in the FOV, it is expected that the true positive rate is lower than when evaluation is open to all pixels in entire image. To provide consistency with our experiments on the DRIVE data set, only pixels in the FOV are considered for classification evaluation in this study. To this end, a mask is created manually for all images in the data set as is consistent with other studies on this collection such as \cite{ricci2007retinal}. This is achieved using the GIMP image editor which allows images to be converted to grayscale and manually thresholded with the aid of an intensity histogram. This process was straightforward for all the images. 

All images in the data sets are manually segmented by 2 observers resulting in the first and second observer segmentation gold standards. The second observer segments more thinner vessels that the first. Since the general practice in previous studies is to use the first observer's standard as the ground truth \cite{Fraz2012}, this approach is followed in this study.

\section{Results and Discussion}
\subsection{Response Image Comparison}
Figure \ref{fig:first} and \ref{fig:sfirst} show an inverted gray scale retinal image that exhibits several enhancement challenges. The optic disk region is visibly the darkest area in the image. Its boundary is likely to be detected as an edge and could eventually be segmented as a vessel. The fovea appears as a high intensity blob in the middle of the image. Effective normalization should not detect this region as a vessel as it is biologically known to have limited vasculature \cite{hildebrand2011anatomy}. Segmenting the inverted image based on gray level thresholding is not viable as the blood vessels and the fundus background are both of visibly varying intensity. Adaptive Gabor filtering is therefore required to enhance vessels based on their relative local intensity profile as opposed to their actual gray level. In addition to the challenges stated above, the image in \ref{fig:sfirst} contains pathology. A robust segmentation method should not falsely detect this pathology as vessels.

Blood vessels have stabler inter-pixel gradients due to their consistent pigmentation. The background has more pronounced local intensity variation due to illumination and textural inconsistency. Failure to suppress background inconsistency leads to increased false positive segmentation. Effective comparison of retinal image segmentation methods should therefore consider background suppression, illumination invariance as well as vessel contrast enhancement. 

The median-offset response image in Figure \ref{fig:fifth} appears to be the best at suppressing the optic disk boundary. All the approaches effectively filter the fovea region. The normalization by division response image in Figure \ref{fig:second} is seen to be the most affected by the optic disk illumination. Its low contrast ensures that it suppresses background noise effectively, albeit at the expense of vessel enhancement. Although the zero-integral response images in Figures \ref{fig:third} and \ref{fig:fourth} show the least background noise suppression, their vessel contrast enhancement is of higher quality than that of the normalization by division response image. Zero-integral2 normalization shows more pronounced vessels than zero-integral1 normalization. This demonstrates the effectiveness of the independent normalization of positive and negative kernel weights in zero-integral2 normalization. Both zero-integral response images show erroneous enhancement of the optic disk border. 
\begin{figure}[ht!]
     \begin{center}
        \subfigure[Inverted Gray Scale ]{%
            \label{fig:first}
            \includegraphics[width=0.22\textwidth]{images/gray.jpg}
        }%
        \subfigure[Division ]{%
           \label{fig:second}
           \includegraphics[width=0.22\textwidth]{images/divall.jpg}
        }\\ %  ------- End of the first row ----------------------%
        \subfigure[Zero-Integral1 ]{%
            \label{fig:third}
            \includegraphics[width=0.22\textwidth]{images/zero1all.jpg}
        }%
        \subfigure[Zero-Integral2 ]{%
            \label{fig:fourth}
            \includegraphics[width=0.22\textwidth]{images/zero2all.jpg}
        }\\%  ------- End of the second row ----------------------%
        \subfigure[Median-offset ]{%
            \label{fig:fifth}
            \includegraphics[width=0.22\textwidth]{images/medall.jpg}
        } %
        \subfigure[Mean-offset ]{%
            \label{fig:sixth}
            \includegraphics[width=0.22\textwidth]{images/dallmean_2gab.jpg}
        }\\%------- End of the third row ----------------------%
    \end{center}
\caption{Gabor Filter Normalization on DRIVE Image. }
\label{rettest2images}
\end{figure}
\FloatBarrier
The mean-offset response image in Figure \ref{fig:sixth} has smoother vessel enhancement than the median-offset response image. The vessels of the former are however thinner than those of the latter. The smoothness of the mean-offset response image is as a result of the blurring effect that results from averaging intensities. Median-offset normalization does not perform averaging but it instead, uses actual intensities for its base. This results in increased vessel enhancement and optic disk border suppression. Figure \ref{srettest2images} shows normalization by division and median offset as the most effective at suppressing pathology. The former however has poor contrast. The choice of wavelength or combinations thereof to use in the Gabor filter is likely to have a bearing on the effectiveness of these normalization methods. Section \ref{autoThresh} investigates this issue further.
\begin{figure}[ht!]
     \begin{center}
        \subfigure[Inverted Gray Scale ]{%
            \label{fig:sfirst}
            \includegraphics[width=0.22\textwidth]{images/s_1gray.jpg}
        }%
        \subfigure[Division ]{%
           \label{fig:ssecond}
           \includegraphics[width=0.22\textwidth]{images/salldiv_1gab.jpg}
        }\\ %  ------- End of the first row ----------------------%
        \subfigure[Zero-Integral1 ]{%
            \label{fig:sthird}
            \includegraphics[width=0.22\textwidth]{images/sallm2_1gab.jpg}
        }%
        \subfigure[Zero-Integral2 ]{%
            \label{fig:sfourth}
            \includegraphics[width=0.22\textwidth]{images/sallm3_1gab.jpg}
        }\\%  ------- End of the second row ----------------------%
        \subfigure[Median-offset ]{%
            \label{fig:sfifth}
            \includegraphics[width=0.22\textwidth]{images/sallmed_1gab.jpg}
        } %
        \subfigure[Mean-offset ]{%
            \label{fig:ssixth}
            \includegraphics[width=0.22\textwidth]{images/sallmean_1gab.jpg}
        }\\%------- End of the third row ----------------------%
    \end{center}
\caption{Gabor Filter Normalization on STARE Image. }
\label{srettest2images}
\end{figure}
\FloatBarrier 
\subsection{Automatic Thresholding}\label{autoThresh}
Table \ref{tablewave4812} shows the segmentation effectiveness of the five Gabor filter normalization methods in conjunction with VET for specific wavelengths. Siddalingaswamy et al.\ \cite{siddalingaswamy2010automatic} recommend a wavelength of 4 pixels as ideal for detecting most vessels within fundus images. In this study, wavelengths of 4, 8 and 12 pixels are presented as wavelengths within the range [4,12] showed the highest effectiveness in our experiments for both thick and thin vessel detection. Sensitivity reflects the rate of accurate vessel detection and the median-offset method shows the highest sensitivity in the context of a high specificity. This is 67.81\% with a corresponding specificity of 97.9\% when a wavelength of 8 pixels is used for median offset normalization. 

\begin{table}[H]
\renewcommand{\arraystretch}{1.05}
\begin{tabular}{|b{0.25cm}|b{2cm}|p{1cm}|p{1cm}|p{1cm}|}\hline
\multicolumn{2}{|c|}{}&\rotatebox{90}{sensitivity}&\rotatebox{90}{specificity}&\rotatebox{90}{accuracy}\\ \hline
\multirow{5}{0.75cm}{\rotatebox{90}{ { Wavelength:4}}}&Division&1&0&0.1332 \\ \cline{2-5}
&ZeroIntegral1&0.4872&0.9801&0.9172 \\ \cline{2-5}
&ZeroIntegral2&0.4982&0.9747&0.914 \\ \cline{2-5}
&MedianOffset&0.5109&0.9953&0.9335 \\ \cline{2-5}
&MeanOffset&0.465&0.9965&0.9275 \\ \hline
\multirow{5}{0.75cm}{\rotatebox{90}{ { Wavelength:8}}}&Division&0.9699&0.0716&0.1912 \\ \cline{2-5}
&ZeroIntegral1&0.4901&0.9929&0.9286 \\ \cline{2-5}
&ZeroIntegral2&0.5106&0.9916&0.93 \\ \cline{2-5}
&MedianOffset&0.6781&0.979&0.9404 \\ \cline{2-5}
&MeanOffset&0.612&0.9845&0.937 \\ \hline
\multirow{5}{0.75cm}{\rotatebox{90}{ { Wavelength:12}}}&Division&0.9699&0.0717&0.1913 \\ \cline{2-5}
&ZeroIntegral1&0.4943&0.9916&0.928 \\ \cline{2-5}
&ZeroIntegral2&0.511&0.9906&0.9293 \\ \cline{2-5}
&MedianOffset&0.676&0.9714&0.9338 \\ \cline{2-5}
&MeanOffset&0.627&0.979&0.935 \\ \hline
\end{tabular}
\caption{Segmentation effectiveness of normalization methods on DRIVE test data set at wavelengths of 4, 8 and 12 pixels.}
\label{tablewave4812}
\end{table}

\begin{table}[H]
\renewcommand{\arraystretch}{1.05}
\begin{tabular}{|b{0.25cm}|b{2cm}|p{1cm}|p{1cm}|p{1cm}|}\hline

\multicolumn{2}{|c|}{}&\rotatebox{90}{sensitivity}&\rotatebox{90}{specificity}&\rotatebox{90}{accuracy}\\ \hline
\multirow{5}{0.75cm}{\rotatebox{90}{ { DRIVE}}}&Division&0.9698&0.0712&0.1856 \\ \cline{2-5}
&ZeroIntegral1&0.5014&0.9924&0.9296 \\ \cline{2-5}
&ZeroIntegral2&0.5229&0.9908&0.931 \\ \cline{2-5}
&MedianOffset&0.683&0.9722&0.9354 \\ \cline{2-5}
&MeanOffset&0.652&	0.9785&	0.9365 \\ \hline
\multirow{5}{0.75cm}{\rotatebox{90}{ { STARE}}}&Division&0.9698&0.0712&0.1856 \\ \cline{2-5}
&ZeroIntegral1&0.5995&	0.9795&	0.94 \\ \cline{2-5}
&ZeroIntegral2&0.6125&	0.978&	0.94 \\ \cline{2-5}
&MedianOffset&0.6885&	0.9615&	0.932 \\ \cline{2-5}
&MeanOffset&0.682&	0.9655&	0.9355\\ \hline
\end{tabular}
\caption{Segmentation effectiveness of normalization methods on DRIVE and STARE test data set for maximum response over wavelengths: 4,8 and 12}
\label{tablewaveall}
\end{table}

The normalization by division method consistently shows low overall accuracy for all wavelengths considered and hence it can be confirmed that the VET method does not effectively threshold its histogram as is alluded to in section \ref{divisive}. The other normalization methods show similar effectiveness with accuracy rates of over 90\% for each wavelength. The actual individual wavelength used seems to have very little effect on the average accuracy and relative performance of each normalization method. It is however notable that the mean offset method has a higher accuracy than the median offset method at a wavelength of 12 pixels. Since this wavelength is the highest of those used in this study, it more effectively enhances thick vessels than the other wavelengths. As previously noted, the median offset method yields thicker vessels that the mean offset method when enhancing retinal images. At high wavelengths this enhancement may be overemphasized and hence the median offset method has a lower specificity than the mean offset method. 

Table \ref{tablewaveall} shows segmentation effectiveness of the normalization methods over a sequence of wavelengths for both the DRIVE and STARE data set. When each pixel is filtered, all wavelengths within the sequence are considered and the maximum response is recorded. The accuracy rates show a similar trend to that of Table \ref{tablewave4812} and very little improvement is achieved. The median-offset method shows the highest vessel segmentation accuracy with a sensitivity and specificity of 68.3\% and 97.2\% on the DRIVE data set. Similar results are obtained on the STARE data set, namely a sensitivity and specificity of 68.85\% and 96.15\% respectively. The average accuracy rates are 18.56\%, 92.96\%, 93.1\%, 93.54\% and 92.87\% for the normalization by division, zero-integral1, zero-integral2, median-offset and mean-offset methods respectively on the DRIVE data set. A similar trend is shown on the STARE data set despite the existence of pathology in this data set. A notable improvement is shown in the sensitivity of zero-integral methods. This may be attributed to the lower illumination variation in this data set.

\begin{figure}[ht!]
\centering
\includegraphics[width=80mm]{images/Img2rocs4812b.pdf}
\caption{ROC curves for segmentation based on normalization methods and manual thresholding}
\label{graphrocs}
\end{figure}
\FloatBarrier

The ROC curves in Figure \ref{graphrocs} show the trade-off between sensitivity/true-positive rate and FPR for each normalization method when the image in Figure \ref{fig:first} is manually thresholded. The regulated parameter in these ROC curves is the threshold intensity used to segment the image. The GFR images from each normalization method are repeatedly thresholded using each gray level within the minimum and maximum intensity of the response image. For each threshold, corresponding sensitivity and FPR values are calculated and plotted on the ROC curve. All normalization methods record an area under the curve of at least 75\%. This shows that they are all viable for use in retinal image segmentation. The zero-integral methods both yield very smooth curves while the graphs of the other methods are angular. The angular graphs are as a result of multi-modal histograms and small response ranges. 

\begin{table}[H]
\begin{tabular}{ p{2.4cm}|p{1.3cm}|p{1cm}|p{1.7cm} }\hline
\textbf{Normalization} & \textbf{Manual} & \textbf{Auto} & \textbf{Maximum} \\\hline
Division & 18 & 8 &	110 \\\hline
Zero1 &	10 & 16 & 101 \\\hline
Zero2 & 7 &	9 &	72 \\\hline
Median-offset & 1 & 1 & 11 \\\hline
Mean-offset & 1 & 1 & 11 \\\hline
\end{tabular}
\caption{Comparison of manual and automatic thresholding}
\label{manauto}
\end{table}

\begin{figure}[ht!]
     \begin{center}
        \subfigure[Gold standard ]{%
            \label{fig:sg}
            \includegraphics[width=0.22\textwidth]{images/02_manual1.jpg}
        }%
        \subfigure[Division (manual thresholding)]{%
           \label{fig:sd}
           \includegraphics[width=0.22\textwidth]{images/div.jpg}
        }\\ %  ------- End of the first row ----------------------%
        \subfigure[Zero-Integral1 ]{%
            \label{fig:sz1}
            \includegraphics[width=0.22\textwidth]{images/zero1.jpg}
        }%
        \subfigure[Zero-Integral2 ]{%
            \label{fig:sz2}
            \includegraphics[width=0.22\textwidth]{images/zero2.jpg}
        }\\%  ------- End of the second row ----------------------%
        \subfigure[Median-offset ]{%
            \label{fig:smd}
            \includegraphics[width=0.22\textwidth]{images/median.jpg}
        } %
        \subfigure[Mean-offset ]{%
            \label{fig:smn}
            \includegraphics[width=0.22\textwidth]{images/mean.jpg}
        }\\%------- End of the third row ----------------------%
    \end{center}
\caption{DRIVE Image segmented through automatic thresholding.}
\label{rettestsegmented}
\end{figure}
\FloatBarrier

Table \ref{manauto} compares the optimal thresholds obtained manually against those obtained using the VET method for all the normalization methods considered in this study. It also shows the maximum gray level intensity produced by each normalization method. In all cases the minimum was 0. The VET method predicted the most optimal threshold for both the median-offset and mean-offset methods. The normalization by division Gabor filter gave a maximum  gray level response value of 110. The VET predicted the intensity 8 instead of 18 as the most optimal threshold. This is the highest error margin between the manual and automatic thresholds from all the normalization methods.   


Figure \ref{fig:sg} shows an example of a segmentation performed by an expert for comparison with the thresholded images from normalized response images. Figures \ref{fig:sz1} and \ref{fig:sz2} show that the zero-integral methods generally tend to produce thin vessels. This explains their low sensitivity rates of below 55\% on the DRIVE data set. The median-offset method seems to have most effectively suppressed the optic disk illumination. Generally all methods perform well with regards to detecting thick vessels. There is room for more improvement with regards to thin vessel detection.

\begin{figure}[ht!]
     \begin{center}
        \subfigure[Gold standard ]{%
            \label{sfig:sg}
            \includegraphics[width=0.22\textwidth]{images/im0001ah.jpg}
        }%
        \subfigure[Division (manual thresholding)]{%
           \label{sfig:sd}
           \includegraphics[width=0.22\textwidth]{images/salldiv_1thresh18.jpg}
        }\\ %  ------- End of the first row ----------------------%
        \subfigure[Zero-Integral1 ]{%
            \label{sfig:sz1}
            \includegraphics[width=0.22\textwidth]{images/sallm2_1thresh.jpg}
        }%
        \subfigure[Zero-Integral2 ]{%
            \label{sfig:sz2}
            \includegraphics[width=0.22\textwidth]{images/sallm3_1thresh.jpg}
        }\\%  ------- End of the second row ----------------------%
        \subfigure[Median-offset ]{%
            \label{sfig:smd}
            \includegraphics[width=0.22\textwidth]{images/sallmed_1thresh.jpg}
        } %
        \subfigure[Mean-offset ]{%
            \label{sfig:smn}
            \includegraphics[width=0.22\textwidth]{images/sallmean_1thresh.jpg}
        }\\%------- End of the third row ----------------------%
    \end{center}
\caption{STARE Image segmented through automatic thresholding.}
\label{srettestsegmented}
\end{figure}
\FloatBarrier
Figure \ref{srettestsegmented} shows segmentation results for a STARE image with pathology. Although the manually thresholded image from the normalization by division response image shows high pathology suppression, a significant proportion of the vessel network is also suppressed. The zero-integral and mean offset methods showed poor pathology suppression. Although the median offset method yields an image showing little evidence of pathology, there is room for improvement in this regard.
\section{Literature Comparison}
\begin{table}[H]
\begin{tabular}{ |p{0.08cm}|p{3.5cm}|p{0.7cm}|p{0.8cm}|p{0.75cm}| }\hline
\multicolumn{2}{|c|}{\textbf{Approach}} & \rotatebox{90}{\textbf{Sensitivity(\%)}} & \rotatebox{90}{\textbf{Specificity(\%)}} & \rotatebox{90}{\textbf{Accuracy(\%)}} \\\hline
\multirow{7}{0.75cm}{\rotatebox{90}{ { DRIVE}}}
&Siddalingaswamy et al.\ \cite{SiddalingaswamyPhD2011}& 86.47 & 96 &	---\\\cline{2-5}
&Human observer\cite{Fraz2012} & 77.63 & 97.23&	94.70\\\cline{2-5}
&Yin et al.\ \cite{yin2012tracking} &	62.52 & 97.10 & 92.67 \\\cline{2-5}
&Zhang et al.\ \cite{zhang2010retinal} & 71.20 &	97.24 & 93.82 \\\cline{2-5}
&Niemeijer et al.\ \cite{niemeijer2004comparative} & 68.98 & 96.96 &	94.17\\\cline{2-5}
&Chaudhuri et al.\ \cite{chaudhuri1989matched} & --- & --- & 87.73 \\\cline{2-5}
&\textbf{Median-offset} & \textbf{68.3}& \textbf{97.22} & \textbf{93.54} \\\hline
\multirow{6}{0.75cm}{\rotatebox{90}{ { STARE}}}
&Siddalingaswamy et al.\ \cite{SiddalingaswamyPhD2011}& 85 & 96 &	---\\\cline{2-5}
&Human observer\cite{Fraz2012} & 89.51& 93.84& 93.48\\\cline{2-5}
&Hoover et al.\ \cite{hoover2000matched,Fraz2012} &	67.51& 95.67& 92.67 \\\cline{2-5}
&Zhang et al.\ \cite{zhang2010retinal} & 71.77 &	97.53 & 94.84 \\\cline{2-5}
&Mendonca et al.\ \cite{mendonca2006segmentation} & 69.96 & 97.3 &	94.4\\\cline{2-5}
&\textbf{Median-offset} & \textbf{68.85}& \textbf{96.15} & \textbf{93.2} \\\hline
\end{tabular}
\caption{Performance comparison of vessel segmentation methods on DRIVE and STARE data sets}
\label{litcomp}
\end{table}
\begin{figure}[ht!]
     \begin{center}
        \subfigure[Gray scale ]{%
            \label{fig:s40}
            \includegraphics[width=0.22\textwidth]{images/40_training.jpg}
        }%
        \subfigure[Gold standard]{%
           \label{fig:sg40}
           \includegraphics[width=0.22\textwidth]{images/40_manual1.jpg}
        }\\ %  ------- End of the first row ----------------------%
        \subfigure[Median-offset ]{%
            \label{fig:smd40}
            \includegraphics[width=0.22\textwidth]{images/med40.jpg}
        } %
        \subfigure[Siddalingaswamy ]{%
            \label{fig:sidda40}
            \includegraphics[width=0.22\textwidth]{images/sidda40.jpg}
        }\\%------- End of the second row ----------------------%
    \end{center}
\caption{Comparison of median-offset and Siddalingaswamy et al.\ \cite{SiddalingaswamyPhD2011} segmentation of DRIVE image.}
\label{rettest40segmented}
\end{figure}
\FloatBarrier
Table \ref{litcomp} compares the segmentation results from previous studies that are based on the DRIVE and STARE data sets. The performance of the thresholded median-offset normalized Gabor filter is comparable with previous methods. The sensitivity of the median-offset approach outperforms some of the recent studies such as that of Yin et al.\ \cite{yin2012tracking} on the DRIVE data set. Performance on the STARE data set is not as competitive against recent studies. It is notable that although the sensitivity and specificity reported by Zhang et al.\ \cite{zhang2010retinal} are higher than those of Niemeijer et al.\ \cite{niemeijer2004comparative}, the average accuracy is lower. Siddalingaswamy et al.\ \cite{SiddalingaswamyPhD2011} report a sensitivity that is significantly higher than that of other approaches, including the performance of a trained human observer on the DRIVE data set. This observer's segmentations are included in the DRIVE data set for comparison with the performance of human experts. Due to the number of previous studies on the segmentation of DRIVE and STARE images, compiling an exhaustive list in Table \ref{litcomp} is impractical. A comprehensive review of the segmentation results of previous studies can be found in \cite{Fraz2012}.


\begin{figure}[ht!]
     \begin{center}
        \subfigure[Gold standard]{%
           \label{sfig:sg2}
           \includegraphics[width=0.22\textwidth]{images/im0002ah.jpg}
        }%
         \subfigure[Median-offset ]{%
            \label{sfig:smd2}
            \includegraphics[width=0.22\textwidth]{images/sallmed_2thresh.jpg}
        } \\ %  ------- End of the first row ----------------------%
        \subfigure[Hoover ]{%
            \label{sfig:shoover2}
            \includegraphics[width=0.22\textwidth]{images/shoover_2thresh.jpg}
        }%
        \subfigure[Li ]{%
            \label{sfig:li2}
            \includegraphics[width=0.22\textwidth]{images/sli_2thresh.jpg}
        }\\%------- End of the second row ----------------------%
    \end{center}
\caption{Comparison of median-offset, Hoover et al.\ \cite{hoover2000matched} and Li et al.\ \cite{li2006gabormultiscale} segmentation of STARE image.}
\label{srettest2segmented}
\end{figure}
\FloatBarrier
Figure \ref{rettest40segmented} visually compares an example segmented image obtained by Siddalingaswamy et al.\ against that of the median-offset  approach. There is very little difference between the two output images. The median approach suppressed the fovea and optic disk  more effectively resulting in fewer false positives in these regions. Figure \ref{srettest2segmented} compares the segmentation output from the median offset with that of Hoover et al.\ and Li et al.\ on a STARE image. Although the former shows the lowest pathology suppression, its detected vessels are more prominent that those from other methods. In addition, it successfully detected the illumination variation around the optic disk as non-vascular tissue unlike the other methods.

\section{Conclusion}
To investigate the effect of Gabor filter normalization on retinal image segmentation, five normalization techniques were tested with application to the VET technique. All the investigated normalization methods except normalization by division achieved an average accuracy of approximately 93\% on both data sets. The median offset method managed to suppress illumination variation in the fundus images from both data sets. Although the other normalization techniques in this study achieved lower sensitivity rates, they effectively handle the illumination variation in the fovea. This shows that normalization techniques have a bearing on the effectiveness of Gabor filter based retinal image segmentation.

Future work will focus on exploring the effect of normalization in the context of other automatic thresholding techniques, such as first and second order entropy thresholding; and combining the different approaches to create an adaptive thresholding approach. Focus will also be given to improving the performance on the STARE data set such that pathology is suppressed during classification. This study has investigated image enhancement using normalization in the spatial domain; future work will also explore normalization based on the image frequency domain.
%\begin{acknowledgments}
%\end{acknowledgments}

\bibliography{rs}
\end{document}