Skin Cancer Detection and Classification using ANN

Mansimransinghanand
5 min readApr 7, 2022

This was an interesting project that I had worked on recently. Skin cancer is term given to the uncontrolled growth of strange skin cells. It occurs whenever unrepaired DNA damages to skin cells triggers mutations, or any other genetic defects, that lead the skin cells to multiply readily and form malignant tumors.

In recent days, skin cancer is commonly seen as one of the most dangerous forms of the Cancers identified in Humans. Skin cancer is classified into various types such as Melanoma, Basal and Squamous Cell Carcinoma out of which Melanoma is the most unpredictable and the most common form of cancer. Melanoma could be a notably deadly variety of skin cancer, and though it justifies solely 4% of all types of skin cancers, it is responsible for 75% of all skin cancer deaths.

So that is all about Skin Cancer and why we need to have more robust, error free and easy to use models for their quick detection.

  • Image processing is a commonly used method for skin cancer detection from the appearance of affected area on the skin.The input to the system is the skin lesion image and then by applying novel image processing techniques, it analyses it to conclude about the presence of skin cancer. The Lesion Image analysis tools checks for the various Melanoma parameters Like Asymmetry, Border, Colour, Diameter, (ABCD rule) etc. by texture, size and shape analysis for image segmentation and feature stages. The extracted feature parameters are used to classify the image as Normal skin and Melanoma cancer lesion.

For this use case we will be using ANN for detection and classification. So before we proceed lets understand what ANN is and how it will be helpful.

  • Artificial Neural Network (ANN) is one of the important branches of Artificial Intelligence, which has been accepted as a brand new technology in computer science for image processing. Neural Networks are currently the area of interest in medicine, particularly in the fields of radiology, urology, cardiology, oncology, etc. Neural Network plays a vital role in an exceedingly call network. It has been used to analyse Melanoma parameters Like Asymmetry, Border, Colour, Diameter, etc. which are calculated using MATLAB from skin cancer images intending to developing diagnostic algorithms that might improve triage practices in the emergency department. Using the ABCD rules for the melanoma skin cancer, we use ANN in classification stage.
ANN internal architecture

Okay, now lets get down to business and discuss the architecture we will be using for this analysis.

The flowchart for Skin Cancer detection

Lets go through each step in more details :-

  1. Image Pre-Processing —The image of skin lesion is given to the computer diagnostic system can be captured in any lighting condition or by using any camera. Hence, it needs to pre-process. The pre-processing steps involves :-
  2. Image Scaling — The course of action of resizing a digital image. The size of an image is reduced or enlarged, the pixels that form the image become increasingly visible, making the image appear soft.
  3. RGB to grayscale conversion — The rgb2gray function converts the true color image RGB to the grayscale intensity image, by eliminating the saturation information
  4. Grayscale to Binary image — Im2bw command converts the grayscale image to a binary image
  5. Segmentation — Image segmentation is the course of action of segregating an image into multiple parts, which is used to identify objects or other relevant information in digital images. Segmentation is proceeded with 3 internal steps which involving,
  6. Background subtraction — Also known as blob detection wherein the an image’s foreground is extracted for further processing.
  7. Edge detection — Catching the boundaries of objects within images. It works by detecting discontinuities in brightness
  8. Masking — setting the pixel values in an image to zero, or some other “background” value. It is used to separate the lesion from the skin image.
  9. Feature Extraction — The foremost features of the Melanoma Skin Lesion are its Geometric Features. Hence, we propose to extract the Geometric Features of the segmented skin lesion. Here, we used some classic geometry features (Area, Perimeter, Greatest Diameter, Circularity Index, Irregularity Index) adopted from the segmented image containing only skin lesion, the image blob of the skin lesion is analysed to extract the geometrical features.

Results:-

  1. Benign Images

Input Image —

Output Image —

Analysis

  • Asymmetry — Not very asymmetric ·
  • Border irregularity. The edges are not ragged, notched, or blurred.
  • Colour — The colour (pigmentation) is uniform. Shades of tan, brown, and black are not Present — Not a mottled appearance.
  • Diameter — The size of the mole is lesser than 1/4 inch (6 mm), about the size of a pencil eraser

Thus, the skin lesion examined is Not Cancerous

2. Malignant Images

Input Image

Output Images

ANALYSIS:

  • Asymmetry — Is asymmetric.
  • Border irregularity — The edges are ragged, notched, or blurred.
  • Color — The color (pigmentation) is non- uniform. Shades of tan, brown, and black are Present. It has a mottled appearance.
  • Diameter — The size of the mole is greater than 1/4 inch (6 mm), about the size of a pencil eraser.

Thus, the skin lesion examined is Cancerous

Conclusion and Future Work

We have discussed a computer-aided diagnosis system for melanoma skin cancer with Artificial Neural Network as a classifier using Back Propagation Algorithm. The present algorithm is fast, consume only a few seconds of execution time and results are found to be better with the accuracy of 96.9%. It can be concluded from the network results that the suggested system can be capably used by patients and physicians to diagnose the skin cancer more exactly. This tool is useful for the rural areas where the experts in the diagnosis field may not be applicable. Since the tool is made more feasible and robust for images acquired in any conditions, it can deliver the purpose of automatic diagnostics of the Melanoma Skin Cancer. In future, we could develop a computer algorithm for skin cancer diagnosis using Support Vector Machine, which is also an emerging technology nowadays

--

--