https://github.com/awslabs/handwritten-text-recognition-for-apache-mxnet

This repository lets you train neural networks models for performing end-to-end full-page handwriting recognition using the Apache MXNet deep learning frameworks on the IAM Dataset.

https://github.com/awslabs/handwritten-text-recognition-for-apache-mxnet

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (10.5%) to scientific vocabulary
Last synced: 9 months ago · JSON representation

Repository

This repository lets you train neural networks models for performing end-to-end full-page handwriting recognition using the Apache MXNet deep learning frameworks on the IAM Dataset.

Basic Info
  • Host: GitHub
  • Owner: awslabs
  • License: apache-2.0
  • Language: Jupyter Notebook
  • Default Branch: master
  • Size: 73 MB
Statistics
  • Stars: 507
  • Watchers: 23
  • Forks: 190
  • Open Issues: 24
  • Releases: 0
Created over 7 years ago · Last pushed over 3 years ago
Metadata Files
Readme Contributing License Code of conduct

README.md

Handwritten Text Recognition (OCR) with MXNet Gluon

Local Setup

git clone https://github.com/awslabs/handwritten-text-recognition-for-apache-mxnet --recursive

You need to install SCLITE for WER evaluation You can follow the following bash script from this folder:

bash cd .. git clone https://github.com/usnistgov/SCTK cd SCTK export CXXFLAGS="-std=c++11" && make config make all make check make install make doc cd -

You also need hsnwlib

bash pip install pybind11 numpy setuptools cd .. git clone https://github.com/nmslib/hnswlib cd hnswlib/python_bindings python setup.py install cd ../.. if "AssertionError: Please enter credentials for the IAM dataset in credentials.json or as arguments" occurs rename credentials.json.example and to credentials.json with your username and password.

Overview

The pipeline is composed of 3 steps: - Detecting the handwritten area in a form [blog post], [jupyter notebook], [python script] - Detecting lines of handwritten texts [blog post], [jupyter notebook], [python script] - Recognising characters and applying a language model to correct errors. [blog post], [jupyter notebook], [python script]

The entire inference pipeline can be found in this notebook. See the pretrained models section for the pretrained models.

A recorded talk detailing the approach is available on youtube. [video]

The corresponding slides are available on slideshare. [slides]

Pretrained models:

You can get the models by running python get_models.py:

Sample results

The greedy, lexicon search, and beam search outputs present similar and reasonable predictions for the selected examples. In Figure 6, interesting examples are presented. The first line of Figure 6 show cases where the lexicon search algorithm provided fixes that corrected the words. In the top example, “tovely” (as it was written) was corrected “lovely” and “woved” was corrected to “waved”. In addition, the beam search output corrected “a” into “all”, however it missed a space between “lovely” and “things”. In the second example, “selt” was converted to “salt” with the lexicon search output. However, “selt” was erroneously converted to “self” in the beam search output. Therefore, in this example, beam search performed worse. In the third example, none of the three methods significantly provided comprehensible results. Finally, in the forth example, the lexicon search algorithm incorrectly converted “forhim” into “forum”, however the beam search algorithm correctly identified “for him”.

Dataset:

  • To use testiamdataset.ipynb, create credentials.json using credentials.json.example and editing the appropriate field. The username and password can be obtained from http://www.fki.inf.unibe.ch/DBs/iamDB/iLogin/index.php.

  • It is recommended to use an instance with 32GB+ RAM and 100GB disk size, a GPU is also recommended. A p3.2xlarge would be the recommended starter instance on AWS for this project

Appendix

1) Handwritten area

Model architecture

Results

2) Line Detection

Model architecture

Results

3) Handwritten text recognition

Model architecture

Results

Owner

  • Name: Amazon Web Services - Labs
  • Login: awslabs
  • Kind: organization
  • Location: Seattle, WA

AWS Labs

GitHub Events

Total
  • Issues event: 1
  • Watch event: 18
  • Delete event: 1
  • Pull request event: 1
  • Fork event: 3
  • Create event: 1
Last Year
  • Issues event: 1
  • Watch event: 18
  • Delete event: 1
  • Pull request event: 1
  • Fork event: 3
  • Create event: 1

Issues and Pull Requests

Last synced: about 2 years ago

All Time
  • Total issues: 63
  • Total pull requests: 6
  • Average time to close issues: about 1 month
  • Average time to close pull requests: about 2 months
  • Total issue authors: 41
  • Total pull request authors: 4
  • Average comments per issue: 3.81
  • Average comments per pull request: 0.33
  • Merged pull requests: 3
  • Bot issues: 0
  • Bot pull requests: 3
Past Year
  • Issues: 1
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 1
  • Pull request authors: 0
  • Average comments per issue: 0.0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • man0007 (9)
  • naveen-marthala (4)
  • mahin003 (3)
  • jbuehler1337 (3)
  • LauraOrozco (2)
  • freedom9393 (2)
  • SumanthAmpcus (2)
  • Neelesh1121 (2)
  • sambbhavgarg (2)
  • vdinesh18 (2)
  • AnimeshMaheshwari22 (2)
  • rsierrap (1)
  • karansdoshi (1)
  • danielmapar (1)
  • shaheerakr (1)
Pull Request Authors
  • dependabot[bot] (4)
  • sethuramanio (1)
  • jalvathi (1)
  • jb-delafosse (1)
Top Labels
Issue Labels
Pull Request Labels
dependencies (4) python (1)

Dependencies

requirements.txt pypi
  • gluonnlp ==0.9.0
  • leven ==1.0.4
  • mxboard ==0.1.0
  • mxnet ==1.4.0
  • protobuf ==3.8.0
  • sacremoses ==0.0.43