0% found this document useful (0 votes)
3 views45 pages

Final

The project report details a novel hybrid deep learning framework for skin cancer detection, combining Generative Adversarial Networks (GANs) with a pretrained VGG16 convolutional neural network. This approach addresses challenges in accurate diagnosis and data imbalance by generating synthetic dermoscopic images, resulting in improved classification performance with a peak accuracy of 86.1%. The study highlights the significance of early detection in reducing mortality rates and enhancing treatment effectiveness.
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)
3 views45 pages

Final

The project report details a novel hybrid deep learning framework for skin cancer detection, combining Generative Adversarial Networks (GANs) with a pretrained VGG16 convolutional neural network. This approach addresses challenges in accurate diagnosis and data imbalance by generating synthetic dermoscopic images, resulting in improved classification performance with a peak accuracy of 86.1%. The study highlights the significance of early detection in reducing mortality rates and enhancing treatment effectiveness.
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/ 45

SKIN CANCER DETECTION USING DEEP

LEARNING TECHNIQUES
PROJECT WORK - II PHASE - I
A PROJECT REPORT
Submitted by

NITHISH KUMAR K I

22CSR136

SANJAY N
22CSR176

KIRUBAKARAN M

22CSL255

in partial fulfilment of the requirements for the award of the degree

of

BACHELOR OF ENGINEERING
IN
COMPUTER SCIENCE AND ENGINEERING
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

KONGU ENGINEERING COLLEGE


(Autonomous)
PERUNDURAI ERODE – 638 060
OCTOBER 2025
ii

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


KONGU ENGINEERING COLLEGE
(Autonomous)
PERUNDURAI ERODE 638 060
OCTOBER 2025
BONAFIDE CERTIFICATE
This is to certify that the Project Report entitled “SKIN CANCER DETECTION
USING DEEP MACHINE LEARNING TECHNIQUES” is the Bonafide record
of project work done by NITHISH KUMAR K I (22CSR136), SANJAY
N(22CSR176) and KIRUBAKARAN M (22CSL255) in partial fulfilment of the
requirements for the award of the Degree of Bachelor of Engineering in Computer Science
and Engineering of Anna University, Chennai during the year 2025-2026.

SUPERVISOR HEAD OF THE DEPARTMENT


(Signature with seal)

Date:

Submitted for the end semester viva voce examination held on ​

INTERNAL EXAMINER EXTERNAL EXAMINER


iii

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


KONGU ENGINEERING COLLEGE
(Autonomous)
PERUNDURAI ERODE–638060
OCTOBER 2025
DECLARATION

We affirm that the Project Report titled “SKIN CANCER DETECTION USING
DEEP LEARNING TECHNIQUES” being submitted in partial fulfillment of the
requirements for the award Bachelor of Engineering is the original work carried
out by us. It has not formed the part of any other project report or dissertation on
the basis of which a degree or award was conferred on an earlier occasion on this
or any other candidate.

Date
NITHISH KUMAR K I
22CSR136

SANJAY N ​
22CSR176

KIRUBAKARAN M
22CSL255

I certify that the declaration made by the above candidate is true to the best of my
knowledge.

Date: Name and Signature of the Supervisor with seal


iv

ABSTRACT

Early detection of skin cancer plays a pivotal role in reducing patient mortality rates and
improving the effectiveness of treatment. However, accurate diagnosis remains a significant
challenge due to the reliance on expert dermatological knowledge and the necessity for large,
diverse, and well-balanced datasets—resources that are often scarce in clinical and low-resource
settings. Moreover, dermoscopic images used in skin cancer classification commonly suffer from
class imbalance, with far fewer malignant samples compared to benign ones, leading to biased
model performance and reduced generalizability.To address these challenges, this project
proposes a novel hybrid deep learning framework that combines Generative Adversarial
Networks (GANs) with a pretrained VGG16 convolutional neural network to enhance
classification performance in detecting skin cancer. The GAN module is utilized to generate
high-quality, realistic synthetic dermoscopic images of underrepresented classes, effectively
augmenting the dataset and mitigating data imbalance. These synthetic images serve to enrich the
training set, providing the classifier with a more representative distribution of both benign and
malignant samples.

Simultaneously, the VGG16 model, known for its deep architecture and powerful feature
extraction capabilities, is leveraged to extract hierarchical visual features from dermoscopic
images. These features are critical for accurately distinguishing between benign and malignant
skin lesions. By integrating the augmented dataset with the pretrained VGG16 network, the
model benefits from both improved data diversity and enhanced feature learning.The proposed
GAN-Augmented VGG16 model was trained and evaluated on the publicly available Skin
Cancer: Malignant vs. Benign dataset. The results demonstrate a significant improvement in
classification performance over several baseline and state-of-the-art models. Specifically, the
proposed model achieved a peak classification accuracy of 86.1%, outperforming DenseNet
(81.5%), ResNet-50 (79.2%), a standard CNN classifier (81.0%), and a generic deep CNN
architecture (72.1%). In addition to accuracy, the proposed method showed improved precision,
recall, and F1-score, indicating a balanced and robust classification capability.
v

ACKNOWLEDGEMENT

We express our sincere thanks and gratitude to Thiru. E. R. K.


KRISHNAN, M.Com. our beloved Correspondent and all other
philanthropic trust members of Kongu Vellalar Institute of Technology
Trust who have always encouraged us in the academic and co-
curricular activities.

We are extremely thankful with no words of formal nature to the


dynamic Principal Dr. R. PARAMESHWARAN, M.E, Ph.D. for
providing necessary facilities to complete our work.

We would like to express our sincere gratitude to our respected


Head of the Department Dr. S. MALLIGA M.E, Ph.D. for providing
necessary facilities.

We extend our thanks to Mr. N. ARAVINDHRAJ, M.E.


Assistant Professor, Computer Science Engineering, Project
Coordinator for his encouragement and valuable advice that made us
carry out the project work successfully.

We extend our gratitude to our Supervisor Mr. N. ARAVINDHRAJ,


M.E. Assistant Professor Computer Science Engineering, for his
valuable ideas and suggestions, which have been very helpful in the
project. We are grateful to all the faculty members of the Computer
Science and Engineering Department, for their support.
vi

TABLE OF CONTENTS

CHAPTER No. TITLE PAGE No.

​ ​
ABSTRACT iv

LIST OF FIGURES viii

LIST OF TABLES ix

1.​ INTRODUCTION 1
1.1​DEEP LEARNING 4

1.2​ SKIN CANCER DETECTION 6

2.​ LITERATURE SURVEY 8

2.1​DEEP LEARNING 8

2.2​SKIN CANCER DETECION 10

2.3​ DEEP LEARNING AND SKIN CANCER \ 11

3.​ REQUIREMENTS SPECIFICATION​ 12

3.1​HARDWARE REQUIREMENTS 12

3.2​SOFTWARE REQUIREMNETS 12
3.3​SOFTWARE DESCRIPTION 13
3.3.1​ COMPONENT OF GOOGLE COLAB​ 13
3.3.2​GOOGLE COLAB 13
4.​ PROPOSED METHODOLOGY:​ 16
4.1​DATA AUGMENTATION USING GAN​ 16
4.1.1​ARCHITECTURE OF GAN 17
4.1.2​ FLOWCHART OF GAN 18
4.2​SKIN CANCER CLASSIFICATION USING VGG16​ 20
4.2.1​ARCHITECTURE OF VGG16 21
4.3​TRANSFER LEARNING APPROACH 22
4.3.1​FINE-TUNING VGG16​ 23
4.4​ MODULES OF PROPOSED WORK​ 24
5.​ RESULTS AND DISCUSSION​ 25
vii

5.1​DATASET DESCRIPTION 22
5.2​PARAMETERS USED FOR EVALUATION 23
5.2.1​PRECISION 24
5.2.2​RECALL 24
5.2.3​F1 SCORE 25
5.2.4​CONFUSION MATRIX​ 26
5.3​TRAINING VS VALIDATION​ 27
5.4​RESULT​ 27
6.​ CONCLUSION AND FUTURE WORK​ 30
6.1​CONCLUSION 31
6.2​FUTURE ENHACEMENT 26
APPENDIX 31
REFERENCES​ 34
MAPPING TO EXISTING GOALS 36
viii

LIST OF FIGURES

FIGURE No. FIGURE NAME PAGE NO

1.1 Deep Learning 3

4.1 Architecture of a Generative Adversarial 13


Network (GAN)
4.2 VGG16 Architecture for Image 14
Classification
4.3 Process Map of GAN Data Augmentation 16

4.4 Comparison of Transfer Learning vs. 17


Training from Scratch
5.1 Sample dataset 22

5.2 Predicted Output 41


ix

LIST OF TABLES

TABLE No. TABLE NAME TABLE No.

5.1 Dataset Validation 23

5.2 Result 26
1
CHAPTER 1

INTRODUCION

1.1 DEEP LEARNING

Deep learning is a rapidly growing field of artificial intelligence that focuses on teaching
computers to think and make decisions similar to the human brain. It is a specialized branch of
machine learning that uses multi-layered neural networks to process and learn from large
volumes of data. These networks, often referred to as artificial neural networks, are designed to
identify patterns, make predictions, and extract meaningful information from raw data such as
images, sound, and text. What makes deep learning unique is its ability to learn automatically
from experience without the need for explicit programming or manual feature extraction. In
recent years, deep learning has become one of the most influential technologies, powering
breakthroughs in computer vision, natural language processing, speech recognition, and, most
importantly, medical image analysis.

The fundamental structure of deep learning is inspired by the human brain, where neurons
are interconnected and work together to process and interpret information. Similarly, artificial
neural networks consist of layers of nodes — an input layer, several hidden layers, and an
output layer. Each node performs simple computations and passes the results to the next layer,
allowing the system to learn complex representations of the input data. The network adjusts its
internal parameters (weights and biases) during the learning process through algorithms such
as backpropagation and gradient descent. These adjustments minimize prediction errors and
improve accuracy over time. Deep learning can handle both structured and unstructured data,
making it especially effective for analyzing complex visual data like medical images.

Convolutional Neural Networks (CNNs) are one of the most widely used architectures in
deep learning, particularly for image-based tasks. CNNs automatically detect important visual
features such as edges, color variations, and textures in an image, which are then used to
classify or segment different regions. In medical imaging, CNNs play a crucial role in
2
identifying diseases by learning the visual differences between healthy and abnormal tissues.
For example, in the detection of skin cancer, CNNs can learn to distinguish between benign
and malignant lesions based on subtle texture and color variations. The study presented in the
base paper demonstrates how deep learning models based on CNN architectures achieve high
accuracy in classifying skin cancer images and even outperform traditional diagnostic
methods.

One major advantage of deep learning is its ability to perform end-to-end learning, which
means that raw data is directly input into the model, and the system automatically learns the
necessary features for accurate prediction. This eliminates the need for manual preprocessing
or handcrafted feature extraction, which were common in earlier machine learning techniques.
Moreover, deep learning models continue to improve as they are exposed to more data,
making them highly scalable and adaptable for different domains. In the context of medical
imaging, this adaptability enables models trained on general image datasets (like ImageNet) to
be fine-tuned for specific diagnostic purposes, such as skin lesion classification. This
approach, known as transfer learning, allows researchers to achieve high performance even
with limited medical data.

However, deep learning also comes with certain challenges. One of the main issues is the
requirement for large amounts of high-quality data. Medical datasets, especially those related
to rare diseases like melanoma, are often limited or imbalanced. To address this problem,
researchers have used techniques such as data augmentation and Generative Adversarial
Networks (GANs). Data augmentation artificially increases the size of a dataset by creating
modified versions of existing images through rotation, flipping, or scaling. GANs, on the
other hand, can generate realistic synthetic images that resemble actual medical data, helping
to balance the dataset and improve model performance. The base study used such approaches
to enhance model accuracy and generalization.

Another limitation of deep learning is its high computational requirement. Training deep
networks often demands powerful hardware such as GPUs or TPUs, which can be expensive
and resource-intensive. Moreover, deep learning models are sometimes considered “black
3
boxes” because it can be difficult to interpret how they arrive at specific predictions. This lack
of transparency poses challenges in sensitive fields like healthcare, where decision
explainability is critical. Nevertheless, ongoing research is addressing this concern through
techniques in explainable AI and visualization tools that help interpret deep learning models’
internal processes.

Deep learning is rapidly moving beyond its foundational Convolutional Neural Network
(CNN) architectures to address more complex problems. Advanced models like Recurrent
Neural Networks (RNNs) and Long Short-Term Memory (LSTM) units are specialized for
analyzing time-series data, making them essential for predicting patient outcomes from
Electronic Health Records (EHRs) and historical clinical sequences. Even more sophisticated
are Transformers, which use a self-attention mechanism to effectively process language and
are now being adapted for multimodal data—integrating images, text reports, and genomic
information to produce comprehensive diagnoses. This ability to fuse diverse data types is
pivotal for realizing the vision of Personalized Medicine, where treatments are precisely
tailored based on a patient's unique genetic and clinical profile, driving advances in drug
discovery and targeted therapies. To counter the inherent complexity of these powerful
models, a major research focus is on Explainable AI (XAI), which employs techniques like
saliency maps to visualize a model's focus during image analysis, providing the transparency
necessary for clinical trust and validation in high-stakes healthcare environments. Finally,
techniques like Federated Learning are addressing data privacy concerns by training models
across decentralized hospital datasets without sharing raw patient information, ensuring that
the benefits of deep learning can be scaled globally while maintaining confidentiality.
4

Figure 1.1 Deep Learning

Deep learning is revolutionizing the medical field by enhancing clinical decision support
systems. These AI-driven tools assist healthcare professionals in diagnosing diseases, predicting
treatment outcomes, and planning personalized therapies with greater accuracy. For instance, in
dermatology, deep learning models can analyze dermoscopic images in real time, providing
immediate diagnostic suggestions that help dermatologists make more informed decisions.
Similarly, in radiology, AI-powered models assist in detecting subtle abnormalities in X-rays,
MRIs, or CT scans that might otherwise go unnoticed by the human eye. This collaboration
between machine intelligence and human expertise not only reduces diagnostic errors but also
improves efficiency by enabling early detection and treatment planning. Furthermore, as deep
learning systems integrate with hospital information systems and electronic medical records, they
contribute to a more connected and data-driven healthcare ecosystem.Additionally, regulatory
frameworks and ethical guidelines are being established to ensure fairness, accountability, and
transparency in AI-driven healthcare solutions. The combination of robust data governance,
explainable model architectures, and interdisciplinary collaboration between computer scientists,
clinicians, and policymakers will shape the next generation of intelligent healthcare systems. As
deep learning continues to evolve, its integration into everyday clinical practice promises not
only to enhance diagnostic precision but also to democratize access to quality healthcare
worldwide.
5
Deep learning models, compared to machine learning models, are far more complex and larger
as they are built with hundreds of interconnected layers. As deep learning technology continues
to advance, the complexity of deep learning network architectures continues to increase. Their
complexity and size contribute to the accuracy deep learning can achieve.

1.2 SKIN CANCER DETECTION

Skin cancer is one of the most prevalent and potentially deadly forms of cancer affecting
humans today. It occurs due to the abnormal and uncontrolled growth of skin cells, which can
spread to other parts of the body if not detected early. The skin, being the largest organ of the
body, acts as a vital barrier that protects internal organs and tissues. However, it is constantly
exposed to environmental stressors such as ultraviolet (UV) radiation, chemicals, and pollutants,
which can damage skin cells and trigger cancerous changes. Skin cancer is broadly classified
into two major categories: melanoma and non-melanoma. Non-melanoma cancers include basal
cell carcinoma (BCC) and squamous cell carcinoma (SCC), which are more common but less
fatal. In contrast, melanoma is less common but highly aggressive, responsible for the majority
of skin cancer deaths worldwide. Early detection is crucial because melanoma can be cured if
diagnosed in its initial stages, but once it spreads, treatment becomes difficult and survival rates
drop drastically.

Traditional skin cancer diagnosis relies on clinical examinations, dermoscopic image analysis,
and biopsy testing. A dermatologist visually inspects the lesion and, if suspicious, recommends a
biopsy for histopathological confirmation. Although this approach provides accurate results, it is
time-consuming, invasive, and costly, often causing discomfort and anxiety in patients.
Moreover, in many developing countries and rural areas, access to dermatological care is limited,
leading to delayed diagnosis and treatment. This gap has created a strong demand for automated,
non-invasive, and cost-effective diagnostic systems that can assist medical professionals and
reach patients in remote regions. With the rise of artificial intelligence (AI), researchers have
begun exploring advanced computational techniques to improve the accuracy and efficiency of
skin cancer detection.

Machine learning and deep learning are among the most promising approaches for automating
the detection process. By training algorithms on large sets of dermoscopic images, these models
6
can learn to differentiate between benign and malignant lesions based on their color, texture, and
shape. Deep learning models, especially Convolutional Neural Networks (CNNs), have shown
exceptional performance in image classification and pattern recognition. The base paper by
Akinrinade and Du demonstrates how deep learning techniques can significantly enhance early
diagnosis by learning subtle visual cues from raw skin images. Unlike conventional image
processing methods that depend on manually selected features, deep learning networks extract
hierarchical features automatically, resulting in higher accuracy and reliability.

The effectiveness of automated skin cancer detection systems also depends on the quality and
diversity of the datasets used for training. Public datasets such as the International Skin Imaging
Collaboration (ISIC) and HAM10000 are commonly used in research for developing and testing
models. However, these datasets often suffer from class imbalance, where benign cases
outnumber malignant ones. To overcome this challenge, the study utilized data augmentation
techniques and Generative Adversarial Networks (GANs) to generate synthetic yet realistic
images of malignant lesions. This not only balanced the dataset but also improved model
generalization. Furthermore, few-shot learning methods were explored to help models learn
effectively from limited samples, a common scenario in medical imaging where obtaining
labeled data is difficult.

The diagnostic accuracy achieved by deep learning models has been remarkable, with some
systems performing at par with experienced dermatologists. CNN-based classifiers, combined
with ensemble or hybrid architectures, have shown improved sensitivity and specificity, reducing
false negatives — a critical factor in life-threatening conditions like melanoma. The research also
emphasizes the use of transfer learning, where pre-trained models such as VGG, ResNet, or
Inception are fine-tuned using medical images to achieve better results with minimal training
data. These advanced techniques have made automated skin cancer detection not only faster and
more efficient but also suitable for integration into telemedicine platforms, enabling remote
diagnosis through mobile and web applications.

Despite these advancements, some challenges remain. The requirement for high-quality
labeled datasets, potential biases in training data, and the interpretability of model predictions are
ongoing concerns. Moreover, differences in skin tone, lighting, and image resolution can affect
7
the accuracy of classification systems. Researchers are now focusing on developing explainable
AI models that provide transparent and interpretable results to build trust among healthcare
professionals. Overall, the combination of artificial intelligence and medical imaging represents
a transformative shift in dermatology. Automated skin cancer detection powered by deep
learning holds the promise of saving lives through early diagnosis, cost-effective screening, and
wider access to healthcare, especially in underserved communities.

1.3 IMAGE BASED SKIN CANCER DETECTION

The core of this quantitative study centers on specialized deep neural network architectures,
primarily Convolutional Neural Networks (CNNs), to acquire and identify highly distinctive
characteristics from the image datasets, facilitating the differentiation between benign and
malignant lesions. CNNs are favored in computer vision due to their inherent ability to capture
both the temporal and spatial properties of an image through the utilization of appropriate filters,
effectively extracting image elements like texture that are significant for cancer identification.
While CNNs have shown exceptional performance, their reliability is often compromised by the
inherent constraints of medical datasets, specifically when trained on a little quantity of image
data, which can lead to overfitting and a reduced ability to generalize successfully. To address
this formidable obstacle, the research introduces the crucial application of few-shot
meta-learning alongside deep learning when diagnosing skin cancer. This few-shot classification
methodology is essential because it enables computer vision models to quickly adapt to new
tasks and situations using only a small number of training samples, which is highly advantageous
in a clinical setting where labeled data may be scarce. The new approach to few-shot
meta-learning utilizes a hybrid network composed of Convolutional Neural Networks and
prototype networks. Fundamentally, the overall computational approach for image-based skin
cancer identification follows a sequence of stages, including preprocessing, image segmentation,
feature extraction, feature reduction, and finally, classification.

A major emphasis of the work is dedicated to overcoming pervasive data challenges, specifically
class imbalance in large datasets, where the ratio of benign to rare malignant cases is skewed,
and the limitations of utilizing small datasets. To boost performance under these constraints, the
research implements strategic data robustness techniques, most notably Transfer Learning and
8
Data Augmentation. Furthermore, to tackle the issues stemming from imbalanced data and
scarcity, the model utilizes Generative Adversarial Networks (GANs), which are employed to
generate synthetic data, thereby improving model performance even in the face of these
deficiencies. Complementary to GANs, the study also explores different sampling techniques and
specialized loss functions that could prove effective for compensating for imbalanced datasets.
The final stage of the research includes an evaluation and comparison between ensemble models
and hybrid models to establish which architecture offers superior effectiveness for the early
detection of skin cancer. This systematic approach, leveraging various deep learning backbones
and advanced data handling techniques, represents a significant step toward developing robust,
highly accurate diagnostic tools that can ultimately improve health outcomes and reduce
mortality rates associated with aggressive cancers like melanoma.
9
CHAPTER 2

LITERATURE SURVEY
2.1 Deep Learning Techniques

Esteva et al. [6] and Simonyan & Zisserman [8], subsequent research has explored how model
architectures and preprocessing pipelines can be optimized to further improve performance in
skin cancer classification tasks. For example, more recent studies have investigated the role of
lesion segmentation not only as a preprocessing step but also as an integrated component of
end-to-end learning systems. Instead of treating segmentation and classification as two separate
stages, researchers have proposed joint models that simultaneously learn to segment the lesion
and classify it. This multi-task learning approach has been shown to improve overall accuracy
and model interpretability, as the segmentation maps can serve as visual explanations for the
classification outcome. Such architectures benefit from attention mechanisms that allow the
network to focus on spatial regions most relevant to malignancy, thus mimicking how a
dermatologist examines a lesion in detail.

Moreover, newer variants of GANs—such as CycleGANs and StyleGANs—have been


introduced to address more nuanced requirements in medical image synthesis. CycleGANs, for
instance, can learn mappings between two unpaired image domains (e.g., benign and malignant
lesions) and generate images that maintain critical semantic structures while adapting styles.
These methods are particularly useful for domain adaptation, where the goal is to generalize a
model trained on one dataset to perform well on another dataset with different visual
characteristics. In the context of skin cancer detection, domain adaptation can help overcome the
discrepancies introduced by different imaging devices, lighting conditions, or geographic and
ethnic variations in skin types. By incorporating synthetic images generated through these
advanced GAN variants, researchers are developing models that are not only accurate but also
more robust across heterogeneous data sources.

Parallel to this, researchers have also explored lightweight CNN architectures such as
MobileNet and EfficientNet for real-time applications on mobile devices and edge computing
platforms. These models, when combined with transfer learning from large-scale networks like
VGG16, offer a promising solution for deploying AI-powered skin lesion diagnostic tools in
10
low-resource settings. MobileNet-based models have been trained on augmented and
GAN-enhanced datasets, demonstrating competitive performance while maintaining low
computational costs. This opens the possibility of integrating AI-assisted skin cancer screening
into mobile health (mHealth) applications, which could potentially reach underserved
populations and facilitate early diagnosis without requiring specialist intervention.

Another significant development in the field is the growing use of ensemble learning
strategies, where multiple deep learning models are combined to produce a more robust and
accurate prediction. In several studies, ensembles of CNNs (e.g., VGG16 + ResNet +
InceptionNet) have been shown to outperform single-model approaches, especially when trained
on augmented datasets that include GAN-generated samples. These ensemble systems benefit
from model diversity, where each model captures different aspects of the data, leading to
improved generalization and reduced prediction variance. Some ensemble methods also employ
confidence scoring and decision fusion techniques, enhancing both reliability and interpretability.

In addition to performance metrics like accuracy and F1-score, recent studies have placed
greater emphasis on calibration—that is, the degree to which predicted probabilities reflect true
likelihoods. Well-calibrated models are crucial in clinical settings where overconfidence in
incorrect predictions could have serious consequences. Techniques such as temperature scaling,
isotonic regression, and Bayesian CNNs have been proposed to improve model calibration.
These methods are particularly relevant when synthetic data (e.g., from GANs) are included in
training, as there is a risk of introducing subtle distribution shifts that affect model confidence.

There is also a growing awareness of the need for fairness and inclusivity in skin cancer AI
research. Traditional datasets often underrepresent certain skin tones, leading to disparities in
model performance across different demographic groups. This issue has prompted initiatives to
build more diverse and representative datasets, as well as methods to debias models during
training. Some researchers are now using GANs not only to generate additional malignant
lesions but also to synthetically balance skin tones within datasets, creating fairer models that
can operate more equitably across populations. This line of work aligns with Brinker et al.'s [10]
emphasis on ethical deployment and has spurred the development of fairness-aware training
algorithms that incorporate demographic variables into model optimization.
11
2.2 Skin Cancer Research

AI systems for skin cancer detection are also being integrated with other modalities and data
sources. Multimodal learning approaches combine dermoscopic images with patient metadata
such as age, sex, lesion location, and medical history. Incorporating this auxiliary information
into CNN architectures has been shown to improve diagnostic performance, particularly in
ambiguous cases where image data alone is insufficient. These systems often use dual-input
models or attention-based fusion techniques to learn how to weigh different modalities
appropriately during inference.

Finally, while the literature highlights many technical advancements, a recurring theme is the
gap between model development and real-world clinical deployment. Despite achieving high
accuracy in experimental settings, AI models still face several hurdles before being adopted in
everyday clinical workflows. These include lack of regulatory approval, interoperability with
electronic health record (EHR) systems, medico-legal concerns, and the need for user training
among clinicians. Addressing these challenges requires interdisciplinary collaboration between
AI researchers, dermatologists, regulatory bodies, and health system administrators.
Furthermore, the future of skin cancer AI systems lies in building tools that are not only accurate
but also transparent, user-friendly, and adaptable to various healthcare contexts.

The convergence of preprocessing techniques, advanced generative models like GANs,


and powerful pretrained CNN architectures such as VGG16 has led to substantial improvements
in the automated detection of skin cancer. The literature reflects a strong consensus on the value
of combining these methods into a unified pipeline that enhances both the quantity and quality of
training data, as well as the depth and relevance of extracted features. However, despite these
technological advancements, several challenges remain—including the need for explainable AI,
clinical validation, and equitable performance across diverse patient groups. As the field evolves,
future research must focus not only on improving diagnostic accuracy but also on ensuring that
these AI-driven solutions are ethical, trustworthy, and ready for integration into real-world
healthcare systems.
12
2.3 Skin Cancer and Deep Learning

Deep learning has become a cornerstone in the automated detection and classification of skin
cancer, offering powerful tools for analyzing dermoscopic images with high accuracy. Among
the various architectures, Convolutional Neural Networks (CNNs) have shown exceptional
capability in learning complex visual features directly from image data. Models such as VGG16,
ResNet, and InceptionV3 have been widely used to extract hierarchical features that help
distinguish between benign and malignant skin lesions. These architectures have significantly
reduced the need for manual feature engineering, enabling end-to-end learning from raw image
inputs.

Recent research has expanded beyond single-modality image analysis to multimodal deep
learning, where dermoscopic images are combined with patient metadata such as age, gender,
lesion location, and medical history. This integration allows models to capture both visual and
contextual cues, improving diagnostic accuracy—especially in ambiguous or borderline cases.
Dual-input CNNs and attention-based fusion models are commonly employed to weigh and learn
from different data modalities effectively during inference.

In addition to classification networks, Generative Adversarial Networks (GANs) have emerged


as an important advancement in skin cancer research. GANs are used to augment limited datasets
by generating realistic synthetic dermoscopic images, thereby addressing class imbalance and
improving model generalization. This is particularly valuable given the scarcity of labeled
medical images and the ethical constraints of patient data sharing. Combining GAN-based data
augmentation with pretrained CNN models like VGG16 and ResNet50 has been shown to
substantially improve overall performance in skin lesion detection tasks.

Despite these advancements, there remains a significant gap between research performance and
real-world clinical application. Many AI models achieve high accuracy in laboratory conditions
but face challenges such as lack of regulatory approval, interoperability issues with electronic
health record (EHR) systems, ethical concerns, and the need for clinician training.
13
CHAPTER 3

SOFTWARE REQUIREMENT SPECIFICATION

3.1​HARDWARE REQUIREMENT

Processor​ :​ Intel Core i5

RAM​ :​ 16 GB

Hard Disk​ :​ 2 TB

3.2​SOFTWARE REQUIREMENTS

Operating System​ : Windows 11 ​

Tool​ :​ Google Colab

Language​ :​ Python

3.3​SOFTWARE DESCRIPTION

3.3.1​Google Colab

Google Colab, short for Google Colaboratory, is a cloud-based platform developed by


Google that enables users to write, execute, and share code in an interactive and
collaborative environment. It is built on the framework of Jupyter Notebooks, making it a
powerful tool for data analysis, machine learning, and research-based programming. One of
the major advantages of Google Colab is that it provides free access to computational
resources, including GPUs (Graphics Processing Units) and TPUs (Tensor Processing
Units), which are essential for running deep learning models and large-scale data processing
tasks. Users can write code in Python directly in the browser, import datasets from Google
Drive, GitHub, or local files, and visualize outputs instantly. The platform also supports
collaborative features similar to Google Docs, allowing multiple users to work on the same
14
notebook in real time. This makes it especially useful for students, researchers, and
developers who want to experiment with code, train machine learning models, and share
results without worrying about hardware limitations or complex software installations.
Overall, Google Colab has become a widely used platform in academia and industry for its
accessibility, ease of use, and seamless integration with Google’s cloud ecosystem.

3.3.2​Components of Google Colab

Toolbar: The Toolbar in Google Colab plays an essential role in managing both the
notebook environment and computational resources. It provides users with quick access to
important functions such as connecting to a runtime, starting, stopping, or restarting the
Colab runtime, which gives complete control over the execution of code cells. This feature
ensures that users can efficiently manage system resources and resolve issues like kernel
crashes or memory overloads without losing their work. In addition to runtime management,
the toolbar offers convenient options for saving and exporting notebooks in multiple
formats, such as Python Notebook (.ipynb), PDF, and direct GitHub integration for version
control and collaboration. Users can also save their progress directly to Google Drive,
ensuring that their work is automatically backed up and easily accessible from any device.
The toolbar’s layout is intuitive and user-friendly, allowing even beginners to manage their
projects effectively while maintaining a seamless workflow in a cloud-based coding
environment
.
Menu Bar: The menu bar includes options for accessing Google services directly from
Colab,such as importing data from Google Sheets or integrating with Google Cloud
services. This integration enhances the connectivity of Colab with the broader Google
ecosystem. Colab supports interactive forms, allowing users to create interactive widgets
for parameterizing and controlling code execution. This is useful for building user-friendly
interfaces within the notebook.

Notebook Interface: Google Colab allows multiple users to collaborate on the same
notebook simultaneously. This real-time collaboration feature is facilitated through Google
15
Drive, making it easy for teams to work together on data science projects.

Real-Time Co-editing: Multiple users can edit the document at the exact same time, and
you can see a colored cursor indicating where other collaborators are typing their changes
instantly.

Sharing and Permissions: You can easily share your document with specific people via
email or a link and set their access level as Editor, Commenter, or Viewer.

Comments: You can add comments on specific parts of the document to provide feedback,
ask questions, or discuss a section without altering the main text. You can also tag (mention)
specific collaborators to assign them a task or direct a comment their way.

Suggesting Mode: This mode allows you to make changes that appear as suggestions,
similar to "Track Changes" in Microsoft Word. Other collaborators can then review, accept,
or reject each suggestion.

Version History: Google Docs automatically saves every change and allows you to view a
complete history of all revisions, see who made which changes, and even revert to an older
version of the document.

Integrated Communication: You can often start a chat or a Google Meet call directly from
within a Google Doc (especially with Google Workspace accounts).
16

CHAPTER 4

SKIN CANCER DETECTION USING DEEP LEARNING


TECHNIQUES

To detect skin cancer using deep learning, start by collecting a labeled dataset of
dermoscopic images, with categories such as benign and malignant. Preprocess the images by
resizing, normalizing pixel values, and removing noise or artifacts like hair or shadows. Data
augmentation techniques such as rotation, flipping, and scaling can also be applied to increase
dataset diversity and reduce overfitting. Next, select an appropriate deep learning architecture,
such as a Convolutional Neural Network (CNN), or leverage transfer learning with pre-trained
models like VGG16 for more accurate feature extraction. Generative Adversarial Networks
(GANs) may also be used to generate synthetic images, helping address class imbalance and
improve model robustness. Train the chosen model on the dataset, fine-tuning hyperparameters
for optimal performance. Finally, evaluate the model using metrics such as accuracy, sensitivity,
specificity, precision, recall, F1-score, and ROC-AUC to assess its effectiveness in classifying
skin lesions and detecting cancer.

Figure 4.1 Dermoscopic


17
4.1​DATA AUGMENTATION USING GAN
Generative Adversarial Networks (GANs) are a class of deep learning architectures
consisting of two neural networks, a Generator and a Discriminator, that compete against
each other in a zero-sum game. Introduced by Ian Goodfellow and his colleagues in 2014,
GANs have revolutionized the field of generative modeling, enabling the creation of highly
realistic synthetic data that is nearly indistinguishable from real data. They are widely used
for tasks such as image synthesis, data augmentation, style transfer, and super-resolution

Key components of GAN include:


•​ Generator Network
•​ Discriminator Network

4.1.1​ARCHITECTURE OF GAN

Figure 4.2 Architecture of GAN


18

Generative Adversarial Networks (GANs) consist of two main neural networks, a


Generator and a Discriminator, which engage in a continuous learning game.

•​ Generator: This network's role is to learn the underlying distribution of the


real data and produce new, synthetic data samples that are as convincing as
possible
•​ Discriminator:Its job is to distinguish between real data samples and the "generated
fake samples" produced by the Generator.

4.1.2​FLOW CHART

In recent years, deep learning approaches have driven remarkable advancements in


the field of medical image analysis, revolutionizing how visual data is interpreted and
processed. Convolutional Neural Networks (CNNs) have demonstrated outstanding
performance in the automatic detection and classification of skin cancer, showcasing the
adaptability of deep learning models for various medical imaging tasks. To address the
challenges associated with accurate and early diagnosis, this work introduces a
comprehensive deep learning-based framework for skin cancer detection that leverages
CNNs, Generative Adversarial Networks (GANs), and the VGG16 architecture. The
proposed approach aims to enhance diagnostic accuracy by effectively learning
discriminative features from dermoscopic images and mitigating data imbalance through
GAN-based image augmentation, ultimately enabling precise classification of skin lesions
into multiple cancer categories
19

Figure 4.3 Process Map

Furthermore, the integration of Generative Adversarial Networks (GANs) plays a crucial role in
improving the robustness of the proposed model. By generating high-quality synthetic
dermoscopic images, GANs help overcome the limitations of small and imbalanced datasets,
which are common in medical imaging research. This data augmentation process not only
increases the diversity of the training data but also prevents overfitting, ensuring that the CNN
model generalizes well to unseen cases. The GAN-generated images preserve important texture
and color variations of real skin lesions, making them effective for training deep neural networks
to distinguish between benign and malignant conditions.

In addition, the adoption of the VGG16 architecture enhances the model’s ability to extract
fine-grained features from complex dermoscopic patterns. VGG16’s deep hierarchical structure
allows the network to capture subtle differences in lesion morphology, color distribution, and
border irregularities—key indicators used in clinical diagnosis. The combination of CNN-based
feature extraction, GAN-based data augmentation, and VGG16 fine-tuning forms a powerful
end-to-end pipeline for skin cancer classification. This framework not only automates the
diagnostic process but also offers a scalable and efficient solution for assisting dermatologists in
early detection and treatment planning.
20

Data Collection:Gathering a diverse dataset of dermoscopic and clinical skin images


representing various types of skin lesions, including both benign and malignant cases, from
Kaggle Skin Cancer Detection: maliganent vs bengin

Generator: This network's role is to learn the underlying distribution of the real data and
produce new, synthetic data samples (e.g., images) that are as convincing as possible. It takes a
"latent random variable" (noise) as input and transforms it into a generated sample, aiming to
fool the Discriminator into classifying its output as real.

Discriminator: This network acts as a binary classifier. Its job is to distinguish between real data
samples (from the actual dataset) and the "generated fake samples" produced by the Generator. It
learns to output a "condition" or probability indicating whether an input is likely real or fake,
essentially answering the question "Is it correct?"

Real Data Samples: These are the actual, authentic data points from the dataset that the
Generator aims to mimic and the Discriminator uses as a reference for reality.

Latent Random Variable: This is a random noise vector sampled from a simple distribution
(e.g., Gaussian). The Generator uses this noise as a seed to create diverse outputs, as different
noise vectors lead to different generated samples.

4.2.VGG16 OVERVIEW

Convolutional Neural Networks (CNNs) are powerful deep learning models that
automatically extract important visual features from medical images, making them highly
effective for skin cancer detection. Generative Adversarial Networks (GANs) enhance model
performance by generating synthetic skin lesion images to overcome data imbalance and
improve training diversity. VGG16, a pre-trained CNN architecture with 16 layers, is used for
deep feature extraction and classification due to its proven accuracy in image recognition tasks.
Together, CNNs, GANs, and VGG16 provide a robust framework for precise and automated
identification of skin cancer from dermoscopic images
21

4.2.1​ ARCHITECTURE OF VGG16


The architecture for skin cancer detection is based on deep convolutional neural
networks (CNNs) integrated with Generative Adversarial Networks (GANs) and
the VGG16 model. CNNs extract spatial features from dermoscopic images, GANs
generate synthetic images to enhance dataset diversity, and VGG16 serves as a pre-trained
backbone for accurate feature extraction for detection

Figure 4.4 VGG16 ARCHITECTURE

The architecture used for skin cancer detection integrates Convolutional Neural
Networks (CNNs), Generative Adversarial Networks (GANs), and the VGG16 model to
achieve high accuracy in image-based classification tasks. CNNs are composed of
multiple convolutional, pooling, and fully connected layers that automatically learn spatial
hierarchies of features from input dermoscopic images. These layers help extract low-level
to high-level visual patterns essential for distinguishing between benign and malignant
lesions.VGG16, a deep CNN architecture with 16 weight layers, is utilized as the
backbone network for feature extraction. It consists of 13 convolutional layers and 3 fully
22
connected layers, employing small 3×3 filters to capture fine image details while
maintaining computational efficiency. The output from the final fully connected layer is
used for classification into various skin cancer categories.
The GAN component comprises two main networks — the generator and the
discriminator. The generator creates synthetic skin lesion images to augment the training
dataset, while the discriminator evaluates their authenticity, improving the model’s
generalization and robustness.
This combined architecture leverages the strengths of CNNs for feature extraction,
GANs for data augmentation, and VGG16 for precise classification, resulting in a reliable
and efficient framework for automated skin cancer detection.
The architecture used for skin cancer detection integrates Convolutional Neural Networks
(CNNs), Generative Adversarial Networks (GANs), and the VGG16 model to achieve
high accuracy in image-based classification tasks. CNNs are composed of multiple
convolutional, pooling, and fully connected layers that automatically learn spatial
hierarchies of features from input dermoscopic images. These layers help extract low-level
to high-level visual patterns essential for distinguishing between benign and malignant
lesions.VGG16, a deep CNN architecture with 16 weight layers, is utilized as the
backbone network for feature extraction. It consists of 13 convolutional layers and 3 fully
connected layers, employing small 3×3 filters to capture fine image details while
maintaining computational efficiency. The output from the final fully connected layer is
used for classification into various skin cancer categories.
The GAN component comprises two main networks — the generator and the
discriminator. The generator creates synthetic skin lesion images to augment the training
dataset, while the discriminator evaluates their authenticity, improving the model’s
generalization and robustness.
This combined architecture leverages the strengths of CNNs for feature extraction,
GANs for data augmentation, and VGG16 for precise classification, resulting in a reliable
and efficient framework for automated skin cancer detection.
23
4.2.2​IMAGE-VECTOR REPRESENTATION
Image-to-vector representation is a technique used to convert images into fixed-size
numerical feature vectors that can be processed by deep learning models. Each image is
transformed into a high-dimensional vector containing visual features such as color, texture, and
shape. Convolutional Neural Networks (CNNs) and pre-trained models like VGG16 are
commonly used to extract these features, ensuring that images with similar visual patterns have
similar vector representations. This representation allows the model to effectively learn and
classify different types of skin lesions in skin cancer detection tasks.

4.2.3 .IMAGE-VECTOR REPRESENTATION WITH CNN

When Convolutional Neural Networks (CNNs) are used for tasks involving image data such
as skin cancer detection, images are first converted into numerical feature representations through
a series of convolution and pooling operations. Each image is represented as a fixed-size vector
containing extracted spatial and textural features, which serve as input to the network for
classification. Pre-trained architectures like VGG16 are often utilized to obtain these deep feature
vectors, as they efficiently capture intricate visual patterns from medical images. The CNN with
image-to-vector representation enables the model to learn discriminative features that help
accurately classify skin lesions into benign or malignant categories.

4.2​GAN
The system utilizes Generative Adversarial Networks (GANs) to address data imbalance
and enhance the diversity of skin cancer image datasets. A GAN consists of two neural
networks—the generator and the discriminator—that are trained simultaneously in a competitive
process. The generator creates synthetic but realistic skin lesion images, while the discriminator
evaluates them against real images, improving the generator’s ability to produce high-quality
synthetic data over time. These generated images are used to augment the training dataset,
enabling the CNN and VGG16 models to learn more generalized and robust features. This
approach enhances classification accuracy, particularly when real malignant samples are limited,
leading to a more reliable and efficient skin cancer detection system.
24
4.3 MODULES OF THE PROPOSED WORK

a)​Data Preprocessing

b)​Data Augmentation

c)​Deep Learning Model


d)​Feature Extraction
e)​Classification Layer
f)​Loss Function
g)​Training
h) Evaluation
i) Fine-Tune

a)​Data Preprocessing:
Image Cleaning: Removing noise and artifacts to ensure clear and consistent input images.​
Resizing: Adjusting all images to a fixed size (e.g., 224×224) suitable for CNN.​
Normalization: Scaling pixel values between 0 and 1 for stable model training.​
Augmentation: Using GANs and basic transformations like rotation and flipping.
b)​Data Augmentation:
​ This layer converts skin lesion images into numerical feature vectors that can be
processed by deep learning models. Pre-trained architectures like VGG16 are used to
extract deep visual features such as texture, color, and shape, enabling accurate
classification of skin lesions.
c)​Deep Learning Model:

Convolutional Neural Networks (CNNs): Used for extracting spatial and textural features from
skin lesion images.​
​ VGG16 Architecture: A pre-trained deep CNN model applied for precise feature
extraction and image classification.​
​ Generative Adversarial Networks (GANs): Employed for generating synthetic skin lesion
25
images to balance the dataset and improve model robustness.

d)​Feature Extraction:

​ Extracting relevant features from the data using the chosen deep learning architecture.
e)​Layer:
​ A fully connected layer is used to map the extracted image features to specific skin lesion
categories. Activation functions such as Softmax are applied to convert the outputs into
class probabilities, enabling accurate classification of skin lesions as benign or malignant.
f)​ Loss Function:
​ The loss function defines the objective to minimize during model training. For skin
cancer detection, categorical cross-entropy is commonly used to measure the difference
between the predicted and actual lesion categories, guiding the model to improve its
classification accuracy.
g)​ Training:
​ Training the model on labeled data using techniques like gradient descent and
backpropagation.
h)​)Evaluation:
​ Assessing the model's performance on a separate validation or test set using metrics like
accuracy, precision, recall, F1-score, or confusion matrices to correctly assess skin lesion.
i)​ Fine-Tuning:
Fine-tuning the model on specific domain data or adjusting hyperparameters to improve
performance on the target task
26

CHAPTER 5

RESULTS AND DISCUSSION

5.1​DATASET DESCRIPTION

The dataset used in this study is the Kaggle Skin Cancer: Malignant vs Benign dataset,
which contains high-quality dermoscopic images of various skin lesions. It is widely utilized in
research on skin cancer detection and classification. The dataset includes two primary categories
— malignant and benign — enabling effective binary classification for diagnostic purposes. It
presents significant visual similarity between classes, making it ideal for evaluating the
robustness of deep learning models. This dataset is crucial for training and testing models aimed
at early and accurate detection of skin cancer. Given the medical sensitivity of the images,
adherence to ethical guidelines and patient privacy protection is strictly maintained..

Figure 5.1 Sample dataset


27

We need to preprocess the image data to reduce computational complexity and improve
model performance. For data preprocessing, image cleaning techniques are applied to remove
noise, artifacts, and unwanted background elements from dermoscopic images. These cleaned
and enhanced images are then resized and normalized before being fed into the deep learning
models. The system is
The system aims to identify different types of skin lesions, specifically focusing on two primary
categories: benign and malignant. The architecture integrates Convolutional Neural Networks
(CNNs) and VGG16, leveraging their feature extraction capabilities, while Generative
Adversarial Networks (GANs) are used to augment the dataset and enhance classification
accuracy in skin cancer detection tasks.

Validation Test Train

Split Percentage (%) 10 10 80

Split Value 1600 1600 12800

Table 5.1 Dataset Validation

5.2​PARAMETERS USED FOR EVALUATION


The parameters used for evaluating the dataset are precision, recall, F1 score
and Confusion matrix.

TP - True
Positive
TN - True
Negative
FN - False
28
Negative
FP - False
Positive

5.2.1​Precision

Precision assesses how well you can identify true positives (TP) from all positive
forecasts (TP+FP).

Precision = TP/(TP+FP)

5.2.2​Recall

The recall is calculated as the ratio between the numbers of positive samples correctly
classified as positive to the total number of positive samples.

Recall = TP/(TP+FN)
5.2.3​F1 Score

The F1 score is a measure of a model's accuracy that takes both precision and recall
into account. It is especially useful when dealing with imbalanced datasets or when both
false positives and false negatives need to be minimized.
The F1 score is calculated using the following formula:

F1 Score = (2 * Precision * Recall) / (Precision + Recall)

5.3​COMPARISON BETWEEN TRAINING AND VALIDATION

The comparative study demonstrated that each model exhibits unique strengths in skin cancer
detection. CNN provided strong performance in capturing spatial and textural patterns of skin
lesions, while VGG16 delivered high accuracy through deep hierarchical feature extraction. The
inclusion of GAN improved data diversity by generating synthetic images, which enhanced the
model’s ability to generalize during validation.

By combining these techniques, the system achieved improved performance and reduced
overfitting between the training and validation phases. The results indicate that integrating
29
GAN-based augmentation with CNN and VGG16 architectures significantly enhances the reliability
and precision of skin cancer classification. This work contributes to the advancement of automated
medical image analysis, supporting early detection and more effective diagnosis of skin cancer in
real-world applications

Figure 5.2 output

5.4 RESULT

​ With its high accuracy, the VGG16–GAN-based model demonstrates strong capability in
distinguishing between different types of skin lesions, effectively identifying benign and malignant
cases. This result highlights the model’s ability to capture subtle visual patterns and textural
differences in dermoscopic images, which are crucial for accurate skin cancer detection. While the
achieved accuracy is impressive, additional performance metrics such as precision, recall, and
F1-score are also considered to provide a comprehensive evaluation of the model’s effectiveness.

Analyzing misclassified samples helps identify potential limitations, such as visually


similar lesion types or insufficient image quality, which can guide further optimization.
Continuous retraining with updated datasets and improved GAN-generated images will
enhance the system’s reliability and diagnostic accuracy over time, supporting more
effective and automated skin cancer screening.
30

MODEL ACCURACY F1 Score


(%)
CNN 81.5 0.58
SVM 84.3 0.59
VGG16 86 0.69
31

CHAPTER 6

CONCLUSION AND FUTURE WORK

6.1​CONCLUSION

The proposed CNN–VGG16–GAN-based system achieved high accuracy in detecting and


classifying skin lesions, effectively distinguishing between benign and malignant cases. This
result demonstrates the model’s strong ability to analyze dermoscopic images and extract
meaningful visual features essential for early skin cancer detection. By integrating GANs for
data augmentation and VGG16 for deep feature extraction, the system enhances diagnostic
reliability and supports AI-assisted medical diagnosis. Continuous evaluation and refinement
will further improve its performance, ensuring robustness and adaptability in real-world clinical
applications.

6.2 FUTURE ENHANCEMENT

Future research should focus on improving the model’s adaptability and robustness by
incorporating a more diverse and extensive collection of dermoscopic images that represent
various skin tones, lighting conditions, and lesion types. Implementing real-time diagnostic
feedback systems and continuous learning mechanisms can enhance the model’s accuracy and
responsiveness in clinical settings. Further exploration of multi-modal approaches, integrating
image data with patient history or metadata, may provide a more comprehensive understanding
of skin cancer diagnosis. Expanding the model’s scope to include additional deep learning
architectures and optimizing GAN-generated data will further enhance detection precision and
reliability, ultimately supporting early and more accurate identification of skin cancer.
32

APPENDIX
from google.colab import drive
drive.mount('/content/drive')

import os

base_dir = "/content/drive/MyDrive/ml/archive"
train_dir = os.path.join(base_dir, "train")
test_dir = os.path.join(base_dir, "test")

print("Train folder exists:", os.path.exists(train_dir))


print("Test folder exists:", os.path.exists(test_dir))

import tensorflow as tf
from tensorflow.keras.preprocessing.image import ImageDataGenerator
import os

base_dir = "/content/drive/MyDrive/ml/archive"
train_dir = os.path.join(base_dir, "train")
val_dir = os.path.join(base_dir, "test")

print("Train folder exists:", os.path.exists(train_dir))


print("Validation/Test folder exists:", os.path.exists(val_dir))

train_datagen = ImageDataGenerator(
rescale=1./255,
rotation_range=20,
width_shift_range=0.2,
height_shift_range=0.2,
shear_range=0.2,
zoom_range=0.2,
horizontal_flip=True,
fill_mode='nearest'
)

val_datagen = ImageDataGenerator(rescale=1./255)

train_generator = train_datagen.flow_from_directory(
train_dir,
target_size=(224, 224),
batch_size=32,
class_mode='categorical'
)

val_generator = val_datagen.flow_from_directory(
val_dir,
target_size=(224, 224),
33
batch_size=32,
class_mode='categorical'
)

from tensorflow.keras.applications import VGG16


from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Flatten, Dropout

base_model = VGG16(weights="imagenet", include_top=False, input_shape=(224, 224, 3))

for layer in base_model.layers:


layer.trainable = False

model = Sequential([
base_model,
Flatten(),
Dense(256, activation='relu'),
Dropout(0.5),
Dense(train_generator.num_classes, activation='softmax')
])

model.compile(optimizer='adam', loss='categorical_crossentropy', metrics=['accuracy'])

history = model.fit(
train_generator,
epochs=2,
validation_data=val_generator
)
model_save_path = '/content/drive/MyDrive/ml/model.keras'
model.save(model_save_path)
from tensorflow import keras
model = keras.models.load_model('/content/drive/MyDrive/ml/model.keras')
model.summary()
val_loss, val_acc = model.evaluate(val_generator)
print(f"Validation Accuracy: {val_accc*100:.2f}%")
from google.colab import files
from tensorflow.keras.preprocessing import image
import numpy as np

uploaded = files.upload()

img_path = list(uploaded.keys())[0]

img = image.load_img(img_path, target_size=(224, 224))


img_array = image.img_to_array(img) / 255.0
img_array = np.expand_dims(img_array, axis=0)

predictions = model.predict(img_array)
34
predicted_class = np.argmax(predictions[0])

class_labels = list(train_generator.class_indices.keys())
print("Predicted class:", class_labels[predicted_class])
35

REFERENCES

[1] Deep Learning-Based Skin Lesion Classification Using CNN, KNN, and GAN. Models: CNN, KNN,
GAN. Preprocessing: Resizing, NumPy conversion, GAN-based augmentation. Challenges: Class
imbalance, small dataset. Accuracy: High accuracy (exact % not given).

[2] Transfer Learning on ISIC Dataset. Models: ResNet, pre-trained CNNs. Preprocessing: Resizing,
ImageNet weight transfer. Challenges: Scarce annotated medical data. Accuracy: Improved after transfer
learning.

1.​ [3] HAM10000-Based Melanoma Detection. Model: Custom CNN. Preprocessing: Resize,
balance dataset. Challenges: Noise in dermoscopy images. Accuracy: High, post-GAN
improvement.

[4] Lesion Classification with 7-Point Checklist. Model: CNN guided by clinical criteria. Preprocessing:
Manual scoring, labeling. Challenges: Need for domain knowledge. Accuracy: Clinical alignment
improves accuracy.

[5] GAN-Augmented Classification. Models: GAN + CNN. Preprocessing: GAN to generate malignant
samples. Challenges: Overfitting, unbalanced data. Accuracy: Improved generalization.

[6] Dermoscopy Feature Detection using CNN. Model: CNN. Preprocessing: Batch normalization,
pooling. Challenges: Feature loss in pooling layers. Accuracy: Strong feature map retention.

[7] ISIC 2017 Subset Classification. Model: CNN. Preprocessing: 500 benign + 500 malignant.
Challenges: Manual selection needed. Accuracy: Good binary accuracy.

[8] Lightweight CNN for Mobile Apps. Model: Custom compact CNN. Preprocessing: Size and speed
optimizations. Challenges: Real-time constraints. Accuracy: Suitable for rural mHealth apps.

[9] Feature Fusion Approach. Model: CNN + Feature weighting. Preprocessing: Convolutional + Clinical
features. Challenges: Multi-modal alignment. Accuracy: Boosted accuracy with checklist + features.

[10] Comparative CNN Architecture Testing. Models: AlexNet vs ResNet. Preprocessing: Same dataset
across models. Challenges: Training time, generalization. Accuracy: ResNet outperforms older models.
36
MAPPING TO SDG GOALS

The project “Skin Cancer Detection Using Deep Learning Techniques” aligns with the United Nations
Sustainable Development Goal (SDG) 3: Good Health and Well-being. This goal emphasizes ensuring
healthy lives and promoting well-being for all at all ages.

By utilizing advanced deep learning models for the early and accurate detection of skin cancer, this
system supports timely diagnosis and treatment, thereby increasing survival rates and reducing the burden
on healthcare systems. The project contributes to preventive healthcare by assisting medical professionals
in identifying malignant skin conditions efficiently. Through the integration of artificial intelligence in
medical diagnostics, the system enhances healthcare accessibility, accuracy, and reliability—ultimately
fostering good health and well-being for all.

You might also like