Image classification projects

Project Goal

This project aims to utilize EfficientNet (CNN) for creating custom-trained image classification models for 3 different applications.

  • 1. Sports Classifier (Multi-class)
  • • Able to predict up to 100 different classes of sports.

  • 2. Playing Cards Classifier (Multi-class)
  • • Able to predict up to 53 different classes of playing cards including the joker.

  • 3. Dog Classifier (Multi-class)
  • • Able to predict up to 120 different dog breeds.

General steps for fine-tuning a pre-trained model

NOTE: Other CNNs models such as ResNet or mobilenet are applicable as well. You can find these modelshere.

    1. 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.

    2. 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.

    3. 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.

    4. Augment Images (if needed):

    • Data augmentation techniques can be applied to artificially increase the diversity
    of your dataset. This helps the model generalize better.

    5. 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.

    6. Validate the Model:

    • Evaluate the trained model on the validation set to ensure it generalizes well
    to new, unseen data.

    7. Inference on Test Set:

    • After training, perform inference on a separate test set to assess the model's performance on completely unseen data.

Custom-trained model's result:

ModelAccuracy
Playing cards classifier97%
Sports Classifier93%
Dog Classifier75%

Chat Assistant

Hi! How can I help you today?