An intelligent signature verification and identification system built using a Siamese ResNet architecture.
It verifies whether a given signature belongs to a registered user by comparing deep feature embeddings of signature images.
This system is optimized for limited user data (as few as 5 samples per user), using data augmentation and contrastive learning for robust verification.
✅ ResNet-18 based Siamese Network – extracts deep signature embeddings.
✅ Contrastive Loss Training – learns to distinguish between genuine and forged pairs.
✅ Automatic Embedding Enrollment – generates and saves student signature representations.
✅ Real-time Verification – compare uploaded signatures with enrolled ones.
✅ Augmentation Pipeline – increases dataset size for limited samples.
✅ Support for CEDAR + Student Dataset – seamlessly integrates both datasets.
Signature-Identification/
│
├── dataset.py # Loads and augments signature data
├── model.py # Defines Siamese ResNet model
├── train.py # Trains the model using CEDAR + student data
├── predict.py # Verifies a new signature against enrolled users
├── enroll.py # Scans test images and saves embeddings
│
├── signatures/ # Public signature dataset (already large)
│── students/ # Contains student signatures (only 5 per user)
│ ├── student1/
│ ├── student2/
│ └── ...
│
├── models/
│ ├── student_embeddings.pkl # Saved student embeddings after enrollment
└── siamese_resnet.pth # Trained model weights
git clone https://github.com/yourusername/Signature-Identification.git
cd Signature-Identificationpip install -r requirements.txtTrain the Siamese ResNet using both CEDAR and student signatures:
python train.pyThis script:
- Loads and augments the datasets
- Creates genuine/forged signature pairs
- Trains the Siamese ResNet model with contrastive loss
- Saves model weights to
models/siamese_resnet.pth
Once training is done, generate embeddings for all student signatures:
python enroll.pyThis step:
- Loads the trained model
- Computes feature embeddings for each student's signatures
- Saves them in
mdoels/student_embeddings.pkl
Verify a given signature against all enrolled users, by configuring query_path:
python predict.pyThe system compares the query signature with all stored embeddings and prints the most probable match, along with the similarity score.
Example Output:
Predicted Student: student5
Similarity Score: 0.912
Result: Genuine
The Siamese ResNet model uses two identical branches of ResNet-18 sharing weights.
Input 1 Input 2
│ │
▼ ▼
ResNet Encoder ResNet Encoder
│ │
└── Feature Embeddings ──┘
│
Euclidean Distance
│
Contrastive Loss
This allows the network to learn meaningful signature representations and distinguish genuine vs forged pairs effectively.
| Dataset | Accuracy | Loss | Remarks |
|---|---|---|---|
| CEDAR | ~97% | Low | High-quality dataset |
| Students (5→Augmented) | ~93% | Moderate | Improved with augmentation |
- Python 3.11
- PyTorch – deep learning framework
- OpenCV / PIL – image handling
- Albumentations – data augmentation
- NumPy / Pandas – preprocessing utilities
- ✅ Web Interface for Upload & Verification
- ✅ Add One-shot Learning for new users
- 🔲 Integrate Live Signature Capture