General steps for fine-tuning a pre-trained CNN model:
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.