\documentclass[a4paper,12pt]{report}
%%%%%%%%%%%%%%%%%% packages %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage[latin1]{inputenc}
\usepackage[english]{babel}
\usepackage{times}
\usepackage{graphicx}
\newcommand{\pv}{\mbox{\boldmath$p$\unboldmath}}
\newcommand{\wv}{\mbox{\boldmath$w$\unboldmath}}
\newcommand{\gammavu}{\mbox{\fontsize{7}{12}\boldmath$\gamma$\unboldmath}}
\newcommand{\gammavvu}{\mbox{\fontsize{3}{12}\boldmath$\gamma$\unboldmath}}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagestyle{plain}
\huge
\title{ \textbf{Final report on pollen project}}
\author{Marc'Aurelio Ranzato}

\begin{document}
\maketitle



\section*{Database}


The database used in the experiments is shown in tab.\ref{tab:folder-images} and \ref{tab:list-pollen}. This database was double-checked by the expert (6 August 2004).


\begin{table}[tbph]
\begin{center}
\begin{tabular}{c||c}
 \textbf{folder}  & \textbf{images} \\ 
\hline
\hline 
*010403 & 195 \\
\hline
022203 & 19 \\
\hline
022303 & 10 \\
\hline
022403 & 15 \\
\hline
030310 & 22 \\
\hline
030311 & 80 \\
\hline
*032102 & 115 \\ 
\hline
*042304$\_$0-12 & 100 \\
\hline
*042802 & 180 \\
\hline
091903 & 30 \\
\hline
120102 & 44 \\
\hline
120202 & 8 \\
\hline
*122902 & 158 \\
\hline
*ChinElm & 216 \\
\hline 
TrialPollen & 71 \\
\hline
\textit{TOTAL} & 1429 \\
\end{tabular}  
\end{center}
\caption{Pollen database: list of folders and images in each folder. The * denotes the new available data in addition to the old database (March 04).}
\label{tab:folder-images}
\end{table}


\begin{table}[tbph]
\begin{center}
\begin{tabular}{c||c}
 \textbf{genus}  & \textbf{number of samples} \\ 
\hline
\hline
\textbf{alder} & \textbf{416} \\
\hline 
\textbf{ash} & \textbf{329} \\
\hline
asterac. & 6 \\
\hline
birch & 4 \\ 
\hline
camplor & 9 \\
\hline
chenopod & 32 \\
\hline
\textbf{chin. elm} & \textbf{522} \\
\hline
c. myrtle & 3 \\
\hline
cypress & 46 \\
\hline
eucal. & 30 \\
\hline
ginkgo & 3 \\
\hline
\textbf{jacaranda} & \textbf{282} \\
\hline
liq. amber & 44 \\
\hline
\textbf{mulberry} & \textbf{111} \\
\hline
\textbf{oak} & \textbf{413} \\
\hline
\textbf{olive} & \textbf{326} \\
\hline
palm & 39 \\
\hline
pecan & 4 \\
\hline
\textbf{pine} & \textbf{705} \\
\hline
plane t. & 10 \\
\hline
poplar & 7 \\
\hline
sycamore & 33 \\
\hline
walnut & 36 \\
\hline
unknown & 263 \\
\hline
pistach. & 0 \\
\hline
plantain & 0 \\
\hline
elm  & 1 \\
\hline
rumex & 1 \\
\hline
umbellif. & 4 \\
\hline
grass & 19 \\
\hline
\textit{TOTAL} & \textit{3686} \\
\end{tabular}  
\end{center}
\caption{List of pollen particles found in the images of tab.\ref{tab:folder-images}. In bold characters, we highlight the species with more than 100 samples.}
\label{tab:list-pollen}
\end{table}


\newpage


\section*{Detection: outline}


The system is based on a filtering approach and its outline is shown in fig. \ref{figure:outline1} and \ref{figure:outline2}.\\

\begin{figure}[htbp]
\centering
\includegraphics[width=1\textwidth,height=.8\textwidth]{./figure/outline1.eps}
\caption{\small Outline of particle detector. Patches of interest are found by a system using two different frequencies (the light blue boxes that are described in 
fig. \ref{figure:outline2}).
Patches coming from these two systems are retained only if they pass a test on overlap and a test on average brightness (boxes with red border). For example, if two patches are too much
overlapped we keep only one patch. If the average brightness of pixels falling inside the box is too high, we discard this patch because pollen particles have always some texture.
The output is a set of patches that will be given to the classifier. In the example, the blue boxes are pollen grains, the green ones are false alarms.}
\label{figure:outline1}
\end{figure}

\begin{figure}[htbp]
\centering
\includegraphics[width=1\textwidth,height=.8\textwidth]{./figure/outline2.eps}
\caption{\small Zoom of the light blue boxes shown in fig. \ref{figure:outline1}. The input image (after conversion to gray level values) is blurred and sampled at a certain frequency.
Then, we look
for the maxima of the difference of Gaussians (DoG) image. These maxima are our initial set of interest
points. Then, we discard points too close to the image border. After that, we automatically compute a bounding box around each interest point. Finally, we discard the patches
whose average side is too small. The output is a set of patches that might contain pollen grains.}
\label{figure:outline2}
\end{figure}


The input image is converted in gray level values. It is blurred and sampled at two different frequencies, $F_1$ and $F_2$.
In order to avoid artifacts near the image border, we normalize the background brightness to zero\footnote{The estimate of the background brightness is iterative and it is based
on computation of the histogram peak of all the image pixel values.}.
We apply to both sampled images a filtering stage: for each such image we compute a difference of Gaussians. A set of interest points is
extracted looking at the extrema of the two previously found images. Then, we discard points that are too close to the image border and for the remaining ones we find a proper bounding
box. 
After removing those patches that are too small, too much overlapped with other patches and patches whose average brightness is too high, we have a set of patches that might contain
a particle of interest and then, these patches will be given to the classifier. \\
In the following subsections, we will explain in some details the key points of the system.


\subsection*{The difference of Gaussians image}

Given a properly blurred and sampled image, we blur the image twice with a Gaussian kernel. The difference of Gaussians (DoG) image is the difference between the outputs of the
two filters. \\ 
In fig. \ref{figure:esempiokernelDoG}, we show the plots of Gaussian kernel and difference of Gaussian (DoG) kernel and their DFT in the 1-D case.\\
The goal of the sampling stage is to make the smallest pollen appear a little blob of few pixels. This automatically removes dust particles smaller than pollen grains 
and reduces the amount of computation. With a proper choice of the variance of the Gaussian kernel $\sigma$, the output image will have a peak in correspondence of round shaped
 objects with a certain size. Fig. \ref{figure:esempiokernelDoGScala} shows a synthetic example in which two filters with DoG kernels having different $\sigma$ are applied to an image. 
 When $\sigma$ is low, the output image has a narrow peak in correspondence of the little blob of the input image. When $\sigma$ is high, the peak is in correspondence of the 
 largest blob. The variance of the Gaussian kernel allows to select the size of the interest objects.\\
In order to detect how good a point of extremum is in the output image, we fit around it a paraboloid. The
vertex of this paraboloid gives the exact position of the interest point and its curvature is a measure of its quality. If this value is too
low then, it is likely that this extremum is generated by a strip shaped object or by an object that is smaller than the one we are looking for. 
If this value is high then the object in that position is round and it has a size that fits the size of our target.


\begin{figure}[htbp]
\centering
\includegraphics[width=0.9\textwidth,height=0.5\textwidth]{./figure/esempiokernelDoG.eps}
\caption{\small First row: basic kernels, namely Gaussian kernel and the equivalent kernel of the whole system. Second row: DFT of previous kernels.}
\label{figure:esempiokernelDoG}
\end{figure}


\begin{figure}[htbp]
\centering
\includegraphics[width=0.9\textwidth,height=0.4\textwidth]{./figure/esempiokernelDoGScala.eps}
\caption{\small This example shows how the choice of scale $\sigma$ is related with the dimension of objects of interest. 
The first image has a little blob of 1 pixel in the upper left corner and a larger one of 10 pixel diameter in the lower right corner. 
The second image shows a good peak in the position of the smaller blob, $\sigma$ was chosen equal to 1. 
The third image shows a good peak in the position of the larger blob, $\sigma$ was chosen equal to $8\sqrt{2}$.}
\label{figure:esempiokernelDoGScala}
\end{figure}



\subsection*{Bounding box determination}

The algorithm to determine a bounding box given an interest point is very straightforward. Its pseudo-code is given in fig. \ref{figure:BB} and in fig. \ref{figure:outlineBB} we show
an example of application of this algorithm.\\

\begin{figure}[htbp]
\centering
\input{./figure/BB.tex}
\caption{\small Pseudo code of algorithm for determination of bounding box.}
\label{figure:BB}
\end{figure}

\begin{figure}[htbp]
\centering
\includegraphics[width=.8\textwidth,height=.5\textwidth]{./figure/outlineBB.eps}
\caption{\small Example of bounding box determination. The point in magenta is the interest point. The green and red points are the estimated points around the particle
border. The
red points give the lowest error when fitting the circle. The resulting box is the cyan square. }
\label{figure:outlineBB}
\end{figure}

We consider 150 pixel values in each direction because pine pollen (the biggest one) can be bounded by a square box of 300 pixels. Then, we compute the mean of groups of three 
pixel values in
order to make less computations and to reduce the noise. We consider 4 values of mean for the mean squared error (point 4) because we assume that outside the pollen the
signal is stable around the background value and there are at least 12 pixels of separation among particles. Error $e$ takes into account only three directions
because we allow to have two wrong points around the border of the object (think about grains that are grouped together or see the dust near the pollen of
fig. \ref{figure:outlineBB}). On the other hand, we can be confident that the
circle with minimum $e$ describes quite well 6 points out of 8 staying in the object border.



\subsection*{Overlap criterion}

When images are very noisy in the background or pollen grains are grouped together, there can be more than one bounding box for particle or there can be a lot of bounding
boxes that are very close and overlapped. 
Then, we have to choose which bounding box to retain and which one to remove.\\
Our criterion focuses on two main cases. If box A is overlapped to box B and no other box is overlapped
with A and B then, we keep the box with minimum error $e$ as defined in the previous subsection. If box A is overlapped to box B and both boxes A and B are overlapped to box C,
then, we keep the box with the smallest value of $e$. Finally, if box A is overlapped to box B, and only box B is overlapped to box C then, we keep box
B if it has the smallest error $e$ otherwise we remove only box B.


\subsection*{Examples} \label{sec:exampledet}


In order to have a better understanding of the computations performed by this system and to see its major limitations, we will take into account two images in our database. 
The first one is an example of very good detection
(fig. \ref{figure:figTESTgood}, fig. \ref{figure:figBOXgood}, fig. \ref{figure:figRESULTgood}), 
the latter one of poor detection (fig. \ref{figure:figTESTbad}, fig. \ref{figure:figBOXbad}, fig. \ref{figure:figRESULTbad}).

Main causes of errors are:
\begin{itemize}
\item some pollen grains are very low contrast and they don't give any interest point
\item pollen grains are sometimes grouped together and we can usually get only an interest point per group, the algorithm for bounding box determination can fail in this
situation
\item bounding box determination and overlap test can fail in very noisy images. 
\end{itemize}


\begin{figure}[htbp]
\begin{center}
\includegraphics[height=.8\textwidth,width=1\textwidth]{figure/figTESTgood.eps}
\caption{\small Example of good detection. The round red markers show the position of interest points. The square blue markers show the points that passed the test on the distance
to the border. The magenta triangular markers are positioned in the centroids of those patches that have passed the test on the size length. The yellow triangular markers
are located in the centroids of those patches that have passed the test on overlap. Finally, the black triangular markers show the position of the centroids of patches that
passed the test on average brightness.}
\label{figure:figTESTgood}
\end{center}
\end{figure}


\begin{figure}[htbp]
\begin{center}
\includegraphics[height=.5\textwidth,width=.8\textwidth]{figure/figBOXgood.eps}
\caption{\small Example of good detection. The red points are the interest points that passed the test on border distance. The blue square boxes are the automatically computed
bounding boxes. The blue point is the centroid of these bounding boxes. }
\label{figure:figBOXgood}
\end{center}
\end{figure}


\begin{figure}[htbp]
\begin{center}
\includegraphics[height=.5\textwidth,width=.8\textwidth]{figure/figRESULTgood.eps}
\caption{\small Example of good detection. The red boxes are dragged by the expert. The blue boxes show the patches computed by the system that match the expert's ones. The green
boxes are patches computed by the system that are false positives. In this image, all pollen grains are detected and other 14 particles that are not pollen grains are
detected.}
\label{figure:figRESULTgood}
\end{center}
\end{figure}




\begin{figure}[htbp]
\begin{center}
\includegraphics[height=.8\textwidth,width=1\textwidth]{figure/figTESTbad.eps}
\caption{\small Example of bad detection. The round red markers show the position of interest points. The square blue markers show the points that passed the test on the distance
to the border. The magenta triangular markers are positioned in the centroids of those patches that have passed the test on the size length. The yellow triangular markers
are located in the centroids of those patches that have passed the test on overlap. Finally, the black triangular markers show the position of the centroids of patches that
passed the test on average brightness.}
\label{figure:figTESTbad}
\end{center}
\end{figure}


\begin{figure}[htbp]
\begin{center}
\includegraphics[height=.5\textwidth,width=.8\textwidth]{figure/figBOXbad.eps}
\caption{\small Example of bad detection. The red points are the interest points that passed the test on border distance. The blue square boxes are the automatically computed
bounding boxes. The blue point is the centroid of these bounding boxes. }
\label{figure:figBOXbad}
\end{center}
\end{figure}


\begin{figure}[htbp]
\begin{center}
\includegraphics[height=.5\textwidth,width=.8\textwidth]{figure/figRESULTbad.eps}
\caption{\small Example of bad detection. The red boxes are dragged by the expert. The blue boxes show the patches computed by the system that match the expert's ones. The green
boxes are patches computed by the system that are false positives. In this image, there are 6 detections, 5 missed detections and 37 false alarms.}
\label{figure:figRESULTbad}
\end{center}
\end{figure}

\newpage

\section*{Detection: experiments}


We studied the performance of this detector changing the values of the sample frequency and the
variance of the Gaussian kernel. With the best achieved performance, we run many experiments varying the parameters $MIN\_K$ and
$MAX\_ERR$ in the function that computes the interest points. Finally, we tried many values for the threshold used in the brightness test. 
With the best parameters that have been found (see tab. \ref{tab:paramdet}), we run a final experiment on all the images of pollen database. The result is shown in 
tab.\ref{tab:resultdetectionDB}. We are able to detect more than 90\% of pollen particles with a percentage of false alarms around 1000\% using the DoG image.\\
Note that the system is quite fast because it takes about 5 sec. to evaluate an image 1024x1280 pixels on machine working with a 2GHz processor.



\begin{table}[tbph]
\begin{center}
\begin{tabular}{c||c}
\textbf{Parameter} & \textbf{DoG} \\
\hline
\hline
$F_1$ & $8$  \\
\hline
$F_2$ & $8\sqrt2$ \\
\hline
$\sigma$ & $\sqrt2$ \\
\hline
$MAX_ERR$ & $0.2$ \\
\hline
$MIN_K$ & $0.1$ \\
\hline
$Bright.$ $thres.$ & $0.97$ \\
\end{tabular}  
\end{center}
\caption{\small Parameters of detector that have been found during the tuning stage.}
\label{tab:paramdet}
\end{table}



\begin{table}[tbph]
\begin{center}
\begin{tabular}{c|c|c||c}
 \textbf{folder}  & \textbf{images} & \textbf{nr. grains} & \textbf{DoG} \\ 
\hline
\hline
  &  &  & \begin{tabular}{c|c} \%det & \%false al. \end{tabular} \\
\hline
*010403 & 195 & 959 & 98.0 \hspace{1cm} 515 \\
\hline
022203 & 19 & 35 & 88.6 \hspace{1cm} 3030 \\
\hline
022303 & 10 & 11 & 100 \hspace{1cm} 3140 \\
\hline
022403 & 15 & 28 & 96.4 \hspace{1cm} 1610\\
\hline
030310 & 22 & 56 & 92.9 \hspace{1cm} 1560 \\
\hline
030311 & 80 & 102 & 98.0 \hspace{1cm} 1820 \\
\hline
*032102 & 115 & 426 & 89.9 \hspace{1cm} 742 \\ 
\hline
*042304$\_$0-12 & 100 & 500 & 90.0 \hspace{1cm} 519 \\
\hline
*042802 & 180 & 520 & 86.3 \hspace{1cm} 1236 \\
\hline
091903 & 30 & 66 & 93.9 \hspace{1cm} 1090 \\
\hline
120102 & 44 & 56 & 98.2 \hspace{1cm} 1560 \\
\hline
120202 & 8 & 12 & 91.7 \hspace{1cm} 2390 \\
\hline
*122902 & 158 & 273 & 98.2 \hspace{1cm} 2470\\
\hline
*ChinElm & 216 & 424 & 97.2 \hspace{1cm} 1000 \\
\hline 
TrialPollen & 71 & 235 & 96.6 \hspace{1cm} 950 \\
\hline
\textit{TOTAL} & \textit{1263} & \textit{3703} & \textbf{\textit{93.9}} \hspace{1cm} \textbf{\textit{995}} \\
\end{tabular}  
\end{center}
\caption{\small Detection performance on each folder of the current database. In the last row, the final result is given. }
\label{tab:resultdetectionDB}
\end{table}

\newpage

\subsection*{Analysis of results}  \label{sec:det_anal}

We have already observed that the main causes of errors are due to dust particles that are attached or very close to pollen grains or to
pollen particles that are grouped in a single blob. In these situations, we are not always able to have an interest point for each pollen grain and the algorithm to find a proper
bounding box can fail. \\
Since our final goal is to classify the detected patches, we have built a database with the detected patches (using DoG images) and we have 
sorted them according to the expert's reference list. Then, we have checked the patches belonging to the most numerous classes in order to discard
the \emph{bad} samples. Bad samples are produced by a mistake of our bounding box algorithm in the situations above mentioned. This procedure will give us a more reliable 
percentage of detection and it will allow us to run experiments of classification. In this way, we do not risk to consider as
pollen particles some false alarm samples both in training and test stage. 

According to this analysis, the new final results are shown in tab.\ref{tab:perfdetchecked}. \\
Examples of good and bad patches for some of the most numerous classes are shown in fig. \ref{figure:AlderPatches} and following.


\begin{table}[tbph]
\begin{center}
\begin{tabular}{c|||c||c|c||c|c}
 \textbf{genus}  & \textbf{expert's} & \textbf{detected} & \textbf{\% det.}  & \textbf{detected good} & \textbf{\% det.} \\ 
\hline
\hline
\textbf{alder} & 416 & 402 & 96.6 & 355 & 85.3\\
\hline 
\textbf{ash} & 329 & 323 & 98.8 & 303 & 92.1\\
\hline
\textbf{chin. elm} & 522 & 506 & 96.9 & 466 & 89.3\\
\hline
\textbf{jacaranda} & 282 & 259 & 91.8 & 223 & 79.1\\
\hline
\textbf{mulberry} & 111 & 88 & 79.3 & 74 & 66.7\\
\hline
\textbf{oak} & 413 & 384 & 93.0 & 329 & 79.7\\
\hline
\textbf{olive} & 326 & 288 & 88.3 & 220 & 67.5\\
\hline
\textbf{pine} & 705 & 694 & 98.4 & 606 & 86.0\\
\hline
\textit{TOTAL} & \textit{3104} & \textit{2944} & \textit{94.9} & \textit{2576} & \textit{83.0} \\
\end{tabular}  
\end{center}
\caption{\small Performance of detector using DoG images when considering the most numerous classes. The number of detected patches is given and also the percentage of detection
with reference to the number of expert's patches for each class. The last two columns refer to the patches that can be reasonably classified.}
\label{tab:perfdetchecked}
\end{table}



\begin{figure}[htbp]
\begin{center}
\includegraphics[height=1\textwidth,width=1\textwidth]{figure/AlderPatches.eps}
\caption{\small Example of 90 patches of alder pollen extracted by detector. The first 7 rows show examples of good segmentation. The last 2 rows show samples that have been
removed because of a bad segmentation. Problems usually arise when there is junk attached to the pollen or when pollen grains are grouped in a single blob. Note that images
have been rescaled to a common resolution in order to fit the grid.}
\label{figure:AlderPatches}
\end{center}
\end{figure}



\begin{figure}[htbp]
\begin{center}
\includegraphics[height=1\textwidth,width=1\textwidth]{figure/JacaranPatches.eps}
\caption{\small Example of 90 patches of jacaranda pollen extracted by detector. The first 7 rows show examples of good segmentation. The last 2 rows show samples that have been
removed because of a bad segmentation. Problems usually arise when there is junk attached to the pollen or when pollen grains are grouped in a single blob. Note that images
have been rescaled to a common resolution in order to fit the grid.}
\label{figure:JacaranPatches}
\end{center}
\end{figure}



\begin{figure}[htbp]
\begin{center}
\includegraphics[height=1\textwidth,width=1\textwidth]{figure/OakPatches.eps}
\caption{\small Example of 90 patches of oak pollen extracted by detector. The first 7 rows show examples of good segmentation. The last 2 rows show samples that have been
removed because of a bad segmentation. Problems usually arise when there is junk attached to the pollen or when pollen grains are grouped in a single blob. Note that images
have been rescaled to a common resolution in order to fit the grid.}
\label{figure:OakPatches}
\end{center}
\end{figure}


\begin{figure}[htbp]
\begin{center}
\includegraphics[height=1\textwidth,width=1\textwidth]{figure/FAPatches.eps}
\caption{\small Example of 100 patches extracted by detector and belonging to the false alarm class.}
\label{figure:FAPatches}
\end{center}
\end{figure}













\section*{Classification}

We show the performance of classifier using MoG with feature based on local jets. The databases we are considering is the database of extracted patches derived from the expert's
reference list and the database built while running the detector using DoG images. This last set of images has been checked in order to remove samples with bad segmentation.\\
The pollen particles we have used for classification are listed in tab.\ref{tab:perfdetchecked}.\\
We randomly extracted from each class 
the 10\% of images to perform the tuning. Then, we run 100 experiments to assess the performance of the system. At each iteration, the 10\% of images was randomly selected for
the test stage.


\subsection*{Classification using expert's patches}

We have computed the performance using the expert's patches in order to find a lower bound for the error rate of the classifier as a part of the system for real-time pollen
count. Why are we getting a lower bound? First, experiments with detector patches use less samples to train the system. Secondly, the automatic segmentation of grains is
 not always perfect. Last but
not least, we have to deal with a lot of false alarms in any real situation.

In order to tune the system, we have run many experiments varying the number of parameters: dimensions of feature space (form 6 to 18), number of components in each
mixture of Gaussians (from 1 to 10 when appropriate\footnote{This means that we tried to keep the number of parameters to less than 50 because \emph{mulberry} class has about
100 samples.}), structure of covariance matrix of each component, initial conditions for EM algorithm. The optimal parameters can be found in tab.\ref{tab:paramExp8Poll}. 
Finally, we have run 100 experiments. Each time, we have randomly 
extracted from each class the 10\% of samples for test, the rest was used to perform the training. The average result on 100 experiments 
is shown in fig. \ref{figure:CM100ExpPatch8PollNoFA}.


\begin{table}[tbph]
\begin{center}
\begin{tabular}{c||c}
 \textbf{parameters}  & \textbf{value} \\ 
\hline
\hline
dimensions & 14 \\
\hline
nr. components & 2 \\
\hline
covariance & diag. \\
\end{tabular}  
\end{center}
\caption{\small Parameters found thanks to tuning stage which also provided us a good set of initial conditions for the random number generator used to perform EM algorithm.}
\label{tab:paramExp8Poll}
\end{table}






\begin{figure}[htbp]
\begin{center}
\includegraphics[height=1\textwidth,width=1\textwidth]{figure/CM100ExpPatch8PollNoFA.eps}
\caption{\small Average test (left side) and training (right side) confusion matrices of 100 experiments in which expert's patches were used (see second column of tab. 
\ref{tab:perfdetchecked}). The proportional error rate is
the sum of the error rates of each single class; these error rates are the ratio between the number of misclassified patches belonging to that class and the product of the number of
tested classes by the total number of samples belonging to that class. The error rate shown in parenthesis is the ratio between the total number of misclassified images and the
total number of tested images. The proportional error rate is useful when we run experiments using a different number of test samples for each class. In these experiments, we have 
randomly extracted the 10\% of images for test at each iteration.}
\label{figure:CM100ExpPatch8PollNoFA}
\end{center}
\end{figure}


\newpage

\subsection*{Classification using detector patches without false alarms} \label{sec:class8PollNoFA}

The tuning stage gave us the parameters that are shown in tab.\ref{tab:paramDet8Poll}. We present the result of classification using detector patches without the false alarm 
class in fig. \ref{figure:CM100DetPatchNoFA}. This is useful to assess the quality of our
automatic segmentation, even though the performance is a little worse due to the minor number of images used in training. We observe that the tuning stage provided us the same
parameters that were found using the expert's patches, and that also the performance is very close to that one (see fig. \ref{figure:CM100ExpPatch8PollNoFA}). Thus, we can
conclude that the automatic segmentation is good. Finally, given the strong similarity of pollen grains belonging to certain classes (i.e. ash, jacaranda, oak) we can be satisfied
about an error rate of nearly 20\% because this classification has been performed using a classifier developed for the cells in urine.   


\begin{table}[tbph]
\begin{center}
\begin{tabular}{c||c}
 \textbf{parameters}  & \textbf{value} \\ 
\hline
\hline
dimensions & 14 \\
\hline
nr. components & 2 \\
\hline
covariance & diag. \\
\end{tabular}  
\end{center}
\caption{\small Parameters found thanks to tuning stage which also provided us a good set of initial conditions for the random number generator used to perform EM algorithm.}
\label{tab:paramDet8Poll}
\end{table}




\begin{figure}[htbp]
\begin{center}
\includegraphics[height=1\textwidth,width=1\textwidth]{figure/CM100DetPatchNoFA.eps}
\caption{\small Average test (left side) and training (right side) confusion matrices of 100 experiments in which detector patches were used 
(see third column of tab.\ref{tab:perfdetchecked}). 
In these experiments, we have 
randomly extracted the 10\% of images for test at each iteration.}
\label{figure:CM100DetPatchNoFA}
\end{center}
\end{figure}


\newpage

\subsection*{Classification using detector patches and considering the false alarm class}



Given the detector performance, we assume that for each found pollen there are 10 false alarms. Thus, we are using in our experiments 2576 pollen samples and 26000 samples of
false alarms. Beside the pollen categories and the false alarm class, we refer also to 
another class: ``\emph{unknown}'' category.  
This is the class where we put the images whose maximum posterior probability is less than a certain threshold. Of course, we assume that the system is right when he assigns a
false alarm sample to either the false alarm class or the unknown one.
We apply the Bayesian classifier using features based on local jets. This classifier is one of the best we have found but it needs a lot of images
to estimate parameters in the MoG. For this reason, we consider only categories with more than 70 images, namely: alder, ash, elm, jacaranda, mulberry, oak, olive, pine 
and obviously the false alarm class. 

We aim to find the performance of the system considering all the available pollen categories. It has been experimentally proved that a better performance is
achieved modeling the false alarm class and not just only the pollen categories.
Since we have available a lot of samples belonging to this class and since these samples show an extreme variability in appearance, we
can build for this class a more complicate model. The tuning stage provided us the parameters listed in tab. \ref{tab:paramDet8PollFA}.

In order to find an average error rate we run 100 experiments and at each iteration we randomly select the 10\% of images for test.
The promising performance is shown in fig. \ref{figure:CM100DetPatch8PollFA}. 

\begin{table}[tbph]
\begin{center}
\begin{tabular}{c||c}
 \textbf{parameters}  & \textbf{value} \\ 
\hline
\hline
dimensions & 14 \\
\hline
components poll. classes & 2 \\
\hline
covariance poll. classes & spher \\
\hline
components f.a. class & 4 \\
\hline
covariance f.a. class & full \\
\hline
prob. thresh. & 0.5 \\
\end{tabular}  
\end{center}
\caption{\small Classification of 8 pollen species when modeling the false alarm class: parameters found thanks to tuning stage which also provided us a good set of initial conditions for the random number generator used to perform EM algorithm.}
\label{tab:paramDet8PollFA}
\end{table}



\begin{figure}[htbp]
\centering
\includegraphics[width=1\textwidth,height=1\textwidth]{./figure/CM100DetPatch8PollFA.eps}
\caption{\small Classification of 8 pollen species when modeling the false alarm class: average test (left side) and training (right side) confusion matrices of 100 experiments in which good detector patches were used. 
In these experiments, we have randomly extracted the 10\% of images for test at each iteration.}
\label{figure:CM100DetPatch8PollFA}
\end{figure}

\newpage

\subsection*{Classification during specific seasons}

In any practical application of airborne pollen recognition, it is useful to know what types occur together at various times of the year in the area of interest.
 In Pasadena area, in September there is chinese elm and almost nothing else; in January, ash, alder, pine pollen grains are commonly found. 
 We will never encounter a period of the year with all the 8 kinds of pollen considered in the previous section. \\
Then, it is interesting to see what the performance would be in a particular season.

In September, we have to distinguish between chinese elm and false alarms. Since we have 466 samples of this pollen, we take 4660 samples belonging to the false alarm class. We
proceed like in the previous section modeling the false alarm class. The tuning stage provided us the parameters listed in tab. \ref{tab:paramDetSEPT}. Choosing a threshold value
of 0.65, we achieved an error rate of about 6\% as shown in fig. \ref{figure:CM100SEPT}.\\


\begin{table}[tbph]
\begin{center}
\begin{tabular}{c||c}
 \textbf{parameters}  & \textbf{value} \\ 
\hline
\hline
dimensions & 8 \\
\hline
components poll. classes & 1 \\
\hline
covariance poll. classes & diag \\
\hline
components f.a. class & 5 \\
\hline
covariance f.a. class & full \\
\hline
prob. thresh. & 0.65 \\
\end{tabular}  
\end{center}
\caption{\small September month: parameters found thanks to tuning stage which also provided us a good set of initial conditions for the random number generator used to perform EM algorithm.}
\label{tab:paramDetSEPT}
\end{table}


\begin{figure}[htbp]
\centering
\includegraphics[width=1\textwidth,height=.55\textwidth]{./figure/CM100SEPT.eps}
\caption{\small September month: average test (left side) and training (right side) confusion matrices of 100 experiments in which good detector patches were used. 
In these experiments, we have randomly extracted the 10\% of images for test at each iteration.}
\label{figure:CM100SEPT}
\end{figure}



In January, we have to distinguish among alder, ash, pine and obviously false alarms. Since we have 1264 samples of these pollen grains, we take 12600 samples belonging 
to the false alarm class. The tuning stage provided us the parameters listed in tab. \ref{tab:paramDetJAN}. Choosing a threshold value
of 0.7, we achieved an error rate of about 17\% as shown in fig. \ref{figure:CM100JAN}.\\


\begin{table}[tbph]
\begin{center}
\begin{tabular}{c||c}
 \textbf{parameters}  & \textbf{value} \\ 
\hline
\hline
dimensions & 8 \\
\hline
components poll. classes & 1 \\
\hline
covariance poll. classes & full \\
\hline
components f.a. class & 10 \\
\hline
covariance f.a. class & full \\
\hline
prob. thresh. & 0.7 \\
\end{tabular}  
\end{center}
\caption{\small January month: parameters found thanks to tuning stage which also provided us a good set of initial conditions for the random number generator used to perform EM algorithm.}
\label{tab:paramDetJAN}
\end{table}



\begin{figure}[htbp]
\centering
\includegraphics[width=1\textwidth,height=1\textwidth]{./figure/CM100JAN.eps}
\caption{\small September month: average test (left side) and training (right side) confusion matrices of 100 experiments in which good detector patches were used. 
In these experiments, we have randomly extracted the 10\% of images for test at each iteration.}
\label{figure:CM100JAN}
\end{figure}


\newpage

\section*{Conclusion}


The detector is able to detect
with probability of 0.94 all pollen grains. It is able to determine a proper bounding box for the 83\% of the pollen grains that were labeled by experts. 
It detects also for each pollen ten other particles that are not pollen. With the spatial resolution of our images this results are quite good.

The classifier has an error rate of about 21\% on 8 pollen categories. A worse performance is achieved when false alarms are introduced; in this situation the error rate increase
up to 35\%. The false alarm class is described by a more complex 
model and we achieve on this category the best correct classification rate:  nearly 90\%.\\

The experiments are done in conditions which are very close to a real situation. Particularly, we keep the ratio between pollen and junk
particles at one out of ten and the classifier receives objects in the right proportion. In this way, we overcome the difficulty to select
images for training and to classify pollen particles that are not modeled because their number is too low.\\

This system has a better performance when considering few pollen categories. Thanks to the counts of this last years in Pasadena area, we know what kind of pollen particles can
be released in each season and we can use this information to improve the performance of the system. For example, in September there is mainly a release of chinese elm and we
achieve an error rate of about 6\%; in January there are only three kinds of pollen and the error rate is around 17\%. These promising results make the system already
attractive for a practical application in airborne pollen recognition. 
    
 
\section*{Future work}

We should try to improve the system in the way in which we acquire the data. A proper standardized procedure to set up the spore trap machine will allow to get a 
database with images having a less variable background. A higher spatial resolution will give a better performance in detection, a better segmentation of the pollen grain and
also a better performance in classification (no junk around the particle). In Appendix, there is a list of ``good'' images that are already in our database and can be used to
set up the spore trap for this purpose.

Detection can be improved trying to decrease the number of false alarms with other tests. For example, we could insert a threshold on the minimum value of the average 
brightness inside the patch; this should remove black objects. Color information seems to carry a lot of information and it has still to be used. Pollen grains are brown, cyan,
green and red while other particles are typically black or pink (i.e. bubble of glue). The segmentation has to be improved in order to deal with elongated particles. For
example, pine pollen has two blob on the sides. One of these blobs usually falls out the bounding box because the interest point is on the other blob and we are trying to fit
a circle looking at 5 points around the interest point. 

Classification could be improved looking for other kinds of feature that might take into account information about color and shape of the particle. A very strong effort
should be done to improve the performance on the false alarm class. When the error rate on this category will be less than 5\% then, the system will be ready for a practical
application given the current performance of the detection system.

\newpage

\section*{APPENDIX}

Images that could constitute the kernel for the future database having a better spatial resolution are listed in tab. \ref{tab:indexgoodima}. The patches that were extracted
by the detector using these images, are shown in fig. \ref{figure:poll_extracted_goodima}.
Each image in this set gives no more than 15 false alarms with the current system and has no more than three pollen grains. These images are the 5\% of the current database
and they give the performance of detection shown in tab. \ref{tab:perfdetgoodima}.



\begin{table}[tbph]
\begin{center}
\begin{tabular}{c||c}
 \textbf{folder}  & \textbf{indexes of good images} \\ 
\hline
\hline 
*010403 &  (4,9,10,13,20,21,23,24,25,26,\\
&28,29,37,38,39,54,66,67,98,106,\\
&109,115,123,124,127,135,168,195)  \\
\hline
022203 & - \\
\hline
022303 & (2) \\
\hline
022403 & (3,13) \\
\hline
030310 & - \\
\hline
030311 & (12,30,31,32,34,67,68) \\
\hline
*032102 & (69,89,90,91,101,\\
& 104,114) \\ 
\hline
*042304$\_$0-12 & (5,18,20,21,22,\\
& 24,33,46,49,55,\\
& 66,70)\\
\hline
*042802 & (12,22,26,27,48,57,58,59,60,61,\\
& 63.64.65.66.80,81,86,87,89,90,\\
& 92,93,95,96,97,98,114,115,117,118,\\
& 119,121,122,123,124) \\
\hline
091903 & (13,18,22,23) \\
\hline
120102 & (1,7,20,24,28,30,35,38,40,41,\\
& 42,43) \\
\hline
120202 & - \\
\hline
*122902 & (1,6,10,13,17,18,19,20,21,22,\\
& 151,152,157) \\
\hline
*ChinElm & (17,18,19,30,32,33,34,35,43,48,\\
& 59,62,63,66,71,76,80,84,86,87,\\
& 91,94,98,99,100,102,103,104,106,114,\\
& 115,126,139,156,160,161,162,169,178,184,\\
& 185,186,199,202,210) \\
\hline 
TrialPollen & (19,22) \\
\hline
\textit{TOTAL} & 168 \\
\end{tabular}  
\end{center}
\caption{Indexes of ``good'' images in each folder of the current database.}
\label{tab:indexgoodima}
\end{table}











\begin{figure}[htbp]
\centering
\includegraphics[width=1\textwidth,height=1\textwidth]{./figure/poll_extracted_goodima.eps}
\caption{\small Patches extracted automatically by the detection system from a set of ``good'' images (i.e. images with a good spatial resolution). The arrows show the patches
that do not have a good segmentation, they are 6.}
\label{figure:poll_extracted_goodima}
\end{figure}

\begin{table}[tbph]
\begin{center}
\begin{tabular}{c||c|c}
 \textbf{genus}  & \textbf{detected}  & \textbf{detected good} \\ 
\hline
\hline
\textbf{alder} & 24 & 22\\
\hline 
\textbf{ash} & 25 & 25\\
\hline
\textbf{chin. elm} & 74 & 73\\
\hline
\textbf{jacaranda} & 18 & 18\\
\hline
\textbf{mulberry} & 7 & 7\\
\hline
\textbf{oak} & 9 & 7\\
\hline
\textbf{olive} & 33 & 32\\
\hline
\textbf{pine} & 45 & 45\\
\hline
\textit{TOTAL} &  \textit{236} & \textit{230}\\
\end{tabular}  
\end{center}
\caption{\small Detection on ``good images'': the last columns refers to images that have been well segmented. The percentage of detection is 100\%. If we remove the 6
patches that have a bad segmentation, the percentage of detection is 98\%. The percentage of false alarms is 565\%.}
\label{tab:perfdetgoodima}
\end{table}






\end{document}
