Detecting wheat heads using YOLOv5
- Web App demo
- Brief overview of the competition images
- Modifications
- Training
- Inference and Deployment
Wheat heads were from various sources:
A few labeled images are as shown: (Blue bounding boxes)
Models can be downloaded from here. (Use last_yolov5x_4M50fold0.pt for best results)
The YOLOv5 notebook internally does some augmentations while preparing a Dataset. Originally, this Dataset consists of only Mosaic images.
Mosaic - https://arxiv.org/pdf/2004.12432.pdf
4 images are cropped and stitched together
Here, I modified the repo to add Mixup.
Mixup - https://arxiv.org/pdf/1710.09412.pdf
2 images are mixed together
I modified the code(especifically utils.datasets) so it had a 50-50 chance of creating a mixup or a mosaic image. This was very helpful for us as it boosted our public score from 0.77->0.7769.
These developments were made before we found out that YOLOv5 was non-compliant and had to switch to EfficientDet for our final 2 submissions. Kaggle later updated the leaderboard with the final 2 submissions and we ended up at 113th Private(Top 6%).
We trained the model for 50 epochs on Colab Pro.
Our best model is currently being used for inference in this web-app. I uses HTML and CSS as front-end and Flask as the backend. This web-app is served on Google Colab but can be easily deployed on AWS or GCP as well.