This project demonstrates the use of transfer learning with the MobileNet architecture to classify images of alpacas using a small, specialised dataset. The Alpaca Dataset (Small), sourced from Kaggle, provides diverse images of alpacas in varying poses, lighting conditions, and backgrounds. The aim of this project is to fine-tune MobileNet, a pre-trained convolutional neural network, to achieve high performance in a niche image classification task with limited data.
This project explores:
-
The principles of transfer learning.
-
Modifications to MobileNet for task-specific fine-tuning.
-
Data preprocessing techniques for small datasets.
-
Training, evaluation, and deployment of a lightweight model for image classification.
The Alpaca Dataset (Small) contains high-quality images of alpacas. It includes a variety of poses and backgrounds to challenge the model’s ability to generalise. The dataset was curated to mimic real-world scenarios where data availability is limited.
Source: Kaggle Alpaca Dataset (Small)
-
dataset/
: Contains the Alpaca Dataset. -
notebooks/
: Contains the main Jupyter Notebook where the analysis, training, and results are documented. -
models/
: Saved weights and configurations of the trained MobileNet model. -
src/
: Includes thetest_utils.py
file, which provides helper functions or classes used in the notebook. -
results/
: Outputs such as evaluation metrics and test results. -
README.md
: Project documentation (this file).
The project follows these steps:
-
Data Collection: Import and review the Alpaca Dataset.
-
Data Preprocessing: Resize, normalise, and augment the dataset for training.
-
Model Preparation: Load the pre-trained MobileNet model and adjust its layers for classification.
-
Training: Fine-tune the model on the Alpaca Dataset.
-
Evaluation: Assess the model using accuracy and loss metrics.
-
Deployment: Test the model on unseen data to validate its generalisation capability.
To run the project, you need the following:
-
Python 3.8 or later
-
TensorFlow 2.x
-
NumPy
-
Matplotlib
-
Pandas
-
Jupyter Notebook
Install dependencies using:
pip install -r requirements.txt
The fine-tuned MobileNet achieved high accuracy on the Alpaca Dataset, demonstrating the power of transfer learning in adapting pre-trained models for small, task-specific datasets. Evaluation metrics and sample predictions are available in the results/ folder.
-
Transfer learning enables efficient training on small datasets.
-
Data augmentation helps prevent overfitting.
-
MobileNet’s lightweight architecture is ideal for resource-constrained tasks.
-
Explore additional datasets to test model generalisation further.
-
Implement real-time alpaca detection using the trained model.
-
Experiment with alternative architectures like ResNet or EfficientNet.
-
Deeplearning.ai for the MobileNet tutorial.
-
Kaggle for providing the Alpaca Dataset.
This project is licensed under the MIT License - see the LICENSE file for details.