Project Report
Project Report
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)
APRIL 2025
BONAFIDE CERTIFICATE
First and foremost, I would like to thank the Almighty for blessing me with
physical and mental strength for doing this project.
(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
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.
2
CHAPTER 2
LITERATURE REVIEW
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
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.
6
CHAPTER 4
SYSTEM REQUIREMENTS
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
13
CHAPTER 6
SYSTEM DESCRIPTION
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.
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.
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
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.
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.
19
model achieves improved accuracy, robustness, and generalization, making it
highly suitable for advanced computer vision applications.
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).
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
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.
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.
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 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.
29
CHAPTER 10
FUTURE ENHANCEMENT
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)
])
ffn_output = [Link](out1)
ffn_output = self.dropout2(ffn_output)
return self.norm2(out1 + ffn_output)
# %%
# Model Creation
33
base_model = InceptionV3(weights='imagenet', include_top=False,
input_shape=(128, 128, 3))
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
# 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'
)
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)
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]()
37
cm = confusion_matrix(y_true, y_pred)
# Compute MSE
mse = mean_squared_error(y_true, y_pred)
print(f"MSE: {mse:.4f}")
# 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}")
38
import numpy as np
import cv2
import os
import [Link] as plt
from [Link] import files
from [Link] import load_model
return result
40
Appendix B – Screenshots
41
42
MOBILE APPLICATION
43
44