## 1 Introduction  
Segmentation is a crucial step in the analysis and identification of diatoms and other phytoplankton organisms because it allows for the separation of the cells from the background. Image segmentation is commonly addressed by standard techniques, such as thresholding and edge detection, in which some parameters are usually required to be fixed beforehand. Moreover, there is not an automatic method that does not require prior knowledge of the employed technique to tune the segmentation procedure. Many segmentation methods have been proposed, but the problem cannot be completely solved, as image segmentation is an ill-posed problem without a clear unique solution.  
Therefore, users have to tune parameters by comparing the results obtained with different parameter values to get the best ones. This task is time-consuming and subjective, given that there is not an ideal ground-truth image.  
The few works published in this domain are mainly related to a particular segmentation technique. In this way, [PERSON] [1] developed a stability heuristic criterion that helps to tune a method to binarise documents. [PERSON] [2] proposed an evaluation criterion of segmentation, based on a measure of image entropy, to automatically optimize the granularity of a graph-based segmentation technique for mammography. [PERSON] et al. [3] used genetic algorithms to tune range image segmentation. [PERSON] et al. [4] proposed a method to tune the key parameters thanks to a preliminary supervised learning stage. [PERSON] et al. [5] introduced an automatic feedback-based image processing method that uses a fuzzy formulation of a priori knowledge of the characteristics of the objects of interest to adapt the segmentation parameters. However, after a literature review, tuning techniques for diatom segmentation methods were not found. Several methods have been employed for diatom segmentation. [PERSON] et al. [6] find two optimal segmentation thresholds heuristically. [PERSON] et al. [7] developed a toolbox, which includes several segmentation techniques, such as the Canny [8] edge detector and the Otsu [9] threshold. These techniques are tested by users to build a workflow for the segmentation and feature extraction of diatoms. [PERSON] et al. [10] developed a method-based on the watershed segmentation [11]. These techniques need several parameters to be fixed heuristically, given that there is not a tuning technique that helps finding the best parameters. Therefore, in this paper, a formal and complete definition of a tuning segmentation technique is introduced. It is shown how this technique can be employed to find the best parameters for diatom segmentation.  
The technique was tested with two of the most popular techniques to segment phytoplankton images [7]: the Canny edge detection [8] and a binarisation method. Results of the binarisation algorithm were compared to those obtained by the Otsu method and those obtained by applying Canny with a ground truth. They show that the proposed tuning method is effective and useful to find the optimal parameters.  
The paper is organized as follows: Section 2 introduces the formulation and mathematical definition of the proposed method. Section 3 provides experiments and results. Lastly, some conclusions and perspectives of this work are given.