CSE C-18 Updated Report
CSE C-18 Updated Report
BACHELOR OF TECHNOLOGY
IN
COMPUTER SCIENCE AND ENGINEERING
Submitted by
Batch No-C18
VISION
To become a Centre of Excellence in Computer Science and
Engineering by imparting high quality education through teaching, training
and research.
MISSION
The Department of Computer Science and Engineering is established
to provide undergraduate and graduate education in the field of
Computer Science and Engineering to students with diverse
background in foundations of software and hardware through a broad
curriculum and strongly focused on developing advanced knowledge
to become future leaders.
i
PROGRAM EDUCATIONAL OBJECTIVES (PEO’S)
iii
PROGRAM OUTCOMES (PO’S)
iv
7. Understand the impact of the professional engineering solutions in
societal and environmental contexts, and demonstrate the knowledge of,
and need for sustainable development (Environment and
sustainability).
12. Recognize the need for, and have the preparation and ability to
engage in independent and life-long learning in the broadest context of
technological change (Life-long learning).
v
COURSE OUTCOMES (CO’S)
CO2. Analytical ability exercised in the project work.(PO2) CO3. Design skills
CO8. Ability to apply ethics and norms of the engineering practice as applied
in the project work.(PO8)
CO10. Ability to present views cogently and precisely on the project work.
(PO10)
vi
CO-PO Mapping
vii
DECLARATION
We declare that this written submission represents our ideas in our own
words and where others' ideas or words have been included, we have
adequately cited and referenced the original sources. We also declare that we
have adhered to all principles of academic honesty and integrity and have not
misrepresented or fabricated or falsified any idea / data / fact / source in our
submission. We understand that any violation of the above will be cause for
disciplinary action by the Institute and can also evoke penal action from the
sources which have thus not been properly cited or from whom proper
permission has not been taken when needed.
1. NAGURU FATHIMA
2. SANGEETHAM PAVANI
3. MENDA MAHESH
4. MUNAGAPATI LIKHITHA
viii
SREE VIDYANIKETHAN ENGINEERING COLLEGE
(Affiliated to JNTUA, Ananthapuramu, Approved by AICTE,
Accredited by NBA & NAAC)
Sree Sainath Nagar, Tirupati – 517 102, A.P., INDIA
CERTIFICATE
This is to certify that the project report entitled
Guide: Head:
ix
ACKNOWLEDGEMENTS
We are also thankful to all the faculty members of the CSE Department, who
have cooperated in carrying out our project. We would like to thank our
parents and friends who have extended their help and encouragement either
directly or indirectly in completion of our project work.
x
ABSTRACT
xi
TABLE OF CONTENTS
Title Page No.
ACKNOWLEDGEMENTS x
ABSTRACT xi
TABLE OF CONTENTS
LIST OF FIGURES
LIST OF TABLES
ORGANIZATION OF THESIS
CHAPTER 1 INTRODUCTION 1-7
1.1 Introduction
1.2 Problem Statement
1.3 Motivation
1.4 Objectives of Project Work
CHAPTER 2 LITERATURE REVIEW 8-11
CHAPTER 3 METHODOLOGY 12-26
3.1 Existing Methodology
3.1.1 Convolution Neural Networks(CNN)
3.1.2 VGG16(Visual Geometry Group)
3.1.3. EfficientNetB5
3.2 Proposed Methodology
3.2.1 Overview
3.2.2 Dataset Overview
3.2.3 Data Preprocessing
3.2.4 Hybrid Model Architecture
3.2.5. Performance Evaluation
CHAPTER 4 SYSTEM DESIGN AND IMPLEMENTATION 27-37
4.1 System Design
4.2 UML Diagrams
4.2.1 Sequence Diagram
4.2.2 Activity Diagram
4.2.3 Class Diagram
4.2.4 Usecase Diagram
CHAPTER 5 RESULTS AND DISCUSSION 38-45
CHAPTER 6 CONCLUSION AND FUTURE WORK 46
ABBREVIATIONS 47-48
NOTATIONS 49
REFERENCES 50-52
IMPLEMENTATION 53-61
LIST OF FIGURES
Chapter 3 Explains how the project was actually carried out. It covers the
data preparation steps like resizing CT images, normalizing pixel values, and
using data augmentation to make the model more robust. It then describes
how two powerful models, DenseNet121 and InceptionV3, were combined to
create a strong feature extractor, leading to better prediction performance.
INTRODUCTION
1.1 Introduction
2
Dept. of CSE
smoking, excessive alcohol consumption, and a family history of kidney
disease, all of which can increase susceptibility to CKD.
As CKD progresses, many patients become increasingly dependent on family
members, caregivers, or medical professionals for their daily needs. In later
stages, when dialysis is required, individuals need to visit a hospital or
dialysis center multiple times a week, requiring assistance with
transportation. Those who opt for home dialysis still need support from
trained caregivers or family members. Simple activities such as cooking,
grocery shopping, and household chores become exhausting, forcing patients
to rely on others for help. In severe cases, individuals may need assistance
with mobility, personal hygiene, and medication management.
Many patients experience persistent high blood pressure, shortness of breath,
and muscle cramps, particularly at night. A declining appetite, unintended
weight loss, nausea, and vomiting are also common as toxins accumulate in
the body. Some individuals may suffer from severe itching, dry skin, and
difficulty concentrating (brain fog), making daily tasks challenging. In
advanced stages, anemia can develop due to reduced red blood cell
production, leading to dizziness, cold intolerance, and paleness. If CKD
remains untreated, it can result in fluid overload, lung congestion, seizures,
confusion, and even coma, severely impacting the quality of life. Regular
kidney function tests are essential to detect CKD early and prevent these
complications.
The financial burden of CKD is another major challenge. The cost of
medications, routine tests, and, in advanced stages, dialysis or a kidney
transplant, can be overwhelming, especially for those without adequate
health insurance. This financial strain often leads to increased anxiety and
stress, affecting mental well-being. Individuals with CKD must also follow
strict dietary guidelines, avoiding high-sodium, high-potassium, and high-
protein foods. This makes meal planning difficult, particularly when dining out
or attending social gatherings, leading to feelings of isolation.
Chronic kidney disease progresses through five stages, starting with mild
damage and normal function (Stage 1) to complete kidney failure (Stage 5)
as shown in Fig 1.1.2.
3
Dept. of CSE
As kidney function (measured by eGFR) declines, symptoms become more
noticeable and treatment becomes more intensive, ranging from lifestyle
changes to dialysis or transplant in the final stage.
A branch of machine learning called transfer learning has shown great
promise in tackling these issues. Transfer learning makes use of pre-trained
models, which are frequently created for massive datasets like ImageNet,
and refines them for particular applications like medical image analysis.
Through the use of knowledge acquired in pre-trained models, this method
enables researchers to overcome the restrictions of small datasets, lowering
the time and computer resources needed for training while increasing model
performance. By effectively extracting pertinent information from kidney
pictures, transfer learning can optimize testing models' accuracy and
reliability for CKD prediction.
4
Dept. of CSE
The best method for CKD prediction is determined by comparing different
transfer learning models. To get the best results, the entails experimenting
with various architectures, fine-tuning tactics, and hyper parameter
optimization techniques. By improving the results interpretability, this meets
a crucial need for the advantage of machine learning algorithms in
therapeutic circumstances.
Different transfer learning models are compared to determine the most
effective approach for CKD prediction. In order to get optimal outcomes, this
involves testing different architectures, fine-tuning strategies, and
hyperparameter optimization methodologies. This satisfies an important
demand for the application of machine learning techniques in therapeutic
contexts by making the results easier to interpret. Medical imaging
breakthroughs could be greatly aided by these developments in CKD
prognosis and treatment.
With advancements in artificial intelligence, machine learning (ML) and
transfer learning have become powerful tools in the early detection and
prediction of Chronic Kidney Disease (CKD). These technologies help analyze
large datasets, identify patterns, and make accurate predictions, which can
improve early diagnosis, treatment planning, and patient outcomes. By using
transfer learning, healthcare professionals can reduce the need for extensive
data collection, improve prediction accuracy, and speed up diagnosis, making
it a cost-effective solution for CKD detection.
5
Dept. of CSE
Fig 1.2. Kidney Architecture
1.3 Motivation
Chronic Kidney Disease (CKD) is a serious health condition that often goes
unnoticed in its early stages due to the lack of clear symptoms. Early
detection plays a key role in slowing down its progression and improving
patient outcomes. However, analyzing CT scan images manually is time-
consuming, requires expert knowledge, and can sometimes lead to errors or
missed details—especially in busy clinical environments. This creates a need
for automated systems that can assist doctors by providing fast, accurate,
and consistent results.
7
Dept. of CSE
CHAPTER 2
LITERATURE REVIEW
Sohaib Asif [1], proposes two ensemble models, StackedEnsembleNet and
PSOWeightedAvgNet, for kidney stone classification using CT images. A
dataset of 1799 CT scans that were classified as either healthy or kidney
stones was preprocessed using techniques like partitioning, augmentation,
and resizing. Using concatenation and meta-learning with deep layers,
StackedEnsembleNet combines transfer learning models (InceptionV3,
InceptionResNetV2, MobileNet, and Xception). In order to aggregate
predictions from the same basic models, PSOWeightedAvgNet uses Particle
Swarm Optimization (PSO) to optimize a weighted average ensemble. These
strategies improve generalization, resilience, and classification accuracy. The
drawbacks includes it requires more computational power and time to
process.
Monali Gulhane[2], proposed an integrated method combining traditional
machine learning models and Deep Neural Networks to improve kidney stone
detection by capturing both simple and complex patterns in medical data.
This hybrid approach allows for the identification of subtle relationships in
patient history, symptoms, and test results, which are crucial for accurate
diagnosis. The Improved DNN model provides high accuracy and precision,
ensuring early detection and better treatment outcomes. However, it has
limitations with a small dataset and can't fully distinguish between kidney
stone types, finally leading to over fitting.
8
Dept. of CSE
predict kidney disease up to a year. The dataset is collected from Taiwan’s
National Health Insurance Research Database. LSTM manages temporal
relationships, whereas CNN records spatial patterns. The ensemble model
uses majority vote to combine predictions, increasing accuracy. Metrics such
as recall, precision, accuracy, F1-score, and specificity are used to assess the
models; the ensemble model performs better. The drawbacks include it faces
limitations in resource demands and addressing individual risk factors like
family history.
Smith J., Patel R.[5] developed a Random forest model to predict CKD
progression using clinical and laboratory data. The model performed well in
handling complex relationships among features and achieved high accuracy.
However, it struggled with missing values and imbalanced class distribution,
which affected its reliability in certain cases.
Ying Chen [6], uses VGG16 for automated IgA nephropathy image analysis.
Immunofluorescence image features are extracted by VGG16, and the model
is assisted by SE modules. BN layers enhance learning while stabilizing
training. Transfer learning and data augmentation are used to improve
performance as the system classifies IgAN images by combining deep
learning and image feature design. By fusing medical expertise with machine
learning, the approach improves CKD prediction by guaranteeing consistent
results. The drawbacks of this technique is it has challenges with learning
accuracy and concerns about privacy and ethics in AI-based diagnosis.
Kumar P., Singh A.[7] designed a Decision tree-based model for early CKD
detection, leveraging simple rule-based classification. The model was easy to
interpret and provided quick predictions, making it suitable for clinical
settings. However, it tended to overfit when trained on small datasets,
reducing its generalizability and also includes pruning techniques and
ensemble learning approaches to enhance robustness.
Md. Sakib Bin Islam [8], to classify kidney conditions like stones, tumors,
cysts, and normal findings from CT images. The dataset is collected from the
hospital in Bangladesh. Following preprocessing, six models were trained and
assessed, including both conventional models and Visual Transformers. The
9
Dept. of CSE
models were evaluated using ROC-AUC, F1-score, recall, accuracy, and
precision. Important areas of the image were visualized using GradCAM. The
drawbacks include the models may need further refinement for broader
clinical use.
Jyotismita Chaki [9], proposes an ensemble of pre-trained DNNs for
achieving high accuracy in CT images. This approach uses advanced pre-
trained models to extract important details from kidney CT images and
combines these features into a single dataset. It then selects the most useful
features and uses an optimized classifier to detect kidney stones. The method
faces limitations in generalizing to diverse data and lacks the ability to locate
kidney stones within images.
10
Dept. of CSE
prevent overfitting and only focusses on explainability methods such as SHAP
values to enhance clinical trust.
Kailash Kumar [13], developed a hybrid fuzzy deep neural network model
for early-stage CKD prediction. It makes use of a large set of patient records
that have been min-max normalized. A hybrid fuzzy neural network (FNN)
combines neural networks for pattern recognition with fuzzy logic to manage
uncertainty. By examining medical factors, such as Ghrelin levels, this
method forecasts the course of chronic kidney disease (CKD) and resolves
issues with inadequate data, ultimately enhancing CKD diagnosis and
treatment. Drawbacks include this is limited by the small sample size,
requiring larger datasets for more reliable outcomes.
Brown E., Williams G.[14] built a hybrid model combining genetic
algorithms and deep learning for CKD prediction. The genetic algorithm
optimized feature selection, while deep learning enhanced predictive
accuracy. Despite its strong performance, the model was computationally
expensive and required large datasets for training and reducing complexity
through model pruning and knowledge distillation techniques.
11
Dept. of CSE
CHAPTER 3
METHODOLOGY
3.1 EXISTING METHODOLOGIES
CNNs help in the early detection of CKD by analyzing medical images for
subtle signs of kidney damage, which may be difficult for human eyes to
detect. By training on large datasets of labeled kidney images, CNN models
can accurately classify stages of CKD. Additionally, CNNs enable automated,
efficient screening, reducing the time and effort needed for diagnosis, and
assisting healthcare professionals in making more accurate decisions. Fig
3.1.1.1 gives the overall architecture of how CNN works to predict Chronic
Kidney Disease.
An input image of size 150x150 pixels, representing a cross-sectional scan of
the kidneys, is used as the starting point. The image is passed through
multiple convolution and pooling layers, where the model begins extracting
important low-level features. Convolution layers apply multiple filters to the
input image, detecting patterns such as edges, textures, and shapes that are
essential for identifying abnormalities in kidney structures. After each
convolution operation, a ReLU (Rectified Linear Unit) activation function is
applied to introduce non-linearity, allowing the model to learn complex
representations that would not be possible with purely linear operations.
12
Dept. of CSE
Fig 3.1.1.1 Architecture of CNN
Pooling layers, likely using max-pooling techniques, are used after
convolution to down-sample the feature maps. This reduces the spatial
dimensions of the data, decreasing the computational load and helping to
prevent overfitting. Global Max Pooling, as shown in Fig 3.1.1.2 also makes
the detection of features more invariant to slight translations and distortions
in the input images. As the image passes through successive convolution and
pooling stages, the model learns increasingly abstract and high-level features
that represent important aspects of the kidney scans relevant for detecting
Chronic Kidney Disease (CKD).
13
Dept. of CSE
After feature extraction, the final set of feature maps is flattened into a one-
dimensional vector. This vector is then passed through fully connected layers,
where neurons combine the learned features to make the final classification
decision. The output layer produces a probability score indicating whether the
input image corresponds to a CKD case or a Non-CKD case. Through this
layered learning process, the model is able to automatically identify and
classify kidney scans, aiding in the early detection and diagnosis of
Chronic Kidney Disease. The pseudocode for CNN is outlined in Fig 3.1.1.3,
which describes the process of image preprocessing, feature extraction, and
classification, where D is the dataset path, (H, W) are the image dimensions,
B is the batch size, and E is the number of training epochs. D_train and D_val
represent the training and validation splits of the dataset, while θ denotes the
model parameters optimized using the Adam optimizer.
Pseudocode:
14
Dept. of CSE
While CNNs are highly effective in detecting patterns from medical images for
CKD prediction, they come with notable limitations. They require large, well-
annotated datasets and significant computational power, making them less
accessible in resource-constrained settings. Overfitting is a common issue
with limited data, and their lack of interpretability can hinder clinical trust.
Additionally, differences in imaging protocols can impact model
generalization, and relying solely on image data may overlook important
clinical information. Addressing these challenges through better data
integration, interpretability methods, and robust model design is essential for
advancing CNN-based CKD diagnostics.
15
Dept. of CSE
Fig 3.1.2.1 Architecture of VGG16
Following the activation step, the data moves into a pooling layer, which
reduces the spatial dimensions of the feature maps while retaining the most
important information. This step, often done using max-pooling, makes the
feature detection process more efficient and helps the model become less
sensitive to minor variations in the input image. By compressing the feature
maps, pooling not only speeds up computation but also helps in minimizing
overfitting, which is crucial when working with relatively small datasets in the
medical domain. After pooling, the extracted features represent a
compressed and meaningful summary of the input kidney scan.
The pooled feature maps are then passed into a fully connected layer, where
all neurons are interconnected to learn the final high-level representations
necessary for classification. A softmax activation function is applied to the
output of the fully connected layers, converting the raw model outputs into
probability scores for each class (e.g., CKD or Non-CKD). The final output
layer presents the classification result based on the highest probability score,
thereby assisting in automatically diagnosing Chronic Kidney Disease from
medical images. This entire pipeline helps streamline CKD detection, offering
potential support for early diagnosis and timely treatment planning. The
16
Dept. of CSE
Pseudocode for VGG16 is outlined in Fig 3.1.2.2, which describes the process
of image preprocessing, feature extraction, and classification, where
train_data and val_data are the training and validation datasets for training
the VGG16-based CKD model. M₀ is the pretrained VGG16 model, M₆ is the
modified model with custom layers, α is the learning rate, and E is the
number of epochs.
Pseudocode:
17
Dept. of CSE
Like those from PACS systems. Additionally, they lack built-in mechanisms for
handling variability in medical imaging quality, and their limited
interpretability can pose challenges in clinical validation and trust. Despite
their success in feature extraction, newer and more efficient architectures
may offer better performance with lower computational cost.
3.1.3 EfficientNetB5
18
Dept. of CSE
Fig 3.1.3.1 Architecture of EfficientB5
Inside the EfficientNetB5 model, the training data goes through several
stages starting with feature extraction, where important patterns like edges,
textures, and organ structures relevant to CKD detection are identified. After
that, batch normalization is applied to speed up training and reduce internal
covariate shifts, leading to a more stable learning process. The convolutional
layers then further extract complex features by applying multiple filters,
helping the model understand deeper patterns in the kidney scans. Finally,
softmax activation is used to produce probabilities for different output
classes, such as CKD or non-CKD.
19
Dept. of CSE
The trained EfficientNetB5 model is then evaluated using the testing data.
The model predicts the output by processing the test images and assigning
them to specific categories based on the learned features. The final output
layer shows the prediction results, helping doctors or systems identify
whether a patient has signs of Chronic Kidney Disease. This end-to-end
system automates the analysis of kidney images, assisting in early detection
and diagnosis of CKD with high accuracy. The pseudocode for EfficientNetB5
is outlined in Fig 3.1.3.2, which describes the process of image
preprocessing, feature extraction, and classification, where Xtrain, Xval, and
Xtest are the training, validation, and test image datasets, respectively. E is
the number of training epochs and B is the batch size.
Pseudocode
It the prediction of Chronic Kidney Disease (CKD) from medical imaging using
a hybrid deep learning model that combines DenseNet121 and InceptionV3.
While many existing methods focus on either shallow feature extraction or
single-model classification, they often fail to capture both fine-grained local
patterns and broader structural features critical for CKD diagnosis. The
proposed hybrid model leverages DenseNet121 for efficient feature
propagation and reuse, while InceptionV3 captures multi-scale spatial
features through parallel convolutions. This fusion enhances the model’s
ability to detect subtle renal abnormalities and improves classification
accuracy. By integrating the strengths of both architectures, the model
supports more robust, interpretable, and clinically relevant CKD prediction.
The dataset was gathered from PACS (Picture Archiving and Communication
System) institutes in Dhaka, Bangladesh, where patients had previously been
diagnosed with kidney tumors, cysts, normal results, or stones. Total there
are 12,446 distinct images, of which 3,709 are cyst-related, 1,377 are
stones, 2,283 are tumors and 5,077 are normal as shown in Fig 3.2.2.1
The hybrid model for Chronic Kidney Disease (CKD) prediction integrates two
powerful pre-trained convolutional neural networks—DenseNet121 and
InceptionV3—to enhance feature extraction and classification performance.
22
Dept. of CSE
These models are known for their ability to learn rich, hierarchical features
from medical images and are fine-tuned through transfer learning for the
specific task of CKD classification. The input medical images, such as renal
ultrasound, MRI, or CT scans, are first preprocessed by resizing them to a
fixed dimension of 224×224 pixels. This resizing ensures uniformity across
the dataset and compatibility with both DenseNet121 and InceptionV3
architectures. The pixel values are normalized by dividing by 255, scaling
them to a range between 0 and 1 to improve training stability. The overall
architecture of the hybrid model is illustrated in Fig 3.2.4.1
23
Dept. of CSE
These complementary architectures allow the model to extract diverse and
meaningful patterns such as kidney shape, texture irregularities, and
structural abnormalities. The convolutional layers are frozen during training
to retain their pre-trained weights and prevent overfitting on the CKD
dataset.
The output feature maps from both models are passed through Global
Average Pooling layers to reduce their dimensionality while retaining the most
informative statistics. The pooled feature vectors from DenseNet121 and
InceptionV3 are then concatenated to form a unified feature representation
that combines the strengths of both models. This merged vector is then
forwarded through newly added dense layers, starting with a fully connected
layer followed by a ReLU activation function to introduce non-linearity. Batch
normalization is applied to stabilize learning, and a dropout layer is used to
randomly deactivate neurons during training, thus reducing overfitting and
improving generalization.
The final output layer is a dense layer with a softmax activation function that
predicts the probability distribution over four CKD-related classes: cyst,
stone, tumor, and normal. The model is trained using the sparse categorical
cross-entropy loss function, which is suitable for multi-class classification with
integer-encoded labels. The pseudocode outlining the training procedure is
provided in Fig 3.2.4.2 The Adam optimizer is employed for efficient and
adaptive gradient-based optimization. An early stopping strategy is used
along with a learning rate scheduler to ensure efficient convergence during
training.
24
Dept. of CSE
The Adam Optimizer, sparse categorical cross-entropy loss, and accuracy are
used to evaluate the hybrid model, Adam Optimizer combines adaptive
learning rates with momentum to optimize well.
25
Dept. of CSE
Fig 3.2.4.2 Pseudocode of hybrid Model
26
Dept. of CSE
CHAPTER 4
SYSTEM DESIGN
4.1 System Design:
Data is first loaded from medical imaging datasets, such as MRI images,
aimed at predicting Chronic Kidney Disease (CKD). OpenCV is used for
loading and resizing the images, NumPy is utilized for numerical processing,
and TensorFlow is employed for model development and training. During
preprocessing, all images are resized to a uniform 150x150 pixels and
normalized to ensure consistent input into the model. To improve robustness
and generalization, data augmentation techniques like rotation, zoom, and
horizontal flipping are applied. Auto-tuning is implemented to cache datasets
in memory and preload them during training, reducing delays and ensuring
smoother model updates. The dataset is split into training and validation sets
while maintaining a balanced distribution across the different classes.
Training parameters are initialized before the training process begins to guide
model learning effectively. The number of epochs is typically set to 10,
allowing the model multiple passes over the entire dataset to learn patterns
thoroughly. A batch size of 32 is selected to optimize between computational
efficiency and stability during training updates. The learning rate is carefully
chosen to control the size of updates to the model weights after each batch.
Setting these parameters properly ensures that the model learns efficiently
27
Dept. of CSE
without overfitting or getting stuck in local minima. Together, they form the
backbone of a stable training strategy.
During training, CKD medical images are passed through the convolutional
layers of DenseNet121 and InceptionV3 for deep feature extraction. The
features are fused and sent through the dense layers to classify images into
categories like cyst, stone, tumor, or normal. The model calculates sparse
categorical cross-entropy loss by comparing predicted labels to actual labels,
indicating how well the model is performing. Backpropagation is applied to
update the weights of newly added layers, while the pre-trained convolutional
layers remain frozen. Training progresses across several epochs, and
performance is evaluated after each epoch using metrics like accuracy,
precision, recall, and F1-score. This monitoring helps fine-tune the model
progressively toward better results.
Once training is complete, the hybrid model is evaluated on the test data
using a variety of performance metrics. Accuracy measures the percentage of
correctly classified instances out of all predictions made by the model.
Precision evaluates the proportion of true positive results among all positive
predictions, while recall focuses on the proportion of true positives detected
among all actual positives. The F1-score, which balances precision and recall,
offers a more comprehensive performance overview. Additionally, the AUC-
ROC curve is plotted to assess the model’s capability to distinguish between
different classes by analyzing the true positive rate versus the false positive
rate. These evaluations provide a detailed understanding of the model's
effectiveness.
28
Dept. of CSE
Values. Ultimately, the goal is to deliver a robust and reliable hybrid model
for Chronic Kidney Disease prediction based on medical imaging. The
continuous improvement loop ensures the final model is both accurate and
dependable for clinical applications.
UML (Unified Modeling Language) diagrams are essential tools in our chronic
kidney disease (CKD) prediction project for visualizing system components
and workflows. They help in designing the system’s architecture and
capturing the interactions between different elements. By using UML
diagrams, we can clearly define functional requirements, class structures, and
data flows. These diagrams also assist in understanding the step-by-step
processes involved in CKD prediction.
A sequence diagram is crucial in our CKD prediction project for illustrating the
interactions between system components over time. It shows how data flows
through the system, detailing the sequence of operations from medical image
input to CKD prediction. By mapping out the exchanges between the feature
extraction models, classification layers, and output generation, it provides a
clear view of the system’s behavior. This diagram helps ensure that the
process is well-understood and efficiently executed. Ultimately, it enhances
communication and guides system development.
The class diagram is vital for defining the structure of our CKD prediction
system by modeling its core components. It identifies the system’s main
29
Dept. of CSE
classes, attributes, and the relationships between them, forming the blueprint
for the object-oriented design. This diagram provides insights into how data
will be stored, accessed, and manipulated within the system. It ensures that
the design is well-organized, scalable, and easy to maintain. The class
diagram plays a key role in shaping the foundation of the system’s backend
architecture.
The use case diagram is essential for capturing the functional requirements of
the CKD prediction system. It outlines how different users, such as healthcare
professionals, will interact with the system, specifying the actions they can
perform and the outcomes they expect. By clearly defining the system’s
functionality, it helps in identifying user needs and ensuring the project
meets its objectives. The use case diagram serves as a foundation for
designing the user interface and guiding the system's development process.
The sequence diagram for the Chronic Kidney Disease (CKD) prediction
system outlines the step-by-step interaction among various entities involved
in the prediction process. The main actors are the Data Scientist, the User,
the Medical Data Source, the CKD Prediction Model, and two deep learning
architectures: DenseNet121 and InceptionV3. This diagram represents how
data and control flow sequentially from the initial data collection phase to the
final validation of prediction results. Fig 4.3.1 gives the clear sequence
diagram to predict CKD.
Initially, the Data Scientist retrieves medical data from the Medical Data
Source and performs preprocessing to ensure data quality and readiness for
model development. Once preprocessing is complete, the CKD Prediction
Model extracts features from the dataset using DenseNet121 and InceptionV3
models. The extracted features are then returned and combined to create a
robust feature set that enhances the training of the hybrid CKD prediction
model.
30
Dept. of CSE
Fig 4.3.1 Sequence Diagram
Subsequently, the Data Scientist proceeds to train the hybrid model using the
combined features. After successful training, the model is provided to the
User for making new predictions. When the User submits new data, the
system again performs feature extraction through DenseNet121 and
InceptionV3, combines these features, and generates the final prediction
based on the trained hybrid model.
Finally, the User receives the prediction results and validates them to ensure
the model’s reliability and accuracy in real-world conditions. This structured
sequence ensures a systematic and logical flow of operations within the CKD
31
Dept. of CSE
prediction framework, making the system reliable, transparent, and efficient
for practical use.
An activity diagram for CKD prediction visually outlines the sequence of steps
from data collection to disease prediction. It shows how data scientists,
models, and users interact at each stage. This helps in clearly understanding,
organizing, and optimizing the CKD detection process. Fig 4.4.1 gives the
clear Activity diagram to predict CKD.
Participants (Swimlanes)
1. Data Scientist
2. CKD Prediction Model
3. User
The data scientist collects raw medical data and transforms it through precise
preprocessing to build a strong foundation for the model. With clean and
structured data in hand, the model begins its work by extracting meaningful
features using two advanced convolutional neural networks: DenseNet121
and InceptionV3. Each network captures different patterns and characteristics
from the data, and their outputs are intelligently combined to create a richer,
more detailed feature set. This fusion of features strengthens the model’s
ability to detect subtle signs of chronic kidney disease that might otherwise
be missed.
Once the feature extraction and combination are complete, a hybrid model is
trained using this enhanced information. The data scientist then rigorously
evaluates the model’s performance, ensuring it meets high standards of
accuracy, reliability, and robustness. After successful validation, the model is
finalized and prepared for deployment. The emphasis on combining multiple
32
Dept. of CSE
feature extractors and thorough evaluation ensures that the model is not only
powerful but also generalizes well to unseen patient cases.
The final stage involves handing the trained hybrid model over to the user.
Users input new medical data into the system, where it undergoes the same
dual feature extraction and merging process before the model generates a
prediction. These predictions are then validated in real-world settings, either
by clinical professionals or through further diagnostic testing. This
streamlined collaboration between data science, deep learning, and user
validation creates a strong, efficient pipeline for early and accurate CKD
prediction.
33
Dept. of CSE
4.5 Class Diagram
The class diagram represents the architectural blueprint of the Chronic Kidney
Disease (CKD) prediction system. It illustrates the key components, their
attributes, operations, and relationships, helping to ensure the system’s
design is modular, scalable, and maintainable. Fig 4.5.1 gives the clear Class
diagram to predict CKD.
The system begins with the DatasetLoader class, which is responsible for
loading the raw medical dataset and splitting it into training and validation
subsets. This structured dataset is then passed to the ImagePreprocessor
class, where images or data samples are resized, normalized, and optionally
augmented to enhance model performance. The preprocessed data is then
fed into the HybridModel class, which serves as the core of the system.
34
Dept. of CSE
Fig 4.5.1 Class Diagram
Finally, the ImagePredictor class uses the trained hybrid model to make real-
time predictions on new patient data and facilitates the loading of saved
model for inference.
35
Dept. of CSE
4.6 Usecase Diagram
The use case diagram for the Chronic Kidney Disease (CKD) prediction
system highlights the key interactions between different actors and the
system functionalities. It offers a clear representation of how various entities
work together to accomplish the overall goal of developing and utilizing a
predictive model for CKD. The main actors involved are the Medical Data
Source, Data Scientist, CKD Prediction Model, and the User. Fig 4.6.1 gives
the clear usecase diagram to predict CKD.
Initially, the Medical Data Source and the Data Scientist collaborate to
preprocess the raw medical data to ensure its quality and usability. The Data
Scientist then uses this prepared data to train the prediction model and
further evaluates the model's performance to ensure it meets the necessary
accuracy standards. The CKD Prediction Model is central to making
predictions once the training process is complete.
36
Dept. of CSE
Following model training, the User interacts with the system to make new
predictions based on unseen data. After predictions are generated, the User
also validates the results to assess their clinical reliability and relevance. Each
use case — Preprocessing Data, Training Model, Evaluating Model, Making
Predictions, and Validating Results — is critical for ensuring the system
functions effectively and meets its objective of accurately predicting CKD.
37
Dept. of CSE
CHAPTER 5
Evaluation Metrics:
The model learns well and performs well on new data, as evidenced by the
accuracy increasing progressively during the first few epochs, with both
training and validation accuracy reaching roughly 98–99% as shown in the fig
5.1.
Dept. of CSE 38
In addition, the loss drops rapidly at first and then remains low, indicating
that the model produces relatively few errors as shown in the fig 5.2. The
model avoids overfitting and performs consistently, as evidenced by the
similarity between training and validation results.
Precision: 99% of the cases that are predicted to have CKD are indeed CKD-
positive, according to the model precision. By reducing false positives, this
high precision helps to prevent healthy people from receiving an inaccurate
CKD diagnosis.
Recall: The model accurately recognizes 99% of all real CKD cases, with a
recall of 99%. This shows how well the model can identify CKD patients,
which is important for early diagnosis and care.
F1 score: An F1-Score of 99% indicates that recall and precision are well-
balanced. This suggests that the model is very dependable for clinical usage
since it does a good job of both detecting actual CKD cases and preventing
misclassification as shown in the fig 5.3.
39
Dept. of CSE
Fig 5.3 Performance Metrics
As illustrated in Fig 5.4, the DenseNet and InceptionV3 model's ROC curve
demonstrates exceptional performance in CKD prediction. The AUC of 1.00
indicates perfect categorization for all classes (0, 1, 2, and 3). Consistent
performance in every class is confirmed by the macro-average AUC of 1.00.
The model is highly reliable for CKD prediction because of its high sensitivity
and low false positive rates, as seen by the curve's location close to the top-
left corner.
The model gives all correct predictions, for example when we pass an image
to the model it correctly categorizes the kidney condition such as cyst,
normal, stone and tumor which is shown in Fig 5.5
The model has around 30 million parameters, but only about 1.5 million
parameters are trainable because the pretrained layers are frozen (not
updated during training) as shown in Fig 5.6. This approach helps the model
train faster and perform better, even with a smaller dataset. By using
pretrained models, we are able to take advantage of their powerful feature
extraction
41
Dept. of CSE
ability without needing to train from scratch. Overall, this hybrid design
improves accuracy and helps the model generalize well to unseen CKD data.
42
Dept. of CSE
Fig 5.7 Number of features extracted per each epoch
In terms of predicting chronic kidney disease (CKD), the hybrid model that
combined DenseNet121 and InceptionV3 outperformed individual models
such as DenseNet121, InceptionV3, EfficientNet, and VGG16. This model
offers a more comprehensive set of characteristics for prediction by utilizing
the feature reuse of DenseNet121 and the multi-scale feature extraction
capabilities of InceptionV3 as shown in the fig 5.8.
DenseNet121 and InceptionV3 were both pretrained on ImageNet, and their
layers were frozen in the hybrid model. After combining their results, more
layers were added to further enhance the features. The model can now
recognize complicated patterns in CKD data because of this method.
Combining the multi-scale feature extraction of InceptionV3 with the feature
reuse of DenseNet121 makes the hybrid model outstanding. This model
catches both varied and complex patterns, which makes it more accurate for
CKD prediction than EfficientNet, which might overlook features, or VGG16,
which is too simplistic.
With a 99.1% accuracy rate, 99% precision, recall, and F1-score, the hybrid
model outperformed the separate models across all important criteria. This
43
Dept. of CSE
demonstrates that the hybrid model is the most effective option for CKD
prediction because to its ability to reduce mistakes. Average Accuracy and
Loss Comparison with other models is explained in graph as shown in Fig 5.9.
In conclusion, integrating DenseNet121 and InceptionV3 improves
performance and generalization, making the hybrid model more dependable
for CKD prediction than the other models
44
Dept. of CSE
Fig 5.9 Average Accuracy and Loss Comparison
45
Dept. of CSE
CHAPTER 6
Future Work
ML → Machine Learning
DL → Deep Learning
AI → Artificial Intelligence
TL → Transfer Learning
CT → Computed Tomography
47
Dept. of CSE
GPU → Graphics Processing Unit
48
Dept. of CSE
NOTATIONS
49
Dept. of CSE
REFERENCES
[2] Gogoi, P., Valan, J.A. Machine learning approaches for predicting and
diagnosing chronic kidney disease: current trends, challenges, solutions, and
future directions. Int Urol Nephrol (2024). https://doi.org/10.1007/s11255-
024-04281-5
[7] Gogoi, P., Valan, J.A. Machine learning approaches for predicting and
diagnosing chronic kidney disease: current trends, challenges, solutions, and
50
Dept. of CSE
future directions. Int Urol Nephrol (2024). https://doi.org/10.1007/s11255-
024-04281-5
51
Dept. of CSE
[14] F. Lareyre et al., "Applications of Artificial Intelligence in Non-cardiac
Vascular Diseases: A Bibliographic Analysis," Angiology, vol. 73, no. 8, pp.
695–703, 2022. DOI: 10.1177/00033197211073267.
[15] D. S. Kermany et al., "Identifying Medical Diagnoses and Treatable
Diseases by Image-Based Deep Learning," Cell, vol. 172, no. 5, pp. 1122–
1131.e9, 2018. DOI: 10.1016/j.cell.2018.02.010.
52
Dept. of CSE
Implementation
Code Snippet:
1. Installing packages:
2. Installing modules:
import pandas as pd
import numpy as np
import cv2
import tensorflow as tf
import os
53
Dept. of CSE
from tensorflow.keras.layers import GlobalAveragePooling2D
#Data Augmentation
data_augmentation = keras.Sequential([
layers.RandomFlip("horizontal"),
layers.RandomRotation(0.1),
layers.RandomZoom(0.1),
])
#Batch Normalization
# Normalize images
normalization_layer = layers.Rescaling(1./255)
train=train.map(lambda x,y:(x/255,y))
val=val.map(lambda x,y:(x/255,y))
#Auto-Tuning
AUTOTUNE = tf.data.AUTOTUNE
train = train.cache().prefetch(buffer_size=AUTOTUNE)
val = val.cache().prefetch(buffer_size=AUTOTUNE)
4. Model training
train=tf.keras.utils.image_dataset_from_directory(data_dir,image_size=(img_height,img_width),
validation_split=0.1,
subset='training',seed=123)
54
Dept. of CSE
val=tf.keras.utils.image_dataset_from_directory(data_dir,image_size=(img_height,img_width),
validation_split=0.2,
subset='validation',seed=123)
5. Model Implementation
densenet.trainable = False
inception.trainable = False
# Combine outputs
densenet_features = densenet(input_layer)
inception_features = inception(input_layer)
x = layers.Dense(512, activation='relu')(concat_features)
x = layers.BatchNormalization()(x)
55
Dept. of CSE
x = layers.Dropout(0.5)(x)
# Create model
combined_model.compile(optimizer='adam', loss='sparse_categorical_crossentropy',
metrics=['accuracy'])
combined_model.summary()
# Train model
history_combined = combined_model.fit(
train,
validation_data=val,
epochs=10
plt.imshow(img)
plt.show()
max_index = np.argmax(yhat)
label_to_class_name[max_index]
56
Dept. of CSE
import matplotlib.pyplot as plt
import numpy as np
val_true_labels = []
val_probabilities = []
val_probabilities.extend(combined_model.predict(images)) # Predict
probabilities
val_true_labels = np.array(val_true_labels)
val_probabilities = np.array(val_probabilities)
val_true_labels_binarized = label_binarize(val_true_labels,
classes=np.arange(n_classes))
fpr = {}
tpr = {}
roc_auc = {}
for i in range(n_classes):
57
Dept. of CSE
# Compute macro-average AUC
val_true_labels_binarized.ravel(), val_probabilities.ravel()
plt.figure(figsize=(10, 8))
for i in range(n_classes):
plt.plot(
fpr[i],
tpr[i],
plt.plot(
fpr["macro"],
plt.xlabel('Epochs')
plt.ylabel('Loss')
plt.legend()
plt.show()
58
Dept. of CSE
9. Training and Validation Accuracy
# Plot results
plt.plot(history_combined.history['val_accuracy'], label='Validation
Accuracy')
plt.legend()
plt.show()
# Compute metrics
print(f"Precision: {precision:.2f}")
print(f"Recall: {recall:.2f}")
print(f"F1-Score: {f1:.2f}")
print(classification_report(val_true_labels, val_predictions))
59
Dept. of CSE
# Extract true labels from the validation dataset
val_true_labels = []
# Compute metrics
print(f"Precision: {precision:.2f}")
print(f"Recall: {recall:.2f}")
print(f"F1-Score: {f1:.2f}")
print(classification_report(val_true_labels, val_predictions))
efficient_model = Sequential()
pretrained_model = EfficientNetB5(include_top=False,
pooling='max',
60
Dept. of CSE
classes=4,
weights='imagenet')
efficient_model.add(pretrained_model)
efficient_model.add(Flatten())
efficient_model.add(Dense(512, activation='relu'))
efficient_model.add(Dropout(0.5))
efficient_model.add(Dense(4, activation='softmax'))
pretrained_model.trainable = False
efficient_model.compile(optimizer='adam',
loss='sparse_categorical_crossentropy', metrics=['accuracy'])
efficient_model.summary()
# Training EfficientNet
history_efficient = efficient_model.fit(
train,
validation_data=val,
epochs=15
# Results
plt.plot(history_efficient.history['val_accuracy'], label='Validation
Accuracy')
plt.title('EfficientNet Accuracy')
plt.legend()
plt.show()
61
Dept. of CSE