yash_report
yash_report
BACHELOR OF TECHNOLOGY
IN
Submitted by
SATHISH SUNKARA
21A31A05J1
DEPARTMENT OF CSE
2021-2025
i
Deep Learning using TensorFlow
NAAC)
DEPARTMENT OF CSE
CERTIFICATE
This is to certify that the report entitled ―Deep Learning using TensorFlow, that is being
submitted by Sathish Sunkara of IV Year II Semester bearing roll number (21A31A05IJ1,
in partial fulfilment for the award of the Degree of Bachelor of Technology in Computer
Science and Engineering, Pragati Engineering College is a record of bonafide work carried out
by him.
TABLE OF CONTENTS
Page Number
1. Abstract 6
2 Introduction 7–8
iii
Deep Learning using TensorFlow
ACKNOWLEDGEMENT
I would like to sincerely thank Mr. Sayantan Kar, Assistant Professor, and Department
Internship Coordinator of Computer Science & Engineering for providing all the necessary
facilities that led to the successful completion of my report.
I would like to sincerely thank Dr. D. V. Manjula, Associate Professor and HOD, Computer
Science & Engineering for providing all the necessary facilities that led to the successful
completion of my report.
I wish to express our special thanks to my beloved Dr. G. Naresh, Professor and Principal for
giving guidelines and encouragement.
I wish to express my special thanks to our beloved Dr. K. Satyanarayana, Professor and
Director (Academics)for giving guidelines and encouragement.
I wish to express sincere gratitude to our beloved and respected Dr. P. KRISHNARAO,
Chairman and Sri. M.V. HARANATHA BABU, Director (Management) and Sri M.
SATISH, Vice-President for their encouragement and blessings.
I am thankful to all the faculty members of the department for their valuable suggestions. My
sincere thanks are also extended to all the teaching and non-teaching staff of Pragati
Engineering College. I also thank my parents whose continuous support has helped in the
successful completion of the project.
Sunkara Sathish
4
Deep Learning using TensorFlow
21A31A05J1
5
Deep Learning using TensorFlow
6
Deep Learning using TensorFlow
ABSTRACT
Deep learning, a subset of machine learning, has emerged as a transformative technology for
solving complex problems across a wide range of domains, including computer vision,
natural language processing (NLP), and speech recognition. Leveraging artificial neural
networks, deep learning models are capable of automatically learning from vast amounts of
data, uncovering intricate patterns that traditional machine learning algorithms might miss.
TensorFlow, an open-source framework developed by Google, has become a leading tool in
the deep learning community, offering a comprehensive environment for building, training,
and deploying these sophisticated models.
It explores the foundational aspects of deep learning, with a particular focus on how
TensorFlow enables the implementation of neural networks such as Convolutional Neural
Networks (CNNs) and Recurrent Neural Networks (RNNs). TensorFlow’s capabilities,
including automatic differentiation, scalability across CPUs and GPUs, and optimization
tools, make it an ideal choice for developers and researchers. The framework’s flexibility
allows for the development of a wide variety of deep learning models, from image
classification and object detection to language translation and text generation.
Through practical examples, the study demonstrates TensorFlow’s core strengths, such as its
efficient handling of large datasets, ability to run on multiple processors, and its support for
deploying models on diverse platforms. The integration of tools like TensorFlow Lite for
mobile devices and TensorFlow Serving for real-time model deployment further underscores
the platform's versatility in production environments. The paper emphasizes TensorFlow’s
role in simplifying the model-building process while ensuring that the models remain highly
performant, making it a preferred choice in both academic research and industry applications.
TensorFlow provides an accessible yet powerful framework that supports a wide array of
deep learning tasks, making it a cornerstone of modern AI development. Its robust ecosystem
not only facilitates the creation of complex neural networks but also streamlines the
deployment process, ensuring that AI-driven solutions can be efficiently integrated into real-
world applications. This study highlights how TensorFlow empowers developers and
researchers to push the boundaries of artificial intelligence with greater ease and flexibility.
7
Deep Learning using TensorFlow
2. INTRODUCTION
Deep Learning, a subset of Machine Learning, focuses on artificial neural networks to model
complex patterns and decision-making processes. It powers applications in healthcare, finance,
autonomous systems, and more by learning from large datasets and making predictions with
minimal human intervention.
8
Deep Learning using TensorFlow
9
Deep Learning using TensorFlow
10
Deep Learning using TensorFlow
3.3 Loss Functions in Deep Learning: Loss functions measure how well the model performs.
Types of Loss Functions
1. For Regression Problems:
o Mean Squared Error (MSE): MSE=1N∑i=1N(yi−y^i)2MSE = \frac{1}{N}
\sum_{i=1}^{N} (y_i - \hat{y}_i)^2MSE=N1i=1∑N(yi−y^i)2 o Mean Absolute Error
(MAE): MAE=1N∑i=1N∣yi−y^i∣MAE = \frac{1}{N}
\sum_{i=1}^{N} |y_i - \hat{y}_i|MAE=N1i=1∑N∣yi−y^i∣
2. For Classification Problems: o Binary Cross-Entropy (for 2 classes):
L=−1N∑i=1N[yilog(y^i)+(1−yi)log(1−y^i)]L = -\frac{1}{N} \sum_{i=1}^{N} [y_i \
log(\hat{y}_i) + (1 - y_i) \log(1 - \hat{y}_i)]L=−N1i=1∑N
[yilog(y^i)+(1−yi)log(1−y^i)] o Categorical Cross-Entropy (for multiple classes):
L=−∑yilog(y^i)L = -\sum y_i
\log(\hat{y}_i)L=−∑yilog(y^i)
3.3 Activation Functions
Activation functions introduce non-linearity, allowing neural networks to learn
complex patterns. Types of Activation Functions
1.Sigmoid Function (Used for binary classification)
f(x)=11+e−xf(x) = \frac{1}{1 + e^{-x}}f(x)=1+e−x1
o Output range: 000 to 111.
o Causes vanishing gradients (small updates for deep networks).
2.ReLU (Rectified Linear Unit) (Most widely used)
f(x)=max(0,x)f(x) = \max(0, x)f(x)=max(0,x)
o Prevents vanishing gradients.
o Computationally efficient.
3.Tanh (Hyperbolic Tangent) Function
f(x)=ex−e−xex+e−xf(x) = \frac{e^x - e^{-x}}{e^x + e^{-x}}
f(x)=ex+e−xex−e−x
o Output range: −1-1−1 to 111, centered around zero.
4.Softmax (For multi-class classification)
f(xi)=exi∑exjf(x_i)=\frac{e^{x_i}}{\sum e^{x_j}}
f(xi)=∑exjexi
o Converts raw scores into probabilities.
11
Deep Learning using TensorFlow
1. Convolutional Layer:
• Extracts spatial features from an image using filters (kernels).
• Computes feature maps through convolution operations.
Mathematical Formula:
Y(i,j) = ∑m∑nX(i+m,j+n) K(m,n)Y(i, j) = \sum_{m}\sum_{n} X(i+m, j+n) \cdot K(m,
n)Y(i,j )= m∑n∑X(i+m,j+n) K(m,n) where: o XXX = input image o KKK = kernel
o YYY = feature map o
2. Activation Function (ReLU):
Introduces non-linearity to improve learning.
3. Pooling Layer (Max Pooling):
• Reduces spatial dimensions while preserving key features.
12
Deep Learning using TensorFlow
13
Deep Learning using TensorFlow
14
Deep Learning using TensorFlow
Objective of the activity done in week 1: The first week focused on introducing participants
to the fundamentals of deep learning while ensuring they had a fully functional development
15
Deep Learning using TensorFlow
environment. The training covered the history, importance, and key concepts of deep learning,
including perceptron, multi-layer perceptron, forward and backward propagation, and the
vanishing gradient problem. Additionally, participants were guided through platform setup,
including Jupyter Notebook, VS Code, and GPU configuration for deep learning experiments.
Platform Setup
The training began with setting up the development environment for deep learning projects.
Participants installed and configured Jupyter Notebook for interactive coding and model 42
experimentation, VS Code for writing Python scripts and debugging deep learning models, and
GPU setup with CUDA, cuDNN, and TensorFlow/PyTorch to enable GPU acceleration for
model training. Anaconda was used to set up a virtual environment to manage dependencies
effectively. This setup ensured that participants had a fully functional Python-based deep
learning workspace, capable of handling large-scale computations. The first week of training
laid a strong foundation in Deep Learning, starting with the Platform Setup, ensuring all
participants had Jupyter Notebook and VS Code properly configured. The session also covered
GPU Setup, emphasizing the need for powerful hardware to accelerate computations for deep
learning models. The introduction to Deep Learning traced its History, from early Artificial
Neural Networks (ANNs) to modern-day deep learning architectures. A core focus was on
Forward Propagation, where data moves from input through hidden layers to produce an
output. Participants learned about Weights, Biases, and Activation Functions, such as Sigmoid,
Tanh, and ReLU, which introduce non-linearity into neural networks, allowing them to learn
intricate patterns. The session emphasized how each neuron applies an activation function to
transform data, ensuring that the network can capture complex relationships within the input
features.
The week concluded with a practical Hands-on Implementation, where participants applied
Forward and Backward Propagation using a simple neural network model, observed how Loss
Functions evolve during training, and experimented with different Optimizers to enhance
model performance.
ACTIVITY LOG FOR THE SECOND WEEK
16
Deep Learning using TensorFlow
17
Deep Learning using TensorFlow
WEEKLY REPORT
Objective of the activity done in week 2: The second week aimed to enhance participants'
understanding of deep learning by focusing on Activation Functions, Loss Functions, and
Optimizers. The curriculum covered different types of activation functions, their significance,
regression and classification loss functions, and optimization techniques. This comprehensive
exploration was designed to improve participants' proficiency in training deep learning models
effectively.
The week concluded with hands-on experiments where participants implemented and compared
different Activation Functions, Loss Functions, and Optimizers in training deep learning
models. By the end of the week, participants had gained a thorough understanding of how
activation functions affect learning, how loss functions measure model performance, and how
optimizers improve training efficiency, setting the foundation for more advanced topics in deep
learning.
18
Deep Learning using TensorFlow
Day 6 Project structure on ANN for classification Understanding key concepts and
implementation
19
Deep Learning using TensorFlow
Objective of the activity done in week 1: The third week aimed to strengthen participants'
knowledge of optimizers, artificial neural networks (ANNs) for regression and classification,
and practical implementations of deep learning models. The curriculum covered advanced
optimization techniques, structured ANN models for car price and laptop price prediction, and
classification tasks. This hands-on learning experience was designed to enhance participants'
ability to build and deploy ANN-based predictive models.
The training began with an advanced discussion on Optimizers-2, focusing on techniques such
as AdamW, Nadam, AdaDelta, and Lookahead Optimizer. AdamW, a weight-decay variant of
Adam, was introduced to address overfitting issues by incorporating proper L2 regularization.
Nadam (Nesterov-accelerated Adaptive Moment Estimation) was explored for its ability to
accelerate convergence by incorporating Nesterov momentum. AdaDelta was covered as an
improvement over Adagrad, helping in situations where learning rates decay too aggressively.
Finally, the Lookahead Optimizer was introduced, showing its effectiveness in stabilizing
updates and improving convergence by reducing oscillations during training. The training then
transitioned to Project Structure on ANN for Regression, where participants learned the
fundamental steps required to build an ANN-based regression model. The importance of feature
selection, normalization, and loss function choice (such as MSE or MAE) was highlighted.
Participants gained insights into designing fully connected neural networks (FCNNs) with
multiple layers and activation functions like ReLU and Leaky ReLU to improve performance in
regression tasks. The project followed an end-to-end pipeline, including data collection,
cleaning, feature scaling, and one-hot encoding of categorical variables. Model evaluation was
done using MSE and R-squared scores to assess prediction accuracy. Participants also explored
hyperparameter tuning using GridSearchCV and KerasTuner to optimize the model’s
performance.
By the end of the week, participants had gained practical experience in building and structuring
ANN-based regression and classification models, fine-tuning optimizers for improved
convergence, and applying real-world predictive modeling techniques for pricing estimation.
20
Deep Learning using TensorFlow
21
Deep Learning using TensorFlow
WEEKLY REPORT
Objective of the activity done in week 4: The fourth week aimed to provide participants with
hands-on experience in Diabetes Classification using ANN, along with an introduction to
Convolutional Neural Networks (CNNs). The training covered essential CNN concepts,
including padding, pooling, flatten layers, weight initialization techniques, and CNN
architectures such as LeNet-5 and AlexNet. This structured learning helped participants
develop a strong foundation in deep learning for both structured and unstructured data.
The week began with the Diabetes Classification Project using ANN, where participants
implemented an artificial neural network (ANN) model to classify patients as diabetic or non
diabetic based on medical attributes such as glucose levels, blood pressure, BMI, insulin levels,
and age. The dataset was preprocessed through handling missing values, feature scaling using
StandardScaler, and dealing with class imbalances using techniques like SMOTE (Synthetic
Minority Over-sampling Technique). The ANN architecture included multiple dense layers with
ReLU activation for hidden layers and sigmoid activation for the output layer, with binary
cross- entropy as the loss function. Model evaluation was performed using accuracy, precision,
recall, and AUC-ROC to measure its effectiveness. Participants learned about convolutional
layers, which apply filters to extract important patterns, and how CNNs reduce model
complexity while retaining essential features. Pooling layers, including max pooling (which
retains the most important features) and average pooling (which smooths feature maps), were
introduced to demonstrate how they help in dimensionality reduction and preventing
overfitting. The Flatten layer was explored, showing how it converts the 2D feature maps from
convolutional layers into a 1D vector for input into fully connected layers.
By the end of the week, participants had acquired practical experience in implementing an
ANN- based medical classification model, fundamental CNN operations, and an understanding
of classic CNN architectures like LeNet-5 and AlexNet.
22
Deep Learning using TensorFlow
Day 2 INCEPTION V3
Understanding key concepts and
implementation
Day 5 Image classification project cat vs dog Understanding key concepts and
implementation
Day 6 Classification using advanced deep learning Understanding key concepts and
models implementation
WEEKLY REPORT
Objective of the activity done in week 5: The fifth week aimed to enhance participants'
understanding of advanced CNN architectures by covering VGG-16, InceptionV3, ResNet-50,
and EfficientNet. The week also included a hands-on image classification project: Cat vs Dog,
where participants implemented these architectures to classify images. This training helped
23
Deep Learning using TensorFlow
participants gain practical knowledge in deep learning for image recognition while exploring
the evolution of CNN architectures for improved accuracy and efficiency.
The week began with an introduction to VGG-16, a deep convolutional neural network
(CNN) architecture that uses small 3×3 filters across multiple convolutional layers. Participants
learned about its sequential deep structure, uniform architecture design, and fully connected
layers that enhance feature extraction. They implemented VGG-16 for image classification,
leveraging pre-trained weights from ImageNet and fine-tuning it for specific datasets.
Following this, participants studied ResNet-50, a revolutionary deep learning model that
introduced residual learning to combat the vanishing gradient problem in deep networks.
By the end of the week, participants gained in-depth knowledge of state-of-the-art CNN
architectures, their advantages, and practical applications. They successfully implemented
image classification using advanced deep learning models, preparing them for real-world
computer vision challenges
Signature of Guide
24
Deep Learning using TensorFlow
WEEKLY REPORT
Objective of the activity done in week 6: The sixth week aimed to introduce participants to
object detection and image segmentation concepts, covering object detection terminology,
bounding box fundamentals, aspect ratio (UI ratio), and image segmentation techniques.
Participants explored Roboflow for dataset preprocessing and annotation and learned about the
YOLO (You Only Look Once) architecture, including its evolution. The week concluded with a
YOLOv11 custom image classification project, enabling participants to implement real-world
object detection models.
25
Deep Learning using TensorFlow
Following this, participants were introduced to Roboflow, an AI-powered platform for image
dataset management and augmentation. They learned how to upload, preprocess, augment, and
export datasets for training object detection models. They applied data augmentation techniques
such as flipping, scaling, brightness adjustment, and rotation to improve model generalization.
By the end of the week, participants gained hands-on experience in object detection, dataset
annotation, YOLO training, and model deployment, preparing them for advanced computer
vision applications.
ACTIVITY LOG FOR THE SEVENTH WEEK
Signature of Guide
26
Deep Learning using TensorFlow
WEEKLY REPORT
Objective of the activity done in week 7: The seventh week aimed to provide participants
with a deep understanding of YOLOv11 and its applications in custom object detection, brain
tumor detection, PEG (Percutaneous Endoscopic Gastrostomy) detection, image segmentation,
and object tracking. The sessions covered YOLOv11 architecture, dataset preparation, model
training, and real-world deployment for various applications in medical imaging and object
tracking.
The training began with an introduction to YOLOv11, an advanced version of the YOLO (You
Only Look Once) object detection model. Participants explored its architecture, improvements
over previous YOLO versions, and how it achieves real-time detection with high accuracy. Key
27
Deep Learning using TensorFlow
The next session focused on custom object detection using YOLOv11. Participants learned how
to collect and annotate a dataset using Roboflow, perform data augmentation, and preprocess
images to improve model performance. They trained YOLOv11 on a custom dataset, optimized
hyperparameters, and evaluated the model using metrics like mean Average Precision (mAP),
recall, and Intersection over Union (IoU).
The training then covered PEG (Percutaneous Endoscopic Gastrostomy) detection using
YOLOv11. This project involved detecting medical tubes in X-ray and endoscopic images.
Participants curated annotated medical datasets, applied contrast enhancement techniques, and
trained YOLOv11 to identify PEG placements in real-time medical procedures. Post-processing
methods, including non-maximum suppression (NMS) and confidence score filtering, were
used to refine detections.
By the end of the week, participants gained expertise in YOLOv11 for various applications,
including custom object detection, medical imaging, image segmentation, and object tracking.
They successfully trained, optimized, and deployed YOLOv11 models for real-world use cases,
preparing them for advanced deep learning and computer vision projects.
Signature of Guide
28
Deep Learning using TensorFlow
Day 3 Image segmentation with Sam2 model using Understanding key concepts and
yolo implementation
WEEKLY REPORT
The THIS week focused on object detection and image segmentation using advanced deep
learning models. The training covered YOLOv5 for real-time detection, Detectron2 for object
detection, image segmentation with the SAM2 model using YOLO, object detection using R
CNN and Mask R-CNN, and medical image segmentation with U-Net. The objective was to
29
Deep Learning using TensorFlow
equip participants with the knowledge and practical skills required to build, train, and deploy
state-of-the-art object detection and segmentation models.
58 The next segment covered image segmentation using the SAM2 model with YOLO. This
session introduced Segment Anything Model (SAM), which leverages transformers for accurate
image segmentation. Participants used SAM with YOLOv5 to segment objects more precisely,
applying it to tasks like medical image segmentation and satellite image analysis.
By the end of the week, participants successfully implemented and optimized object detection
and image segmentation models using YOLOv5, Detectron2, R-CNN, Mask R-CNN, SAM2,
and U-Net. They also deployed trained models for real-world applications, including
autonomous systems, healthcare imaging, and industrial automation, gaining hands-on
experience in deep learning-based computer vision solutions.
30
Deep Learning using TensorFlow
Day 2 RNN-NLP-Segmentation
Understanding key concepts and
implementation
31
Deep Learning using TensorFlow
WEEKLY REPORT
The training began with an introduction to RNN in NLP, explaining how Recurrent Neural
Networks process sequential data by maintaining contextual memory. Participants explored the
architecture of RNNs, including hidden states and weight sharing, making them effective for
language modeling and sequence prediction.
The first core topic was text tokenization, which breaks down text into meaningful units called
tokens. Participants explored types of tokenization: word-level tokenization (splitting text into
words) and character-level tokenization (breaking text into individual characters). They also
studied subword tokenization (Byte Pair Encoding, SentencePiece) used in modern NLP
models.
Following tokenization, text segmentation was covered, demonstrating how texts are divided
into sentences or phrases for better processing. Various segmentation techniques, including
rule- based and machine-learning-based methods, were discussed.
The next segment focused on data cleaning, an essential step in NLP preprocessing. They
explored lemmatization and stemming, which reduce words to their base form to handle
variations in natural language. by the end of the week, participants had gained hands-on
experience in text preprocessing, feature extraction, and deep learning-based NLP models.
They successfully implemented techniques such as n-grams, Word2Vec, and Seq2Seq models
32
Deep Learning using TensorFlow
to develop language understanding systems for applications like sentiment analysis, text
classification, and machine translation.
Day 4 Google stock price using LSTM Understanding key concepts and
implementation
Day 5 GRU – Text classification using GRU Understanding key concepts and
implementation
WEEKLY REPORT
33
Deep Learning using TensorFlow
Objective of the activity done in week 10: The this week aimed to deepen participants'
understanding of Sentiment Classification in NLP, Transformer Architecture, LSTM for time-
series forecasting, and GRU for text classification. The objective was to equip participants with
the knowledge and hands-on experience needed to apply sequential deep learning models in
financial forecasting, NLP-based sentiment analysis, and text classification tasks
The training began with an introduction to Sentiment Classification using NLP, where
participants explored how to analyze textual data and classify it as positive, negative, or
neutral. They learned about text preprocessing techniques, tokenization, stopword removal, and
feature extraction methods such as Bag of Words (BoW), TF-IDF, and Word2Vec. The session
emphasized how deep learning-based models like LSTMs and GRUs outperform traditional
machine learning models (Logistic Regression, SVM, Naïve Bayes) in sentiment analysis.
By the end of the week, participants had a strong grasp of sentiment analysis, transformer models,
LSTM- based financial forecasting, and GRU-based text classification. They successfully implemented
deep learning models for NLP and time-series analysis
34
Deep Learning using TensorFlow
Learning Outcome
Day Brief description of the daily activity
WEEKLY REPORT
35
Deep Learning using TensorFlow
Objective of the activity done in week 11: The session aimed to introduce participants to
Generative Adversarial Networks (GANs), covering their architecture, working principles, and
practical applications. Additionally, participants explored Reinforcement Learning (RL) basics,
focusing on actions, rewards, and policy optimization. The session also included project-based
learning, such as GAN-based image generation and language translation using deep learning
models, followed by discussions on deployment strategies for real-world applications
A key topic covered was different types of GANs, including DCGAN (Deep Convolutional
GAN), CycleGAN (for style transfer), and Conditional GANs (cGANs), which enable more
controlled image generation. Practical applications of GANs in image super-resolution, face
generation, and synthetic data creation were discussed, along with the challenges of mode
collapse, training instability, and evaluation metrics like FID and IS (Inception Score).
By the end of the session, participants had hands-on experience with GANs, sequence-to
sequence models for translation, reinforcement learning basics, and practical deployment
strategies. This knowledge provided them with a deeper understanding of AI-driven content
generation, language processing, and autonomous learning systems.
ACTIVITY LOG FOR THE TWELVETH WEEK
36
Deep Learning using TensorFlow
WEEKLY REPORT
Objective of the activity done in week 12: The session aimed to introduce participants to
MLOps (Machine Learning Operations), focusing on the automation, deployment, and
monitoring of machine learning models. The training covered MLOps tools, including GitHub
Actions for CI/CD, Docker for containerization, AWS for cloud deployment, and model
37
Deep Learning using TensorFlow
monitoring techniques. By the end of the session, participants understood how to build an end-
to-end pipeline for deploying machine learning models efficiently.
The session began with an introduction to MLOps, emphasizing its importance in bridging the
gap between model development and production deployment. Participants explored MLOps
principles, such as continuous integration (CI), continuous deployment (CD), model versioning,
automation, and monitoring. These practices ensure that machine learning models are deployed
seamlessly and maintained efficiently.
Next, the session covered GitHub Actions, a powerful CI/CD tool that automates workflows.
Participants learned how to create YAML-based GitHub Actions workflows to automate model
training, testing, and deployment. The process included triggering builds on code commits,
running unit tests, and deploying models to cloud environments.
By the end of the session, participants had a clear understanding of MLOps best practices,
cloud deployment, CI/CD automation, and model monitoring, equipping them with the
necessary skills to deploy scalable, reliable, and automated ML solutions.
38
Deep Learning using TensorFlow
Learning Outcome
Day Brief description of the daily activity
WEEKLY REPORT
39
Deep Learning using TensorFlow
Objective of the activity done in week 13: The objective for Week 13 was to initiate the Chest Cancer
Classification project by setting up the necessary technical environment and processing the dataset. This
phase aimed to lay the groundwork for deep learning model development through proper data collection,
preprocessing, and structuring.
The week commenced with the formulation of the core problem statement—developing an AI-powered
solution for the early detection of chest cancer through the analysis of CT scan images. The aim was to
leverage deep learning techniques to classify scans as either cancerous or non-cancerous, thereby
assisting in faster diagnosis and timely treatment. To build a reliable and accurate model, the team
conducted a detailed review of available datasets and finalized the use of publicly accessible medical
imaging datasets from platforms such as Kaggle and the National Institutes of Health (NIH). These
datasets provided a diverse collection of labeled CT scan images, which served as the foundation for
training and evaluating the model.
The subsequent phase involved preprocessing the raw medical images. Since many of the CT scans were
initially stored in the DICOM (Digital Imaging and Communications in Medicine) format—a standard in
medical imaging—the team used OpenCV to convert these into more manageable formats like JPEG or
PNG. This step enhanced compatibility with the machine learning pipeline. Once converted, each image
was resized to a uniform dimension, and pixel normalization was applied to standardize input values,
ensuring that the model could learn from consistent data. To address potential overfitting and enhance the
model’s ability to generalize to unseen data, various data augmentation techniques were implemented.
These included horizontal and vertical flipping, random rotations, and brightness adjustments, which
artificially expanded the dataset and introduced variability during training.
In order to conduct a fair and balanced evaluation of model performance, the entire dataset was split into
three subsets: 80% for training, 10% for validation, and 10% for testing. This approach allowed the team
to train the model on a large portion of the data while retaining enough samples for unbiased validation
and final performance testing. The split also ensured that the model was not evaluated on data it had
already seen, thereby maintaining the integrity of the results.
40
Deep Learning using TensorFlow
WEEKLY REPORT
Objective of the activity done in week 14: The objective for Week 14 was to explore the dataset
through EDA (Exploratory Data Analysis), build and train a Convolutional Neural Network (CNN), and
evaluate initial model performance using standard metrics.
41
Deep Learning using TensorFlow
The week commenced with an extensive Exploratory Data Analysis (EDA) phase aimed at gaining a
deeper understanding of the dataset's structure, particularly the distribution of classes and image
characteristics. Visualization tools such as Seaborn and Matplotlib were employed to analyze key aspects
including class imbalance, pixel intensity distributions, and variations in image structure. These
visualizations revealed a significant imbalance in the dataset, with cancerous samples being notably
underrepresented compared to non-cancerous ones. Recognizing the potential impact of this imbalance
on model performance, the team documented potential future strategies to mitigate it—such as
implementing weighted loss functions during training or applying oversampling techniques to augment
the minority class.
Model development was carried out using the TensorFlow/Keras deep learning framework. A
Convolutional Neural Network (CNN) architecture was custom-built, consisting of multiple
convolutional layers for feature extraction, interspersed with pooling layers to reduce spatial dimensions,
and fully connected dense layers for classification. In parallel, the team experimented with transfer
learning by utilizing pre-trained models like ResNet50, which are known for their deep feature
representation capabilities. These models were fine-tuned on the dataset to leverage their learned weights
from large-scale image classification tasks. Hyperparameters such as learning rate, batch size, and
number of epochs were methodically tuned using validation accuracy as the guiding metric to optimize
model performance.
Model training was conducted on Google Colab, taking advantage of its GPU acceleration to reduce
training time and handle computationally intensive operations more efficiently. Throughout the training
process, the team generated loss and accuracy plots to monitor learning behavior over epochs. Model
evaluation was comprehensive, using a combination of metrics including Accuracy, Precision, Recall,
F1- score, and AUC-ROC to ensure balanced performance across both classes. To combat overfitting,
Dropout layers were incorporated into the model architecture, and EarlyStopping callbacks were
configured to halt training once the model's performance ceased to improve on the validation set.
42
Deep Learning using TensorFlow
Day 1 Model Saving & Export (.h5 format) Understanding key concepts
and implementation
Day 3 Integrated CNN model with Flask API Understanding key concepts
and implementation
Day 5 Dockerfile Creation & Image Build Understanding key concepts and
implementation
WEEKLY REPORT
Objective of the activity done in week 15: The objective for Week 15 was to deploy the trained model
as a RESTful API using Flask, test the endpoints, and prepare the project for containerization using
Docker.
During this phase of the Chest Cancer Classification Project, the primary focus was on integrating the
trained deep learning model into a Flask-based web application, laying the groundwork for real-time
interaction with end-users. The model, trained to classify CT scan images as either cancerous or non-
cancerous, was saved in the .h5 format, a standard format used by TensorFlow and Keras for storing
43
Deep Learning using TensorFlow
models. This model was then loaded within the Flask backend, where it would be accessed during
prediction requests.
A RESTful API route, /predict, was developed to handle incoming HTTP POST requests containing
medical CT scan images. Upon receiving an image, the API would initiate a structured pipeline that
included input validation, image preprocessing, and model inference. The preprocessing stage was
designed to resize input images to the model’s expected dimensions and normalize pixel values to
enhance prediction accuracy. After preprocessing, the model would perform inference, returning a
classification result indicating whether the submitted scan was likely cancerous or non-cancerous. This
output was then returned to the client in a structured JSON format, ensuring usability and clarity.
To verify the robustness of the application, local testing was conducted using tools such as Postman and
cURL. These tools allowed the team to simulate API calls with real image inputs, validate the
functionality of the /predict endpoint, and assess the accuracy and consistency of the model’s
responses. This rigorous testing phase ensured that the API logic was sound and that the backend could
handle various input scenarios effectively.
In preparation for deployment, the team initiated the containerization process to package the application
and its dependencies into a portable environment. A Dockerfile was written, defining the build
instructions to include all required libraries, such as TensorFlow for model execution, Flask for API
management, and OpenCV for image processing. The Docker image was then built and run locally using
Docker Desktop, replicating a production-like environment. Successful container execution confirmed
that the application and its environment were correctly configured and fully functional outside the
development setup. By the end of the week, the project team had achieved a major milestone—a fully
functional and locally tested prediction API, packaged within a Docker container. This ensured the
application was portable, consistent, and ready for cloud deployment. The progress made during this
week was pivotal in moving the project closer to a scalable, production-ready solution capable of
assisting in chest cancer diagnosis through automated CT scan classification.
44
Deep Learning using TensorFlow
ACTIVITY LOG FOR THE SIXTEENTH WEEK
Day 1 AWS EC2 Launch & SSH Configuration Understanding key concepts
and implementation
Day 5 Integrated GitHub Actions with Docker & EC2 Understanding key concepts and
implementation
45
Deep Learning using TensorFlow
WEEKLY REPORT
Objective of the activity done in week 16: The objective for Week 16 was to complete cloud
deployment on AWS EC2, implement CI/CD with GitHub Actions, and integrate basic monitoring tools
for maintaining system stability and performance.
The final week of the Chest Cancer Classification Project was dedicated to deploying the trained deep
learning model into a cloud environment, marking a significant transition from a development prototype
to a production-ready application. This stage was crucial for enabling real-world usage of the system,
where users could interact with the model via an API and receive real-time predictions. To accomplish
this, the project team launched an Ubuntu-based Amazon EC2 instance, which served as the hosting
environment for the application. Core software components such as Docker and Git were installed on the
server, laying the groundwork for containerized deployment and version-controlled code management. A
Docker image—containing the Flask API, the trained model, and all required dependencies—was pulled
from Docker Hub and executed on the EC2 instance.
To ensure the Flask API could perform reliably under production-level conditions, the team integrated
Gunicorn, a Python-based WSGI server capable of handling multiple concurrent requests. Gunicorn
offered superior performance and stability compared to Flask’s default development server. To further
optimize request handling and enhance security, Nginx was installed and configured as a reverse proxy
server. Nginx was responsible for managing incoming HTTP requests, routing them to the appropriate
Gunicorn worker, and serving static content when needed. This combination of Gunicorn and Nginx
significantly improved the application’s load distribution, response time, and fault tolerance.
One of the most impactful aspects of the deployment phase was the implementation of a Continuous
Integration and Continuous Deployment (CI/CD) pipeline using GitHub Actions. This automation
strategy was configured to trigger on every push to the project’s main GitHub branch. The pipeline
included multiple critical steps: installing project dependencies, running unit tests to validate
functionality, executing model tests to ensure predictive accuracy, building a new Docker image, and
securely deploying that image to the EC2 instance. This seamless workflow reduced manual intervention
and deployment errors, enabling faster and more reliable application updates with each code iteration.
By the conclusion of the final week, the project team had delivered a fully operational, cloud-deployed,
and production-grade system. The deep learning model was not only trained and encapsulated within a
Flask API but was also containerized with Docker, hosted on a scalable AWS infrastructure, and
supported by a robust CI/CD pipeline. These advancements culminated in a complete and professional
solution capable of supporting real-time cancer classification use cases. The success of this deployment
phase signified the successful completion of the Chest Cancer Classification Project and demonstrated
the system’s readiness for real-world applications in medical imaging diagnostics.
46
Deep Learning using TensorFlow
Conclusion
The study and application of Deep Learning have emerged as a cornerstone in the advancement of Artificial
Intelligence. This training program provided a comprehensive overview of the foundational and advanced
concepts required to understand and implement deep learning systems. Through structured sessions on
neural networks, activation functions, loss functions, optimization algorithms, and practical model training,
learners developed a solid understanding of the mechanics behind intelligent systems.
The capstone project, titled "Chest Cancer Classification Using CT Scan Images with Deep Learning &
Deployment," exemplified the real-world relevance of deep learning. It showcased how convolutional
neural networks (CNNs) can be effectively utilized for medical image classification, contributing to early
detection and diagnosis in the healthcare domain. Beyond model development, the program emphasized
industry- aligned practices such as REST API integration with Flask, containerization using Docker,
deployment on cloud platforms like AWS, and automation through CI/CD pipelines with GitHub Actions.
The hands-on experience across the entire machine learning lifecycle—from data pre-processing and
exploratory analysis to model deployment and monitoring—equipped participants with a practical skillset
that aligns with current industry standards. The inclusion of modern tools and frameworks such as
TensorFlow, OpenCV, Flask, Docker, and AWS ensured that learners are prepared for scalable and
production-ready AI solutions.
Overall, this training program not only reinforced technical competencies in deep learning but also
encouraged critical thinking, problem-solving, and innovation in applying AI to real-world challenges. It has
laid a strong foundation for further exploration and specialization in the rapidly evolving field of artificial
intelligence.
47
Deep Learning using TensorFlow
48
Deep Learning using TensorFlow
49