## 2 Materials and Methods
### Cell Segmentation
#### 2.4.3 Active Contours Model  
The problem of the identification of the contours for patterns that are visually very different and need to be separated from overlapping cells inside the Hep-2 image, has been addressed in this work, by implementing a method of active contours. This family of algorithms has the advantage that, if properly initialized, they can converge on the correct contour of objects and since the evolution involves a non-punctual analysis of the image, they allow the separation of contiguous but visually distinct objects. The characteristics of the active contour model algorithms allow to address the problem of cells overlapping. In particular, the method used is a model of active contours, based on the techniques of curve evolution, Mumford-Shah functional for segmentation and level sets [37], which is a Matlab 2017 (MathWorks, Natick, Massachusetts, USA) function. This model can detect objects whose boundaries are not necessarily defined by a gradient. The method involves minimizing an energetic functional which can be seen as a particular case of the minimal partition problem. The stopping term does not depend on the gradient of the image, as in the classical active contour models, but is instead related to a particular segmentation of the image. The method is particularly stable and allows a good convergence, even if the initial conditions are not optimal. Additionally, this model does not require image smoothing, even if it is very noisy, and in this way the locations of boundaries are very well-detected and preserved.  
The result of the Hough transform was used to initialize the active contour. In particular, the ellipse identified on the generic cell has been reduced in size, halving the axle shafts, in order to obtain an evolution of contour, which in expansion tend to be the desired cell boundary. Figure 5 shows an example of the initialization and evolution of an active contour obtained on a pattern, which is particularly difficult to segment--the cytoplasmic pattern. The average iterations number for convergence of the proposed method is around 80.  
Figure 6 shows an example of segmentation, which shows the lack of accuracy obtained from the pre-segmentation (the nucleoli contained within the cell have been identified by committing over-segmentation) and the correct identification of the contours obtained from the ACM method.  
In this work, the Dice index [38] has been chosen as a measure of the goodness of segmentation. The Dice index, also called the overlap index, is the most used metric in validating image segmentations [39], this index was used for a direct comparison between the ground truth and automatic segmentations. More generally, the Dice measures the spatial overlap between two segmentations, A and B target regions, and is defined as:  
\[Dice(A,B)=\frac{2(A\cap B)}{(A\cup B)+(A\cap B)} \tag{1}\]  
where the symbol \(\cap\) represents the intersection, and the symbol \(\cup\) is the union.  
Figure 4: (**a**) An example of an indirect immunofluorescence (IIF) sub-image containing two attached fluorescent cells; (**b**) the pre-segmented IIF sub-image; and (**c**) the relative result obtained from the randomized Hough transform method.  
The ground truth segmentation was obtained with a manual segmentation performed by an expert in the field. A total of 95 images were manually segmented, their distribution is shown below:  
* 15 homogenous;
* 16 speckled;
* 19 nucleolar;
* 15 centromere;
* 23 nuclear dots;
* 7 nuclear membrane.