Integrated artificial intelligence algorithm for skin detection

The detection of skin colour has been a useful and renowned technique due to its wide range of application in both analyses based on diagnostic and human computer interactions. Various problems could be solved by simply providing an appropriate method for pixel-like skin parts. Presented in this study is a colour segmentation algorithm that works directly in RGB colour space without converting the colour space. Genfis function as used in this study formed the Sugeno fuzzy network and utilizing Fuzzy C-Mean (FCM) clustering rule, clustered the data and for each cluster/class a rule is generated. Finally, corresponding output from data mapping of pseudo-polynomial is obtained from input dataset to the adaptive neuro fuzzy inference system (ANFIS).


Introduction
One of the unique features of humans is the skin.In several fields, skin detection has applications including identity confirmation and identification based on military and security applications, facial characteristics, camera remote control, video conferences, skin tracking in video, information access, managing pictorial information in banks and so on.This paper explores ANFIS algorithm to detecting skin from nonskin instances.Fuzzy neural networks and systems are generally known estimators that estimates any given non-linear function with intended accuracy under the condition of the presence of sufficient neurons in the middle layer and fuzzy rules.Recent studies in the field of fuzzy systems and neural networks indicate that the combination of these two methods can be very effective in nonlinear systems identification.
ANFIS structure works by integrating adaptive neural networks and fuzzy logic parameters which can be set based on the input and output data to model the systems [1].The basic principle used in training the adaptive networks is the rule of reducing gradient.Using gradient reduction alone is not desirable due to the slowness and tendency of the local minima to set network parameters.However new hybrid methods that are the result of combining gradient reduction and other similar methods lead to increased speed of least square error (LSE).Fuzzy modeling and detection was earlier analyzed by Takagi-Sugeno and obtained practical applications in the field of control, detection and prediction.Adaptive neuro fuzzy inference systems works by combining fuzzy structures with artificial neural networks that are used to detect systems, predict time series and other various cases.There is a high level of uncertainty to achieve the desired automatic segmentation in each image segmentation layout.This fact also can be extended into face detection especially skin color segmentation.Therefore, fuzzy theory is a good way to achieve the basic detection because fuzzy model provides a mechanism that presents image uncertainty.According to the fuzzy rules extracted from different color spaces used in training phase, each pixel can be divided into the skin or non-skin pixels.One of the features of pixels-based color is that it required no space ground, therefore fixed and fast orientation and size for processing, detection and tracking applications such as detection of specified body parts of human, nudity detection and detection of face; all of which benefits from skin detection.Moreover, detection of skin color helps to block the abusive image or video content.In addition to its use in computing, color of human skin color plays a vital role in human and human relationships.
Dealing with black and white colors does not provide any satisfaction with image.Projecting the degree of membership is a new way to solve the problems and issues to deal with vague fuzzy data or in a fuzzy form through which the fuzzy systems are allowed to control certain random levels without causing damage and endangering performance to the system.Fuzzy neural system is one of the most tangible and most successful aspects of this effort.Linking and fuzzy neural system integration could be performed in two ways: a fuzzy system augmented by a neural network to promote some of its features such as speed, flexibility and the ability to adapt known as neural-fuzzy system NFS or ANFIS an equipped neural network with the ability to handle and control fuzzy information (fuzzy neural network).The design of adaptive neural-fuzzy system is orchestrated to induce the fuzzy reasoning processes where network connections are consistent with the parameters of fuzzy reasoning.Using fuzzy clustering for color image segmentation [2]  based on pixels, where the fuzzy system determines each pixel belongs to which category.Therefore, the purpose is to create a fuzzy system that can classify more colors.To do so, an expert is required to sets the rules and membership functions according to the training data which is very time-consuming and cumbersome and the final rules might not be the best ones.Therefore an automatic method is required to create fuzzy rules and membership functions according to the training data.Many techniques have been developed for this purpose.In this article ANFIS method has been devised to produce membership functions and fuzzy rules automatically.The main advantage which provides explicit meaning for skin models is their simple decision making rules and integrating them with the main advantages of nonparametric skin models that is; having lower decision making time for training and clustering.In order to perform this method a fuzzy model for detecting skin in color images is presented.

Related works
The three primary colors corresponding to RGB are: red, green and blue, respectively.The RGB color components are normalized to reduce the dependence on lighting so that, sum of the normalized components is unity i.e r + g + b = 1.The third component does not hold any significant information since the sum of these components is 1 and is normally dropped for dimensionality reduction purposes.Under certain assumptions, it is observed that the differences the skincolor clusters in RGB space have relatively lower variance than the corresponding clusters in RGB therefore, are demonstrated to be useful for detection and modeling of skin color [3,4].Regarding the advantages mentioned above, a popular choice for detection of skin is the RGB and has been utilized by Brown et al. [5], Oliver et al. [6], Caetano and Barone [7], Bergasa et al. [8], Kim et al. [9], Sebe et al. [10], Soriano et al. [11], Schwerdt and Crowley [12], Wang and Sung [13], Storring et al. [14], Yang and Ahuja [3], Iraji [15] and Yang et al. [4].Commission Internationale de l'Eclairage (CIE) system describes a luminance component Y as color, and other two components X and Z.The values of CIE-XYZ were constructed from psychophysical experiments and correspond to the color matching characteristics of human visual system.It is confirmed that Chen and Chiang [16], Brown et al. [5] and Wu et al. [17] used this color space.As described by Lior Shamir [18], a human perception based approach is linked to segmentation of pixel color.The H, S and V components defines fuzzy sets of the HSV color space and generate a model of fuzzy logic that aims to follow the classification of color based on human intuition.Simple modification of the classification by knowledgedriven model based on needs of a specific application and the efficiency of the algorithm in terms of the computational complexity makes the proposed method suitable for applications where efficiency is a primary issue.M. Hamidi and A. Borji [19] using fuzzy logic, have proposed a new method for color image segmentation where they automatically produce a system for classification of color and segmentation of image with minimum error rate and least number of rules.To find optimal membership functions and fuzzy rules, a comprehensive learning particle swarm optimization technique is used as it discourages premature convergence.Compared to other approaches such as ANFIS, less computational load is needed when using this method.Variety of large train data set makes the proposed algorithm invariant to noise illumination.
Rajen Bhatt, Abhinav Dhall, IIT Delhi first compiled this dataset in 2009 [20] where they published a paper titled "efficient skin region segmentation using low complexity fuzzy decision tree model" in the Indian IEEE conference known as INDICO1.Same researchers published a paper titled "adaptive digital makeup" in the same year in the international symposium on visual computing (ISVC).Leonid Sigal et al. [21] in real time systems and video conferences put forward a novel method for skin segmentation.Despite the great variety of skin types this segmentation enjoyed a fairly reliable performance.Even in brightness changes, this approach was effective.Furthermore, the Markov's method is used in this study [22].An algorithm for segmentation of skin region in color images using edge and color information was presented by Bouzerdoum.Historically, the skin color regions were used for detection of human skin color using Bayesian model [23].Considering high processing speed, Rodrigo Verschae et al. performed segmentation of skin regions by examining the closest pixels [24].A new method to solving the segmentation of skin problem was designed by Junwei Han et al. [25].At first, given a gesture of video sequences, a general skin model was developed.The data were automatically gathered from several frames.Conclusively, an SVM classifier was utilized for the detection of skin pixel on active learning basis [25].In [26], Mohammad Shoyaib et al. performed detection of skin utilizing color distance map.Moreover, a novel recognition technique of the face was introduced; a hybrid of main components analysis and skin color segmentation known as SCS-PCA [27].In [28], K. K. Bhoyar et al. used a classification method known as novel neural network symmetric to detect pixels of skin from non-skin ones in color images.Methods of data mining such as k-means were as well utilized for detection of skin and worthwhile results were obtained as demonstrated in [29].In this study [29], Hamid A. Jalab using a cluster pixel model designed segmentation of skin under specifiable environmental conditions.This proposed model can overcome the changes in complex backgrounds and sensitivity to brightness conditions [30].In [31], P. Kakumanu et al. presented modeling and detection of skin and this is recommended for further study.In conclusion, associated with the current issue, the most outstanding results is obtained using fuzzy system combined with support vector machine (FS-FCSVM) [32].3 Skin detection using ANFIS Adaptive Neuro Fuzzy Inference Systems (ANFISs) as explored in this paper is a rule and knowledge based system.ANFIS focal point is the knowledge base that is made up of the if-then fuzzy rules.Convincingly, if-then expression is simply the if-then fuzzy rules which are specified by a continuous membership function [33,34].In this paper, we explored ANFIS algorithm.An algorithm is the basic component of any intelligent system.An algorithm processes and generates knowledge from data [35,36].Creating systematic algorithmic models encompasses many steps.The first step is data preprocessing which is an important step in data mining; it filters and makes data ready for operations.Analyzing unfiltered data can generate inappropriate model or misleading results.Hence, the representation and quality of data is first and foremost before further analysis and classification.The second step as featured in this paper is feeding the processed data onto the classifier; ANFIS models.This paper proposed an intelligent ANFIS for detection of skin from nonskin.This proposed algorithm is capable of detecting skin by taking mixture of RGB color space of both skin and nonskin pixels.The design stages of ANFIS are studied and implemented in this section.Beginning with the dataset, the data matrix with dimensions utilized by the algorithm is of 4*245057 (four columns and 245057 rows) where the first three columns represents R, G, and B i.e X1, X2, and X3 features and the fourth column represents the class labels; 1 for skin and 2 for non-skin.Here, detection of skin from nonskin is carried out by introducing the three R, G, and B components onto the model.Considering the extremely large number of rows, the holdout cross validation technique was explored to randomly sample the dataset into training and test sets, to minimize the biasness of the model.For high performance accuracy to be obtained, the dataset were normalized/rescaled to the range of [0, 1].For higher system flexibility, MATLAB R2015a was used for designing and implementing the ANFISs.Figure 1 below demonstrates the framework flowchart.

Fig. 1. Flowchart of the framework
The ANFIS morphology used in this study is made up of five layers of nodes from which the first and the fourth layers composed of the adaptive nodes having defuzzification and fuzzification incorporated, while the second, third and fifth layers comprise of fixed nodes with rule, neuron summation and normalization incorporated.Moreover, in subsequent iterations, the adaptive nodes are linked with their respective parameters constantly updating each node, and all other parameters are devoid by the fixed nodes.Architecture of the ANFIS was built on two fuzzy if-then rules using the first order Sugeno model as also demonstrated in [37][38][39].
First Rule: If (x is A 1 ) and (y is B 1 ) then (f 1 = p1x + q1y + r1) Second Rule: If (x is A 2 ) and (y is B 2 ) then (f 2 = p2x + q2y + r2) From the above two fuzzy rules, X and Y are predefined membership functions, B i and A i are membership values, q i , p i , and r i are consequent parameters constantly updated in the forward pass in the learning algorithm and finally, f i are the outputs.The implemented ANFIS architecture displaying those two fuzzy rules is depicted in Figure 2 where a square represents an adaptive node and a circle represents a fixed node.• Layer 1 represents the fuzzification layer where every node i in the layer is an adaptive node.Outputs of this layer represents the fuzzy membership grade of the inputs given by: Where y and x are the inputs to node i, A is a linguistic label; small, large and μ Ai (x), μ Bi -2 (y) assumes all fuzzy membership function.μ Ai (x) was chosen to be bell-shaped with maximum equal to 1 and minimum equal to 0, so that: From equation 3, a i , b i and c i represent the membership function parameters.Here, parameters are referred to as premise parameters.
• Layer 2 represents rule layer having a fixed node whose output is the product of all the incoming signals.Layer 2 output is depicted thus: • Layer 3 represents the normalization layer having a fixed node represented by circle node: • Layer 4 represents the defuzzification layer having an adaptive node.Each node's output in this layer is simply a first order polynomial and the product of the normalized firing strength as shown in equation 6: • Layer 5 represents the Summation neuron having a fixed node computing the overall output as the summation of all incoming signals as demonstrated below: This Hybrid technique; neuro-fuzzy brings learning capabilities of neural networks to fuzzy inference systems.Where the membership functions of the Sugeno-type fuzzy inference system are fine-tuned by the learning algorithm using the training input and output data, checking input and output data; to minimizing over-fitting and finally a back propagation algorithm in combination with a least squares type of method.The proposed ANFIS classifier is presented as dermatologist's diagnostic tool in analyzing human skin as well as identifying skin from nonskin.It uses a hybrid approach of adaptive neuro-fuzzy inference system comprising two intelligent techniques; neural network (NN) and fuzzy inference system (FIS) to obtaining good reasoning in quantity and quality.That is, it is programed using NN and Fuzzy reasoning calculations.
In this paper, the classification objective is to classify skin from nonskin in a given dataset.The feature vectors extracted from RGB colour space were used as the input to the ANFIS model.Afterwards, a smaller number of iteration steps were converged using ANFIS; the hybrid learning algorithm.As depicted in figure 2, implementation of the ANFIS networks has a total of 8 fuzzy rules for experiment 1, 27 fuzzy rules for experiment 2 and 1 target for the two experiments.The ANFIS classifiers used Gbell membership functions (MFs).Choice of membership function selection is basically dependent on the user's application since there is no rule/regulation in choosing them.Here, the general ideal would be to use minimum training parameters to generate the best smallest error measure.Accepted error measure virtually determines the number of epochs fixed by the user.In this paper, 100 epochs was fixed for Experiment 1 and 2. First and second experiments resulted to 89.40% and 90.10% respectively.Results of the proposed experimental models are extensively depicted in table 1. skin from nonskin.Our proposed algorithm is capable of simulating human knowledge and experience from complex decision makings using approximate information and in environments with uncertainty.The explored approach operates in accordance with particular characteristics for detecting human skin from nonskin.Considering the input data, detection is categorized as very low, low, median, and high.Regarding the obtained results from the two experiments, second experiment with 90.10% accuracy outperformed first experiment having 89.40% accuracy.A dermatologist at the prestigious Near East University Hospital-Cyprus considered this result to be worthwhile.Interestingly, between the two experiments; Experiment 1 having low fuzzy rules and Experiment 2 with high fuzzy rules, it was recorded that Experiment 1 having low fuzzy rules was outperformed by experiment 2 having high number of fuzzy rules.The experimental results show that the high number of fuzzy rules used in Experiment 2 actually boosted the performance of the system by increasing the performance accuracy by 0.7%.Observations from this experimental results proved that it is totally advisable to use moderately high number of fuzzy rules in ANFIS computation since further increase of the number of rules would result to reasonably high classification and performance accuracy.Furthermore, we are of no claim that our proposed system has the best performance ever.To improve on the performance, future contributions to this problem would feature the repetition of the experiment using other machine learning techniques such as co-adaptive neuro-fuzzy inference system (CANFIS), extreme learning machines (ELMs), deep learning and support vector machines (SVMs) to obtaining more optimal results.

Fig. 2 .
Fig. 2. Architecture of the ANFIS From the above ANFIS structure, is one of the methods of segmentation

Table 1
above demonstrates the experimental results.In both experiments, every other parameter was left constant except number of fuzzy rules.In Experiment 2, the number of fuzzy rules was increased from 8 to 27 and this raised the recognition rate from 89.40% to 90.10%.The result of these experiments generates a conventional rule; increase in the number of fuzzy rules increases the performance of the ANFIS technique.Figure3depict error tolerance curve for Experiment 2 (model having the best performance accuracy).