2015 Pornographic Image Recognition Based on Skin Probability and Eigenporn of Skin ROIs

2 Abstract The paper proposed a pornographic image recognition using skin probability and principle component analysis (PCA) on YCbCr color space. The pornographic image recognition is defined as a process to classify the image containing and showing genital elements of human body from any kinds of images. This process is hard to be performed because the images have large variability due to poses, lighting, and background variations. The skin probability and holistic feature, which is extracted by YCbCr skin segmentation and PCA, is employed to handle those variability problems. The function of skin segmentation is to determine skin Region of Interest (ROI) image and skin probability. While the function of PCA is to extract eigenporn of the skin ROIs images and to project the skin ROI vector using the obtained eigenporns to holistic features. The main aim of this research is to optimize the accuracy and false rejection rate of the skin probability and fusion descriptor based recognition system. The experimental result shows that the proposed method can increase the accuracy by about 4.0% and decreases the FPR 20.6% of those of pornographic recognition using fusion descriptors, respectively. In addition, the proposed method is also robust for large size dataset that is shown by giving similar performance to the latest method (Multilayer-Perceptron and Neuro-Fuzzy (MP-NF)). The proposed method also works fast for recognition, which requires 0.12 seconds per


Introduction
Rejection system for accessing pornographic contents (text, image and video) is a big issue developing country like Indonesia. It is caused by the weak protection of accessing pornographic contents, which can lead to social problems in community. Nowadays, protection for accessing pornographic contents is done by blocking the site's domain name indicating to contain pornographic contents seen from the text information of the sites. However, this method has some weaknesses: firstly, The false positive performance is high because text information of pornographic site are much similar to medical sites and sites related to human anatomy; secondly, the growth of pornographic sites is very fast not only due to exchanging the site's domain but also big business; the rest, this blocking method also has high false negative performance because the sites containing less text but many pornographic images and videos cannot be recognized as negative sites. That means people can easily access sites containing pornographic images or videos. Moreover, the pornographic content also can trigger the social problem such as addiction of pornographic content, sexual harassment, and early pregnancy. These social problems will be happen to children and teenagers who always access the pornographic content without much knowledge of sex education including the disadvantages free sex. Therefore, it is required a rejection system that can block or reject of accessing pornographic content. The system works like a firewall that can block or reject of accessing pornographic content based on its information, such as text, images and video. The system should also be run on a variety of gadgets with different platform. The rejection system consists of many complex sub processes including free processing, agent extractor, feature extraction, and recognition engine. In addition, the rejection system also faces many obstacles such as large variability images due to lighting, pose, color variations. It means, the rejection system In order to solve the mentioned problem, a pornographic image recognition using skin probability and principle component analysis (PCA) on YCbCr color space is proposed. The pornographic image recognition is defined as a process to classify the image containing and showing genital elements of human body from any kinds of images. The skin probability and holistic feature, which is extracted by YCbCr skin segmentation and PCA, is employed to handle large variability pornographic image problems. The function of skin segmentation is to determine skin ROI image and skin probability. While the function of PCA is to extract eigenporns of the skin ROIs images and the holistic features are determined by using the eigenporns. Theoretically, it can be realized because pornographic content like photos and videos can be classified by shape/pose, skin color, and genital information. However, pornographic content is generally a color image that has large diversity in terms of lighting, pose, and background. In addition, templates matching also can be applied to classify whether the pose of the objects in the input image contains pornographic content. Here, templates of pornographic can be genital elements, such as breasts, vagina, and/or penis. In terms of the text information, input media such as website can be classified as pornography from probability occurrences of words and phrases associated with pornographic such as a hard-core, free sex, porn videos, and so forth.
This paper, which is focus on pornographic image recognition, a pornographic image recognition using skin probability and principle component analysis (PCA) on YCbCr color space, is organized as follows: the first section describes the introduction of this work; the second section explains the previous works; the third section presents our proposed method including YCbCr skin segmentation, Eigenporn extraction and kNN matching process; the fourth section explains experimental result and discussion; and the rest presents conclusion and future work.

Related Works
This research mostly relates to pattern recognition, which consists of lighting normalization, object detection, intelligence systems, and matching processes.
Some detection of pornographic images called as contour-based and region based [1], and human skin probability [2][3][4] had been performed by some researches. Those methods performed the detection based on the skin information, which were extracted by skin segmentation. In addition, the pornographic image recognition using fusion descriptors (FD) [5] also had been proposed. However, those methods lack of accuracy, high false positive and negative data due to large variability of pornographic images. Regarding to skin segmentation, the skin classification models that were implemented for segmenting the skin region were threshold model in YCbCr, HSV, and RGB color spaces and Gaussian mixture models [5][6][7][8]. The FD-based method is an improvement of skin region and contour based methods. The eigenporn of skin segmented image of HSV color channel also has been proposed which provide better achievement than FD method on the HSV color channel [9]. However, it also lacks of accuracy and false recognition rate. The pornographic detection using localization skin ROI [10] had been proposed and provided better achievement than POESIA classifier. In that method, the image features that consisted of ratio of total skin to non-skin pixels within convex hull, means and variance of RGB color channel, seven spatial invariant momen, and angel of principle axis of convex hull versus horisontal axis, were extracted from ROI image. The classification was performed by Random Forest tree model. Regarding to robust pornographic image recognition over large size dataset, the multi perceptron and neuro fuzzy (MP-NF) based method had been proposed which provided reasonable result (about 87% in TP and 5.5% in FN on test dataset) compared other related works. The MP-NF method used complex and 17 kinds of features [11] for recognition, which analytically required long computational time for feature extractions.
The intelligence system that had successfully been developed and implemented in pattern recognition can be grouped into three major groups, namely: firstly, feature-based method which is comprehensive/holistic (feature extracted using statistical analysis, texture, and frequency); secondly, artificial intelligence based method (Neural Networks, Genetic Algorithms, and Fuzzy Logic); and the rest is combination of both of them. Mostly, holistic feature which was extracted by subspace, had been successfully implemented for face recognition such as face 987 recognition using PCA algorithm [12,13], LDA [13][14][15][16], DCT+PCA [13,15], and DCT+PCALDA [15,16]. Among them, the PCA and LDA are very popular because of not only their simpleness but also their easiness to be implemented. In terms of feature extraction, some techniques known as holistic feature, shape feature, and facial feature (eyes, nose, and mouth) extraction had been proposed and provided reasonable achievement. All of these techniques were widely implemented to determine the unique pattern of the object. The implementation example of holistic feature extraction techniques are content-based feature using frequency analysis (FFT, DCT, and Wavelet) and feature point descriptor using SIFT [13], [15][16][17]. In addition, the shape feature that is extracted by moment analysis could increase the discriminatory power of facial feature.
In this paper, the alternative solution of pornographic image recognition using skin probability and skin ROIs images is proposed to solve many obstacles faced in pornographic image recognition. In addition, this method is also proposed to improve the existing methods [1][2][3], [5] and will be implemented for rejection system of pornographic contents especially images and video both in standalone personal computer, tablet, smart phone and the internet from unexpected people.

Proposed Methods
The proposed pornographic image recognition algorithm is presented in the Figure 1, which consists of training and recognition processes. Both processes are constructed by preprocessing (histogram equalization and skin segmentation), eigenporn extraction using PCA and matching process using kNN sub processes.
The function of each sub-process of pornographic image recognition diagram block is described as follows: a) Histogram equalization is a process to remove non uniform lighting effect on image capturing which can decrease the large variability of pornographic images due to lighting variation. b) Skin segmentation is used to remove non skin pixel of the input images which can decrease the large variability pornographic images due to backgrounds. c) PCA is used to extract the eigenporn from skin segmented pornographic images called as skin ROIs images. In this case the output of this process in the eigenporn and the projection matrix which is needed in the matching process. d) The similarity between the query eigenporn and the training set eigenporn is determined by kNN algorithms.

Figure 1. Pornographic image recognition diagram block
In the training process, training set is normalized by histogram equalization, next the histogram equalization output is segmented to remove non-skin pixels, next from the skin ROIs images of training set, the eigenporns are extracted by PCA. While in recognition process, the query image is treated as the same as in the training process but until PCA projection process, next the similarity of query eigenporn and the training set eigenporn by kNN algorithms.

YCbCr Based Skin Segmentation
Skin is important information of pornographic images because mostly the pornographic images are covered by skin. Therefore, non-skin pixels have to be removed from pornographic images by segmentation algorithms. Commonly, the skin segmentation algorithm works using pixel-based skin classification. Several algorithms regarding to pixel based skin classification [5][6][7][8] have been carried out which define a pixels as skin or non-skin using threshold rules. The threshold rules were created based on the histogram information of colour space. For example, a pixel in RGB color space is defined as skin if it satisfies the following criteria [5,7]: The skin classification also can be performed in YCbCr color space. The most popular rule for skin classification in YCbCr color space is defined as follows [7]. As mentioned previously, these rules also defined based the histogram information of each color components. The pixel values of H, S, and V are in the range of 0-1, which are determined by the following equation [2]: The example of skin segmentation using the Equation (1), Equation (2), and Equation (3) are presented in Figure 2. From these algorithms, HSV had been implemented to segment skin color and to extract skin probability for pornographic image detection [2] and provided good enough performance. In addition, the YCbCr also has been implemented for skin segmentation and applied pornographic image recognition [5] and the YCbCr skin segmentation gave better performance. Therefore, in this paper, the YCbCr based skin segmentation is employed for extracting skin ROIs images of training and querying sets. The diagram block of ROI image extraction is shown in Figure 3. After skin segmentation, the ROI extraction is started from performing the vertical (rows) dan horisontal (column) projection probability to know the coordinates having large of skin and non-skin region. Secondly, the vertical and horisontal projection probability having less than a defined threshold is removed. In this case, by trial and error the best threshold can be defiend as 0.25 of maximum vertical and horisontal projection probability. Thirdly, the skin tone is cropped using the x and y coordinates where the vertical and horisontal projection probability are thresholded. Finally, the cropped skin tone is mapped to original image to get the skin ROI image.  Next, from the ROI image, the eigenporns are extracted by PCA for improving the skin probability (SP), skin region (SR) and fusion descriptor [FD] based pornographic image recognition. The main different of this PCA to that of Reference [5] is on its functionality. The traditional PCA was implemented for dimensional reduction of FD to decrease the time complexity FD based recognition system, while the PCA on this research is not only employed for dimensional reduction but also for extracting eigenporn and the holistic features of both training set and querying images. In addition, the main difference of our eigenporn to classical PCA is on determining the global covariance as shown in Equation (9), which does not using the

Eigenporn Extraction
Suppose, there are two data classes (porn and non-porn) denoted by X 1 and X 2 . The X 1 has N 1 images and X 2 has N 2 images. In this case, the images are the ROIs having different sizes. Therefore, the ROIs have to be normalized the size to be 64 pixels with keeping the aspect ratio. The ratio is defined as 64 divided by max of image width and image height (64/max(imWidth,imHeight)). By resizing the image using the defined ratio, if the input image width is wider than the height, the image width is resized into 64 and the image height follows the ratio, and vice versa. From these data, the eigenporn is extracted as follows.
Step 1. Converting each image of the data classes into column vector using row-ordering process.
Step 2. Resizing the column vector into size 4096 elements by zero padding in the end of elements the vector to provide the same vector size for PCA. For instance, the zero padding is done from index 4032 to 4095 of input ROI having 64 x 63 pixels to reach defined column vector 4096 elements. In this case, assuming the index is started from 0 Step 3. Determining the mean of each data class and mean of all data samples using Equation (7) and (8), respectively.
∑ , k=1, 2 ∑ ∑ Step 4. By using the mean of each class ( k ) and data classes, the global covariance matrix (C g ) is calculated by Equation (9).
Step 5. Performing the eigen analysis of C g for obtaining projection matrix, W, using the Equation (10).
 , i = 1, 2, 3, … , n ( 1 0 ) The w i and λ i is the i-th eigenvector and eigenvalue of C g respectively. While n is the number of eigen values which is almost the same as dimensional input vector.
Step 6. Selecting small number of eigenvectors (m) representing eigenporn of data classes and put them into matrix W =[w 1 ,w 2 ,w 3 ,…,w m ] n x m which have to satisfy the criteria as presented in Euatiuon (11).
In order to satisfy this criteria, small m eigenvectors which correspond to the largest eigenvalues (i.e. m<n) are selected as eigenporn.
Step 7. Projecting the each input vectors using obtained eigenporn as holistic feature that can be performed by Equation (12): Step 8. Save selecting eigenporn and projection vector for recognition process.
The example of eigenporn that is extracted by this algorithm is shown in Figure 4. In this case, the input data classes are 687 pornographic images and the selected eigenporns are 18. Theoretically, eigenporn extraction using PCA is lack of the power discriminatory compare to LDA (Linear Discriminant Analysis) for large sample size data. It also requires retraining of all samples to obtain the most favorable projection matrix. However, the data of this research have two classes (porn and non-porn), the power discriminatory does not give much effect to recognition performance. The small sample size data, the between class scatter matrix of LDA close to or be singular, which means the projection matrix is not optimum or cannot be obtained by eigen analysis.

Matching Process
The matching process is performed by k-nearest neighbors (kNN), which can be illustrated using Figure 5. Suppose we have two classes (A and B) represented by blue delta (∆) and red square ( ), if the query (green diamond,) enter to the system the distance between the query and the training class are determined by Euclidean distance. When the k parameter is 3, the query is concluded as class B, because the nearest neighbor probability to class B is hihger (2/3) than to class A (1/3). However, if the k parameter is set-up by 7, the query is concluded as the class A because the nearest neighbor probability to class B is less (3/7) than to class A (4/7).

Results and Analysis
Several experiments were carried out to know the performance of proposed method using dataset consisting of 1400 images [5,19]. This dataset is composed of 687 pornographic images and 715 non-pornographic images, which were downloaded from the internet using downloader tools. The pornographic images contain naked single, couples, triples persons showing human body genitals and sexual activities. The pornographic images are mostly females and some of images have skin like backgrounds such as sand, wood, etc. While nonpornographic images contain objects that are similar to human skin such flower, wood, tiger, dessert, etc. The experiments were performed under the following circumstances [5]: 1) 50% of each pornographic and non-pornographic images were randomly selected as training set, 2) testing images were overlapped with training set, because the testing images highly come from the same person as the training set. 3) the accuracy, false negative rate (FNR), and false positive rate (FPR) parameters were used for performance indicators, and 4) the evaluation was carried out on pc with specification Intel Core i3-2370M, 2.4 GHz, 8 GB RAM. The accuracy, false negative rate (FNR), and false positive rate (FPR) were calculated using the following formula:

100%
( 1 5 ) Where the TP (true positive) is the pornographic testing image that is truly recognized as pornographic image, TN (true negative) is the non-pornographic testing image that is truly recognized as non-pornographic image, FN (false negative) is the pornographic testing image that is falsely recognized as non-pornographic image, FP (false positive) is the nonpornographic testing image that is falsely recognized as pornographic image, N P is total of pornographic testing images, and N N is total of non-pornographic testing images. The first experiment was performed to find the best k parameter of kNN for the proposed method. The experiment was done using 18 eigenporns and the 0.15 skin probability threshold, which means that the images having skin probability less than given threshold were concluded as false detection data. The experimental data ( Figure 6) show that the best k parameter of kNN for performing the recognition is 9 which is indicated by the highest accuracy (86.99%) and smallest FPR and FNR (18.81% and 9.05%, respectively). This k parameter is implemented for the performing the further evaluation to prove that the eigenporn can be used for recognizing the pornographic images.
The second experiment was performed to find the best number of eigenporns of PCA that is suitable for the recognition. In this case, the skin probability threshold and the k parameter of kNN were setup 0.15 and 9 respectively. The experimental data show that the best numbers of eigenporns that is suitable for performing the recognition is 20 eigenporns, which are shown by high enough accuracy and small FPR and FNR (87.95%, 13.71%, and 10.33%respectively), as shown in Figure 7. From this achievement, the 20 eigenporns and k=9 will be used for further performances evaluation in the next experiments. The third experiment was carried out to know the effect of skin probability threshold to pornographic recognition performance. In this case, the experiment was done using the same data set as in the first and second experiment, k=9, 20 eigenporns of PCA, and the same performance indicators. The experimental results show that the best threshold of skin probability that provide high accuracy and small false recognition rate is 0.15. By using this skin probability threshold, the proposed methods provide accuracy by about 87.02% and FPR and FNR by about 14.13% and 11.79%, respectively (see Figure 8). These results support that the eigenporns from PCA of YCbCr ROIs images is reasonable method for recognizing the pornographic images. In addition, from the first and second experiments achievement (20 eigenporn and skin probability 0.15), the next experiment is performed for knowing the further performances.
The fourth experiment was carried out to know the performance of the proposed algorithm compared to the existing methods (skin probability (SP), skin region (SR), fusion  [1][2][3], [5], and eigenporn of HSV skin segementaion image [16]. In this experiment, k=9, 20eigenporn features and 0.15 threshold of skin probability were employed. The experimental results ( Figure 9) show that proposed method tends to provide better performances than all existing methods. In detail, the accuracy of proposed method increases by about 4% (from 84 to 88%) and decreases the FNR 20.6% (from 28.8 to 8.2%) of those of the best method (FD on YCbCr), respectively. However, the FPR increases by about 12.9% of that of FD method. The accuracy increment and FNR decrement are higher than FPR increment, which means that the proposed method still gives better performance than that of FD method [5]. It can be achieved because the eigenporn of skin ROIs images provide holistic information of pornographic data class which is represented by some eigenporns (see Figure 4).
In addition, the holistic information its self does not only come from eigenporns but also come from skin information, which are represented by skin ROIs images. It is known from the experimental results that the accuracy of the proposed method is higher than that of without skin probability (SP), and the FNR and FPR is less than those of without SP, as shown in Figure 10. From these performances, it can be concluded that the proposed method is alternative solution for pornographic image recognition.  The fifth experiment was done to know computational time of the proposed method compare to that of existing methods. The computational time is one important parameter for evaluations. It means the best recognition system must be shown by the highest accuracy, the smallest FNR and FPR, and the shortest computational time for recognition. The ideal system must have 100% of accuracy, 0% of FNR, 0% of FPR, and almost 0 seconds computational time. In this case, the computational time is defined as the time that is required for classifying the input image starts from loading the input image. The experimental results shows that the proposed method needs much less computational time than FD method [5] and almost as fast as SP and SR based methods (see Figure 10). It means that the proposed method gives not only high enough accuracy and small FNR and FPR but also needs short computational time (0.12 seconds). This achievement also supports the previous achievements that proposed method is alternative solution for pornographic image recognition. In addition, the proposed method also an improvement of the FD-based pornographic image recognition which can improve the accuracy, false recognition, and computational time.
In order to know the robust performance of our proposed method over large variability pornographic images, the last experiment was carried out on large size dataset [11,18] and using the best variation of eigenporns. This dataset consists of 18354 images which 9295 and 9059 images are pornographic and non-pornographic, respectively. The images of this dataset were also downloaded from Internet using some downloader tools. The pornographic images of have large variability in terms of people, pose, skin. Similar to UNRAM dataset [5,18], the nonpornographic images contain objects which are skin like such as flower, wood, tiger, dessert, etc. The training images also setup the same as carried out in the Reference [11]. The experimental result indicates that our proposed method tends to give almost the same achievement as the latest existing method (MP+NF) about almost 90.13% of accuracy, 4.93% and 14.61% of FPR and FNR, respectively, as shown in Figure 11. It re-proves that the proposed method can give good enough achievements and the eigenporn of YCbCr skin ROI image is suitable concept for recognizing pornographic images. These can be achieved, because the eigenporn provides holistic information of pornogpahic image such as genital information, sexual activityies, etc as shown in Figure 4.

Conclusion and Future Works
The proposed method can improve the existing methods of pornographic image recognition such as skin probability, skin region and the fusion descriptor. This method is alternative solution for developing the rejection of pornography images. The holistic features that is extracted by eigenporns of skin ROIs images is suitable features concept for pornographic image recognition. It is known by better accuracy and less FNR and FPR than existing methods. In detail, the proposed method increases the accuracy of the latest existing method (FD) by about 4.0% and decreases the FNR and computational time by about 20.6% and 208 milliseconds, respectively. However, the FPR increases by about 12.9%. In addition, the proposed method has almost the same performace as MP-NFfor large size dataset.
This method needs to be improved by adding not only ROIs images from intensity components but also from the chrominance component such as Cb and Cr components in order to increase the accuracy.