- Pre-trained model used was EfficientNet_B0 (model pre-trained on ImageNet dataset) : https://github.com/lukemelas/EfficientNet-PyTorch
- Custom model was trained using the smallest EfficientNet, model imported using torch image model (timm) : https://huggingface.co/timm
- Model Trained on 100 different sports, refer to classes.txt for the list of different sports
- For the purpose of using Streamlit cloud, the smallest model is chosen for a faster inference speed, with less accuracy
- Accuracy of the model is 93%
- Label images:
- For image classification tasks, the labeling process involves assigning a class label to each image and organizing them into folders based on their classes. Tools like RoboFlow or CVAT simplify this process.
- Split Data:
- Divide dataset into training and validation sets. The training set is used to train the model, while the validation set is used to evaluate its performance during training.
- Pre-process the images: (Resize images and batching dataset)
- Resize images into appropriate sizes, each pre-trained model has a different image size. For EfficientNet, the image size used was 128x128 for the smallest model.
- Batch size for image classification can vary, a good starting point is 32 for batch size.
- Augment Images (if needed):
- Data augmentation techniques can be applied to artificially increase the diversity of your dataset. This helps the model generalize better.
- Train the model:
- The models were trained using PyTorch, feel free to use tensorflow if you want. Monitor metrics such as train loss and val loss during training.
- Validate the Model:
- Evaluate the trained model on the validation set to ensure it generalizes well to new, unseen data.
- Inference on Test Set:
- After training, perform inference on a separate test set to assess the model's performance on completely unseen data.