Skip to content
GTHome
All projects

ML Engineer (Solo) · 2024

Open SourceSource-available

Fine-Tuned Image Classifier

Transfer learning project using MobileNetV2, ResNet, and VGG16 for image classification, improving accuracy through model fine-tuning.

PythonTensorFlowKerasOpenCV

Source-available

Fine-Tuned Image Classifier

PythonTensorFlowKeras

Problem

Training image classifiers from scratch is data- and compute-intensive, especially for smaller, domain-specific datasets.

Approach

Applied transfer learning with MobileNetV2, ResNet, and VGG16 backbones, fine-tuning each on a target dataset and comparing accuracy and efficiency trade-offs.

Tech highlights

Python with TensorFlow/Keras for model definition and training, OpenCV for image preprocessing, and a head-to-head comparison across the three architectures.

Results

MobileNetV2 with a new classification head reached 97.7% validation accuracy, and 99.0% on the held-out test set after unfreezing the top layers and fine-tuning at a lower learning rate. A per-class report in the same notebook reads 48%, which is chance level: predictions and labels were taken in two separate passes over a shuffled dataset, so they no longer lined up. Evaluating batch by batch, with each batch's images and labels kept together, fixes it.

Challenges

Avoiding overfitting when fine-tuning large ImageNet backbones on a small target dataset: tuning how many layers to unfreeze and how low to drop the learning rate so the pretrained features survived, and keeping the comparison fair when MobileNetV2, ResNet, and VGG16 have very different parameter counts and memory footprints.

More like this