Developing a Recognition System for Diagnosing Melanoma Skin Lesions Using Artificial Intelligence Algorithms

In recent years, computerized biomedical imaging and analysis have become extremely promising, more interesting, and highly beneficial. They provide remarkable information in the diagnoses of skin lesions. There have been developments in modern diagnostic systems that can help detect melanoma in its early stages to save the lives of many people. There is also a significant growth in the design of computer-aided diagnosis (CAD) systems using advanced artificial intelligence. The purpose of the present research is to develop a system to diagnose skin cancer, one that will lead to a high level of detection of the skin cancer. The proposed system was developed using deep learning and traditional artificial intelligence machine learning algorithms. The dermoscopy images were collected from the PH2 and ISIC 2018 in order to examine the diagnose system. The developed system is divided into feature-based and deep leaning. The feature-based system was developed based on feature-extracting methods. In order to segment the lesion from dermoscopy images, the active contour method was proposed. These skin lesions were processed using hybrid feature extractions, namely, the Local Binary Pattern (LBP) and Gray Level Co-occurrence Matrix (GLCM) methods to extract the texture features. The obtained features were then processed using the artificial neural network (ANNs) algorithm. In the second system, the convolutional neural network (CNNs) algorithm was applied for the efficient classification of skin diseases; the CNNs were pretrained using large AlexNet and ResNet50 transfer learning models. The experimental results show that the proposed method outperformed the state-of-art methods for HP2 and ISIC 2018 datasets. Standard evaluation metrics like accuracy, specificity, sensitivity, precision, recall, and F-score were employed to evaluate the results of the two proposed systems. The ANN model achieved the highest accuracy for PH2 (97.50%) and ISIC 2018 (98.35%) compared with the CNN model. The evaluation and comparison, proposed systems for classification and detection of melanoma are presented.


Introduction
Skin is the largest organ of the human body. It protects the body's internal tissues from the external environment. The skin also helps maintain the body temperature at a steady level and shields our body from unfortunate solar radiation, for example, bright (UV) light introduction. It counteracts contaminants and permits the generation of vitamin D and is essential for certain body capacities [1]. Melanoma is an abnormal proliferation of skin cells that arises and develops, in most cases, on the surface of the skin that is exposed to copious amounts of sunlight. However, this common type of cancer can also develop in areas of the skin that is not exposed to too much sunlight.
Melanoma is the fifth most common lesion of skin cancer. As recently reported by the Skin Cancer Foundation (SCF), it is considered the most serious form of skin cancer because it is capable of spreading to other parts of the body.
Once melanoma spreads elsewhere, it becomes difficult to treat. However, early detection protects lives, that is rare but the most dangerous. In the past couple of years, the incidence of skin cancer has been increasing, and reports show that the recurrence of melanoma occurs at regular intervals [2]. Skin disease, the most overwhelming kind of malignancy, manifests when skin cells lose control. There are three primary kinds of skin growths: basal cell skin tumors (basal cell carcinomas), squamous cell skin malignancies (squamous cell carcinomas), and melanomas. For the most part, skin growths that are not melanomas are normally grouped into nonmelanoma skin tumors. Skin cancer disease can be classified into two groups: benign and malignant. Benign cancers are classified as basal cell carcinoma and squamous cell carcinoma. Malignant cancer (aka melanoma) is the most dangerous and leads to death. Skin tumors are the costliest malignancies [3].
The National Cancer Institute (NCI) has reported that melanoma is one of the most serious types of cancers. When too many ultraviolet (UV) lights hit the skin, over time, it leads to DNA damage in skin cells, causes cancer and takes many years. Cancerous melanoma is one of the fastest rising skin cancer in the world, with more than 70,000 projected new cases in the USA alone and an estimated 10,000+ deaths just in 2017, according to the American Cancer Society (ACS) [4]. In 2012, around three million skin lesions were evaluated in the US, and over 100,000 were diagnosed as malignant melanoma [5].
Artificial intelligence (AI) algorithms have advanced at a notable rate and have found practical applications in various industries [6]. AI algorithms define training data inputs to training data outputs by designing a complex structure of layers for solving specific problems. Currently, deep learning algorithms are employed to solve problems that are barely resolvable via traditional ANNs [7]. ANNs were applied to large amounts numbers of scientific data, learning from complex data [8,9], developing recognition systems using image processing [10], used them for analysis and classification of texts [11], etc. One of the important applications of ANNs is for biomedical diagnosis [12,13]. In addition, ANNs were used to analyze health informatics [14] using biomedical data [15] and magnetic resonance imaging (MRI) as the diagnostic system [16]. The artificial intelligence algorithms were applied to achieve numerous biomedical tasks, such as a biomedical segmentation image to determine the specific disease areas, develop diagnostic systems, classify all types of diseases, predict diseases using health informatics, and detect various anatomical regions of interest (ROI). Currently, the deep learning algorithms were successfully developed superior biomedical health.
In recent years, several researchers were applied to various AI algorithms to diagnose skin cancer. Different dermatological datasets were used to test their proposed research models. Zhou developed a diagnostic system using several mean shiftbased techniques for segmenting skin lesions during the acquisition of dermatoscopic images [17][18][19]. Garnavi et al. applied optimal color channels and hybrid thresholding algorithms in order to segment skin lesions [20]. In more recent research, Pennisi et al. presented Delaunay triangulation (DT) to divide skin lesion regions into segments [21]. Ma et al. [22] presented a novel defined speed function and stopping approach for the segmentation of skin lesions. The method is more robust against noise and proves effective and flexible at segmenting skin lesions. Yu et al. [23] proposed a fully convolutional residual network (FCRN) for skin lesion segmentation. Celebi et al. applied an extraction method to obtain features, including color and texture, as well as process these features using classification algorithms [24]. Schaefer applied an automatic border detection technique to segment the skin lesion area and extract features, such as shape, texture, and color, for the diagnosis of melanoma [25,26]. Codella et al. developed hybrid CNNs and support vector machines (SVMs) to detect melanoma [27]. Wichakam et al. utilized CNNs to extract features for melanoma in order to design a recognition system [28].
The main contribution of the proposed research can be summarized as follows: the key to deep learning capabilities lies in the of the neural networks' ability to learn from data through generally purpose learning procedures. The proposed research addresses the application of AI in the medical diagnosis of skin diseases. The main challenges in our work were how to differentiate between benign and malignant images. Figure 1 illustrates skin cancer samples from diverse datasets.
The early detection of melanoma and improving dermatologic techniques can increase family physicians' confidence in their referral accuracy to dermatologists, thereby, decreasing unnecessary surgery or biopsies (excisions). Early detection could reduce mortality and increase the survival rate of patients with melanoma to 98%. These are the main purposes of our research. A comparative analysis of performance between artificial neural networks (ANNs) and convolution neural networks (CNNs) are presented along with the research of simple, suitable segmentation techniques for obtaining ROI. These techniques were applied to two dermoscopy dataset images, namely, PH2and ISIC 2018, using different feature extraction methods to obtain diagnostic accuracy in the early detection of melanoma.

Materials and Methods
Since the nature of characteristics of each dataset is different, and the challenges in each dataset are different too; these challenges composed of lesion segmentation, disease classification and detection, localization of visual dermoscopy features/pattern, and lesion attribute detection. Due to this reason, the proposed system has the ability detection of melanomas in dermoscopy images. Figure 2 displays the framework of the proposed system for the classification of skin diseases. In feature-based, the active count segmentation algorithm was used to segment ROI from dermoscopy images. The hybrid features extraction local binary pattern and Gray Level Co-occurrence Matrix (GLCM) methods to extract texture features. These features were processed by an artificial neural network algorithm. The second system, convolutional neural networks (CNNs), was applied for efficient classification of skin disease; the CNNs were pretrained using large AlexNet and ResNet50 methods. This work is aimed at determining the best selected of a system for skin lesion classification. The other objective is to compare the robust and reliability between the deep leaning and traditional ANN algorithms.

Preprocessing Stages.
In this section, the preprocessing steps were applied to obtained significant features from dermoscopy images. Figure 5 shows the preprocessing stages of the proposed methodology.   A Gaussian filter method is used to apply a 2-D convolution operator to "blur" the skin images and remove details and noise. It uses the kernel function for representing the shape of a Gaussian. The function is defined as the following: where σ is the standard deviation parameter of the distribution.

Segmentation
Method. The snake model is one of the active contour types; it has the ability to perform appropriate segmentation. The model clearly identifies the target lesion and requires prior knowledge about the contour of the particular lesion or complex lesion. The active snake model applies spline, which focuses on the minimum energy followed by different forces that control the image. The spline A mathematical function of a polynomial set to derive geometric figures and curves in the image. Geometric active contours are applied by [29,30].      Computational and Mathematical Methods in Medicine The curve ∁ is represented in by a level set function∅: Ω ⟶, where is zero at the border region in the image of skin lesions I. The curve ∁ divides the subregions W k ⊂Ω into two subregions w, w, with ϕ, where In this algorithm, the level set evolution starts by moving contour inwards. The initial contour is determined at the boundaries of the image in order to calculate the contour map of the skin lesion area. When ϕ > 0 is set, the level set moves inward, to compute the subregion of the zero levels. The outer region is also computed by subtracting the previously subregion computed subregion from the current region computed, as shown by the equations below.
On the whole, the outer subregion can be computed as When segmentation, the active contour algorithm moves dynamically towards the boundaries of the object. In order to achieve this, external energy moves the zero level towards the boundaries of the object. The following equation illustrates the energy functional for the function ϕ.
where λ > 0 and ν are constants. The terms L spf and A spf are defined in the following equations where spf ðIÞ will be defined later in the equation (), H ε is the Heaviside function, and δ ε denotes the univariate Dirac delta function that will be defined later. Lspf (ϕ) is reduced by driven the zero-level curve C into a smooth curve, so that small energy in spf ðIÞ speeds up curve evolution, which will drive the zero level set toward the boundaries of a skin lesion. The coefficient v of A spf ðϕÞ is a positive or negative value according to the position of the initial contour of the region of interest. If the initial contour is outside the region of interest, then the value of v is positive, and if its position is inside the region of interest, then the value of v is negative in order to speed up the expansion of contours. We define a new region according to energy functional. We suggest the E proposed for the previously used SPF function. Let I : Ω ⟶ R be the image of the inputted skin lesion and C be a closed curve, and the energy functional proposed is defined as follows.
Keeping ϕ constant while reducing energy E proposed by the following formulas, we get C 1 for the w region and C 1 for the w region as follows.
M k is the characteristic function of the defined subregion as follows: By calculating of variations A spf ð∅Þ, it can be written as the Gateaux derivative (first variation) as follows: A function ϕ which minimizes the function and satisfies the Euler Lagrange function as with the equation ∂E spf /∂∅ = 0. The first term corresponds to L spf , which indicates the object's curvature according to the edges' information, while the second term corresponds to A spf , which indicates a region within the region of interest. If the value of SPF is positive, then the contour moves to the region of high density and vice versa.
An iterative process to minimize the function E spf ðϕÞ through gradient flow with time t by the following formula: An SPF function is a mathematical expression with two values in the range [1, -1] inside and outside the region of interest. There are many ways to calculate the SPF function, some of them have global density, and some have a local density in their construction. We proposed a new SPF function restricted to the term mask that works to evolution the level set into inwards. When the mask is set to 1, it modifies the compressive force signals so that when it is outside the object, the contour shrinks, and when it is inside the object, the contour expands.

Computational and Mathematical Methods in Medicine
The global fitted model for a level set function defined as follows: According to the global fitted model mentioned above, the SPF function is reformulated as follows: In this work, the Dirac function δ ε ðzÞ and Heaviside function H ε ðzÞ are the smoothed versions of the whole image. The approximation for H ε ðzÞ and δ ε ðzÞ is as follows: If there is a difference between the initial level set function and SDF, then schema reinitialization is unable to reinitialization SDF. In our proposed, the initial level ϕ 0 is set as in the formula.
where ρ > 0 is a constant value and ϕ0 with ρ = 2 that is used. When the pixels are similar between two consecutive contours, the contour algorithm will stop using the stop value at a certain point. If then the contour will stop moving. ldM k i,j denotes the last calculated mask for the contour, and M k i,j indicates to the current mask of the contour; row and col are the maximum number of rows and columns, respectively, in the skin lesion images. The stop value is in a range between 98 and 100, which is calculated by computing the mean intensity value in the initial contour. The threshold value T is used to eliminate small values when calculating the stop value. The active contour method was developed to extract the region of interest (ROI) from dermoscopy images. It is noted that the active contour method was appropriate for dermoscopy images. Figure 6 displays the region of interests of PH2, whereas the important region of skin lesions for ISIC 2018 dermoscopy images is presented in Figure 7.

Feature Extraction.
In this present research, we fused two feature extractions: the Local Binary Pattern (LBP) and GLCM method to extract features from the dermoscopy images [31]. The Local Binary Pattern (LBP) is one of the important features of the extraction method; it has implemented many image processing fields. The local binary pattern method was proposed by Ojola [32], to extract the significant texture feature from the pixel values. The LBP is a very simple and robust method for extracting in each center pixel of the input image ðx, yÞ with grey level values of the ℊ c , and the LBP method is computed by comparing the ℊ c values of grey pixels at the R distance during its P neighborhood pixels. Figure 8 shows the LBP neighborhood pixels, either clockwise or counterclockwise. ðx, yÞ has grey level values than neighborhood p that will assign 0 or 1 values. Figure 8 displays a sample 2D plot of the LBP method for extracting the features from the ROI that has obtained by the segmentation method.
Its LBP value is estimated by comparing the g c value with the grey level values of pixels at the R distance within its surrounding P neighborhood pixels following the pixels along a circular path either clockwise or counterclockwise. The LBPP, R, is computing as follows: where x is defined The GLCM method is one of powerful statistical extraction feature methods. The GLCM method uses to extract the texture features from dermoscopy image. We considered 13 statistical features, namely, contrast, correlation, energy, homogeneity, mean, standard deviation, entropy, RMS, variance, smoothness, kurtosis, and skewness. We fused the features of GLCM with LBP to obtain robust features. 216 significant features were selected from the hybrid method for training the classification algorithms.

Classification Algorithms.
In this section, the classification algorithm artificial neural networks (ANNs) and convolutional neural networks (CNNs) were applied to detect skin diseases from dermoscopy images.
2.4.1. Artificial Neural Networks (ANNs). The artificial neural network is a very powerful computation method for developing numbers of real medical applications. In general, the neural network (NN) models are used as a very powerful machine learning algorithms for time-series prediction of different engineering applications. The ANN model is consist of an input layer, hidden layers, and an output layer. Each hidden layer has weight and bias parameters to manage neurons. In order to transfer the data from the hidden layer into the output layer, the activation function is used. The learning algorithms are used to select the weights within the NN framework. The weight selection is based on the minimum performance measures such as mean square error (MSE). Figure 9 shows the architecture of ANNs for detecting skin diseases.
In this study, the ANN algorithm has applied for diagnosis the skin diereses. The ANNs have three significant layers input, hidden layer, and output layers. Two standard real datasets have such as ISIC 2018 and PH2 employed to examine the proposed methodology. Two thousand sixteen features were considered input training for both datasets, whereas five hidden layers transfer the input training from input to output 7 Computational and Mathematical Methods in Medicine the sigmoid function. However, the output layer for PH2 dataset is 3 and 7 output for HAM dataset-the sigmoid function.

Deep Learning with Convolutional Neural Networks (CNNs).
A convolutional neural network (CNNs) system is used for deep learning. In signal processing and image processing domain, such methods are commonly used to classify the scenes and objects as well as to perform the ROI detection and segmentation process [32][33][34][35][36][37][38][39]. In this work, two transfer models of CNN algorithms, namely, AlexNet and ResNet50, were applied to classify skin diseases. Figure 10 shows the   Figure 11: ReLU function. 8 Computational and Mathematical Methods in Medicine framework of the CNN algorithm. It gets rid of the process of manual feature extraction as the learning of features is directly performed by CNNs. In the convolutional layer, given the input, a weight matrix passes all over the input, and the recorded weighted summation is placed as a single element of the subsequent layer. Three hyperparameters include (filter size, stride, and zero padding) that affect the performance of the convolutional layer. By using different values for these hyperparameters, the convolutional layer will decrease the complexity of the network. The CNN algorithm has different layers. Many nonlinear functions can be used in the convolutional neural network. However, Rectified Linear Unit ReLU is one of the most common nonlinear functions applied in image processing applications. The ReLU is shown in Figure 11. The main goal of using the ReLU is applying element-wise activation function to the feature map from the previous layer. In addition, the ReLU function transfers all value of features map to positive or zero. The ReLU can be represented, as shown in Eq. (1).
The pooling layer, roughly, reduces the dimensions of the input data and minimizes the number of parameters in the feature map. The simplest way to implement the pooling layer is by selecting the maximum of each region and then writing it in the next layer's corresponding place. Using this pooling filter reduces the input size to 25% of its original size. Also, averaging represents another pooling method. However, taking the maximum is the most popular and promising method in the literature. The maximum pooling method is noninvertible; so, the original values before pooling operation cannot be restored. But if the locations of the maximum values of each moving in a set of switch variables are recoded, approximate original values can be generated.
The softmax function is used to calculate the probability distribution of an N-dimensional vector. The main purpose of using softmax at the output layer is the multiclass classification method in machine learning algorithms, deep learning, and data science. The correct calculation of the output probability helps to determine the proper target class for input dataset. The probability of the maximum values is increased using the exponential element. The softmax equation is shown by Eq. (19).
where i, z i , is the output, the O i indicates to the softmax output, and M is the total number of output nodes. The fully connected layer represents the last layers in any convolutional neural network. Each node in the layer (L) is connected directly to each node in layers (L − 1) and (L + 1). There is not any connection between nodes in the same layer in contrast with the traditional ANN. Therefore, this layer takes long training and testing time. More than one fully connected layer can be used at the same network, as shown in Figure 12.
In this study, two transfer learnings, namely, the AlexNet and ResNet50 models, are implemented, and the detailed description of these models is as follows:

Computational and Mathematical Methods in Medicine
(1) AlexNet Model. AlexNet contains five convolutional layers, as well as two fully connected layers for learning features. It has max-pooling after the first, second, and fifth convolutional layer. In total, it has 650 K neurons, 60 M parameters, and 630 M connections. The AlexNet was the first to show that deep learning was effective in computer vision tasks [54,84]. Each convolutional network is made up of convolutional layer, nonlinearity, pooling layer, one fully connected layer and, lastly, softmax are considered for recognition of the gestures. Table 1 shows the parameters of the CNN algorithm. Figure 13 shows the proposed framework of the AlexNet transfer learning model.
(2) ResNet50 Model. The ResNet models, developed by He et al. [41], are a powerful transfer learning model of CNNs for classification purposes. They have good convergence behaviors and compelling accuracy. The ResNet transfer learning model was built with different layers, like 18, 34, 50, 101, 152, and 1202. These layers gave the ResNet more efficiency to obtain the best accuracy. The ResNet transfer learning model is similar to the VGG net; nonetheless, ResNet50 is eight times deeper than VGG [42]. The ResNet50 consists of 49 convolutional layers and a fully connected layer at the end of the network. Finally, the ResNet50 was applied to classify skin diseases. Table 2 shows the significant parameters of ResNet50.
There are several layers in CNNs to detect various features of input image through each layer learning. At different resolutions, filters are applied to every trained image, and the outcome of every convolved image is utilized in the next layer as input. We used the CNNs for disease detection based on extracted features from the input disease. Our aim behind using the CNNs for skin disease detection is to improve the recognition results and compared with ANN algorithms. Then, through some experiments, we presented the optimal architecture based on the results. Selecting the frame length determines only the input dimension of our method. The second challenge is to find an optimal architecture for the CNNs. Therefore, firstly, we defined the input and the output structure of the network.

Experiment Environment Setup
In order to develop a recognition system for the diagnosis of skin cancer, we should give specific answers for the following set of questions; this will give more grants for developing a successful system.
(1) Does the real-time standard set used to examine the selected feature recognition system scores the highest ranking using the information methods?         In order to give answers to the above questions, real-time stranded datasets were used. The ANN and CNN classification algorithms were applied to detect skin diseases. The implementation of this research has been done using Matlab 2020 programming. The experiments were conducted on the system with I7 Processor and 8 GB RAM to process all system tasks. The evaluation metrics were used to evaluate the pro-posed system. The classification results of ANN and CNN Algorithms are presented. The experimental results of the recognition system were tested and evaluated by employing the evaluative metrics: accuracy, sensitivity, specificity, precision, recall, and F1 score. The developing system was applied to diagnosis the skin cancer. The detailed description of the experiment results of the proposed system is presented in the following subsection.
3.1. Evaluation Metrics. In order to evaluate and measure the effectiveness of the recognition system, the performance measurement metrics like accuracy, sensitivity, specificity, precision, recall, and F1 score were employed. The equations are defined as below: where TP is true positive, FP is false positive, TN is true negative, and FN is false negative. Table 3 provides a description setup of the skin disease datasets used in these experiments.

Experiment Results of the Artificial Neural Network
(ANNs) Algorithm. In this section, the results of the ANN algorithm to diagnose skin cancer are presented. The datasets were divided into 80% training and 20% testing. The ANN algorithm was used as PH 2 database to detect the skin diseases, whereas the PH2 dataset has three diseases, namely, common nevi, benign, and melanoma, whereas the ISIC 2018 has seven classes. We created a neural network with 10 hidden layers, 216 inputs, and 3 outputs. Figure 14 shows the framework of the ANN model for PH2 and ISIC 2018 datasets to diagnose the skin diseases. In PH2 dataset, 27 epochs are considered for the training process. The confusion matrix of the ANN model of the PH2 dataset is displayed in Figure 15, whereas Figure 16 shows the confusion matrix of

Computational and Mathematical Methods in Medicine
ANNs for the ISIC 2018 dataset. The confusion matrix consists of four training, validation, testing, and all data. Three epochs were achieved in the training process to obtained good performance, with time elapsed 3 min. The actual class is represented in the rows, and the predicted class is represented in the columns. The correct classification class represents in the trig diagram of the confusion matrix. The last cell rows display the accuracy of the model. By analyzing this result of the ANN algorithm, it is noted that that neural network with 10 hidden layers is more appropriate for distinguishing the malign lesion from the benign one. Table 4 summarizes the results of the ANNs to detect skin diseases. It is noted that the performance of the ANN model with ISIC 2018 dataset is very superior compared with PH2, but overall, the ANN model is more appropriate to diagnosis the skin diseases. It is noted that the ANNs with ISIC 2018 dataset attained the highest accuracy, (98.35%).
The performance plot is used to identify the mean square error in the network in order to diagnose skin diseases. It is useful to test the proposed. The performance of the ANN model is displayed in Figure 17. The best validation of the ANN model was 0.018149 at epoch 27 with PH2 dataset. In this case, ISIC 2018 best validation of the ANN model is 0.037798 at epoch 36. The performance of the ANN model means the square error rapidly decreases as it learns. The blue line indicates the training process, and a green line represents the validation error. The red line represents the error of testing the training. Additionally, when the number of epochs in the system increases, a smaller error in the training data will be obtained. When the validation error stops decreasing, the training also stops. The receiver operating characteristic (ROC) displays the simulation results of the ANN model to diagnose skin diseases. Figure 19 shows the receiver operating characteristic (ROC) to measure validation of the ANN model using two real standard datasets. The graphic representation of testing,   15 Computational and Mathematical Methods in Medicine training, and validation of the system is presented. The last graph shows the overall ROC of the system.

Experiment
Results of the Deep Learning Algorithm. This section presents the simulation results of two CNNs (Alex-Net and ResNet50) for detecting skin diseases. The dataset was divided into 80% training and 20% testing. In order to obtain powerful results, the input size should be fixed. In this research, the input size is a 244 × 244 × 3 matrix. The output shape in this present research is the softmax function, with three classes for the PH and seven classes for the ISIC 2018 datasets. The softmax layer is used as an output to recognize skin diseases from both datasets. The performance of the CNNs (AlexNet and ResNet50) depends on the CNN parameters such as filter size, hidden layer, and the number of filters used in the convolutional layer. In the AlexNet transfer model, 34 layers and 10 epochs were utilized. The PH 2 and ISIC 2018 datasets were used with different outputs to test the AlexNet and ResNet50. The input data of PH2 120 images and ISIC 2018 is 840 images. In the ResNet50 transfer model, 174 hidden layer and minibatch size of one, while the weight learning rate factor and the bias learning rate factor were set to 20; the epoch's values are 10. The number of feature maps is usually equal to the number of filters used.  Pooling size also affects the accuracy of the network result, and when used, it fully connects the number of nodes used at this layer. The number of convolutional layers has a significant effect on the result. We cascaded the convolutional layers together to build our classifier system. Each convolutional network consists of convolution, nonlinearity, pooling layers. The (AlexNet and ResNet50) transfer learning model has applied as individual classifiers for skin diseases detection. From each database, 80% of the images were used for training, and 20% of the images were used for validation (in both PH 2 and ISIC 2018). Table 5 shows the results of the AlexNet model, and the results of the ResNet50 model are presented in Table 6. It is observed that the results of ResNet50 are better than AlexNet. The results of ResNet50 have a higher accuracy which indicates that it plays a leading role in the proposed model. Figure 20 shows the confusion Metrix of AlexNet for detecting skin diseases using PH2 and ISIC 2018. Figure 21 shows the confusion matrix of ResNet50 for both datasets and presented several sample validation images. For each of them, we presented the predicted labels and the predicted probabilities of the images having those labels. Figure 22 displays the ROC curve for the AUC stand metric of the AlexNet model for both datasets. The ROC curve for AUC stand metric of ResNet50 is shown in Figure 23. The graphical representation demonstrates the successful classification; the false positive rate is very low. The blue line shows the detection rate; it is noted that the detection rate is very high for recognizing skin diseases. The figure indicates that the performance of the AlexNet and Resnet-50 models is good multiclass ROC curve, and it attains a statistically significant AUC value of 94.05% of ResNet50 with ISIC datasets.

Discussion
In this research work, developing the proposed system using artificial intelligence to detect skin diseases is presented. Two real standard datasets were employed for evaluating the proposed system. The datasets were split into 80% for training state and 20% for the testing state. The proposed system was developed using Matlab.  Initially, we developed a system based on the features obtained from the extraction methods. The hybrid feature extraction, based on LBP and GLCM, was implemented to extract significant features. The hybrid feature extraction methods extruded 216 significant features. These features were processed using the ANN algorithm in order to detect skin diseases. In the ANNs model, we considered 10 hidden layers regarding 216 input and seven output features for ISIC 2018 and 3 for PH2 datasets. Notably, the ANNs achieved the highest accuracy for ISIC datasets: accuracy = %. In the second model, the deep learning algorithm was proposed. Two transfer learnings, namely, AlexNet and ResNet50, were considered for skin disease detection. The results of ResNet50 are better for both datasets.
Overall, it was observed that the ANN model achieved the highest accuracy compared with using the CNN algorithm. In the case of the ANN model, we preprocessed all images to remove the hair from images; this helped increase the accuracy of the proposed model. The developed diagnosis system's most prominent challenges are due to the similarity of skin disease features. Another issue is the quality of the images, which look like dermatologist-drawn makings into the lesion. However, the developing system has the ability to detect skin diseases with accuracy (98.35%). Comparative classification results between the proposed model and the existing one are displayed in Table 7.
The proposed methodology's empirical results are highly accurate (98%) using the ANN algorithm based on ISIC 2018, and the ANN model based on PH2 data achieved an accuracy of 97.50%. Additionally, the CNN transfer learning model attained satisfactory results compared with existing models. Finally, we believe that the proposed system has the ability to diagnose skin diseases.

Conclusion
Nowadays, it is essential to focus more attention toward the early detection of skin diseases such as melanoma before they spread to other parts of the body. In this research, we developed a skin diagnosis system based on AI algorithms. The proposed methodology was evaluated and tested using statistical analysis methods. The following conclusions can be drawn from the use of advanced AI for the classification of skin diseases: (i) Two real standard datasets were used to test and evaluate the diagnostic system (ii) ANN algorithms based on features that were extracted from skin lesions using hybrid feature extraction methods were implemented. The developed database contains 216 significant features that can be considered important for skin disease diagnosis (iii) CNN transfer learning, AlexNet and ResNet50, was applied to classify the skin diseases (iv) Comparisons between the ANN-based on features and CNN algorithm are presented. It is noted that the ANN algorithm achieved the highest accuracy (v) We tested the proposed system by detecting skin diseases (vi) Comparative classification results between the proposed system and existing system are presented. Overall, the proposed system achieved good accuracy and is more satisfactory

Conflicts of Interest
The authors declare no conflict of interest.