rdat/fastai-prac-guitar-classifier
0
Guitar Type Image Classifier
This is an image classifier app that identifies a guitar's type based on its image. This was done as a quick mini-project to try out the FastAI+Gradio+HF Spaces stack. The model itself has been fine-tuned from ResNet18 using the FastAI API.
List of guitar types in this app's scope:
- Acoustic Bass Guitar
- What it sounds like
- Archtop Guitar
- What it sounds like
- Classical Guitar
- What it sounds like
- Electric Bass Guitar
- What it sounds like
- Electric Guitar
- What it sounds like
- Flat-top Guitar
- What it sounds like
Assumptions and Caveats:
- Semi-acoustic guitars of all types have been kept in the acoustic category.
- There was some manual data cleaning done between data augmentation and model fine-tuning. The details are described in the train.py script.
Observations:
- The most commonly confused category pairs are acoustic bass : classical and classical : flat-top. This makes sense because apart from the headstock and the strings themselves, these 3 categories are largely similar. Higher resolution images for training should help the model in doing a better job of distinguishing betweeen these categories.
- The fine-tuning works well despite being given less than 200 images per class and only 5 training epochs.
Using the app:
- The app can be accessed at https://huggingface.co/spaces/rdat/fastai-prac-guitar-classifier. Add an image to the input area and click submit to get the model's inference along with probability percentages.
- The train.py script can be executed with the appropriate config parameters to train (fine-tune) a new model.
Next Steps:
- Add a component to the Gradio interface that lets the user play a sample of the instrument when its corresponding example image is selected.
- Experiment with more recent ResNet models and supply them with more data for fine-tuning.
- Perform more extensive hyperparameter tuning.
- Add performance metrics to the README file.
