This project is a Signature Forgery Detection System built using Django and TensorFlow/Keras, which leverages transfer learning with pre-trained CNN models including ResNet50, VGG16, VGG19, and a custom CNN model. The aim is to classify whether a given signature is genuine or forged.
- Detect forged signatures using deep learning
- Use transfer learning with pre-trained models for efficient training
- Train multiple models for comparison and accuracy benchmarking
- Serve predictions through a Django web interface
A standard CNN with multiple convolution and pooling layers followed by dense layers.
- Input size:
150x150 - Layers: Conv2D → MaxPooling → Dense
- Optimizer: Adam (
lr=0.0001) - Loss: Binary Crossentropy
- Metrics: Accuracy
- Epochs:
100(with early stopping)
- Pre-trained on ImageNet (
include_top=False) - Input size:
64x64 - Pooling:
avg - Added Layers: Flatten → Dense(512 → 435 → 365 → 1)
- Trainable Layers: All frozen
- Optimizer: Adam
- Epochs:
100(early stopping with patience 30)
- Pre-trained on ImageNet (
include_top=False) - Input size:
64x64 - Pooling:
avg - Added Layers: Flatten → Dense(512 → 450 → 260 → 1)
- Trainable Layers: All frozen
- Optimizer: Adam
- Epochs:
100(early stopping with patience 30)
- Pre-trained on ImageNet (
include_top=False) - Input size:
64x64 - Pooling:
avg - Added Layers: Flatten → Dense(512 → 455 → 250 → 1)
- Trainable Layers: All frozen
- Optimizer: Adam
- Epochs:
100(early stopping with patience 30)
This project combines deep learning with web development to deliver a full-stack signature forgery detection system.
- Django — Web framework to handle routing, views, form submissions, file storage, and templating.
- Python — Core programming language for backend logic and model execution.
- Django Template Language (DTL) — For dynamic HTML rendering with logic blocks, URL routing, and static file linking.
- Bootstrap 5 — For responsive layout, modern UI components, grid system, and modals.
- Bootstrap Icons — Used to visually enhance success/failure results.
- Custom CSS — For additional design and theming.
- TensorFlow / Keras — To train, load, and infer from deep learning models:
- Custom Sequential CNN Model
- ResNet50 (Transfer Learning)
- VGG16 (Transfer Learning)
- VGG19 (Transfer Learning)
- NumPy / OpenCV (optional) — For image preprocessing.
- Signature image upload via Django form.
- Real-time model prediction for 4 different CNN architectures.
- Display of:
- Confidence scores per model
- Averaged result and final verification decision
- Signature preview for the uploaded image
- Responsive and mobile-friendly layout.
Dataset used: Signature Verification Dataset by robinreni
Downloaded using kagglehub:
import kagglehub
path = kagglehub.dataset_download("robinreni/signature-verification-dataset")
print("Path to dataset files:", path)To get started quickly, you can download the pre-trained .h5 models from the following Google Drive links:
| Model Name | Architecture | Download Link |
|---|---|---|
| Custom CNN | Custom-built CNN | Download |
| ResNet50 | Transfer Learning | Download |
| VGG16 | Transfer Learning | Download |
| VGG19 | Transfer Learning | Download |
- Ensure you have installed Docker.
git clone https://github.com/sanu0711/Forgery-Detection-Signature-Verification.gitcd Forgery-Detection-Signature-VerificationThis command will build the Docker image and start the Django server inside a container.
- Place the downloaded .h5 files inside the trained_models/ directory before running the app.
docker-compose up --buildhttp://localhost:8000/
Here, you can upload signature images and get real-time forgery predictions from 4 different deep learning models
