COLON CANCER DETECTION USING DEEP LEARNING
PROJECT REPORT
Submitted by
HARSHINIPRIYA R
20CSR073
JANANI P
20CSR079
JAYASUDHA A S
20CSR083
in partial fulfillment 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
NOVEMBER 2023
ii
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
KONGU ENGINEERING COLLEGE
(Autonomous)
PERUNDURAI, ERODE 638060
NOVEMBER 2023
BONAFIDE CERTIFICATE
This is to certify that the Project report entitled COLON CANCER DETECTION USING
DEEP LEARNING is the bonafide record of project work done by HARSHINI PRIYA R
(Register No.:20CSR073), JANANI P (Register No.:20CSR079) and JAYASUDHA A S
(Register No.:20CSR083) in partial fulfillment 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 2022 - 2023.
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
NOVEMBER 2023
DECLARATION
We affirm that the Project Report titled COLON CANCER DETECTION USING DEEP
LEARNING being submitted in partial fulfillment of the requirements for the award of Bachelor
of Engineering is the original work carried out by us. It has not formed 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 :
HARSHINI PRIYA R
(Reg. No.:20CSR073)
JANANI P
([Link].:20CSR079)
JAYASUDHA A S
([Link].:20CSR083)
I certify that the declaration made by the above candidates is true to the best of my knowledge.
Date : Name and Signature of the Supervisor with seal
i
ABSTRACT
Colon cancer is a serious hazard to world health, needing precise and timely detection in
order to manage the disease effectively. This study provides a powerful diagnostic system for
detecting colon cancer that uses the EfficientNet architecture in deep learning and feature
extraction approaches. Based on the highly efficient EfficientNet architecture, our deep learning
model capitalizes on its demonstrated excellence in image processing tasks. This model is fine-
tuned via transfer learning, with pre-trained weights used to speed up convergence, and is
further enhanced with feature extraction techniques. These methods extract relevant information
from medical images, which improves the model's capacity to distinguish malignant tissue.
This combination of deep learning and feature extraction, especially when combined with
the capabilities of EfficientNet, demonstrates the promise of new technology in the field of
medical diagnostics. Harnessing these tools empowers precise colon cancer detection,
facilitating early intervention and improved patient outcomes in the field of healthcare.
v
ACKNOWLEDGEMENT
We express our sincere thanks and gratitude to our beloved Correspondent
[Link], [Link], M.B.A, LLB 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. V. BALUSAMY, [Link]., Ph.D., for providing the necessary facilities to complete our
work.
We would like to express our sincere gratitude to [Link] M.E., Ph.D.,
Professor and Head of the Department for providing necessary facilities.
We extend our thanks to [Link].,M.E., Assistant Professor (Sr.G),
Department of Computer Science Engineering, Project Coordinator for her encouragement and
valuable advice that made us to carry out the project work successfully.
We extend our gratitude to our Supervisor [Link].,[Link]., Assistant
Professor, Department of Computer Science Engineering, for her 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.
i
TABLE OF CONTENTS
CHAPTER TITLE PAGE
No. No.
ABSTRACT iv
LIST OF FIGURES ix
LIST OF ABBREVIATION x
INTRODUCTION 1
1 1.1 MOTIVATION OF THE PROJECT 1
1.2 OBJECTIVE OF THE PROPOSED WORK 3
2 LITERATURE REVIEW 4
3 SYSTEM REQUIREMENT 5
3.1 HARDWARE REQUIREMENT 5
3.2 SOFTWARE REQUIREMENT 5
3.3 SOFTWARE DESCRIPTION 5
3.3.1 Python 8 5
3.3.2 OpenCV 7
3.3.3 Efficient Net 9
3.3.4 VGG 9
4 PROPOSED SYSTEM 10
4.1 DEEP LEARNING 10
4.1.1 Deep Learning Techniques 10
4.1.2 Neural Networks 11
vii
4.2 KEY TECHNOLOGIES 12
4.2.1 Efficient Net 12
4.2.2 VGG 12
4.2.3 Pre-trained models 13
4.2.4 Data Augmentation 13
4.3 MODULE DESCRIPTION 13
4.3.1 Dataset Description 14
4.3.2 Datasets Collection 14
4.3.3 Working of VGG 15
4.3.4 Working of Efficient Net 18
4.4 FLOW DIAGRAM OF WORKING MODEL 20
5 RESULTS AND DISCUSSION 21
5.1 PERFORMANCE EVALUATION 21
5.2 VALIDATION AND RESULTS 21
5.3 MODEL COMPARISON 22
6 CONCLUSION AND FUTURE WORK 24
APPENDIX 1 CODING 25
APPENDIX 2 SCREENSHOT 31
REFERENCES 32
viii
LIST OF FIGURES
FIGURE FIGURE NAME PAGE
No. No.
4.1 Images of Dataset 15
4.2 VGG Network Architecture 17
4.3 EfficientNet Architecture 19
4.4 Flow Diagram of Working Model 20
4.5 Graph for Training and Validation Accuracy 22
4.6 Graph for Training and Validation Loss 23
4.7 Confusion Matrix 23
ix
LIST OF ABBREVIATIONS
DL : Deep Learning
CNN : Convolutional Neural Network
OpenCV : Open Computer Vision
RNN : Recurrent Neural Network
NumPy : Numerical Python
API : Application Programming Interface
GPU : Graphics Processing Unit
GPL : General Public License
CSV : Comma Separated Values
GUI : Graphical User Interface
VGG : Visual Geometry Group
CT : Computed Tomography
MAP : Mean Average Precision
CHAPTER 1
INTRODUCTION
Colon cancer, also known as colorectal cancer, is a significant global health concern, ranking as
one of the most prevalent and deadly cancers. Early detection of colon cancer is crucial for
improving patient outcomes and reducing mortality rates. Traditional methods of colon cancer
detection, such as colonoscopy and fecal occult blood testing, are effective but can be invasive,
costly, and sometimes uncomfortable for [Link] learning, a subset of artificial
intelligence, has emerged as a promising tool in the field of medical diagnostics, including the
early detection of colon cancer. This technology leverages the power of neural networks and
extensive datasets to analyze medical images, such as colonoscopy images and radiological
scans, with remarkable [Link] this era of precision medicine, deep learning algorithms have
the potential to revolutionize colon cancer detection by automating the identification of
suspicious lesions, polyps, or tumors, ultimately aiding healthcare professionals in making faster
and more precise diagnoses. Furthermore, deep learning can help in the development of
computer-aided diagnostic systems that not only improve accuracy but also reduce human error,
variability, and subjectivity in the diagnostic [Link] introduction sets the stage for the
exploration of how deep learning is transforming the landscape of colon cancer detection,
offering a glimpse into its potential benefits for patients, healthcare providers, and the broader
healthcare industry.
MOTIVATION OF THE PROJECT
The motivation behind conducting a colon cancer detection project using deep learning
(DL) is multifaceted and encompasses several compelling reasons:
Early Detection and Improved Survival Rates: One of the primary motivations is
to detect colon cancer at its earliest stages. DL algorithms can identify
precancerous lesions, polyps, or tumors in medical images, which, when caught
early, significantly increase the chances of successful treatment and improved
survival rates for patients.
Reducing Mortality: Colon cancer is one of the leading causes of cancer-related
deaths worldwide. By implementing DL-based screening and early detection
methods, we can potentially reduce the mortality associated with this disease,
saving countless lives.
Enhancing Diagnostic Accuracy: DL algorithms have demonstrated high levels of
accuracy in identifying subtle patterns and anomalies in medical images. This
technology can help healthcare professionals make more accurate and timely
diagnosis, reducing the chances of missed or misdiagnosed cases.
Reducing Healthcare Costs: By detecting colon cancer at earlier stages, DL can
potentially lead to cost savings in the healthcare system. Treating cancer at later
stages is often more expensive, and DL-based screening can help alleviate this
financial burden.
Access to Remote Areas: DL-based colon cancer detection can be particularly
valuable in areas with limited access to healthcare facilities or specialized medical
professionals. Telemedicine and remote diagnostic tools can extend the reach of
healthcare services.
Personalized Treatment: DL can contribute to precision medicine by tailoring
treatments to individual patients.
OBJECTIVE OF THE PROPOSED WORK
The main objectives of the proposed work are:
To develop a deep learning model for early and precise colon cancer detection to assist in
the timely diagnosis and treatment of this life-threatening disease.
To enhance the accuracy and reliability of colon cancer detection by leveraging deep
learning techniques to reduce false positives and false negatives in screening procedures.
To investigate the potential for using deep learning to analyze diverse medical imaging
modalities, such as colonoscopy images and radiological scans, to identify colon cancer
at various stages of development.
To create a scalable and cost-effective solution that can be integrated into healthcare
systems to provide broad access to advanced colon cancer screening, particularly in
underserved or remote areas.
To evaluate the model's performance against existing diagnostic methods, demonstrating
its potential to improve patient outcomes, reduce healthcare costs, and enhance the
overall efficacy of colon cancer screening programs.
CHAPTER 2
LITERATURE REVIEW
In recent years, the application of deep learning techniques in the realm of colon
cancer detection has garnered significant attention due to its potential to revolutionize
early diagnosis and improve patient outcomes. This literature survey aims to provide
a comprehensive overview of the state-of-the-art methods, research trends, and
notable advancements in the field. We delve into the diverse array of deep learning
architectures and methodologies employed, ranging from convolutional neural
networks (CNNs) for image-based detection to recurrent neural networks (RNNs) for
sequential data analysis, highlighting their pivotal role in feature extraction,
classification, and the integration of multi-modal data sources. Moreover, we discuss
the pivotal role of transfer learning, which leverages pre-trained models to enhance
performance and reduce the need for extensive labeled data. The availability of public
datasets and data preprocessing techniques are also scrutinized, underscoring their
relevance in facilitating model development and evaluation. Performance metrics
such as sensitivity, specificity, and area under the receiver operating characteristic curve
explored as vital tools for assessing the efficacy of deep learning models in colon
cancer detection. Through an in-depth analysis of recent breakthroughs, challenges,
and future research directions, this survey serves as a comprehensive resource for
researchers, clinicians, and healthcare practitioners committed to leveraging deep
learning for more accurate, efficient, and timely colon cancer detection, ultimately
contributing to advancements in early intervention and patient care.
CHAPTER 3
SYSTEM REQUIREMENTS
HARDWARE REQUIREMENTS
Processor : intel i7
Processor Speed : 2.21 GHz
Hard Disk : 475 GB
RAM : 8.00 GB
SOFTWARE REQUIREMENTS
Language :Python 8
Software :PyCharm,OpenCV,Pandas,Tensorflow,Seaborn,NumPy,Time
Operating System :Windows 11
SOFTWARE DESCRIPTION
PYTHON 8
Python is an interactive, object-oriented, interpreted and high- level programming
language. The source code of python is available under the GPL. It provides constructs that
enable clear programming on both small and large scales. Python has features like dynamic
systems and automatic memory management. It supports eight multiple programming paradigms,
including imperative, object-oriented, functional and procedural, and has a large and
comprehensive standard library.
Python is open source software and has a community-based development model. Python
allows programmers to build their own types using classes, which are most often used for object-
oriented programming. Python is managed by the Python Software Foundation.
The features of python include the below mentioned:
Easy-to-maintain: source code is easy to maintain.
Easy-to-learn: Python has simple keywords, simple structure, and a clearly defined
syntax. This allows the student to learn language quickly.
A broad standard library: source code is fairly easy to maintain.
Easy-to-read: Python code is more clearly defined and visible to the eyes.
Interactive Mode: Python has a support for an interactive mode which allows interactive
testing and debugging of snippets of code.
Portable: Python can run on a wide variety of hardware platforms and has the same
interface on all platforms.
Databases: Python provides interfaces to all major commercial databases.
GUI Programming: Python supports GUI applications that can be created and ported to
many system calls, libraries and windows systems, such as Windows MFC, Macintosh,
and the X Window system of Unix.
Scalable: Python provides a better structure and support for large programs than shell
scripting. The support of NumPy makes the task easier. NumPy is a highly optimized
library for numerical operations.
NUMPY:
NumPy is a library for the Python programming language that provides tools for working
with large, multi-dimensional arrays and matrices. It also provides a variety of mathematical
functions for working with these arrays, including linear algebra, Fourier analysis, and random
number generation.
MATPLOTLIB:
Matplotlib is a plotting library for the Python programming language. It provides a
variety of plotting functions and tools for creating visualizations of data, including line plots,
scatter plots, bar plots, and histograms.
TIME:
Time is a module in the Python standard library that provides tools for working with time-
related functions. It can be used for measuring the performance of code, calculating time
intervals, and other time-related tasks.
OPENCV:
OpenCV supports various programming languages such as C++, Python, and Java, and is
available on various platforms such as Windows, Linux, OS X, Android, and iOS. Interfaces for
accelerated GPU operations based on CUDA and OpenCL are also actively developed. OpenCV
Python is a Python API for OpenCV that combines the best features of the OpenCV C++ API
and the Python [Link] Python uses Numpy, a highly optimized library for numerical
operations with MATLAB-style syntax. All OpenCV array structures are converted to and from
numpy arrays. This also makes it easier to integrate with other libraries that use Numpy, such as
SciPy and Matplotlib.
OpenCV's application areas include:
Image Segmentation
Feature Extraction
Object Detection
Pattern Recognition
Visualization
TENSORFLOW:
TensorFlow is an open-source machine learning framework developed by Google. It
provides tools and libraries for building and training machine learning models, including deep
neural networks. TensorFlow is known for its ease of use, scalability, and flexibility.
PYTORCH:
PyTorch is an open-source machine learning framework developed by Facebook. It is
based on the Torch library and provides a dynamic computational graph, making it easier to
debug and optimize machine learning models. PyTorch is known for its simplicity and flexibility.
KERAS:
Keras is a high-level neural networks API, written in Python and capable of running on top
of TensorFlow, Theano, or CNTK. It provides a user-friendly interface for building and training
deep learning models.
EFFICIENT NET:
EfficientNet is a series of convolutional neural networks (CNNs) that were designed to
provide an optimal balance between model size (number of parameters) and model performance.
These models are known for their efficiency, meaning they achieve high accuracy while
requiring fewer computational resources compared to other architectures like VGG, ResNet, or
Inception.
VGG:
The VGG (Visual Geometry Group) models, specifically VGG16 and VGG19, can be
used for a variety of computer vision tasks, including image classification, object detection, and
feature extraction. Here are some common use cases for VGG models
CHAPTER 4
PROPOSED SYSTEM
The proposed system for colon cancer detection employs deep learning, specifically
Convolutional Neural Networks (CNNs), to analyze medical imaging data, including
colonoscopy images and radiological scans. It will be designed to identify and classify abnormal
features, such as polyps or tumors, in the colon with high accuracy. By training the model on
extensive and well-annotated datasets, the system aims to enhance early detection, reduce false
negatives, and improve patient outcomes. The integration of this system into existing healthcare
infrastructure will provide a reliable and efficient tool for clinicians, ultimately contributing to
more timely and effective colon cancer diagnoses and treatment.
DEEP LEARNING:
Deep learning is a subset of machine learning and a subset of artificial intelligence. Artificial
intelligence is a technical term for technologies that enable computers to imitate human behavior.
Machine learning is a set of data-trained algorithms that make all this possible. Deep learning is
a type of machine learning inspired by the structure of the human brain. These algorithms
attempt to reach human-like conclusions by continuously analyzing data using a given data set.
To achieve this, deep learning uses a hierarchy of algorithms called neural networks.
DEEP LEARNING TECHNIQUES:
Some of the various deep learning techniques are:
[Link] neural networks
2. Convolutional neural networks
3. Recurrent neural networks
NEURAL NETWORK:
Neural networks provide the ability to perform tasks such as classification and clustering.
They are a set of algorithms that copy the behavior of the human brain in recognizing
relationships between data. Neurons are information carriers. They use electrical impulses and
chemical signals to communicate information between themselves and other parts of the brain. A
neural network here is a set of neurons organized in layers.
Each neuron is a mathematical operation that takes an input, performs multiplication by
weights, and passes the sum to other neurons via an activation function. Also called a node or
unit. A neural network consists of three layers:
1. Input Layer
2. Hidden Layer
3. Output Layer
The input layer is responsible for getting input into the system for further processing in
subsequent layers. These inputs can be read as vectors or from CSV files. Only one input layer
can exist in the network.
The hidden layer sits between the model's input and output layers, where the function applies
weights to the input values and passes them through the activation function. It is passed to
subsequent functions. They are very common in neural networks, but their usage and architecture
often vary from case to case. In some cases, weighted inputs are randomly assigned. Otherwise,
it will be tweaked and adjusted by the Back Propagation process call.
The output layer of a neural network is the final layer of neurons responsible for generating the
output. The output layer takes input from the previous layer, performs computations, and outputs.
As with the input layer, there can only be one output layer with any number of neurons.
KEY TECHNOLOGIES:
EFFICIENT NET:
EfficientNet, a groundbreaking family of convolutional neural networks, represents a significant
leap in the field of deep learning. In 2019, these models excel in delivering an optimal blend of
computational efficiency and high accuracy. The key innovation lies in compound scaling, where
the depth, width, and resolution of the network are simultaneously adjusted, resulting in models
that are both deeper and wider without overwhelming computational demands. This unique
approach has given rise to a range of EfficientNet variants, denoted as "EfficientNet-B0" to
"EfficientNet-B7," each catering to diverse applications, from resource-constrained mobile
devices to high-performance cloud-based systems. Notably, EfficientNet models have established
new benchmarks in computer vision tasks and have gained popularity for their efficacy in
transfer learning, making them a versatile and essential tool in the deep learning landscape.
VGG:
The Visual Geometry Group (VGG) is a deep convolutional neural network architecture that
has made significant contributions to the field of computer vision and deep learning. Using VGG
we can explore the architecture, key features, and the impact of VGG in the world of deep
[Link] VGG architecture is often referred to as a "very deep" neural network, as it
comprises a substantial number of layers. There are two primary versions of VGG, VGG16 and
VGG19, named after the number of weight layers they contain. VGG16 consists of 16 weight
layers, while VGG19 has 19. Both versions utilize small 3x3 convolutional filters, allowing them
to capture intricate and fine-grained features in the input images.
PRE-TRAINED MODELS:
Pre-trained models for EfficientNet and VGG are available, which can be fine-tuned on
specific datasets to achieve better performance. Pre-trained models are trained on large datasets
and can detect a wide range of objects, making them a good starting point for fine-tuning on a
specific dataset. Fine-tuning allows the model to learn from specific data and improve its
accuracy for a particular task.
DATA AUGMENTATION:
Data Augmentation is a technique used to increase the size of the training dataset by
applying random transformations to the data. This can improve the robustness and generalization
of the model, as it learns to recognize objects under different conditions. Common data
augmentation techniques include random scaling, cropping, and flipping, which can help the
model learn to detect vehicles at different scales and orientations.
MODULE DESCRIPTION:
1) Introduction to Colon Cancer
Epidemiology and impact
Colon cancer staging and types
Significance of early detection
2)Neural networks and their components
Convolutional neural networks (CNNs) for image analysis
Recurrent neural networks (RNNs) for sequential data
Imaging Modalities and Biomarkers in Colon Cancer
3)Colonoscopy and its role in diagnosis
Radiological imaging (CT scans, MRI) for tumor detection
Molecular and genetic markers as indicators of cancer
Data Preprocessing and Preparation
DATASET DESCRIPTION:
The Colon Cancer Detection Using Deep Learning dataset is a critical resource for the
development of advanced algorithms and models in the field of medical imaging and healthcare.
This dataset encompasses a diverse array of medical images, primarily focusing on colonoscopy
images, computed tomography (CT) scans, and histopathology slides of colon tissues, all
carefully curated and anonymized to ensure patient privacy. Each image is accompanied by
essential metadata, including imaging modality, acquisition date, and, most importantly, binary
labels indicating cancerous or non-cancerous (benign) status, as determined by clinical experts.
DATASET COLLECTION:
The dataset collection process for colon cancer detection using deep learning demands
meticulous attention to ethical, legal, and privacy considerations. By curating a high-quality
dataset, the project aims to contribute to the development of advanced deep learning models and
ultimately improve the early diagnosis of colon cancer, with the potential to save lives and
enhance patient outcomes.
Figure 4.1 Images of Dataset
WORKING OF VGG:
The VGG (Visual Geometry Group) architecture is a deep convolutional neural network
that has been widely used in various computer vision tasks, including image classification. While
VGG was originally designed for generic image recognition, it can be applied to colon cancer
detection with some adaptations. Here's how VGG can be employed in the context of colon
cancer detection:
1) Dataset Preparation:
Gather a dataset of colonoscopy or medical images for training and testing.
Annotate the images to indicate whether they contain colon cancer or not.
2) Data Preprocessing:
Resize and normalize the images to a consistent format and scale.
Perform data augmentation to increase the dataset's diversity and prevent overfitting.
3) Transfer Learning:
Use a pre-trained VGG model (e.g., VGG16 or VGG19) that has been trained on
large-scale image datasets like ImageNet.
Remove the fully connected layers at the end of the VGG model, as they are specific to
the original task.
Retain the convolutional layers and use them as feature extractors.
4) Feature Extraction:
Pass the pre-processed medical images through the VGG convolutional layers. The
output of these layers can be considered as high-level features extracted from the images.
5) Classification Head:
Add a new set of fully connected layers on top of the VGG base.
Train this classification head to make predictions about whether an image contains colon
cancer or not.
6) Training:
Train the entire model, including the classification head, on the colon cancer dataset.
Utilize techniques like transfer learning, fine-tuning, and appropriate optimization
algorithms to make the training process more efficient and accurate.
7) Model Evaluation:
Assess the model's performance using standard evaluation metrics such as accuracy,
sensitivity, specificity, ROC-AUC, and F1 score.
Validate the model on a separate test dataset to ensure its generalization to unseen data.
8) Hyperparameter Tuning:
Fine-tune hyperparameters like learning rates, batch sizes, and regularization techniques
to optimize model performance.
9) Model Interpretability:
Implement techniques for model interpretability, such as visualization of convolutional
filters and attention maps, to understand which regions of the images are important for
cancer detection.
10) Cross-Validation:
Perform cross-validation to assess the model's stability and reliability.
VGG-based models can provide robust image features that are beneficial for colon cancer
detection. However, it's essential to customize the model architecture and training process to
meet the specific needs and challenges of the medical domain while prioritizing patient privacy
and ethical considerations.
Figure 4.2 VGG Net Architecture
WORKING OF EFFICIENT NET:
EfficientNet architecture comprises three key components:
Depth Scaling: EfficientNet utilizes a compound scaling method to increase network depth while
keeping other dimensions in check. This approach incorporates more layers into the neural
network, enhancing its representational capacity. However, the authors propose that simply
scaling depth without considering other factors can lead to suboptimal models. Hence, they
introduce two additional scaling dimensions: width and resolution.
Width Scaling: Increasing the width of a neural network's layers enhances the capacity for
feature extraction and model expressiveness. EfficientNet applies this concept but does so in a
way that complements depth scaling. The authors argue that the optimal scaling ratio between
width and depth should be carefully determined to maximize performance gains while
minimizing computational costs.
Resolution Scaling: Resolution refers to the input image size, and increasing resolution can
provide a richer representation of visual data. EfficientNet scales resolution with respect to the
baseline model. This introduces the idea that higher resolution images can contribute
significantly to improved accuracy. Importantly, resolution scaling is also coordinated with depth
and width scaling to maintain efficiency.
The groundbreaking feature of EfficientNet is its comprehensive scaling strategy that allows for
model optimization across all three dimensions: depth, width, and resolution. This systematic
approach results in models that are not only more accurate but also more computationally
efficient than their predecessors. As a result, EfficientNet models have gained wide acceptance in
various computer vision tasks, including image classification, object detection, and
[Link] the context of computer vision applications, EfficientNet's efficiency is
particularly notable. Deep learning models are often criticized for their computational demands
and large memory footprints, making them challenging to deploy in resource-constrained
environments. EfficientNet addresses this issue by delivering state-of-the-art performance with
significantly fewer parameters compared to previous [Link], EfficientNet's transfer
learning capabilities make it highly versatile. Researchers and practitioners can take advantage of
pre-trained EfficientNet models, fine-tune them for specific tasks, and achieve remarkable
results. This adaptability is a boon in fields like medical imaging, where EfficientNet can be
employed for tasks like cancer detection, organ segmentation, and disease
[Link]'s impact extends beyond the research community and into real-world
applications. Its efficient yet high-performing models are well-suited for resource-limited
environments, such as mobile devices, embedded systems, and edge computing. These
capabilities open up new possibilities for a wide range of applications, from autonomous vehicles
and healthcare to augmented reality and [Link] conclusion, EfficientNet represents a
significant milestone in the evolution of deep learning models. Its innovative approach to model
scaling, coupled with remarkable efficiency, has elevated its status as a key player in the field of
computer vision. As the field of deep learning continues to advance, EfficientNet's influence is
likely to persist, offering the promise of more accessible and efficient artificial intelligence
solutions for a variety of applications.
Figure 4.3 EfficientNet Architecture
FLOW DIAGRAM OF WORKING MODEL
The workflow model for colon cancer detection is depicted below:
Figure 4.4 Flow Diagram for Working Model
CHAPTER 5
RESULTS AND DISCUSSION
PERFORMANCE EVALUATION
In the context of colon cancer detection, the dataset comprises 5000 images that
classifies colon cancerous tissues and non-cancerous histopathological [Link] facilitate
model development and evaluation, Python libraries such as Matplotlib, Keras, TensorFlow, and
others are leveraged. Model training and testing are executed on hardware powered by an 11th
generation Intel® CoreTM i5-1135G7 processor, clocked at 2.40GHz (with a turbo boost up to
2.42GHz), supported by 8.00 GB of RAM, and operating on a 64-bit system. This computational
environment provides the necessary resources to facilitate the rigorous training, testing, and
validation of deep learning models for colon cancer detection, ensuring their potential efficacy in
real-world clinical scenarios.
VALIDATION AND RESULTS
VGG19, ResNet, and InceptionV3 are just a few of the well-known CNN models
that were evaluated. Among the well-known CNN models, Efficient Net has the highest
accuracy. Various image pre-processing methods are employed while segmentation,
VGG19, and CNN are implemented through Python libraries, Keras, TensorFlow,
matplotlib, etc. Metrics used to assess how well the developed technique works include
accuracy, precision, recall, and the f1-score. The network's accuracy is displayed by the
mean average precision (MAP).
PERFORMANCE METRICS:
Precision Recall F1 - score Support
colon_aca 1.00 1.00 1.00 417
colon_n 1.00 1.00 1.00 383
accuracy 1.00 800
macro avg 1.00 1.00 1.00 800
weighted avg 1.00 1.00 1.00 800
PERFORMANCE METRICS
MODEL COMPARISON:
Figure 4.5 Graph for Training and Validation Accuracy
Figure 4.6 Graph for Training and Validation Loss
CONFUSION MATRIX:
Figure 4.7 Confusion Matrix
CHAPTER 6
CONCLUSION AND FUTURE WORK
This paper presents an analysis and comparison of handcrafted features and deep CNN
extracted features for the LC 25000 lung and colon cancer histopathological image dataset. The
experimental results indicate that texture and color-based handcrafted features hold greater
significance than edges and shape-based features in the classification and detection of lung and
colon cancer using histopathological images. This is due to the non-homogeneous color and
spreading of color in cancer cells, making features based on these parameters more significant.
Among the proposed handcrafted feature extraction techniques, the Color Correlogram feature
extraction technique extracts the most significant features. However, it should be noted that the
CC feature extraction technique extracts more features than other handcrafted feature extraction
techniques.
This is further supported by the validation scores given by multiple expert pathologists
for GlaS (9.251), LC-25000 (9.045), Kather-5k (9.248), NCT-100k (9.262), and HosC (9.853).
These findings will contribute to resolving the issues related to variability in clinical data and the
data requirements of deep learning-based classification techniques, which are combined with
diminishing gradient, focus refinement, and resolution degradation. These classified output
images, when provided to pathologists as a secondary reference, can assist them in formulating
precise diagnostic decisions and treatment plans. In future research, the proposed classifier will
be further optimized for the analysis of histopathological data from different organs.
APPENDIX 1
CODING:
import system libs
import os
import time
import shutil
import pathlib
import itertools
from PIL import Image
import cv2
import numpy as np
import pandas as pd
import seaborn as sns
sns.set_style('darkgrid')
import [Link] as plt
from sklearn.model_selection import train_test_split
from [Link] import confusion_matrix, classification_report
import tensorflow as tf
from tensorflow import keras
from [Link] import Sequential
from [Link] import Adam, Adamax
from [Link] import ImageDataGenerator
from [Link] import Conv2D, MaxPooling2D, Flatten, Dense, Activation,
Dropout, BatchNormalization
from [Link] import regularizersprint ('modules loaded')
#Data Preprocessing
#Read data and store it in dataframe
data_dir = "F:\lung_colon_image_set\colon_image_sets"
filepaths = []
labels = []
for fold in folds:
foldpath = [Link](data_dir, fold)
filelist = [Link](foldpath)
for file in filelist:
fpath = [Link](foldpath, file)
[Link](fpath)
[Link](fold)
Fseries = [Link](filepaths, name= 'filepaths')
Lseries = [Link](labels, name='labels')
df = [Link]([Fseries, Lseries], axis= 1)
batch_size = 16
img_size = (224, 224)
channels = 3
img_shape = (img_size[0], img_size[1], channels)
tr_gen = ImageDataGenerator()
ts_gen = ImageDataGenerator()
train_gen = tr_gen.flow_from_dataframe( train_df, x_col= 'filepaths', y_col= 'labels',
target_size= img_size, class_mode= 'categorical',
color_mode= 'rgb', shuffle= True, batch_size= batch_size)
valid_gen = ts_gen.flow_from_dataframe( valid_df, x_col= 'filepaths', y_col= 'labels',
target_size= img_size, class_mode= 'categorical',
color_mode= 'rgb', shuffle= True, batch_size= batch_size)
test_gen = ts_gen.flow_from_dataframe( test_df, x_col= 'filepaths', y_col= 'labels', target_size=
img_size, class_mode= 'categorical',
color_mode= 'rgb', shuffle= False, batch_size= batch_size)
g_dict = train_gen.class_indices # defines dictionary {'class': index}
classes = list(g_dict.keys()) # defines list of dictionary's kays (classes), classes names : string
images, labels = next(train_gen) # get a batch size samples from the generator
for i in range(16):
[Link](4, 4, i + 1)
image = images[i] / 255 # scales data to range (0 - 255)
[Link](image)
index = [Link](labels[i]) # get image index
class_name = classes[index] # get class of image
[Link](class_name, color= 'blue', fontsize= 12)
[Link]('off')
[Link]()
img_size = (224, 224)
channels = 3
img_shape = (img_size[0], img_size[1], channels)
class_count = len(list(train_gen.class_indices.keys())) # to define number of classes in dense
layer
# create pre-trained model (you can built on pretrained model such as : efficientnet, VGG ,
Resnet )
model = Sequential([
base_model,
BatchNormalization(axis= -1, momentum= 0.99, epsilon= 0.001),
Dense(256, kernel_regularizer= regularizers.l2(l= 0.016), activity_regularizer=
regularizers.l1(0.006),bias_regularizer= regularizers.l1(0.006), activation= 'relu'),
Dropout(rate= 0.45, seed= 123),Dense(class_count, activation= 'softmax')])
[Link](Adamax(learning_rate= 0.001), loss= 'categorical_crossentropy', metrics=
['accuracy'])
[Link]()
tr_acc = [Link]['accuracy']
tr_loss = [Link]['loss']
val_acc = [Link]['val_accuracy']
val_loss = [Link]['val_loss']
index_loss = [Link](val_loss)
val_lowest = val_loss[index_loss]
index_acc = [Link](val_acc)
acc_highest = val_acc[index_acc]
Epochs = [i+1 for i in range(len(tr_acc))]
loss_label = f'best epoch= {str(index_loss + 1)}'
acc_label = f'best epoch= {str(index_acc + 1)}'
[Link](figsize= (20, 8))
[Link]('fivethirtyeight')
[Link](1, 2, 1)
[Link](Epochs, tr_loss, 'r', label= 'Training loss')
[Link](Epochs, val_loss, 'g', label= 'Validation loss')
[Link](index_loss + 1, val_lowest, s= 150, c= 'blue', label= loss_label)
[Link]('Training and Validation Loss')
[Link]('Epochs')
[Link]('Loss')
[Link]()
[Link](1, 2, 2)
[Link](Epochs, tr_acc, 'r', label= 'Training Accuracy')
[Link](Epochs, val_acc, 'g', label= 'Validation Accuracy')
[Link](index_acc + 1 , acc_highest, s= 150, c= 'blue', label= acc_label)
[Link]('Training and Validation Accuracy')
[Link]('Epochs')
[Link]('Accuracy')
[Link]()
plt.tight_layout
[Link]()
ts_length = len(test_df)
test_batch_size = max(sorted([ts_length // n for n in range(1, ts_length + 1) if ts_length%n == 0
and ts_length/n <= 80]))
test_steps = ts_length // test_batch_size
train_score = [Link](train_gen, steps= test_steps, verbose= 1)
valid_score = [Link](valid_gen, steps= test_steps, verbose= 1)
test_score = [Link](test_gen, steps= test_steps, verbose= 1)
print("Train Loss: ", train_score[0])
print("Train Accuracy: ", train_score[1])
print('-' * 20)
print("Validation Loss: ", valid_score[0])
print("Validation Accuracy: ", valid_score[1])
print('-' * 20)
print("Test Loss: ", test_score[0])
print("Test Accuracy: ", test_score[1])
g_dict = test_gen.class_indices
classes = list(g_dict.keys())
cm = confusion_matrix(test_gen.classes, y_pred)
[Link](figsize= (10, 10))
[Link](cm, interpolation= 'nearest', cmap= [Link])
[Link]('Confusion Matrix')
[Link]()
tick_marks = [Link](len(classes))
[Link](tick_marks, classes, rotation= 45)
[Link](tick_marks, classes)
thresh = [Link]() / 2.
for i, j in [Link](range([Link][0]), range([Link][1])):
[Link](j, i, cm[i, j], horizontalalignment= 'center', color= 'white' if cm[i, j] > thresh else
'black')
plt.tight_layout()
[Link]('True Label')
[Link]('Predicted Label')
[Link]()
image_path = "F:\lung_colon_image_set\colon_image_sets\colon_aca\[Link]"
image = [Link](image_path)
# Preprocess the image
img = [Link]((224, 224))
img_array = [Link].img_to_array(img)
img_array = tf.expand_dims(img_array, 0)
predictions = loaded_model.predict(img_array)
class_labels = ['Colon_ACA', 'Lung_N']
score=[Link](predictions[0])
print(f"{class_labels[[Link](score)]}")
REFERENCES
[1] Y. Xi, P. Xu, Global colorectal cancer burden in 2020 and projections to2040, Transl.
Oncol. 14 (10) (2021), [Link]
[2] M. Shapcott, K.J. Hewitt, N. Rajpoot, Deep learning with sampling in colon cancer
histology, Front. Bioeng. Biotechnol. 7 (MAR) (2019), [Link]
fbioe.2019.00052.
[3] D. Bychkov, N. Linder, R. Turkki, S. Nordling, P.E. Kovanen, C. Verrill,
M. Walliander, M. Lundin, C. Haglund, J. Lundin, Deep learning-based tissue analysis predicts
outcome in colorectal cancer, Sci. Rep. 8 (1) (2018), [Link] org/10.1038/s41598-018-
21758-3.
[3] H. Haj-Hassan, A. Chaddad, Y. Harkouss, C. Desrosiers, M. Toews, C. Tanougast,
Classifications of multispectral colorectal cancer tissues using convolution neural network, J.
Pathol. Inf. 8 (1) (2017), [Link]
[4] J.N. Kather, J. Krisam, P. Charoentong, T. Luedde, E. Herpel, C.A. Weis, T. Gaiser,
A. Marx, N.A. Valous, D. Ferber, L. Jansen, Predicting survival from colorectal cancer
histology slides using deep learning: a retrospective multicenter study, PLoS Med. 16 (1)
(2019), [Link]
[5] B. Saroja, A. SelwinMich Priyadharson, Adaptive pillar K-means clustering-based colon
cancer detection from biopsy samples with outliers, Comput. Methods
Biomech. Biomed. Eng.: Imag. Vis. 7 (1) (2019), [Link]
21681163.2017.1350603.
[6] M. Dabass, S. Vashisth, R. Vig, Effect analysis of contrast enhancement techniques on
cancer classification in colon histopathology images using machine learning, in
Communications in Computer and Information Science 1229 (2020), [Link]
org/10.1007/978-981-15-5827-6_9. CCIS.
[7] P. Kainz, M. Pfeiffer, M. Urschler, Segmentation and classification of colon glands with
deep convolutional neural networks and total variation regularization, PeerJ
10 (2017), [Link] 2017.
[8] Z. Ma, Z. Swiderska-Chadaj, H. Salemi, D. McGovern, B. Knudsen, A. Gertych,
Semantic segmentation of colon glands in inflammatory bowel disease
biopsies,[Link].762(2019),
[Link] 0_34.
[9] O. Iizuka, F. Kanavati, K. Kato, M. Rambeau, K. Arihiro, M. Tsuneki, Deep learning
models for histopathological classification of gastric and colonic epithelial tumours, Sci. Rep.
10 (1) (2020), [Link]