## 2 Materials and Methods
### Preprocessing for Pattern Classification  
Figure 7 shows the flow of operations, adopted in this work, for the cellular classification--the generic segmented cell is simultaneously processed by six processes, obtaining six separate outputs representing how the cell resembles each of the six staining patterns analyzed in this work. The choice of methods, features, and parameters was performed automatically, using Accuracy as a figure of merit. The main benefit of this pipeline consists of offering of a good explanatory faculty, based on an easily explainable principle. The image classification is achieved by means of the cell classification. The rate of presence of the individual patterns, within the image, is evaluated and the generic image is associated with the pattern that has a higher rate. Figure 5: (**a**) An example of IIF sub-image containing cytoplasmic pattern; (**b**) the initial ellipse for the process of active contours; and (**c**) the contour evolution (with a step of 25 iterations) from the initial condition to the identification of the pattern. Figure 6: (**a**) An example of IIF sub-image containing nucleolar pattern; (**b**) pre-segmented sub-images; (**c**) relative result obtained from the randomized Hough transform method; and (**d**) the result of the active contours model (ACM)) algorithm. In a pattern recognition process, in particular when, as in this case, the objects to be discriminated are very heterogeneous, the image preprocessing has considerable importance, since from this phase the features extraction will be strictly dependent. For this reason, in this work, the preprocessing phase has been differentiated for each type of pattern to be recognized. Starting from a set of preprocessing functions, all their possible couplings, in terms of class accuracy, were evaluated, and the best performing combination for each pattern was chosen. Table 1 shows the preprocessing functions used. Many of the functions in the table have been analyzed using several parameters (e.g., median kernel of size \(3\times 3\), \(5\times 5\), and \(7\times 7\) have been analyzed); overall a total of thirty-seven functions were analyzed. The analysis carried out allowed the determination of the best configuration for each analyzed pattern, the result is shown in Table 2. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Abbreviation** & **Function Description** & **Reference** \\ \hline Nt & Nothing & - \\ Fs & FAS (Filter Alternate Sequential) & [[http://www.pkuwwrt.tk/ofeli/doc/index.html](http://www.pkuwwrt.tk/ofeli/doc/index.html)]([http://www.pkuwwrt.tk/ofeli/doc/index.html](http://www.pkuwwrt.tk/ofeli/doc/index.html)) \\ Eq & & \multirow{2}{*}{[[http://docs.opencv.org](http://docs.opencv.org)]([http://docs.opencv.org](http://docs.opencv.org))} \\ Ch & CLAHE (Contrast Limited Adaptive Histogram Equalization) & \\ Md & Median filter & [[http://docs.opencv.org](http://docs.opencv.org)]([http://docs.opencv.org](http://docs.opencv.org)) \\ Gs & Gaussian filter & [[http://docs.opencv.org](http://docs.opencv.org)]([http://docs.opencv.org](http://docs.opencv.org)) \\ Ge & Gaussian-Enhancement: & [[http://docs.opencv.org](http://docs.opencv.org)]([http://docs.opencv.org](http://docs.opencv.org)) \\ Di & Dilatation & [[http://docs.opencv.org](http://docs.opencv.org)]([http://docs.opencv.org](http://docs.opencv.org)) \\ Er & Erosion & [[http://docs.opencv.org](http://docs.opencv.org)]([http://docs.opencv.org](http://docs.opencv.org)) \\ Ng & Nagao & [[http://www.pkuwwrt.tk/ofeli/doc/index.html](http://www.pkuwwrt.tk/ofeli/doc/index.html)]([http://www.pkuwwrt.tk/ofeli/doc/index.html](http://www.pkuwwrt.tk/ofeli/doc/index.html)) \\ Bl & Bilateral & [[http://docs.opencv.org](http://docs.opencv.org)]([http://docs.opencv.org](http://docs.opencv.org)) \\ Op & Opening & [[http://docs.opencv.org](http://docs.opencv.org)]([http://docs.opencv.org](http://docs.opencv.org)) \\ Cn & Contrast normalization & - \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Preprocessing functions analyzed.