/Signature_verification_web_app

this repository will verify signatures based on the Signet model(siamese convolutional neural network)

Primary LanguageJupyter NotebookMIT LicenseMIT

Offline Writer Independent signature verification

Setting up locally

Download the dependencies.

pip install -r requirements.txt

Then download the pretrained model and dataset

python DownloadData.py

To use the web demo

cd frontend
npm install
npm run build
cd ..
python main.py

Models used

Used a Convolutional Siamese network along with the Constrastive loss function. I chose Euclidian distance as the distance metric for comparing the output feature vectors.

Accuracy

The model acheived an accuracy of 78.34% on the CEDAR signature dataset(test set size was around 4100 samples). Deviations of 1-2% are possible as accuracy depends on the threshold. The threshold for the siamese network was computed by taking the average of True positive rate and True negative rate using ROC.

Preprocessing

Images were converted to grayscale, inverted and scaled down to 0 or up to 255 depending on whether the pixel value was below or above 50. Image tensor sizes of 225x155 were fed into the model. Images were grouped in pairs of genuine and forged images, where the label was 1 if both were genuine and of the same writer and 0 otherwise. 13500 image pairs of each label where chosen, 15% of which were used for testing.

Original image

Original image

Preprocessed image

Preprocessed image

Dataset

The CEDAR signature dataset is one of the benchmark datasets for signature verification. It consists of 24 genuine and forged signatures each from 55 different signers.

Dataset link

References

  1. SigNet: Convolutional Siamese Network for Writer Independent Offline SignatureVerification

Screenshots

screenshot1

screenshot2