Git Product home page Git Product logo

signature-extraction's Introduction

layout categories code demo drawer permalink
project
Machine Learning
saifkhichi96/signature-extraction
mSPeYTF9J4Q
true
/index.html

Extracting Signatures from Bank Checks

Introduction

Ahmed et al. [1] suggest a connected components-based method for segmenting signatures in document images. For this purpose, they train and evaluate their models on Tobacco-800 documents dataset to extract patch-level signatures.

In this project, we have taken their proposal and modified it to work specifically for bank checks, and be able to segment signatures on a stroke level instead of patch level. Both these are inherently more difficult problems.

Bank checks have complex backgrounds which are not known beforehand. This was not the case in Tobacco-800 dataset where the documents have a simple white background. Similarly, extracting stroke-level position of the signature is again a more difficult task compared to patch level location.

Demo

You can watch a demo of the results in the following Youtube video
Demo Video

Datasets

One reason why [1] worked on patch-level was a lack of publicly available datasets with groundtruth at stroke-level. In this project, we have created our own dataset of bank checks with stroke level groundtruth available as binary segmentation masks. We use this dataset for testing.

We divide our training data into two classes: signatures and non-signature. For non-signature class, we took 64 documents from Tobacco-800 [3, 4] to manually generate new images which which didn't contain any signatures or handwritten text. Some of these documents contained logos, as well. For the signature class, we combined all images from the UTSig signature database [2], which contains 8280 Persian language signatures.

Installation

Clone the project and cd to project directory. Then, execute the following commands once to set-up your environment

python3 -m venv venv/
source venv/bin/activate
pip install -r requirements.txt

Then you can run the GUI app with python3 src/extract_gui.py.

The repository comes with trained models in the models/ folder. To train a new model with your own data, look at the train_test.py script.

References

  1. Ahmed, S., Malik, M. I., Liwicki, M., & Dengel, A. (2012, September). Signature segmentation from document images. In 2012 International Conference on Frontiers in Handwriting Recognition (pp. 425-429). IEEE.

  2. Soleimani, A., Fouladi, K., & Araabi, B. N. (2016). UTSig: A Persian offline signature dataset. IET Biometrics, 6(1), 1-8.

  3. Zhu, G., & Doermann, D. (2007, September). Automatic document logo detection. In Ninth International Conference on Document Analysis and Recognition (ICDAR 2007) (Vol. 2, pp. 864-868). IEEE.

  4. Zhu, G., Zheng, Y., Doermann, D., & Jaeger, S. (2007, June). Multi-scale structural saliency for signature detection. In 2007 IEEE Conference on Computer Vision and Pattern Recognition (pp. 1-8). IEEE.

signature-extraction's People

Contributors

saifkhichi96 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

signature-extraction's Issues

Broken requirements.txt because of changes in opencv-contrib library

Describe the bug
Because of patented algorithms like surf and sift being removed from opencv-contrib, installing via the given method in the readme is not working.

To Reproduce
Steps to reproduce the behavior:
Try installing and running the program.

Expected behavior
Opencv-contrib library wont install

How to fix
I installed the following packages in a conda environment one by one and then used a special flag to install opencv-contrib and it worked

Installation - WORKING USING CONDA

Create conda environment with the name 'signature_extraction' and activate virtual env

conda create --name signature_extraction

conda activate signature_extraction

Install packages one by one (requirements.txt not working properly because of different channels)

conda install -c anaconda joblib

conda install -c anaconda numpy

conda install -c anaconda scikit-learn

conda install -c anaconda scipy

conda install -c conda-forge opencv

conda install -c conda-forge threadpoolctl

conda install -c conda-forge tqdm

opencv-contrib package will have to be built from source with NONFREE flag set. If this package installed directly then we wont be able to use a crucial function in the code. This might take some time.

CMAKE_ARGS="-DOPENCV_ENABLE_NONFREE=ON" pip install --no-binary=opencv-contrib-python opencv-contrib-python

Once all packages are installed to the virtual env, cd to the project directory and run the GUI app with

python3 src/extract_gui.py

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.