This project focuses on classifying dog breeds using deep learning techniques. The goal is to build an effective model capable of distinguishing between various dog breeds. The project encompasses data preprocessing, model training, hyperparameter tuning, and evaluation.
The project is organized into several key sections:
- Various Python modules are imported for data manipulation, visualization, and deep learning.
- The project uses a dog breed classification dataset from Stanford University.
- Helper functions are defined for visualizing images, plotting training history, benchmarking models, showing results, and generating a classification report.
- The dataset is downloaded and extracted.
- Images are cropped and preprocessed to reduce background noise.
- Data is split into training, validation, and test sets.
- Image data generators are created for data augmentation.
- A simple CNN model is implemented as a baseline for dog breed classification.
- The model is trained, and its performance is visualized.
- NASNetLarge, a pre-trained deep learning model, is used for transfer learning.
- The model is fine-tuned on the dog breed dataset, and its performance is evaluated.
- Hyperparameters for the NASNetLarge model are optimized using Keras Tuner.
- The best hyperparameters are selected, and the model is re-trained.
- The last layers of the NASNetLarge model are fine-tuned to improve performance.
- The fine-tuned model is evaluated on the test set.
- Predictions are made using the trained models.
- Results are visualized, and misclassifications are analyzed.
- A confusion matrix and classification report are generated.
- The total time taken for the project execution is displayed at the end.
- The final models (NASNetLarge and fine-tuned NASNetLarge) are saved.
- The class labels are saved using pickle for future use.
Note: Ensure that the necessary datasets and dependencies are available before running the code.
This project was created by Fouad Maherzi.