Fungal Skin Disease Classification Using the Convolutional Neural Network

Skin is the outer cover of our body, which protects vital organs from harm. This important body part is often affected by a series of infections caused by fungus, bacteria, viruses, allergies, and dust. Millions of people suffer from skin diseases. It is one of the common causes of infection in sub-Saharan Africa. Skin disease can also be the cause of stigma and discrimination. Early and accurate diagnosis of skin disease can be vital for effective treatment. Laser and photonics-based technologies are used for the diagnosis of skin disease. These technologies are expensive and not affordable, especially for resource-limited countries like Ethiopia. Hence, image-based methods can be effective in reducing cost and time. There are previous studies on image-based diagnosis for skin disease. However, there are few scientific studies on tinea pedis and tinea corporis. In this study, the convolution neural network (CNN) has been used to classify fungal skin disease. The classification was carried out on the four most common fungal skin diseases: tinea pedis, tinea capitis, tinea corporis, and tinea unguium. The dataset consisted of a total of 407 fungal skin lesions collected from Dr. Gerbi Medium Clinic, Jimma, Ethiopia. Normalization of image size, conversion of RGB to grayscale, and balancing the intensity of the image have been carried out. Images were normalized to three sizes: 120 × 120, 150 × 150, and 224 × 224. Then, augmentation was applied. The developed model classified the four common fungal skin diseases with 93.3% accuracy. Comparisons were made with similar CNN architectures: MobileNetV2 and ResNet 50, and the proposed model was superior to both. This study may be an important addition to the very limited work on the detection of fungal skin disease. It can be used to build an automated image-based screening system for dermatology at an initial stage.


Introduction
Skin is the outermost layer spread throughout the body, accounting for 16% of the body mass [1]. It is the frst line of defense to protect the vital organs of our body from harm. It is necessary to give proper attention to the overall health of the skin. Changes in its normal functioning can afect other parts of the body. Any disorder that afects the skin is a skin disease. Skin is often afected by diseases caused by fungus, bacteria, viruses, allergies, and dust. Tere are more than 3000 known skin diseases worldwide [2]. Skin disease is one of the major global health issues across all age groups that afects about 900 million people [2,3]. It is the fourth leading cause of skin related illness [4]. It is a signifcant cause of infection in sub-Saharan Africa [5]. An estimated 21-87% of children in Africa are afected by skin disease [6]. According to the WHO report of 2018, skin disease-related deaths in Ethiopia reached 2,459, accounting for 0.40% of total deaths [7]. Te most common skin illnesses include eczema, melanoma, vitiligo, mycosis, papillomas, impetigo, scabies, herpes, dermatitis, warts, psoriasis, acne, tinea corporis, tinea pedis, and tinea capitis [8]. If not detected and treated promptly, they are dangerous and can spread easily. Te disability caused by diseases can have a psychological impact on people that afects their education, relationships, selfesteem, career choices, and social, sexual, and leisure activities. Tis can also lead to depression, frustration, isolation, and even suicide [9,10].
Fungal skin disease is one of the most common types of skin disease. Superfcial fungal infections afect the hair, nails, epidermis, and mucosa. Dermatophytes are the most common cause of superfcial fungal infections. It is prevalent in developing nations. Tinea corporis, tinea capitis, tinea pedis, tinea cruises, and pityriasis vesicular are the most common fungal infections [11]. Tinea corporis is more prevalent in children and young adults and infects the whole body. Tinea capitis infects the skin around the scalp. Tinea pedis generally infects the leg and foot, beginning between the toes. It is common in people who have sweaty feet while wearing tight-ftting shoes. Tinea unguium, or onychomycosis, is a fungal skin disease that infects the nail. Te global prevalence of onychomycosis is 5.5% and contributes 50% to all nail diseases [12]. Tinea infections can be difcult to diagnose and treat accurately because of the similarity between diferent types of fungal morphology. As a result, image-based approaches to detection and diagnosis of fungal skin diseases may be efective. Early detection and diagnosis of fungal skin disease are critical to providing appropriate treatment and preventing further spread. Fever, pain, and dyspnea are some of the clinical symptoms of fungal skin diseases. Tese symptoms are not specifc to fungal skin diseases, and the fungal spore microscopic image of the fungal spores is complex, making early detection and diagnosis difcult [13]. Common methods for the diagnosis of fungal skin diseases are based on blood tests, history, symptom analysis, skin scraping, visual inspection, dermoscopy, and skin biopsy. Tese diagnosis methods are time-consuming, require an extensive understanding of the domain, and are vulnerable to subjective errors.
Detection, diagnosis, and classifcation of skin disease were carried out previously by diferent studies. Tey have used diferent methodologies, and therefore, the performances of the models are diferent. Velasco et al. proposed smartphone-based skin disease detection. Teir system recognized acne, eczema, pityriasis rosea, psoriasis, tinea corporis, varicella (chickenpox), and vitiligo with an accuracy of 94% [14]. Wu et al. compared fve pretrained deep learning frameworks for the diagnosis of six facial skin conditions from a clinical image and using an Inception-ResNet_V2 [15]. Te reported precision of their model has been 77% [15]. Kamulegeya et al. developed a skin disease identifcation model of Uganda [16]. Tey have used a blackcolor image dataset. Te accuracy was low (17%). Tey concluded that the model is poor for detecting fungal infections like tinea. In all previous scientifc works, highly prevalent skin fungal diseases such as tinea capitis, tinea pedis, and tinea unguium were not signifcantly considered. In this study, we used CNN to classify the most common fungal skin diseases.
Tis study may be an important contribution to the classifcation of fungal skin diseases, where there are few previous scientifc works, especially on high-burden diseases such as tinea pedis and tinea corporis. Te performance of the proposed model is superior to models with similar architecture. More importantly, it can be very helpful in the early identifcation of the most common fungal skin diseases by building an automated screening system. It can be integrated with knowledge-based systems and clinical decision support systems to support practitioners. Tis will be useful, especially for resource-limited health facilities that have an acute shortage of diagnostic tools and means. Timely diagnosis and efective medication can be achieved with these systems.
Te remainder of the paper has been organized into three sections. In Section 2, the materials and method used in the study to classify the most common fungal skin diseases have been discussed. Details of the dataset, preprocessing techniques, augmentation, modeling, and evaluation have been described. In Section 3, experiments, results, discussion, and evaluations of the proposed method are incorporated. Te conclusion that highlights the main fndings and inferences has been incorporated in Section 4.

Materials and Method
Te aim of this study was to efectively classify the most common fungal skin diseases, tinea pedis, tinea capitis, tinea corporis, and tinea unguium, using CNN. As shown in the work fow diagram in Figure 1, it was carried out in a series of steps that included preparation of the dataset, preprocessing, image annotation, modeling, and evaluation.

Dataset.
Te dataset for this study was collected from the Dr. Gerbi Medium Clinic in Jimma, Ethiopia. Te images were captured after the diagnosis was confrmed by a dermatologist. Tinea pedis, tinea capitis, Tinea Corporis, and tinea unguium were the four labels in the collected images. Te dataset comprises a total of 407 images of the selected four fungal skin diseases. Table 1 displays the distribution and percentages.

Image Preprocessing.
Image preprocessing is a technique to improve the quality of images by applying diferent techniques. Most original medical images contain irrelevant parts that require preprocessing. Image preprocessing techniques are used ahead of classifcation to remove such irrelevant parts of the images, with the goal of improving image visualization and model performance [17]. Normalization, image color conversion, and image resizing were specifc techniques used in this study. Te original images were not uniform in size, and they were resized into 120 × 120, 150 × 150, and 224 × 224 pixels. After the size of all acquired images became uniform, the color was converted from RGB to grayscale. Feature extraction is a technique that changes the original features of the data into a new, smaller set of features that is more informative. Tis smaller set of informative features is critical for recognition to distinguish between diferent labels. CNN is efective in the extraction of deep features. Te powerful learning ability of deep CNN is primarily due to the use of multiple feature extraction stages that can automatically learn representations from the data [18].

Augmentation.
Data augmentation is a technique that is used to artifcially increase the size of the dataset. It is one way to prevent deep learning models from overftting. Tere are several data augmentation techniques, such as cropping, rotations, fipping, translations, contrast adjustment, and scaling. In this study, we augment 407 images labeled into four classes: tinea capitis, tinea corporis, tinea pedis, and tinea unguium. After augmentation, we have a dataset of 1069 images, as shown in Table 2.

Modeling and Evaluation
. Te deep learning model proposed for this study is CNN. It is one of the implementations of a neural network that has been widely used in image-based learning. Automatic extraction and selection of features are two of the main strengths of deep learning models [19]. CNN in particular is efective in extracting deep features. It has been suggested that the accuracy of disease detection can be greatly enhanced with the combination of clinical and imaging data and the use of newer artifcial intelligence methods such as deep learning [20]. Deep learning has been used efectively in medical image detection and classifcation [21][22][23]. To identify patients with COVID-19 in their early stages of the disease, NASNet, a state-of-the-art pretrained convolutional neural network for image feature extraction, has been used efectively [21]. In the study, COVID-19 cases were identifed without misclassifcation errors. Similarly, eight well-known CNN models were used for feature extraction in the detection of B-ALL lymphoblasts [22]. Early detection of diseases is usually vital for efective and timely intervention [23,24]. With current medical devices and technology, early detection or identifcation is getting better, but people may not reach to diagnosis centers in time or are too expensive for some, especially in developing countries [25]. Te symptoms and signs of some of the diseases are too similar and asymmetric for extremely large areas, making identifcation difcult [26]. We believe that the proposed CNN model is appropriate for the classifcation of fungal skin diseases. In order to evaluate the performance, commonly applied evaluation metrics such as accuracy, precision, recall, and f1score have been used, as shown in the following equations: where TP is true positive, FP is false positive, TN is true negative, and FN is false negative.

Results and Discussion
Reducing the image to its optimal size decreases processing time and cost. Te dataset consists of images of diferent sizes. We resized images to the sizes of 120 × 120, 150 × 150, and 224 × 224. We carried out modeling by varying image sizes to obtain optimal performance. As the size of the image increases, it needs more computational time. Te maximum accuracy obtained was with an image size of 224 × 224. Tese experiments have been discussed as follows: Te frst was carried out with an image size of 120 × 120. Te training accuracy of the model has been 85% and its validation accuracy has been 81%, as shown in Figure 2. Ten, modeling was carried out with an image size of 150 × 150. Te training accuracy of the model has increased to 86% and its validation accuracy to 83%, as shown in Figure 3.
Lastly, modeling was carried out with an image size of 224 × 224. Te training accuracy of the model has increased to 93.3% and its validation accuracy to 87.3%. Te result showed that modeling with an image size of 224 × 224 has the best performance when compared with modeling with image sizes of 120 × 120 and 150 × 150, even if it is computationally more expensive. Te accuracy and loss are shown in Figure 4.
Te modeling confusion matrix with an image size of 224 × 224 is shown in Figure 5. From the total of 214 validation images, 187 have been correctly classifed and 27 incorrectly classifed. As shown in Table 3, the performance of the model is an accuracy of 93.3%, a sensitivity of 86.4%, a specifcity of 95.4%, a precision of 87.3%, a recall of 86.4%, and an F1 score of 86.8%.
Hyperparameter optimization is an important task to obtain optimal performance. We have conducted modeling with two activation functions, ReLU and ELU, separately to obtain optimal performance. Te image size was 224 × 224, and the color mode was RGB. Firstly, the model was trained using a 224 × 224 image size in the RGB color mode with an ELU activation function. Te training accuracy of the model is 88.5% and its validation accuracy is 81%, as shown in Figure 6.
Te model was trained using 224 × 224 pixels of image size, RGB color images, and ReLU as an activation function. Te training accuracy of the model has been 93.3%, and its validation accuracy has been 87.3%. Tis result shows that use of the ReLU activation function enhanced the performance. We conducted two modeling experiments using RGB and grayscale color modes with an image size of 224 × 224 for the classifcation of fungal skin diseases in order to identify an appropriate color mode. Te training accuracy of the model has been 76.0%, and its validation accuracy has been 65.0%. Te result showed that the classifcation accuracy of using RGB colors is better than using grayscale color modes. Te training/ validation accuracy and loss using RGB color are shown in Figure 7.   Journal of Healthcare Engineering A comparison has been made with similar CNN architectures using the same dataset and parameters. Tere are diferent types of deep neural network models, such as AlexNet, ResNet, MobileNet, VGG16, VGG19, and Goo-gleNet. From these models, we have selected MobileNetV2 and ResNet50 to compare the proposed model. Te MobileNetV2 model was trained using the 224 × 224 image size, the RGB color channel, and the ReLU activation function. Te training accuracy of the model has been 90.5% and its validation accuracy has been 81.0%, as shown in Figure 8. Tis means that HSFDCModel outperformed MobileNet V2.
Similarly, the ResNet 50 model was trained using the 224 × 224 image size, RGB color channel, and ReLU activation function. Te training accuracy of the model has been     89% and its validation accuracy has been 86%, as shown in Figure 9. Tis means that HSFDCModel also outperformed ResNet50.
In general, we conducted four diferent experiments to achieve optimal performance and validated them through comparison. Tese experiments were carried out to fnd an appropriate image size, activation function, and color channel. Te optimal result has been obtained with an image size of 224 × 224, the ReLU activation function, and the RGB color channel. Te comparison with similar CNN architectures, MobileNetV2 and ResNet50, showed that the proposed CNN model signifcantly outperformed both of them. Te stated results have been shown in Table 4 and Figure 10.

Conclusions
Millions of people around the world have been afected by skin diseases. It is one of the common causes of infection in resource-limited regions like sub-Saharan Africa. Early detection and intervention are important to minimize its impact. However, existing state-of-the-art diagnostic techniques such as laser and photonics-based technologies are not afordable for resource-limited nations. Tis makes image-based methods more efective. Tere have been studies to detect and classify skin diseases using diferent deep learning techniques. However, only few of them focused on highly prevalent fungal skin diseases such as tinea pedis and tinea corporis. In this study, CNN has been used to classify four common fungal skin diseases: tinea capitis, tinea pedis, tinea corporis, and tinea unguium. Diferent experiments were carried out to obtain the optimum performance. An accuracy of 93.3% has been obtained with an image size of 224 × 224, ReLU activation function, and RGB color channel. Comparisons were made with two similar CNN architectures: MobileNetV2 and ResNet 50. Te proposed CNN model signifcantly outperformed both of them. Tis study may be helpful in the early identifcation of the four common fungal skin diseases in health facilities that have an acute shortage of skin disease diagnosis equipment. Tis can be important for timely treatment. An image-based automated fungal skin disease screening system can also be built. To improve performance and scalability, the study can be extended in the future by increasing the number of datasets, the number of fungal skin diseases to be classifed, and experimenting with hybrid deep learning techniques. Knowledge-based systems and clinical decision support systems can also be developed from the study.

Data Availability
Te data used to support the fndings of this study are available upon request to the corresponding author.

Ethical Approval
Te research work was ethically approved by the Jimma University Institute of Technology Research Ethics Approval Board.