An image classification model for nut recognition, including data collection, cleaning, model training, deployment, and API integration.
The Nut Recognizer model is capable of classifying 14 different types of nuts:
- Almonds
- Brazil nuts
- Cashew nuts
- Chestnuts
- Ginkgo nuts
- Hazelnuts
- Hickory nuts
- Macadamia nuts
- Pecans
- Pili nuts
- Pine nuts
- Peanuts
- Pistachio nuts
- Walnuts
- Data Collection: The dataset was downloaded using DuckDuckGo by searching for each nut type.
- DataLoader: The fastai DataBlock API was used to set up the DataLoader.
- Data Augmentation: Default data augmentation provided by fastai was utilized, taking advantage of GPU acceleration.
- For more details, refer to the
notebooks/data_prep_train_clean.ipynb
notebook.
- Training: The model was fine-tuned using the resnet34 architecture for 5 epochs, repeated 3 times, achieving an accuracy of approximately 90%.
- Data Cleaning: A significant amount of time was spent on data cleaning due to noise in the collected data. The fastai ImageClassifierCleaner tool was used to clean and update the dataset after each training iteration, except for the final model iteration.
The trained model was deployed to the HuggingFace Spaces Gradio App. You can access the implementaion here. I used the nut-recognizer-v14.pkl in the 'models' folder for this implementation. Below is a screenshot of the deployed application:
The deployed model API is integrated into the GitHub Pages Website. Implementation details and other related information can be found in the docs
folder.
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
HuggingFace Spaces App URL: Hugging Face App
Gradio App URL (for next 3 days only): Gradio App
I would like to express my heartfelt gratitude to Mohammad Sabik Irbaz, MasterCourse Bangladesh for their invaluable contributions to this project. Their expertise, guidance, and unwavering support were instrumental in shaping my skills and enabling me to complete this repository. I am truly grateful for their mentorship and valuable insights throughout this journey.