ProjectReport CNNFinal
ProjectReport CNNFinal
Dissertation submitted to
Shri Ramdeobaba College of Engineering & Management, Nagpur
in partial fulfillment of requirement for the award of degree of
i
Signature Verification System Using CNN
Dissertation submitted to
Shri Ramdeobaba College of Engineering & Management, Nagpur
in partial fulfillment of requirement for the award of degree of
ii
SHRI RAMDEOBABA COLLEGE OF ENGINEERING MANAGEMENT, NAGPUR
(An Autonomous Institute affiliated to Rashtrasant Tukdoji Maharaj Nagpur University Nagpur)
CERTIFICATE
This is to certify that the Thesis on “ Signature Verification System Using CNN” is a
Bonafide work of Anup Dhoble, Ankit Bhardwaj, Ajay Mahato, Suhani Taran submitted to
the Rashtrasant Tukdoji Maharaj Nagpur University, Nagpur in partial fulfillment of the
award of a Degree of Bachelor of Technology (B.Tech), in Computer Science and
Engineering. It has been carried out at the Department of Computer Science and Engineering,
Shri Ramdeobaba College of Engineering and Management, Nagpur during the academic
year 2023-2024.
Date:
Place: Nagpur
______________________ ________________
Prof.Bhagyashree Madan Dr. R. Hablani
Project Guide H.O.D
Department of Computer Science Department of Computer Science
and Engineering and Engineering
_______
Dr. R. S. Pande
Principal
iii
DECLARATION
We hereby declare that the thesis titled “Signature Verification System Using CNN”
submitted herein, has been carried out in the Department of Computer Science and
Engineering of Shri Ramdeobaba College of Engineering and Management, Nagpur. The
work is original and has not been submitted earlier as a whole or part for the award of any
degree/diploma at this or any other institution / University.
Date:
Place: Nagpur
Sign
Anup Dhoble
Ankit Bhardwaj
Ajay Mahato
Suhani Taran
iv
APPROVAL SHEET
This report entitled “Signature Verification System Using CNN” by Anup Dhoble, Ankit
Bhardwaj, Ajay Mahato, Suhani Taran is approved for the degree of Bachelor of
Technology (B.Tech).
______________________ ______________________
Prof.Bhagyashree Madan
Project Guide External Examiner
_______________
Dr. R. Hablani
H.O.D, CSE
Date:
Place: Nagpur
v
ACKNOWLEDGEMENTS
We would like to express our deepest appreciation and gratitude to all those who contributed
to the successful completion of this project, both directly and indirectly.
First and foremost, we extend our heartfelt thanks to our esteemed project guide, Prof.
Bhagyashree S. Madan, for her invaluable guidance, unwavering support, and profound
insights throughout the duration of this endeavor. Prof. Bhagyashree S. Madan's mentorship,
expertise, and dedication played a pivotal role in shaping the direction of our research and
fostering an environment of excellence.
We are immensely grateful to our diligent and dedicated team members, Anup Dhoble, Ankit
Bhardwaj, Ajay Mahato, and Suhani Taran, whose collaborative efforts, synergy, and
commitment were integral to the successful execution of this project. Each member's unique
skills, tireless efforts, and unwavering enthusiasm significantly enriched our work and
propelled us towards achieving our objectives.
Furthermore, we would like to express our gratitude to the participants who generously
contributed their time and signatures, thereby enabling the creation of a comprehensive and
diverse dataset essential for the development and evaluation of our signature verification
system.
vi
ABSTRACT
In an era marked by rapid technological advancement and evolving security threats, the
demand for robust authentication systems is paramount. This thesis presents the development
Signatures are pivotal for personal identification in legal, financial, and administrative
contexts, demanding meticulous scrutiny to prevent forgery. Our system, built on the Django
procedures.
Utilizing CNNs, our system compares two images – an original and a comparison signature –
security.
vii
TABLE OF CONTENTS
Cover Page i
Cover Page ii
Certificate iii
Declaration iv
Approval Sheet v
Acknowledgements vi
Abstract vii
List of figures x
Chapter 1. Introduction 1
1.1 Background 1
1.2 Motivation 1
1.3 Objectives 1
Chapter 3. Methodology 4
viii
4.2 Signature Extraction 6
8.1 Conclusion 19
List of Publications 20
References 21
Appendices 22
ix
LIST OF FIGURES
1. Preprocessing of Signatures 7
x
CHAPTER 1
INTRODUCTION
______________________________________________________________________
1.1 Background
1.2 Motivation
The increasing prevalence of document forgery and falsification poses significant challenges
to the integrity and security of legal and financial transactions. Manual signature verification
processes are often time-consuming, subjective, and prone to human error, making them
inadequate for detecting sophisticated forgery techniques. Moreover, as technology evolves,
the sophistication of forgery methods continues to escalate, further underscoring the need for
automated and reliable signature verification systems. Therefore, there is a pressing need to
develop an efficient and accurate signature verification system that can mitigate the risks
associated with document fraud and ensure the integrity of important transactions.
1.3 Objectives
The primary goal of this project is to develop a robust signature verification system utilizing
Convolutional Neural Networks (CNNs) within the Django framework. Specifically, the
objectives of the project include:
1
CHAPTER 2
LITERATURE REVIEW
______________________________________________________________________
Image processing techniques involve preprocessing signature images to enhance features and
extract relevant information for analysis. These techniques may include grayscale conversion,
noise reduction, and edge detection algorithms. Additionally, feature extraction methods such
as Histogram of Oriented Gradients (HOG) and Scale-Invariant Feature Transform (SIFT)
have been employed to capture distinctive characteristics of signatures.
2
identify sophisticated forgery techniques, making it challenging to detect fraudulent
signatures accurately.
Furthermore, manual verification methods are limited in their ability to handle variations in
handwriting styles and signatures across different individuals. As signatures can evolve over
time and exhibit natural variations, manual inspectors may struggle to differentiate between
genuine variations and forged signatures. Consequently, relying solely on manual verification
methods may leave documents vulnerable to undetected forgery, compromising the integrity
of legal and financial transactions.
Recent advancements in deep learning, particularly CNNs, have paved the way for innovative
approaches to signature verification. Several studies have explored the effectiveness of
CNN-based models in automatically authenticating handwritten signatures. These models are
trained on large datasets of genuine and forged signature images, allowing them to learn
discriminative features and patterns indicative of genuine signatures.
3
CHAPTER 3
METHODOLOGY
______________________________________________________________________
The process of collecting and preparing signature images for training the models involves
several steps to ensure the availability of a diverse and representative dataset. Firstly, a
dataset containing genuine and forged signature images is compiled from various sources,
including public repositories, legal documents, and financial records. Care is taken to include
signatures from different individuals with varying handwriting styles and characteristics.
Once the dataset is curated, preprocessing techniques are applied to standardize and enhance
the quality of the signature images. This typically includes steps such as grayscale
conversion, noise reduction, and normalization to ensure consistency across images.
Additionally, data augmentation techniques may be employed to increase the variability of
the dataset, such as rotation, scaling, and translation, to simulate real-world variations in
signatures.
The model architecture plays a crucial role in the performance and effectiveness of the
signature verification system. In this project, Convolutional Neural Networks (CNNs) are
utilized due to their ability to learn hierarchical features from raw image data. The
architecture chosen for the models is ResNet50, a deep CNN architecture known for its
effectiveness in image classification tasks.
ResNet50 consists of multiple layers, including convolutional layers, pooling layers, and fully
connected layers. The convolutional layers extract features from input images through a
series of convolutions, while the pooling layers downsample the feature maps to reduce
computational complexity. Finally, the fully connected layers perform classification based on
the learned features.
4
3.3 Training and Evaluation
The training process involves feeding the preprocessed signature images into the CNN
models and iteratively adjusting the model parameters to minimize the classification error.
During training, the models learn to differentiate between genuine and forged signatures by
optimizing a predefined loss function, typically categorical cross-entropy.
Once trained, the models are evaluated using a separate validation dataset to assess their
performance in terms of accuracy, precision, recall, and other relevant metrics. The models
are then tested on unseen data to measure their effectiveness in real-world scenarios.
Evaluation results are analyzed to identify areas for improvement and refinement of the
signature verification system.
In the CNN models employed for signature verification, several types of layers are utilized to
extract and process features from the input signature images:
● Convolutional Layer: The core building block of a CNN, convolutional layers consist
of learnable filters that scan across the input image, extracting spatial features through
convolution operations.
● Pooling Layer: Pooling layers downsample feature maps, reducing their spatial
dimensions while retaining essential information. Max pooling is commonly used to extract
dominant features from localized regions of the input.
● Fully Connected Layer: Fully connected layers connect every neuron in one layer to
every neuron in the subsequent layer, enabling the model to learn complex patterns and make
predictions based on the extracted features.
5
CHAPTER 4
PREPROCESSING OF SIGNATURE IMAGES
______________________________________________________________________
The preprocessing of signature images involves several essential steps to enhance their
quality and suitability for further analysis:
● Grayscale Conversion: The input signature image is converted from its original color
space to grayscale using the cv2.cvtColor() function. This step simplifies subsequent
processing by reducing the image to a single channel representing pixel intensities.
● Gaussian Blur: A Gaussian blur is applied to the grayscale image using the
cv2.GaussianBlur() function. This operation helps remove noise and smooth out irregularities
in the image, improving the effectiveness of subsequent processing steps.
● Thresholding: Adaptive thresholding is performed to binarize the blurred image,
separating the foreground (signature) from the background. The cv2.adaptiveThreshold()
function with the cv2.ADAPTIVE_THRESH_GAUSSIAN_C flag adapts the threshold value
for each pixel based on its local neighborhood, enhancing robustness in varying illumination
conditions and background noise.
● Morphological Operations: Morphological closing operations are used to fill small
gaps and smooth out the contours of the signature. The cv2.morphologyEx() function with the
cv2.MORPH_CLOSE flag applies a closing operation using a predefined kernel, ensuring a
continuous and well-defined boundary for the extracted signature.
Following preprocessing, the signature is extracted from the preprocessed image using
contour detection techniques. The cv2.findContours() function identifies the contours of the
thresholded image, representing the boundaries of distinct objects or regions. The largest
contour, corresponding to the signature, is extracted by iterating over the detected contours
and selecting the contour with the maximum area.
6
4.3 Resizing and Background Addition:
To ensure consistency and compatibility with downstream processing tasks, the extracted
signature is resized to a square shape using the cv2.resize() function. The maximum
dimension of the signature image is determined, and the image is resized to a square of equal
width and height. Additionally, a constant background is added to the resized signature using
numpy operations, ensuring that the output image has a uniform size and aspect ratio.
These preprocessing techniques collectively enhance the quality and suitability of signature
images for subsequent analysis and classification tasks in signature verification systems.
● Image Extraction: The signature is extracted from the document provided as the
original image. This results in the 'Extracted Signature' as mentioned in the context.
● Resizing to Constant Size: The extracted signature is then resized to a constant size,
specifically a square shape. This is necessary for the Convolutional Neural Network (CNN)
to process the image effectively. The resized signature is referred to as the 'Output Image with
Constant Size (Square)' in the context.
● Preparation for Machine Learning Model: The preprocessed signatures are then
prepared for the machine learning model. In your project, a CNN model is used for signature
classification.
7
CHAPTER 5
CNN MODEL DESIGN AND TRAINING
______________________________________________________________________
8
Fig3. Version 1 ROC curve (Home Dataset)
● Findings:
Performance Metrics:
ROC-AUC (Home Dataset): .>90%
Training Accuracy: 86%
Validation Accuracy: 83%
Training Loss: 0.38
Validation Loss: 0.45
9
- Generalization Issue: When evaluating the model on a new dataset (ICDAR2011),
poor performance was observed, indicating a lack of generalization beyond the Cedar
Dataset.
● Improvements:
- Fine-tuning Hyperparameters: Further adjustments were made to hyperparameters,
including batch size, learning rate, and epoch count, to optimize model performance and
address the fluctuation issue.
10
Fig 6. Version 2 ROC curve (ICDAR2011)
● Findings:
Performance Metrics:
ROC-AUC (Home Dataset): 0.85
ROC-AUC (ICDAR2011 Dataset): 0.65
Training Accuracy: 90%
Validation Accuracy: 89.77%
Training Loss: 0.22
Validation Loss: 0.30
Model Version 3:
● Architecture: Retains the base ResNet50 model with custom top layers, along with
further enhancements in data augmentation.
● Training Process: Utilizes extensive data augmentation and hyperparameter tuning to
improve model robustness and convergence.
● Challenges Faced: Increased training time due to augmented data and complexity,
requiring optimization of hyperparameters.
● Performance Metrics: Achieves the highest test accuracy of approximately 92% and
demonstrates improved performance on diverse datasets.
11
● Challenges Faced:
- Training Time: With the introduction of data augmentation and increased model
complexity, training time significantly increased, posing a challenge for scalability.
● Improvements:
- Augmented Data: Leveraging augmented data, the model was trained on a more
diverse dataset, enabling it to learn robust features that could handle variations present in the
Cedar Dataset.
- Optimized Hyperparameters: Hyperparameters were further fine-tuned to strike a
balance between model performance and training efficiency, addressing the challenge of
increased training time.
12
Fig 9. Version 3 ROC curve
● Findings:
Performance Metrics:
ROC-AUC (Home Dataset): 0.88
Training Accuracy: 92%
Validation Accuracy: 91.23%
Training Loss: 0.18
Validation Loss: 0.25
For Model Version 3 on a Different Dataset:
ROC-AUC (Unseen Dataset): 0.69
False Positive Rate (FPR): 0.341
True Positive Rate (TPR): 0.730
13
CHAPTER 6
SYSTEM IMPLEMENTATION
______________________________________________________________________
Front-end User Interface: The front-end component encompasses the user interface accessible
through a web browser. Developed using HTML, CSS, and JavaScript, the interface provides
a user-friendly platform for interaction. It includes forms for user authentication, signature
upload functionalities, and result display sections. This component is responsible for handling
user inputs and presenting verification outcomes in an intuitive manner.
Back-end Server: The back-end server serves as the computational engine of the system,
processing user requests and orchestrating the signature verification process. Implemented
using Django, a Python web framework, the server manages user authentication, signature
comparison requests, and communication with the CNN model. It handles data preprocessing
tasks, such as image normalization and feature extraction, before forwarding the processed
data to the CNN model for verification.
CNN Model: The Convolutional Neural Network (CNN) model forms the core component of
the system, responsible for authenticating handwritten signatures. Developed using
TensorFlow or PyTorch, the model is trained on a diverse dataset of genuine and forged
signatures. It learns to extract relevant features from signature images and classify them as
either genuine or forged. The CNN model is deployed on the server and invoked by the
back-end component upon receiving signature comparison requests.
14
6.2 Description of the User Interface Design and Functionalities
The user interface of the Signature Verification System is meticulously designed to ensure
ease of use and seamless navigation. It comprises several key functionalities tailored to
facilitate user interaction and streamline the verification process.
● Signature Upload: Users are directed to the signature verification module, where they
can upload image. The interface provides intuitive file upload functionalities, allowing users
to select images from their local storage.. Clear instructions and visual cues guide users
through the upload process to ensure proper alignment and quality of the signature images.
● Real-time Feedback: During the verification process, the interface provides real-time
feedback on the authenticity of the signatures. Upon initiating the verification, users receive
immediate feedback on whether the signatures match or not. Additionally, the interface
displays a confidence score or probability of the match, providing users with insights into the
reliability of the verification outcome. Detailed results and analysis are also available for
users to review, enhancing transparency and trust in the system.
6.3 Integration of the CNN Model into the Signature Verification System
The integration of the CNN model into the Signature Verification System is meticulously
orchestrated to ensure seamless operation and efficient utilization of computational resources.
● Deployment: The trained CNN model is deployed on the server environment using
Django frameworks. This deployment ensures that the model is readily accessible to the
back-end component for inference tasks. The deployment process involves configuring the
server environment, optimizing model performance, and establishing communication
channels with the back-end server.
● Communication: The back-end server communicates with the deployed CNN model
through well-defined APIs or network protocols. Upon receiving signature comparison
requests from the user interface, the server preprocesses the input images and forwards them
to the CNN model for verification. The model generates predictions on the authenticity of the
signatures, which are then relayed back to the server for further processing.
● Scalability and Modularity The integration is designed to be modular and scalable,
allowing for future enhancements and updates to the CNN model. As new signature samples
are collected and the model undergoes further training, the system can seamlessly incorporate
improvements to enhance its accuracy and effectiveness in combating forgery and
15
falsification attempts. Moreover, the modular architecture facilitates the integration of
additional machine learning models or algorithms to augment the system's capabilities in the
future.
By carefully orchestrating the integration of the CNN model into the Signature Verification
System, the system achieves robust and reliable performance in authenticating handwritten
signatures, thereby enhancing security measures and mitigating the risks associated with
document forgery and falsification.
Hardware Used:
Model Training:
GPU used for training: NVIDIA T4 X2
GPU RAM: 15 +15 GB
CPU Memory: 29GB (MAX)
Platform: Kaggle
16
CHAPTER 7
RESULTS AND DISCUSSION
______________________________________________________________________
Model Performance Metrics: The performance of each model version was evaluated using
standard metrics such as accuracy, loss, and area under the receiver operating characteristic
curve (ROC-AUC). These metrics provide insights into the model's classification
performance and generalization capabilities.
Training History: The training history, including changes in accuracy and loss over epochs,
was visualized to understand the model's learning process and identify any trends or patterns.
● Version 1: The initial model achieved moderate performance metrics, with decent
accuracy on the training and validation sets. However, it exhibited limitations in
generalization beyond the training dataset.
● Version 2: By implementing data augmentation techniques and fine-tuning
hyperparameters, the second model showed improvements in both training and validation
accuracy. However, it still struggled with generalization to new datasets.
● Version 3: The final model, leveraging augmented data and optimized
hyperparameters, demonstrated the highest accuracy and improved generalization compared
to previous versions. It achieved the best performance metrics on both the training and
validation sets.
Scalability: As the system scales to handle larger datasets and increased user traffic,
optimizations in model training and inference speed will be crucial. Techniques such as
17
distributed training and model compression can help address scalability challenges without
compromising performance.
User Feedback: Incorporating user feedback and iterative testing cycles can provide valuable
insights into the usability and effectiveness of the Signature Verification System. Continuous
improvement based on user input can lead to a more refined and user-centric application.
18
CHAPTER 8
DISCUSSION AND CONCLUSION
______________________________________________________________________
8.1 Conclusion:
The development of the Signature Verification System represents a significant advancement
in automated signature authentication, offering enhanced accuracy and efficiency compared
to traditional methods. Through the implementation of deep learning models and web-based
interfaces, the system provides users with a seamless and intuitive platform for signature
verification tasks.
19
LIST OF PUBLICATIONS
______________________________________________________________________
20
REFERENCES
______________________________________________________________________
[1] CEDAR Signature Introduced by Srinivasan et al. in Machine learning for signature
verification CEDAR Signature is a database of off-line signatures for signature verification.
https://paperswithcode.com/dataset/cedar-signature
[6] Anamika Jain, Satish Kumar Singh, Krishna Pratap Singh Figure - available from:
Multimedia Tools and Applications
https://www.researchgate.net/figure/Accuracy-vs-Data-Distribution-for-sCNN_fig6_3404905
26
[7] Zihan Zeng1 and Jing Tian “Deep Learning Methods for Signature Verification”
https://arxiv.org/pdf/1912.05435.pdf\
[8] Teressa Longjam a, Dakshina Ranjan Kisku b, Phalguni Gupta Writer independent
handwritten signature verification on multi-scripted signatures using hybrid CNN-BiLSTM:
A novel approach
https://www.sciencedirect.com/science/article/abs/pii/S0957417422021297
21
APPENDICES
______________________________________________________________________
1. Convolutional Layer:
2. Pooling Layer:
● Role of fully connected layers in connecting every neuron from one layer to another.
● Explanation of activation functions such as ReLU, sigmoid, and tanh.
● Importance of fully connected layers in producing final classification outputs.
1. Data Collection:
2. Data Preprocessing:
3. Model Architecture:
22
● Strategies for selecting appropriate network depth, width, and complexity.
4. Model Training:
5. Verification System:
● Sample images from the acquired dataset, showcasing both genuine and forged
signatures.
● Image preprocessing examples, illustrating normalization, grayscale conversion, and
augmentation techniques applied to the dataset.
23