Code for the Kaggle Kuzushiji Recognition Challenge. My team finished as 5th with a F1-score of 0.94. The challenge was to develop better algorithms for Kuzushiji recognition.


The training data can be downloaded from here: https://www.kaggle.com/c/kuzushiji-recognition/data

or using the Kaggle API:

kaggle competitions download -c kuzushiji-recognition


pip install --upgrade tqdm opencv-python== timm --user
pip install --upgrade git+https://github.com/albu/albumentations --user

Install apex for your system setup as explained here: https://github.com/NVIDIA/apex This is optional if you just want to run inference.

$ ls | grep images
>>> test_images
>>> train_images


$ python train.py

This will produce the weights Logdir_038_f00/f00-ep-0125-val_hm_acc-0.9944-val_classes_acc-0.4986.pth. Training takes ~8 hours on a single V100 GPU with mixed precision training. Alternatively, the weights can be downloaded from here. Just put them into Logdir_038_f00.


$ python submit.py

This will produce the submission file Logdir_038_f00/f00-TTA-V7-PREDS-p0.40-.csv.


You can visualize the predictions via: python vis_submission.py --fn ../Kuzushiji/Logdir_038_f00/f00-TTA-V7-PREDS-p0.40-.csv.