Keywords

1 Introduction

In recent years, face recognition attracted attention of researchers and neuroscientists in the area of application of computer vision communication and automatic access control system. Automatic face recognition is the first step of face detection. Face detection is as simple approach but it has many challenges of image appearance, such as pose variation, occlusion, image orientation, lighting condition, and facial expression. The first [1, 9] important step is to identify the presence of human face and position of the face which includes posture and scale, face orientation, facial expression, ethnicity, and skin color. External background’s inconsistent illumination condition and quality of image may also contribute significantly to the overall problem. Skin-based face detection has been proposed by many researches. Some popular techniques are RGB, normalized RGB, YCbCr, and HSI (Hue, Saturation, and Intensity). HSV and YCbCr color [7, 8] spaces help to identify and locate the face based on intensity variations in color space. There is distribution of skin color in humans. When source light changes, the appearance of face image changes significantly. The transformation simplicity and explicit separation of luminance and chrominance components make YCbCr color model very popular. Thresholds should be chosen carefully, [Cr1; Cr2] and [Cb1; Cb2], a pixel is classified to skin tone if the chromaticity values (Cr; Cb) fall within the ranges, i.e., Cr1 ≤ Cr ≤ Cr2 and Cb1 ≤ Cb ≤ Cb2 (Fig. 1).

Fig. 1
figure 1

a Input image, b segmented region using HIS color model, c segmented region using YCbCr model

2 Background Theory

Face detection methods are broadly classified in four areas: template matching methods, feature invariant methods, knowledge-based methods, and appearance-based methods.

  1. (1)

    Template matching methods: In template matching [2] method, it stores standard pattern to identify the face. It is a way to detect the face up to certain level of correlation with basic feature of face. When an image is given, certain value of counter is calculated such as distance of eyes, nose, lips, and eyebrow. Then with the help of these counter values, face is detected. Template matching is used for face localization and detection. It also has some difficulties to represent standard templates fit for different poses, orientations, facial expression, illumination conditions, etc.

  2. (2)

    Feature invariant methods: This algorithm [5] aim is to find out structural feature such as face even lightning conditions, pose, and viewpoint variations etc. It uses facial features such as eyes, nose, ear, lip, and skin color for face detection.

  3. (3)

    Knowledge-based methods: These methods [4, 5] are based on rules. In this method, the relationship between facial features is captured. But accuracy of this method is greatly affected by rules designed for face detection. Strong rules in algorithm can increase the face detection rate while weak rule can decrease the face detection rate.

  4. (4)

    Appearance-based methods: Appearance-based [6, 11] method is trained through some set of images. After training, the trained model is prepared and then test images are applied for face detection. Neural network-based face detection technique is related to appearance-based methods.

3 Related Work

Thakur et al. [1] introduced face detection using skin tone segmentation. In this paper, an improved segmentation algorithm for face detection in color images with multiple faces and skin tone region is proposed. Algorithm uses skin color model and RGB-HS-Cb-Cr for identification of faces. Many techniques are based on pixel, which classifies the skin and “non-skin” region of pixel with its neighbor. This algorithm uses the hue and chrominance effect with RGB properties, which is used to improve the discriminality between skin and “non-skin” pixel.

Morphological Operation: Morphological operation [7] is used to refine the skin regions which are extracted from above operation. First step is hole- and gap-filling operation. Then removal based on width-to-height ratio [2]. By applying trial and error on training set, we have found that the good range of values lies between 1.1 and 0.4. Ratio values which are greater than 1.1 would not be a face since human face’s vertical height is greater than width.

In Fig. 2a, the skin color is detected and connected region is eliminated, and then in Fig. 2b, face is detected using morphological operation. Kang et al. [2] suggested a method to improve the speed of face detection with the help of sliding window and skin color modeling. This method controls the size of window and detection areas which help in reducing the processing time. In this paper, color image is taken and then skin modeling is done. Skin segmentation operation is performed. Skin color modeling [3, 12] requires the process of selecting one color model. Color model includes RGB, normalized RGB, HIS (hue, saturation, and intensity), HSL (hue, saturation, and lightness), TSL (tint, saturation, and luminance), and YCbCr. After performing color modeling, the non-skin area is rejected. Removal of area smaller than 24 × 24 is done, which is minimum size of a face according to the face-learning data collected by the face detector. The sliding window over the skin region helps to improve the speed of face detection by reducing the area to be scanned.

Fig. 2
figure 2

a Connected region eliminated in training image, b face-detected training image

4 Proposed Work

Face detection identifies the presence of any face and locate where it is. It does the modeling of face and segments it. Image is selected from the database, and portion is selected where the operation is performed. The portion is selected from image which is identified on the basis of [15] color hybrid color space. Then Gaussian probability density function is applied to model the skin and non-skin pixel. For classification purpose of skin and non-skin pixel, KNN classifier is used. High boost filter technique is applied for removing the blur edges from image. Eventually to remove the noise from image, canny edge detection is used.

  • Gaussian Probability Density Function

Gaussian or normal PDF is called the Gaussian probability density function. It is the vertically normalized PDF. Function of Gaussian probability density is produced from a signal that has purely random errors. The normal probability density function is:

$$ f\left( x \right) = \frac{1}{{\sigma \sqrt {2\pi } }}{\text{e}}^{{ - \frac{{\left( {x - \mu } \right)^{2} }}{{2\sigma^{2} }}}} $$
  • K -Nearest Neighbor Classifier

The K-nearest neighbor (KNN) classifier [14] is an extended version of the simple nearest neighbor (NN) classifier system. The nearest neighbor classifier works on an easy nonparametric decision. Every query is answered on the basis of its distance of feature. The nearest neighbor is found from image which has the minimum distance from the query image in the feature space. The distance between two features can be found with the help of distance functions such as city block distance d1, and Euclidean distance d2 or cosine distance dcos.

$$ d_{1} \left( {x, y} \right) = \mathop \sum \limits_{i = 1}^{N} \left| {x_{i} - y_{i} } \right| $$
$$ d_{2} \left( {x, y} \right) = \sqrt {\mathop \sum \limits_{i = 1}^{N} \left| {x_{i} - y_{i} } \right|} $$
$$ d_{ \cos } \left( {x, y} \right) = 1 - \frac{{\vec{x}\cdot\vec{y}}}{\left| x \right|\left| y \right|} $$
  • High Boost Filter (HBF)

A high boost filter [10] belongs to a category of spatial filtering. A high boost filter is used to retain some of the low-frequency components. In this filter, the input image f(m, n) is multiplied with an amplification factor “Af” before subtracting. The low-pass images are discussed as follows. \( {\text{HBF}} = Af \times f\left( {m,n} \right) - {\text{LP}} \), adding and subtracting 1 with the gain factor,

$$ {\text{HB}} = Af - 1 \times f\left( {m,n} \right) + f\left( {m,n} \right) - {\text{LP}} $$

where f(m, n)—LP − HP

$$ {\text{HBF}} = Af - 1 \times f\left( {m,n} \right) + {\text{HP,}} $$

where,

HBF:

High boost filter

LP:

Low pass

Hp:

High pass

Af:

Amplification factor

  • Proposed Step:

The multistep process is shown in Fig. 3 and explained as follows:

  1. Step 1.

    Select an image randomly either from a database or from own galleries which consist of single and multiple faces.

  2. Step 2.

    First skin detection is done. Color space combinations, such as luma and chroma component, are explicitly separated. Convert the RGB color pixels into YCbCr and HSV color pixel. The skin color pixel should satisfy the following condition in HSV color space 0 ≤ H ≤ 0.26; 0.16 ≤ S; ≥0.1, and for YCbCr, it should satisfy 141 ≤ Cr ≤ 164; 141 ≤ Cb ≤ 194.

  3. Step 3.

    Gaussian probability density function is used to successfully model for skin color. This can be obtained via maximum likelihood criteria mean vector and covariance matrix that maximizes the likelihood function. Segmentation is done on the basis of them.

  4. Step 4.

    After the low-level process of skin and non-skin pixel detection, K-nearest neighbor classifier is used for classification and segmentation process is also run which is used for removal of the unwanted skin regions like neck and shoulder part.

  5. Step 5.

    We use contrast enhancement technique along with high boost filter so that probability of object gets enhanced and the difference between face and background should be clear, and this is done using contrast stretch.

  6. Step 6.

    Binary mask has been created by removing noises (gaps and holes) from morphological phase.

  7. Step 7.

    Now in the noise removal process, we use high boost filter and Gaussian filter.

  8. Step 8.

    To identify and locate sharp discontinuities of an image, we use edge detection method which is [13] canny edge detection method. The edges identified still contain noise so the noise removal process starts in a loop with canny edge and the desired output detected faces.

Fig. 3
figure 3

Block diagram of the proposed method

5 Experimental Result

To verify the effectiveness of the proposed scheme, MATLAB simulated experiments are performed. Most frequently used databases for face detection are PIE, CMU, MIT databases which consist of single frontal gray color images. Therefore, images from own photo gallery and from Internet are taken into consideration which consist of both single and multiple group images with various poses and illumination conditions. The test is performed on 10 group images containing 121 different faces. The examples of part experimental result are shown in Figs. 4, 5, 6, 7, 8, 9, 10.

Fig. 4
figure 4

Input test image and its skin-detected image

Fig. 5
figure 5

HBF-enhanced image and successfully detected face

Fig. 6
figure 6

Input group image

Fig. 7
figure 7

HBF-enhanced image

Fig. 8
figure 8

Noise removal process

Fig. 9
figure 9

Edges detected using canny edge

Fig. 10
figure 10

Successfully detected faces in group image

The performance of the proposed scheme is evaluated in terms of true detection rate and defined as:

$$ {\text{Detection rate }}\left( \% \right) = \left( {{\text{True detected faces}} \times 100} \right)/\left( {\text{Total no. of faces}} \right). $$

Experimental results show that the proposed scheme achieves 95% true detection rate for colored group images. Proposed method claims high detection rate because geometric features are being used. The statistical data is shown in Tables 1 and 2.

Table 1 Result analysis of existing method
Table 2 Result analysis of proposed method

6 Conclusion

We have presented a novel model for face detection. First skin color segmentation is performed and then K-nearest neighbor (KNN) classifier is used. Canny edge detection is used for edge detection. The experimental result showed that our approach achieves good detection and success rate. Experimental results show that the proposed scheme achieves 95% true detection rate for colored group images. When nasa1 image is tested in existing method, there are 17 faces in the image; the true detection is 16 and detection rate is 94.1%. When the same image is tested in the proposed method, the detection rate is 100%. The false detection rate is almost zero in the proposed method.