How Neural Networks Are Being Used For Skin Cancer Classification

Cancer is one of the most dreaded diseases in the world and in spite of the fact that medical advancements are happening at a rapid pace, this evil apparition of a disease continues to affect and take many lives.

This article explores the application of neural networks in particularly skin cancer classification. We would discuss the methods of classification of images for detecting skin cancer with neural networks which can help oncologists and dermatologists diagnose the disease faster, with greater accuracy.

Forms Of Skin Cancer

Skin cancer is mainly caused by sun’s rays inflicting the human skin, causing abnormal growth in skin cells. Although the disease is more prevalent in Western countries, nevertheless the possibilities of skin cancer occuring should not be ignored by people of all skin colors. The following are the forms of skin cancer that arise from the early stages that gradually lead to the last stage.

Subscribe to our Newsletter

Join our editors every weekday evening as they steer you through the most significant news of the day, introduce you to fresh perspectives, and provide unexpected moments of joy
Your newsletter subscriptions are subject to AIM Privacy Policy and Terms and Conditions.
  • Actinic Keratosis: Precancerous growths on the skin that are usually pale, dry spots
  • Basal cell carcinoma: The skin develops pinkish blemishes. It originates in the epidermis layer of skin.
  • Squamous Cell Carcinoma: Red bumps or patches are developed on the skin. If left untreated, it can lead to permanent skin damage.
  • Melanoma: It develops as a small dark mole which left undiagnosed can cause death by spreading to other organs. It originates in skin pigment-producing cells called melanocytes.

The first three forms will sometime lead to melanoma, and should be mitigated at the early onset itself.

Neural Networks For Skin Cancer Classification

Since melanoma is the most dangerous among the various forms of skin cancers, Neural networks (NN) are usually centered around and developed for classification of this specific skin cancer type. However, NN are trained to classify other forms too. In one study by Andre Esteva at Stanford University, NN were trained to classify approximately 2,000 skin cancer variations with more than 1,00,000 images. The sample images which were chosen for classifications are shown below

skin cancer classification
Image Credits : Andre Esteva – Stanford University

The images are classified along two dimensions of tumor growth, benign and malignant, against three forms of skin cancer development called epidermal lesions, melanocytic lesions and dermoscopically observed melanocytic lesions. This is to avoid misclassification by NN and make diagnosis of skin diseases easier.

The type of network architecture used is Inception-V3, which is a deep Convolutional Neural Network (CNN). This NN can make an error of only upto 20 percent, which makes it helpful for image validation to eliminate misclassification to a greater extent. Once the NN is introduced in the process, the training of these image data is segregated into 750 classes, as well as into inference classes along the two dimensions (benign/malignant probability) by using a partitioning algorithm. Another dimension called Non-Neoplastic is also introduced to the inference class considering the possibility of benign growths turning malignant.

Validation And Working

Once the entire NN classification structure is established for skin cancer classification, it is set for validation. This means the set of input images are checked whether they conform to the skin classification scenario or not. The validation can be done according to the dimensions or classes mentioned earlier. Test sets can be images collected for classification and the number can vary with regard to images collected in the context. In the study, the accuracy obtained in validation is close to that of the dermatologist itself (almost 90 percent accurate).

T-distributed stochastic neighbor embedding (t-SNE) is the ML algorithm used for partitioning. The classification basis are visualised below in the picture.

skin cancer classification
Image Credits : Andre Esteva – Stanford University

Although, the validation is done to maintain precision in classification, it will lead to instances where the NN and algorithm might misclassify benign growth as malignant, vice-versa or even give a completely different output altogether. The percentage stands low — at 10 percent — but there is room for improvement to achieve 100 percent accuracy.


There are no regions or organs in the human body that cannot be afflicted by cancer, and that’s why it is important to keep a check on its progression. The earlier the cancer is diagnosed, the easier it is to prevent it from growing and spreading to other parts of the body. This can also lead to curing the threat altogether. This is where machine learning aids oncologists and dermatologists with accuracy and speed.

Abhishek Sharma
I research and cover latest happenings in data science. My fervent interests are in latest technology and humor/comedy (an odd combination!). When I'm not busy reading on these subjects, you'll find me watching movies or playing badminton.

Download our Mobile App

MachineHack | AI Hackathons, Coding & Learning

Host Hackathons & Recruit Great Data Talent!

AIMResearch Pioneering advanced AI market research

With a decade of experience under our belt, we are transforming how businesses use AI & data-driven insights to succeed.

The Gold Standard for Recognizing Excellence in Data Science and Tech Workplaces

With Best Firm Certification, you can effortlessly delve into the minds of your employees, unveil invaluable perspectives, and gain distinguished acclaim for fostering an exceptional company culture.

AIM Leaders Council

World’s Biggest Community Exclusively For Senior Executives In Data Science And Analytics.

3 Ways to Join our Community

Telegram group

Discover special offers, top stories, upcoming events, and more.

Discord Server

Stay Connected with a larger ecosystem of data science and ML Professionals

Subscribe to our Daily newsletter

Get our daily awesome stories & videos in your inbox