Introduction
Image classification is one of the most exciting applications of computer vision. It powers technologies in sports analytics, autonomous driving, healthcare diagnostics, and more.
In this project, we take you through a complete, end-to-end workflow for classifying Olympic sports images — from raw data to real-time predictions — using EfficientNetV2S, a state-of-the-art deep learning model.
Our journey is divided into three clear steps:
- Dataset Preparation – Organizing and splitting images into training and testing sets.
- Model Training – Fine-tuning EfficientNetV2S on the Olympics dataset.
- Model Inference – Running real-time predictions on new images.
Watch the full tutorial here : https://youtu.be/lomMTiG9UZ4
You can download the code here : https://ko-fi.com/s/a91cfcced2
You can find more tutorials, and join my newsletter here : https://eranfeit.net/
If you are interested in learning modern Computer Vision course with deep dive with TensorFlow , Keras and Pytorch , you can find it here : http://bit.ly/3HeDy1V
Perfect course for every computer vision enthusiastic
Before we continue , I actually recommend this book for deep learning based on Tensorflow and Keras : https://amzn.to/3STWZ2N
Enjoy
Eran
Step 1 – Preparing and Splitting the Dataset
Before training a model, we need to organize the dataset. The Olympics dataset we use contains folders, each representing a different sport (e.g., swimming, gymnastics, athletics).
To ensure accurate evaluation:
- Training set (90%) – Used for teaching the model.
- Testing set (10%) – Used for measuring performance on unseen data.
The dataset split keeps the original folder structure so the model retains class labels. Shuffling images ensures a fair and balanced distribution between training and testing sets.
Step 2 – Training with EfficientNetV2S
With the dataset ready, it’s time to train the model. Instead of starting from scratch, we use transfer learning with EfficientNetV2S, which is already trained on millions of images from ImageNet.
Here’s how we adapt it to our project:
- Keep the feature extraction layers from EfficientNetV2S.
- Add custom layers to classify our specific sports categories.
- Fine-tune the model so it learns both general image features and sport-specific patterns.
To improve generalization, we apply data augmentation during training — random flips, zoom, and shearing — so the model learns to handle different camera angles, lighting conditions, and athlete positions.
We train for multiple epochs, using tools like EarlyStopping and ModelCheckpoint to save the best version of the model and avoid overfitting.
Step 3 – Making Real-Time Predictions
The final step is to use the trained model to classify new, unseen images.
Our test image :
The prediction process includes:
- Preprocessing – Resize the image, normalize pixel values, and prepare it in the same way as during training.
- Prediction – The model outputs probabilities for each class.
- Result Extraction – The class with the highest probability becomes the prediction.
- Visualization – The predicted sport is overlaid on the image and displayed or saved.
This makes the system ready for practical use, instantly recognizing the sport in any given image.
Results
The model delivers high accuracy, successfully identifying sports across a variety of test images. Predictions are clearly displayed on the images, making it easy to verify correctness.
This approach is flexible — you can replace the Olympics dataset with any other labeled image set and train the same way to classify different subjects.
Conclusion
In this project, we went from raw images to a fully working classification system in just three steps:
- Organizing and splitting the dataset.
- Training EfficientNetV2S with transfer learning and fine-tuning.
- Running real-time predictions with visual output.
This workflow is a strong foundation for creating your own custom image classification projects, whether for sports, wildlife, medical images, or any other domain.