An image classification model from data collection (scraping chicken types), cleaning, model training, deployment and API integration.
The model can classify 20 different types of chicken breeds
The types are following:
- Austra White
- Black Sex Link
- Blue Laced Red Wyandotte
- Bresse
- Cherry Egger
- Cochin
- Cornish Cross
- Cream Legbar
- Easter Egger
- Frizzle
- Iowa Blue
- Jersey Giant
- Nankin
- New Hampshire
- Orpingtons
- Polish
- Shamo
- Silkie
- Silver Laced Wyandotte
- Turken (Naked Neck)
Data Scraping: Collected the names of the chicken breeds through web scraping from this link.
Data Collection: Downloaded from DuckDuckgo using term name.
Dataloader: Used fastai DataBlock API to set up the Dataloader.
Data Augmentation: fastai provides default data augmentation which operates in GPU.
Details can be found in
.ipynb format notebooks/chicken_breed_recognizer_data_collections.ipynb
.py format src/chicken_breed_recognizer_data_collections.py
Training: Fine-tuned a resnet34 model 3 times, for (10+10+5) epochs and got up to ~94% accuracy.
Here's the final Confusion Matrix.
Data Cleaning: This part was the most tedious and took the highest time. Since the data was collected from DuckDuckgo images, there were many noises, and also misguided images. Cleaned and updated data using fastai ImageClassifierCleaner. A visual tool for cleaning data. I cleaned the data each time after training/finetuning, except for the last time which was the final iteration of the model.
Deployed the model to HuggingFace Spaces Gradio App. The implementation can be found in app
folder or here
The deployed model API is intgegrated here in github pages website. Implementation can be found in docs
folder.