Applying Different Pattern Recognition Methods for Identifying Skin Diseases

According to the WHO (World Health Organization) (2015), cancer is the first or second major cause of death before the age of 70 in 91 of 172 countries, and it is ranked third or fourth in 22 other countries. In 2018, out of 1042056 new non-melanoma skin cancer cases in the world, 6.25% of them had been reported to have died. The most effective method to reduce disease mortality is early diagnosis, which requires a precision and reliable diagnosis. Automatic diagnosis is speedy and far from human error and reduces the workload and warns about patients who need more attention, and allows physicians to focus on diagnosis and prognosis. For automatic classification, six K-NN methods, weighted K-NN, Bayesian, perceptron artificial neural network, RBF neural network, SVM are used, and the results of the correct classification rate are compared. Then the correct classification rate is significantly increased using the FDR formula and genetic algorithm. RBF, perceptron artificial neural network, and weighted K-NN methods had the best precision of classification, respectively. After applying the genetic coefficients, RBF weighted K-NN and K-NN methods are reached to a precision of 100%. After them, SVM and perceptron artificial neural network methods are reached to a precision of 99%.


Introduction
The skin is the largest organ in the body. The skin protects against heat, sunlight, damage, and infection. It also helps control body temperature and stores water, fat, and vitamin D. The skin has several layers. However, the two main layers are the epidermis (top or outer layer) and the dermis (bottom or inner layer). Today, skin diseases are widespread. Some of them are simple and easy to treat, but some are very harmful and may not cure them. Therefore, this important organ in the body should be taken care of. Diagnosis of skin diseases is very complex, especially when the symptoms of more than one disease are almost the same.
Therefore, a dermatologist with a wide range of skin diseases experience is needed. According to the WHO (2015) estimates, cancer is the first or second leading cause of death before the age of 70 in 91 of 172 countries, and in 22 other countries, it is ranked third or fourth. The outbreak and mortality of cancer in the world by continents are as follows [1,2]: The main types of skin cancer are SCC, BCC, and melanoma. Squamous Cells (S.C.s): The thin, flat cells make up the top layer of the epidermis. Cancer that makes in S.C.s is called SCC of the skin.
Basal cells (B.C.s): These cells are round cells beneath S.C.s. BSC is carcinoma in stem cells.
Melanocytes: It is found in the lower part of the epidermis; these cells make melanin, a pigment that gives the skin its natural color. When the skin is exposed to the sun, melanocytes produce more pigment, causing the skin to stain or darken. Cancer that makes in melanocytes is called melanoma. Melanoma is much less common than other types but is much more likely to attack the surrounding tissue and spread to other parts of the body. Most deaths from skin cancer are due to melanoma "figure 1a".
BCC and SCC of the skin are also called non-melanoma skin cancer and are the most common skin cancer forms. Most BSCs and SCCs are curable. Melanoma is more likely to spread to surrounding tissues and other parts of the body and is more difficult to treat. Melanoma becomes easier if the tumor is found before it spreads to the dermis (the skin's inner layer). Early diagnosis of melanoma and early treatment reduces the likelihood of mortality [1,3].
The most effective method to reduce mortality from disease and cancer is to diagnose it early. Early diagnosis requires an accurate and reliable diagnosis. Besides, the non-automatic diagnosis will be very time consuming, tedious, and associated with human error, so the use of machine learning tools in medical diagnosis is gradually increasing. An automated diagnostic computer system allows physicians to focus on diagnosis and prognosis by reducing workload and alerting patients who need more attention. In this paper, 4 data classes are classified: melanoma, eczema "figure 1b", psoriasis "figure 1c", and healthy. By using image processing on skin images forty-eight features were collected from each class include 64 sample. KNN, Bayesian, neural networks, and SVM have been used to analyze and classify these diseases.

K-Nearest Neighbor
K-NN algorithm is widely used in pattern recognition and data mining for classification due to its simple implementation and outstanding performance. The main idea of the standard K-NN method is to predict the label of a test data according to the law of majority so that the Euclidean distance of the test data from the training data is calculated and the test data class is determined based on the class with the largest number of neighbors [4].
Steps of identifying and determining the class in K-NN method: Creating training and test data Calculating the Euclidean distance Specifying the class of neighbors with a short distance Determining the maximum class as the test data class End of classification Calculating the correct classification rate The end In this method, the correct classification rate of 87.5% in 160ms has been calculated, and also in the number of different neighborhoods is calculated as follows.

Weighted K-Nearest Neighbor
First, a weighting method is introduced for K-NN, which is called the weight distance of k of K-NN. Using the weight distance function, more weight is allocated to closer neighbors than farther neighbors.
Weight w i for the i th nearest neighbor: Which is data for weight change and is the weight training data of class i. In other words, the class can be defined by the following relation. Then weighted majority of the neighbors then determines the classification result. In the conditions of Equation 1, one of the values will be one or zero.
According to (1), it can be seen that a neighbor at a close distance has more weight than farther distance. The nearest neighbor weighs 1, and the farthest neighbor weighs 0, and the other neighbors are divided linearly between them.
This method, was used in data classification and the correct classification rate 92.26% in 250ms has been calculated [5].

Bayesian Method
In the Bayesian method, according to the Gaussian distribution for all data in each class, based on the density function, the probability of each class is calculated By calculating the mean values and the variance of features of each class. The probability of attendance of test data in each class is calculated. The class of test is selected as the class that has shown the highest probability [6].
Steps of identifying and determining the class in Bayesian method [6,7]: Putting test samples in the Gaussian Equation Calculating the probability function of each test sample Determining the class with the highest probability of attendance for the test data The end and calculating the correct classification rate In this method, the correct classification rate 91 in 110ms has been calculated.

Perceptron Artificial Neural Network
Artificial neural networks that are (a very popular classification method) (neural network inspires the learning technique in the human brain.) After processing with the inputs of the neurons of the previous layer, this network sends the weight values of each of the artificial neurons as output to the next layer. This change in weight between the neurons minimizes the error. An important issue in this network is determining the number of layers and the number of neurons in the hidden layer and its relationship. These issues and parameters have a significant effect on neural network performance. The results may be very different in each of these parameters. Different architectures will have different results for different problems. However, achieving a desirable architecture with trial and error is very important. The training data set were used to determine the bias and weight values.
The training is iterated to obtain the lowest level of error by changing the number of iterations and neurons. The trained algorithm is then used on the test data set [8,9].
The perceptron neural network algorithm for the data set in this paper is designed according to the figure 3.
A graph called the regression line is drawn using the confusion matrix, which shows the correct classification rate. This graph includes bisector of the first and third quarters, and according to the number of data classes used, it will have the number of classes that in this article will have numbers from 1 to 4 in each axis so that each detected class is compared to the real class and is marked at the same point. If the correct classification rate is 100%, all marks will be on the bisector of the first and third quarters. If the points are outside this line, it indicates that the correct classification rate is not 100% [10].  The correct classification rate of 99.72% in 360 ms has been calculated by the perceptron neural network.

Radial Basis Function
RBF neural network is one of the types of artificial neural networks with its own advantages, including approximate capabilities, simpler network structures, and faster learning algorithms. The RBF network is a fully connected three-layer network forward, which uses RBFs as the only nonlinearity in hidden layer neurons. The output layer is nonlinear, and the output layer connections have weights, but the connections from the input to the hidden layer have no weight. Due to better capabilities, simpler network structures, and faster network learning algorithms have wide applications in engineering sciences and disciplines. RBF neural networks are based on interpolation. Theories consist of three leading layers. The first layer receives a vector and propagates to the middle layer, which is made up of neurons that use RBF. The output is received in the last layer [11,12].
The RBF neural network error can be seen in the "figure 5" which after performing 130 Radial Basis functions for its layer the error value for this number of function is almost zero and does not need to be iterated. The correct classification rate with this neural network of 100% in 14.36 s has been calculated.

Support Vector Machine Neural Network
SVM is a powerful data classification tool that tries to find a linear separator between data so that it has the greatest distance from all classes. This method is used for data of two classes, and for data in more than two classes should be calculated in pairs [11,13].
In the above equation, w and b represent the gradient and the distance of the line from the origin point, respectively. The central divider line can be described by the following equation (5): Instead of using this line in SVM, two parallel lines to create a more secure boundary with equation are described (6) and (7): Considering the data, we will have +1 and -1 in two classes: If < =-1 = + +b<-1 (9) According to " figure 6" the distance of two parallel lines from the midline is called d 1 and d 2 . The best way to separate classes is to have two equal distances d 1 =d . 2 The best case for separating classes will occur when d 1 =d . 2 By doing calculations we have (10): By decreasing the value of w, the separator distance between the lines will increase, so the objective function for minimization can be expressed as follows (11): Which ? is known as the Lagrange coefficient. After solving the above equations, the values of b and w are presented with equations (12) and (13), respectively: w=∑ ? < (12) 9 < ; + 9 &$ " 9 (13) As mentioned the SVM method is actually a binary classification, while most of the topics like the dataset in this article are related to the multi-class classifiers. In such cases, a multi-class problem can be reduced to several binary cases, and a multi-class problem can be solved by comparing pairs of classes and combining their outputs. [13,14] By using this method, the correct classification rate of 73.21% in 190 ms has been calculated.

Fisher's Discriminant Ratio
Assuming a Gaussian distribution for natural class sample data, FDR can be used to determine the degree of class discrimination from each other and the effect of each feature on the degree of this discrimination and the possibility of combining features for better discrimination.
In order to better discriminate the classes, the common area between the classes should be as small as possible. The greater the difference between the mean classes and the smaller the variance of the classes, the smaller the common area and the better the discrimination of the classes. Unknown coefficients are considered for data features and the values of these coefficients are determined using optimization algorithms in a way that maximizes FDR. For a four classes problem, FDR can be defined as follows [15]: That a is a matrix of unknown coefficients of class features.

Genetic Algorithm
A genetic algorithm is an optimization algorithm whose strategy is inspired by observation principles in natural evolution. The search technique is to find an approximate solution for optimizing models, math, and search problems. A genetic algorithm is a special type of evolutionary algorithm that uses evolutionary biology techniques such as inheritance to find the optimal formula for prediction. The problem to be solved has inputs that are transformed into solutions in a process modeled on genetic evolution. Solutions are then evaluated as candidates by the fitness function, and the algorithm terminates if the exit condition is met. In general, it is an iteration-based algorithm that most of its parts are selected as random processes that these algorithms consist of parts of the fitness function, display, selection, and change. This algorithm results in the least optimal solution by solving the problem. First, FDR is considered as a target function, and since it will find the minimum genetic algorithm, the FDR formula should be considered in reverse.
The steps of the genetic algorithm are as follows: [16] Start Selecting the initial population Iteration Evaluation of the fitness function concerning the population Selecting better answers to reproduce the population Iteration of this process until the optimal answer has resulted The end By defining the fitness function of the genetic algorithm as follows, minimizing the function leads to maximizing the FDR.
Fitness function= OPQ (15) After applying the genetic algorithm and maximizing FDR, the coefficients of the feature are calculated as follows: After calculating the coefficients, again to test classification methods with new datas. The CCR results are presented in Table 3. These results show that the genetic algorithm is effective on all methods and the three methods of K-NN, weighted K-NN, and RBF neural network reached 100% accuracy.

Conclusion
Since automatic diagnosis is much faster and more accurate than non-automatic methods, and on the other hand, early diagnosis of these diseases will reduce the mortality rate. In the automatic diagnosis method, the workload is reduced, and the accuracy is significantly increased.
In this article, skin diseases classify using K-NN, weighted K-NN, Bayesian, neural networks, and SVM methods. The best results were RBF neural network, perceptron neural network, weighted K-NN, Bayesian method, K-NN, and S. V., respectively. Then, using a genetic algorithm and applying coefficients for the features, the correct classification rate was increased, which RBF neural network method and K-NN, weighted K-NN, perceptron neural network, SVM, and Bayesian had the correct classification rate, respectively. The genetic algorithm has the highest increase in the correct classification rate in the SVM and K-NN methods. In the classification of classes, the RBF neural network's correct classification rate reached 100%. After applying the genetic algorithm's coefficients, RBF neural network, weighted K-NN, and K-NN reached the correct classification rate of 100%.
In article 15 of the Hindawi journal using the SVM method and image features of skin diseases of herpes, dermatitis, psoriasis is classified into three classes. The classification accuracy of each class is separately calculated 85%, 90%, 95%, respectively. On average, the correct accuracy of classification can be considered 90% [17]. In this article, using the SVM method, the correct classification rate was first calculated 73%, and after applying genetic coefficients, it was calculated 99%.