Skip to content

jessechumo/InkSpector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Inkspector: Signature Forgery Detection with Deep Learning

Inkspector is a deep learning project that detects forged handwritten signatures using a Siamese Convolutional Neural Network (Siamese CNN). By comparing a test signature against a known genuine sample, the model learns to distinguish subtle differences between authentic and forged signatures.

Project Overview

Forgery detection is a critical problem in banking, legal, and academic sectors. Traditional visual inspection methods are subjective and error-prone. Inkspector leverages deep learning to automate and improve the accuracy of signature verification.

Instead of treating signature classification as a binary task (real vs forged), Inkspector uses a pairwise comparison approach: it determines whether two signatures come from the same person.

Model Architecture

  • Siamese Neural Network using shared CNN branches
  • Each branch processes an input signature image and learns deep feature representations
  • The model uses L1 distance to compare the features of a test signature and a known genuine sample
  • Final prediction: same (genuine) or different (forged) image

Dataset

The dataset used is Handwritten Signatures | Genuine and Forged from Kaggle.

  • 150 genuine + 150 forged signatures (300 total)
  • Format: Grayscale .png images

Dataset Structure:

  • genuine/: 5 samples each from 30 individuals
  • forged/: 5 forged samples for the same 30 individuals

File Naming Convention: NFI-XXXYYZZZ

  • XXX: ID of the person who performed the signature
  • YY: Sample number
  • ZZZ: ID of the person the signature claims to represent

Examples:

  • NFI-00602023: Person 006 forged a signature of person 023 → forged
  • NFI-02103021: Person 021 signed their own signature → genuine

Performance

image

  • Training Accuracy: 99.46%
  • Validation Accuracy: 97.14%
  • Custom confusion heatmaps and model visualization included

  • The model in action below. image

Project Structure

Inkspector/
├── sample_Signature/
│   ├── genuine/
│   └── forged/
├── dasv.ipynb           # Main notebook
├── Signature Forgery Detection.pptx
├── requirements.txt       
└── README.md

How to Run

  1. Clone this repo
git clone https://github.com/jessechumo/inkspector.git
cd inkspector
  1. Create and activate a virtual environment
python -m venv venv
source venv/bin/activate   # For Linux/macOS
venv\Scripts\activate      # For Windows
  1. Install dependencies
pip install -r requirements.txt
  1. Run the notebook
jupyter notebook dasv.ipynb

Features

  • Siamese architecture for pairwise signature verification
  • Heatmap visualizations to evaluate model behavior
  • Plot of network architecture using Matplotlib
  • Clean preprocessing with padding, normalization, and resizing
  • Compatible across Linux (CPU) and Windows (GPU)

Future Work

  • Expand dataset with real-world samples
  • Add data augmentation for robustness
  • Experiment with deeper or hybrid models
  • Deploy as a web app for real-time signature verification

Credits

About

A Siamese Network for Signature Forgery Detection

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published