0% found this document useful (0 votes)
8 views52 pages

Skincancer Final Report

The project report details the development of an automated skin cancer detection system using deep learning models, specifically EfficientNet B5 and ResNet50, to classify dermoscopic images of skin lesions. The research addresses the limitations of traditional diagnostic methods, emphasizing the need for early detection to improve treatment outcomes. The dataset utilized consists of 1800 benign and 1497 malignant images, with extensive data augmentation applied to enhance model performance.

Uploaded by

Manasa M Shetty
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views52 pages

Skincancer Final Report

The project report details the development of an automated skin cancer detection system using deep learning models, specifically EfficientNet B5 and ResNet50, to classify dermoscopic images of skin lesions. The research addresses the limitations of traditional diagnostic methods, emphasizing the need for early detection to improve treatment outcomes. The dataset utilized consists of 1800 benign and 1497 malignant images, with extensive data augmentation applied to enhance model performance.

Uploaded by

Manasa M Shetty
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 52

VISVESVARAYA TECHNOLOGICAL UNIVERSITY

BELAGAVI – 590018

A Project Report on
“SKIN CANCER DETECTION”
Submitted in partial fulfillment of the requirements of the Award of degree of

BACHELOR OF ENGINEERING
IN
COMPUTER SCIENCE AND ENGINEERING
Submitted By
MANASA M SHETTY [4JK21CS031]
NIKSHITHA [4JK21CS039]
UNNIKRISHNAN [4JK21CS060]
PRAJEETH [4JK22CS403]

UNDER THE GUIDANCE OF

MR. STANLEY PRADEEP D’SOUZA


Assistant Professor
Department of Computer Science & Engineering

Department of Computer Science and Engineering


A J INSTITUTE OF ENGINEERING AND TECHNOLOGY
NH-66, Kottara Chowki, Mangaluru – 575006, Karnataka, India
A unit of Laxmi Memorial Education Trust®
(Approved by AICTE, New Delhi, affiliated to VTU Belagavi, Recognized by Govt. of Karnataka)
Accredited by NBA (BE: CV, CSE, ECE, ISE, ME)
2024-2025
Department of Computer Science and Engineering

CERTIFICATE
This is to certify that the Project entitled “ SKIN CANCER DETECTION ” is a bonafide
work carried out by MANASA M SHETTY (4JK21CS031), NIKSHITHA (4JK21CS039),
UNNIKRISHNAN (4JK21CS060), PRAJEETH (4JK22CS403) of 8th semester Computer
Science and Engineering in partial fulfillment for the award of the degree of Bachelor of
Engineering in Computer Science & Engineering of the Visvesvaraya Technological
University, Belgavi during the academic year 2024-2025. It is certified that all the suggestions
and corrections indicated for the internal assessment have been incorporated in the report
deposited in the department library. The project report has been approved as it satisfies the
requirements in respect of project work prescribed for the said degree.

Signature of Guide Signature of HOD Signature of Principal

Mr. Stanley D’Souza Dr. Antony P J Dr. Shantharama Rai C


(Assistant Professor) (HOD, Dept of CS&E) (Principal, AJIET, Mangaluru)

Examiners Signature with Date

1.
2.
ACKNOWLEDGEMENT

If words are considered as the tokens of acknowledgements, then the words play the heralding
role of expressing our gratitude.

With proud gratitude we thank God Almighty for all the blessings showered on us and for
completing our project successfully.

We wish to enunciate our special thanks to our paradigmatic and relevant Project coordinator,
Mrs. Ashwitha Shetty, Assistant Professor, and the internal guide Mr. Stanley Pradeep
D’Souza , Assistant Professor, Department of Computer Science and Engineering, AJIET who
gave us throughout our project period with their valuable suggestions and for devoting their
precious time in making this project a success.

We wish to express our deepest gratitude to Dr. Antony P J, Vice Principal and Head of
Department, Computer Science and Engineering, AJIET, for his profound alacrity in our
project and his valuable suggestions.

We are indebted to The Dean Academics, Mr. Mahabaleshwarappa P, for his guidance
and invaluable suggestions steered us towards a greater insight and understanding.

We owe our gratitude to The Principal, Dr. Shantharama Rai C for his whole hearted support
and for his kind permission to undergo the project.

We extend our heartfelt gratitude to the Management of A. J. Institute of Engineering and


Technology, a unit of Laxmi Memorial Education Trust, for their unwavering support
throughout our project journey

In the end, we offer our sincere thanks to our family members and friends for their valuable
suggestions, encouragement and unwavering support.

MANASA M SHETTY [4JK21CS031]


NIKSHITHA [4JK21CS039]
UNNIKRISHNAN [4JK21CS060]
PRAJEETH [4JK22CS403]

i
ABSTRACT

Skin cancer is one of the most common and potentially fatal malignancies. Early detection is
crucial for effective treatment, but traditional diagnostic methods like visual inspection,
dermoscopic analysis, and biopsies are time-consuming and prone to human error. Recent
advances in deep learning offer promising solutions for automating skin lesion classification.
This research explores the use of EfficientNet B5 and ResNet50 models for distinguishing
between benign and malignant skin lesions in dermoscopic images. The dataset used comes
from the International Skin Imaging Collaboration (ISIC) archive, containing 1800 benign
and 1497 malignant images, resized to 224x224x3 pixels. To improve model performance, we
apply extensive data augmentation, including random rotation, shear, height and width zoom,
hair augmentation, and coarse dropout. The ResNet50 model, with its deep residual
connections, addresses the vanishing gradient problem, while EfficientNet B5 balances
accuracy and computational efficiency through compound scaling. Both models are trained
using binary cross-entropy loss and the Adam optimizer. The models are evaluated using
metrics such as accuracy, precision, recall, F1-score, and ROC-AUC. Our results
demonstrate that both models achieve robust performance in classifying skin lesions, with
EfficientNet B5 offering a good trade-off between accuracy and efficiency.

ii
TABLE OF CONTENTS

Chapters Contents Page.No


Acknowledgement i
Abstract ii

List of Contents iii-iv

List of Figures v
List of Tables vi
Introduction
1.1 Overview
1 1.2 Existing System 1- 7
1.3 Proposed System
1.4 Organization of the Report

2 Literature Survey 8-12


Hardware and Software Requirement Specification
3.1 Functional Requirements

3 3.2 Non-Functional Requirements 13-16


3.3 System Requirements
Design and Implementation
4.1 Schema Diagram

4 4.2 E-R Diagram 17-26


4.3 Modules with description

Testing
5 5.1 Test Cases 27-29
Snapshots and Results
6 6.1 ResNet50 30-40
6.2 EfficientNetB5

iii
Conclusion vii

Future works viii-ix

References x

iv
LIST OF FIGURES

Figure No. Title Page No.

Fig 2.1 Overview of Referred Paper 11

Fig 4.1 Schema Diagram 17

Fig 4.2 ER Diagram 19

Fig 6.1.1 Prediction Result (ResNet50) 30

Fig 6.1.2 Model Accuracy Graph (ResNet50) 32

Fig 6.1.3 Model Loss Graph (ResNet50) 34

Fig 6.2.1 Prediction Result (EfficientNet B5) 36

Fig 6.2.2 Model Accuracy Graph (EfficientNet B5) 38

Fig 6.2.3 Model Loss Graph (EfficientNet B5) 39

v
LIST OF TABLES

Table No. Title Page No.

Table 5.1.1 Functional Test Cases 27

Table 5.1.2 Performance Test Cases 28

Table 5.1.3 Model-Specific Test Cases 29

vi
Skin Cancer Detection

CHAPTER 1

INTRODUCTION
1.1 Overview
Skin cancer is the most prevalent form of human malignancy and can be life-threatening if not
diagnosed early. Early detection significantly improves treatment outcomes, but traditional
diagnostic methods rely heavily on visual inspection, dermoscopic analysis, and biopsies,
which are time-consuming and prone to human error. The variability in the appearance of skin
lesions makes accurate diagnosis challenging, even for trained dermatologists. Consequently,
there is a growing need for automated and reliable methods to assist in skin cancer detection.
Recent advancements in deep learning have shown great promise in medical image analysis,
particularly in the classification of skin lesions. Convolutional Neural Networks (CNNs) are
capable of extracting complex patterns and features from dermoscopic images, enabling
accurate classification of skin lesions as benign or malignant. In this study, we employ two
state-of-the-art deep learning models: EfficientNet B5 and ResNet50.

ResNet50 is a 50-layer deep CNN that uses residual connections to address the vanishing
gradient problem, enabling the training of very deep networks without performance
degradation. It has demonstrated strong performance in various image classification tasks.
EfficientNet B5, on the other hand, optimizes network scaling in terms of depth, width, and
resolution, providing a balance between high accuracy and computational efficiency.

The dataset used for this research comes from the International Skin Imaging Collaboration
(ISIC) archive, which includes thousands of labeled dermoscopic images of benign and
malignant skin lesions. To enhance model performance and reduce overfitting, various data
augmentation techniques such as random rotation, shear, zoom, hair augmentation, and coarse
dropout are applied. The primary goal of this research is to develop an automated system that
can accurately classify dermoscopic images, assisting dermatologists in early diagnosis and
reducing diagnostic errors. By leveraging EfficientNet B5 and ResNet50, we aim to
demonstrate the potential of deep learning in improving the accuracy and efficiency of skin
cancer detection.

Medical imaging plays a crucial role in the early detection and diagnosis of skin cancer. High-
resolution dermoscopic images allow dermatologists to analyze skin lesions for subtle patterns
indicative of malignancy. However, the variability in lesion appearance, caused by factors such

Dept of CSE, AJIET, Mangaluru Page 1


Skin Cancer Detection

as lighting, patient skin type, and lesion location, makes manual diagnosis challenging. To
address this, deep learning techniques have been applied to automate the classification of these
images, improving accuracy and reducing human error.
For this study, the dataset is sourced from the International Skin Imaging Collaboration (ISIC)
archive, a leading repository for dermoscopic images of skin lesions. The dataset includes:
1800 images of benign moles, 1497 images of malignant moles. The images are resized to a
uniform resolution of 224x224 pixels with three color channels (RGB) .The dataset is balanced,
making it well-suited for binary classification tasks.

Preprocessing is essential to enhance image quality and prepare the data for training. The
following preprocessing techniques are applied: Normalization: Images are normalized by
scaling pixel values to the range [0, 1] by dividing by 255. Data Augmentation: Various
augmentation techniques are used to improve model generalization, including: Random
Rotation, Shear and Zoom Transformations, Hair Augmentation: Adding synthetic hair to
simulate real-world dermoscopic images, Coarse Dropout: Randomly masking parts of the
image to improve robustnessThe dataset is split into training and test sets: Training Set: 1440
benign and 1197 malignant images (2637 total). Test Set: 360 benign and 300 malignant images
(660 total) . This comprehensive dataset and preprocessing approach help ensure the deep
learning models can effectively distinguish between benign and malignant skin lesions.

Machine learning algorithms learn to recognize patterns associated with the data, make
decisions or predictions based on those patterns. In a broad sense machine learning algorithm
categorized based on the nature of learning task and the data processed into several types.
1. Supervised Learning
In supervised learning, the model is trained on a labeled dataset, meaning the input data comes
with corresponding output labels. The goal is to learn a mapping from inputs to outputs.

2. Unsupervised Learning
In unsupervised learning, the model is trained on an unlabeled dataset and aims to find patterns
or structures within the data.

3. Semi-Supervised Learning
Semi-supervised learning uses a combination of a small amount of labeled data and a large
amount of unlabeled data. This approach is useful when labeling data is expensive or time-
consuming predictions based on those patterns. In a broad sense machine learning algorithm
categorized based on the nature of learning task and the data processed.

Dept of CSE, AJIET, Mangaluru Page 2


Skin Cancer Detection

4. Reinforcement Learning
In reinforcement learning, an agent learns to make decisions by interacting with an
environment. It receives feedback in the form of rewards or penalties.

1.1.1 Problem Statement


Skin cancer is the most commonly diagnosed cancer globally, with millions of new cases
reported annually. Among its types, melanoma is the deadliest, accounting for 75% of skin
cancer-related deaths despite comprising a smaller proportion of overall cases. Early detection
significantly improves survival rates, yet achieving this remains a challenge due to the
following limitations in traditional diagnostic methods:
• Subjective and Inconsistent Diagnoses: Visual inspection and dermoscopic analysis
rely heavily on the expertise and judgment of dermatologists. This introduces
variability, as interpretations may differ across practitioners based on experience and
training.
• Time-Intensive Procedures: Diagnostic workflows often involve detailed visual
analysis followed by confirmatory biopsies, resulting in delays that could impact
treatment outcomes.
• Complexity of Lesions: Skin lesions exhibit diverse morphological features, including
variations in color, size, texture, and borders. These factors make accurate manual
diagnosis challenging, even for trained professionals.
• Lack of Accessibility: In rural or resource-constrained areas, access to dermatologists
and specialized diagnostic tools is limited, delaying early detection and increasing the
likelihood of advanced disease at presentation.

The growing global burden of skin cancer highlights the need for innovative solutions to
improve diagnostic speed, consistency, and accessibility. A robust, automated detection system
leveraging advanced machine learning techniques could assist healthcare providers in early
diagnosis, reducing dependency on invasive procedures and expert availability.

1.1.2 Problem Definition


The primary goal of this project is to develop a deep learning-based automated system for the
early detection of skin cancer. This system leverages advanced neural network architectures,
such as EfficientNet B5 and ResNet50, to classify dermoscopic images of skin lesions as
benign or malignant with high precision and recall. The system is designed to address the
critical challenges of existing diagnostic approaches, including data imbalance, variability in

Dept of CSE, AJIET, Mangaluru Page 3


Skin Cancer Detection

image quality, and the computational inefficiencies of traditional machine learning models.
Through robust preprocessing techniques, such as normalization and data augmentation, the
model aims to improve its generalizability to real-world data, where image noise, lighting, and
resolution often vary. By providing a scalable and efficient solution, this system can support
dermatologists in clinical decision-making, reduce dependency on invasive procedures like
biopsies, and facilitate early diagnosis in resource-limited settings.

1.2 Existing System

The current approaches for skin cancer detection primarily rely on a combination of manual
diagnostic methods and basic machine learning models, each with its limitations:

• Manual Diagnostic Methods: Dermatologists rely on dermoscopes to magnify and


illuminate skin lesions for visual evaluation. This method is subjective and prone to
human error, particularly for lesions with ambiguous or atypical features. Diagnosis
heavily depends on the dermatologist’s expertise, leading to inconsistent outcomes
across practitioners. A biopsy involves excising part or all of the lesion for
microscopic examination by a pathologist. Although highly accurate, this process is
invasive, time-consuming, and expensive. It cannot be routinely used for all patients,
especially in cases where lesions are suspected to be benign.

• Machine Learning-Based Approaches: Early attempts at automating skin cancer


detection used conventional machine learning techniques with handcrafted features
(e.g., texture, shape, and color).
These approaches have significant drawbacks: Requires domain expertise to design
features that capture the characteristics of skin lesions, making the process time-
intensive and error-prone, Performance is limited due to the inability to capture
complex patterns inherent in dermoscopic images, Traditional machine learning
models struggle with large datasets, often leading to computational inefficiency and
reduced applicability in real-world scenarios.

• Challenges in Current Systems: Publicly available datasets (e.g., ISIC) often have
more benign cases than malignant ones, skewing predictions toward the majority class
and reducing sensitivity for detecting malignant lesions. Images in dermoscopic
datasets vary significantly in resolution, lighting, and angle of capture. This variability
complicates feature extraction and model training. Complex models often memorize

Dept of CSE, AJIET, Mangaluru Page 4


Skin Cancer Detection

training data instead of learning generalizable patterns, resulting in poor performance


on unseen cases. Many existing systems are “black boxes,” making it difficult for
clinicians to understand and trust the model’s decision-making process. This lack of
transparency reduces the adoption of AI tools in medical practice. High computational
demands of deep learning models limit their deployment in low-resource settings, such
as rural clinics or hospitals without high-performance computing infrastructure.

1.3 Proposed System

The proposed system introduces significant advancements by leveraging state-of-the-art deep


learning technologies to overcome the shortcomings of existing systems. Key features and
benefits include:

1. Deep Learning Models:

• EfficientNet B5: Uses a compound scaling approach to balance depth, width, and
resolution, ensuring computational efficiency. Highly accurate in extracting relevant
features from complex dermoscopic images while maintaining a low computational
cost.
• ResNet50: Employs residual connections to combat the vanishing gradient problem,
enabling effective training of deeper networks. Excels at capturing subtle features such
as color variations, texture, and edges crucial for distinguishing between benign and
malignant lesions.

2. Data Handling and Preprocessing:

• Dataset: Sourced from the ISIC archive, including 1800 benign and 1497 malignant
labeled images. Balanced dataset ensures equal representation of both categories for
better classification accuracy. high precision and recall, minimizing false negatives.

• Preprocessing Techniques:
o Normalization: Scales pixel values to the [0,1] range to standardize image
inputs.
o Resizing: Images are resized to 224x224x3 (RGB) dimensions to match model
requirements.
o Segmentation: Isolates lesions from the background to focus color variations,
texture, and edges on the region of interest.

Dept of CSE, AJIET, Mangaluru Page 5


Skin Cancer Detection

o Data Augmentation: Techniques like random rotation, zoom, shear


transformations, hair augmentation, and coarse dropout improve generalization
and reduce overfitting.

3. Workflow:

The system follows a well-defined pipeline:

• Image Acquisition: Collect dermoscopic images from datasets like ISIC.


• Preprocessing: Standardize image quality and augment data.
• Segmentation: Focus on lesion regions.
• Feature Extraction: Automatically extract texture, color, and shape patterns using
EfficientNet B5 and ResNet50.
• Classification: Use supervised learning for binary classification (benign vs.
malignant).
• Evaluation: Validate model performance using metrics like accuracy, precision, recall,
F1-score, and ROC-AUC.

4. Training and Optimization:

• Binary Cross-Entropy Loss Function: Optimizes classification performance.


• Adam Optimizer: Ensures faster convergence during training.
• Learning Rate Scheduling and Checkpointing: Dynamically adjusts learning rates
and saves the best-performing model. Use of learning rate scheduling, model
checkpointing, and TPU-based training accelerates computation and improves model.

5. Key Benefits:

• Accuracy: Achieves high precision and recall, minimizing false negatives and false
positives.
• Efficiency: Reduces diagnostic time, enabling quicker decision-making.
• Scalability: Adaptable to larger datasets and real-world clinical settings.
• Automation: Reduces dependency on manual interpretation, allowing widespread use
in areas with limited dermatological expertise.

6. Evaluation Metrics:

• Accuracy: Measures overall performance, System requirements such as Hardware and


software specification.

Dept of CSE, AJIET, Mangaluru Page 6


Skin Cancer Detection

• Precision and Recall: Focus on the trade-off between false positives and false
negatives.
• F1-Score: Balances precision and recall for imbalanced datasets.
• ROC-AUC: Assesses the model's capability to distinguish between the two classes.

1.4 Organization of Project Report

The chapter 1 gives the brief overview of the project including the main objectives of the
project. Its spectacles about the existing system and demerits of that. The proposed system that
overcomes the demerits of the existing system is stated. The chapter 2 briefs the literature
survey of the project. The chapter 3 specifies software Requirement Specification, which
includes Functional requirements, Nonfunctional requirements, System requirements such as
Hardware and software specification. The chapter 4 specifies Design phase of the project which
includes System Architecture, modules, low level and high-level design consisting and gives
the detail implementation of each module. The chapter 5 gives the snap shots and the results.

Dept of CSE, AJIET, Mangaluru Page 7


Skin Cancer Detection

CHAPTER 2

LITERATURE SURVEY

Skin cancer is a major health concern impacting people worldwide. “Melanoma, Basal cell
carcinoma (BCC) and squamous cell carcinoma (SCC) are the most common types”. Early
detection is crucial for effective treatment, as it greatly enhances the chances of a positive
outcome. However, correctly identifying skin conditions cancer, particularly in its starting
stages, poses challenges, with traditional biopsy methods often being invasive and time-
consuming. Recent progress in “artificial intelligence (AI) technology” and its more complex
version, deep learning. have led researchers to investigate automated techniques for detecting
skin cancer detection that are quicker, non-invasive, and potentially more precise. This review
focuses on recent discoveries from four research studies that utilize various advanced AI
techniques to identify different types of skin cancer and melanoma at different stages.

The study “Skin Cancer Classification Using EfficientNet”[1] by Harahap et al. (2024)
examines how well the EfficientNet architecture in identifying different skin cancer,
concentrating on the three main types: BCC, SCC, and melanoma. EfficientNet, a series of
models recognized for their compound scaling and lightweight design, enables high accuracy
while ensuring computational efficiency. The authors tested models ranging from EfficientNet-
B0 to EfficientNet-B7 on a vast collection of skin lesions. The study highlights the benefits of
EfficientNet’s architecture in effectively balancing depth, width, and resolution, which are
scaled up to higher versions (B0 through B7) using a compound scaling method. The findings
indicate that EfficientNet-B4 achieves the best accuracy at 79.69%, demonstrating improved
precision and recall than other models.

An important aspect of the study is the application of transfer learning, where EfficientNet
models are initially trained on ImageNet and subsequently fine-tuned for skin cancer
classification. This approach not only accelerates training but also improves the model's ability
to generalize on the skin cancer dataset, showcasing EfficientNet’s strength in identifying
BCC, SCC, and melanoma. Additionally, the study tackles the problem of an imbalanced
dataset by applying methods to expand the data, such as random flipping and rotation, which
further improved the model’s capacity to accurately classify different types of skin cancer.

The research conducted by Patil and Bellary (2022), titled “Machine Learning Approach in the
Melanoma Cancer Stage Detection[2],” centers for identifying and categorizing melanoma by

Dept of CSE, AJIET, Mangaluru Page 8


Skin Cancer Detection

its stages, utilizing a CNN model that incorporates a new way to measure text similarity
Processing (SMTP) loss function. This SMTP loss function is specifically designed to
differentiate melanoma stages based on tumor thickness, allowing the model to more accurately
identify distinct stages of melanoma.

The study highlights the critical role of early detection in melanoma, a type of cancer known
for spreading quickly progression. Traditional staging methods, such as Clark’s and Breslow’s
indices, require surgical procedures to measure tumor depth and thickness. In contrast, Patil
and Bellary’s model seeks to offer a non-invasive solution that analyzes dermoscopic images
to classify melanoma stages by assessing tumor thickness without requiring surgery. The
SMTP method for calculating loss improves the CNN’s sensitivity, specificity, and accuracy
by focusing on the differences among stages based on tumor thickness, making the model
particularly effective for stage classification.

The study evaluated two classification frameworks: one for a two-stage classification (tumor
thickness < 0.76 mm for Stage 1 and ≥ 0.76 mm for Stage 2) and another for a three-stage
classification that includes Stage 3 for tumor thickness > 1.5 mm. By utilizing this loss
function, the model demonstrates enhanced precision, recall, and F1-score, especially in
distinguishing early-stage melanomas. The non-invasive approach and the accuracy achieved
with the SMTP function represent significant advancements over traditional staging methods,
underscoring the potential of machine learning in facilitating early diagnosis and treatment
planning.

Daghrir et al. (2020) present a hybrid diagnostic system in their study “Melanoma Skin Cancer
Detection Using Deep Learning and Classical Machine Learning Techniques: A Hybrid
Approach[3],” This system merges “deep learning with classical machine learning” methods
to improve the level of accuracy melanoma detection. The authors utilize a “convolutional
neural network (CNN), support vector machines (SVM), and k-nearest neighbors (KNN)” to
classify melanoma, focusing on important lesion characteristics such as color, texture, and
irregular borders. The ensemble method, which employs majority voting, enhances
classification by making use of each model.

The hybrid system starts with image preprocessing to segment and isolate lesions from the
surrounding skin, a crucial step for precise classification. The authors implement techniques
like hair removal and border refinement to minimize noise and artifacts that could disrupt these
model predictions. SVMs are particularly effective in managing non-linear data, while KNN

Dept of CSE, AJIET, Mangaluru Page 9


Skin Cancer Detection

classifies based on the nearest data points, and CNN excels in feature extraction, all
contributing to better overall performance.

This study’s hybrid approach demonstrates that blending human expertise with technology
leads to smarter and more impactful results. machine learning techniques, especially in
complex classification tasks such as skin lesion analysis. The ensemble model reached an
impressive accuracy of 88.4%, surpassing the results show strong and reliable performance of
single models. The success of this method suggests that integrating classifiers can significantly
boost diagnostic accuracy, presenting promising opportunities for practical applications in
dermatology.

The paper “Melanoma Skin Cancer Detection Using Deep Learning and Classical Machine
Learning Techniques” examines various CNN architectures, such as DenseNet169 and
ResNet50, and their effectiveness in identifying different types of skin cancer. The authors
demonstrate that by utilizing transfer learning, models pre-trained on extensive datasets like
“ImageNet will be a good way to help with skin cancer detection, particularly when fine-tuned
on the HAM10000 dataset”, which features a many different approaches of lesion types.

DenseNet169 and ResNet50 are recognized for their robust feature extraction abilities and their
ability to understand complex patterns that are key to understand difference between melanoma
and different kinds of skin lesions. This augmentation strategy aids in reducing overfitting and
enhances the model's generalization capabilities.

The authors also highlight the advantages of transfer learning, noting that pre-trained models
can now be trained faster than ever and perform effectively even with limited datasets. By
utilizing features learned from large datasets, models like DenseNet169 achieved high accuracy
and completeness in melanoma classification. This research shows the power of CNNs and
transfer learning in achieving better results improve diagnostic accuracy for skin cancer,
positioning them as promising tools for practical clinical applications. “The literature on skin
cancer classification showcases a clear evolution from traditional machine learning methods to
advanced deep learning approaches [4]”. Early studies by applying methods such as “Support
Vector Machines (SVM)” with handcrafted features demonstrated the ability of automated
detection but faced limitations due to small datasets and lower accuracy levels. For example,
SVM models achieved accuracies around 76%, which will be constrained by the simplicity of
the features extracted and the dataset size. While these methods offered a step forward, they
lacked scalability and robustness for broader applications.

Dept of CSE, AJIET, Mangaluru Page 10


Skin Cancer Detection

The adoption of “deep learning, particularly Convolutional Neural Networks (CNNs)”,[5] has
transformed skin cancer detection. Models like ResNet50, InceptionV3, and Inception-ResNet
have shown exceptional performance, achieving accuracy rates between 83% and 86% with
large amounts of data like ISIC2018. These advancements are largely attributed the capability
of deep learning models to automatically identify complex patterns in medical images.
Techniques like Enhanced Super-Resolution “Generative Adversarial Networks (ESRGAN)”
have made these models even better by improving image quality, minimizing noise, and
providing clearer data for analysis.

Transfer learning has played a key part in this progress. By fine-tuning pretrained networks
with medical datasets, researchers have made these models more adaptable to domain-specific
challenges. Also, hybrid approaches that bring together CNNs with segmentation techniques
and clustering algorithms have pushed classification and segmentation accuracies beyond 90%,
especially when applied to datasets like ISIC2017 and PH2. Main takeaways from these studies
highlight that shallower networks, such as InceptionV3, often perform better for medical
imaging tasks, as they generalize well across diverse data. Meanwhile, deeper networks like
ResNet50 excel in natural image processing but require fine-tuning to deliver comparable
results for medical images.

Fig 2.1: Overview of Referred Paper

Dept of CSE, AJIET, Mangaluru Page 11


Skin Cancer Detection

Overall, deep learning [6] has drastically changed skin cancer diagnosis, offering faster, more
accurate, and scalable solutions that can complement dermatologists in clinical settings. These
technologies promise consistent and efficient diagnostic support, paving the way for early
detection and better treatment outcomes. However, to fully implement these systems into
practice, further work is needed to improve dataset [7] diversity, model generalizability, and
real-world validation.

Throughout these studies, several recurring themes are evident, particularly the efficacy of
CNNs in skin cancer classification and the importance of preprocessing methods like data
augmentation and segmentation. EfficientNet, with its compound scaling, presents an effective
model for skin cancer classification, striking a balance between performance and
computational efficiency. Conversely, the hybrid model that combines CNN, SVM, and KNN
showcases the benefits of ensemble methods, where multiple algorithms work together to
achieve greater accuracy. Non-invasive staging, as illustrated with the SMTP loss function,
addresses.

Dept of CSE, AJIET, Mangaluru Page 12


Skin Cancer Detection

CHAPTER 3

HARDWARE AND SOFTWARE REQUIREMENTS


System requirement specification provides the details like hardware and software necessary to
carry out this project. Analysis is the phase where actual expectations from the software are set.
The requirements desired from the software are set in analysis phase which are carried on to
design phase where the software is designed to fulfill these requirements.

3.1 Functional Requirements

In software engineering, a functional requirement defines a function of a software system or its


component. A function is described as a set of inputs, the behaviour, and outputs. Functional
requirements may be calculations, technical details, data manipulation and processing and other
specific functionality that define what a system is supposed to accomplish.

1. Image Input and Preprocessing:


• Accept dermoscopic images of skin lesions as input.
• Resize, normalize, and preprocess images to a standard format (e.g., 224x224x3
pixels).
• Apply data augmentation techniques (e.g., rotation, zoom, shear) to enhance
model generalization.
2. Classification of Skin Lesions:
• Accurately classify input images into benign or malignant categories using deep
learning models.
• Provide probability scores or confidence levels for each classification.
3. Data Handling:
• Support for uploading datasets, preferably in common image formats (e.g.,
JPEG, PNG).
• Store and retrieve labeled datasets for training and testing.
4. Training and Model Optimization:
• Train deep learning models (EfficientNet B5 and ResNet50) on labeled datasets
and preprocess images to a standard format.
• Implement optimization techniques like learning rate classify input images into
benign or malignant categories using deep learning model scheduling and model
checkpointing to enhance accuracy.

Dept. of CSE, AJIET, Mangaluru Page 13


Skin Cancer Detection

5. Performance Metrics and Evaluation:


• Display performance metrics such as accuracy, precision, recall, F1-score, and
ROC-AUC for model evaluation.
• Compare performance between EfficientNet B5 and ResNet50 models.
6. Prediction and Feedback:
• Predict the nature of new, unseen skin lesions (benign or malignant) using the
trained model.
• Provide an interface for users to view and interpret predictions.
7. Model Deployment:
• Allow integration of the trained model into a clinical or cloud-based
environment for real-time predictions.
• Provide API endpoints or a web interface for interacting with the model.
8. User Management (if applicable):
• Support for different user roles (e.g., administrators for training and general
users for predictions).
• Secure login and session management.

3.2 Non-functional requirements


A non-functional requirement is a requirement that specifies criteria that can be used to judge
the operation of a system, rather than specific behaviors. Non-functional requirements are often
called qualities of a system.

1. Performance:
• The system should classify images with high accuracy (preferably above 90%)
and low latency.
• Training time for the model should be optimized, leveraging GPU or TPU
acceleration.
2. Scalability:
• The system should handle large datasets (thousands of images) without
significant performance degradation.
• Should support future extensions, such as adding new datasets or incorporating
additional deep learning architectures.
• Support easy retraining and model updates as new data becomes available for
the model should be optimized, leveraging GPU or TPU acceleration, optimize
resource usage during training and inference

Dept. of CSE, AJIET, Mangaluru Page 14


Skin Cancer Detection

3. Reliability:
• Incorporate robust error handling mechanisms for invalid inputs or missing
data.
4. Usability:
• The user interface (if any) should be intuitive, requiring minimal technical
expertise for operation.
• Visualize classification results clearly, including confidence levels and metrics.
5. Security:
• Protect patient data and dermoscopic images, adhering to standards like HIPAA
(if deployed in a clinical setting).
• Ensure secure data storage and communication channels.
6. Maintainability:
• Code should be modular and well-documented to simplify debugging, updates,
and feature additions.
• Support easy retraining and model updates as new data becomes available.
7. Portability:
• The system should be deployable on various platforms (e.g., local machines,
cloud environments, or edge devices).
• Provide containerized solutions (e.g., Docker) for consistent deployment across
environments.
8. Efficiency:
• Optimize resource usage during training and inference to reduce computational
costs.
• Minimize energy consumption, especially for large-scale or cloud-based
deployments.
9. Interoperability:
• Ensure compatibility with standard medical imaging formats and APIs for
integration into existing healthcare workflows.
• Support data import/export to/from popular tools like Excel, CSV, or other
medical record systems.
10. Extensibility:
• Allow for the addition of new models, datasets, or functionalities, such as
ensemble learning or multi-class classification.
• Optimize resource usage during training and inference to reduce computational.

Dept. of CSE, AJIET, Mangaluru Page 15


Skin Cancer Detection

3.3 System requirements

System requirements are usually listed as minimum and recommended. Minimum


requirements must be met for the software to run on your system. Recommended requirements
ensure optimal performance. Meeting the minimum allows the software to function, while
recommended specs provide a better experience.

3.3.1 Software Requirements

• Operating System : Windows Family

• Libraries and Frameworks : Keras, NumPy and Pandas, OpenCV, Scikit-learn

• Web Browser : Google Chrome

• Dataset Sources : ISIC Archive (International Skin Imaging Collaboration)

3.3.2 Hardware Requirements

• RAM : 2 GB or higher

• Processor : Intel Core i9 or AMD Ryzen 9

• Display : 1080p resolution monitor.

• Installed RAM : 8GB

• GPU : NVIDIA GTX 1660 or higher

Dept. of CSE, AJIET, Mangaluru Page 16


Skin Cancer Detection

CHAPTER 4

DESIGN AND IMPLEMENTATION

This work applies deep learning models to images of skin lesions through a systematic pipeline
for image preparation, processing, and analysis. It involves the acquisition phase of images
collected from publicly accessible datasets that are mainly the ISIC archive in the form of high-
quality dermoscopic images of skin lesions. These are inputs into the models, covering different
types of skin problems: types, sizes, shapes, and stages of lesions, thus being a representative
of wide variability. Such details of the skin would be magnified and enlarged via dermoscopic
images so that AI models are able to evaluate these patterns of pigmentation, vascular
structures, and more importantly, distinguish between benign from malignant lesions. This
quality and diversity of the dataset are an important step towards getting an accurate prediction
and good performance. All the images that are taken afterwards get preprocessed to increase
their quality and prepare it for further analysis. The preprocessing steps consisted of noise
removal, which made the dimensions of images similar; hence, making the datasets uniform.
The images are resized with fixed dimensions as 250x250 for EfficientNet-B5 and 256x256
for ResNet-50 but without lesion features being erased, pixel values normalized from 0 to 1 for
easy and efficient running through the neural networks thus providing a more accelerated time
in training.

4.1 Schema diagram:

Fig 4.1 Schema diagram

Dept of CSE, AJIET, Mangaluru Page 17


Skin Cancer Detection

This is a workflow diagram for a skin cancer detection model.

• Image Acquisition : This is the first step where dermoscopic images of skin lesions
are collected. The images are typically obtained from datasets like ISIC or other
medical image repositories.
• Image Pre-processing: In this step, the collected images undergo pre-processing to
improve their quality and prepare them for the next stages. This may include resizing
the images, normalizing pixel values, and applying data augmentation techniques
(such as random rotations, zooming, and flipping) to enhance model generalization.
• Image Segmentation: Image segmentation is the process of isolating the region of
interest (e.g., the skin lesion) from the background. This helps the model focus on the
lesion area, improving the accuracy of the subsequent classification.
• Feature Extraction: In this step, relevant features from the segmented image are
extracted. Features could include texture, color, shape, and edge information that can
help differentiate between benign and malignant lesions. Deep learning models like
EfficientNet B5 and ResNet50 perform feature extraction automatically during the
training phase.
• Classification using Machine Learning Algorithm: The extracted features are used to
train the model to classify the lesions as either benign or malignant. This step involves
using EfficientNet B5 or ResNet50 as the classification algorithms, both of which are
deep learning models suited for image classification tasks.
• Training and Testing: During training, the model learns to classify images based on
the labelled data (benign/malignant). The model is then tested on a separate dataset to
evaluate its performance using metrics like accuracy, precision, recall, and F1-score.

4.2 ER diagram:

ER Diagram maps out the backbone of the Skin Cancer Detection system, emphasizing data
flow and relationships between key components. It supports scalability, accuracy, and
accountability, ensuring robust functionality while facilitating : Image segmentation is the
process of isolating the region of interest from the background. lesions as either benign or
malignant. This step involves using EfficientNet B5 or ResNet50 as the classification
algorithms future enhancements like adding new models, datasets, or supports scalability,
accuracy, and accountability, ensuring robust functionality while facilitating prediction
workflows, backbone of the Skin Cancer Detection system, emphasizing data flow .

Dept of CSE, AJIET, Mangaluru Page 18


Skin Cancer Detection

Fig 4.2 ER diagram

1. Dataset: Represents the collection of dermoscopic images, which serve as input data
for the entire system. This is a key entity since all subsequent processes rely on the
quality and completeness of datasets.
▪ Dataset_ID (PK): Ensures unique identification of each dataset.
▪ Name: Describes the dataset (e.g., "ISIC Archive Dataset 2024").
▪ Source: Specifies the origin of the dataset (e.g., ISIC or HAM10000
repositories).
▪ Total_Images: Records the total number of images available in the
dataset. A dataset named "ISIC 2023" with 3297 dermoscopic images
serves as the input for training the model.

2. Image: Represents each dermoscopic image within a dataset. Each image contains
essential data such as its label (benign or malignant) and its preprocessing status.
▪ Image_ID (PK): A unique identifier for each image.
▪ Dataset_ID (FK): Links the image to its parent dataset.
▪ File_Path: Stores the location of the image file in the system.
▪ Preprocessing_Status: Indicates whether the image has undergone
preprocessing (e.g., resizing, normalization).
▪ Augmentation_Status: Notes whether the image has been augmented
to enhance training (e.g., rotation or zoom applied).
▪ Label: Indicates if the image shows a benign or malignant lesion. An
image with ID 1045 from Dataset "ISIC 2023" is classified as benign
after preprocessing and augmentation.

Dept of CSE, AJIET, Mangaluru Page 19


Skin Cancer Detection

3. Model: Represents the machine learning models (e.g., EfficientNet B5 or ResNet50)


used for classification. Each model is evaluated based on performance metrics like
accuracy and recall.
▪ Model_ID (PK): A unique identifier for each trained model.
▪ Model_Type: Specifies the architecture used (e.g., EfficientNet B5,
ResNet50).
▪ Training_Status: Indicates if the model is fully trained or in progress.
▪ Accuracy, Precision, Recall, F1_Score, ROC_AUC: Performance
metrics used to evaluate the model.
▪ Created_Date: The date the model was trained. Model "EfficientNet
B5" trained on the "ISIC 2023" dataset achieved an accuracy of 92.5%
and is deployed for prediction.

4. Training_Session: Tracks the process of training models on datasets. This entity logs
training details, such as epochs, loss functions, and learning rates, for reproducibility.
▪ Session_ID (PK): A unique identifier for each training session.
▪ Model_ID (FK): Links the session to the model being trained.
▪ Dataset_ID (FK): Links the session to the dataset used for training.
▪ Start_Time, End_Time: Track when the session began and ended.
▪ Epochs: The number of iterations over the dataset during training,
training session using EfficientNet B5.
▪ Loss_Function, Optimizer: Details of the methods used to minimize
error and optimize model performance.
▪ Status: Indicates the current state of training (e.g., completed, in
progress). A training session using EfficientNet B5 on the "ISIC 2023"
dataset completed 50 epochs with the Adam optimizer.

5. Prediction: Captures the results of using a trained model to classify new or existing
images. Each prediction includes the label and the model's confidence score.
▪ Prediction_ID (PK): A unique identifier for each prediction.
▪ Model_ID (FK): Links the prediction to the model used.
▪ Image_ID (FK): Links the prediction to the image analyzed.
▪ Prediction_Label: Indicates the predicted class (e.g., benign or
malignant).
▪ Confidence_Score: Shows confident in its prediction (e.g., 95%).

Dept of CSE, AJIET, Mangaluru Page 20


Skin Cancer Detection

▪ Timestamp: Records the date and time the prediction was made. Model
"ResNet50" predicted that Image 1202 is malignant with 98%
confidence.

6. User: Represents individuals who interact with the system. Users can perform actions
such as uploading datasets, initiating training sessions, or generating predictions.
▪ User_ID (PK): A unique identifier for each user.
▪ Name: The name of the user (e.g., "Dr. Smith").
▪ Role: Defines the user's permissions (e.g., Admin, Clinician).
▪ Email: Contact information.
▪ Password: Encrypted for secure login.
▪ Last_Login: Tracks the user’s most recent activity. Dr. Smith, a
Clinician, logs into the system to classify new dermoscopic images.

7. System_Log: Tracks all actions performed within the system for accountability and
debugging purposes.
▪ Log_ID (PK): A unique identifier for each log entry.
▪ Event_Type: Describes the type of event (e.g., dataset upload, model
training).
▪ Description: Provides additional details about the event.
▪ Timestamp: Records the time of the event.
▪ User_ID (FK): Links the log entry to the user responsible for the event.
An event log shows that User 102 uploaded the "ISIC 2023" dataset on
December 10, 2024.

Detailed Explanation of Relationships

1. Dataset → Image
o A dataset contains multiple images (One-to-Many). This ensures that each
image belongs to a specific dataset, allowing the system to organize and
preprocess images systematically.
2. Dataset → Training_Session
o A dataset is used in multiple training sessions (One-to-Many). This supports the
reusability of datasets for training different models or for ensures belongs to a
specific dataset, allowing the system that each image belongs to a specific
dataset, allowing the system refining existing ones.

Dept of CSE, AJIET, Mangaluru Page 21


Skin Cancer Detection

3. Image → Prediction
o Each image may have multiple predictions associated with it (One-to-Many).
For example, a single image could be analyzed multiple times using different
models.
4. Model → Training_Session
o A model is involved in multiple training sessions (One-to-Many). This allows
tracking of model development across different datasets and configurations.
5. Model → Prediction
o A model generates predictions for multiple images (One-to-Many). This shows
the application of a trained model for real-world classification tasks.
6. Training_Session → Dataset & Model
o Each training session links one dataset and one model (Many-to-One). This
relationship ties the data and the model together, ensuring traceability.
7. User → Dataset, Training_Session, Prediction
o Users manage datasets, initiate training sessions, and make predictions (One-to-
Many). This relationship defines user interactions with the system.
8. User → System_Log
o Each system event is logged with the user who performed it (One-to-Many).
This ensures transparency and accountability.

4.3 Modules with description:

1. Data Collection and Preprocessing

Data collection is the foundational step in building the skin cancer detection system. High-
quality dermoscopic images of skin lesions are sourced from trusted repositories like the
International Skin Imaging Collaboration (ISIC) archive.

This dataset contains thousands of images labeled as benign or malignant, providing a rich
resource for training and testing deep learning models. A balanced dataset is maintained to
ensure the model performs equally well for both classes. To standardize the input data, images
are resized to a resolution of 224x224 pixels and normalized, scaling pixel values to a range of
0 to 1, which helps in uniform training and improves computational efficiency. Preprocessing
techniques are then applied to enhance the dataset further. Data augmentation strategies like
random rotations, zooming, shearing, and coarse dropout are employed to create variations in
the images, simulating real-world conditions and reducing overfitting. A unique step involves

Dept of CSE, AJIET, Mangaluru Page 22


Skin Cancer Detection

adding synthetic hair to the images, mimicking challenges faced in real dermoscopic analysis.
These efforts ensure the model encounters diverse scenarios during training, making it robust
and adaptable to unseen cases in clinical practice.

2. Feature Extraction

Feature extraction is one of the most crucial steps in the classification process. Unlike
traditional methods where domain experts manually define features like color, texture, and
shape, this system leverages deep learning to automate the process. Advanced architectures
like EfficientNet B5 and ResNet50 are employed to extract these features from dermoscopic
images. EfficientNet B5, known for its compound scaling, optimizes the network depth, width,
and resolution, offering high accuracy while maintaining computational efficiency. Its
architecture is particularly suited for medical images where high-resolution details are crucial.

ResNet50, a 50-layer deep neural network, excels in identifying intricate patterns and subtle
variations in skin lesions by utilizing residual connections. These connections mitigate the
vanishing gradient problem, allowing the model to train effectively even at greater depths. The
combination of these models ensures a comprehensive understanding of image features,
enabling precise classification of benign and malignant lesions. This automated extraction of
intricate details significantly reduces reliance on manual feature engineering, expediting the
development process.

3. Model Training

The training module involves using labeled datasets to teach the model to distinguish between
benign and malignant lesions. Both EfficientNet B5 and ResNet50 are fine-tuned using
supervised learning techniques, where labeled examples guide the model in learning patterns
associated with each class. To enhance training efficiency, techniques like binary cross-entropy
loss and the Adam optimizer are used, ensuring fast convergence and minimizing prediction.
Additionally, advanced methods such as learning rate scheduling dynamically adjust the
learning rate to improve model accuracy, while model checkpointing saves the best-performing
versions during training.

This ensures the system’s robustness and ability to generalize to new, unseen data. The training
process is computationally intensive but is optimized using GPUs or TPUs, significantly
reducing training time, while model checkpointing saves the best-performing versions during
training, while maintaining model quality.

Dept of CSE, AJIET, Mangaluru Page 23


Skin Cancer Detection

4. Model Testing and Evaluation

Once the models are trained, their performance is evaluated on a separate test set that mimics
real-world scenarios. This module focuses on validating the model’s ability to generalize and
its effectiveness in differentiating benign from malignant lesions. Multiple performance
metrics are employed, including accuracy, precision, recall, F1-score, and ROC-AUC. These
metrics provide insights into the system’s reliability, particularly in minimizing false negatives
(critical for early detection) and false positives (important for reducing unnecessary biopsies).

This evaluation also includes a comparative analysis of EfficientNet B5 and ResNet50. Each
model’s strengths and weaknesses are assessed, providing guidance for selecting the most
suitable architecture for deployment. The testing phase ensures that only the most robust and
reliable model moves forward for real-world application.

5. Segmentation

Segmentation plays a pivotal role in isolating the lesion area from the background in
dermoscopic images. By using algorithms to segment the region of interest, the model is able
to focus solely on the lesion, eliminating distractions like hair, lighting variations, or other
irrelevant elements. This step not only improves the accuracy of the classification process but
also makes the system more robust in handling diverse datasets with variable quality and
conditions. Advanced segmentation techniques may include methods like hair, lighting
variations, or other that refine lesion boundaries, ensuring only the most relevant regions are
passed to the classification model. This enhanced focus on the lesion allows for better analysis
of key features more robust in handling diverse datasets with variable quality and conditions.
Advanced segmentation like asymmetry, border irregularity, and color distribution—
parameters critical for distinguishing between benign and malignant cases.

6. Classification

The classification module forms the core functionality of the system. This step uses the features
extracted by EfficientNet B5 and ResNet50 to predict whether a skin lesion is benign or
malignant. Each prediction is accompanied by a probability score, offering transparency in the
model's decision-making process. This not only helps in clinical decision-making but also
builds trust in the system by providing interpretable results. By automating the diagnostic
process, this module reduces dependency on invasive procedures like biopsies, especially for
cases that are confidently classified as benign. The combination of high accuracy and for these

Dept of CSE, AJIET, Mangaluru Page 24


Skin Cancer Detection

confidence scoring ensures the model is a valuable assistant to dermatologists, supporting early
detection and treatment planning.

7. System Deployment

The deployment module focuses on making the system accessible to end-users. The trained
models are integrated into clinical or cloud-based environments, offering real-time predictions
through APIs or a web-based interface. Deployment is designed to be flexible, supporting
various platforms such as local servers, cloud environments, and mobile devices.
Containerization using tools like Docker ensures consistent performance across different
systems and simplifies the installation process.

This module also facilitates scalability, allowing the addition of new features, datasets, or
models over time. The real-time functionality ensures that dermatologists and healthcare
providers can quickly analyze dermoscopic images and make informed decisions, even in
resource-constrained settings.

8. User Interface Development

A user-friendly interface is crucial for the practical adoption of the system. This module focuses
on designing an intuitive interface where users can upload images, view predictions, and access
evaluation metrics. The interface may include visualization tools that highlight the features
contributing to the classification, helping users understand the model’s decision-making
process. Role-based access controls and secure login mechanisms ensure that sensitive patient
data is protected, meeting the stringent the real-time functionality ensures that dermatologists
and healthcare requirements of medical applications. The interface bridges the gap between the
technical backend and the clinical end-user, making advanced AI technology accessible to
dermatologists and researchers without requiring extensive technical.

9. Security and Compliance

This module ensures that the system adheres to medical data protection regulations, such as
HIPAA. Measures include encrypted communication channels, secure storage of patient data,
and rigorous access controls. By implementing these measures, the system ensures data privacy
and builds trust among users, the real-time functionality ensures that dermatologists and
healthcare facilitating its adoption in clinical environments. Additionally, compliance with
medical standards ensures the system is suitable for integration into existing healthcare
workflows.

Dept of CSE, AJIET, Mangaluru Page 25


Skin Cancer Detection

10. System Optimization

Optimization is key to the system's efficiency and scalability. Techniques such as model
pruning, quantization, and GPU/TPU acceleration are used to reduce computational costs and
enhance performance. The system is designed to handle large datasets, with provisions for easy
retraining and updates as new data becomes available. This ensures the model remains relevant
and effective in adapting to evolving clinical requirements, making it a sustainable solution for
skin cancer detection.

Dept of CSE, AJIET, Mangaluru Page 26


Skin Cancer Detection

CHAPTER 5
TESTING

Testing is a critical phase in the melanoma skin cancer detection project to ensure the system's
reliability, accuracy, and usability. It involves evaluating the functionality, performance, and
integration of the models (ResNet50 and EfficientNetB5) within the application framework.
Functional testing ensures that key features, such as image uploads, prediction generation, and
error handling, work as expected. Usability testing focuses on the user interface, verifying that
features like drag-and-drop uploads, error messages, and prediction displays are intuitive.

5.1 Test Cases


Table 5.1.1 Functional Test Cases
Test Case
Test Scenario Steps to Execute Expected Outcome
ID
Upload image 1. Open the web app. The image is uploaded
TC_FT_01 2. Upload a valid lesion
functionality successfully, and the system
image. processes it.
Predict button 1. Upload an image. The system predicts the lesion type
TC_FT_02 2. Click "Predict".
functionality (Benign/Malignant) and displays
the confidence score.
Invalid image 1. Upload a non-image file The system displays an error
TC_FT_03
upload (e.g., .txt file). message like "Invalid file format.
Please upload an image."
Model Use multiple test images The models correctly classify the
prediction for ResNet50 and lesions with an acceptable
TC_FT_04
accuracy EfficientNetB5 accuracy.

The conclusion for the test cases outlined in Table 5.1.1 Functional Test Cases is as follows:
1. Robustness of Image Upload: The system successfully processes valid lesion images
and handles invalid file formats gracefully by displaying appropriate error messages.
2. Prediction Accuracy and Functionality: The "Predict" feature accurately identifies
the lesion type (Benign/Malignant) and provides confidence scores, demonstrating its
utility and reliability.
3. Model Performance Validation: The ResNet50 and EfficientNetB5 models perform
as expected, achieving acceptable classification accuracy on the test data.

Dept of CSE, AJIET, Mangaluru Page 27


Skin Cancer Detection

Table 5.1.2 Performance Test Cases

Test Case Test Scenario Steps to Execute Expected Outcome


ID

TC_PT_01 Response time 1. Upload an image. The prediction is displayed


2. Click "Predict".
for prediction within 3-5 seconds.
The system processes all 10
Test the system by uploading
images without crashing or
TC_PT_02 Bulk processing
10 images consecutively.
significant delays.
Measure the time taken to load Models are loaded within an
Model loading
models. acceptable time.
TC_PT_03
time

The conclusion for the performance test cases outlined in Table 5.1.2 Performance Test
Cases is as follows:
1. Prediction Response Time: The system meets the expected performance benchmarks,
with predictions being displayed within the acceptable range of 3–5 seconds, ensuring
timely results for users.
2. Bulk Processing Capability: The system successfully handles multiple consecutive
uploads (10 images) without crashes or significant delays, demonstrating its
robustness and scalability.
3. Model Loading Efficiency: The ResNet50 and EfficientNetB5 models load within the
acceptable time range (5–10 seconds), ensuring minimal delays during initialization.

Table 5.1.3 Model-Specific Test Cases

ResNet50

Test Case Test Scenario Steps to Execute Expected Outcome


ID
ResNet50 achieves an accuracy of
ResNet50 accuracy Test with 50 known
at least 82% on malignant lesion
TC_RES_01
on malignant lesions malignant images.
images.

TC_RES_02 ResNet50 false- Test with 50 benign ResNet50 maintains a low false-
positive rate images. positive rate (e.g., <10%).

Dept of CSE, AJIET, Mangaluru Page 28


Skin Cancer Detection

EfficientNetB5

Test Case Test Scenario Steps to Execute Expected Outcome


ID

EfficientNetB5 Test with 50 known EfficientNetB5 achieves an


TC_EFF_01
accuracy on malignant images. accuracy of at least 88% on
malignant lesions malignant lesion images.
EfficientNetB5 consistently
EfficientNetB5
predicts the same classification for
Use the same image
prediction
TC_EFF_02 the same image with minimal
multiple times.
consistency
confidence score variations.

The conclusion for the model-specific test cases outlined in Table 5.1.3 Model-Specific
Test Cases is as follows:
ResNet50:
1. Accuracy on Malignant Lesions: ResNet50 achieves at least 82% accuracy on
malignant lesion images, demonstrating reliable diagnostic performance.
2. False-Positive Rate: The model maintains a low false-positive rate (<10%) when
tested on benign images, ensuring minimal misclassifications.
EfficientNetB5:
1. Accuracy on Malignant Lesions: EfficientNetB5 achieves a higher accuracy of at
least 88% on malignant lesion images, showcasing superior classification
2. Prediction Consistency: EfficientNetB5 consistently predicts the same
classification for identical images, ensuring stability and reliability.

Dept of CSE, AJIET, Mangaluru Page 29


Skin Cancer Detection

CHAPTER 6

SNAPSHOTS AND RESULTS

In this chapter, we present and analyze the performance of our models, specifically ResNet50
and EfficientNetB5, for melanoma skin cancer detection. The results are showcased through
figures and metrics that highlight the effectiveness of the models in identifying malignant and
benign skin lesions.
The results include:
1. Prediction Outputs: Examples of how the models classify skin lesions, including the
prediction labels and confidence levels.
2. Model Accuracy: Graphical representations of training and testing accuracy over epochs,
showcasing how well the models learned and generalized during training.
3. Model Loss: A detailed evaluation of the loss curves for both models during training and
testing, providing insights into how the models optimized their predictions and
converged.

6.1 ResNet50:

Fig 6.1.1 Prediction Result (ResNet50)

Dept of CSE, AJIET, Mangaluru Page 30


Skin Cancer Detection

The Fig 6.1.1 showcases the diagnosis of melanoma using the ResNet50 model.
1. Interface Breakdown
• Upload Image Section: The user uploaded an image of a skin lesion for analysis.
• Predict Button: Once clicked, the image is passed to the ResNet50 model for inference.

2. Prediction Results
• Malignant Prediction:
o The model classified the lesion as Malignant, suggesting it detected features
typically associated with melanoma.
o Malignant lesions are usually characterized by:
▪ Asymmetry: One half of the lesion differs from the other.
▪ Irregular Borders: Uneven or poorly defined edges.
▪ Color Variation: Shades of black, brown, or even red and white within the
lesion.
▪ Large Diameter: Lesions larger than 6mm are concerning.
▪ Evolution: Changes in the lesion over time.
• Confidence Level: 100%:
o The model assigned 100.0% confidence to this prediction.
o This means the model is highly certain about its decision, which could result
from:
▪ A distinct malignant pattern in the lesion.
▪ High similarity to training images marked as malignant.
▪ Potential overconfidence due to the training process.

3. How ResNet50 Works


• Feature Extraction:
o ResNet50 extracts high-level features using its 50-layer architecture.
o Patterns such as irregular shapes, border distortions, and color gradients are likely
captured.
• Prediction Confidence:
o A SoftMax activation function generates probabilities for the two classes: benign
and malignant.
o In this case, the probability of the malignant class is 100%.
• Model Limitations:
o While the prediction seems accurate, the model's output should be corroborated

Dept of CSE, AJIET, Mangaluru Page 31


Skin Cancer Detection

by medical professionals.
o A 100% confidence score may indicate overfitting, where the model is overly
reliant on specific patterns seen during training.

Fig 6.1.2 Model Accuracy Graph (ResNet50)

The Fig 6.1.2 shows how the ResNet50 model performed during training and testing over 18
epochs.

1. Key Components of the Graph


• X-Axis (Epochs):
o Represents the number of iterations the model went through during
training.
• Y-Axis (Accuracy):
o Accuracy measures the proportion of correctly classified samples.
• Two Curves:
o Training Accuracy (Blue Line): Shows how well the model fits the
training data.
o Testing Accuracy (Orange Line): Reflects the model’s generalization
ability on unseen data.

Dept of CSE, AJIET, Mangaluru Page 32


Skin Cancer Detection

• Training Accuracy:
o Starts at around 67% and improves rapidly, indicating that the model is
learning key features from the data.
• Testing Accuracy:
o Initially fluctuates significantly. This is typical in the early phase as the
model adjusts to the data.

Middle Phase (Epochs 3–10):


• Both curves rise steadily, with training accuracy exceeding 85% and testing
accuracy reaching approximately 82%.
• The divergence between the two curves begins here, indicating that the model
starts to focus on training data, potentially at the cost of generalization.

Final Phase (Epochs 10–18):


• Training Accuracy:
o Plateaus around 87.5%, showing that the model has nearly reached its
learning capacity.
• Testing Accuracy:
o Stabilizes around 82.5%, with some fluctuations.
o The gap between training and testing accuracy suggests mild overfitting.

2. Insights from the Graph


• Strong Performance:
o With final training and testing accuracies of 87.5% and 82.5%, the model
performs well in melanoma detection.
• Generalization:
o The relatively small gap between training and testing accuracy (around
5%) indicates that the model generalizes reasonably well to unseen data.
• Overfitting:
o The divergence after epoch 10 suggests overfitting. The model memorizes
specific patterns in the training data rather than generalizing.
• Test Accuracy Fluctuations:
o Variability in test accuracy could stem from: Small dataset size. High
variability in lesion appearances. The model memorizes specific patterns
in the training data rather than generalizing.

Dept of CSE, AJIET, Mangaluru Page 33


Skin Cancer Detection

Fig 6.1.3 Model Loss Graph(ResNet50)

The above Fig 6.1.3 illustrates how the ResNet50 model’s loss values evolved during training
and testing over 18 epochs. Loss indicates how well the model's predictions align with the true
labels, with lower loss values signifying better performance.

1. Key Components of the Graph

• X-Axis (Epochs):
o Represents the number of training iterations the model completed.
• Y-Axis (Loss):
o Loss measures the model's error, with lower values indicating better
predictive accuracy.
• Two Curves:
o Training Loss (Blue Line): Reflects the error on the training dataset as
the model optimizes its parameters.
o Testing Loss (Orange Line): Indicates the error on unseen data,
measuring how well the model generalizes.

Dept of CSE, AJIET, Mangaluru Page 34


Skin Cancer Detection

Initial Phase (Epochs 0–3):


• Training Loss:
o Starts high (around 1.8), indicating the model begins with poor
predictions as weights are randomly initialized.
o Drops sharply within the first 2 epochs, reaching approximately 0.4,
showing the model learns fundamental patterns rapidly.
• Testing Loss:
o Begins lower than the training loss (around 1.0) and fluctuates more
significantly during the first few epochs. This is typical as the model
adjusts to unseen data during early optimization.

Middle Phase (Epochs 3–10):


• Training Loss:
o Continues to decline gradually, stabilizing around 0.3 by epoch 10. This
indicates the model is refining its understanding of the training data.
• Testing Loss:
o Shows minor fluctuations but stabilizes near 0.4 by epoch 10. The slight
oscillation suggests the model is attempting to generalize while still fine-
tuning its predictions.
Final Phase (Epochs 10–18):
• Training Loss:
o Plateaus around 0.3, indicating the model has nearly reached its capacity
to learn from the training data.
• Testing Loss:
o Remains stable around 0.4 with minor fluctuations, suggesting
consistent generalization.
o A small gap between training and testing loss emerges, hinting at slight
overfitting.

2. Insights from the Graph

• Strong Performance:
o The model demonstrates effective convergence, with training and
testing loss stabilizing at low values by epoch 10.
o The testing loss remains close to the training loss (a small gap of ~0.1).

Dept of CSE, AJIET, Mangaluru Page 35


Skin Cancer Detection

• Overfitting:
o The slight gap between training and testing loss in the later epochs
suggests minor overfitting, where the model memorizes patterns
specific to the training data.
• Testing Loss Fluctuations:
o The small oscillations in testing loss may stem from: Variability in the
dataset. Limited training data causing sensitivity to specific examples.

The ResNet50 model confidently classifies the lesion as malignant with a 100% confidence
score. This result aligns with the model's effective training on malignant features, highlighting
its ability to identify critical patterns in skin lesions.

The accuracy graph indicates the model achieves a final training accuracy of 87.5% and a testing
accuracy of 82.5%. While training and testing accuracy rise steadily through the first 10 epochs,
a gap emerges afterward, suggesting mild overfitting as the model begins to focus more on the
training data.

The loss graph shows a rapid decrease in training loss during the initial epochs, stabilizing at
approximately 0.3 by the end of training. Testing loss follows a similar pattern, stabilizing around
0.4, with minor fluctuations throughout. The small gap between training and testing loss reflects
reasonable generalization with only slight overfitting.

6.2 EfficientNetB5:

Fig 6.2.1 Prediction Result (EfficientNetB5)

Dept of CSE, AJIET, Mangaluru Page 36


Skin Cancer Detection

The Fig 6.2.1 showcases the prediction result when a skin lesion image is input into the
EfficientNetB5 model. The system provides both a classification label and the corresponding
confidence level.

Key Observations

1. Prediction Label:

• The model classifies the lesion as malignant, indicating that the features of the
lesion match those typically associated with cancerous lesions.
• This prediction reflects the model’s training on datasets that differentiate
between malignant and benign skin lesions.

2. Confidence Score:

• The model assigns a confidence score of 55.46% to the prediction.


• This relatively moderate confidence suggests that while the model leans toward
the lesion being malignant, it is not entirely certain. Factors contributing to this
lower confidence might include:
o Ambiguity in the visual features of the lesion.
o Limited or variable representation of similar cases in the training data.
• Such a prediction highlights the importance of additional clinical evaluation or
biopsy to confirm the diagnosis.

3. Insights:

• The model's ability to detect malignant lesions with reasonable confidence


demonstrates its utility in assisting dermatologists, though the moderate
confidence score emphasizes the need for human verification in borderline
cases.
• In real-world applications, predictions with confidence levels below a certain
threshold (e.g., 60%) might be flagged for closer review by medical experts. .
The system provides both a classification label and the corresponding
confidence level.
• The close alignment with the training AUC suggests that the model
generalizes well to unseen data, with minimal overfitting. Testing loss in
assisting, a similar pattern, stabilizing around 0.4, with minor fluctuations
throughout data.

Dept of CSE, AJIET, Mangaluru Page 37


Skin Cancer Detection

Fig 6.2.2 Model Accuracy Graph (EfficientNetB5)

The Fig 6.2.2 illustrates the Training AUC and Testing AUC over 30 epochs, representing
the model's ability to distinguish between malignant and benign lesions. The Area Under the
Curve (AUC) metric ranges from 0 to 1, with higher values indicating better performance.

Key Observations

1. Training AUC (Blue Curve):

• Starts at ~0.65, indicating the model initially has limited knowledge about
classifying lesions correctly.
• Increases rapidly during the first 10 epochs as the model learns key features,
reaching ~0.90.
• Gradually stabilizes after epoch 20, plateauing around 0.95, indicating that the
model has learned most of the discriminative features from the training dataset.

2. Testing AUC (Orange Curve):

• Follows a similar trend to the training AUC, starting lower at ~0.65 but rising
steadily.
• Plateauing occurs around 0.91 after epoch 20, with minor fluctuations.

Dept of CSE, AJIET, Mangaluru Page 38


Skin Cancer Detection

• The close alignment with the training AUC suggests that the model generalizes
well to unseen data, with minimal overfitting.

3. Performance Trends:

• The small gap between training and testing AUC curves highlights the model's
ability to generalize effectively, avoiding significant overfitting.
• Minor fluctuations in the testing AUC may stem from:

o High variability in the appearance of lesions in the test dataset.


o Possible class imbalance in the dataset (e.g., fewer malignant cases
compared to benign cases).

Fig 6.2.3 Model Loss Graph (EfficientNetB5)

The fig 6.2.3 shows the Training Loss and Testing Loss across 30 epochs. Loss indicates the
model’s error during training and evaluation. Lower loss values correspond to better
performance.

Dept of CSE, AJIET, Mangaluru Page 39


Skin Cancer Detection

Key Observations

1. Training Loss (Blue Curve):

• Starts high, around 0.55, indicating a high error rate at the beginning when the
model is untrained.
• Decreases rapidly during the first 5 epochs as the model learns basic patterns
from the training data.
• Continues to decline gradually and stabilizes around 0.22 after epoch 20,
indicating that the model has effectively minimized its error on the training
dataset.

2. Testing Loss (Red Curve):

• Initially aligns closely with the training loss at ~0.55.


• Experiences a steeper and more fluctuating decline compared to the training
loss, reflecting variability in the test data.
• Stabilizes around 0.25, slightly higher than the training loss, highlighting a good
but imperfect generalization.

Performance Trends:

1. Rapid Initial Decline:


• Both curves drop sharply in the first few epochs, a sign that the model quickly
learns fundamental features of the dataset.

• This phase is typical for models optimizing through gradient descent, where
early improvements are more significant.

2. Stabilization Phase:

• After epoch 20, the loss values stabilize, suggesting the model has reached a
point where further training brings diminishing returns.
• Testing loss remaining close to training loss is a positive sign, as it implies
minimal overfitting. The model generalizes well to unseen data but does not
achieve perfect performance.
• Potential variability in the test dataset (e.g., different distributions or harder-to-
classify examples).

Dept of CSE, AJIET, Mangaluru Page 40


CONCLUSION

We evaluated two deep learning models, ResNet50 and EfficientNetB5, for melanoma skin
cancer detection. Both models demonstrated strong performance in classifying skin lesions as
malignant or benign, highlighting the potential of deep learning approaches in aiding
dermatological diagnosis. Below are the key conclusions based on our results. Achieved a final
training accuracy of 87.5% and a testing accuracy of 82.5%, with a relatively small gap
between the two, indicating good generalization with minimal overfitting. The loss stabilized
at approximately 0.3 (training) and 0.4 (testing), showing effective convergence while
maintaining low error rates. Prediction results, such as the confident 100% classification of
malignant lesions, highlight its capacity to detect critical features. However, this confidence
level may reflect overfitting in certain cases and warrants further evaluation. Demonstrated a
high Training AUC of 0.95 and a Testing AUC of 0.91, indicating excellent ability to
distinguish between malignant and benign lesions. The small gap between training and testing
AUC curves highlights the model's ability to generalize effectively, avoiding significant
overfitting. The loss values stabilized at 0.22 (training) and 0.25 (testing), showcasing robust
learning and minimal overfitting. The model's moderate prediction confidence (e.g., 55.46%
confidence for a malignant lesion) reflects its cautious approach, which could be beneficial
in ambiguous cases but also highlights the need for further improvements. EfficientNetB5
balances accuracy with caution, making both models valuable tools in early skin cancer
diagnosis. ResNet50 and EfficientNetB5 both demonstrated strong potential in melanoma
detection, with complementary strengths that could be leveraged in real-world applications.
While ResNet50 is highly confident in its predictions, EfficientNetB5 balances accuracy with
caution, making both models valuable tools in early skin cancer diagnosis. Further refinement
and integration into clinical workflows will be essential to maximize their impact on improving
patient outcomes.

vii
FUTURE WORKS

Future works in a melanoma skin cancer detection project can aim to improve the system’s
accuracy, usability, scalability, and clinical adoption. Here are some potential areas for future
research and development:

1. Improving Model Performance

• Data Augmentation: Develop advanced data augmentation techniques to enhance


model training with limited datasets.
• Multimodal Approaches: Incorporate clinical metadata (e.g., patient age, skin type, or
family history) alongside image data.
• Explainable AI: Focus on making the model's decisions interpretable by
dermatologists for increased trust.
• Transfer Learning: Explore pre-trained models optimized for medical imaging to
improve performance with small datasets.

2. Real-World Applications

• Mobile and Wearable Integration: Adapt the model for real-time use in mobile apps
or wearable devices.
• Edge Computing: Optimize the model for deployment on edge devices to enable
offline processing in remote areas.

3. Dataset Expansion

• Diverse Skin Tones: Include datasets representing various skin tones and
demographics to improve generalization.
• Longitudinal Data: Collect follow-up images over time to detect early changes in skin
lesions.

4. Clinical Validation

• Prospective Studies: Conduct clinical trials to validate the model’s performance in


real-world settings.
• Integration with Dermatology Workflows: Collaborate with healthcare professionals
to refine usability in clinical settings.

viii
5. Enhanced Preprocessing and Feature Engineering

• Advanced Segmentation: Develop better lesion segmentation techniques to isolate


regions of interest with higher precision.
• Feature Analysis: Integrate additional imaging features, such as 3D or dermoscopic
images.

6. Ethical and Regulatory Considerations

• Bias Mitigation: Address biases in datasets to ensure equitable predictions across all
population groups.
• Regulatory Approvals: Work on compliance with FDA/CE standards for medical
device software.

7. Collaborative Frameworks

• Telemedicine Integration: Combine the system with telemedicine platforms for


remote consultation.
• Crowdsourcing Data: Enable patients to contribute anonymized data to continuously
improve the system.

8. Expanding Scope

• Other Skin Conditions: Extend the model to detect other types of skin cancer or
dermatological conditions.
• Hybrid Models: Explore models combining rule-based systems with AI for increased
reliability.

ix
REFERENCES

[1] M. Harahap, A. M. Husein, S. C. Kwok, V. Wizley, J. Leonardi, D. K. Ong, D. Ginting,


and B. A. Silitonga, “Skin cancer classification using EfficientNet architecture,” Bulletin
of Electrical Engineering and Informatics, vol. 13, no. 4, pp. 2716-2728, Aug. 2024. DOI:
10.11591/eei.v13i4.7159.Q. Zhu, Z. Zheng, and Q. Chen, "Resume Information Extraction
with Neural Networks," IEEE Access, vol. 7, pp. 81858-81868, 2019.
[2] R. Patil and S. Bellary, “Machine learning approach in melanoma cancer stage detection,”
Journal of King Saud University – Computer and Information Sciences, vol. 34, pp. 3285-
3293, 2022. DOI: 10.1016/j.jksuci.2020.09.002.
[3] J. Daghrir, L. Tlig, M. Bouchouicha, and M. Sayadi, “Melanoma skin cancer detection
using deep learning and classical machine learning techniques: A hybrid approach,” in 5th
International Conference on Advanced Technologies for Signal and Image Processing
(ATSIP), Sfax, Tunisia, 2020, pp. 1-6. DOI: 10.1109/ATSIP49331.2020.9231801.
[4] K. Kanchana, S. Kavitha, A. K. J. Anoop, and B. Chinthamani, "Optimizing Skin Cancer
Diagnosis with EfficientNet B0-B7 and Patient-Specific Transfer Learning," Asian Pacific
Journal of Cancer Prevention, vol. 25, no. 5, pp. 1795-1802, 2024, doi:
10.31557/APJCP.2024.25.5.1795.
[5] N. Khasanah and M. N. Winnarto, “Application of Deep Learning with ResNet50 for Early
Detection of Melanoma Skin Cancer,” MEDINFTech, vol. 2, no. 1, pp. 16–20, 2024. doi:
10.37034/medinftech.v2i1.31.
[6] W. Gouda, N. U. Sama, G. Al-Waakid, M. Humayun, and N. Z. Jhanjhi, “Detection of Skin
Cancer Based on Skin Lesion Images Using Deep Learning,” Healthcare, vol. 10, no. 7, p.
1183, 2022. doi: 10.3390/healthcare10071183.
[7] SIIM-ISIC Melanoma Classification - Kaggle, “SIIM-ISIC Melanoma Classification,”
Kaggle, 2020.

You might also like