Skip to content

lorihe/Springboard-Capstone3---Transfer_Learning

Repository files navigation

'Soccer or Rugby' Image Classification

This project uses pre-trained weights to create a classification model which recognized images as either 'soccer' or 'rugby'. This project also deploys the model as a web application using Streamlit.

Data Source: Kaggle-Football 🏈 Vs Rugby 🏉 Image Classification

01_Data_Overview Notebook

The raw data source contains images sorted as below:
'train' folder --- 'rugby' folder (1224 images)
                    --- 'soccer' folder (1224 images)
'test' folder  --- 'rugby' folder (305 images)
                    --- 'soccer' folder (305 images)

All images are in one of these formats: 'JPEG', 'JPG', 'BMP', 'PNG', 'MPO.

By browsing images in the raw data, it was noticed that:

  • A few basketball/American football pictures were placed in the soccer folders. Those pictures are manually replaced for this project.
  • Multiple American football pictures were placed in the rugby folders. Those pictures are not corrected at the moment.
  • All soccer image files in 'soccer' folder were named 'rugby'. Those file names were corrected in the code.

02_Game_Classification Notebook

I used MobileNetV2 as the base model to train on the updated datasets. The training resulted in an accuracy of 0.9493 on the training set and 0.918 on the validation set.

03_Streamlit.ipynb Notebook

application

To deploy:

  • Save model in a selected directory on your Google Drive.
  • Open '03_Streamlit.ipynb' on Google Colab.
  • Direct the connection to your selected directory in code. Run through all lines.
  • Use the output of the last line. Open 'your url' and input the 'External URL' (remove 'http://' and ':8501').
  • Pick a picture to predict.

04_Performance.ipynb Notebook

I applied the model to newly collected datasets:
  ---'rugby' folder (50 images)
  ---'soccer' folder (50 images)

Prediction performance metrics & wrongly labeled images:

Image Description

errror

As shown, the model performs much better in recognizing soccer than in rugby. The next step would be cleaning up the noise in training data to see if it improves the performance.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published