VISVESVARAYA TECHNOLOGICAL UNIVERSITY
Jnana Sangama, Belagavi 590018
Project Synopsis
on
“SKIN CANCER DETECTION”
Submitted in partial fulfillment of the requirements for the award of the degree of
BACHELOR OF ENGINEERING
In
COMPUTER SCIENCE & ENGINEERING
By
ABHISHEK R SHETTY (4MT22CS003)
ACHITH J V (4MT22CS004)
ADITHYA JAIN (4MT22CS006)
AMAN N (4MT22CS018)
Under the Guidance of
Assistant Professor
Mr Vijayananda Madlur
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING
MANGALORE INSTITUTE OF TECHNOLOGY & ENGINEERING
(A Unit of Rajalaxmi Education Trust®, Mangalore)
Autonomous Institute Affiliated to VTU, Belagavi, Approved by AICTE, New Delhi
Accredited by NAAC with A+ Grade,An ISO 9001:2015 Certified Institution 2024-25
ABSTRACT
Skin cancer is a prevalent and potentially life-threatening disease that, if detected early, can significantly
improve patient outcomes. In this project, we propose a skin cancer detection system employing deep
learning techniques. Leveraging the power of transfer learning, we utilize the ResNet50 architecture, a
pre-trained convolutional neural network (CNN), to automatically learn intricate features from skin lesion
images. The dataset comprises a diverse collection of benign and malignant skin lesions. The workflow
involves data loading, preprocessing, and augmentation, followed by the construction of a custom
classification model on top of the ResNet50 base. The model is trained on a subset of the dataset, with a
focus on optimizing classification accuracy. Additionally, we employ early stopping to mitigate overfitting
during the training process. The evaluation phase involves assessing the model's performance on a
separate test set, providing key metrics such as accuracy, precision, recall, and F1score. Furthermore, we
visualize the training and validation curves to gain insights into the model's convergence. To demonstrate
the model's real-world application, we include a feature for predicting the class of custom skin lesion
images. The model is saved for future use, and the classification report offers a comprehensive analysis
of its effectiveness. Our project not only showcases the potential of deep learning in skin cancer detection
but also serves as a foundation for further research and development in the domain of medical image
analysis.
MANGALORE INSTITUTE OF TECHNOLOGY & ENGINEERING
(A Unit of Rajalaxmi Education Trust ®, Mangalore)
Autonomous Institute Affiliated to V.T.U, Belagavi , Approved by AICTE, New Delhi
Accredited by NAAC with A+ Grade & ISO 9001:2015 Certified Institution
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING
CERTIFICATE
This is to certify that Mr. ABHISHEK R SHETTY (4MT22CS003), ACHITH J V(4MT22CS004),
ADITHYA JAIN (4MT22CS006), AMAN N (4MT22CS018) has satisfactorily completed the mini
project entitled “SKIN CANCER DETECTION” for the Mini Project (BCS586) as prescribed by
the VTU for 5th semester B.E. Computer Science & Engineering branch for the academic year 2024 –
2025. It is certified that all the corrections or suggestions indicated for internal assessment have been
incorporated in the report and is been verified and validated.
………………………… …………………………
[Link] Madlur Dr. Ravinarayana B
Mini Project Guide Head of the Department
Name of Examiners Signature of the Examiners
1. …………………………. …………………………..
2. …………………………. …………………………..
ACKNOWLEDGEMENTS
The satisfaction and the successful completion of this project would be incomplete without
the mention of the people who made it possible, whose constant guidance encouragement
crowned our efforts with success.
This project is made under the guidance of Mr Vijayananda Madlur, Assistant Professor, in
the Department of Computer Science and Engineering. We would like to express my sincere
gratitude to our guide for all the helping hand and guidance in this project.
We would like to express appreciation to Dr. Ravinarayana B, Professor and Head,
Department of Computer Science and Engineering, for his support and guidance.
We would like to thank our Principal Dr. Prashanth C M, for encouraging us and giving us
an opportunity to accomplish the project.
We also thank our management who helped us directly or indirectly in the completion of this
mini project.
Our special thanks to faculty members and others for their constant help and support.
Above all, we extend our sincere gratitude to our parents and friends for their constant
encouragement with moral support.
ABHISHEK R SHETTY (4MT22CS003)
ACHITH JV (4MT22CS004)
ADITHYA JAIN (4MT22CS006)
AMAN N (4MT22CS018)
TABLE OF CONTENT
[Link]
1.1 PROBLEM STATEMENT
[Link] REVIEW
2.1 STATE OF THE ART MODELS
2.2 DATSET UTILIZATION
2.3 CLINICAL INTEGRATION CHALLENGES
2.4 TREATMENTNAND PROGNOSIS APPLICATIONS
2.5 FUTURE DIRECTONS
[Link]
3.1 DATSETS
3.2 DATA PREPROCESSING AND MODEL TRAINING DATA
3.3 ALGORITHM IN PICTURE
[Link] REQUIREMENTS
4.1 HARDWARE SPECIFICATIONS
4.2 SOFTWARE SPECIFICATIONS
[Link]
5.1 TEST PROCESSES
5.2 TEST CASE
[Link] AND DISCUSSION
[Link]
[Link]
CHAPTER 1
INTRODUCTION
Skin cancer, among the most prevalent forms of cancer globally, poses a substantial public
health challenge. Timely detection and accurate diagnosis play a pivotal role in enhancing
patient outcomes and reducing the morbidity associated with this disease. Traditional methods
of skin cancer diagnosis heavily rely on visual inspection by dermatologists, a process that can
be time-consuming and subjective. In recent years, advances in deep learning, particularly
convolutional neural networks (CNNs), have demonstrated remarkable capabilities in image
classification tasks, including medical image analysis. This project endeavors to harness the
potential of deep learning to create an automated system for skin cancer detection, facilitating
early diagnosis and intervention. The primary objective of this project is to develop a robust and
accurate model capable of distinguishing between benign and malignant skin lesions. To
achieve this, we leverage transfer learning, utilizing the ResNet50 architecture as a pre-trained
feature extractor. This approach allows the model to benefit from the knowledge gained through
training on a diverse set of images, enabling it to recognize intricate patterns and features
associated with skin cancer. [1]
1.1 Problem Statement
The manual diagnosis of skin lesions is time-consuming and subjective, often leading to delays
in treatment. Leveraging the power of deep learning, our project aims to develop an efficient
and accurate model capable of automatically discerning between benign and malignant skin
lesions. By addressing these challenges, we seek to enhance the speed and accuracy of skin
cancer diagnosis, ultimately improving patient outcomes. This project focuses on utilizing
transfer learning with the ResNet50 architecture, incorporating data loading, preprocessing,
and model training. Through this endeavor, we aspire to contribute to the field of dermatology
by providing a reliable tool for early skin cancer detection, thereby facilitating timely and
effective medical interventions.
CHAPTER2
LITERATURE REVIEW
2.1 State-of-the-Art Models
DeepSkin (IEEE, 2024):
This study introduces "DeepSkin," a model integrating EfficientNet and
InceptionResNet architectures for robust classification of skin lesions. The use of
HAM10000 and ISIC datasets enabled high classification accuracy (above 90%) for
melanoma and other common skin cancers
The model employed data augmentation techniques and transfer learning to overcome the
challenge of limited labeled medical datasets.[2]
Explainable AI in Skin Cancer Detection (arXiv, 2023):
Advanced interpretability methods like SmoothGrad and Faster Score-CAM were
incorporated into classification models, enhancing the trustworthiness of DL systems.
The study emphasizes the importance of visualizing the decision-making process for
clinical adoption[3]
2.2 Dataset Utilization
HAM10000 Dataset (MDPI, 2023):
The HAM10000 dataset has become the benchmark for DL-based dermatological
research. This journal article highlights the stratification of the dataset into training,
testing, and validation subsets (80:10:10 split). It further discusses how data imbalance
was addressed using augmentation techniques[4]
ISIC Archive Contributions:
Annual challenges hosted by the ISIC dataset have catalyzed progress in skin lesion
segmentation and classification. Studies frequently leverage this dataset to validate
their models, ensuring generalization across diverse populations.
2.3 Clinical Integration Challenges
Challenges in Model Deployment (MDPI, 2023):
Key barriers include the "black-box" nature of DL models and the variability in lesion
presentation due to demographic and environmental factors. The article discusses potential
solutions, such as federated learning for training models across diverse datasets while
maintaining patient privacy Generalizability Issues:
Ensuring models perform well across varied imaging conditions and patient
populations is a significant concern. Papers emphasize the need for real-world clinical
validation before large-scale deployment.[4]
2.4 Treatment and Prognosis Applications
Prognostic Models (IEEE, 2023):
Deep learning has also been extended to prognosis and treatment recommendation. For
example, models integrating clinical, genomic, and histopathological data can predict
survival rates and recommend personalized treatments[4]
2.5 Future Directions
Federated Learning:
Several studies discuss federated learning as a method to enhance data diversity
without compromising privacy. This approach could accelerate the creation of globally
applicable DL models
Explainability and Ethics:
Explainable AI and the ethical implications of AI-driven decisions remain areas of
active research, as highlighted in several recent journal articles. These are critical for
building clinician trust and meeting regulatory requirements.
CHAPTER3
METHODOLOGY
3.1 Datasets
The success of any machine learning project heavily relies on the quality and diversity of the dataset
used for training and evaluation. In our skin cancer detection project, we meticulously curated a dataset
that encapsulates the spectrum of benign and malignant skin lesions. The dataset serves as the
foundation for model training, validation, and testing, ensuring the robustness and generalization of our
deep learning model. The skin cancer dataset used in this project comprises a total of 2637 samples.
The dataset is meticulously curated to facilitate the training and evaluation of a deep learning model for
skin cancer detection. The samples are categorized into two classes: Number of Malignant Samples:
1197 These samples represent instances of skin lesions identified as malignant. Malignant skin lesions
encompass various types of skin cancers, including melanoma, basal cell carcinoma, and squamous cell
carcinoma. [9]
FIG 3.1 : MALIGNANT
Number of Benign Samples: 1440
These samples correspond to benign skin lesions, covering a spectrum of noncancerous dermatological
conditions.
FIG 3.2 : BENIGN
The dataset is balanced, ensuring a representative distribution of both malignant and benign samples.
Each sample is associated with a corresponding file path, enabling seamless integration into the deep
learning model training process. The diversity of the dataset, along with careful annotation by medical
professionals, contributes to the robustness and generalization of the skin cancer detection model.
FIG 3.3 : Comparison between Benign and Malignant
This comprehensive dataset forms the foundation for the development and evaluation of an
accurate and clinically relevant skin cancer detection system.
3.2 Data Preprocessing And Model Training Data
Augmentation:
Purpose: Data augmentation is employed to artificially increase the diversity of the training dataset,
preventing the model from overfitting to the specific images in the training set. The
ImageDataGenerator is configured with the preprocess_input function, which aligns pixel values with
the preprocessing used during training ResNet50 on ImageNet. During training, the generator applies
random transformations to the images, such as rotation, zooming, horizontal flipping, and width/height
shifts.
Preprocessing Function:
Purpose: Normalize pixel values and preprocess images to be compatible with the ResNet50 model. The
preprocess_input function is applied to each image array. It normalizes the pixel values and performs
other preprocessing steps, ensuring that the images fed into the model have a format consistent with
ResNet50's expectations. [10]
Flow from DataFrame:
Purpose: Generate batches of augmented and preprocessed images during model training and testing.
flow_from_dataframe is used to create a generator that reads file paths and labels from the DataFrame
(train). Images are resized to the target size of (100, 100), and class mode is set to 'categorical' for
multiclass classification. The generator yields batches of augmented and preprocessed images during
training, with shuffling enabled. [7]
Training and Validation Generators:
Purpose: Create separate generators for training and validation datasets to provide batches of images
during model training and evaluation. Separate generators are created for the validation and test datasets
using flow_from_dataframe. For the validation generator (valid_gen), shuffling is disabled to evaluate
the model on a fixed set of validation data. The test generator (test_gen) is used to evaluate the model on
unseen test data during the final evaluation step.
Model Compilation:
Objective: Before training, the model needs to be configured for the learning process.
This involves specifying the optimizer, loss function, and evaluation metric. Optimizer ('adam'): Adam is
a popular optimization algorithm that adapts the learning rates during training, making it well-suited for
a variety of tasks.
Loss Function ('categorical_crossentropy'): Categorical crossentropy is often used for multi-class
classification problems.
Metrics (['accuracy']): The accuracy metric is chosen to monitor the model's performance during
training.
Model Training:
Objective: Train the model using the provided training data and evaluate it on the validation set. Adjust
the model's weights based on the computed gradients. train_gen: The training generator (train_gen)
yields batches of augmented and preprocessed images along with their labels.
validation_data=valid_gen: The validation generator (valid_gen) provides batches of validation data to
assess the model's performance during training. epochs=100: The model is trained for a maximum of
100 epochs. callbacks=my_callbacks: Early stopping is employed as a callback during training. These
data preprocessing steps collectively ensure that the model is trained on a varied and wellprepared
dataset, promoting better generalization to new, unseen skin lesion images.
Fig 3.4 : Flowchart of Complete Model
3.3 Algorithms In Picture
Here's a brief explanation of the main algorithms used in the code :
ResNet50 : ResNet50 is a deep convolutional neural network architecture known for its
groundbreaking approach to addressing the challenge of training very deep networks. It was introduced
by Kaiming He et al. in 2015 and is characterized by the innovative use of residual learning blocks.
ResNet50 serves as a powerful feature extractor. Its pre-trained layers are used to capture hierarchical
features from skin cancer images. By excluding the top layers and adding custom dense layers, the
model is fine-tuned to specialize in the task of classifying skin lesions as benign or malignant. This
transfer learning approach allows the model to leverage the knowledge gained from ImageNet and adapt
it to the specific nuances of skin cancer detection. [10]
Data Augmentation: This technique involves applying various transformations to the
training data, such as rotation, flipping, shifting, shearing, and zooming. Data augmentation helps
increase the diversity of the training data, allowing the model to generalize better and handle variations
in the input images. [5]
Adam Optimization: Adam is an optimization algorithm used to update the weights and
biases of the neural network during training. It combines ideas from adaptive learning rates and
momentum methods, resulting in efficient and effective optimization. [11]
Categorical Cross-Entropy Loss: This is a common loss function used in multi-class
classification problems. It measures the dissimilarity between the predicted class probabilities and the
true class labels. The goal is to minimize the cross-entropy loss, encouraging the model to make accurate
predictions.
Softmax Classifier: The softmax classifier, also known as the multinomial logistic regression,
is used to assign class probabilities to input data. It is commonly used in multi-class classification
problems where there are more than two classes. [5]
Activation Function: The softmax activation function is applied to the output layer of the
neural network model. It takes the raw class scores and converts them into probabilities. The softmax
function ensures that the predicted probabilities sum up to 1, allowing the model to make confident
predictions about the input's class membership. [5]
Loss Function: Categorical cross-entropy loss is used as the loss function to measure the
dissimilarity between the predicted class probabilities and the true class labels. The goal is to minimize
this loss during training, encouraging the model to make accurate predictions. [5]
In summary, the main classification algorithm used in the code is the softmax classifier, which assigns
class probabilities to input data using the softmax activation function. The model is trained to minimize
the categorical cross-entropy loss, allowing it to make accurate predictions for multi-class classification
tasks.
CHAPTER 4
Functional Requirements
The System Requirement Specification (SRS) is a document, which describes completely the external
behavior of the software as well as the behavior of the hardware. The first and foremost work of the
developer is to study the system to be developed and specify the user requirements before going for the
designing phase. It includes a set of use cases that describes all the interaction the users will have with
software. Use cases are also known as functional requirements. In addition to use cases, the SRS also
contains non-functional requirements. Non-functional requirements are requirements, which impose
constraints on the design or implementation.
The functional Requirements are broadly classified into 2 categories :
● Hardware Requirements
● Software Requirements
4.1 Hardware Specifications:
Processor : Intel i3/i5, 1.8 GHz machine or above
Main Memory : 4GB RAM or above
Hard disk : 1TB or above
4.2 Software Specifications:
Operating system: Windows 7 and above
Programming Language : Python
Platform Used : Anaconda, Jupyter, Visual Studio , Google Colab
Chapter 5
TESTING
5.1 Test Processes
The testing phase in your model involves evaluating the trained skin cancer detection model's
performance on a separate, previously unseen dataset. Here's a brief overview:
Data Splitting:
The dataset is split into training and testing sets using train_test_split from scikit-learn.
ImageDataGenerator : ImageDataGenerator is used for preprocessing during the testing phase, ensuring
consistency with the preprocessing applied during training.
Model Evaluation:
The trained model is evaluated on the test set using the evaluate method.
Metrics such as accuracy, loss, precision, recall, and F1-score are computed to assess the model's
performance. [5]
Results Analysis:
The classification report is generated using scikit-learn's classification_report function, providing
detailed metrics for each class (benign and malignant).
Visualization:
Matplotlib is utilized to visualize the model's performance, including accuracy and loss trends over
epochs. [6]
Custom Image Prediction:
A custom image is loaded and preprocessed, and the model predicts its class.
The result, including the predicted class and confidence, is displayed using Matplotlib.
5.2 Test Case
A Test Case is a software testing document, which consists of events, action, input, output, expected result
and actual result. Technically a test case includes test description, procedure, expected result and remarks.
Test cases should be based primarily on the software requirements and developed to verify correct
functionality and to establish conditions that reveal potential errors.
Chapter 6
RESULT & DISCUSSION
Fig 6.1
Fig 6.1 shows us the classified image after running the model. In this case we have uploaded the image
of Malignant skin cancer and as we can see, the model predicted it correctly .
Fig 6.2
Fig 6.2 shows us some custom images which are downloaded from the internet. We are using these
images for our model to make the predictions.
Chapter 7
CONCLUSION
In conclusion, the skin cancer detection project has successfully implemented a Convolutional Neural
Network (CNN) with transfer learning using ResNet50, showcasing robust performance in classifying
skin lesions as benign or malignant. The model exhibits commendable accuracy, precision, recall, and
F1-score on a diverse dataset. The utilization of data augmentation, transfer learning, and meticulous
preprocessing contributes to the model's ability to generalize well across various scenarios. The
project's visualizations provide insights into the model's training dynamics and performance metrics.
Additionally, the incorporation of early stopping enhances efficiency by preventing overfitting during
training. The successful deployment of the model is demonstrated through real-time predictions on
custom skin lesion images.
Future Scope :
Fine Tuning and Hyperparameter Optimization: Explore further fine-tuning of
hyperparameters to potentially enhance model performance.
Additional Data Sources: Integrate data from additional sources or datasets to increase the model's
diversity and generalization.
Ensemble Learning: Investigate the implementation of ensemble learning techniques to combine
predictions from multiple models for improved accuracy.
Explainability and Interpretability: Enhance model explainability and interpretability for better
understanding of decision-making processes, crucial in medical applications.
Clinical Validation: Collaborate with healthcare professionals to clinically validate the model's
performance in real-world settings.
Continuous Monitoring and Updates: Implement mechanisms for continuous monitoring and
updates to adapt the model to emerging patterns and changes in skin cancer characteristics.
Incorporate Domain Expertise: Involve dermatologists and domain experts in the development
process to refine the model's features and enhance its clinical relevance.
Mobile Application Integration: Develop a user-friendly mobile application for convenient and
accessible skin cancer detection, promoting early diagnosis.
REFERENCES
1. [Link]
2. DeepSkin: A Deep Learning Approach for Skin Cancer Classification - IEEE Xplore, 2024
[Link] Interpretable Deep Learning Approach for Skin Cancer Categorization - arXiv, 2023
[Link] Cancer Detection Using Deep Learning—A Review - MDPI Diagnostics, 2023
5. Hands on Machine Learning :
[Link]
6. Matplotlib:
[Link] 7.
flow_from_dataframe:
[Link]
8. [Link]
artefact-
clow_fig2_342502768#:~:text=Manual%20detection%20is%20not%20accurate,processing%20over
hea d%20and%20increased%20complexity.
9. Kaggle Dataset :
[Link]
10. ResNet :
[Link]
vision/resnet/#:~:text=Residual%20Network%20(ResNet)%20is%20a,or%20thousands%20of%20con
volutional%20layers. 11. Adam Optimizer:
[Link]