Facial Image Segmentation Based on Gabor Filter

As an important part of face recognition, facial image segmentation has become a focus of human feature detection. In this paper, the AdaBoost algorithm and the Gabor texture analysis algorithm are used to segment an image containing multiple faces, which effectively reduces the false detection rate of facial image segmentation. In facial image segmentation, the image containing face information is first analyzed for texture using the Gabor algorithm, and appropriate thresholds are set with different thresholds of skin-like areas, where skin-like areas in the image’s background information are removed. Then, the AdaBoost algorithm is used to detect face regions, and finally, the detected face regions are segmented. Experiments show that this method can quickly and accurately segment faces in an image and effectively reduce the rate of missed and false detections.


Introduction
With the rapid development of biometric recognition technology, face recognition [1] has been widely used in many fields. As the basic research of face recognition, facial image segmentation [2][3][4] is an important step in a face recognition system. Accurate and fast segmentation of the face is critical to improve the speed and accuracy of recognition. However, due to the influences of head position, occlusion, image orientation, illumination conditions and facial expression, facial segmentation is typically difficult. Early research of images containing faces primarily focused on the adjustment model, the adjustment subimage, and the deformation model. Detection methods typically detect images with frontal face regions with simple backgrounds and other unchanged conditions; thus, their detection forms are relatively fixed. Based on these facial image detection systems, even if changes in facial image detection conditions are not affected, certain system parameters must be adjusted.
en, people paid more attention to positive facial image research, facial recognition, and video coding system. In recent years, facial image segmentation has become a research hotspot. Researchers have developed many methods, including methods that detect movement, skin color, and general information. e use of statistical methods and neural networks can find face information in complex backgrounds, markedly improving the accuracy of facial image segmentation. In addition, considerable progress has been made in the design of methods that can manage facial features with precise positions. e latest research of this project focuses on the statistical analysis model [5], the neural network learning method [6], the SVM (support vector machine) method [7], the Markov random field method [8], the BDF [9], face detection based on skin color, and other statistical information.
Currently, the rapid development of facial image segmentation and recognition has widened its possible applications. We divide existing facial image segmentation and recognition methods into three categories. e first is knowledge-based methods [10], which use surface-based rules for face recognition [11].
ere are clear rules of thumb for regional facial features, and facial expressions can be used to set local features of facial features. Yang and Huang [12] used a knowledge-based hierarchical method to detect a human face and established a three-level detection system. e primary difficulty lies in transforming human perception experience into clear rules and methods, and it is difficult to correctly detect facial areas outside these detection rules and result in feature loss. However, if these rules are too general, they can lead to error detection. In addition, the method cannot recognize all possible situations; thus, it is difficult to detect the face in different positions.
e second type is based on skin color [13]. Skin color can reveal the position of the face and is an important piece of facial information that does not depend on the details of the face. Skin color can rotate, is relatively stable, can be distinguished from the complex and diverse colors in most backgrounds, and has the advantages of pose and speed invariance.
erefore, this method is commonly used in facial image segmentation and provides good detection results for certain detection algorithms. Second, the skin is seriously disturbed by illumination, noise, and certain occlusion, and the skin color function is weakened; thus, the algorithm is difficult to use. Although skin color technology has certain limitations, it has many benefits. For example, face detection can be performed on a fine background of repeated attributes. is method does not limit the size and direction of the face, and the processing speed is relatively fast, and it is easy to define and locate the real face. Particularly in color facial image segmentation with complex and diverse colors in the background, this method can segment candidate face regions based on the different skin color thresholds, and through certain verification and face feature matching, the face region can be effectively located.
e third type is based on model matching [14]. A stored face and algorithm can be used to create a standard model [15], which describes the shape of the eyes, nose, and other facial features; or a flexible model. en, similarities between the detection area and the standard model are calculated to determine whether the region is a face or a corresponding entity. Liang and Ai [16] used five types of face detection templates to detect facial areas. e original template was used to detect eyes, and the other four templates were used to detect facial styles with different length ratios. is method has been successfully implemented and achieved good results. However, to recognize a face in a complex background, different interventions and basic models must be developed. e hidden interference model is difficult to describe, a template that can represent different faces cannot distinguish complex backgrounds accurately, and a template that can distinguish complex backgrounds cannot represent faces accurately. Based on this method, researchers must balance model accuracy and error detection.
In order to improve the accuracy and stability of the face segmentation algorithm, this paper combined the AdaBoost algorithm [17] and Gabor filter [18] to segment the face image, and the texture of the image processed by Gabor filter is clearer, which can effectively solve the omissions and misdetection phenomenon when the AdaBoost algorithm directly segments the face. Our proposed algorithm has a significant improvement in the accuracy of face image segmentation, especially in the complex background is more obvious. e structure of this paper is as follows: Section 1 introduces the existing facial image segmentation methods; Section 2 introduces he Haar-like feature Gabor features, and the AdaBoost algorithm; Section 3 proposes a facial image segmentation algorithm combining the Gabor filter and the AdaBoost algorithm; Section 4 presents experimental results and analyses; and Section 5 summarizes the full text.

Haar Classifier.
e Haar classifier is a tree-based classifier that creates a boost filter cascade classifier and primarily includes Haar-like features, integral graph method, AdaBoost algorithm, and cascading features, including the following: (1) Haar-like features are extracted, and the integral graph method is used to process the Haar-like features quickly (2) e AdaBoost algorithm is used to train the model continuously to obtain a strong classifier to distinguish a face from nonfacial information (3) Strong classifiers can be cascaded together by the screening cascade method, which can improve detection accuracy A Haar-like feature is used to describe a human face. ere are two rectangles (a white and black matrix), and an eigenvalue is defined as the sum of the black matrix pixels minus the sum of the white matrix pixels. ese Haar eigenvalues describe changes in gray levels. Because rectangular features are only sensitive to simple graphic structures, such as edges and line segments, they can only describe the structure of a particular trend.
By changing the size and location of the model, we can list many feature elements in the image pane. e function model in Figure 1 is called a "feature prototype." We can obtain many rectangular features by changing the position in the subwindow and the size of various templates and then calculate all eigenvalues in the subwindow based on these eigenvalues. Figure 2 shows certain features of the face. For example, the color of the eye area in the middle is darker than that of the cheek, while the color on the right shows that the color of the bridge of the nose is lighter than that of the side of the nose. e same is true for other targets such as eyes, which can also be represented by appropriate rectangular elements. Compared to the simple use of pixels, the use of features has great advantages and yields faster computing speeds.

Gabor Filter.
e Gabor transform effectively extracts spatial and local frequency information from a target region. Although the Gabor wavelet itself does not form an orthogonal basis, it may be a narrow frame under certain parameters. e Gabor wave is sensitive to the edge of the image and provides a good proportion selection characteristics and directionality. e Gabor wave is not sensitive to changes in illumination, making it widely applicable to describing visual information accurately. Gabor filtering with different scales in the same direction is shown in Figure 3. Gabor filtering with different directions in the same scale is shown in Figure 4.
Gabor transforms include dividing the signal into several small time intervals and then using Fourier transform to analyze each time interval to determine the signal frequency during the corresponding time interval. e processing method includes adding a sliding window and performing Fourier transform.
If f is a concrete function, and f ∈ L 2 (R), then the Gabor transform is defined as where Equation (1) is a Gaussian function called a window function, where A > 0, b > 0, ga(t − b) is a window function of time localization, and the parameter b is used as a parallel moving window to cover the entire time domain. If we integrate the parameter b, then we have e signal reconstruction expression is e value of the Gabor transform is Gaussian for two reasons: (1) the Fourier transform of Gaussian function remains Gaussian function; thus, the inverse Fourier transform can also be located by the window function (i.e., the frequency-domain location); and (2) the Gabor transform is the best Fourier transform of a window. Most importantly, after the Gabor transform, a real analysis of time and frequency is performed. us, the Gabor transform can locate time-frequency, including all signal information concurrently, correlation information of signal change severity, frequency-domain information, and local time-domain information.

AdaBoost Algorithm.
Facial image segmentation refers to the technology and process of dividing the facial image into several specific and unique regions, and identifying objects of interest in these regions. In recent years, facial image segmentation technology has been widely used in facial information processing. Facial image segmentation is an important step between facial image processing and face image analysis. Existing facial image segmentation methods can be divided into the following categories: knowledgebased, model matching, and skin color-based.
ere are more types of facial image segmentation algorithms, but most are hindered by noise or background. Noise is typically difficult to distinguish from a face, which leads to low accuracy and stability. e original purpose of the AdaBoost [19] algorithm is to improve the performance of the simple classification algorithm by training various weak classifiers on the same training set and then combining these weak classifiers into a strong classifier (i.e., the final classifier) [20]. We use the AdaBoost algorithm based on Haar-like rectangle features for face detection. e AdaBoost method iteratively searches for feature vectors that can distinguish a face from background based on the edge gray features of a human face. In this iterative process, the weight  of this iteration is updated based on the classification accuracy of the last training set, and finally the purpose of changing the data distribution is achieved. e specific steps are as follows: (1) e training data set is searched, and both face regions and nonface regions are manually segmented from the image as positive and negative training sample sets, respectively. (2) A Haar-like feature is extracted, and its eigenvalue is used to represent the contrast between the gray level of the facial area and that of the nonface area within the rectangular range. e larger the eigenvalue, the more marked the edge features are. en, the approximate rate is used to detect the face. e eigenvalue is defined as where f(r) is the eigenvalue corresponding to the rectangular feature, i(x, y) is the gray value of pixels (x, y) in the rectangle area, (x,y)∈S B i(x, y) is the sum of the gray levels of the face area, (x,y)∈S W i(x, y) is the sum of the gray levels of the background area, and c is the ratio of the size of the background area and the face area in the rectangular feature.
(3) e classifier is selected, the weight in the iteration process is adjusted, and the weight of the correct classification samples is reduced: where i � 1, 2, · · ·, N. When the classification is correct, the weight of ε t decreases; otherwise, ε t � 1, and the weight value increases. e weight is updated, and iterations continue until the most effective n features are selected from the rectangular features as weak classifiers, which makes the Ada-Boost algorithm integrate strong classifiers. (4) Because n weak classifiers may detect the same face many times, we combine the detection results from intersecting areas. We select the maximum value of four vertices as the new vertices and synthesize them into a detection result to reduce repeated face detection.

Facial Image Segmentation Algorithm Design
To solve the problems of false and missing detections in facial image segmentation, this paper proposes a facial image segmentation algorithm combining the Gabor filter and the Ada-Boost algorithm. e AdaBoost algorithm can recognize and detect faces in an image quickly. However, when the background information of the image is complex, the face detection based on the AdaBoost algorithm will typically result in many background information sections that are similar to skin color features being detected as face information; face information may also be missed. To solve this problem, we first use the textural features of skin and the significant differences of other objects combined with Gabor texture for further analysis. is method can be divided into two steps. First, the Gabor filter is used to obtain the texture feature map of the faces image, and then a threshold is set to extract the contour information of skin color to identify a skin-like region. In this way, black pixels can be added to the background information, which can significantly reduce the possibility of falsely detecting background information near skin color information. Second, the AdaBoost algorithm is used to segment the faces image, and the face region can be obtained. e algorithm steps are shown in Figure 5.

Experimental Analysis.
In the experiment, the Haar face feature classifier haarcasade_frontalface_alt_XML was trained by front face in OpenCV and then applied to positive faces images. If you want to segment the side face or other organs, OpenCV also provides a trained classifier. e experiment was divided into experimental and control groups. e design of four-direction and seven-dimension Gabor filter can filter redundant information as much as possible. For the experimental group, the original image was filtered with a four-direction and seven-dimension Gabor filter. e four directions were 0 degrees, 45 degrees, 90 degrees, 135 degrees, and the seven scales were 1, 2, 3, 4, 5, 6, and 7 pixels, and then the filtered image was segmented with the AdaBoost algorithm. e control group directly uses the AdaBoost algorithm to segment the original image without Gabor filtering. e purpose of this experiment is to verify that our method has better detection rate and stability for face segmentation compared with AdaBoost algorithm.
For the facial image in Figure 6, we conducted 10 experiments on all experimental images, and the results of multiple experiments on each image were consistent, verifying the stability of the two methods in the experimental and control groups. In the control group without Gabor filtering, the segmentation accuracy of a human face is low, and more missed detections exist: clothes are frequently mistakenly detected as a human face. In the experimental group, spatial location and the local structure information of directional selectivity maintain the details of the image features and are not sensitive to illumination change because the Gabor filter can describe spatial frequencies well. Additionally, the experimental group after managing the Gabor filter of the images is not mistakenly identified and markedly improves the human face segmentation accuracy.
In Figure 6, we counted the face segmentation accuracy of experimental group and the control group, and Figure 7 shows the accuracy of five experiments using different methods in Figure 6, where the horizontal axis represents the picture number and the vertical axis represents the segmentation accuracy. As shown in Figure 7, the face segmentation accuracy of the experimental group is higher than that of the control group. Overall, the face segmentation accuracy of the experimental group is significantly higher than that of the control group. e comparison experiment proves the effectiveness of the method proposed in this paper.  e detection data in Figure 6 are shown in Table 1. Using AdaBoost-based face detection when the background information is complex, many background regions that are similar to skin color features will be detected as face information. In the experiment, the background is recognized as a face. e Gabor filter can describe local structure information corresponding to spatial frequency, spatial position, and direction selectivity; can retain the detailed features of the image; and is not sensitive to light changes. e accuracy of face recognition after Gabor filtering is 26.5% higher than that of direct face recognition.

Conclusion
To make facial image segmentation more accurate and efficient and to create a better foundation for face recognition, this study investigates a facial image segmentation algorithm based on the Gabor filter and the AdaBoost algorithm. In this method, the Gabor filter is used to filter the original images, and skin colorlike regions are extracted as the final image for recognition. en, the AdaBoost algorithm is used to recognize faces in the image. Experimental results show that the proposed method can effectively extract skin-like regions, solve the problem of missing and false detections when the AdaBoost algorithm is directly used for face segmentation, and thereby effectively improve the accuracy of facial image segmentation.

Data Availability
e image data used to support the findings of this study are included within the article.

Conflicts of Interest
e authors declare that there are no conflicts of interest regarding the publication of this article Mathematical Problems in Engineering 7