/Mosaic-PS1

Primary LanguageJupyter NotebookApache License 2.0Apache-2.0

Mosaic-PS1

Hindi Word Recognizer

This Repo contains our approach and code for the Problem Statement for Round-1 of Event MOSAIC organised at UDYAM'21. For more info about the PS, find - Here

Kindly read our Article on Medium which throws light on how we handled the dataset, approach we followed while processing the images and how we trained our model

Installation

We strongly recommend to create a seprate virtual environment for installing the dependencies .Make sure you have python version>=3.6

  • Clone Repo
git clone https://github.com/akshatsood2249/Mosaic-PS1.git
  • Then Run below commands for installing the requirements.
cd Mosaic-PS1
pip install -r requirements.txt

Training

you can find the notebook here.

You can train model on your own Dataset or you can use the pretrained model available in this Repo. Just look at our character set here before using the pretrained model.

Testing

For testing, Run

cd codes
python3 main.py

before running just modify

load_model("model.h5")

according to your needs in main.py and after that while running it will ask for the path of word image.

Overview of Our Approach

Segmentation

  • Used Median Blur to Remove shadows
  • Used MinAreaRect in OpenCV to deskew word.
  • Used a method for line(shirorekha) management
  • Used the method of horizontal projection along with Canny edge for segmenting individual characters

Model

  • Used 32 characters for training the model
  • Used exponential lr_decay while training to achieve smooth convergence

For finding Details about segmentation and model Look into Segmenter.py and train.ipynb

Our Contribution

From this Repo we are releasing a New Dataset made by ourselves for bridging the gap between reality and training.

Why is it Needed ?

One can easily find a number of Dataset related to Devnagri and Hindi Characters. But when we test the model trained on these datasets in real applications, we found that it lacks the power of Generality. So we decided to build our own Dataset and made it open source to be used by others with same applications.

Dataset Validity

We collected the dataset with the help of 9 different individuals from different age groups, we made the validation data distribution slightly different from the train to test the generalizing capability of Deep Learning Models.

Our Performance

We trained several models using different techniques and able to get the train/val score of 0.98/0.96. We validated that our validation data is hard enough to increase the score beyond it and can serve the purpose of competitive dataset for this application to genralize well.

How to Download ?

Run

wget https://github.com/akshatsood2249/Mosaic-PS1/files/6348871/Hindi_Char-Dataset.zip
unzip Hindi_Char-Dataset.zip

Citation

If you are using our Dataset in you research or applications Please Cite this Repo or attach link of this Repo in your Reference

Cite as:

@misc{MOSAIC-PS1,
  title={Dataset for Increasing Generality in Hindi Character Recognition},
  author={Aman Mishra, Akshat Sood, Mainak Samanta},
  year={2021},
  url={https://github.com/akshatsood2249/Mosaic-PS1}
}

References

Team ✨✨


Mainak Samanta


Akshat Sood


Aman Mishra


If you have any query feel free to create an issue or can reach us via