Skin Detection Based on Image Color Segmentation with Histogram and K-Means Clustering Emir Buza, Amila Akagic, Samir Omanovic University of Sarajevo Faculty of Electrical Engineering, Department for Computer Science and Informatics Zmaja od Bosne bb, Kampus Univerziteta, 71000 Sarajevo emir.buza, amila.akagic, samir.omanovic@etf.unsa.ba Abstract Skin detection is a crucial pre-processing step for finding human faces in images. The challenging task is to find a reliable, yet efficient method for detection of skin region(s). In this paper, we proposed a new, simple and efficient method for skin detection based on image segmentation of different color spaces, and simple clustering technique (K-means) for clustering similar pixels on an image. Three K-means input features are used : a) two components from two different color spaces (Hue, Cr, Cb), b) positions of pixels on an image and c) rough estimation of skin pixels obtained from skin-color based detection. Our approach showed promising results on human images from different ethnicities, with simple background and high illumination. The computational cost of the method has been very low, since no training data is required. Results indicate that the method is suitable as a pre-processing step for some supervised method for advanced human skin segmentation and detection. Keywords: Skin detection, Unsupervised method, k-means clustering, Image processing, Image segmentation I. Introduction A reliable and efficient human skin detection has been the first necessary step in many image processing applications, such as face detection and tracking, gesture analysis, content-based image retrieval systems, de-identification, privacy-protection and other human computer interaction domains. In recent years, numerous skin detection methods have been presented in literature. They vary from methods based on manipulation of color-space channels to more sophisticated statistical modeling and machine learning methods. The former have been the most common methods in literature, and they are in general considered as computationally effective. The common steps in a skin detection algorithm usually include transformation of skin pixels into an appropriate color space and classification through labeling of skin pixels into skin and non-skin pixels (skin classifier). The common problem has usually been high false skin detection, which must be corrected with some addi- tional method(s). The latter methods required a pre-processing step for training a binary classification system, and have one major drawback: the classifier performance highly depends on the size of a training set. Thus, the existing solutions usually make a trade-off between precision and computational complexity. Detection of human skin has been a challenging task be- cause many factors affect skin appearance in images [1] [2]. These factors include illumination, camera characteristics, eth- nicity, individual characteristics, background characteristics, etc. There are three main problems when designing a method based on skin color as a feature. These are: what color space to choose? how to model skin and non-skin pixel distribution? and how to classify the modeled distribution? This paper attempts to provide answers to all three problems. There are several color spaces with different properties in literature. The most popular color spaces are RGB, Normalized RGB, HSV, TSL and YCrCb [3]. The RGB color space is the default color space for the most image formats, while other color spaces can be obtained with linear and non-linear transformation of RGB color space. The choice of color space significantly influences modeling efficiency of the skin-color distribution. The goal of skin modeling is to build a decision rule in order to classify skin and non-skin pixels. There have been several modeling choices: explicitly defined skin region (a number of rules), non- parametric (histogram-based), parametric (Gaussian, Elliptic boundary model) and dynamic skin distribution (used for face tracking). A comprehensive survey of skin modeling distributions has been published in [2], [4]. In this paper, a new region-based method for skin detection based on skin-color information has been presented. The primary steps for skin detection in our method include (1) combining two color spaces, HSV and YCrCb, to represent image pixels, (2) using histogram-based modeling with new approach for defining threshold value and (3) using K-means clustering for unsupervised classification with new data set for pre-processing. K-means clustering [5] is unsupervised, non- deterministic technique for generating a number of disjoint and flat (non-hierarchical) clusters. It is used to cluster similar pixels with an equal cardinality constraint. Special dataset con- sisting of three input features has been defined for clustering image pixels into three clusters: background, foreground and skin pixels. Our method is simple and fast when compared to the exist- ing state-of-the-art segmentation methods for skin detection. It has low computational cost, since it does not require pre- processing of large training dataset. The experimental results showed that changes in illumination conditions and viewing environment do not affect quality of skin detection. Results also indicated that the method has no limitation on choice of ethnicity. On complex backgrounds, the method detected objects with similar color as skin, thus some improvements are necessary for distinguishing background objects with similar colors. The method produced better results for images with high level of skin area, while on images with many small regions (i.e. multiple humans on a image) the results are modest. However, the method is suitable as a pre-processing step for some sophisticated supervised method. The paper is organized as follows: related work on skin detection using image processing is briefly reviewed in Section II. In Section III, we proposed a new method for skin detection. Implementation and experimental results have been presented in Section IV, and in Section V we concluded the paper with some remarks.