This is my solution to the Bengali.AI Handwritten Grapheme Classification competition. I used a DenseNet-121 that receives a one-channel image and outputs 3 separate classifiers for the grapheme root, vowel diacritics, and consonant diacritics, respectively. The MixUp augmentation is used to improve the performance.
Result: Macro-average recall score of 0.9319 in the private leaderboard. Ranked 182 out of 2059 teams (bronze medal region).
To get a local copy up and running, follow these simple example steps.
-
PyTorch (version 1.3.0)
Install using Anaconda:
conda install pytorch=1.3.0 -c pytorch
-
Clone the repo
git clone https://github.com/stephenllh/bengali_character.git
-
Change directory
cd bengali_character
-
Install packages
pip install requirements.txt
-
Change directory
cd bengali_character
-
Create a directory called
input
mkdir input cd input
-
Download the dataset into the folder
- Option 1: Use Kaggle API
pip install kaggle
kaggle competitions download -c bengaliai-cv19
- Option 2: Download the dataset from the competition website.
- Option 1: Use Kaggle API
-
Run the training script
cd .. python train.py
-
(Optional) Run the inference script
python inference.py
Distributed under the MIT License. See LICENSE
for more information.
Stephen Lau - Email - Twitter - Kaggle
Project Link: https://github.com/stephenllh/bengali_handwriting