
%% BioMed_Central_Tex_Template_v1.06
%%                                      %
%  bmc_article.tex            ver: 1.06 %
%                                       %

%%IMPORTANT: do not delete the first line of this template
%%It must be present to enable the BMC Submission system to
%%recognise this template!!

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                                     %%
%%  LaTeX template for BioMed Central  %%
%%     journal article submissions     %%
%%                                     %%
%%          <8 June 2012>              %%
%%                                     %%
%%                                     %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                                                                 %%
%% For instructions on how to fill out this Tex template           %%
%% document please refer to Readme.html and the instructions for   %%
%% authors page on the biomed central website                      %%
%% http://www.biomedcentral.com/info/authors/                      %%
%%                                                                 %%
%% Please do not use \input{...} to include other tex files.       %%
%% Submit your LaTeX manuscript as one .tex document.              %%
%%                                                                 %%
%% All additional figures and files should be attached             %%
%% separately and not embedded in the \TeX\ document itself.       %%
%%                                                                 %%
%% BioMed Central currently use the MikTex distribution of         %%
%% TeX for Windows) of TeX and LaTeX.  This is available from      %%
%% http://www.miktex.org                                           %%
%%                                                                 %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%% additional documentclass options:
%  [doublespacing]
%  [linenumbers]   - put the line numbers on margins

%%% loading packages, author definitions

%\documentclass[twocolumn]{bmcart}% uncomment this for twocolumn layout and comment line below
\documentclass{bmcart}
\renewcommand{\figurename}{Fig.} % ����Ĵ���
%%% Load packages
%\usepackage{amsthm,amsmath}
%\RequirePackage{natbib}
%\RequirePackage[authoryear]{natbib}% uncomment this for author-year bibliography
%\RequirePackage{hyperref}
\usepackage[utf8]{inputenc} %unicode support

%\usepackage{caption}
\usepackage{graphicx}
\usepackage{hyperref}
\hypersetup{hypertex=true,
            colorlinks=true,
            linkcolor=blue,
            anchorcolor=blue,
            %citecolor=blue
            }
\usepackage{multirow}
\usepackage{array}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage[figuresright]{rotating}
\usepackage{color}
%\usepackage{epstopdf}
%\usepackage[applemac]{inputenc} %applemac support if unicode package fails
%\usepackage[latin1]{inputenc} %UNIX support if unicode package fails


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                                             %%
%%  If you wish to display your graphics for   %%
%%  your own use using includegraphic or       %%
%%  includegraphics, then comment out the      %%
%%  following two lines of code.               %%
%%  NB: These line *must* be included when     %%
%%  submitting to BMC.                         %%
%%  All figure files must be submitted as      %%
%%  separate graphics through the BMC          %%
%%  submission process, not included in the    %%
%%  submitted article.                         %%
%%                                             %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\def\includegraphic{}
%\def\includegraphics{}



%%% Put your definitions there:
\startlocaldefs
\endlocaldefs


%%% Begin ...
\begin{document}
%\listoffigures
%\captionsetup[figure]{labelfont={bf},name={Fig.},labelsep=period}
%%% Start of article front matter
\begin{frontmatter}

\begin{fmbox}
\dochead{Research}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                                          %%
%% Enter the title of your article here     %%
%%                                          %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\title{Microaneurysms detection in color fundus images using machine learning based on directional local contrast}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                                          %%
%% Enter the authors here                   %%
%%                                          %%
%% Specify information, if available,       %%
%% in the form:                             %%
%%   <key>={<id1>,<id2>}                    %%
%%   <key>=                                 %%
%% Comment or delete the keys which are     %%
%% not used. Repeat \author command as much %%
%% as required.                             %%
%%                                          %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\author[
   addressref={aff1},                   % id's of addresses, e.g. {aff1,aff2}
   %corref={aff1},                       % id of corresponding address, if any
   %noteref={n1},                        % id's of article notes, if any
   %email={longsc@zjut.edu.cn}   % email address
]{\inits{SL}\fnm{Shengchun} \snm{Long}}
\author[
   addressref={aff1},
   corref={aff1},
   email={chenjiali@zjut.edu.cn}
]{\inits{JC}\fnm{Jiali} \snm{Chen}}
\author[
   addressref={aff1},
   noteref={n1},
]{\inits{AH}\fnm{Ante} \snm{Hu}}
\author[
addressref={aff2},
noteref={n1},
]{\inits{HL}\fnm{Haipeng} \snm{Liu}}
\author[
   addressref={aff3},
   noteref={n1},
]{\inits{ZC}\fnm{Zhiqing} \snm{Chen}}
\author[
addressref={aff2},
noteref={n1},
]{\inits{DZ}\fnm{Dingchang} \snm{Zheng}}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                                          %%
%% Enter the authors' addresses here        %%
%%                                          %%
%% Repeat \address commands as much as      %%
%% required.                                %%
%%                                          %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\address[id=aff1]{%                           % unique id
  \orgname{College of Computer Science and Technology, Zhejiang University of Technology}, % university, etc
  %\street{Liuhe Road},                     %
  \postcode{310023},                                % post or zip code
  \city{Hangzhou},                              % city
  \cny{China}                                    % country
}

\address[id=aff2]{%
  \orgname{Research Center of Intelligent Healthcare, Faculty of Health and Life Science, Coventry University},
  \postcode{CV1 5RW},
  \city{Coventry},
  \cny{UK}
}

\address[id=aff3]{%
  \orgname{Eye Center, The second Affiliated Hospital of Zhejiang University School of Medicine},
  %\street{Jiefang Road},
  \postcode{310009},
  \city{Hangzhou},
  \cny{China}
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                                          %%
%% Enter short notes here                   %%
%%                                          %%
%% Short notes will be after addresses      %%
%% on first page.                           %%
%%                                          %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{artnotes}
%\note{Sample of title note}     % note to the article
\note[id=n1]{Equal contributor} % note, connected to author
\end{artnotes}

\end{fmbox}% comment this for two column layout

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                                          %%
%% The Abstract begins here                 %%
%%                                          %%
%% Please refer to the Instructions for     %%
%% authors on http://www.biomedcentral.com  %%
%% and include the section headings         %%
%% accordingly for your article type.       %%
%%                                          %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{abstractbox}

\begin{abstract} % abstract
\parttitle{Background} %if any
As one of the major complications of diabetes, diabetic retinopathy (DR) is a leading cause of visual impairment and blindness due to delayed diagnosis and intervention. Microaneurysms appear as the earliest symptom of DR. Accurate and reliable detection of microaneurysms in color fundus images has great importance for DR screening.

\parttitle{Methods} %if any
A microaneurysms detection method \textcolor{red}{using machine learning based on directional local contrast (DLC)} is proposed for the early diagnosis of DR. First, blood vessels were enhanced and segmented using improved enhancement function based on analyzing eigenvalues of Hessian matrix. Next, with blood vessels excluded, microaneurysm candidate regions were obtained by using shape characteristics and connected components analysis. After image segmented to patches, the features of each microaneurysm candidate patch were extracted, and each candidate patch was classified into microaneurysm or non-microaneurysm. \textcolor{red}{The main contributions of our study are: 1) Making use of directional local contrast in microaneurysms detection for the first time, which does make sense for better microaneurysms classification. 2) Applying three different machine learning techniques for classification and comparing their performance for microaneurysms detection.} The proposed algorithm was trained and tested on e-ophtha MA database, and further tested on another independent DIARETDB1 database. Results of microaneurysms detection on the two databases were evaluated on lesion level and compared with existing algorithms.

\parttitle{Results} %if any
The proposed method has achieved better performance compared with existing algorithms \textcolor{red}{on accuracy and computation time.} On e-ophtha MA and DIARETDB1 databases, the area under curve (AUC) of receiver operating characteristic (ROC) curve was 0.87 and 0.86, respectively. The free-response ROC (FROC) score on the two databases was 0.374 and 0.210, respectively. \textcolor{red}{The computation time per image with resolution of $2544\times1969$, $1400\times960$ and $1500\times1152$ is 29 seconds, 3 seconds and 2.6 seconds respectively.}

\parttitle{Conclusions} %if any
The proposed method \textcolor{red}{using machine learning based on directional local contrast} of image patches can effectively detect microaneurysms in color fundus images and provide an effective scientific basis for early clinical DR diagnosis.

\end{abstract}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                                          %%
%% The keywords begin here                  %%
%%                                          %%
%% Put each keyword in separate \kwd{}.     %%
%%                                          %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{keyword}
\kwd{color fundus image}
\kwd{microaneurysms detection}
\kwd{patch}
\kwd{feature extraction}
\kwd{\textcolor{red}{directional local contrast}}
\kwd{\textcolor{red}{machine learning}}
%\kwd{Naive Bayesian}
%\kwd{\textcolor{red}{support vector machine}}
%\kwd{\textcolor{red}{K-nearest neighbor}}
\end{keyword}

% MSC classifications codes, if any
%\begin{keyword}[class=AMS]
%\kwd[Primary ]{}
%\kwd{}
%\kwd[; secondary ]{}
%\end{keyword}

\end{abstractbox}
%
%\end{fmbox}% uncomment this for twcolumn layout

\end{frontmatter}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                                          %%
%% The Main Body begins here                %%
%%                                          %%
%% Please refer to the instructions for     %%
%% authors on:                              %%
%% http://www.biomedcentral.com/info/authors%%
%% and include the section headings         %%
%% accordingly for your article type.       %%
%%                                          %%
%% See the Results and Discussion section   %%
%% for details on how to create sub-sections%%
%%                                          %%
%% use \cite{...} to cite references        %%
%%  \cite{koon} and                         %%
%%  \cite{oreg,khar,zvai,xjon,schn,pond}    %%
%%  \nocite{smith,marg,hunn,advi,koha,mouse}%%
%%                                          %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%% start of article main body
% <put your article body there>

%%%%%%%%%%%%%%%%
%% Background %%
%%

\section*{Background}
Diabetes mellitus has reached epidemic levels worldwide. In 2019, approximately 463 million adults (20-79 years) were living with diabetes; by 2045 this will rise to 700 million\cite{saeedi2019global}. \textcolor{red}{Diabetic eye disease (DED) is one of the serious complications caused by diabetes, which can cause serious effects on eyes\cite{lutty2013effects}. Most importantly,} diabetic retinopathy (DR) is the leading cause of visual impairment and blindness among working age adults. Among people with diabetes, the incidence of DR is approximately one third\cite{stitt2016the}. Clinical evidence shows that early diagnose and clinical intervention of DR can effectively reduce the risk of DR-related vision loss\cite{stitt2016the}.

\textcolor{red}{At present, diabetic eye disease (especially DR) is clinically diagnosed by using fundus imaging techniques\cite{salz2015imaging}, mainly including fundus photography, fundus fluorescein angiography (FFA), and optical coherence tomography (OCT)\cite{lyssekboron2017longitudinal}, etc. All the imaging techniques were widely used in automatic detection of DR. As described in reviews of fundus imaging techniques\cite{salz2015imaging,bernardes2011digital}, compared with others, fundus photography can be used to document retinal disease over time, and may be increasingly helpful in screening of DR.}

\textcolor{red}{Therefore, color fundus images obtained from fundus photography were used in this study, which of DR is shown in Fig. \ref{fig:1}. Retinal abnormalities caused by DR can be observed from Fig. \ref{fig:1},} including microaneurysms (MAs), hemorrhages (HMs), hard exudates (HEs) and cotton wool spots (CWSs). MAs often appear in the fundus posterior pole and as red or dark red isolated small dots with clear borders in color fundus images. The diameter of MA is usually between $15\mu$$m$ and $60\mu$$m$\cite{CHEW20061271}, or larger, but seldom exceeds $125\mu$$m$\cite{eftekhari2019microaneurysm}. Compared with other DR-related lesions such as HE and CWS, MA is difficult to detect due to its tiny structure. MA is the earliest symptom of DR. Therefore, accurate and reliable detection of MA in color fundus images is significant for the early screening and diagnosis of DR.

Computer-aided automatic analysis of color fundus images is highly efficient and has been widely applied in the diagnosis of DR\cite{2019arXiv190909853C,saha2019color,salamat2019diabetic,biyani2018algorithms}, \textcolor{red}{which could reduce the workload of ophthalmologists and improve the efficiency of DR screening. With the development of computer-aided diagnose (CAD) of DR, due to the importance of MA for DR diagnose, there are more and more studies on automatic detection of MA recently. Saha et al.\cite{saha2016diabetic} detected red lesions and bright lesions using Naive Bayesian (NB) classifier and support vector machine (SVM), but they only used one database including 100 images for both training and testing. Seoud et al.\cite{seoud2016red} proposed a method based on random forest (RF) for the detection of both MA and HM using dynamic shape features, which did not need any prior segmentation of lesions. But the lesions linked to blood vessels were missed leading to false negatives (FN)\cite{biyani2018algorithms}. Srivastava et al.\cite{Srivastava2016Detecting} proposed filters on different grid sizes and combined with multiple-kernel learning (MKL) and SVM to detect MA and HM dealing with the false positives (FP) due to small blood vessel (BV) segments. Using MKL was found to improve the performance as compared to using a single grid size, but with a disadvantage of high computations for higher grid size. Zhou et al.\cite{zhou2017automatic} proposed an unsupervised classification method based on sparse principal component analysis (PCA) for MA detection, which can avoid the class imbalance problem. But there are some FPs during feature extraction. Ren et al.\cite{ren2017ensemble} detected MA by adaptive over-sampling boosting (ADOBoosting), while Dai et al.\cite{Dai2016Retinal} and Dashtbozorg et al.\cite{DashtbozorgRetinal} applied the random under-sampling boosting (RUSBoosting) classifier to detect MA, and all of them performed well with respect to class-imbalance problem. Wu et al.\cite{WU2017106} used peak detection and region growing to get MA candidates, then detected MA based on K-nearest neighbor (KNN), with a relatively low FROC score of 0.273 on e-ophtha MA database. Wang et al.\cite{wang2017localizing} proposed a method using singular spectrum analysis and KNN classifier for MA detection, which obtained some FNs due to missing of subtle or low contrast or blurry-outlined MA. They also missed few MA during candidate extraction. Adal et al.\cite{adal2014automated} presented a multi-stage approach for automated detection of longitudinal retinal changes due to MA and dot HM (small red lesions). Derwin et al.\cite{derwin2019secondary} detected MA by applying local binary pattern (LBP) for texture features extraction and followed by SVM for classification. Javidi et al.\cite{javidi2017vessel} and Wei et al.\cite{WeiAutomatic} detected MA by discriminative dictionary learning (DDL) and multi-feature fusion dictionary learning (MFFDL) respectively. The former depended heavily on original grayscale feature dictionary, and since there is a large variability in color, luminosity, and contrast both within and between retinal images, using single grayscale feature will affect the performance.}

\textcolor{red}{As deep learning is an emerging computer vision application in medical image processing and proving to be of great help to mankind in machine learning\cite{biyani2018algorithms}, several MA detection methods based on convolutional neural networks (CNN)\cite{eftekhari2019microaneurysm,akut2019film,wang2019a,chudzik2018microaneurysm,budak2017a} were proposed. The main limitation of CNN is the requirement of larger training time\cite{biyani2018algorithms}.}

Moreover, some studies mentioned above for MA detection only used one database for training and testing\cite{zhou2017automatic,adal2014automated,derwin2019secondary,javidi2017vessel,WeiAutomatic,budak2017a}. Large-scale data on heterogeneous patient cohorts are needed for full validation. Considering the limitations aforementioned, \textcolor{red}{mainly improvement of MA detection results, lower computation time and enough data for validation are mainly required.}

We aim to propose a new method using \textcolor{red}{machine learning algorithms based on directional local contrast (DLC) feature} for MA detection, and validate it on two different databases. \textcolor{red}{The first step is preprocessing to improve the image quality, including segmentation and removal of blood vessel (BV). An improved enhancement method based on Hessian matrix eigenvalue analysis was used for BV segmentation. With main structure of BV eliminated, MA candidates were extracted based on shape characteristics and connected components analysis. Next, features were extracted from each candidate to differentiate the MA and non-MA. Lastly, machine learning methods were applied for classification based on the extracted features and comparing their performances on MA detection.}

\textcolor{red}{The main contributions of our study are: 1) Using DLC feature which has not been used in existing methods for MA detection. DLC indicates the local contrast characteristics in a neighborhood which was applied as feature to distinguish MA, and it was proven that the method performs better by using DLC than not. 2) Applying three different machine learning methods for MA classification and comparing their performance, especially, Naive Bayesian classification which is simple with low computational complexity and efficient on accuracy and computation time. The overview of the proposed method is depicted in Fig. \ref{fig:2}.}

\textcolor{red}{The remaining paper is organized as follows: Section 2 presents the results of our proposed method. In Sections 3 and 4, discussion and conclusions are presented. The proposed method is described in Section 5 including experiment and evaluation measures.}

\section*{Results}
\textcolor{red}{Results of the proposed method were evaluated on lesion level, including ROC curves of the three classifiers, computation time, and comparison with existing methods on FROC curve and time.}

\subsection*{ROC curves}
The ROC curve and corresponding AUC of MA detection results on e-ophtha MA and DIARETDB1 databases achieved by 3 classifiers (Naive Bayesian, KNN and SVM) are shown in Fig. \ref{fig:3}.

\textcolor{red}{In this work, the directional local contrast of the center point $p$ of each MA candidate patch was calculated, including totally 12 values of different directions of DLC. Without using the DLC feature, the results of 3 classifiers are shown in Fig. \ref{fig:4}. As can be seen from Fig. \ref{fig:3} and Fig. \ref{fig:4}, the proposed method performs better by using DLC feature compared with not. }

It can be seen that Naive Bayesian classifier performs better than SVM and KNN, with the AUC of 0.871 and 0.859 on e-ophtha MA and DIARETDB1 databases respectively. Therefore, Naive Bayesian was selected for evaluation of MA detection performance in this study.

\subsection*{\textcolor{red}{Computation time}}
To run the proposed method for MA detection, MATLAB 2016a (The MathWorks, Inc., Natick, Massachusetts, USA) was used in the environment of 64bit Windows 10 operating system with 2.9 GHz Intel Core i5 CPU and 16GB memory.

\textcolor{red}{The computation time mainly depends on image resolution and the number of MAs labelled per image. The average computation time per image in the test set of e-ophtha MA database and DIARETDB1 database is shown is Table \ref{tab:1}. This means the lager resolution is, the more computation time. The more MAs labelled per image, the greater the number of extracted MA candidates, resulting in more computation time for making candidate patches, feature extraction and classification. The average time per image in each processing step is shown in Table \ref{tab:2} and compared with that of Dashtbozorg et al.\cite{DashtbozorgRetinal}}

\subsection*{Comparison with different methods}
Fig. \ref{fig:5} shows FROC curves of the proposed MA detection method on e-ophtha MA and DIARETDB1 databases compared with existing algorithms.

Table \ref{tab:3} and Table \ref{tab:4} show comparison of Sensitivity between the proposed MA detection method and existing algorithms at different FPI values on e-ophtha MA and DIARETDB1 databases, respectively.

\textcolor{red}{Table \ref{tab:5} shows comparison of average computation time for different methods.}

It can be seen that the proposed method has better performance on MA detection compared to existing algorithms. Especially, \textcolor{red}{as to those using deep learning techniques, the algorithms proposed by Eftekhari et al.\cite{eftekhari2019microaneurysm} and Chudzik et al.\cite{chudzik2018microaneurysm} performed very well on FROC score, using two-step CNN and FCN respectively. It is known that deep learning with CNN for classification has a better performance on accuracy but more computation time for training, requirement of a large number of training samples and higher requirements for experiment equipment (best with GPU).}

\subsection*{Typical examples analysis}
Typical examples of MA detection results of our experiments on the two databases are shown in Fig. \ref{fig:6} and Fig. \ref{fig:7}.

In DIARETDB1 database, MA detection results correspond to different confidences are shown in different colored circles in Fig. \ref{fig:8}(a). The evaluation shown in Fig. \ref{fig:8}(b) is based on the confidence$\geq75\%$. As can be seen from Fig. \ref{fig:8}, with a standard of ground truth confidence$\geq75\%$, a part of FPs belong to those labeled with a confidence of less than $75\%$. For example, the two FPs shown in Fig. \ref{fig:7}(b) have a confidence of $50\%$ (shown in Fig. \ref{fig:8}(a)).

\section*{Discussion}
In this study, a method \textcolor{red}{using machine learning based on directional local contrast} is proposed for microaneurysms detection in color fundus images. The effectiveness of the method is proved through experiments on different databases.

\subsection*{Advantages}
The accurate segmentation of BV main structure could improve the accuracy of MA detection. It has been proven that using Jerman's enhanced function can achieve the accuracy of $95.4\%$ in BV segmentation\cite{jerman2016enhancement}, \textcolor{red}{with better performance compared to the widely used Hessian-based enhanced function proposed by Frangi\cite{frangi}.} For the features selection of MA candidate regions, directional local contrast (DLC) feature was creatively used in this study. \textcolor{red}{The DLC of center point of each candidate patch was analyzed, which was the first time applied in MA detection and showed promising ability in differentiating MA (comparing Fig. \ref{fig:3} with Fig. \ref{fig:4}).}  Through the analysis of characteristics of MA, it is found that the DLC of MA and non-MA patch is significantly different(Fig. \ref{fig:13}). \textcolor{red}{The accuracy of MA detection could be improved by using the DLC feature.} In addition, compared with existing methods, the proposed method performs better with relatively high accuracy and less computation time. \textcolor{red}{As compared with methods using deep learning with CNN in high accuracy, whose main limitations are widely known that long training time and high requirement of computational resources (best with GPU), the proposed method is simpler and time saving.}

\subsection*{Typical misclassification analysis}
Despite the good performance in MA detection achieved by the proposed algorithm, some misclassified examples affecting accuracy could be seen in Fig. \ref{fig:6} and Fig. \ref{fig:7}. There are several causes for misclassification. For FPs, from the white circles in Fig. \ref{fig:6}(c) and Fig. \ref{fig:7}(c), it can be seen that image noises could lead to erroneous MA detection. Throughout the experiment, most FPs were caused by image noises interference.

For FNs, firstly, as shown by the red circle in Fig. \ref{fig:6}(b), the MA has an irregular shape and a relatively large area. It's a typical example that leads to misjudgment of the algorithm based on the shape features. As the shape features used to distinguish between MA and HM (shown in Table \ref{tab:6}), that missed MA might be considered as HM by the classifier. Secondly, as shown by the red circle in Fig. \ref{fig:7}(c), this MA was missed in the process of MA candidate regions extraction. Although the applied method for extracting MA candidate regions was efficient, it might miss a small part of MA in candidate regions, which caused the increase of FNs in the final MA detection results and affected the overall accuracy of MA detection. The main reasons are as follows: In the first case, MA was attached to BV and removed with it. This case is relatively rare, because MA usually appears at the end of BV which was isolated from the main structure of BV and preserved as an independent slender structure during BV removing, as shown in Fig. \ref{fig:9}(d) and Fig. \ref{fig:9}(e). In the second case, MA was discarded together with the attached slender segment of BV end in the step of removing slender structures. Thus, the threshold for removing slender structures is important. If it was set too small, some MAs would be removed together. If it was too large, some slender and small BV might still be left. In another case, when MA characteristics are not obvious, as shown by the red circle in Fig. \ref{fig:7}(c), this missed MA is too small and has low contrast to background, which looks more like image noise. It is difficult to judge whether it is MA.

MA detection is a difficult task that there is disagreement between different experts in the diagnosis of MA, as shown in Fig. \ref{fig:8}. As the DIARETDB1 database shows, from the observation of the image in Fig. \ref{fig:7}, it can be seen that the two FPs in Fig. \ref{fig:7}(b) are very similar to actual MA, while only two experts label them as MA (confidence of $50\%$). Because the MA structure is too small, unaided eye observation is also susceptible to image quality. From the viewpoint of clinical application, the algorithmic prediction and clinical diagnosis could be mutually complementary. If there is MA detected in an image, the ophthalmologist can further diagnose whether the image corresponds to DR by MA detection result. Therefore, some FN on lesion level will not affect the MA detection performance on image level, and has little impact on clinical diagnosis of ophthalmologist. Or a lower confidence level can be taken as ground truth for ophthalmologists to screen. Thus, the application of computer-aided MA detection in assisting clinical DR screening deserves further investigation.

\subsection*{Limitations}
\begin{itemize}
  \item [1)]
  One of the main limitations of this study is the interference of image noises on MA detection. It's difficult to distinguish MA and image noises in current method.
  \item [2)]
  The scale of data for experiment is another important limitation. Two databases with totally 163 (74 in e-ophtha MA and 89 in DIARETDB1) images were used for test. The physiological and pathological factors that might affect MA detection could not be considered in this pilot study.
\end{itemize}

\subsection*{Future works}
For the current limitations above, in the subsequent research, the image denoising operation in preprocessing progress should be improved. In addition, to improve the generalization of the method, more databases that cover more heterogeneous samples are needed for as fully validation as possible, including real samples from hospitals for clinical validation.

\section*{Conclusions}
\textcolor{red}{Making use of directional local contrast feature can improve the performance of machine learning method for MA detection. Naive Bayesian classification is more accurate than SVM and KNN in this study. The proposed MA detection algorithm showed good performance on the two databases with AUC of 0.87 and 0.86, FROC score of 0.374 and 0.210 respectively. In addition, compared with deep learning-based methods, the proposed method is simple and takes less computation time, of 29 seconds for image with $2544\times1969$ resolution and 3 seconds for image with $1400\times960$ resolution and 2.6 seconds with $1500\times1152$ resolution.} Therefore, the proposed method is promising for clinical application for clinical DR diagnosis.

\section*{Methods}
This study \textcolor{red}{uses machine learning based on directional local contrast} to detect MA on preprocessed and segmented image patches.

Firstly, preprocessing was used to enhance the image quality. Then blood vessels (BVs) were segmented by using an improved enhanced function based on Jerman's work\cite{jerman2016enhancement}. With BVs eliminated, candidate regions of MA were then extracted. Next, processed images were divided into patches according to the location of the MA candidate regions. Finally, based on the features extracted, candidate patches were classified to differentiate the MA and non-MA. The process is illustrated in Fig. \ref{fig:2}. To comprehensively evaluate the algorithm on different patient cohorts, the proposed method was validated on two independent databases (e-ophtha MA and DIARETDB1) on lesion level.

\subsection*{Preprocessing}
\subsubsection*{\textcolor{red}{Shade correction}}
BVs, HMs, and MAs all appear dark red in color fundus images (as shown in Fig. \ref{fig:1}). In order to make the dark red regions more obvious, preprocessing progress was performed in the Field of View (FOV).

Compared to the other two channels, the green channel has higher contrast between target area and background, therefore contains the most abundant information. Thus, the first step of preprocessing was to extract the green channel image $I_\text{g}$. Then median filter on the green channel image $I_\text{g}$ was applied to obtain the background $I_\text{bg}$. The filter size was larger than the maximal BV width in the fundus image. In this study, the filter size of $50\times50$ was selected. Finally, the result derived by the median filter $I_\text{bg}$ was subtracted from the green channel image $I_\text{g}$ to eliminate the background and achieve the image with the effect of shade correction, named $I_\text{eq}$. The main structure of BVs in $I_\text{eq}$ were clear. Other dark regions that include HM and MA in the original image were also highlighted in $I_\text{eq}$. But the overall image was dark with low contrast. In order to make the image clearer, the mean gray value of the green channel image $I_\text{g}$ in FOV was added on image $I_\text{eq}$ to maintain in the same gray range as the green channel image. As follows:
\begin{equation}\label{eq:1}
I_\text{sc}=I_\text{eq}+\text{mean}(I_\text{g})
\end{equation}\vspace{-7mm}

The result of \textcolor{red}{shade correction ($I_\text{sc}$)} is shown as Fig. \ref{fig:9}(b) where BV can be obviously observed.

\subsubsection*{Segmentation of blood vessels}
For accurate MA detection, it is important to separate BV and MA which are similar in color and brightness. Thus, BVs were segmented and eliminated to minimize the influence on MA detection. The most widely used BV segmentation methods are machine learning\cite{orlando2017a} and deep learning\cite{oliveira2018retinal,guo2018a}, which have high accuracy but are complicated and time-consuming. Inspired by Jerman et al.'s work\cite{jerman2016enhancement}, which was improved from the widely used method for BV enhancement of Frangi et al.'s work\cite{frangi}, this study constructed a response function to enhance BV by analyzing the eigenvalues of Hessian matrix, to achieve simple, fast, and accurate BV segmentation.

For a \textcolor{red}{shade-corrected image $I_\text{sc}(x,y)$}, firstly, Gaussian filter was applied to reduce the noise. Different $\sigma$ values were selected for Gaussian filter to obtain different enhancement functions, and the largest response function was selected to derive BV enhanced image. The value range of $\sigma$ was $3\sim6$ and the step was 1 in this study.
\begin{equation}\label{eq:2}
G(x,y)=\frac{1}{2\pi\sigma^2}e^{-\frac{x^2+y^2}{2\sigma^2}}
\end{equation}

The second-order partial derivatives of $x$ and $y$ on the filtered image were computed respectively, then convolved with $I_\text{sc}(x,y)$, getting $L_\text{xx}$, $L_\text{xy}$, $L_\text{yy}$ respectively. The Hessian matrix $H$ was composed as follows:
\begin{equation}\label{eq:3}
H=\left[\begin{array}{rcl} L_\text{xx} & L_\text{xy} \\ L_\text{xy} & L_\text{yy}\ \end{array} \right]
\end{equation}

Then two eigenvalues $\lambda_1$ and $\lambda_2$ could be obtained from Hessian matrix $H$ as follows, where $tmp$ represented an intermediate variable.
\begin{equation}\label{eq:4}
tmp=\sqrt{(L_\text{xx}-L_\text{yy})^2+4*L_\text{xy}^2}
\end{equation}\vspace{-9mm}
\begin{equation}\label{eq:5}
\mu_1=0.5*(L_\text{xx}+L_\text{yy}+tmp)
\end{equation}\vspace{-9mm}
\begin{equation}\label{eq:6}
\mu_2=0.5*(L_\text{xx}+L_\text{yy}-tmp)
\end{equation}\vspace{-6mm}

If $|\mu_1|\leq|\mu_2|$, then $\lambda_1=\mu_1,\lambda_2=\mu_2$. Otherwise, $\lambda_1=\mu_2,\lambda_2=\mu_1$ (that is, to ensure $|\lambda_2|\geq|\lambda_1|$).
$\lambda_2$ was normalized as follows:
\begin{equation}\label{eq:7}
\lambda_{\rho}=\left\{\begin{array}{ccl}
\text{max}(\lambda_2)  &      &{\lambda_2>0}\\
0               &      &\text{else}\end{array} \right.
\end{equation}

Enhancement function was calculated as follows:
\begin{equation}\label{eq:8}
\text{enhancement}=\left\{\begin{array}{ccl}
0 &      &{{\lambda_2}\leq{0}\cup{\lambda_{\rho}}\leq{0}}\\
1 &     &{{\lambda_2}\geq{\frac{\lambda_{\rho}}{2}}>0}\\
{\lambda_2}^2(\lambda_{\rho}-\lambda_2)(\frac{3}{\lambda_2+\lambda_{\rho}})^3 &     &\text{else}\\
\end{array} \right.
\end{equation}

The BV enhancement result is shown in Fig. \ref{fig:9}(c). Because the BV enhancement process might also enhance some other dark red regions in the original image, MA might be enhanced. The green circles in Fig. \ref{fig:9}(c) indicate the MAs contained in the BV enhancement image.

Firstly, the Ostu's adaptive threshold method was used to binarize the BV enhanced image in order to obtain the preliminary BV segmentation result, as shown in Fig. \ref{fig:9}(d). MAs might be contained in the result, shown as the green circles in Fig. \ref{fig:9}(d). To remove MAs from BV segmentation result, small regions were excluded to obtain the final BV \textcolor{red}{main structure} segmentation result, as shown in Fig. \ref{fig:9}(e). Compared with Fig. \ref{fig:9}(d), MAs have been removed.

\subsubsection*{\textcolor{red}{Contrast enhancement and noise reduction}}
Due to the tiny structure of MA, the accuracy of MA detection is sensitive to image quality. Therefore, further preprocessing was performed to improve the image quality.

To enhance the contrast between background and highlighted dark regions (including BVs, HMs, and MAs) in the \textcolor{red}{shade-corrected image $I_\text{sc}$}, the image was processed with contrast limited adaptive histogram equalization (CLAHE) method. A $7\times7$ Gaussian filter was then applied to reduce the influence of noise. The result ($I_\text{gauss}$) is shown in Fig. \ref{fig:10}(b).

\subsubsection*{Blood vessels removal}
To eliminate the effects of BV on MA detection, on the filtered image ($I_\text{gauss}$), the gray value of the corresponding position of the segmented BV was directly set to zero, obtaining $I_\text{gsBV0}$ as shown in Fig. \ref{fig:10}(c).

\subsection*{Extraction of MA candidate regions}
In the previous step of BV removal, the gray value of BV has been directly set to zero. To further make all the other parts black except for the MA candidates, firstly, the mean gray value of original green channel image in FOV (see Equation. \ref{eq:1}) was subtracted from $I_\text{gsBV0}$. Then contrast stretch was used, obtaining $I_\text{CS}$ as shown in Fig. \ref{fig:10}(d). Finally, the Ostu's adaptive threshold method was used to binarize to obtain the preliminary MA candidate regions $I_\text{can1}$, as shown in Fig. \ref{fig:10}(e).

In BV segmentation, the small regions were excluded to ensure that candidate regions of MA were not included in the segmented BV. As a result, the preliminary MA candidate regions contained some small BV segments which appear as slender structures in Fig. \ref{fig:10}(e).

Then, the connected component analysis and shape characteristics was used to refine the results of MA candidates. Since MAs appear as dots, the remaining slender structures could be excluded by the ratio (named $R$) of the length of the major axis and the minor axis of each candidate region (or connected component). If the ratio $R$ of a candidate region exceeds the set threshold, the region would be discarded.

The threshold was set based on the mean value of the ratio $R$ of all connected components in the preliminary MA candidate regions. Considering the proportion of the number of the remaining slender structure, through several experiments, 1.2 was finally selected to multiply the mean value, formulated as follows:
\begin{equation}\label{eq:9}
\text{threshold}=1.2*\frac{1}{n}\sum_{i=1}^{n}{R(i)},i=1,2,\ldots,n
\end{equation}

Where $n$ is the total number of connected components in the preliminary MA candidate regions.

Finally, in remaining candidate regions, those with area larger than 500 pixels were discarded, since MAs are often much smaller (maximum MA with $100\sim300$ pixels in existing works\cite{DashtbozorgRetinal,WeiAutomatic,WU2017106,HABIB201744}, and 361 pixels labeled in e-ophtha MA database). The final result of MA candidate regions $I_\text{can}$ is shown in Fig. \ref{fig:10}(f), where green circles indicate ground truth of MAs.

\subsection*{Image patches}
MA is difficult to observe and detect at the whole image level due to its tiny structure. Therefore, the detection of MA was based on image patches.

All images in training set and test set were divided into $25\times25$ patches according to the location of candidate regions, and a suitable classification method was selected to determine whether each test patch contains MA, so as to realize MA detection. MA patches and non-MA patches are shown in Fig. \ref{fig:11}.

\subsection*{Features extraction and classification}
Although the interference of BV on MA detection was eliminated, in addition to image noises in the obtained candidate regions, there might also be HMs. In order to further separate the true MA from the candidate regions, it is necessary to analyze the difference between MA and HM. As shown in Fig. \ref{fig:1} and Fig. \ref{fig:12}, MAs appear as isolated dark red dots with clear borders, while HMs appear as dark red regions of different sizes and shapes with blurred borders. Thus, using shape features or combined with gradient features could distinguish MA and HM.

\textcolor{red}{Moreover,} for each MA candidate patch, the directional local contrast (\emph{\textbf{DLC}}) of its center point $p$ was calculated to distinguish MA and other structures. Assuming that the gray level of the center point $p$ is $I_p$, the DLC of the point $p$ along the direction angle $\theta$ is defined as:
\begin{equation}\label{eq:10}
DLC_{p(\theta)}=\frac{I_p-\overline{I}_{p(\theta)}}{\overline{I}_{p(\theta)}}
\end{equation}\vspace{-7mm}
\begin{equation}\label{eq:11}
\overline{I}_{p(\theta)}=\frac{1}{r}\sum_{q\in{N_{p(\theta,r)}}}{I_q}
\end{equation}

Where $\overline{I}_{p(\theta)}$ is the mean gray value of neighboring pixels of point $p$ along the direction angle $\theta$, $r$ is the radius of neighboring region, and $N_{p(\theta,r)}$ is the set of neighboring pixels of point $p$ along the direction angle $\theta$ within the radius $r$:
\begin{equation}\label{eq:12}
N_{p(\theta,r)}=\left\{(x_q,y_q)|x_q=x_p+k\cos\theta,y_q=y_p+k\sin\theta,k=1,2,\ldots,r\right\}
\end{equation}\vspace{-5mm}

Finally, the obtained DLC vector of point $p$ is:
\begin{equation}\label{eq:13}
DLC_p=(DLC_{p(\theta_1)},DLC_{p(\theta_2)},\ldots,DLC_{p(\theta_n)})
\end{equation}\vspace{-5mm}

Where $n$ is the number of angles, 12 was selected, that is, $360^{\circ}$ was divided into 12 angles with a step of $30^{\circ}$. And the selected value of $r$ was 12, which was half the patch size. DLC indicates the local contrast characteristics in a neighborhood. A negative DLC value indicates that the gray value of the current pixel is lower than that of the neighborhood. Therefore, DLC could be used to differentiate the structures with different local contrast. Fig. \ref{fig:13} shows DLC distribution of center point of each region of MA, HM, BV and background (BG) shown in Fig. \ref{fig:12}.

As shown in Fig. \ref{fig:13}, the difference between MA and other regions (HM, BV, BG) in DLC distribution is obvious. The analysis of variance (ANOVA) results showed that the DLC of MA is significantly different from those of HM, BV, and BG (p$<0.05$ for all).

With the aim of distinguishing between true MA and non-MA, totally seven types of features including color, grayscale, DLC, shape, texture, Gaussian filter-based, and gradient were selected for each candidate (or patch). The details are shown in Table \ref{tab:6}, where $I_\text{CLAHE}$ indicates the result of CLAHE on the green channel.

\emph{\textbf{Area}} is the total number of pixels in candidate region, \textcolor{red}{that is the number of white pixels of each connected component in Fig. \ref{fig:10}(f).}

\emph{\textbf{Perimeter}} is the total number of boundary pixels that surrounds candidate region.

\emph{\textbf{Circularity}} of each candidate region is defined as: $Circularity=\frac{Perimeter^2}{4*\pi*Area}$

\emph{\textbf{Aspect ratio}} is the ratio of the length of major axis to minor axis of candidate region.

\emph{\textbf{Eccentricity}} is the ratio of the distance between the two focal points of the circumscribed ellipse of candidate region (focal length $2c$) to its major axis length(2a), and it is equal to 0 for a circular region, \textcolor{red}{as: $Eccentricity=\frac{c}{a}$}

\emph{\textbf{Solidity}} is the ratio of area of candidate region to its convex hull area\textcolor{red}{($ConA$), as: $Solidity=\frac{Area}{ConA}$}

\emph{\textbf{Entropy}} indicates image randomness or texture complexity, representing the clustering characteristics of gray distribution. With $n$ different gray values in the image, proportion $p(i)$ of each gray value $i$, it is defined as: $Entropy=-\sum_{i=1}^{n}({p(i)*\text{log}_2{p(i)}}),i=1,\ldots,n$. When gray level of image is uniform, entropy can reach the maximum.

\emph{\textbf{Energy}} reflects the uniformity of image gray distribution and texture thickness, and it is the sum of square of element values of gray level co-occurrence matrix (GLCM). With $P$ indicating GLCM, it is defined as: $Energy=\sum_{i,j}{P(i,j)^2}$

\emph{\textbf{Homogeneity}} reflects the tightness of distribution of elements to the diagonal in GLCM, defined as: $Homogeneity=\sum_{i,j}\frac{P(i,j)}{1+|i-j|}$

\emph{\textbf{Skewness}} reflects the asymmetry of gray value distribution of image. For input gray values $x$ of pixels, with $\mu$ and $\sigma$ representing the mean and standard deviation of the input $x$ respectively, and $E$ representing expectation, it is defined as: $Skewness=\frac{E(x-\mu)^3}{\sigma^3}$

As for gradient features, \textcolor{red}{$dx$ and $dy$ indicate the gradient in the horizontal and vertical direction respectively.} Gradient at MA boundary has an abrupt change. As shown in Fig. \ref{fig:12}(a), gradient vector on the boundary of MA is divergent, where the absolute value of gradient is large. Whereas the absolute value of gradient at the center of MA is small. As shown in Fig. \ref{fig:12}(b), the distribution of gradient vector in the patch of HM is relatively messy. It can be seen from Fig. \ref{fig:12} that the difference in gradient vector distribution is obvious between MA and other structures. Therefore, features based on gradient can be used as reference to distinguish MA from image patches of candidate regions.

\subsection*{\textcolor{red}{Machine learning algorithms for classification}}
After all the 44 features extracted from each MA candidate patch, \textcolor{red}{machine learning technique} would be used to classify each patch to MA or non-MA.

\textcolor{red}{As aforementioned, a variety of classification methods were used in automatic DR detection, including MA detection with Naive Bayesian\cite{saha2016diabetic}, random forest\cite{seoud2016red}, support vector machine\cite{Srivastava2016Detecting,derwin2019secondary,Veiga2018} and K-nearest neighbor\cite{WU2017106,wang2017localizing}, etc. Three classifiers were selected for MA detection and compared the results in this work: NB, KNN and SVM.}

\subsubsection*{\textcolor{red}{Naive Bayesian}}
\textcolor{red}{NB classifiier is supervised learning technique based on Bayesian theory. It assumes that features are independent (naive) of each other. NB calculates the prior probability of each class and the conditional probability of each class for each feature from the training samples. For a test sample to be classified, Bayesian theory is used to calculate the posterior probability of test sample belonging to each class, the class with the maximum posterior probability will be chosen. NB is simple and powerful therefore has been widely used in machine learning algorithms of spam processing, document classification, disease diagnosis and other aspects.}

\subsubsection*{\textcolor{red}{K-Nearest Neighbor}}
\textcolor{red}{KNN is a very special kind of machine learning algorithm because it does not have a learning process in a general sense, which named lazy learning. Lazy learning is also called mechanical learning due to its high dependence on training samples. Mechanical learning does not build a model, so KNN is a non-parametric supervised learning method. For a test sample to be classified, KNN calculates the distance between the test sample and all training samples, selects the K samples closest to the test sample from the training dataset, and according to the majority-voting rule, the test sample is classified into the class that the more samples of K nearest neighbors belong to.}

\subsubsection*{\textcolor{red}{Support Vector Machine}}
\textcolor{red}{SVM is a classic supervised learning algorithm in the field of machine learning, mainly used to solve the problem of data classification. SVM algorithm aims to find a maximum-margin hyperplane to correctly divide the training samples to different categories. For linearly inseparable problems, kernel functions are used to map the input features into the higher-dimensional feature space where a linear separation is possible. Kernel functions used in SVM classifier mainly include linear, sigmoid, polynomial and radial basis function (RBF).}

%\section*{Experiment}
\subsection*{Experiment materials}
The fundus images of two available public retinal image databases (e-ophtha MA\cite{decenciere2013teleophta:} and DIARETDB1\cite{kauppi2007the}) were used for experiments.

In e-ophtha MA database, there are four image resolutions ranging from $1440\times960$ to $2544\times1696$ pixels with $45^{\circ}$ FOV. The e-ophtha MA database contains 233 images without MAs, and 148 images MAs, which are manually annotated by an ophthalmologist and confirmed by another. The 148 images with totally 1306 MAs were used in this study for experiments.

DIARETDB1 database contains 89 color fundus images with resolution of $1500\times1152$ pixels and $50^{\circ}$ FOV. Four medical experts marked MA in DIARETDB1 database independently. Considering the disagreement between the four experts annotations, we use the annotations with confidence$\geq{75\%}$ (at least three of the four experts agree that there is an MA) as standard for MA labeling, and there are 182 MAs with confidence$\geq{75\%}$.

74 images were selected from e-ophtha MA database and segmented to derive the training set. The segmented patches on MA locations and Non-MA candidate patches were positive and negative samples respectively, making up the training set.

The remaining 74 images in e-ophtha MA database and the whole DIARETDB1 database were used as test set to verify the performance of the proposed MA detection method.

\subsection*{Experiment procedure}
From each patch of the training set, the aforementioned 44 features were extracted to train the classifier. Then the trained classifier was used on each test patch to determine whether the candidate was MA based on the 44 features extracted, so as to achieve the purpose of MA detection.

\textcolor{red}{NB, KNN and SVM with RBF kernel function were used to perform the experiment and compared to choose the best performed classifier, then the results of MA detection were evaluated on lesion level.}

\subsection*{Evaluation}
\textcolor{red}{For the problems of class-imbalance, the receiver operating characteristic (ROC) curve can better evaluate the performance of the classifier. In this study, the number of MAs in candidate regions is much smaller than that of Non-MAs. Therefore,} \textbf{ROC} curve and its corresponding Area Under Curve (\textbf{AUC}) as well as free-response ROC (\textbf{FROC}) curve were used to evaluate the proposed MA detection method. The closer ROC curve is to the upper left corner, the more convex the ROC curve is, the larger value of AUC is, the better the algorithm performs.

The abscissa of ROC curve is false positive rate (FPR), which is the proportion of negative samples with positive classification results to all negative samples. The ordinate is Sensitivity, also named true positive rate (TPR), which is the proportion of positive samples with positive classification results to all positive samples. The two variables corresponding were calculated as follows:
\begin{equation}\label{eq:14}
FPR=1-Specificity=1-\frac{TN}{TN+FP}
\end{equation}\vspace{-7mm}
\begin{equation}\label{eq:15}
TPR=Sensitivity=\frac{TP}{TP+FN}
\end{equation}

TP indicates that MA is correctly predicted. TN indicates that non-MA is correctly predicted. FP indicates that non-MA is erroneously predicted as MA. And FN indicates that MA is erroneously predicted as non-MA.

Compared with ROC curve, FROC curve has the same Sensitivity on the ordinate and the false positive per image (FPI) on the abscissa.

As both databases provide the annotation of MA on lesion level, evaluation of the results was performed on lesion level. As aforementioned, the ground truth of DIARETDB1 database with confidence$\geq{75\%}$ was used as the standard for evaluation of MA detection results.

First of all, ROC curve and AUC were used to evaluate the performance of 3 classifiers on MA detection, so as to select the best performed classifier, and further analyze its results of MA detection.

Next, FROC curve and FROC \textbf{score} were used to evaluate the performance of the proposed MA detection method and be compared with existing algorithms.

\textcolor{red}{Then, average computation time per image of the whole experiment and of each processing step was recorded and compared with existing algorithms.}

Lastly, typical examples of MA detection results evaluated on lesion level were analyzed.



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                                          %%
%% Backmatter begins here                   %%
%%                                          %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{backmatter}
\section*{Abbreviations}
DR: diabetic retinopathy; DLC: directional local contrast; AUC: area under curve; ROC: receiver operating characteristic; FROC: free-response ROC (FROC); NB: Naive Bayesian (NB); SVM: support vector machine ; KNN: K-nearest neighbor (KNN); \textcolor{red}{FFA: fundus fluorescein angiography; OCT: optical coherence tomography;} MAs: microaneurysms; HMs: hemorrhages; HEs: hard exudates; CWSs: cotton wool spots; \textcolor{red}{CAD: computer-aided diagnose; RF: random forest; MKL: multiple-kernel learning;} BV: blood vessel; \textcolor{red}{PCA: principal component analysis; ADOBoosting: adaptive over-sampling boosting; RUSBoosting: random under-sampling boosting; LBP: local binary pattern; DDL: discriminative dictionary learning; MFFDL: multi-feature fusion dictionary learning; CNN: convolutional neural networks;} FN: false negative; FP: false positive; TN: true negative; TP: true positive; FPR: false positive rate; TPR: true positive rate; FPI: false positive per image; \textcolor{red}{FCN: fully convolutional neural networks;} FOV: field of view; CLAHE: contrast limited adaptive histogram equalization; ANOVA: analysis of variance; BG: background; GLCM: gray level co-occurrence matrix; \textcolor{red}{RBF: radial basis function}.

\section*{Acknowledgements}
Authors would like to thank e-ophtha MA dataset (http://www.eophtha.com) and DIARETDB1 database(http://www.it.lut.fi/project/imageret/diaretdb1/) for providing the fundus images for this work.

\section*{Author's contributions}
S.C Long. and J.L Chen. conceived and designed the experiments. Z.Q Chen provided medical guidance. J.L Chen. performed the experiments, J.L Chen. and A.T Hu analysed the results. J.L Chen composed the manuscript. H.P Liu and D.C Zheng checked the results and revised the manuscript. All authors read and approved the final version.

\section*{Funding}
Not applicable.

\section*{Availability of data and materials}
The data used or analyzed during the study are available from the corresponding author on reasonable request.

\section*{Ethics approval and consent to participate}
Not applicable.
\section*{Consent for publication}
Not applicable.
\section*{Competing interests}
The authors declare that they have no competing interests.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                  The Bibliography                       %%
%%                                                         %%
%%  Bmc_mathpys.bst  will be used to                       %%
%%  create a .BBL file for submission.                     %%
%%  After submission of the .TEX file,                     %%
%%  you will be prompted to submit your .BBL file.         %%
%%                                                         %%
%%                                                         %%
%%  Note that the displayed Bibliography will not          %%
%%  necessarily be rendered by Latex exactly as specified  %%
%%  in the online Instructions for Authors.                %%
%%                                                         %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% if your bibliography is in bibtex format, use those commands:
\bibliographystyle{bmc-mathphys} % Style BST file (bmc-mathphys, vancouver, spbasic).
\bibliography{bmc_article}      % Bibliography file (usually '*.bib' )
% for author-year bibliography (bmc-mathphys or spbasic)
% a) write to bib file (bmc-mathphys only)
% @settings{label, options="nameyear"}
% b) uncomment next line
%\nocite{label}

% or include bibliography directly:
% \begin{thebibliography}
% \bibitem{b1}
% \end{thebibliography}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                               %%
%% Figures                       %%
%%                               %%
%% NB: this is for captions and  %%
%% Titles. All graphics must be  %%
%% submitted separately and NOT  %%
%% included in the Tex document  %%
%%                               %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%
%% Do not use \listoffigures as most will included as separate files

\section*{Figures}

\begin{figure}[ht]
\includegraphics[width=0.95\linewidth]{fig1.jpg}
\caption{Color fundus image of DR.}
\label{fig:1}
\end{figure}

\begin{figure}[ht]
\centering
\includegraphics[width=0.95\linewidth]{fig2.jpg}
\caption{\textcolor{red}{Illustration of the proposed MA detection method.}}
\label{fig:2}
\end{figure}

\begin{figure}[ht]
\centering
\includegraphics[width=0.95\linewidth]{fig3.jpg}
\caption{ROC curves of 3 classifiers on the two databases.
(a) e-ophtha MA database; (b) DIARETDB1 database}
\label{fig:3}
\end{figure}

\begin{figure}[ht]
\centering
\includegraphics[width=0.95\linewidth]{fig4.jpg}
\caption{\textcolor{red}{ROC curves of 3 classifiers on the two databases without using DLC feature.
(a) e-ophtha MA database; (b) DIARETDB1 database}}
\label{fig:4}
\end{figure}

\begin{figure}[ht]
\centering
\includegraphics[width=0.95\linewidth]{fig5.jpg}
\caption{\textcolor{red}{FROC curves of different methods for MA detection on the two databases.
(a) e-ophtha MA database; (b) DIARETDB1 database}}
\label{fig:5}
\end{figure}

\begin{figure}[ht]
\centering
\includegraphics[width=0.95\linewidth]{fig6.jpg}
\caption{Lesion level evaluation for MA detection results on e-ophtha MA database.
(a) Results of MA detection, where green circles indicate TPs, white circles indicate FPs, and red circles indicate FNs; (b) Examples of TP and FN; (c) Examples of FP}
\label{fig:6}
\end{figure}

\begin{figure}[ht]
\centering
\includegraphics[width=0.95\linewidth]{fig7.jpg}
\caption{Lesion level evaluation for MA detection results on DIARETDB1 database.
(a) Results of MA detection, where green circles indicate TPs, white circles indicate FPs, and the red circle indicates FN; (b) Examples of TP and FP; (c) Examples of FP and FN}
\label{fig:7}
\end{figure}

\begin{figure}[ht]
\centering
\includegraphics[width=0.95\linewidth]{fig8.jpg}
\caption{
\csentence{Analysis of MA detection results compared with ground truth on DIARETDB1 database.}
(a) MA detection results corresponding to different labeling confidences, where yellow circles indicate labels with confidence$\geq \emph{75\%}$, orange circles indicate labels with confidence$\geq \emph{50\%}$, and brown circles indicate labels with confidence$\geq \emph{25\%}$. (b) Evaluarion of MA detection results with ground truth of confidence$\geq \emph{75\%}$, where green circles indicate TPs, white circles indicate FPs, and the red circle indicates FN, corresponding to Fig. \ref{fig:7}}
\label{fig:8}
\end{figure}

\begin{figure}[ht]
\centering
\includegraphics[width=0.95\linewidth]{fig9.jpg}
\caption{Process of blood vessels segmentation.
(a) Green channel image; (b) Result of \textcolor{red}{shade correction ($I_\text{sc}$)}; (c) BV enhanced image (green circles indicate MAs); (d) Preliminary BV segmentation (green circles indicate MAs); (e) Final result of BV segmentation}
\label{fig:9}
\end{figure}

\begin{figure}[ht]
\centering
\includegraphics[width=0.95\linewidth]{fig10.jpg}
\caption{Process of MA candidate regions extraction.
(a) Result of \textcolor{red}{shade correction ($I_\text{sc}$)}; (b) Result of preprocessing ($I_\text{gauss}$); (c) Result of BV removal ($I_\text{gsBV0}$); (d) Result of contrast stretch ($I_\text{CS}$); (e) Preliminary MA candidate regions ($I_\text{can1}$); (f) Final result of MA candidate regions ($I_\text{can}$, green circles indicate ground truth of MAs)}
\label{fig:10}
\end{figure}

\begin{figure}[ht]
\centering
\includegraphics[width=0.95\linewidth]{fig11.jpg}
\caption{Examples of patches. (a) MA patches; (b) Non-MA patches}
\label{fig:11}
\end{figure}

\begin{figure}[ht]
\centering
\includegraphics[width=0.95\linewidth]{fig12.jpg}
\caption{Comparison of different structures in 25*25 patch.
(a) MA; (b) HM; (c) BV; (d) Background}
\label{fig:12}
\end{figure}

\begin{figure}[ht]
\centering
\includegraphics[width=0.95\linewidth]{fig13.jpg}
\caption{DLC distribution on different structures shown in Fig. \ref{fig:12}, where radius indicates the DLC value along the direction angle $\theta$}
\label{fig:13}
\end{figure}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                               %%
%% Tables                        %%
%%                               %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%% Use of \listoftables is discouraged.
%%
\section*{Tables}
\renewcommand\arraystretch{1.5}
\begin{table}[ht]
\caption{\textbf{\textcolor{red}{Average computation time per image.}}}
\resizebox{\textwidth}{!}{
  \begin{tabular}{cccc}
    \hline
    {\textbf{Databases}} & {\textbf{Resolutions}} & {\textbf{Number of MAs labelled per image}} & {\textbf{Computation time per image}}\\
    \hline
        \multirow{2}{*}{e-ophtha MA} &  {$2544\times1696$} & {$7.38$ ($273$ in $37$ images)} & {$\sim29$ seconds}\\
        ~ &  {$1400\times960$} & {$8.16$ ($301$ in $37$ images)} & {$\sim3$ seconds}\\
        {DIARETDB1} &  {$1500\times1152$} & {$2.04$ ($182$ in $89$ images)} & {$\sim2.6$ seconds}\\
    \hline
  \end{tabular}}
\label{tab:1}
\end{table}

\renewcommand\arraystretch{1.5}
\begin{table}[ht]
%\begin{sidewaystable}[ht]
%\centering
\caption{\textbf{\textcolor{red}{Average time per image in each processing step.}}}
\resizebox{\textwidth}{!}{
  \begin{tabular}{lcccc}
    \hline
    \multirow{2}{*}{\textbf{Steps}} &
    \multicolumn{3}{c}{\textbf{Average time (ms) of different resolutions}} & {\textbf{Average time of }}\\
    \cline{2-4}
    %~ & \multicolumn{2}{c}{\textbf{e-ophtha MA}} & {\textbf{DIARETDB1}} & ~\\
    %\cline{2-4}
    ~ & $\textbf{2544}\times\textbf{1696}$ & $\textbf{1440}\times\textbf{960}$ & $\textbf{1500}\times\textbf{1152}$ & {\textbf{Dashtbozorg \cite{DashtbozorgRetinal}}}\\
    \hline
        {Preprocessing} & $\sim4409$  & $\sim1229$ & $\sim2528$ &	$\sim11.0s$\\
        {MA Candidate extraction} & $\sim14997$  & $\sim701$ & $\sim75$ &	$\sim52.5s$\\
        {Making candidate patch} & $\sim222$  & $\sim33$ & $\sim14$ &	$-$\\
        {Feature extraction} & $\sim4591$  & $\sim561$ & $\sim17$ &	$\sim98.4s$\\
        {Classification} & $\sim4599$  & $\sim568$ & $\sim5$ &	$\sim18.1s$\\
    \hline
  \end{tabular}}
\label{tab:2}
\end{table}

\renewcommand\arraystretch{1.5}
\begin{table}[ht]
%\begin{sidewaystable}[ht]
%\centering
\caption{\textbf{Comparison of sensitivity at different FPI values for different MA detection methods on e-ophtha MA database.}}
\resizebox{\textwidth}{!}{
  \begin{tabular}{llcccccccc}
    \hline
    \multirow{2}{*}{\textbf{Methods}} & \multirow{2}{*}{\textbf{\textcolor{red}{Highlights}}} &
    \multicolumn{7}{c}{\textbf{Sensitivity under different FPI values}} & \multirow{2}{*}{\textbf{Scores}}\\
    \cline{3-9}
    ~ & ~ & $\frac{\textbf{1}}{\textbf{8}}$ & $\frac{\textbf{1}}{\textbf{4}}$ & $\frac{\textbf{1}}{\textbf{2}}$ & \textbf{1} & \textbf{2} & \textbf{4} & \textbf{8} & ~ \\
    \hline
        {Eftekhari (2019)\cite{eftekhari2019microaneurysm}} & {2-step CNN} & $0.091$ & $0.258$ & $0.401$ &	$0.534$ &	$0.579$ & $0.667$ &	$0.771$ & $0.471$\\
        {Veiga (2018)\cite{Veiga2018}} & {Laws texture masks, SVM} & $0.110$ & $0.152$ & $0.222$ &	$0.307$ & $0.383$ &	$0.494$ &	$0.629$ & $0.328$\\
        {\textcolor{red}{Orlando (2018)}\cite{orlando2018an}} & {CNN-based features, RF} & $0.14$ & $0.20$ & $0.23$ & $0.37$ &	$0.45$ &	$0.52$ &	$0.62$ & $0.361$\\
        {Wu (2017)\cite{WU2017106}} & {Profile features, KNN} & $0.063$ & $0.117$ & $0.172$ & $0.245$ &	$0.323$ &	$0.417$ &	$0.573$ &	$0.273$\\
        {\textcolor{red}{Proposed method}} & {DLC feature, NB} & $0.075$ & $0.154$ & $0.267$ & $0.358$ & $0.472$ & $0.594$ & $0.699$ & $0.374$\\

        %{Eftekhari(2019)\cite{eftekhari2019microaneurysm}} & {2-step CNN} & 0.09 & 0.26 & 0.40 &	0.53 &	0.58 &	0.67 &	0.77 &	0.47\\
        %{Veiga(2018)\cite{Veiga2018}} & {Laws texture masks, SVM} & 0.11 & 0.15 & 0.22 &	0.31 &	0.38 &	0.49 &	0.63 & 0.33\\
        %{Orlando(2018)\cite{orlando2018an}} & {CNN-based features, RF} & 0.14 & 0.20 & 0.23 & 0.37 &	0.45 &	0.52 &	0.62 & 0.361\\
        %{Wu(2017)\cite{WU2017106}} & {Profile features, KNN} & 0.06 & 0.12 & 0.17 & 0.25 &	0.32 &	0.42 &	0.57 &	0.27\\
        %{Proposed method} & {DLC feature, NB} & 0.08 & 0.15 & 0.27 & 0.36 & 0.47 & 0.59 & 0.70 & 0.37\\
    \hline
  \end{tabular}}
\label{tab:3}
\end{table}

\renewcommand\arraystretch{1.5}
\begin{table}[ht]
%\begin{sidewaystable}[ht]
%\centering
\caption{\textbf{\textcolor{red}{Comparison of sensitivity at different FPI values for different MA detection methods on DIARETDB1 database.}}}
\resizebox{\textwidth}{!}{
  \begin{tabular}{lm{32mm}cccccccc}
    \hline
    \multirow{2}{*}{\textbf{Methods}} & \multirow{2}{*}{\textbf{\textcolor{red}{Highlights}}} &
    \multicolumn{7}{c}{\textbf{Sensitivity under different FPI values}} & \multirow{2}{*}{\textbf{Scores}}\\
    \cline{3-9}
    ~ & ~ & $\frac{\textbf{1}}{\textbf{8}}$ & $\frac{\textbf{1}}{\textbf{4}}$ & $\frac{\textbf{1}}{\textbf{2}}$ & \textbf{1} & \textbf{2} & \textbf{4} & \textbf{8} & ~ \\
    \hline
        {Chudzik (2018)\cite{chudzik2018microaneurysm}} & {Fully convolutional neural networks (FCN)} & $0.187$ &	$0.246$ &	$0.288$ &	$0.365$ &	$0.449$ & $0.570$ &	$0.641$ &	$0.392$\\
        {Orlando (2018)\cite{orlando2018an}} & {CNN-based features, RF} & $0.06$ & $0.09$ & $0.10$ & $0.29$ &	$0.37$ &	$0.49$ &	$0.67$ & 0.294\\
        {Habib (2017)\cite{HABIB201744}} & {Tree ensemble} & $-$ & $-$ & $-$ & $0.18$ &	$0.20$ &	$0.38$ &	$0.58$ &	$0.2109$\\
        {Adal (2014)\cite{adal2014automated}} & {Semi-supervised learning} & $0.024$ & $0.033$ & $0.045$ & $0.103$ & $0.204$ & $0.305$ &	$0.571$ &	$0.184$\\
        {Proposed method} & {DLC feature, NB} & $0.013$ & $0.026$ &	$0.052$ &	$0.104$ &	$0.209$ &	$0.400$ &	$0.669$ &	$0.210$\\
    \hline
  \end{tabular}}
\label{tab:4}
\end{table}

\renewcommand\arraystretch{1.5}
\begin{table}[ht]
\caption{\textbf{\textcolor{red}{Comparison of computation time for different MA detection methods.}}}
\resizebox{\textwidth}{!}{
  \begin{tabular}{lm{31mm}m{33mm}m{44mm}}
    \hline
    {\textbf{Methods}} & {\textbf{Highlights}} & {\textbf{Average time}} & {\textbf{Databases used}}\\
    \hline
        {Derwin (2019)\cite{derwin2019secondary}} & {Texture descriptors, SVM} & {29 seconds} &	{One database, in resolutions of $768\times576$, $1058\times1061$ and $1389\times1383$}\\
        {Chudzik (2018)\cite{chudzik2018microaneurysm}} & {FCN} & {220 seconds} & {e-ophtha MA and DIARETDB1, with FROC score of $0.562$ and $0.369$}\\
        {Dashtbozorg (2018)\cite{DashtbozorgRetinal}} & {Local convergence index features, RUSBoosting} & {3 minutes} &	{e-ophtha MA and DIARETDB1, with FROC score of $0.546$ and $0.547$}\\          
        {Wang (2017)\cite{wang2017localizing}} & {Singular spectrum analysis, KNN} & {1 minute} & {DIARETDB1 database, with Sensitivity of $0.517$ at 1 FPI}\\        
        {Habib (2017)\cite{HABIB201744}} & {Tree ensemble} & {65 seconds} & {DIARETDB1 database, with FROC score of $0.2109$}\\
        {Seoud (2016)\cite{seoud2016red}} & {Dynamic shape features, RF} & {98 seconds for range of $2000-3000$ pixels} &	{DIARETDB1 database, with Sensitivity of 0.6 at 6 FPI}\\
        {Proposed method} & {DLC feature, NB} & {29 seconds for $2544\times1696$, 3 seconds for $1400\times960$, 2.6 seconds for $1500\times1152$} & {e-ophtha MA and DIARETDB1, with FROC score of $0.374$ and $0.210$}\\
    \hline
  \end{tabular}}
\label{tab:5}
\end{table}
\clearpage
 
\renewcommand\arraystretch{1.5}
\begin{table}[ht]
\caption{\textbf{Descriptions of features for MA detection.}}
\resizebox{\textwidth}{!}{
      \begin{tabular}{m{18mm}m{12mm}m{90mm}}
        \hline
        \textbf{Feature types}   & \textbf{Symbols}  & \textbf{Descriptions} \\ \hline
        {Color} & {f1\textasciitilde2} & {Mean and standard deviation value of candidate patch in RGB color}\\
        ~ & {f3\textasciitilde4} & {Mean and standard deviation value of candidate patch in HSV color}\\
        ~ & {f5\textasciitilde6} & {Mean and standard deviation value of candidate patch in CIElab color}\\
        {Grayscale} & {f7\textasciitilde8} & {Mean and standard deviation value of candidate patch in $I_\text{g}$}\\
        ~ & {f9\textasciitilde10} & {Mean and standard deviation value of candidate patch in $I_\text{CLAHE}$}\\
        {DLC}& {f11\textasciitilde22} & {Directional local contrast (DLC) of the center point of each candidate region in $I_\text{CLAHE}$}\\
        {Shape} & {f23\textasciitilde28} & {Area, Perimeter, Circularity, Eccentricity, Aspect ratio, and Solidity of each candidate region}\\
        {Texture} & {f29\textasciitilde32} & {Entropy, Energy, Homogeneity and Skewness of candidate patch in $I_\text{CLAHE}$}\\
        {Gaussian filter-based}& {f33\textasciitilde40} & {Mean and standard deviation value of candidate patch in corresponding Gaussian filtered result of $I_\text{CLAHE}$ when $\sigma$ is $\left[1,2,4,8\right]$}\\
        {Gradient} & {f41\textasciitilde42} & {Mean gradient of candidate patch in $I_\text{CLAHE}$ (mean value of $dx$ and $dy$)}\\
        ~ & {f43\textasciitilde44} & {Mean gradient on the boundary of each candidate region in $I_\text{CLAHE}$ (mean value of $dx$ and $dy$ on the boundary)}\\
        \hline
      \end{tabular}}
\label{tab:6}
\end{table}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                               %%
%% Additional Files              %%
%%                               %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\iffalse
\section*{Additional Files}
  \subsection*{Additional file 1 --- Sample additional file title}
    Additional file descriptions text (including details of how to
    view the file, if it is in a non-standard format or the file extension).  This might
    refer to a multi-page table or a figure.

  \subsection*{Additional file 2 --- Sample additional file title}
    Additional file descriptions text.
\fi
\end{backmatter}
\end{document}
