Project Report
Project Report
“JNANASANGAMA”,BELAGAVI-590018
A PROJECT REPORT(BCS786)
ON
Submitted in partial fulfilment of the requirements for the award of the degree of
BACHELOR OF ENGINEERING
IN
COMPUTER SCIENCE AND ENGINEERING
Submitted by
MANASA M K 4GL22CS023
SANJANA H P 4GL22CS047
T CHANNABASAVA 4GL22CS053
GNANESH KUMAR D P 4GL23CS406
CERTIFICATE
This is Certified that the project work entitled “LUNG CANCER DETECTION SYSTEM USING
ML” is a bonafide work carried out by MANASA M K(4GL22CS023) , SANJANA H
P(4GL22CS047) T CHANNABASAVA(4GL22CS053) , GNANESH KUMAR D P(4GL23CS406).In
partial fulfillment
for the award of Bachelor of Engineering in Computer Science and Engineering of Visvesvaraya Tech-
nological University, Belagavi during the year 2025-2026. It is certified that all
corrections/suggestions indicated for internal evaluation have been incorporated in the report deposited
in the department li- [Link] project report has been approved as it is satisfied the academic
requirements in respect of project work prescribed for the Bachelor of Engineering Degree.
———————————- ——————————
Signature of the Guide Signature of the
Coordinator [Link] PRASAD B S [Link] B
Associate Professor Project Coordinator
[Link] CS&E [Link] CS&E
——————————– ———————————
Signature of HOD Signature of the Principal
[Link] S [Link] K I
Head of [Link] CS&E Principal GEC,Kushalnagar
EXTERNAL VIVA-VOCE
1. ————————- ————————
2. ————————- ————————-
GOVERNMENT ENGINEERING COLLEGE
KUSHALNAGAR-571234,KODAGU,KARNATAKA.
Affiliated to VTU,Belagavi,Approved by AICTE New Delhi
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
DECLARATION
Date:
Place: Kushalnagara
We are extremely grateful to our own and beloved [Link] Prasad B.S, Associate Profes-
sor,Department of Computer Science and Engineering, for guiding us throughout the project .
We are highly indebted to Head of the Department Of CSE [Link] S for giving us the op-
portunity.
We would like to thank all the teaching and non-teaching faculty of the [Link] extend a very
heartfelt thanks to our parents and friends for all the moral support they provided during the
preparation of this Project.
MANASA M K
SANJANA H P
T CHANNABASAVA
GNANESH KUMAR D P
i
Abstract
Lung cancer remains one of the leading causes of cancer-related mortality worldwide, primarily due to
late-stage diagnosis and limited early detection methods. This project proposes a Lung Cancer
Detection System that leverages machine learning techniques to identify potential lung cancer at an
early stage based on clinical and demographic data. The system utilizes a supervised learning model
trained on relevant features such as age, smoking history, genetic predisposition, environmental
exposure, and radiographic findings. These model aims to achieve high accuracy, sensitivity, and
specificity in cancer risk prediction. The final model is deployed via a user-friendly interface that
allows healthcare providers to input patient data and receive real-time risk assessments. This system
has the potential to support early intervention, improve patient outcomes, and reduce the burden on
healthcare [Link] cancer is one of the most prevalent and deadly forms of cancer, accounting
for millions of deaths annually worldwide. Its high mortality rate is primarily attributed to late-stage
diagnosis when the disease has already progressed significantly. Early detection remains a critical
factor in improving survival rates and treatment outcomes. Traditional diagnostic methods such as
biopsy, X-rays, CT scans, and histopathological examinations, while effective, are often time-
consuming, expensive, and may not be accessible in resource-limited settings. Hence, there is an
urgent need for an intelligent, cost-effective, and non-invasive approach to assist clinicians in
predicting lung cancer risk at an earlier stage. This project proposes a Lung Cancer Prediction System
based on machine learning (ML) techniques designed to analyze patient data and predict the likelihood
of lung cancer with high accuracy and reliability.
ii
Table of Contents
Acknowledgment i
Abstract ii
List of Figures iv
List of Tables v
List of Acronyms v
1 INTRODUCTION 1
1.1 Scope of the Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.3 Challenges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.4 Existing System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.5 Proposed system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.6 Problem Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.7 Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2 LITERATURE REVIEW 6
2.1 Objectives of literature survey . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.2 Related Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.2.1 Attention enhanced inceptionNext based hybrid deep learning model for lung
cancer detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.2.2 Advancing Oncology Diagnosis:AI enabled early detection of Lung cancer through
image analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.2.3 Early Detection of Lung Cancer Using Predictive Modeling Incorporating CT-
GAN Features and Tree-Based Learning . . . . . . . . . . . . . . . . . . . . . . 8
2.2.4 Early diagnosis of Lung Cancer diagnosis Throgh Deep learning . . . . . . . . . 8
2.2.5 End-to-end Fully Automated Lung Cancer detection System . . . . . . . . . . . 9
2.2.6 Advancing techniques for accurate lung cancer system . . . . . . . . . . . . . . 9
2.2.7 A transformer based multi scale deep learning model for lung cancer . . . . . . . 9
2.2.8 A wireless and machine learning based lung cancer detection system . . . . . . . 10
2.2.9 An integrated Data analysis for lung cancer detection system . . . . . . . . . . . 10
2.2.10 Advanced Cardiovascular disease detection system . . . . . . . . . . . . . . . . 11
iii
3 SYSTEM REQUIREMENTS SPECIFICATION 12
3.1 Purpose of Software Requirement Specification......................................................................12
3.2 Specific Requirements..............................................................................................................12
3.3 Product Perspective..................................................................................................................12
3.4 Functional Requirements.........................................................................................................13
3.5 Non-Functional Requirements.................................................................................................13
3.6 Hardware and Software Requirement......................................................................................13
3.6.1 Hardware Resource......................................................................................................13
3.6.2 Software Resources......................................................................................................14
3.7 Software Environment and tool................................................................................................14
3.7.1 Programming language................................................................................................14
3.7.2 Python Programming Language..................................................................................14
3.7.3 Website Frontend Development using HTML,CSS Javascript...................................14
3.7.4 Flask backend in Python..............................................................................................15
3.7.5 Deep Learning model in python..................................................................................15
3.8 Details of specification.............................................................................................................15
3.8.1 User view.....................................................................................................................16
3.8.2 Architectural view........................................................................................................18
3.8.3 Network Components..................................................................................................19
5 SYSTEM IMPLEMENTATION 26
5.1 Implementation module............................................................................................................26
5.1.1 Preprocessing Feature Engineering with Equilibrium Optimizer...............................26
5.1.2 Model Training and Evaluation...................................................................................27
5.1.3 Website Integration......................................................................................................28
6 CODE IMPLEMENTATION 30
6.1 Importing Libraries...................................................................................................................30
6.2 Data Collection.........................................................................................................................30
6.3 Data Preprocessing...................................................................................................................31
6.4 Splitting Data into Train Test and validation Set.....................................................................32
6.5 Model Selection........................................................................................................................33
6.6 Train The Model.......................................................................................................................33
6.7 Evaluating the Model...............................................................................................................35
6.8 Frontend Development.............................................................................................................37
6.9 Deployment..............................................................................................................................38
7 SYSTEM TESTING 39
7.1 Testing Process.........................................................................................................................39
7.2 Testing Objectives....................................................................................................................39
7.3 Test Environment.....................................................................................................................40
7.4 System Testing........................................................................................................................40
7.5 Testing Types Applied.............................................................................................................41
7.6 Testing Scenarios.....................................................................................................................42
7.7 Results and Observations..........................................................................................................43
7.8 Issues Identified and Fixed......................................................................................................43
7.9 Results and Observations..........................................................................................................43
Bibliography 59
List of Figures
Figure 3.1 : User veiw Flow Diagram for Lung Cancer Detection System............................................16
Figure 3.2 : Architechtural veiw Flow Diagram for Lung Cancer Detection System............................18
Figure 3.3 : Architechtural veiw Flow Diagram for Lung Cancer Detection System............................19
Figure 4.1 : Architechtural veiw Flow Diagram for Lung Cancer Detection System............................21
Figure 4.2 :System design for Lung Cancer Detection System..............................................................23
Figure 4.3 :Data Flow design for Lung Cancer Detection System.........................................................23
Figure 4.4 :Detailed design for Lung Cancer Detection System.............................................................24
Figure 4.5 :Sequential design for Lung Cancer Detection System.........................................................25
Figure 5.1 :Preprocessing Feature Engineering with EO........................................................................27
Figure 5.2:Model Training And Evaluation............................................................................................27
Figure 5.3:Preprocessing Feature Engineering with EO.........................................................................29
Figure 6.1 :Importing Libraries for LC...................................................................................................30
Figure 6.2 :Data Collection for LC.........................................................................................................31
Figure 6.3 :Data collection for LC..........................................................................................................31
Figure 6.4:Data splitting for LC..............................................................................................................33
Figure 6.5:Model Seelection for LC........................................................................................................33
Figure 6.6 :Evaluation for LC.................................................................................................................34
Figure 6.7 :Model Evaluation for LC......................................................................................................36
Figure 6.8 : Frontend Development for LC............................................................................................37
Figure 6.9 : Deployment for LC..............................................................................................................38
Figure 8.1 : Login Page for LC...............................................................................................................45
Figure 8.2 : Login Page for LC...............................................................................................................48
Figure 8.3: Patients Details page for LC.................................................................................................49
Figure 8.4 : User Interface for LC...........................................................................................................50
Figure 8.5 : Normal image......................................................................................................................51
Figure 8.6 : Cancer Image.......................................................................................................................53
Figure 8.7 : Confusion Matrix for LC.....................................................................................................54
Figure 8.8 : Performance Analysis for LC..............................................................................................56
Figure 8.9 : Performance Analysis for LC..............................................................................................57
iv
List of Tables
Table 7.1 : Testing results for Lung Cancer detection System.........................................................42
Table 7.2 : Identified issues and Fixes in Lung Cancer detection System........................................44
LIST OF ACRONYMS
v
Lung cancer detection using machine learning (BCS786) 2025-26
CHAPTER 1
1 INTRODUCTION
Lung cancer remains one of the most significant global health challenges of the 21st century, with
con- siderable implications for mortality, morbidity, and healthcare systems. Characterized by the
uncontrolled proliferation of cells in the lungs, this malignancy has long been associated with tobacco
use, although it also arises in non-smokers due to a variety of genetic, environmental, and occupational
factors. Despite advances in diagnostic imaging, molecular profiling, and therapeutics, lung cancer
continues to have a poor prognosis, often due to late-stage diagnosis. This background explores the
foundational aspects of lung cancer to inform policy, clinical, and research [Link]
diagnostic techniques for lung cancer include chest X-rays, computed tomography (CT) scans,
biopsies, and bronchoscopy. While these methods are effective, they are often expensive, invasive, and
time-consuming, and may not be readily available in all healthcare settings, especially in low-resource
environments. These limitations have fueled research into the development of computer-aided
diagnosis (CAD) systems and predictive models that can help identify individuals at high risk of lung
cancer using easily obtainable data such as demo- graphic information, lifestyle factors, and medical
[Link] cancer is one of the most prevalent and deadly forms of cancer globally, largely due to its
late-stage diagnosis and rapid progression. Traditional diagnostic methods, such as chest X-rays, CT
scans, and biopsies, while effective to a degree, often fail to detect the disease at its early stages,
leading to delayed treatment and poor prognosis. In response to these limitations, researchers have
increasingly turned to machine learning (ML) as a promising tool for im- proving lung cancer detection
and prediction. Machine learning, a subset of artificial intelligence, enables the development of
predictive models that can analyze complex datasets—including medical imaging, clinical records, and
genomic information—to identify patterns and make data-driven decisions. These models can assist
healthcare professionals by providing more accurate and earlier diagnoses, supporting risk
stratification, and even forecasting patient outcomes. Common ML algorithms used in lung can- cer
prediction include support vector machines, decision trees, random forests, logistic regression, and
deep learning techniques such as convolutional neural networks, especially when processing
radiological images. By leveraging large datasets and sophisticated pattern recognition, ML-based
systems have demonstrated improved diagnostic accuracy and efficiency compared to traditional
methods. However, challenges such as data quality, model interpretability, and clinical integration
remain significant barriers to widespread adoption. Nonetheless, ongoing advancements in computing
power, data availability, and algorithm design continue to push the boundaries of what is possible,
making machine learning a vital area of research in the fight against lung [Link],
integrating machine learning with electronic health records and real-time monitoring tools opens new
avenues for continuous patient risk assessment. The use of explainable AI is also gaining traction,
aiming to make ML models more transparent and trust- worthy for clinical decision-making. As more
annotated medical datasets become publicly available, the training and validation of robust models are
becoming increasingly feasible. Overall, machine learning is not only enhancing early detection but
also paving the way for personalized medicine in lung cancer [Link] innovations are helping
1.2 Motivation
• Early Detection Saves Lives:Lung cancer is one of the leading causes of death worldwide, and
most cases are diagnosed at later [Link] and accurate detection can significantly improve
the chances of successful treatment and survival.
1.3 Challenges
Developing a Lung Cancer detection system using machine learning involves several technical and
practi- cal challenges One major challenge is the quality and availability of medical datasets, as real
clinical data is limited, imbalanced, and often contains noise or missing values. This requires careful
preprocessing and feature engineering to ensure reliable training. Another challenge is the high
variability in patient CT scan image patterns and biomedical features, which makes it difficult for the
model to generalize well across diverse populations. Selecting the most relevant features from
multiple acoustic measures is also complex, as unnecessary features may reduce the model’s accuracy.
Additionally, choosing the right model and tuning its hyperparameters requires extensive
experimentation to achieve optimal per- [Link] the trained model into a user-friendly
web application introduces challenges such as ensuring fast prediction time, handling batch uploads,
and maintaining data privacy.
1.7 Objectives
Here are well-defined objectives for a Lung Cancer Prediction System, suitable for inclusion in
technical proposal, or project documentation. These objectives focus on medical, technical, and social
aspects of the lung cancer prediction system.
• To design a system architecture that integrates software components.
• To implement and evaluate the performance of the proposed system in terms of energy savings
and user satisfaction.
• To compare the proposed system with existing energy management solutions and highlight its
advantages.
– Early Detection and Diagnosis: Accurately identify individuals at high risk of developing
lung cancer at an early stage. Early-stage lung cancer is often asymptomatic but has a
significantly higher survival rate.
– Risk Stratification: Stratify patients based on risk factors such as age, smoking history,
genetic predispositions, environmental exposures. Tailored screening and surveillance
plans can be implemented more effectively by focusing on high-risk groups.
– Integration of Multimodal Data: Integrate diverse data types (e.g., electronic health
records, imaging, genetic data, lab tests) into a unified predictive model. Multimodal
approaches improve predictive performance .
– Improve Diagnostic Accuracy: Enhance the diagnostic precision of lung cancer compared
to traditional clinical methods. Reduce false positives and false negatives to avoid
unnecessary procedures or missed diagnoses.
– Clinical Decision Support:Provide clinicians with data-driven recommendations or risk
scores to aid in [Link] evidence-based clinical pathways, improve
consis- tency in care, and reduce physician workload.
CHAPTER 2
2 LITERATURE REVIEW
A literature survey or a literature review in a project report shows the various analyses and research
made in the field of interest and the results already published, taking into account the various
parameters of the project and the extent of the project. Literature survey is mainly carried out in order
to analyse the background of the current project which helps to find out flaws in the existing system
guides on which unsolved problems we can work out. So, the following topics not only illustrate the
background of the project but also uncover the problems and flaws which motivated to propose
solutions and work on this project.
A literature survey is a text of a scholarly paper, which includes the current knowledge including
substantive findings, as well as theoretical and methodological contributions to a particular topic.
Liter- ature reviews use secondary sources, and do not report new or original experimental work. Most
often associated with academic oriented literature, such as a thesis, dissertation or a peer-reviewed
journal article, a literature review usually precedes the methodology and results sectional though this is
not always the case. Literature reviews are also common in are search proposal or prospectus (the
document that is approved before a student formally begins a dissertation or thesis). Its main goals are
to situate the current study within the body of literature and to provide context for the particular reader.
Literature reviews are a basis for researching nearly every academic field. A literature survey includes
the following: enumerate
Literature survey describes about the existing work on the given project. It deals with the problem
associated with the existing system and also gives user a clear knowledge on how to deal with the
existing problems and how to provide solution to the existing problems.
• It improves the quality of the literature survey to exclude side tracks Remember to
explicate what is excluded.
This research introduces an Attention Enhanced InceptionNeXt-Based Hybrid Deep Learning Model for
the critical task of early lung cancer detection using Computed Tomography (CT) images. The
model’s core innovation is the fusion of Convolutional Neural Networks (CNN’s) and Vision
Transformers (ViTs) to leverage the strengths of both architectures. It integrates novel InceptionNeXt
blocks with optimized grid and block attention mechanisms. This hybrid approach effectively captures
both fine-grained local details and large-scale global contextual features in complex lung nodule
patterns. The comprehensive system is capable of not only differentiating between malignant and
benign nodules but also classifying specific subtypes, including adenocarcinoma, large cell carcinoma,
and squamous cell [Link] model was rigorously validated using two public datasets, Chest CT
and IQ-OTH/NCCD, demonstrating statistically significant superiority over five leading CNN-based
and five ViT-based [Link] achieved impressive, state-of-the-art classification accuracies of 99.54
percent on the IQ-OTH/NCCD dataset and
98.41 percent on the Chest CT dataset. Crucially, the architecture is lightweight, containing only 18.1
million parameters. This makes the model an efficient, scalable, and powerful solution for clinical
environments. By providing highly accurate and fast diagnostics, this model holds significant potential
to improve clinical workflows and ultimately increase patient survival [Link] study focuses on
developing a machine learning-based system to predict lung cancer using medical imaging data,
primarily CT scans, along with relevant clinical information such as patient demographics and medical
history. It aims to design and evaluate algorithms capable of early detection of lung cancer nodules
and classification of their malignancy [1].
2.2.2 Advancing Oncology Diagnosis:AI enabled early detection of Lung cancer through image
analysis
Against the backdrop of the pervasive global challenge of cancer, with particular emphasis on lung can-
cer (LC), this study centers its investigation on the critical realm of early detection leveraging artificial
intelligence (AI) within the domain of histological image analysis. Through the fusion of
DenseNet201 with color histogram techniques, a novel hybrid feature set emerges, engineered to
elevate classification accuracy. The comprehensive evaluation encompasses eight diverse machine
learning (ML) algorithms, spanning from K-Nearest Neighbors (KNN) to Support Vector Machines
(SVM), including notable con- tenders such as LightGBM (LGBM), CatBoost, XGBoost, decision
trees (DT), random forests (RF), and multinomial naive Bayes (MultinomialNB). This rigorous
examination illuminates a distinguished model, achieving a remarkable accuracy rate of
99.683methodology to breast cancer detection, utilizing the BreakHis dataset, yields a commendable
accuracy rate of 94.808histopathological analysis, position- ing it as a pivotal force in advancing
underscores the merits but also elucidates the limitations of existing AI applications in medical
imaging, thereby charting a roadmap for future refinements and clinical deployments. Consequently,
continued research in AI within clinical settings is advocated, with the ultimate aim of fortifying early
cancer diagnosis and subsequently enhancing patient outcomes through judicious therapeutic
interventions [2].
2.2.3 Early Detection of Lung Cancer Using Predictive Modeling Incorporating CTGAN
Features and Tree-Based Learning
The paper titled “Early Detection of Lung Cancer Using Predictive Modeling Incorporating CTGAN
Features and Tree-Based Learning” proposes an advanced hybrid framework for accurate and early
lung cancer prediction. The study addresses the major issue of class imbalance in medical datasets,
where cancer cases are fewer than normal samples. It uses Conditional Tabular Generative Adversarial
Networks (CTGAN) to generate realistic synthetic data for the minority class, creating a more balanced
dataset. This enriched data is then used to train a Random Forest classifier, which ensures robust and
interpretable predictions. The hybrid CTGAN-RF model achieved an impressive accuracy of
98.93percent, with high precision and recall. It effectively reduces false positives and negatives,
improving diagnostic reliability. The model also highlights important features influencing lung cancer
risk, making it valuable for clinical use. Its scalability and interpretability make it suitable for other
medical applications as well. Overall, the framework enhances predictive performance and supports
early detection, potentially saving more lives [3].
Lung cancer continues to be a leading cause of cancer-related mortality globally, primarily due to
late-stage diagnosis. Non-invasive diagnostic techniques, especially those based on exhaled breath
analysis, have recently garnered significant interest. This study explores a novel approach to lung
cancer detection by analyzing volatile organic compounds (VOCs) such as formaldehyde, ethanol,
acetone, and chloroform present in exhaled breath. Signal processing techniques, including Wavelet
Transform (WT) and Wavelet Packet Transform (WPT), were employed to generate and analyze
signals derived from VOC data. Features extracted from these transformed signals were subsequently
classified using various machine learning and deep learning models, namely Support Vector Machine
(SVM), k-Nearest Neighbours (KNN), Random Forest (RF), Multi-Layer Perceptron (MLP), and
Convolutional Neural Network (CNN). A comprehensive comparative evaluation was conducted to
assess the impact of WT and WPT on model performance. Results indicate that WPT significantly
enhances feature representation, improving classification accuracy across models. Among all evaluated
models, the CNN outperformed others, achieving a maximum accuracy of 98.21capability of deep
learning models in handling complex VOC patterns and highlights their potential in clinical
applications. The findings of this research affirm that integrating advanced signal processing
techniques with deep learning can substantially improve the accuracy and reliability of non-invasive
lung cancer diagnostics. The proposed method offers a promising, efficient, and patient-friendly
alternative to conventional diagnostic procedures [4].
The computer aided diagnosis of lung cancer is majorly focused on detection and segmentation with
very less work reported on volume estimation and grading of cancerous nodule. Further, lung cancer
segmentation systems are semi automatic in nature requiring radiologists to demarcate cancerous
portions on every slice. This leads to subjectivity and delayed diagnosis. Further, these techniques
are based on standard convolution leading to inaccurate segmentation in terms of actual boundary
retention of the cancerous nodule. Also, there is a need of automatic system that not only grades the
lung cancer based on actual parameters but also enables early warning for flagging of anomalies in
periodic screening. This research work reports the design of a fully automated end-to-end screening
system that consists of 5 major models with an improved performance on cancer detection,
segmentation, volume estimation, grading, and an early warning system. The traditional convolutional
technique is modified to allow for retention of actual shape of cancerous nodule. The simultaneous
segmentation of cancer, lymph nodes and trachea is also achieved through a focus module and a
modified loss function to remove redundancy and achieve an accuracy of 92.09estimation model is
developed using GPR interpolation to give an improved accuracy of 94.18model based on the TNM
classification standard is developed to grade the detected cancerous nodule to one of the six grades
with an accuracy of 96.4system for changes in the CT scans of lung cancer patients under treatment.
The research is undertaken in collaboration with Nanavati Hospital, Mumbai, and all the models are
validated on a real dataset obtained from the hospital [5]
Early detection of lung cancer is crucial for improving patient survival and reducing mortality.
However, medical datasets often face challenges like irrelevant features and class imbalance,
complicating accurate predictions. This study presents a comprehensive AI-powered lung cancer
classification approach that enhances predictive accuracy and treatment planning. Our methodology
combines Recursive Feature Elimination with Support Vector Machines (RFE-SVM) for effective
feature selection and employs the XGBoost ensemble learning algorithm for classification, optimized
using the Nelder-Mead algorithm. Evaluating the model’s generalizability on two distinct lung cancer
datasets, results show that our approach outperforms traditional machine learning models, achieving
100importance of advanced computational techniques in healthcare, paving the way for more
personalized and effective patient care [6].
2.2.7 A transformer based multi scale deep learning model for lung cancer
Lung cancer surgery presents significant challenges due to its complexity and the need for precise
risk stratification to improve patient outcomes. This study presents a Transformer-based multi-scale
deep learning framework that integrates imaging, clinical, and genomic data to optimize decision-
making surrounding surgery. By using the self-attention mechanism in Transformers and multi-scale
feature extraction, the model expertly explores different data modalities. Therefore, it enables a precise
prediction of surgical risks, such as delayed extubation and mortality; besides, it further performs risk
stratification, having the model improve resource utilization by identifying high- and low-risk patients,
Thorough evaluations, including ablation experiments, case analyses, and error analyses, prove the
model’s robustness and practical applicability in a clinical setting. This study demonstrates the game-
changing potential of advanced deep learning techniques in the field of precision medicine and provides
a concrete framework for personalized treatment in lung cancer surgery, laying the foundation for
broader healthcare applications [7].
2.2.8 A wireless and machine learning based lung cancer detection system
Lung cancer remains one of the leading causes of cancer-related deaths globally, with approximately
2.5 million new cases and 1.8 million deaths reported annually according to World Health
Organization in 2022. Early and accurate detection is crucial for improving survival rates through
timely treatment. However, current detection methods face challenges such as invasiveness, high costs,
and delayed diag- nosis. Electrochemical biosensors, which use potentiostats to detect biological
analytes by controlling cell voltage and measuring current, voltage, or impedance, offer a rapid and
sensitive alternative. Nev- ertheless, many existing potentiostats are limited by narrow voltage ranges,
single current measurement capabilities, and inadequate support for advanced electrochemical
techniques. This study presents a novel wireless electrochemical biosensor potentiostat system
enhanced with machine learning and Internet of Things (IoT) integration for the detection of lung
cancer biomarkers, specifically the CD63 protein. The system is designed to be portable, energy
efficient, cost-effective, and high sensitive, supporting advanced electrochemical techniques such as
cyclic voltammetry (CV) and square wave voltammetry (SWV). It achieves a limit of detection (LoD)
of 2 × 101 particles/mL and a sensitivity of 5.188 µA per log concentration unit, comparable to the
commercial systems like uStat8000 potentiostat. Furthermore, the integrated random forest classifier
enables fast and automated data interpretation, achieving accuracy rates of 83.5portable, and scalable
solution for point-of-care diagnostics, contributing to early detection and improved prognosis in lung
cancer management [8].
Lung cancer is the leading cause of cancer death worldwide, regardless of gender. Among the types of
lung cancer, Lung Squamous Cell Carcinoma (LUSC) is the second most common type, characterized
by a diagnosis in advanced stages, a poor prognosis, and a high association with smoking. Due to the
severity of lung cancer, it is essential to understand its molecular mechanisms. In this context, this
study uses transcriptomic and clinical data to implement bioinformatics pipelines, and machine
learning, through random forest models to predict patients’ overall survival and obtain a gene signature
of LUSC for tumor progression. We analyzed clinical and molecular data from the project LUSC-
TCGA, and we performed differential expression analyses (DEA) comparing normal tissues against
tumor tissues. Based on DEA-selected genes, the patients were divided into three clusters, followed by
a feature selection and classification. Finally, it was possible to obtain classifications results close to
70clusters. Finally, we also performed a functional enrichment analysis. The clustering analysis
revealed in cluster 2, enriched genes such as CDT1, CENPI, and NLGN1, associated with the
molecular EMT (epithelialto-mesenchymal transition) process [9]
Smoking has a serious complicated impact on Cardiovascular Health (CVH), which makes it an easily
controlled risk factor for Cardiovascular Disease (CVD). The importance of early diagnosis and
treatment is crucial because of CVD, which remains to be the leading cause of morbidity and death
across the globe, therefore, smoking behaviour prediction is essential. This research explores the
complex relationship between smoking and CVD, and clarifies how smoking negatively impacts CVH.
The first step of the analysis is removing the Not-a-Number (NaN) values in the smoking behaviour
bio signals data because all NaN values are in the target column ‘smoking’, which could lead to
generate biased predictions. Further, robust scaling is applied to standardize the data, where all features
are on the same scale. The Random Forest feature selection technique is applied to select the most
relevant features for smoking status prediction. The Borderline-Synthetic Minority Oversampling
Technique is used to balance the minority class with the majority class, to reduce the risk of overfitting
in results. Finally, the cleaned and preprocessed data is passed to the Proposed Blending Model (PBM).
In PBM, the Echo State Network and GoogleNet are placed on the base layer, and AlexNet is placed on
the meta layer to make a robust smoking status prediction model. In terms of accuracy, precision,
recall, and f1-score, the PBM outperforms the baseline techniques with an improvement score of 5are
validated through a 10-fold cross-validation method, which can increase its reliability and durability.
Finally, the SHapley Additive exPlanations technique is used to understand the predictions made by
the PBM. It can reveal the explainability and interpretability of the PBM. Conclusively, during the
thorough simulation process, the results are collected and the ablation study is performed. The
simulation results show that the early prediction of hidden smokers can help to reduce the effect of the
CVDs. It also makes proactive healthcare strategies possible for better future outcomes and public
health [10].
CHAPTER 3
– Personal Computer/laptop
∗ Processor:intel i5/i7 or AMD Ryzen 5/7
∗ RAM:Minimum 8GB (16 GB recommended for deep learning)
∗ Storage:At least 256 GB SSD for fast data access
– Cloud Resources(e.g.,Google Colab,AWS,Azure):
∗ GPU support (NVINDIA Tesla K80/T4/V100) for training deep learning models.
∗ On demand Scalable Computer instances
The language used for implementation of project must be platform independent,simple and power-
ful,object oriented,robust,interactive ,easy to learn, dynamic and extensible.
The Lung Cancer Prediction System is developed using the Python programming language due to its
simplicity, flexibility, and powerful machine learning libraries such as TensorFlow, Keras, and Scikit-
learn. In this project, Python is used for data preprocessing, model training, and prediction tasks using
algorithms like CNN and Random Forest. The backend handles the core logic, database connections,
and ML model integration, ensuring smooth data flow and accurate predictions. The frontend is
designed with HTML, CSS, and Flask framework to create a user-friendly interface for inputting patient
details and displaying results. The system allows users to upload medical data or images, which are
processed by the backend for analysis. The connection between frontend and backend ensures real-
time interaction and efficient performance. This architecture provides both functionality and
simplicity, making it suitable for clinical or educational use. Overall, the integration of Python in both
backend computation and web development makes the project efficient, accurate, and easy to maintain.
The frontend of the Lung Cancer Prediction website is designed to be intuitive and responsive,
ensuring that users can easily navigate across different sections such as symptom entry, image upload,
and result
viewing. HTML defines the structure of the web pages, while CSS provides an attractive layout with
well-organized forms and visually appealing buttons.
JavaScript enhances interactivity by performing real-time checks on user inputs, image size, and
format before sending them to the backend. The system also provides alerts or messages to guide users
during data entry. Once the user submits the information, the frontend communicates securely with the
backend to process the data through machine learning models. After prediction, the result—whether
normal, low risk, or high risk—is displayed with clear visualization.
Overall, the frontend ensures a seamless user experience, combining simplicity, clarity, and
efficiency for accurate lung cancer prediction.
The backend of the Lung Cancer Prediction System is developed using Flask, a lightweight and
powerful web framework in Python. Flask handles all server-side operations, such as receiving user
inputs, processing uploaded lung images, and integrating with machine learning models for prediction.
When the user submits symptoms and image data from the frontend, Flask routes this information to
the prediction module, where trained models like CNN and Random Forest analyze it. The CNN
model processes the image to detect lung abnormalities, while the Random Forest model evaluates
symptom- based data to enhance accuracy. Flask then combines the results and sends the final
prediction back to the frontend for display. The backend ensures smooth communication between the
user interface and the ML algorithms, maintaining data security, scalability, and efficiency. It also
allows easy model updates and real-time prediction, making the system reliable for practical medical
applications.
The Deep Learning model in the Lung Cancer Prediction System is implemented using Python with
frameworks like TensorFlow and Keras. The model primarily uses a Convolutional Neural Network
(CNN), which is highly effective in analyzing medical images such as chest X-rays or CT scans. The
CNN extracts important features like textures, shapes, and patterns from the lung images to detect
possible cancerous regions. The dataset is preprocessed by resizing images, normalizing pixel values,
and augmenting data to improve model performance. The network consists of multiple convolutional,
pooling, and dense layers that help in accurate feature extraction and classification. The model is
trained on a large dataset to differentiate between normal and cancer-affected lungs. Once trained, it is
integrated into the Flask backend for real-time prediction. This deep learning model enhances
accuracy, reliability, and early detection, making the system a powerful tool for lung cancer diagnosis.
The frontend of the system is built using HTML, CSS, and JavaScript, offering a simple and
interactive interface where users can input symptoms and upload lung X-ray or CT scan images. The
backend uses the Flask framework in Python, which acts as a bridge between the user interface and the
ML models, managing requests, processing inputs, and displaying the prediction results.
The system accepts both image and text data as inputs. The CNN model processes image data to
identify abnormal lung patterns, while the Random Forest algorithm analyzes symptom-based data to
improve prediction accuracy. The outputs are categorized into different risk levels—normal, low risk,
or high risk—helping in early diagnosis. The database stores user data, images, and prediction results
securely. The system is designed to be scalable, lightweight, and efficient, allowing deployment on
both local and cloud servers.
The software requires Python 3.8 or above, Flask, TensorFlow/Keras, and scikit-learn libraries.
The hardware requirements include at least 8GB RAM, a modern processor (Intel i5 or above), and a
stable internet connection for online use. The system ensures high accuracy, reliability, and fast
processing, minimizing manual diagnostic errors. With a user-friendly interface and AI-driven
backend, this project demonstrates how technology can assist in automated medical diagnosis,
reducing human workload and supporting timely clinical decision-making.
The user view of the Lung Cancer Prediction System provides a simple, interactive, and intuitive
interface designed for easy use by both patients and healthcare professionals. When the user opens the
system, they are greeted with a clean homepage that explains the purpose of the project and guides
them through the prediction process. The user can enter symptom details such as cough, chest pain,
shortness of breath, or fatigue into provided input fields. Additionally, the system allows users to
upload lung images such as chest X-rays or CT scans directly from their device. Once the necessary
data is entered, the user simply clicks the “Predict” button to submit their information.
Behind the scenes, the data is processed by machine learning and deep learning models integrated
through Flask in Python. The results are then displayed clearly on the screen, indicating whether the
user is at normal, low, or high risk of lung cancer. The interface is responsive, ensuring compatibility
across different devices like laptops and mobile phones. The user also receives guidance messages for
incomplete inputs or incorrect image formats. Overall, the user view emphasizes ease of access, clear
communication, and reliability, making the system efficient for real-time lung cancer prediction and
helping users gain valuable health insights in a few simple steps.
• User Interaction: The process begins when the user visits the website dashboard, where
they can upload a lung image (such as an X-ray or CT scan) or enter symptoms manually
for analysis.
• Upload Image / Symptoms: The system accepts inputs from users in the form of medical
images or textual symptom data. These inputs are the foundation for predicting whether the
lung condition is normal or cancerous.
• Real-Time Processing: Once the input is received, the system starts processing the data
immediately to provide instant results without manual intervention.
• Image Pre-processing: The uploaded images go through preprocessing steps like resizing,
normalization, and denoising. These operations remove unwanted noise and standardize
the image quality, ensuring accurate model predictions.
• Feature Extraction AI Model: After preprocessing, important features are extracted from
the image using advanced AI and machine learning techniques. These features are then
analyzed by the trained deep learning model to identify disease patterns.
• Prediction Output (Probability Score): The AI model produces a probability score, such as
“98.5 percent Malignant,” which represents the confidence level of the model in detecting
cancerous regions in the lung.
• Classification Rule: Based on the probability score, a threshold (usually 50percent) is
applied. If the score exceeds the threshold, the system classifies the case as “Malignant”;
otherwise, it is labeled as “Benign.”
• Calculate Performance Metrics: The system also computes important performance metrics
like Accuracy and F1 Score, which indicate how well the AI model performs in
classification tasks.
• Result Display (on Dashboard): Finally, the dashboard displays the classification result
(e.g., “Malignant” with 98.5percent confidence) along with performance indicators like F1
Score and Accuracy, giving users clear insight into the system’s prediction quality.
• End: The process ends with a summarized output shown to the user, completing the
automated lung cancer prediction cycle.
The Lung Cancer Prediction Architecture is designed to integrate the user interface, backend API, and
model storage to enable smooth disease prediction. The frontend acts as the user interface where
patients or users upload lung images through a web page built using HTML and Flask framework. Once
the image is uploaded, it is sent as an HTTP POST request to the Flask backend (API layer) for
processing. In the backend, the image first passes through the feature extraction module (/api/feature-
extraction), where preprocessing steps like resizing and normalization are performed to prepare the
data for analysis.
The processed image is then sent to the deep learning prediction module (/api/predict), which uses
a Convolutional Neural Network (CNN) model to infer whether the lung image indicates a malignant
or benign condition. After obtaining the prediction, the result is forwarded to the result generator
(/api/result-generator) that converts the model output into a JSON-formatted response for easy commu-
nication with the frontend. The frontend then displays this prediction result to the user in real time.
Additionally, the system maintains data/model storage, where logs, metadata, and the trained CNN
model are stored for future updates and retraining. This architecture ensures scalability, modularity, and
efficient communication between user and AI components, enabling fast and reliable lung cancer
prediction.
The network components of the Lung Cancer Prediction System play a crucial role in connecting the
different layers of the application to ensure smooth data flow and model interaction. The system
typically consists of three main components — Frontend, Backend Server, and Database/Model
Storage. The Frontend acts as the user interface where patients or users upload lung images or input
symptoms through a web dashboard. This interface communicates with the backend via HTTP
requests or RESTful APIs. The Backend Server, usually implemented using Flask or Django in
Python, handles the core processing tasks such as image pre-processing, feature extraction, and model
prediction.
It interacts with the Machine Learning or Deep Learning model, often built using libraries like
TensorFlow or Keras, to classify lung images as malignant or benign. The Database or Storage Layer
stores important data such as user inputs, processed results, logs, and trained model files. Additionally,
network communication protocols like HTTP/HTTPS ensure secure and reliable data transfer between
client and server. In some systems, cloud services like AWS or Google Cloud are used to deploy the
model and manage scalability. Together, these components form a robust, interconnected network that
enables accurate and real-time lung cancer prediction using machine learning.
CHAPTER 4
• ECONOMICAL FEASIBILITY
• TECHNICAL FEASIBILITY
• SOCIAL FEASIBILITY
Economic Feasibility evaluates whether the project is cost-effective and worth the investment. For the
Lung Cancer Prediction System, it requires minimal cost compared to traditional diagnosis methods
using scans or lab tests. The system uses open-source machine learning tools, reducing software
expenses. Maintenance and operational costs are low since predictions are automated. Overall, the
system provides a budget-friendly and efficient solution for early cancer detection, offering high value
for its development cost.
Technical Feasibility examines whether the required technology and resources are available to develop
the system effectively. The Lung Cancer Prediction System is technically feasible as it uses existing
technologies like Python, Flask, and machine learning algorithms such as CNN or Decision Tree. The
hardware and software requirements are minimal and easily available. The system can efficiently
process and analyze medical data to provide accurate predictions. Hence, it is technically possible to
design, implement, and maintain this system with current tools and expertise.
Social Feasibility evaluates how well the system will be accepted and used by society. The Lung
Cancer Prediction System is socially feasible because it helps in early detection of cancer, which can
save lives and reduce suffering. It increases health awareness among people and encourages
preventive medical checkups. The system is user-friendly and can be used by both medical
professionals and the public. Overall, it gains social acceptance due to its positive impact on public
health and community well-being.
performance analysis Performance Analysis of the Lung Cancer Prediction System using Machine
Learning focuses on evaluating the system’s accuracy, speed, and reliability. The model’s
performance is measured using metrics like accuracy, precision, recall, F1-score, and confusion
matrix. It efficiently processes medical data and provides quick predictions with high accuracy. The
system performs well under different input conditions and maintains stability during real-time
execution. Overall, it delivers consistent, accurate, and efficient results for lung cancer detection.
Technical Analysis
is passed into the Random Forest Classifier, the core machine learning model responsible for analyzing
patterns and generating predictions. This classifier processes the input data and calculates prediction
scores or classification results. The results are then sent to the Model Output and Scores (UI) section,
where the user can view the outcomes clearly. Additionally, a visualization module presents the
model’s performance and predictions graphically for better understanding. The circular connection
between the classifier and backend indicates iterative learning or feedback. This architecture ensures
smooth data flow, secure processing, and real-time, accurate prediction results through a user-friendly
web interface.
supports system learning and model refinement. Overall, this design ensures efficient data flow, high
prediction accuracy, and a user-friendly interface for early lung cancer detection.
workflow ensures a smooth transition from data input to accurate prediction and visualization for lung
cancer detection.
that uses CNN and Random Forest models to analyze and predict disease risk. The ML service returns
the prediction results, including confidence scores and visual summaries. These results are then stored
securely in the database along with the patient and model details. The system acknowledges successful
data storage to ensure reliability. The summarized prediction report is displayed to the user through
the frontend interface. Additionally, an optional clinician review and feedback process is included for
professional validation. Clinicians can review the predicted outcomes, provide feedback or confirm the
prediction accuracy. Finally, the updated feedback is stored in the system to enhance prediction
credibility and maintain medical accuracy.
CHAPTER 5
5 SYSTEM IMPLEMENTATION
The implementation phase of any project developers the phase alities the final solution, which solve
the problem at land. The implementation phase moves the actual materialization of the ideas which are
expressed in the analysis decstment and developed in the design phase. Implementation should be
perfect mappi of the design document in a suitable programming langitage in inder to achieve the
necessary final product. Often the product is ruined due to incorrect programming language chosen for
implementation or unsuitable method of programeting. It is better for the coding phase to be directly
linked to the design phase in the sense if the design it in terms of object oriented terms then
implementation should be preferably carried out in a object oriented way.
The implementation stage in a system project in its own right. It involves
• Careful planning
• Investigation of the current system and the constraints on implementation
• Training of staff in the newly developed system
Implementation of any software is always preceded by important decisions regarding selection of the
platform, the language used, etc, these decisions are often influenced by several factors such as real
environment in which the system works, the speed that is required, the security concerns, and other
implementation specific details. There are three major implementation decisions that have been made
before the implementation of this project. They are as follows:
The diagram represents the process of preparing and optimizing data for a medical prediction system.
It starts with two types of input data—image data (CT/X-ray scans) and clinical data (symptoms,
patient details). Image preprocessing extracts radiomic features like shape, texture, and margins, while
clinical feature engineering cleans and encodes tabular data. Both sets of features are then unified and
optimized using dimensionality reduction methods. The final result is an optimized feature set ready
for use in machine learning models. Key Processes:
• Image Preprocessing Feature Extraction – Isolates nodules and extracts radiomic features from
CT/X-ray scans.
• Clinical Feature Engineering – Handles missing data, encodes categorical variables, and
normalizes numerical values.
• Feature Unification Selection – Combines image and clinical features and reduces
dimensionality using techniques like PCA or RFE.
• Final Feature Optimization – Produces a refined, high-quality feature set for accurate model
training and prediction.
This diagram represents the machine learning stage of a medical prediction system. The optimized feature
set is used as input for two models—CNN for image data and Random Forest for clinical data. The
CNN learns spatial patterns from scans, while the Random Forest identifies key clinical factors. Both
models work together to generate predictions, classifying results as malignant or benign with
confidence levels. The final step involves evaluating model performance using various accuracy and
validation metrics.
Key Concepts :
• Machine Learning Models – CNN handles image data, and Random Forest processes
clinical data to learn features and patterns.
• Prediction Classification – Produces risk scores and determines whether a case is
malignant or benign.
• Model Fusion – Combines outputs from both models for a more accurate and reliable diag-
nosis.
• Evaluation Metrics – Uses accuracy, sensitivity, specificity, F1-score, and ROC curve
analysis to validate model performance.
This diagram illustrates a clinical decision support system designed to predict patient risk based on
medical images and clinical data. The process begins when User Input Data (CT scans and clinical
features) is uploaded via a web portal to a Frontend Web Server which validates the data. This data is
then sent to a Backend Prediction Server, which routes the image data to a CNN Model for image-
based risk prediction, and the tabular data to a Random Forest model for feature-based risk prediction.
The backend server then fuses the predictions from both models (using a weighted average) to generate
the final result, which is stored in a database. Finally, the outcome is presented to the user on a
Frontend Display Dashboard, showing the Malignant/Benign Result, a Confidence Score, the Risk
Level, and key visualizations like CNN and RF heatmaps for model interpretability.
CHAPTER 6
6 CODE IMPLEMENTATION
centers, or online medical databases. Once collected, the data is stored in a structured format so that it
can be easily processed in later stages.
1. Image Resizing:
Convert all images to a fixed size (e.g., 224×224 or 512×512) so that the model receives
uniform input.
3. Noise Removal:
Use filters to reduce noise
Gaussian filter
Median filter
Bilateral filter
This improves image clarity and segmentation quality.
4. Lung Segmentation:
Extract only the lung region using:
Thresholding
Morphological operations (erosion,
dilation) U-Net segmentation models
Segmentation removes unnecessary surrounding tissues.
5. data Augmentation:
Enhances dataset size and variety:
Rotation seperation
1. Training Set
The training set is the largest portion of the dataset.
It is used to train the machine learning model, meaning the model learns patterns, relationships,
and features from this data.
Proper training helps the model generalize to new, unseen data.
2. Validation Set
The validation set is a smaller portion of the dataset.
It is used during training to tune model parameters (like hyperparameters) and to prevent overfitting.
The model does not learn from this set directly, but its performance here helps decide the best
configuration for the model.
3. Test Set
The test set is completely unseen by the model during training.
It is used to evaluate the final performance of the trained
model.
This ensures that the model is not just memorizing the training data but can generalize well to
new real-world data.
scan images, such as tumor size, shape, or image pixel patterns. The training process adjusts the
model’s internal parameters so that it can correctly classify new, unseen samples as benign or
malignant.
Recall (Sensitivity): Ability to detect all actual positive cases Confusion Matrix: Visual
representation of predicted vs actual classes It is a critical step in determining the accuracy, reliability,
and generalization ability of the model before it is deployed in real-world applications. Lung cancer
remains one of the leading causes of cancer-related deaths worldwide, primarily due to late-stage
diagnosis and the aggressive nature of the disease. Early detection significantly improves the chances
of successful treatment and long-term survival. However, traditional diagnostic methods, such as
manual examination of CT scans or X-rays, can be time-consuming, prone to human error, and require
highly skilled radiologists. Machine learning (ML) offers a transformative approach to this challenge
by enabling automated, accurate, and efficient analysis of medical imaging data. By leveraging
algorithms—particularly deep learning models like Convolutional Neural Networks (CNNs)—the
system can learn to identify subtle patterns and anomalies in lung tissue that may indicate the presence
of cancer, even at its earliest stages.
Frontend development typically uses HTML for structure, CSS for styling, and JavaScript for
interactivity. It ensures that the system is user-friendly, responsive, and accessible, making complex
machine learning functionality easy to use for doctors or patients.
6.9 Deployment
Deployment is the final phase of a machine learning project, where a trained model is made accessible
and usable in a real-world environment. In a lung cancer detection system, deployment allows
healthcare professionals or patients to interact with the system, input patient data or medical images,
and receive predictions in a user-friendly interface.
The deployment process ensures that the model is reliable, scalable, and efficient, integrating the
backend (trained model) with the frontend (user interface).eployment is the stage in a machine learning
project where the trained model is made operational and integrated into a system that end-users can
access. For a lung cancer detection system, deployment allows doctors, radiologists, or healthcare staff
to input patient data or CT scan images and receive automated predictions for early diagnosis.
CHAPTER 7
7 SYSTEM TESTING
System testing is a critical phase in the development of the Lung Cancer Detection System, ensuring
that the entire machine learning–based application functions correctly, reliably, and efficiently as a
unified whole. After individual modules—such as data preprocessing, feature extraction, model
training, and prediction—are developed and tested independently, system testing evaluates the
integrated system to verify that all components work together seamlessly.
• Unit Testing:Each Module, such as data preprocessing,model prediction, and flask routing, to
produce the correct output.
• integration testing:Verified that the interaction between modules worked extensively without
any data mistakes.
• System testing:The complete, integrated system was tested as a whole to ensure it fulfilled all
user and system requirements.
• User Acceptance Testing (UAT):End-users tested the system interface for usability,chlarity,
and output accuracy.
• To ensure that the Lung cancer detection System operates correctly and produces accurate results.
• To validate that all functional requirements (data upload, preprocessing, model prediction, and
result visualization) are implemented correctly.
• To verify that the machine learning model generates consistent predictions across different input
datasets.
• To ensure that the user interface (http web app) is responsive, error-free, and provides
appropriate feedback to users.
• To confirm that the system meets non-functional requirements, such as performance, security,
and scalability.
Testing also ensures that the system can handle unexpected inputs gracefully without crashing or
producing erroneous outputs. For example, when invalid or incomplete data is uploaded, the system
should provide an informative error message instead of failing silently.
Software Configuration:
The test environment was isolated from the development environment to ensure that no
development dependencies affected testing outcomes. The system was deployed locally on
localhost:5000 for Flask-based testing and accessed via browser.
Each function was tested against defined input-output specifications, and the outputs were
compared with expected results. The testing outcomes were recorded in a test report for further
evaluation.
• Unit Testing: Conducted on individual modules like data preprocessing and prediction.
Example: Verifying that normalization produces values between 0 and 1.
• Integration Testing: Tested the connection between Flask frontend and the machine learning
model. Example: Ensuring that input from the web form correctly reaches the backend and
returns a valid prediction.
• Performance Testing: Assessed the model’s prediction time and Flask’s response latency under
heavy load.
• Usability Testing: Conducted with sample users to ensure ease of navigation, readability, and
user-friendliness.
• Validation Testing: Compared actual model predictions with known dataset labels to confirm
predictive accuracy.
Together, these testing types validated that the system performs as expected across multiple layers of
functionality and user interaction.
• Scenario 1: Valid Dataset Upload Input: Correctly formatted CSV file. Expected Output:
“Data uploaded successfully” and table preview displayed. Actual Output: Successful.
• Scenario 2: Invalid File Type Upload Input: Uploading a PDF instead of CSV. Expected
Output: Error message — “Invalid file format. Please upload a CSV file.” Actual Output:
Successful validation.
• Scenario 3: Prediction with Valid Inputs Input: Valid CT scan image Expected Output:
”Cancer” or ”normal”. Actual Output: Consistent with expected results.
• Scenario 4: Stress Test Input: Uploading dataset with 10,000+ records. Expected Output:
System should remain stable and responsive. Actual Output: Performance maintained with
minimal delay.
All scenarios were executed multiple times to confirm repeatability and stability under different
conditions.
• Issue 1 – Missing Value Error: When datasets contained NaN values, the model failed during
prediction. Fix: Implemented automatic handling using mean imputation in the preprocessing
module.
• Issue 2 – File Upload Error: Non-CSV uploads caused Flask crashes. Fix: Added validation
checks for file format before processing.
• Issue 3 – Model Inconsistency: Early versions of the model produced fluctuating predictions
due to unscaled features. Fix: Integrated normalization before model inference.
• Issue 4 – User Interface Lag: Response delay observed for large datasets. Fix: Optimized
server-side processing and used asynchronous file handling.
• Issue 5 – Incorrect Error Messages: Some exceptions were not properly displayed to the user.
Fix: Implemented detailed exception handling in Flask routes.
• User interface received positive feedback for its simplicity and clarity.
Observation: The system demonstrated consistent performance even under large dataset sizes.
Average response time for predictions remained under 1.5 seconds, confirming suitability for real-time
deployment.
Graphical outputs, such as the confusion matrix and ROC curve, further validated the model’s
reliability and minimal misclassification.
After fixes, all modules were re-tested to confirm stability and correctness. Final testing confirmed
that the system was ready for deployment and capable of delivering reliable Parkinson’s prediction
results in real time.
Issue Fix
Missing Value Error – When Automatic handling using mean
datasets contained NaN values, the imputation in preprocessing
model failed during prediction. mod- ule.
File Upload Error – Non-CSV up- Validation checks for file format
loads caused Flask crashes. before model processing.
Model Inconsistency – Early ver- Integration of normalization be-
sions of the model produced fluc- fore model inference.
tuating predictions due to unscaled
features.
User Interface Lag – Response de- Optimized server-side processing and
lay observed for large datasets. asynchronous access.
Incorrect Error Messages – Some Detailed exception handling in
exceptions were not properly dis- Flask routes.
played to the user.
Table 7.2 : Identified Issues and Fixes in Lung Cancer detection System System
CHAPTER 8
8.1 Snapshots
8.1.1 Login Page
This page is designed to collect the basic personal information of the patient before proceeding to the
diagnosis process. It includes input fields for the patient’s name and email, ensuring that the uploaded
medical images and prediction results are properly associated with the correct patient. After entering
the details, the user can click the Next button to move forward to the image upload or diagnostic
section. This interface helps in maintaining organized medical records and enables easy
communication of the diagnostic results to the [Link] Patient Details page acts as the starting
point of the system where the user enters essential personal information such as Name and Email. This
step ensures proper identification and management of patient data throughout the diagnostic process.
The interface is simple, user-friendly, and designed with a clean medical theme for easy interaction.
Once the required information is entered, the Next button allows the patient to proceed to the image
upload section. By collecting these details, the system can securely store medical records, personalize
prediction results, and even enable communication of reports directly to the patient’s email. This page
plays an important role in establishing a structured and traceable workflow within the healthcare
diagnostic [Link] Login Page is the secure entry gateway of the system, designed to ensure
that only authorized users can access the medical diagnosis and patient management features. This
page typically contains input fields for Username/Email and Password, along with a Login button that
verifies the provided credentials. The authentication process helps protect sensitive medical data and
maintains privacy, which is critical in healthcare [Link] user interface is simple, intuitive, and
easy to navigate, allowing doctors, technicians, or registered users to sign in without any complexity.
Behind the interface, a secure backend authentication mechanism validates the login information
before granting access to the dashboard or next functional page. If incorrect details are provided, the
system can display helpful error messages prompting the user to retry.
The Lung Cancer Detection System is a machine learning–based application designed to assist in the
professionals to input relevant medical information and receive an AI-based risk evaluation. The login
and patient information interface serves as the first stage of the system. It allows users to securely
access the platform and enter essential patient details required for analysis. The form collects
demographic information such as age and gender, along with various clinical symptoms and lifestyle
factors commonly associated with lung cancer. These include parameters like anxiety, allergy history,
alcohol consumption, and respiratory symptoms such as coughing, among others. By systematically
capturing these inputs, the system ensures that the machine learning model receives structured and
comprehensive data to generate an accurate prediction. The interface is designed to be intuitive,
visually clear, and easy to navigate, ensuring that users can efficiently enter information without
medical expertise. This streamlined data collection process ultimately enhances the system’s reliability
and supports effective risk assessment for better clinical [Link] patient information page
is a crucial component of the Lung Cancer Risk Assessment System, designed to collect essential user
data in a structured and interactive manner. The interface is visually appealing, featuring a dark-
themed background with medical imagery that enhances user experience and reinforces the healthcare
the page, a bold and clear title—”Enter Patient Information to Assess Lung Cancer Risk”—guides
users about the purpose of this section. The design focuses on simplicity and clarity, ensuring that
users, including non-technical individuals, can easily understand and navigate through the form. The
interface begins by capturing basic demographic information such as Age. The age input field accepts
numerical values, as age is an important determinant in predicting lung cancer risk. It is followed by a
Gender dropdown menu that allows the user to select the appropriate gender category. Gender-based
differences play a significant role in medical risk prediction models, making this input essential. Next,
the form shifts to Symptoms and Medical History, highlighted in a clickable, styled hyperlink format for
easy navigation and visibility. This section includes several dropdown menus that gather specific
health-related attributes such as:
• Anxiety
• Allergy
• Alcohol Consumption
• Coughing
Each dropdown provides standardized options, ensuring consistency and accuracy in the data that is
fed into the machine learning model. These clinical and lifestyle factors are among the most influential
attributes in the prediction of lung cancer, as supported by medical research and patient datasets. The
form layout is cleanly organized, with each field clearly labeled to minimize user confusion. The
dropdowns ensure that users select valid inputs, reducing the possibility of incorrect or incomplete data
submission. The interface design emphasizes accessibility, responsiveness, and user-friendliness,
making it suitable for both clinical environments and personal health assessment scenarios. Overall, this
patient information page is an essential gateway for collecting relevant inputs that will be processed by
the machine learning algorithm. Its intuitive layout, professional design, and structured data fields
contribute to accurate and reliable lung cancer risk [Link] login page acts as the secure entry
point to the Lung Cancer Detection System, ensuring that only authorized users—such as healthcare
professionals, researchers, or registered patients—can access the application. This page is designed
with a strong emphasis on security, simplicity, and usability, all of which are critical for health-related
digital platforms. Visually, the login page maintains a modern and professional interface, typically set
against a themed medical background that reflects the system’s focus on healthcare and diagnostics.
The clean layout helps users instantly understand the purpose of the system while also providing a
sense of trust and [Link] fields ensure secure identification of each user. The input boxes are
clearly labeled and styled to be easily readable, even for older users or those with limited technological
experience. The password field hides user input for privacy, especially in shared environments like
clinics or [Link] overall design ensures that users can seamlessly transition from the login page
to the patient information form without confusion. The simplicity of the interface reduces cognitive
load, allowing users to focus on the main task—entering patient details and obtaining lung cancer risk
[Link], the Welcome Page creates a smooth and friendly entry point to the system. It sets
the tone for the entire application by maintaining a balance between professionalism and user-
friendliness.
Its design encourages users to proceed confidently toward entering their information and exploring
the lung cancer risk prediction tools powered by machine learning. At the center of the page, a bold
and informative heading—such as “Lung Cancer Detection System using Machine Learning”—
communicates the primary function of the platform. The background typically includes healthcare-
themed visuals, subtle patterns, or medical illustrations to create a sense of trust, seriousness, and
relevance to the domain of health diagnostics.
At the center of the page, a bold and informative heading—such as “Lung Cancer Detection
System using Machine Learning”—immediately communicates the primary function of the platform.
The background typically includes healthcare-themed visuals, subtle patterns, or medical illustrations
to create a sense of trust, seriousness, and relevance to the domain of health diagnostics.
The Welcome Page serves as the introductory interface to the Lung Cancer Detection System,
providing users with a clear understanding of the system’s purpose and guiding them toward the next
steps. Designed with a clean and visually appealing layout, this page creates a professional first
impression while ensuring ease of navigation for all users, including patients, clinicians, and
[Link] the center of the page, a bold and informative heading—such as “Lung Cancer
Detection System using Machine Learning”—immediately communicates the primary function of the
platform. The background typically includes healthcare-themed visuals, subtle patterns, or medical
illustrations to create a sense of trust, seriousness, and relevance to the domain of health
[Link] the heading, a brief description may be provided to highlight the objective of the
system. This introduction explains that the platform uses advanced machine learning algorithms to
analyze key health indicators and predict the potential risk of lung cancer. The goal is to assist in early
detection, enhance medical decision-making, and make risk assessment more accessible. The
Welcome Page generally includes clear navigation options, such as:
“Login” button for registered users
“Get Started” or “Assess Risk” for new users
Information links like About, Help, or
Contact
These buttons are visually distinct and positioned strategically to ensure intuitive access to the next
steps. Overall, the Welcome Page creates a smooth and friendly entry point to the system. It sets the
tone for the entire application by maintaining a balance between professionalism and user-friendliness.
Its design encourages users to proceed confidently toward entering their information and exploring the
lung cancer risk prediction tools powered by machine learning.
Machine learning–based lung cancer detection systems are designed to assist in the early identification
of abnormal lung conditions by analyzing chest images such as X-rays or CT scans. When the system
processes an image that shows no significant abnormalities, it generates a prediction indicating that the
lungs appear normal according to the model’s learned patterns. This type of prediction is crucial
because it allows the system not only to detect potential cancer risks but also to reliably confirm cases
where there are no visible indicators of the disease.A “normal image prediction” means that the
machine learning model has not detected features commonly associated with lung cancer, such as
irregular masses, nodules, abnormal tissue densities, or other suspicious patterns. To achieve this, the
model has been trained on large datasets containing both cancerous and non-cancerous images.
Through this training process, the system learns to differentiate between healthy lung structures and
those that may show signs of [Link] ability to classify an image as normal is just as
important as identifying abnormal findings. It helps reduce unnecessary anxiety, supports clinical
decision-making, and improves workflow efficiency in healthcare settings by quickly filtering out
low-risk cases. Additionally, the model’s performance on normal images demonstrates its robustness
and generalization capability, showing that it can accurately recognize diverse lung structures across
different [Link] the context of the Lung Cancer Detection System, the normal prediction result is
presented clearly and visually, ensuring that users—whether healthcare professionals or individuals
using the tool for awareness—can easily understand the output. While the model assists in preliminary
screening, it is not a standalone diagnostic tool; instead, it acts as a supportive technology to enhance
early detection efforts and streamline medical [Link] displayed image is a CT (Computed
Tomography) scan of the thoracic region, specifically showing a cross-sectional view of the lungs. CT
scans are highly detailed radiological images that allow doctors and AI systems to observe the internal
structure of the lungs, airways, and surrounding tissues clearly. They play a major role in lung disease
screening because they can detect even very small abnormalities. In the image provided, the majority
of the lung area appears dark, which indicates air-filled, healthy lung tissue. The boundaries of the
lungs are smooth and well-shaped, and no noticeable masses, abnormal white patches, or irregular
growths are visible. The white and gray surrounding regions represent bones (such as ribs and
vertebrae), muscles, blood vessels, and connective tissues — all appearing in their
normal anatomical form.
In the context of the Lung Cancer Detection System, the normal prediction result is presented
clearly and visually, ensuring that users—whether healthcare professionals or individuals using the
tool for awareness—can easily understand the output. While the model assists in preliminary
screening, it is not a standalone diagnostic tool; instead, it acts as a supportive technology to enhance
early detection efforts and streamline medical evaluations.
The cancer prediction output is one of the most critical components of the Lung Cancer Detection
System, as it indicates that the machine learning model has identified patterns associated with a
potential risk of lung cancer. When the system classifies an image or patient data as “Cancer
Detected,” it means the model has recognized features that closely match those found in confirmed
lung cancer cases during the training phase.
This prediction is based on advanced machine learning algorithms that analyze multiple indica-
tors—such as lung tissue patterns, image intensities, and clinical symptoms—to determine whether
abnormalities are present. These abnormalities may include irregular nodules, unusual tissue densities,
or patterns commonly linked to malignant growths. The system evaluates these features based on the
knowledge it has learned from extensive datasets containing both healthy and cancerous examples.
A positive cancer prediction serves as an early warning signal, guiding users or healthcare
profession- als toward further medical evaluation. While the system is not a diagnostic tool, it acts as
an intelligent assistant that helps prioritize high-risk cases, reducing delays in clinical workflows and
decision-making. Early detection plays a crucial role in improving treatment outcomes, and the
system’s ability to recognize high-risk patterns contributes significantly to this goal.
The interface presents the cancer prediction result in a clear and visually distinctive manner,
ensuring users can easily understand the outcome. This design helps communicate the model’s
assessment while maintaining the seriousness and sensitivity required for health-related predictions.
A confusion matrix is a table used to evaluate the performance of a classification model by comparing
the predicted labels with the actual labels. It provides a detailed breakdown of correct and incorrect
predictions for each class.
In a lung cancer detection system, the confusion matrix helps to:
Identify the number of true positives (TP) – correctly predicted malignant cases these results, high-
lighting strengths, weaknesses, Identify true negatives (TN) – correctly predicted benign cases
Detect false positives (FP) – benign cases incorrectly predicted as malignant
Detect false negatives (FN) – malignant cases incorrectly predicted as
benign
This detailed evaluation allows researchers to understand the types of errors the model makes,
which is especially critical in medical applications where false negatives can have serious
consequences.
By analyzing the confusion matrix, developers can measure accuracy, precision, recall, and F1-
score, and make informed decisions to improve model performance for reliable lung cancer detection.
Dept. of CS&E GEC, KUSHALNAGAR Page 67
Lung cancer detection using machine learning (BCS786) 2025-26
1. Detect highly correlated features, which can influence model performance or cause redundancy.
Positive correlation values (close to +1) indicate that two features increase together, while negative
values (close to -1) indicate an inverse relationship. Values near 0 imply no linear relationship.
The matrix is arranged in a square format, where rows typically represent the actual classes and
columns represent the predicted classes. Each cell in the matrix shows the number of predictions made
for that combination of actual and predicted values. From this, several key performance metrics can be
derived
Performance analysis is a crucial step in evaluating the effectiveness of any machine learning model.
It provides insights into how well the model has learned from the training data and how accurately it
generalizes to unseen data. To assess this, two primary metrics are commonly monitored during
training: accuracy and loss. These metrics are typically visualized across multiple training epochs to
observe patterns of improvement, convergence, or overfitting.
The accuracy curve shows the proportion of correct predictions made by the model during both
training and validation phases. A steady increase in accuracy indicates that the model is effectively
learning the underlying patterns in the data. Similarly, the loss curve represents the model’s prediction
error. A decreasing loss suggests that the model is optimizing its parameters to minimize errors over
time.
In the presented performance analysis graphs, both accuracy and loss trends are plotted across
several epochs. The accuracy graph compares training accuracy and validation accuracy, helping
determine whether learning is consistent or if the model is overfitting. The loss graph provides a
complementary view, illustrating how the model’s error reduces during training and how well it
generalizes to validation data.
Together, these visualizations offer a comprehensive understanding of model performance,
revealing training progress, potential weaknesses, and overall learning behavior. Such analysis is
essential for refining model architecture, tuning hyperparameters, and ensuring that the final model is
robust and reliable. Key Points from the Performance Graphs
• Accuracy Trends Training accuracy steadily increases from around 0.35 to 1.0 within the first
few [Link] accuracy also increases rapidly, reaching 1.0 accuracy by the 2nd
[Link] training and validation accuracy lines converge at 100%, indicating strong learning
[Link] visible oscillations or drops, suggesting the model learns patterns consistently.
• Loss Trends:Training loss decreases significantly from around 1.45 to nearly 0.0 by later
[Link] loss also drops sharply, following a similar downward pattern as the training
[Link] curves flatten towards zero, showing that the model continues improving with each
[Link] low gap between training and validation loss suggests minimal overfitting.
• Model Behavior:The rapid convergence indicates the model learns very quickly, possibly due
to:A simple datasetWell-selected features Efficient model architecture The close alignment of
training and validation curves shows that the model generalizes well to unseen data.
• Overall Performance Insight:The model achieves high accuracy and extremely low loss for both
training and [Link] curves show a consistent pattern of improvement, demonstrating
effec- tive optimization during training.
The absence of divergence between training and validation metrics confirms that the model is stable
and [Link] accuracy curve shows the proportion of correct predictions made by the model during
both training and validation phases. A steady increase in accuracy indicates that the model is
effectively learning the underlying patterns in the data. Similarly, the loss curve represents the model’s
error. A decreasing loss suggests that the model is optimizing its parameters to minimize errors over
time. These metrics are calculated using test data that the model has not seen before, ensuring unbiased
performance evaluation. Higher values in accuracy, precision, and recall indicate strong predictive
ability and reliability of the system for clinical support. The results are often shown using graphs,
charts, or comparison tables to clearly demonstrate the model’s [Link] Analysis is
carried out to evaluate how effectively the lung cancer prediction system identifies cancerous and non-
cancerous images. Various quantitative metrics are used to measure the model’s accuracy and
[Link] Analysis plays a vital role in evaluating the overall efficiency, accuracy, and
clinical usefulness of the Lung Cancer Detection System using Machine Learning. Since medical
diagnosis is a highly sensitive field, the performance of the system must be thoroughly analyzed to
ensure that the predictions made by the model are reliable and safe for real-world application. In this
project, the performance of the trained model is measured using a set of standard evaluation metrics
that are widely used in the domain of classification and healthcare predictive systems. These
performance indicators help in understanding how well the model is able to differentiate between
cancerous images and non-cancerous images. They not only help in validating the system but also help
in determining the possibilities for any future improvements.
This image is a data visualization chart used in cancer image classification systems. The chart shows
the percentage distribution of two classes from the images that were uploaded to the system: Normal
or Cancer
CHAPTER 9
9.1 Conclusion
The Lung Cancer detection System using Machine Learning offers an efficient and reliable method for
early identification of Lung cancer disease by analyzing biomedical voice features. Through
systematic preprocessing, noise removal, and normalization, the input data becomes suitable for
accurate analysis. Meaningful features are extracted and utilized to train machine learning models
capable of distinguishing between cancerous and non-cancerous cases with good [Link] system
is deployed through a http web application that supports both normal case and cancer case. This makes
the platform practical and user-friendly for healthcare professionals, researchers, and general users. Its
ability to handle multiple records and generate downloadable results enhances its usability and
scalability, making it fit for real- world [Link] the system is not intended to replace
formal medical diagnosis, it serves as a valuable decision-support tool by providing quick, data-driven
insights. The overall project demonstrates the potential of machine learning in medical prediction tasks
and supports efforts toward early detection and improved patient [Link] Lung cancer detection
System using Machine Learning demonstrates how artificial intelligence can significantly enhance
early detection of neurological disorders. By analyzing biomedical image features, the system
provides a scientific and data-driven approach to identifying lung cancer disease at an early stage. The
use of preprocessing techniques, feature extraction, and normalization ensures that the input data is
clean, consistent, and meaningful, ultimately improving the accuracy of the model. This structured
workflow highlights the importance of ML in handling complex medical datasets and transforming
them into actionable predictions.
Bibliography
[1] Emrah aslan and Ishak Pacal, ”Attention Enhanced InceptionNeXt-Based Hybrid Deep Learning
Model for Lung Cancer Detection”Multimedia Applications,volume 13,Feb.2025.
[2] Basam M. Kanber , Ahmad al smadi ”Advancing Oncology Diagnostics: AI-Enabled Early
Detec- tion of Lung Cancer Through Hybrid Histological Image Analysis”Deep learning,volume
15,march 2024.
[3] Abdulrahaman alzahrani,”Early detection of Lung Cancer using predictive Modelling Incorpora-
tion”,Deep learning,volume 16,feb 2025.
[4] [Link],Ashok mondal ,”Early Diagnosis of Lung Cancer Through Deep learning”,Deep
learn- ing,volume 25,october 2025.
[5] Pushkar Sathe,Alka Mahanajan, “End to end Automated lung cancer detection system”,
Multimedia Tools Appl., ,Volume 83, no. 5pp 14305 , Aug 2024.
[6] Sarad ayad,Hamdi “Advanced Lung Cancer detection and Classification based on alexnet CNN”,
[Link].(ICCES),Jul.2021,pp.1390-1397, doi:10.1109/ICCES51350.202 n
proc.6th feb 2025
[7] gilbert , “A transformer based multi scale deep learning for lung cancer ”, International Journal
of Computer Science and Information Technologies,Vol. 6 (1) , april 2025.
[8] Ahmed faozi,leo bey, “A wireless machine learning based lung cancer detection system”,
International Research Journal of Modernization in Engineering Technology and science,
Volume:06/Issue:03/oct-2025.
[9] Andriod and stephen, “An integrated data analysis for lung cancer”, American Journal of Open
Research, 3(3), May,2024
[10] Mohammad ammar and nadeem javid, “A advanced cardiovascular system ”, IEEE, 3(3), nov,2024