Design and Analysis of CNN-Based Skin Disease Detection System With Preliminary Diagnosis
Design and Analysis of CNN-Based Skin Disease Detection System With Preliminary Diagnosis
Design and Analysis of CNN-Based Skin Disease Detection System With Preliminary Diagnosis
Abstract. Over the past few decades, the occurrence of skin diseases has
increased, putting a significant strain on healthcare systems worldwide. These skin
diseases can be cancerous (e.g., basal and squamous cell carcinoma, melanoma)
and non- cancerous (e.g., acne, vitiligo and eczema). Skin problems can be detri-
mental to physical health and can cause psychological problems, usually in patients
whose face is disfigured or damaged due to skin problems. These dermatologic
disorders worsen the situation as time progresses, but the survival rates are high
if detected and diagnosed early. This article provides a comprehensive overview
of the methods used to classify and detect skin disorders as well as diagnostic
methods using naturopathic methods. This paper likewise briefs about the openly
available image pre-processing mechanisms and classification algorithms based
on the relevant works performed by researchers across the world, and suggests the
most suitable technique for each process involved in the skin disease system with
appropriate results.
1 Introduction
Skin is said to be the most sensitive and the largest part of the human body. Skin disorders
are one of the most widespread health issues which create an impact on the appearance of
the skin. The primary sources of skin diseases are fungi, allergies, bacteria and viruses.
At a later stage, this may be the reason for chronic infections, which affect victims for
a longer period of time. In many cases, especially in rural and tribal areas, people tend
to ignore skin lesions by comparing them to common infections. Still, a lack of proper
diagnosis can cause severe inflammation and worsen the situation. Most of these diseases
may take lots of time to show symptoms and are difficult to detect. Sometimes the tests
recommended by hospitals to diagnose the disease may be the reason for other harmful
effects on the human skin. In order to eliminate these costs and the harmfulness of the
examination to the human body, we propose an automatic classification system for skin
diseases. Such an automated diagnosis system can be realized using the aid of artificial
intelligence and convolutional neural networks (CNN).
Convolutional neural networks help extract useful features from images, eliminating
the need for traditional manual image processing techniques. CNNs effectively reduce
the number of defining properties without losing the quality of designed models. Due to
these advantages, CNNs are said to have better efficiency in classifying images based
on the given dataset. Python is at present the most accepted, mature, and widely adopted
programming language for machine learning. In addition to this, Computer Vision allows
the computer to determine the feature of different objects using digital images or videos.
Implementing CV in Python is useful for developers when programming tasks related
to visual concepts, separations, and other image processing steps.
There has been over the past few years an upward trend in the usage of harmoniz-
ing and substituting medicines because of the disadvantages related to the traditional
chemotherapic treatments and the possible advantages of using better natural options.
Phytochemical compounds derived from the extracts of different parts of plants like
leaves, barks and roots have shown capability and potential to function as anticancer
drugs, or for acting as base compounds in synthesizing new naturopathic drugs.
2 Literature Survey
Various research papers have been proposed that deal with the classification and precise
information about different skin diseases. For instance, Vinay Gautam et al. [1] proposed
a high-performance CNN to detect and classify skin diseases at an earlier stage, while
Dan Popescu et al. [3] presented a methodical overview of recent developments in the
field of increased interest in skin disease prediction.
To address the overfitting and deprivation issues in the network, Viswanatha Reddy
Allugunti [2] proposed using residual learning algorithm, while Md. Al Mamun and
Mohammad Shorif Uddin [4] evaluated the methods and techniques used to diagnose 21
commonly observed skin diseases and related them to available image databases. Kritika
Sujay Rao, Pooja Sureh Yelkar and Omkar Narayan [5] presented a layered deep-learning
model to differentiate healthy vs diseased skin lesion using CNN algorithm.
Several research papers have also proposed datasets of skin diseases that are used in
Computer-Aided Diagnostic (CAD) systems worldwide. Bing Xie et al. [15] proposed
a skin disease dataset dominated by Asian species with the bounding box label named
XiangyaDerm. It contains over 107,000 medical images covering more than 500 types of
skin disorders, while Zhe Wu et al. [16] studied various CNN algorithms for classifying
facial skin lesions based on dermoscopic images and identified six common skin diseases.
Rowin Veneman [10] developed a smartphone application which can detect current skin
lesions using segmentation and detection of objects, while S. Chatterjee, Debangshu
Dey & Sugata Munshi [11] reported a procedure for the advancement of four class
skin disease identification technique. I Gunadi et al. [13] also presented the real-time
execution of an application using Open CV library supported with Python in medical
image processing.
336 T. V. Reddy et al.
The procedural flow of the proposed model (Fig. 1) is based on two processes – the first
includes data acquisition from an appropriate image database, followed by segmentation
and contour (edge) detection to obtain the features of the skin lesion from training dataset,
which serve the purpose of training the CNN model, while the second process involves
data acquisition from the captured input image to compare with the existing model pre-
trained with the skin disease dataset. The features of given input image are compared
with those of the possible disease affected images present in the system through CNN
algorithm in order to classify the type and intensity of the skin disease present in the
input image [3].
Every machine learning model is designed using two sets of data – the training dataset
and the test dataset, which might be in the form of texts, images, audio or numerical
types. There are different types of datasets available in open source for the purpose of skin
disease classification. Some of these are DermNet, ISIC, HAM10000 etc. HAM10000
is a set of clinical images and infected tissues acquired from different populations and
saved using different modes and methods. The dataset consists of over 10,000 images that
shall be implemented as the training database for academic machine learning purposes
[7].
Out of the available options, HAM10000 is preferred due to large diversity in datasets
(Fig. 2) and properly classified images to train the machine learning model. This study
involves the analysis of seven types of skin diseases, namely melanocytic nevi (nv),
melanoma (mel), benign keratosis lesions (bkl), actinic keratosis & intraepithelial car-
cinoma (akiec), vascular lesions (vasc), dermatofibroma (df) and basal cell carcinoma
(bcc). The dataset includes numerous images pertaining to each disease, supported by
metadata which consists of the gender and age of the person along with the location of
disease. These images are forwarded to the image processing setup, while the related
information is forwarded to the machine learning model.
Design and Analysis of CNN-Based Skin 337
The image processing stage begins with image preprocessing, which is necessary for
eliminating the unwanted and redundant details from skin images such as noises and
hairs. For this, there are various morphological filters such as minimum, maximum,
Gaussian and median filters that use special operations and transform a given image. In
these preprocessing filters, each pixel is modified based on comparison with neighboring
pixels in the task window. The maximum filter is a pre-processing technique which
replaces each pixel by the darkest (maximum) pixel of the neighboring elements, while
the minimum filter, similarly, replaces the pixels with the lightest (minimum) pixel
of the neighboring elements. The Gaussian filter is a smoothing filter that performs
2-D convolution for removing noises and irrelevant details from the input image. The
functionality is somewhat similar to a mean filter, but the filter uses a unique aggregation
function that represents the shape of a Gaussian, i.e., bell-shaped hump (Fig. 3).
Given an input image of size M x N, and a filter window of size W x W, where W is
an odd number, the output image O(i,j) at pixel (i,j) is given by:
where I is the input image, and median is the function that returns the median value of
a set of values. In other words, for each pixel in the image, the median filter takes the
values of all the pixels in the surrounding window and computes the median value. This
value is then assigned to the central pixel in the output image.
338 T. V. Reddy et al.
Input Output
1 4 0 1 3 1 1 4 0 1 3 1
2 2 4 2 2 3 2 1 1 1 1 3
1 0 1 0 1 0 1 1 1 1 2 0
1 2 1 0 2 2 1 1 1 1 1 2
2 5 3 1 2 5 2 2 2 2 2 5
1 1 4 2 3 0 1 1 4 2 3 0
Sorted:
0,0,1,1,1,2,2,4,4
Fig. 3. Median filtering (3x3 window)
The pre-processed image is subjected to various segmentation processes where the spe-
cific area of infection is detected from the entire image by grouping similar regions
under their respective class labels. Under image segmentation, various techniques based
on threshold limiting, region wise classification, edge/contour detection and sample
clustering are implemented.
Threshold-based segmentation is a method where an image is segmented into two or
more regions based on a specific threshold value. The threshold value is set to a specific
level, and pixels with intensities above or below this value are classified into different
regions. Region-based segmentation groups pixels with similar characteristics into seg-
ments or regions based on some predefined criteria. This method involves partitioning
the image into homogeneous regions, where pixels within the same region have sim-
ilar color or texture features. Edge-based segmentation involves detecting edges in an
image and then partitioning the image into regions based on these edges. This method is
based on finding discontinuities in the image, such as changes in brightness or texture,
to separate the image into regions.
Clustering algorithms are able to provide reasonably accurate segments within a
small amount of time. Mainstream algorithms like the K-means clustering algorithms
[19] are unsupervised algorithms that work by grouping pixels with mutual attributes
together as belonging to a particular segment. In K-means clustering (Fig. 4), the central
locations of each cluster are generally located at different positions, followed by every
point of data being plotted to the nearest centroid. These are then shifted to the mathe-
matical average position of data points which are accordingly plotted, as illustrated by
(2), (3) and (4).
The primary function is denoted by F, where nik equals 1 if xi belongs to cluster
k, or else nik equals 0. In this equation, µk represents the position of centroid of the
corresponding cluster.
m K
F= nik xi − μk 2 (2)
i=1 k=1
Design and Analysis of CNN-Based Skin 339
This function is minimized first with respect to nik by treating µik as a constant term
in order to update the assignments of each cluster.
∂f m K
= xi − μk 2 (3)
∂nik i=1 k=1
1. Asymmetry (A) - one half of the skin lesion must be different from the other half
analogous to other neural networks, but they contain an additional stage of processing
due to the fact that they are comprised of a sequence of convolutional layers. The below
figure (Fig. 6) represents the schematic view of a basic CNN architecture. Some of the
common CNN architectures include Inception, Xception, VGG Family, ResNet-50 etc.
Inception architecture makes the neural network wider by connecting multiple lay-
ers in parallel with different filters and adding them to move to the next layer. Xception
improvises on older architectures by implementing depth-separable convolution opera-
tions. The VGG Family is, above all, a simple and easy-to-understand CNN architecture.
In the VGG architecture, convolutional layers are added to the aggregation filter size.
VGG-16 and VGG-19 are more widely used.
The ResNet-50 architecture consists of 50 layers that are stacked to form a deep neural
network. It uses link connections, also called residual connections, to allow the network
to learn more efficiently and avoid the problem of leakage gradients. The network is
trained using backpropagation with stochastic gradient descent, where the weights of
the network are adjusted to minimize the difference between the predicted output and the
actual output. Once trained, the ResNet-50 model can be used for image classification
tasks, where it takes an input image and predicts the probability that the image belongs
to a certain class. The model has been shown to achieve high accuracy on a variety of
image classification benchmarks (Fig. 7).
4 Results
In this study, image segmentation methods are applied and compared using images of
skin diseases and a sample set of 25 images were used to compare these algorithms based
on three factors – sensitivity, specificity and accuracy [8, 21]. Mathematical descriptions
of these terms are given in (9), (10) and (11). TP and TN represent images representing
“true positives” and “true negatives,” while FP and FN represent false positives and
false negatives, the four parameters used to calculate the above ratios. Table 1 shows a
comparison of image segmentation methods.
TP + TN
Accuracy = (11)
TP + TN + FP + FN
The behavior of every deep learning model can be represented by a specific parameter
known as the ‘confusion matrix’. It is defined as a tool used to analyze the effective
Design and Analysis of CNN-Based Skin 343
behavior of a classification model by showing the number of true and false predictions
made by the model. The matrix is usually presented in the form of a table, where the
columns depict the class predicted by the model while the rows represent the original
class. The proposed model has seven types of classification of diseases, which results in
a confusion matrix with an order of 7 (seven rows and columns), labelling each disease
from 0 to 6. It can be inferred from the above matrix that when the predicted label matches
the true label, the highest score is obtained in each row, indicating the overall accuracy
of the model as a cumulative average of the scores present across the diagonal of the
matrix. The performance of a neural network can also be analyzed using model accuracy
and model loss with respect to increase in number of epochs (groups of images). The
overall accuracy of the model is found to be close to 97%, whereas the loss of data from
images is minimized to 7% (Fig. 8).
5 Conclusion
The design of an automated skin disease system is composed of image processing as well
as machine learning stages, which are supported by different types of mechanisms. The
image acquisition process is executed using the HAM10000 dataset [7] which provides
a clear overview of the types of skin diseases present across the globe.
The image processing stage consists of data cleaning or image pre-processing which
is done using median filters [20], followed by image segmentation process implemented
using K-means clustering mechanism [19], and the features are extracted following
ABCD rule for skin cancer detection [18] using the overall score used for classifying the
lesion as cancerous or non-cancerous. When it comes to the design of a trained machine
learning model, we make use of deep CNN algorithms [16] in order to classify the type
of skin disease present in the input images through automated visual inspection. From
the comparisons drawn between different CNN methodologies, ResNet-50 is the most
suitable architectures for implementing CNN modelling in the diagnosis of skin-related
disorders. Since the diagnosis of each and every disease might not be feasible within
the scope of this paper, this work could be extended towards providing more efficient
natural remedies for a wider range of diseases.
References
1. Vinay Gautam, Naresh Kumar Trivedi, Abhineet Anand, Rajeev Tiwari, Atef Zaguia, Deepika
Koundal and Sachin Jain, “Early skin disease identification using deep neural network”,
Computer Systems Science & Engineering, 44 (2023): 2259–2275.
2. Viswanatha Reddy Allugunti, “A machine learning model for skin disease classification
using convolution neural network.”, International Journal of Computing, Programming and
Database Management 2022; 3(1): 141–147.
3. Dan Popescu, Mohamed El-Khatib, Hassan El- khatib and Loretta Ichim, “New trends
in melanoma detection using neural networks: A Systematic Review.”, Sensors (Basel,
Switzerland) 22 (2022).
4. Md. Al Mamun and Mohammed Shorif Uddin, “A survey on skin disease detection system.”,
International Journal of Healthcare Informatics, 16 (2021) : 1–17
5. K. S. Rao, Pooja Suresh Yelkar and Omkar Narayan Pise, “Skin disease detection using
machine learning.”, IJERT, Special Issue 2021, ISSN: 2278–0181.
6. Pierre Fontanillas, Babak Alipanahi, Nicholas A. Furlotte, Michael Johnson, Catherine H.
Wilson, Steven J. Pitts, Robert Gentleman and Adam Auton, “Disease risk scores for skin
cancers.”, Nature Communications 12 (2021).
7. Khan, Muhammad & Sharif, Muhammad & Akram, Tallha & Damaševičius, Robertas &
Maskeliunas, Rytis, “Skin Lesion Segmentation and Multiclass Classification Using Deep
Learning Features and Improved Moth Flame Optimization”, Diagnostics (2021).
8. Suphi Onder Bütüner, & Eftal Sehirli, “Comparison of segmentation methods used for bone
fracture images”, The International Archives of the Photogrammetry, Remote Sensing and
Spatial Information Sciences (2021).
9. Bishwas Mandal, Adaeze Okeukwu, & Yihong Theis, “Masked Face Recognition using
ResNet-50”, ArXiv 2021.
10. Widodo, Catur Edi, Ketaki Adi and Rahmad Gernowo, “Medical image processing using
python and open cv”, Journal of Physics: Conference Series, 1524 (2020).
Design and Analysis of CNN-Based Skin 345
11. Shuchi Bhadula, Sachin Sharma, Piyush Juyal, Chitransh Kulshrestha, “Machine learning
algorithms-based skin disease detection”, International Journal of Innovative Technology
and Exploring Engineering (2019).
12. Bin Xie, Xiaoyu He, Shuang Zhao, Yi Li, Juan Su, Xinyu Zhao, Yehong Kuang, Yong Wang
and Xiang Chen, “Xiangyaderm: a clinical image dataset of Asian race for skin disease aided
diagnosis”, LABELS/ HALMICCAI/ CuRIOUS@MICCAI (2019).
13. Zhe Wu, Shuang Zhao, Yonghong Peng, Xiaoyu He, Xinyu Zhao, Kai Huang, Xian Wu, Wei
Fan, Fangfang Li, Mingliang Chen, Jie Li, Weihong Huang, Xiang Chen and Yi Li, “Studies
on different CNN algorithms for face skin disease classification based on clinical images”,
IEEE Access 7 (2019): 66505–66511.
14. Andrei Dascalu and E.O. David, “Skin cancer detection by deep learning and sound analysis
algorithms: A prospective clinical study of an elementary dermoscope”, EBioMedicine 43
(2019):107–113.
15. Kyamelia Roy, Sheli Sinha Chaudhuri, Shaurnav Ghosh, Swarna Kamal Dutta, Proggya
Chakraborty and Rudradeep Sarkar, “Skin disease detection based on different segmenta-
tion techniques”, 2019 International Conference on Opto-Electronics and Applied Optics
(Optronix):1–5.
16. Phung, & Rhee, “A High-Accuracy Model Average Ensemble of Convolutional Neural Net-
works for Classification of Cloud Image Patches on Small Datasets”, Applied Sciences (2019),
9.4500.
17. Pradeep S Chauhan, “Skin cancer and role of herbal medicines”, Asian Journal of Pharmacy
and Pharmacology, 2018.
18. Alafghani, Thaer, “A CMOS 10-bit SAR ADC, with On- Chip Offset Cancellation, for Near-
Field, mm-Wave Imaging Technique, Applied to Skin Cancer Detection”, 2018.
19. Benavente, Patricio & Protopapas, Pavlos & Pichara, Karim, “Automatic Survey- Invariant
Classification of Variable Stars”, The Astrophysical Journal (2017), 845.147.
20. Raju, Rajeswari & Maul, Tomas & Bargiela, Andrzej, “New image processing pipelines for
membrane detection”, Journal of the Institute of Industrial Applications Engineers (2015).
21. G. G. Sundarkumar, V. Ravi and V. Siddeshwar, “One-class support vector machine based
undersampling: Application to churn prediction and insurance fraud detection”, IEEE Interna-
tional Conference on Computational Intelligence and Computing Research (ICCIC), Madurai,
India, 2015.
22. Talluri, A, Gupta, S. (2022).Gender Prediction Based on Morphometry of Eyes Using Deep
Learning Models, ECS Transactions, IoP Science, Volume 107, Number 1, 6665–6675, 2022.
23. Sangeeta Gupta, Dr. Sujoy Bhattacharya (2013). Compression of ECG Signals Using A
Novel Discrete Wavelet Transform Algorithm For Dynamic Arrhythmia Database in pro-
ceedings of Computer Networks and Communications (NetCom), Lecture Notes in Electrical
Engineering.
346 T. V. Reddy et al.
Open Access This chapter is licensed under the terms of the Creative Commons Attribution-
NonCommercial 4.0 International License (http://creativecommons.org/licenses/by-nc/4.0/),
which permits any noncommercial use, sharing, adaptation, distribution and reproduction in any
medium or format, as long as you give appropriate credit to the original author(s) and the source,
provide a link to the Creative Commons license and indicate if changes were made.
The images or other third party material in this chapter are included in the chapter’s Creative
Commons license, unless indicated otherwise in a credit line to the material. If material is not
included in the chapter’s Creative Commons license and your intended use is not permitted by
statutory regulation or exceeds the permitted use, you will need to obtain permission directly from
the copyright holder.