VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
Image Classification And Skin cancer detection
1. Abstract-Image Classification in medical imaging
applications is extremely important. In our work,
we have used deep learning with CNN to build a
model to classify skin cancer to detect if it’s benign
or malignant. Datasets of skin cancer is challenging
because of format and shape. It’s required effort to
detect different features.Wetrainedandtestedour
model on a dataset from the ISIC (International Skin
Image Collaboration) Archive. The first step is to
prepare data of images with less noise to make it
easy for detection. Then, building CNN model with
four convolutional layers, two max pooling layers,
two dropout layers and 1 flatten layer, two dense
layers .The results of the test produced accuracy of
.8030 .withmoreefforts we canbuildmoreefficient
model to get higher accuracy.
Index Terms-CNN, Skin Cancer, CNN Layers,
Convolution layer, Image Classification, Deep
Learning, Malignant Skin Cancer, Benign Skin
Cancer, Neural Network, Neurons, Kernel Filters,
Cross-Validation.
I.INTRODUCTION
mage classification is a computer vision
problem[1]. It is assigning pixels in the image into
several classes or categories of LULC (land use land
cover)based on the applicationof statistical decision
rules or logical decision rules [2]. In order to classify
a dataset into differentclasses or categoriesthe data
and the classes’ relationship must be well-
understood. so image classifier depends on the role
of discriminant whether discriminant value highest
for one class and lower for other and this is called
multiclass (like the case of recognition of characters
or digits from bitmaps of scanned text) or
discriminantvaluepositivefor one classand negative
for another which is called two class (like the case of
distinguishing between text and graphics in scanned
document).
To achieve this, computer must be trained as
training is the main key of the classification success.
Important aspects of accurate classification is
feature sets which are data elements attributes
based on assigning elements in to various classes, it
could be quantitative or qualitative and learning
techniques that could be supervised learning or
unsupervised learning.
We have chosen one of the algorithms used in
image classification which is CNN (Convolutional
neural network) [3] [4] and we choose to handle the
I
Image Classification
Skin cancer detection with CNN
Eman Othman Fathy , Dina Alaa Ahmed , Dai Alaa Hassan, Mohammed IbrahimGab Allah,
Mohammed Cherif Mohammed, Nihal Mansour Abd-Elbari,Hager IsmailAbd-Elaty.
CairoUniversityFacultyof Engineering –December,2019
2. problems this algorithms faces in the cancer an
especially skin cancer.
In the coming sections you will see why we choose
CNN specifically and why skin cancer.
Why CNN?
There are many types of neural networks out there
like ANN (Artificial neural network), RNN (Recursive
neural network) [5], DNN (Deep neural network) [6]
and lastly but not last CNN (Convolutional Neural
Network) which we choose specifically because it is
the best for image classification tasks as ANN is best
for pattern recognition [7] and other neural
networks are best for other specific application.
CNN is a supervised learning algorithm and it is
different from other neural networks that is has at
least one convolutional layer. The convolution layer
focuses on detecting lower level features such as
edge detection and gradient orientation and others.
CNN has manyadvantagessuch that it trainsfaster,
needs fewer samples and reduces the chances of
overfitting. CNN requires less preprocessing
compared to other classification algorithms. It can
also learn filters itself while other primitive methods
need them to be hand-engineered.
Brief introduction about cancer:
Cancer occurs when normal cells start dividing
uncontrollably and spread into surrounding tissues.
Some of cancer basics are:
A mass called a tumor form due to the
multiplication of the cells.
If a tumor is malignant then it’s cancerous.
This means that they invade neighboring
tissues because of their uncontrolled growth.
Tumors can also travel to remote organs
throw the bloodstream.
Tumors also invade the surrounding tissue's
space and take the oxygen and nutrients they
need to survive and function.
Skin cancer:
Skin cancer is the most common of all human
cancers. It is abnormal growth of skin cells. Most
often occurs on skin exposed to the sun. But it can
also occur on areas of your skin not ordinarily
exposed to sunlight (or specifically ultraviolet (UV)
radiation) [8].
Much of the damage to DNA in skin cells results
fromultraviolet(UV) radiation that found in sunlight.
But sun exposure doesn't explain skin cancers that
occur on areas that rarely see the light of day. This
indicates that other factors may cause skin cancer,
such as being exposed to toxic substances or having
a condition that weakens your immune system.
Skin cancer begins in your skin's top layer (the
epidermis). The epidermis is a thin layer that
provides a protective cover of skin cells that your
body continually sheds.
Treatment is dependent on the specific type of
cancer,locationof the cancer,ageofthe patient, and
whether the cancer is primary or a recurrence.
Currently, surgical excision is the most common
way of treatment for skin cancers. The aim of
reconstructive surgery is restoration of normal
appearance and function. The choice of technique in
reconstruction is dictated by the size and location of
the defect.
Types of skin cancer:
There are two main types of skin cancer are
melanoma and non-melanoma. Melanoma is the
19th most commonly occurring cancer in humans.
Non- melanoma is the 5th most commonly occurring
cancer in humans. It had over 1 million diagnoses
worldwide in 2018.
Non-melanoma skin cancer has two major types:
basal cell carcinoma (BCC) and squamous cell
carcinoma (SCC).
Basal cell carcinoma (BCC) is most often a benign
form of skin cancer. It's usually caused by exposure
to ultraviolet (UV) rays, and it’s the first most
occurring form of all skin cancers.
3. Squamous cell carcinoma (SCC) is the second most
occurring form of all skin cancers. It is also usually
caused by exposure to ultraviolet (UV) rays from the
sun or tanning beds. SCC is a slow-growing skin
cancer and it could become hard to treat ifit spreads
to the tissues, bones, and nearby lymph nodes. But if
SCC was caught early it’s easy to be treated.
Melanoma skin cancer is not common but it is the
most serious type of skin cancer.it can be developed
anywhere on the skin but there are some areas that
has a higher risk to be affected. The most common
affected areas in men are: chest and the back. In
women, the legsarethe most common affected area
[9].
II.MATHEMATICALTHEORY
CNN are a type of Neural Network Architecture.
They are composed of the following layers: conv,
pooling, ReLU, fully Connected With at least one
convolutional layer.Theinput and output of all layers,
except fully connected layers, are 3d volumes.
Figure 1.output of the neuron
A convolution layer consists of a set of filters. Each
neuron is connected to a small volume in the input
volume of the layer (called its receptive field) that
coversa small regionverticallyandhorizontallyofthe
input volume and covers it’s full depth. As shown at
(Figure1)the output of the neuron isthe dot product
of its weights ( 𝑤𝑖) and vectorization of its receptive
field (𝑥 𝑖) plus the neuron bias𝑏.
Like other neural network architectures, gradient
descent is used to iteratively modify the weights and
biases of the CNN to minimize the loss function.
𝐿((𝑥𝑖, 𝑦𝑖), 𝑊)𝑤ℎ𝑒𝑟𝑒(𝑥 𝑖, 𝑦𝑖) are the set of training
images and labels and W being the weight matrix of
the CNN. The gradient of the loss function with
respect to the parameters of the CNN
𝛻 𝑊 𝐿((𝑥 𝑖, 𝑦𝑖), 𝑊)is first calculated using the
backpropagation algorithm. Its negative is the
direction in which nudging the parameters of the
CNN would result inthe greatestdecreaseinthe loss.
We reiterate this procedure till we find a satisfying
model. In practice for large data sets of images
(millions) a loss function that takes as input a small
batch of images randomly sampled from the data set
is used instead of the entire data set hence greatly
reducing the computational cost of learning at the
expense of some error in the gradient. This
technique is sometimes called Batch Gradient
Descent (BGD) or Stochastic Gradient Descent (SGD).
III.METHODS
It has been proved that CNN is very successful in
solving image classification problems. Research
works based on CNNimproved the best performance
for many image databases, including the NORB
database, the MNIST database and the CIFAR10
dataset [10].
It is very good at learning the global and local
structures from image data. General image objects
like human faces or hand written numbers have
obvious local and global structures, hence simple
local features can be combined to become more
complex features such as shapes, corners and
eventually the objects [11].
4. Recently, CNN has joined the medical imaging
analysis such as the knee cartilage segmentation.
Different from these published studies, training a
large neural network with many parameters results
a potential problem which is over-fitting training a
large neural network with many parameters.
The convolutional neural network is typically
consisting of three layers, convolution layer, pooling
layer, and fully connected layer [12]. CNN may
contain optional layers such as dropout layer to help
increasing the efficiency and reducing the over-
fitting, however, the three basic layers (convolution,
pooling, and fully connected layers) are the most
popular architecture for CNN.
Figure 2- CNN Architecture
A. Convolution Layer
The convolution layer performs the most
computational load so basically, it’s the central
structure for the CNN. The layers are like a set of
learnable filters. This layer performs a dot product
between two matrices, the first matrix is the kernels
which is a set of filters that are smaller in size than
the image itself. The kernel filter is used to add any
wanted effect to the image, for example sharpen,
unsharpen, blurs or edge detection. These filters can
be seen as a transformation of the image as
illustrated in (Figure 3).
The second matrix is window matrix of the
receptive field which is typically a fraction of image
with predefined sliding and size. Mostly the kernel
and receptive filed are extended to three channels
because most of the images are composed of three
channels (RGB). The kernel filter or matrix travel
across the input image to produce smaller image
that maps the input image.
Figure 3. Kernel matrix
B. Pooling layer
The main importance of the pooling layer in CNN is
reducing the size of the output layer which produced
from the previous layer by reducing the size of
features the computation time is reduced and the
overfitting .so simply this layer acts as a down
sampling filter, in order to do that the pooling layer
algorithm combines all the neighboring elements in
the convolution layer output matrices.
Pooling could be done by several ways like max
pooling and average pooling; however, the most
popular wayis the maxpooling which we used .in this
work, we selected a (2D) maxpooling layer with
pooling size = 2 × 2[4]. The pooling size must be
chosen as increasing the pooling dimension makes
the down sampling more important. This layer
algorithm generates one element in the output
matrix by selecting the maximum value of the 4
neighboring element in the input matrix as shown in
(Figure 4).
Figure 4. Max pooling with a 2x2 pooling size
5. C. Fully connected layer
The last layer is the fully connected layer also
known as the dense layer. The results of the
convolutional layers (flattened matrix) are fed
through neural layers to generate a prediction as
illustrated in (Figure 5). For example, if the image is
of a cat some features should have high probability
such as a fur feature.
Figure 5.fully connected layer
Other layers:
A. Dropout layer:
This layer lies after the pooling layer. The dropout
is a regularizationtechnique, where some number of
layer outputs (neurons) are randomly ignored or
“dropped out” during training (Figure 6) which
improves the performance.
At the start of each iteration a drop-out map is
initialized to contain the on or off state of each
corresponding neuron. The dropped neurons during
the training iterations is the ones with the off state
on the drop-out map. The neurons are turned back
on during the testing. Applying this technique forces
the network to learn features in a distributed way. It
also reduces the overfitting and improves
generalization.
Figure 6.Drop-out illustration
B. Flatten layer:
The Flatten layer transforms a two-dimensional
matrix of features into a vector that can be fed into
a fully connected neural network classifier as
illustrated in (Figure 7). The flatten layer lies
between the convolutional/maxpool layers and the
fully connected layer. It combines all the found local
features of the previous convolutional layers.
Figure 7.flattening layer
IV. EXPERIMENTAL WORK
Dataset
The dataset is taken from the ISIC (International
Skin Image Collaboration) Archive. This dataset
contains a balanced dataset of images of benign skin
moles and malignant skin moles. It consists of 1800
pictures of benign moles and 1497 pictures of
malignant classified moles. The pictures have all
been resized to low resolution (224x224x3) RGB.The
task of this kernel is to create a model, which can
classify a mole visually into benign and malignant.
6. Eight Steps for building the model:
Figure 8.steps for building the model
Convolutional layers:
In model 1 there is two convolutional layer and in
model 2 we used four exact convolutional layer with
the same Kernel size of model 1 which enables the
neural network to model more complex
relationships and make better analogy for curve
fitting.
There are many other ways to increase the
accuracy of a network of existing depth like shuffling
the data, RMSprop (or other associated techniques),
Dropout, Supervised layer wise training (shameless
plug), changing model hyper parameters, or
even reducing the model complexity (has worked
plenty of times for me).
In this code we has tried to detect these classes of
moles using CNN with keras tensorflow in backend
and analyzed the result to see how the model can be
beneficial.
Cross-validation
Cross-validation is a procedure used to evaluate
CNN models on a limited data sample .It is a popular
simple train/test split method. We used k (the
number of groups that a given data sample is to be
split into) equals 3. This method is dependents on
splitting dataset into k groups then train each group
at k-1 groups eachgroup is trained on k-1 groups and
tested on 1 group.
V. RESULTSANDDISCUSSION
‘Accuracy of Learning-rate’ controls how quickly or
slowly a neural network model learns a problem.
‘Accuracy of cross validation’ determines the
performance of the model after training with cross
validation method.
‘Final accuracy’ determines the performance after
testing the model .It is the final accuracy, which
shows the ability of the CNN model to recognize
benign and malignant skin cancer.
7. Model 1 Model 2
Number of
Convolutional
layers
2 4
Accuracy of
learning rate
Accuracy of
cross
validation
train method
with k=3
69.06% (+/- 3.90%) 75.50% (+/- 3.16%)
Final accuracy .68181 .80303
Adding more convolutional layers to CNN model:
Adding more layers will help to extract more
features. Increases the number of weights in the
network, and thus the model complexity and can
increase the accuracy. but In case of small training
set, over fitting will occur and then accuracy will be
reduced on the test data .so adding more layers is
not always the best option. There is a limit that we
should not overshoot it otherwise, we tend to ‘over fit’
the data instead of extracting features. Over fitting can
make us face some errors like wrong positives.
For more understanding of over fitting problem,
we will explain an example. Consider that we train a
model for detecting cats. If all cats’ features are
detected and we add more layers, if some of these
cats wear bells, it may start detecting this bell as a
part of the cat and this will cause a problem. If there
is a cat without bell, it may classify it as not a cat and
may sometimes classify another animal with bell as
cat. Thishappen because adding morelayers beyond
a certain threshold leads to finding irregularities in
the data.
VI. FUTURE WORK
We will try to improve the CNN model with the use of
hyper-parameters optimization to get a model with
higher feature detection and higher accuracy.
VII. CONCLUSLON
Imageclassificationreferstoa process in computer
vision that can classify an image according to its
visual content and extractinformationclassesfroma
multiband raster image. One of the most important
applications of image classification is the medical
field where the medical image data is produced by
various imaging modalities for treatment planning
8. and diagnosis. In this paper, we specifically
presented the skin cancer and how to detect if it is
benign or malignant. Skin cancer consists of two
main types: melanoma and non-melanoma but
melanoma is one of the most dangerous types of
cancer, the early detection and treatment for it is
critical in the therapy. With the help of the image
classification we can supply a code with huge
number of data and pictures of differenttypes of skin
cancer which helps doctors to determine if it is
dangerous or not and to maintain its way of
treatment. We also introduced the CNN which
represents a huge breakthrough in image
recognition as we used Keras sequential API to add
two convolutional layers at a time starting from the
input which enable the neural network to model
more complex relationships and make better analog
for curve fitting.
REFERENCES
[1]K. He, X. Zhang, S. Ren, and J. Sun, “Deepresidual
learning for image recognition,” in Proceedings of
the IEEE conference on computer vision and pattern
recognition, pp. 770-778, 2016.
[2] Best Accuracy Land Use/Land Cover (LULC)
Classification to Derive Crop Types Using
Multitemporal, Multisensor, and Multi-Polarization
SAR Satellite Images.
[3] Contrasting Convolutional Neural Network (CNN)
with Multi-Layer Perceptron (MLP) for Big Data
Analysis.
[4] Hough-CNN: Deep learning for segmentation of
deep brain regions in MRI and ultrasound.
[5]Deep Recurrent Neural Networks for
Hyperspectral Image Classification.
[6] Polarimetric SAR Image Classification Using Deep
Convolutional Neural Networks.
[7] User Activity Recognition in Smart Homes Using
Pattern Clustering Applied to Temporal ANN
Algorithm.
[8] Dermatologist-level classification of skin cancer
with deep neural networks.
[9] Computer Aided Melanoma Skin Cancer
Detection Using Image Processing.
[10] Combining CNN with Hand-Crafted Features for
Image Classification.
[11] Patch-based Convolutional Neural Network for
Whole Slide Tissue Image Classification.
[12] Convolutional Neural Network for Diagnosing
Skin Cancer.
[13] Medical Image Classification with Convolutional
Neural Network.
APPENDICES
Abbreviations:
CNN stands for Convolutional Neural
Networks
LULC stands for (land use land cover)
ANN stands for Artificial neural network
RNN stands for Recursive neural network
DNN stands for Deep neural network
BCC stands for basal cell carcinoma
SCC stands for squamous cell carcinoma
UV stands for ultraviolet