0% found this document useful (0 votes)
3 views50 pages

Project Report

Uploaded by

venkatathiru24
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views50 pages

Project Report

Uploaded by

venkatathiru24
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

TRANSFER LEARNING AND DEEP LEARNING

INTEGRATED FRAMEWORK FOR PARKINSON’S DISEASE


DIAGNOSIS USING HAND – DRAWN DATASET

Dissertation
Submitted to
The Gandhigram Rural Institute (Deemed to be University)
In partial fulfilment of the requirements for the award of the degree of
MASTER OF COMPUTER APPLICATIONS

Submitted by
JEYA KIRUBAKARAN G
(Register Number: 23322013)

DEPARTMENT OF COMPUTER SCIENCE AND APPLICATIONS


THE GANDHIGRAM RURAL INSTITUTE
(DEEMED TO BE UNIVERSITY)
GANDHIGRAM – 624 302
TAMIL NADU
INDIA

APRIL 2025
BONAFIDE CERTIFICATE

This is to certify that the project titled “TRANSFER LEARNING AND


DEEP LEARNING INTEGRATED FRAMEWORK FOR PARKINSON’S
DISEASE DIAGNOSIS USING HAND – DRAWN DATASET” is a bonafide
record of work carried out by JEYA KIRUBAKARAN G
([Link].:23322013) submitted in partial fulfilment of the requirements for the
award of MASTER OF COMPUTER APPLICATIONS in The Gandhigram
Rural Institute (Deemed to be University), Gandhigram, during the period
December 2024 – April 2025.

INTERNAL GUIDE HEAD OF THE DEPARTMENT


[Link] MCA.,MBA.,Ph.D., [Link] MCA.,[Link].,Ph.D.,

Submitted for the VIVA-VOICE Examination held on ___________

INTERNAL EXAMINER EXTERNAL EXAMINER


DECLARATION

I hereby declare that this project work titled “TRANSFER LEARNING


AND DEEP LEARNING INTEGRATED FRAMEWORK FOR
PARKINSON’S DISEASE DIAGNOSIS USING HAND – DRAWN
DATASET” is a record of original work done by me under the supervision and
guidance of [Link], M.C.A.,M.B.A.,Ph.D., and that this
project work has not formed the basis for the award of any Degree/ Diploma/
Associate ship/ Fellowship or similar title to any candidate of any other University.

Place: Gandhigram Signature of the Candidate


Date: (JEYA KIRUBAKARAN G)
ACKNOWLEDGEMENTS

First and foremost, I would like to thank the Almighty for blessing me with
physical and mental strength for doing this project.

I express my sincere thanks to my Guide,


[Link],M.C.A.,M.B,A.,Ph.D., Senior Professor,
Department of Computer Science and Applications for giving me a moral support
and excellent guidance through the course of the development of this project.

I express my sincere thanks to [Link],


MCA.,[Link].,Ph.D.,Professor and Head, Department of Computer Science and
Applications, for supporting me through the course of the development of this
project.

I express my deep appreciation of the help and warm encouragement that I


received from my family and friends, because without their support and help I
could not have dreamt of completing this project successfully.

(JEYA KIRUBAKARAN G)
TABLE OF CONTENTS
Chapter Contents Page No.
ABSTRACT
1 INTRODUCTION 1
1.1 Deep Learning Techniques 1
1.2 Mobile Application 2
2 LITERATURE REVIEW 3
3 SYSTEM ANALYSIS 5
3.1 Existing System 5
3.2 Proposed System 5
3.3 Feasibility Study 6
4 SYSTEM REQUIREMENTS 7
4.1 Hardware Requirements 7
4.2 Software Requirements 7
4.3 Software Description 7
5 SYSTEM DESIGN 13
5.1 Data Flow Diagram 13
6 SYSTEM DEVELOPMENT 14
6.1 Project Description 14
6.2 Module Description 15
6.2.1 Get Dataset 15
6.2.2 Dataset Preprocessing and Augmentation 16
6.2.3 Splitting the Dataset 18
6.2.4 Applying the CNN Model Algorithm 18
6.2.5 Prediction Accuracy 20
6.2.6 Visualization 20
6.2.7 Convert into Mobile App 22
7 RESULT AND DISCUSSION 24
8 SYSTEM IMPLEMENTATION AND 27
MAINTENANCE
9 CONCLUSION 29
10 FUTURE ENHANCEMENT 30
BIBLIOGRAPHY 31
APPENDIX 32
Appendix A – Sample Source Code 32
Appendix B – Screenshots 42
ABSTRACT

Parkinson’s Disease (PD) is a progressive neurodegenerative disorder that


significantly impacts motor functions. Early and accurate diagnosis is essential
for effective treatment and management, yet traditional methods often rely on
manual assessment and expert observation of motor symptoms such as
handwriting irregularities, tremors, muscle stiffness, slowness of movement
(bradykinesia), postural instability, reduced facial expressions (hypomimia), and
shuffling gait. This project introduces a deep learning-based diagnostic approach
that leverages both Convolutional Neural Networks (CNN) and Transformer
architectures to classify hand-drawn spiral and wave patterns for Parkinson’s
detection.

The proposed model combines the InceptionV3 for local feature extraction
with Transformer layers to capture global spatial dependencies within the image.
This hybrid architecture enhances the model’s ability to understand complex
drawing patterns typically affected by PD. The system is trained on the
Parkinson’s Hand-Drawn Image Dataset, which includes spiral and wave images
from both PD healthy individuals and patients. Images are resized to 128x128
and processed for multi-class classification with high accuracy.

The trained model is converted into TensorFlow Lite (TFLite) and


integrated into a mobile Android app. Users can upload or capture hand-drawn
images to receive real-time predictions, enabling early, non-invasive Parkinson’s
screening. This is especially helpful in remote areas lacking advanced
diagnostics. The combined CNN and Transformer model improves classification
accuracy and ensures accessibility, highlighting the potential of AI tools in
supporting early intervention.
CHAPTER 1
INTRODUCTION

Parkinson’s Disease (PD) is a progressive neurodegenerative disorder that


affects motor function due to the loss of dopaminergic neurons, leading to
symptoms like tremors, muscle rigidity, slowness of movement, and postural
instability. Early detection is crucial for effective management and improving
quality of life. Deep learning, particularly Convolutional Neural Networks
(CNNs), has shown great promise in medical image analysis by automatically
identifying complex patterns. This study applies deep learning techniques to
analyze hand-drawn images, such as spirals and waves, which are commonly used
to assess motor impairments in PD patients. Utilizing two publicly available
datasets, the Parkinson’s Drawing Dataset and the NewHandPD Dataset, the
research aims to develop a method for early, non-invasive detection of PD by
analyzing scanned or uploaded hand-drawn images.

1.1 DEEP LEARNING TECHNIQUES


Deep learning, a subset of machine learning, has revolutionized various
fields, including computer vision, natural language processing, and medical
diagnostics, due to its ability to automatically learn complex patterns from large-
scale data. Deep learning models, particularly deep neural networks (DNNs),
consist of multiple interconnected layers that enable them to extract hierarchical
features from the data without the need for manual feature engineering. One of
the most successful architectures in deep learning is the Convolutional Neural
Network (CNN), widely used for image-based tasks. CNNs are designed to
automatically detect features like edges, textures, and shapes in images, making
them highly effective for tasks such as image classification, object detection, and
medical image analysis. Another powerful architecture, the Transformer, uses
self-attention mechanisms to capture global dependencies and relationships
1
within the data, making it useful for sequence-based tasks and complex image
processing.
In medical imaging, deep learning has demonstrated significant success,
particularly in applications such as cancer detection and disease diagnosis, where
traditional methods struggle to handle the complexity of medical images. These
models, particularly CNNs, have been used to extract relevant features from MRI
scans, X-rays, and CT scans, often achieving accuracy comparable to or
surpassing that of human experts. In the context of Parkinson's Disease (PD),
deep learning techniques have been applied to analyze hand-drawn patterns, such
as spirals and waves, which are commonly used to assess fine motor skills in PD
patients. Through deep learning, these models can learn subtle patterns in these
drawings that indicate PD, offering the potential for early, non-invasive
diagnosis. Despite challenges like the need for large labeled datasets and
computational resources, the continuous advancement of deep learning, along
with techniques like transfer learning and explainable AI, holds promise for
further enhancing diagnostic capabilities and accessibility, especially in low-
resource or remote settings.

1.2 MOBILE APPLICATION


Mobile applications are essential tools in modern life, offering easy access
to services and information. In healthcare, they improve accessibility, enabling
real-time monitoring and communication between patients and healthcare
professionals. For diseases like Parkinson’s, mobile apps provide non-invasive,
real-time screening tools for early diagnosis using machine learning models. This
approach enhances healthcare accessibility, enables quicker interventions, and
holds great potential for improving global healthcare delivery.

2
CHAPTER 2
LITERATURE REVIEW

Numerous researchers have explored the application of deep learning and


artificial intelligence for Parkinson’s Disease (PD) detection. An attention-based
multimodal fusion framework using handwriting, drawing patterns, and clinical
data was proposed, achieving 96% accuracy ([Sabrina Benredjem et al.]). A study
using the NIATS dataset applied six deep learning models including ResNet and
ViT with advanced augmentation, achieved 96.67% accuracy ([Yingcong Huang
et al.]). A review of various modalities such as MRI and EEG found that a CNN-
RF hybrid model reached 97% accuracy ([C.R. Dhivyaa et al.]). A hybrid
VGG16-InceptionV3 model enhanced with Gray Wolf Optimization reported
99.94% accuracy for MRI and 100% for DaTscan ([Babita Majhi]). Using speech
data from 3,000 patients, a study showed AlexNet to be most effective with 95%
accuracy ([V. S. Bakkialakshmi]). CNN ensemble models applied to DaTscan
images achieved 98.45% accuracy with a real-time GUI for PD detection ([Ankit
Kurmi et al.]). Facial emotion recognition using CNN models like VGG-16 on
PPMI data yielded 96.5% accuracy ([U. Anusri et al.]).

A comparison between 2D and 3D CNNs on MRI scans showed that 3D


CNNs were more effective, with 88.9% accuracy ([Tarjni Vyas]). A study
focused on feature selection outperformed traditional models using deep learning
on the PPMI dataset with 96.45% accuracy ([Wu Wang et al.]). CNN-based
combinations on UCI data reached 86.9% accuracy ([Hakan Gunduz]). Analysis
of spiral and wave images using DenseNet201 and VGG16 showed high
accuracy—up to 94% for spiral images/drawings ([Aldhyani et al.]). A CNN
model with image augmentation achieved 93.3% accuracy on spiral and wave
drawings, highlighting the importance of expanded datasets ([Himaja G et al.]).

3
Lastly, the use of 3D CNNs for drawing test classification showed superior
accuracy, reached 86.67%, compared to 2D and 1D CNNs ([X. Wang et al.]).
These studies collectively emphasize the promising potential of deep learning
methods in enhancing the accuracy, efficiency, and accessibility of Parkinson’s
Disease diagnosis.

4
CHAPTER 3
SYSTEM ANALYSIS

3.1 EXISTING SYSTEM


Parkinson’s Disease is primarily diagnosed through clinical observation of
motor symptoms such as tremors, rigidity, and slow movement. Additional
methods include medical imaging (like MRI or DaTscan), voice analysis, gait
tracking with wearable sensors, and handwriting analysis using spiral and wave
patterns. Some systems use smart pens or motion sensors to collect detailed motor
data. Traditional machine learning models have also been applied to these
features, but they often require manual feature extraction and lack accuracy. Most
of these methods are either expensive, invasive, or inaccessible in low-resource
settings. There is a need for a portable, automated, and accurate solution that
enables early detection without relying on complex medical equipment.

3.2 PROPOSED SYSTEM


The proposed system introduces an AI-powered approach for early
Parkinson’s Disease detection using hand-drawn spiral and wave images. A
hybrid deep learning model combining InceptionV3 and Transformer layers is
used to extract both local and global features for accurate classification. The
model is trained on the Parkinson’s Hand-Drawn Image Dataset and achieves
high performance in detecting early motor abnormalities. After training, the
model is converted to TensorFlow Lite and integrated into an Android mobile
application. Users can capture or upload images through the app, which provides
real-time predictions. This non-invasive, cost-effective, and portable solution is
designed to assist in remote and early diagnosis, especially in low-resource
environments.

5
3.3 FEASIBILITY STUDY
3.3.1 TECHNICAL FEASIBILITY
The proposed system is technically feasible using current tools and
frameworks. The deep learning model combining InceptionV3 and Transformer
layers can be developed using Python, TensorFlow, and Keras. The trained model
is converted to TensorFlow Lite and integrated into an Android application using
Android Studio. The technologies used are open-source and widely supported,
making implementation and maintenance manageable even with limited
resources.

3.3.2 ECONOMIC FEASIBILITY


This system is economically viable as it primarily uses free and open-
source software tools, reducing development costs. Once deployed, the mobile
app eliminates the need for expensive medical devices or hospital visits for initial
screening. It enables scalable deployment at a low cost, particularly beneficial for
underdeveloped and rural regions. Training costs are minimized using cloud-
based environments like Google Colab.

3.3.3 OPERATIONAL FEASIBILITY


The system is easy to operate and intended for both clinical and personal
use. Users only need to capture or upload an image of a spiral or wave drawing
through the mobile app to receive instant feedback. This reduces dependency on
hospital infrastructure and medical staff for initial screening. The user-friendly
interface and fast prediction make the solution highly practical and acceptable for
real-world use.

6
CHAPTER 4
SYSTEM REQUIREMENTS

4.1 HARDWARE REQUIREMENTS


RAM : 8.00 GB (7.33 GB usable)
Processor : AMD Ryzen 3 5300U with Radeon Graphics
Storage : 512 GB
Monitor : 15’’ Color
System type : 64-bit operating system
Processor speed : 2.60 GHz

4.2 SOFTWARE REQUIREMENTS


Programming Tools : Python, Java, XML
Python Libraries : TensorFlow, Keras, NumPy, OpenCV,
Matplotlib, scikit-learn
Environments : Google Colab, Android Studio, VSCode
Model Deployment : TensorFlow Lite
Mobile Development tools : Android Studio (Java/XML for UI design)
Visualization Tools : Matplotlib, Seaborn
Web Browser : Google Chrome
Operating System : Windows 11 (64-bit)

4.3 SOFTWARE DESCRIPTION:


PYTHON
Python is a high-level, general-purpose programming language known for
its simplicity, readability, and wide range of applications. It supports multiple
programming paradigms, including object-oriented, functional, and procedural
programming. Python is extensively used in fields such as machine learning, data

7
science, artificial intelligence, and web development due to its rich ecosystem of
libraries and frameworks. In this project, Python serves as the core language for
developing and training the hybrid deep learning model combining InceptionV3
and Transformer architectures. It also handles data preprocessing, evaluation, and
visualization. Tools like TensorFlow, Keras, NumPy, and Matplotlib are all
supported seamlessly within the Python environment, making it a powerful
choice for implementing AI-based solutions.

JAVA
Java is the primary programming language used in Android Studio for
building native Android applications. It enables developers to create robust,
secure, and high-performance mobile apps with extensive support for Android
APIs and libraries. In Android Studio, Java handles core functionalities such as
user interface interactions, activity lifecycle management, and data processing.
For this project, Java is used to integrate the TensorFlow Lite model into the
Android app, manage image input from the user, and display the Parkinson’s
disease prediction results. Java’s strong object-oriented structure and
compatibility with Android SDK make it an ideal choice for mobile application
development in Android Studio.

XML
XML (eXtensible Markup Language) is a markup language used to store
and transport data in a structured and human-readable format. In Android
development, XML is primarily used for designing the user interface, including
layouts, widgets, and styling elements. It separates the presentation layer from
the application logic, which is typically written in Java or Kotlin. In this project,
XML is used within Android Studio to create and define the layout of the mobile
application interface, such as buttons, image views, and text views. Its structured

8
format allows for easy customization and scalability of the app's visual
components, making it essential for clean and maintainable UI design.

TensorFlow
TensorFlow is an open-source machine learning framework developed by
Google for building and training deep learning and neural network models. It
provides a comprehensive ecosystem of tools, libraries, and community resources
that allow developers to create scalable and efficient AI models. TensorFlow
supports both CPU and GPU computation, making it suitable for large-scale data
processing and training. In this project, TensorFlow is used to develop and train
a hybrid deep learning model that combines InceptionV3 and Transformer
architectures for Parkinson’s disease diagnosis based on hand-drawn images. Its
compatibility with TensorFlow Lite also enables the deployment of trained
models on mobile devices for real-time predictions.

KERAS
Keras is a high-level neural networks API written in Python that runs on
top of backends like TensorFlow. It simplifies the process of building, training,
and evaluating deep learning models with an intuitive and user-friendly interface.
Keras supports both convolutional and recurrent networks, making it ideal for a
wide range of AI tasks. In this project, Keras is used to define and train the deep
learning architecture combining InceptionV3 and Transformer models. Its
modularity and ease of use accelerate the development of machine learning
models.

NumPy
NumPy (Numerical Python) is a fundamental Python library used for
numerical computing and data manipulation. It provides support for large, multi-
dimensional arrays and matrices, along with a collection of high-level

9
mathematical functions. NumPy is essential for scientific computing and is
widely used in machine learning and data preprocessing. In this project, NumPy
is used to handle and process image data efficiently before feeding it into the deep
learning model. Its speed and efficiency make it a core tool in any AI or data
science workflow.

OpenCV
OpenCV (Open Source Computer Vision Library) is an open-source library
focused on real-time computer vision and image processing tasks. It provides a
wide range of tools for image manipulation, object detection, facial recognition,
and more. In this project, OpenCV is used to preprocess hand-drawn images, such
as resizing, grayscale conversion, and noise removal, before passing them to the
deep learning model. Its flexibility and performance make it a popular choice for
handling visual data in machine learning applications. OpenCV integrates
seamlessly with Python and other AI libraries.

Matplotlib
Matplotlib is a widely used Python library for creating static, animated, and
interactive data visualizations. It allows developers to plot graphs, charts, and
histograms to better understand and present data. In this project, Matplotlib is
used to visualize training accuracy, loss curves, and performance metrics of the
deep learning model. These visualizations help evaluate how well the model is
learning and identifying patterns. Its flexibility and ease of customization make
it essential in data science and machine learning workflows.

scikit-learn
Scikit-learn is a powerful Python library used for machine learning and
data mining. It provides simple and efficient tools for data preprocessing,
classification, regression, clustering, and model evaluation. In this project, scikit-

10
learn is utilized for tasks like data normalization, splitting datasets, and evaluating
model performance using metrics such as accuracy and confusion matrix. Its user-
friendly interface makes it ideal for integrating classical ML techniques alongside
deep learning models. Scikit-learn is widely used in academic and industry
research for rapid prototyping.
Google Colab
Google Colab (Colaboratory) is a free cloud-based development
environment provided by Google that allows users to write and execute Python
code directly from a web browser. It is especially useful for data science, machine
learning, and deep learning projects due to its seamless integration with popular
libraries like TensorFlow, Keras, OpenCV, NumPy, and more. One of its most
valuable features is the free access to powerful GPUs and TPUs, which
significantly accelerates the training of deep learning models. Built on top of
Jupyter Notebook, Google Colab supports code cells, markdown formatting, and
inline visualization, making it easy to write, test, and explain code. It also
integrates with Google Drive, enabling users to store, access, and share notebooks
and datasets conveniently. Multiple users can collaborate in real time, making it
ideal for team-based research and development. In this project, Google Colab is
used to develop and train the combined CNN-Inception and Transformer model
for Parkinson’s disease prediction using hand-drawn images. Its cloud
infrastructure removes hardware limitations and simplifies the overall machine
learning workflow, especially for students and researchers.

Android Studio
Android Studio is the official integrated development environment (IDE)
for Android application development, created by Google. It provides developers
with a powerful and user-friendly platform to build, test, and debug Android apps
using programming languages such as Java and Kotlin. Android Studio includes
a rich set of tools like a visual layout editor, real-time code analysis, an emulator

11
for testing apps on different Android devices, and Gradle-based build support. In
this project, Android Studio is used to design and develop the user interface of
the mobile application that allows users to upload hand-drawn images (spirals
and waves) for Parkinson’s disease diagnosis. It also facilitates the integration of
the TensorFlow Lite model for on-device predictions, providing a seamless and
responsive experience for end users. XML is used for designing layouts, while
Java is used for implementing the backend logic of the app. Android Studio
supports real-time previews and debugging, which helps in rapid development
and troubleshooting. Its compatibility with machine learning libraries and
Android APIs makes it ideal for deploying AI-based health monitoring apps like
this one.

12
CHAPTER 5
SYSTEM DESIGN

5.1 DATA FLOW DIAGRAM

Fig.1: Data Flow Diagram of PD Detection

13
CHAPTER 6
SYSTEM DESCRIPTION

6.1 PROJECT DESCRIPTION


This project focuses on the early detection of Parkinson’s disease using a
deep learning-based approach that analyses hand-drawn spiral and wave images.
Parkinson’s disease is a progressive neurodegenerative disorder that primarily
affects motor functions, and early diagnosis can greatly improve the quality of
life for patients. Traditional diagnosis methods involve clinical observation and
motor tests, which can be time-consuming and subjective. This project aims to
provide an automated, accurate, and portable diagnosis tool using Artificial
Intelligence (AI).

A hybrid model combining Inception-based Convolutional Neural


Networks (CNN) and Transformer architecture is developed to capture both local
spatial features and global dependencies within the images. The dataset used
contains spiral and wave drawings from individuals with and without Parkinson’s
disease. These images undergo preprocessing steps such as resizing,
normalization, and augmentation to ensure consistency and improve training
effectiveness.

The trained model is then optimized and converted into TensorFlow Lite
(TFLite) format for efficient deployment on mobile devices. An Android
application is developed using Android Studio, where users can upload spiral or
wave images for real-time prediction. The app runs the TFLite model and displays
the result indicating whether Parkinson’s disease is detected. This system is
designed to be lightweight, user-friendly, and accessible, offering a cost-effective
tool for preliminary screening.

14
It empowers users and healthcare professionals with a smart and fast
solution, especially in remote or resource-limited areas, where access to
neurologists and diagnostic tools may be limited. The application enables early
detection and monitoring of Parkinson’s disease, potentially leading to faster
medical intervention and improved patient outcomes. By leveraging deep
learning and mobile technology, this system bridges the gap between advanced
diagnostics and everyday accessibility. It also ensures offline functionality,
allowing predictions without internet dependency. The project demonstrates how
AI-powered healthcare tools can significantly enhance medical services and
support timely disease management even beyond clinical environments.

6.2 MODULE DESCRIPTION


MODULES:
6.2.1 Get Dataset
6.2.2 Dataset Preprocessing
6.2.3 Splitting the Dataset
6.2.4 Applying CNN Model with Transformer Layer
6.2.5 Prediction Accuracy
6.2.6 Visualization
6.2.7 Convert into Mobile App

6.2.1 DATASET DESCRIPTION


The dataset used in this project consists of hand-drawn spiral and wave
images, sourced from Parkinson’s disease research studies and publicly available
datasets that focus on motor symptom analysis. These images are typically
collected from clinical trials involving both Parkinson’s patients and healthy
individuals. The primary goal of the dataset is to assist in the early detection of
Parkinson’s disease by analyzing motor impairments through hand-drawn
patterns. Spiral and wave drawings are particularly effective in capturing tremors

15
and movement irregularities that are indicative of the condition. The dataset is
structured into folders based on class labels Parkinson and Non-Parkinson with
each instance being an image file (usually in .png or .jpg format) resized to
128×128 pixels. These images are preprocessed and used as input to deep learning
models for classification tasks.

Fig.2: Sample Images of PD Dataset

6.2.2 DATASET PREPROCESSING


Dataset augmentation is a technique used to expand the size and diversity
of a dataset by applying transformations like rotation, flipping, and zooming to
original images. In this project, it enhances the deep learning model’s ability to
generalize by exposing it to varied patterns in hand-drawn spiral and wave
images. This reduces overfitting and helps the model learn more robust features
for accurate Parkinson’s disease classification.

16
Classes Count (Before) Count (After)
Spiral Healthy 51 408
Spiral Parkinson 51 408
Wave Healthy 51 408
Wave Parkinson 51 408
Table 1: Dataset count before and after augmentation

Dataset preprocessing is the process of transforming raw image data into a


clean and structured format suitable for training a deep learning model. In this
project, preprocessing is a crucial step to ensure that all hand-drawn spiral and
wave images are standardized, relevant, and optimized for input into a
Convolutional Neural Network (CNN) combined with a Transformer module.

Processing Techniques Values


Rescale 1./255
Rotation range 20
Width shift range 0.2
Height shift range 0.2
Shear range 0.2
Zoom range 0.2
Horizontal flip True
Fill mode nearest
Table 2: Preprocessing Techniques

17
6.2.3 SPLITTING THE DATASET
Splitting the dataset is an essential step in preparing data for building an effective
deep learning model. In this project, the dataset is divided into two main parts:
training and testing datasets. The training set is used to teach the model by
allowing it to learn from known examples, while the testing set is used to evaluate
the model’s performance on new, unseen data. This separation helps in measuring
the accuracy and generalization ability of the model. A common split ratio is 80%
for training and 20% for testing, though it can be adjusted depending on the
dataset size.

Classes Count (Before) Count (After)


Spiral Healthy Training: 36 Training: 288
Testing: 15 Testing: 120
Spiral Parkinson Training: 36 Training: 288
Testing: 15 Testing: 120
Wave Healthy Training: 36 Training: 288
Testing: 15 Testing: 120
Wave Parkinson Training: 36 Training: 288
Testing: 15 Testing: 120
Table 3: Splitting the Dataset

6.2.4 APPLYING CNN MODEL WITH TRANSFORMER


INCEPTION V3
InceptionV3 is a deep convolutional neural network developed by Google
for efficient and accurate image classification. It utilizes Inception modules with
parallel filter sizes to capture features at different scales, enhancing its ability to
recognize complex patterns. The model incorporates techniques like factorized
convolutions, batch normalization, and auxiliary classifiers to improve training
efficiency and generalization. Widely used in medical imaging and other fields,
18
InceptionV3 excels in tasks requiring precise image analysis. Its ability to handle
large datasets and provide high performance makes it suitable for real-time or
embedded applications.

TRANSFORMER
A Transformer is a deep learning model that uses self-attention
mechanisms, originally designed for NLP tasks but now widely adopted for image
tasks. Unlike RNNs, Transformers process data in parallel, capturing contextual
relationships and long-range dependencies efficiently. In vision tasks, the model
breaks down images into smaller patches, analyzing them individually and in
relation to each other. This allows the model to understand global structures and
long-range interactions. Transformers excel in image classification,
segmentation, and object detection, benefiting from parallel training that speeds
up processing and improves scalability.

COMBINATION OF INCEPTION V3 AND TRANSFORMER


The combination of InceptionV3 and Transformer models brings together
the strengths of both architectures to create a highly effective system for complex
image classification tasks. InceptionV3 excels at extracting hierarchical features
through its multi-sized convolutional filters, allowing it to capture both local and
global patterns within an image. The Transformer, with its self-attention
mechanism, processes the extracted features to understand long-range
dependencies and contextual relationships between distant parts of the image.
This synergy enables the model to not only detect fine-grained details but also
grasp global structures and interactions across the image, which is crucial for
tasks like object detection and segmentation. Additionally, Transformers are
capable of parallel processing, making the combined model more scalable and
efficient, especially for large datasets. By merging InceptionV3's feature
extraction prowess with the global context modeling of Transformers, the hybrid

19
model achieves improved accuracy, robustness, and generalization, making it
highly suitable for advanced computer vision applications.

Fig.3: Architecture Diagram

6.2.5 PREDICTION ACCURACY


Prediction accuracy is a metric used to evaluate the performance of a
machine learning model by measuring the proportion of correct predictions made
by the model compared to the total number of predictions. It is expressed as a
percentage and is calculated by dividing the number of correct predictions by the
total number of predictions. High prediction accuracy indicates that the model is
making correct predictions most of the time, but it may not always reflect
performance in cases where the dataset is imbalanced.

6.2.6 VISUALIZATION
Visualization in the context of machine learning refers to the graphical
representation of data, model performance, or results to help interpret and

20
understand complex information. It involves creating charts, graphs, and plots to
make the underlying patterns, trends, and relationships in the data or model
outputs more accessible. Visualization tools, like confusion matrices, ROC
curves, and loss/accuracy graphs, help to evaluate and improve the model by
providing insights into its behaviour, performance, and errors. In deep learning,
visualization is also used to track training progress and optimize model
parameters.

CONFUSION MATRIX
A Confusion Matrix is a table used to evaluate the performance of a
classification model. It shows how many predictions were correct and how many
were incorrect, broken down by each class. The matrix helps to identify the types
of errors made by the model, such as false positives and false negatives, and is
used to calculate important metrics like accuracy, recall, and precision.

RECALL
Recall (also known as Sensitivity or True Positive Rate) is a performance
metric that measures how effectively a classification model identifies positive
instances. It indicates the proportion of actual positive cases that the model
correctly predicts. A high recall value means the model is good at identifying most
of the positive instances, minimizing the number of false negatives.

SPECIFICITY
Specificity (also known as the True Negative Rate) is a performance metric
that measures how well a classification model identifies negative instances. It
calculates the proportion of actual negative cases that are correctly identified as
negative by the model. A high specificity value means the model effectively
avoids false positives and correctly classifies the negative instances.

21
F1 SCORE
F1 Score is a performance metric that combines both precision and recall
into a single value. It is the harmonic mean of precision and recall, providing a
balance between the two metrics. The F1 score is especially useful when the
dataset has an imbalanced class distribution, as it takes both false positives and
false negatives into account. A high F1 score indicates that the model performs
well in both identifying positive cases (high recall) and minimizing false positives
(high precision).

6.2.7 CONVERTING INTO MOBILE APP


Converting into a Mobile App involves taking a trained machine learning
model and integrating it into a mobile application for real-time predictions. In this
project, after training the model, it is converted into TensorFlow Lite (TFLite)
format to optimize it for mobile devices. The TFLite model is then integrated into
an Android app using Android Studio, allowing users to upload images (such as
spiral or wave drawings) from their device. The app processes these images, runs
the TFLite model for prediction, and displays the results, indicating whether
Parkinson's disease is detected or not. This process makes it possible for users to
perform diagnosis tasks directly from their mobile devices.

COLAB
Google Colab (short for Colaboratory) is a free cloud-based platform
provided by Google that allows users to write and execute Python code in an
interactive environment. It is particularly useful for machine learning and data
analysis tasks, as it provides access to powerful computational resources, without
the need for any setup. Colab supports Jupyter notebooks, enabling users to
document their code, visualize data, and share their work easily. It integrates

22
seamlessly with Google Drive, making it convenient for storing and collaborating
on projects.

TFLite
TensorFlow Lite is a lightweight version of TensorFlow, specifically
designed for mobile and embedded devices. It enables the deployment of machine
learning models on mobile platforms such as Android and iOS, providing
efficient inference with low latency and reduced memory usage. TensorFlow Lite
optimizes models for performance, making it possible to run deep learning
algorithms directly on mobile devices without requiring a constant internet
connection. It supports a wide range of operations and is designed to work
seamlessly on various mobile and edge devices, enabling real-time predictions
with minimal computational resources.

ANDROID STUDIO
Android Studio is an integrated development environment (IDE) for
developing Android applications. It is the official IDE for Android development,
provided by Google, and is based on IntelliJ IDEA. Android Studio offers
powerful tools for building, testing, and debugging Android apps. It provides
features such as code completion, a visual layout editor, real-time code analysis,
and an emulator for testing apps on various Android devices. Android Studio also
supports Java, Kotlin, and C++ for app development, making it a versatile tool
for creating mobile applications

23
CHAPTER 7
REVIEW & DISCUSSION

The proposed model combines InceptionV3 with a Transformer layer to


effectively classify hand-drawn spiral and wave images for Parkinson’s Disease
detection. This hybrid architecture leverages the CNN’s strength in capturing
local visual features and the Transformer’s ability to model long-range spatial
relationships across the image. While the model showed strong performance
during training, the validation results revealed a gap, suggesting possible
overfitting due to the limited dataset size. As a result, evaluation metrics like
recall, F1-score, and specificity were relatively lower, reflecting the model’s
challenge in generalizing to unseen data. This limitation highlights the
importance of a larger and more diverse dataset, along with techniques like data
augmentation, to improve model robustness and accuracy in real-world scenarios.

Model Dataset Epochs Accuracy Loss

Train Val Train Val


PD Dataset
Inception V3 (Spiral 35 0.9956 0.8080 0.0094 0.8510
+ Image)
Transformer PD Dataset
Layer (wave 35 0.9794 0.8348 0.0463 0.9408
Image)
Table 4: Model Performance

The Inception V3 + Transformer Layer model was evaluated on the


Parkinson's Disease (PD) dataset using both Spiral and Wave images over 35
epochs. For the Spiral Image dataset, the model achieved a high training accuracy

24
of 99.56% but had a notable drop in validation accuracy to 80.80%, with a very
low training loss of 0.0094 and a significantly higher validation loss of 0.8510,
indicating potential overfitting. On the Wave Image dataset, the model showed
slightly lower training accuracy at 97.94% and a better validation accuracy of
83.48%, but the training loss of 0.0463 and validation loss of 0.9408 still revealed
a performance gap between training and validation data. These results suggest
that while the model performs well on training data, it struggles to generalize
effectively, highlighting the need for methods to reduce overfitting, such as data
augmentation, regularization, or further optimization of the model's architecture.

Model Dataset Epochs Performance Metrics


Recall Specificity F1 - Score
PD Dataset
Inception V3 (Spiral 35 0.5125 0.5125 0.5063
+ Image)
Transformer PD Dataset
Layer (Wave 35 0.5125 0.5125 0.5123
Image)
Table 5: Performance Metrics

The performance of the Inception V3 + Transformer Layer model was


evaluated on the Parkinson's Disease (PD) dataset using both Spiral and Wave
images over 35 epochs. For the Spiral Image dataset, the model achieved a recall
of 0.5125, specificity of 0.5125, and an F1-score of 0.5063. When tested on the
Wave Image dataset, the model's performance remained consistent, with a recall
of 0.5125, specificity of 0.5125, and an F1-score of 0.5123. These results
demonstrate a similar performance across both types of images, highlighting the
stability of the model across different input types.

25
The low F1 score, recall, and specificity are mainly due to having a small
number of images in the dataset. With fewer images, the model cannot learn
enough patterns to accurately tell the difference between healthy and Parkinson’s
cases. This makes it hard for the model to correctly identify positive and negative
samples, leading to poor performance. Also, the model might do well during
training but fail on new data, which is a sign of overfitting caused by limited data.

The developed mobile application for Parkinson’s disease detection is able


to classify hand-drawn spiral and wave images as either normal or showing signs
of the disease. The app provides an easy-to-use interface where users can choose
the type of drawing, upload an image from the camera or gallery, and submit it
for prediction. During testing, the app correctly identified both normal and
abnormal drawings based on their patterns. Smooth and regular shapes were
recognized as normal, while shaky or uneven drawings were marked as signs of
the disease. The results show that the model used in the app is effective in
detecting common motor symptoms related to Parkinson’s disease. The mobile
design makes the system accessible and convenient, especially for early screening
at home. However, more testing with a wider range of images is suggested to
improve the accuracy and reliability of the predictions.
26
CHAPTER 8
SYSTEM IMPLEMENTATION AND MAINTENANCE

System implementation is the phase where the developed system is


deployed in a real-world environment and made operational. In this project, the
trained hybrid model combining InceptionV3 and Transformer is converted into
a TensorFlow Lite (TFLite) model for mobile deployment. The Android
application is developed using Android Studio, allowing users to upload spiral
and wave images for real-time Parkinson's disease detection.

8.1 DATA COLLECTION AND PREPROCESSING


The implementation phase begins with collecting a suitable dataset of
hand-drawn spiral and wave images related to Parkinson’s disease. These images
are acquired from publicly available datasets used for motor disorder analysis.
Preprocessing steps such as image resizing (to 128×128 pixels), grayscale
conversion, and normalization are applied to standardize the input. Additionally,
data augmentation techniques like rotation, zoom, shear, and flipping are used to
increase data variability and improve model generalization.

8.2 MODEL DEVELOPMENT


The model is developed by combining the InceptionV3 architecture with a
Transformer module. InceptionV3 is used for efficient feature extraction from the
preprocessed images, while the Transformer is incorporated to enhance global
context understanding. The model is trained using a supervised learning
approach, and performance metrics such as accuracy, recall, precision, and F1-
score are evaluated to determine the model’s effectiveness.

27
8.3 MOBILE APPLICATION DEVELOPMENT
To improve accessibility, a user-friendly mobile application is developed
using Android Studio. The mobile app allows users to upload hand-drawn spiral
or wave images directly from their device. It integrates the optimized TensorFlow
Lite model to provide on-device predictions, making it possible for users to
receive real-time diagnostic results without requiring an internet connection.

8.4 DEPLOYMENT
For deployment, the trained model is converted to TensorFlow Lite
(TFLite) format to reduce size and optimize performance. This lightweight model
is integrated into the Android application, enabling real-time inference on mobile
devices. The app is designed to work efficiently even in low-resource
environments, offering an accessible solution for early Parkinson’s screening.

8.5 MAINTENANCE
The system is designed to be modular and scalable, allowing for easy
updates and maintenance. Future improvements may include expanding the
dataset, retraining the model for higher accuracy, or enhancing the mobile app's
user interface. Regular updates and monitoring ensure that the system remains
functional and effective in real-world use cases.

28
CHAPTER 9
CONCLUSION

The project titled “TRANSFER LEARNING AND DEEP LEARNING


INTEGRATED FRAMEWORK FOR PARKINSON’S DISEASE
DIAGNOSIS USING HAND – DRAWN DATASET” presents an innovative
approach to early-stage diagnosis of Parkinson’s disease by leveraging deep
learning techniques. By utilizing spiral and wave drawings that reflect motor
function irregularities, the system accurately classifies the likelihood of
Parkinson’s through image-based analysis.
A hybrid deep learning model combining InceptionV3 and Transformer
architectures was developed and trained on preprocessed image datasets,
achieving a validation accuracy of 80.80% for spiral images and 83.48% for wave
images. The model demonstrated high training accuracy (above 99%), confirming
its robustness, and was subsequently optimized and converted into TensorFlow
Lite format, making it lightweight and suitable for mobile deployment.

The final output was integrated into an Android application, allowing users
to upload hand-drawn images directly from their phones for real-time predictions.
This provides a cost-effective, accessible, and user-friendly tool, particularly
useful in rural or resource-constrained environments where specialist diagnosis
may not be readily available.

In conclusion, this mobile-based diagnostic system not only enhances early


detection and monitoring of Parkinson’s disease but also represents a significant
advancement in applying AI to real-world healthcare challenges. Continuous
improvements, expanded datasets, and clinical validation will further strengthen
its reliability and practical impact.

29
CHAPTER 10
FUTURE ENHANCEMENT

While the current system successfully detects Parkinson’s disease using


hand-drawn spiral and wave images through a mobile application, there is still
ample scope for further improvement and expansion. Future enhancements may
include integrating more diverse datasets with additional drawing types or motor
tasks to improve model robustness and generalizability across a wider population.

Another potential advancement is incorporating real-time drawing capture


within the mobile app itself, allowing users to draw directly on the screen rather
than uploading pre-scanned images. This would improve usability and streamline
the prediction process.

The app can also be extended with patient management features such as
report generation, history tracking, and reminders for follow-up assessments.
Additionally, integration with cloud storage and health record systems can
enhance accessibility and data sharing between patients and healthcare providers.

Lastly, the model can be trained using federated learning to ensure user
privacy while still allowing the model to improve over time. With continuous
development and collaboration with medical experts, this mobile solution can
evolve into a powerful diagnostic aid for early and accessible Parkinson’s disease
detection.

30
BIBLIOGRAPHY

1. [Link]
2. [Link]
3. [Link]
[Link]://[Link]/Yuvnish017/Parkinsons_Disease_Detection_using_Parkins
ons_Spiral_Drawing
5. [Link]
6. [Link] learning classification [Link]
7. [Link]
8. [Link]
9. [Link]
10. [Link]
11. Yousif, N. R., Balaha, H. M., Haikal, A. Y., & El-Gendy, E. M. (2023). A
generic optimization and learning framework for Parkinson’s disease via
speech and handwritten records. Journal of Ambient Intelligence and
Humanized Computing, 14, 10673–10693
12. X. Wang, J. Huang, S. Nõmm, M. Chatzakou, K. Medijainen, A. Toomela,
and M. Ruzhansky, “LSTM-CNN: An efficient diagnostic network for
Parkinson’s disease utilizing dynamic handwriting analysis,” arXiv preprint
arXiv:2311.11756, 2023.
13. Majhi, B., Kashyap, A., Mohanty, S. S., Dash, S., Mallik, S., Li, A., & Zhao,
Z. (2024). An improved method for diagnosis of Parkinson’s disease using deep
learning models enhanced with metaheuristic algorithm. BMC Medical
Imaging, 24(156). [Link]
14. [Link]

31
APPENDIX
APPENDIX A – Sample Source Code
Colab code:
from IPython import get_ipython
from [Link] import display
# %%
import tensorflow as tf
from [Link] import InceptionV3
from [Link] import Model
from [Link] import Dense, Dropout, GlobalAveragePooling2D,
LayerNormalization, MultiHeadAttention, Layer, Reshape
from [Link] import ImageDataGenerator
from [Link] import Adam
import numpy as np
import os
from [Link] import load_model
from [Link] import drive

@[Link].register_keras_serializable(package="Custom")
class TransformerBlock(Layer):
def __init__(self, embed_dim, num_heads, ff_dim, dropout_rate=0.1,
**kwargs): # Add **kwargs
super(TransformerBlock, self).__init__(**kwargs) # Pass **kwargs to
super()
[Link] = MultiHeadAttention(num_heads=num_heads,
key_dim=embed_dim // num_heads) # Fix key_dim
self.norm1 = LayerNormalization(epsilon=1e-6)
self.norm2 = LayerNormalization(epsilon=1e-6)

32
self.dropout1 = Dropout(dropout_rate)
self.dropout2 = Dropout(dropout_rate)
[Link] = [Link]([
Dense(ff_dim, activation='relu'),
Dense(embed_dim)
])

def call(self, inputs):


attention_output = [Link](inputs, inputs)
attention_output = self.dropout1(attention_output)
out1 = self.norm1(inputs + attention_output)

ffn_output = [Link](out1)
ffn_output = self.dropout2(ffn_output)
return self.norm2(out1 + ffn_output)

def get_config(self): # Define get_config to handle trainable


config = super(TransformerBlock, self).get_config()
[Link]({
'embed_dim': [Link].key_dim * [Link].num_heads, # Get
embed_dim from attention layer
'num_heads': [Link].num_heads,
'ff_dim': [Link][0].units, # Get ff_dim from ffn layer
})
return config

# %%
# Model Creation

33
base_model = InceptionV3(weights='imagenet', include_top=False,
input_shape=(128, 128, 3))

# Unfreeze last 30 layers for fine-tuning


for layer in base_model.layers[-30:]:
[Link] = True

x = base_model.output
x = GlobalAveragePooling2D()(x) # Convert CNN features to 1D vector
x = Reshape((1, [Link][-1]))(x) # Ensure correct reshape

# Transformer Layer
transformer_layer = TransformerBlock(embed_dim=[Link][-1], num_heads=4,
ff_dim=4096)
x = transformer_layer(x)
x = Reshape(([Link][-1],))(x) # Convert back to 2D

# Fully Connected Layers


x = Dense(256, activation='relu')(x)
x = Dropout(0.5)(x)
output = Dense(4, activation='softmax')(x) # Output layer for 4 classes

# Create Final Model


model = Model(inputs=base_model.input, outputs=output)
[Link](optimizer=Adam(learning_rate=0.0001),
loss='categorical_crossentropy', metrics=['accuracy'])
[Link]()

# Image Augmentation

34
train_datagen = ImageDataGenerator(
rescale=1./255
)

test_datagen = ImageDataGenerator(rescale=1./255)

# Dataset Paths
train_path = '/content/drive/MyDrive/Drawingdata_aug/train_aug'
test_path = '/content/drive/MyDrive/Drawingdata_aug/test_aug'

# Load Datasets
training_set = train_datagen.flow_from_directory(
train_path, target_size=(128, 128), batch_size=32, class_mode='categorical'
)

test_set = test_datagen.flow_from_directory(
test_path, target_size=(128, 128), batch_size=32, class_mode='categorical'
)

print("Training class labels:", training_set.class_indices)


print("Validation class labels:", test_set.class_indices)

history = [Link](
training_set,
steps_per_epoch=len(training_set),
epochs=10,
validation_data=test_set,
validation_steps=test_set.samples // test_set.batch_size
)

35
y_pred_probs = [Link](test_set)

# Convert probabilities to class predictions


y_pred = [Link](y_pred_probs, axis=1)

# Define class labels (Update based on dataset)


class_labels = ["Spiral Healthy", "Spiral Parkinson", "Wave Healthy", "Wave
Parkinson"]

# Compute Confusion Matrix


cm = confusion_matrix(y_true, y_pred)

# Select only "Healthy" and "Parkinson" (combining Spiral & Wave)


healthy_indices = [0, 2] # Indices for Spiral Healthy & Wave Healthy
parkinson_indices = [1, 3] # Indices for Spiral Parkinson & Wave Parkinson

# Summing up values for combined categories


healthy_true = cm[healthy_indices, :].sum(axis=0)
parkinson_true = cm[parkinson_indices, :].sum(axis=0)

# Creating a 2x2 confusion matrix


cm_combined = [Link]([
[healthy_true[healthy_indices].sum(),
healthy_true[parkinson_indices].sum()],
[parkinson_true[healthy_indices].sum(),
parkinson_true[parkinson_indices].sum()]
])

# Plot Confusion Matrix (Healthy vs. Parkinson)

36
[Link](figsize=(5, 4))
[Link](cm_combined, annot=True, fmt='d', cmap='Blues',
xticklabels=["Healthy", "Parkinson"], yticklabels=["Healthy", "Parkinson"])
[Link]("Predicted Label")
[Link]("True Label")
[Link]("Confusion Matrix (Healthy vs. Parkinson)")
[Link]()

from [Link] import mean_squared_error

# Get true labels (actual values) and predicted values


y_train_true = training_set.classes # Ensure this is defined
y_train_pred_probs = [Link](training_set) # Get predictions
y_train_pred = y_train_pred_probs.argmax(axis=1) # Convert to class labels

# Calculate Training MSE


train_mse = mean_squared_error(y_train_true, y_train_pred)
print(f"Training MSE: {train_mse:.4f}")

from [Link] import recall_score

recall = recall_score(y_true, y_pred, average='macro') # Use 'macro' for overall


recall
print(f"Recall: {recall:.4f}")

from [Link] import confusion_matrix


import numpy as np

# Compute confusion matrix

37
cm = confusion_matrix(y_true, y_pred)

# Calculate specificity for each class


specificity_per_class = []
for i in range([Link][0]):
tn = [Link](cm) - (cm[i, :].sum() + cm[:, i].sum() - cm[i, i])
fp = cm[:, i].sum() - cm[i, i]
specificity = tn / (tn + fp)
specificity_per_class.append(specificity)

# Calculate overall specificity


overall_specificity = [Link](specificity_per_class)
print(f"Specificity: {overall_specificity:.4f}")

from [Link] import mean_squared_error

# Compute MSE
mse = mean_squared_error(y_true, y_pred)
print(f"MSE: {mse:.4f}")

from [Link] import f1_score

# Assuming y_true contains actual labels and y_pred contains predicted labels
f1 = f1_score(y_true, y_pred, average='weighted') # Use 'weighted' for
multiclass classification
print(f"F1 Score: {f1:.4f}")

from [Link] import precision_score

38
import numpy as np
import cv2
import os
import [Link] as plt
from [Link] import files
from [Link] import load_model

# Step 2: Load the Saved Model from Google Drive


model_path = "/content/drive/MyDrive/saved_models/[Link]" #
Update your model path
model = load_model(model_path)
print("✅ Model Loaded Successfully!")

# Step 3: Define Class Labels (Update Based on Your Dataset)


class_labels = ["Spiral Healthy", "Spiral Parkinson", "Wave Healthy", "Wave
Parkinson"]

# Step 4: Function to Preprocess Image


def preprocess_image(image_path):
IMG_SIZE = (128, 128) # Update based on your model input size
img = [Link](image_path) # Load image
img = [Link](img, cv2.COLOR_BGR2RGB) # Convert to RGB
img = [Link](img, IMG_SIZE) # Resize to match model input size
img = img / 255.0 # Normalize pixel values (0-1)
img = np.expand_dims(img, axis=0) # Add batch dimension
return img

# Step 5: Function to Predict Class from Uploaded Image


def predict_image(image_path):
39
processed_img = preprocess_image(image_path) # Preprocess image
prediction = [Link](processed_img) # Get prediction probabilities
predicted_class = [Link](prediction) # Get class index with highest
probability

result = class_labels[predicted_class] # Map index to class label

# Display Image with Prediction


[Link]([Link](image_path)[:, :, ::-1]) # Convert BGR to RGB for
correct display
[Link]('off')
[Link](f"Prediction: {result}", fontsize=14)
[Link]()

return result

# Step 6: Upload an Image from Device


uploaded = [Link]() # Opens a file uploader in Colab

# Step 7: Run Prediction on Uploaded File


for filename in [Link]():
print(f"\n📂 Uploaded file: {filename}")

# Predict & Display Result


result = predict_image(filename)
print(f"🔍 Prediction: {result}")

40
Appendix B – Screenshots

41
42
MOBILE APPLICATION

43
44

You might also like