All Projects → jungomi → Math Formula Recognition

jungomi / Math Formula Recognition

Licence: mit
Math formula recognition (Images to LaTeX strings)

Projects that are alternatives of or similar to Math Formula Recognition

Design Of Experiment Python
Design-of-experiment (DOE) generator for science, engineering, and statistics
Stars: ✭ 143 (-0.69%)
Mutual labels:  jupyter-notebook
Visualizing cnns
Using Keras and cats to visualize layers from CNNs
Stars: ✭ 143 (-0.69%)
Mutual labels:  jupyter-notebook
Dive Into Deep Learning Pytorch Pdf
本项目对中文版《动手学深度学习》中的代码进行了PyTorch实现并整理为PDF版本供下载
Stars: ✭ 144 (+0%)
Mutual labels:  jupyter-notebook
Selfconsistency
Code for the paper: Fighting Fake News: Image Splice Detection via Learned Self-Consistency
Stars: ✭ 143 (-0.69%)
Mutual labels:  jupyter-notebook
Part2
Stars: ✭ 143 (-0.69%)
Mutual labels:  jupyter-notebook
Data Science Question Answer
A repo for data science related questions and answers
Stars: ✭ 2,000 (+1288.89%)
Mutual labels:  jupyter-notebook
Deep and machine learning projects
This Repository contains the list of various Machine and Deep Learning related projects. Related code and data files are available inside this folder. One can go through these projects to implement them in real life for specific use cases.
Stars: ✭ 141 (-2.08%)
Mutual labels:  jupyter-notebook
Pytorch tutorial
A set of jupyter notebooks on pytorch functions with examples
Stars: ✭ 142 (-1.39%)
Mutual labels:  jupyter-notebook
Tutorial Softweightsharingfornncompression
A tutorial on 'Soft weight-sharing for Neural Network compression' published at ICLR2017
Stars: ✭ 143 (-0.69%)
Mutual labels:  jupyter-notebook
Gp
A tutorial about Gaussian process regression
Stars: ✭ 141 (-2.08%)
Mutual labels:  jupyter-notebook
Dlfs code
Code for the book Deep Learning From Scratch, from O'Reilly September 2019
Stars: ✭ 142 (-1.39%)
Mutual labels:  jupyter-notebook
Machine learning for good
Machine learning fundamentals lesson in interactive notebooks
Stars: ✭ 142 (-1.39%)
Mutual labels:  jupyter-notebook
Complete Python Bootcamp
Lectures for Udemy - Complete Python Bootcamp Course
Stars: ✭ 1,879 (+1204.86%)
Mutual labels:  jupyter-notebook
Faster Rcnn tensorflow
This is a tensorflow re-implementation of Faster R-CNN: Towards Real-Time ObjectDetection with Region Proposal Networks.
Stars: ✭ 142 (-1.39%)
Mutual labels:  jupyter-notebook
Diy Alexa
Command recognition research
Stars: ✭ 143 (-0.69%)
Mutual labels:  jupyter-notebook
Gator
Conda environment and package management extension from within Jupyter
Stars: ✭ 143 (-0.69%)
Mutual labels:  jupyter-notebook
Practicalai Cn
AI实战-practicalAI 中文版
Stars: ✭ 2,375 (+1549.31%)
Mutual labels:  jupyter-notebook
Pubtabnet
Stars: ✭ 143 (-0.69%)
Mutual labels:  jupyter-notebook
Desafio 2 2020
Stars: ✭ 144 (+0%)
Mutual labels:  jupyter-notebook
Main
CS579: Online Social Network Analysis at the Illinois Institute of Technology
Stars: ✭ 143 (-0.69%)
Mutual labels:  jupyter-notebook

Off-Line Math Formula Recognition Using Deep Neural Networks

Based on Multi-Scale Attention with Dense Encoder for Handwritten Mathematical Expression Recognition.

Requirements

All dependencies can be installed with PIP.

pip install -r requirements.txt

If you'd like to use a different installation method or another CUDA version with PyTorch (e.g. CUDA 10) follow the instructions on PyTorch - Getting Started.

Data

CROHME: Competition on Recognition of Online Handwritten Mathematical Expressions has been used. As it is an on-line handwritten dataset, it consists of InkML files, but this architecture is for off-line recognition, which means that images are used as input.

The dataset has been converted to images of size 256x256 and the ground truth has been extracted as well. The converted dataset can be found at Floydhub - crohme-png.

The data needs to be in the data/ directory and a tokens.tsv file defines the available tokens separated by tabs. Training and validation sets are defined in gt_split/train.tsv and gt_split/validation.tsv, where each line is the path to the image and its ground truth.

The training/validation split can be generated by running:

python data_tools/train_validation_split.py -i data/groundtruth_train.tsv -o data/gt_split

Note: The content of the generated images vary greatly in size. As longer expressions are limited to the same width, they will essentially use a smaller font. This makes it much more difficult to correctly predict the sequences, especially since the dataset is quite small. The primary focus was the attention mechanism, to see whether it can handle different sizes. If you want better results, the images need to be normalised.

Usage

Training

Training is done with the train.py script:

python train.py --prefix "some-name-" -n 200 -c checkpoints/example-0022.pth

The --prefix option is used to give it a name, otherwise the checkpoints are just numbered without any given name and -c is to resume from the given checkpoint, if not specified it starts fresh.

For all options see python train.py --help:

Evaluation

To evaluate a model use the evaluate.py script with the desired checkpoint and the dataset it should be tested against (can use multiple sets at once):

For example to evaluate the sets 2014 and 2016 with beam width 5:

python evaluate.py -d 2014 2016 --beam-width 5 -c checkpoints/example-0022.pth
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].