Abstract. This paper proposes a nested particle swarm optimization (PSO) method to find the optimal number of clusters for segmenting a grayscale image. The proposed approach, herein denoted as PSilhOuette, comprises two hierarchically divided PSOs to solve two dependent problems: i) to find the most adequate number of clusters considering the silhouette index as a measure of similarity; and ii) to segment the image using the Fuzzy C-Means (FCM) approach with the number of clusters previously retrieved. Experimental results show that parent particles converge towards maximizing the silhouette value while, at the same time, child particles strive to minimize the FCM objective function.