\chapter{Analysis of errors}	\label{sec:errana}
\thispagestyle{empty}
  
In this chapter, we analyze errors made by detector and classifier. We aim to find where the mistakes are made and to understand why they are
made. We conclude each section with some ideas to overcome these problems.

\section{Detector}

In this section, we will refer to detection of pollen in images of tape taken from a volumetric spore trap.

Detector based on DoG -see par. \ref{sec:DetDoG}, is not able to detect all particles of interest because there is a quite big difference of dimension among particles belonging to different categories. For example, pine pollen maybe bounded by a square box of side greater than 200 pixels while eucalyptus by a square box of 40 pixel-wide side. So, the sample frequency and the variance of the Gaussian kernel will only be good for grains of a certain size. Moreover, some pollen particles have a very low contrast with respect to the background, because they have no texture. Thus, they can give low values of extrema in the DoG image even if their size is matched by the sample frequency and variance of the Gaussian kernel. Finally, there are a lot of particles in the background that are similar to pollen grains if you only consider information about size and shape as this detector does.\\

Focusing now on morphological detector, we show an example of missed detection in \figref{erroreDetector2} and \figref{erroreDetector1}. 


\begin{figure}[htbp]
\centering
\includegraphics[width=0.8\textwidth]{./figure/erroreDetector2.eps}
\caption{Mask computation performed by morphological detector.}
\label{figure:erroreDetector2}
\end{figure}

\begin{figure}[htbp]
\centering
\includegraphics[width=0.8\textwidth]{./figure/erroreDetector1.eps}
\caption{Errors of morphological detector: the green boxes are the automatically detected patches, the red box was selected by the expert.}
\label{figure:erroreDetector1}
\end{figure}
  
In this situation, the error was caused by the test on the mean gray level value of pixels fallen inside the region containing the pollen. Because
the pollen is quite dark and is attached to a black junk, this region is skipped. \\
Generally, the kinds of situation that make the detector fail are:
\begin{itemize}
\item pollen has very low contrast and edge detector is not able to find its contour
\item pollen is close to dark junk and the found region contains both of them
\item pollen has dimension or contrast out of range with respect to the fixed thresholds
\end{itemize} 
The main cause of missed detection is the second one.

False alarms are due to the high number of particles in the images with  similar statistics to pollen
particles. False alarms are typically
round objects with the same pollen size but with different texture. \\
Their number could be indirectly reduced increasing the spatial resolution of images, that is, making the wheel of the air sampler machine to
rotate faster.

In conclusion, the detector based on DoG seems to be intrinsically limited in its performance because of the high variability in dimension and
contrast of pollen grains. The morphological detector could be further improved considering texture inside the regions of interest.

\section{Classifier}

In this section, we will refer to experiments done on urine database.
The classification errors will be analyzed with reference to the Bayesian classifier using feature based on local jets.\\
In particular, we refer to experiments done on full data set taking 10\% of images for test. These images are randomly extracted by a set
never used for training and validation.

In \figref{WrongClassifiedImagesLJ}, we show the misclassified images with the estimated class and the assigned probability 
(in percentage). This probability is the probability of the estimated class given the extracted feature vector. 
We note that for most of these images the probability is below 90\%. This is a good point because in a real application 
we could assign these items to an unknown class for further analysis.


Let us try to give a deeper insight on the previous misclassification.
In \figref{DistanceWrongTrueClassLJ}, we show a collage in which in the central column there are some (misclassified) images 
of \figref{WrongClassifiedImagesLJ} with assigned high probability. In the first three columns there are images belonging to the true class
that are the nearest to the one in central column in the euclidean norm of the feature space (after the projection on FLD). 
In the last three columns, there are images belonging to the estimated class that are the nearest in the same feature space. \\
If you follow a row you can see the smooth transition in the features space from one class to the other; 
with this interpretation the misclassified image is on the boundary between the two classes and it can be thought like a transition item. \\

We note that some errors could be avoided by considering features with information on shape.
For example, in the second row of \figref{DistanceWrongTrueClassLJ}, it seems clear that the average of local jets doesn't allow 
to separate clearly the image on the fourth column from the image in the fifth column but we should overcome this difficulty considering 
shape and texture of these two images.

On the other hand, there are images which are really hard to distinguish because of a certain intrinsic ambiguity of the database. \\
What is the difference between the images on the fourth and fifth columns in the intersection with the fifth, sixth, tenth and eleventh row?
 It is an embarassing question, which was also posed to the experts who provided us this database, and they could not say it! 
 This intrinsic ambiguity will constitute a lower bound for the error rate of any classifier on this data set and this bound could be found with a test 
 on the human (expert's) error rate on this database. \\

Analogous analysis can be done on pollen database. Errors are made because our features do not capture all the essence of texture in 
particles and because we are not using color information.

\begin{figure}[htbp]
\begin{center}
\includegraphics[width=1\textwidth]{./figure/WrongClassifiedImagesLJ.eps}
\caption{Analysis of classification errors: misclassified images by Bayesian classifier using features based on local jets.}
\label{figure:WrongClassifiedImagesLJ}
\end{center}
\end{figure}

\begin{figure}[htbp]
\begin{center}
\includegraphics[width=1\textwidth,height=1.2\textwidth]{./figure/DistanceWrongTrueClassLJ.eps}
\caption{Analysis of classification errors: nearest images in the euclidean norm of the feature space. 
In central column the misclassified images, in the first three columns the closest images belonging to the true class, in the last three columns
the closest images belonging to the estimated class; each row is referred to the image in its central column. Above each image, there is the class number
and its index in the database.}
\label{figure:DistanceWrongTrueClassLJ}
\end{center}
\end{figure}

 
\clearemptydoublepage
