Skip to content

fsantamaria1/Bird_Classification

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 

Repository files navigation

Bird Classification Machine Learning Model

This repository contains a machine learning model for multi-class bird species classification. The model is implemented in a Jupyter Notebook, and it utilizes various deep learning techniques to train and evaluate the model's performance.

Table of Contents

Introduction

The goal of this project is to develop a machine learning model that can accurately classify bird species based on input images. The model is built using TensorFlow and Keras, and it leverages transfer learning with the InceptionV3 architecture. The model is trained and evaluated using a dataset of bird images.

Getting Started

To run the Jupyter Notebook and use the machine learning model, follow these steps:

  1. Clone the repository:
git clone https://github.com/fsantamaria1/Bird_Classification.git
  1. Install the required dependencies:
  • matplotlib
  • pandas
  • numpy
  • tensorflow
  • tensorflow_hub
  • fastai
  1. Launch Jupyter Notebook and open the Bird_Classification.ipynb file.

  2. Run the cells in the notebook sequentially to execute the code and train the model.

Dataset

The model uses a bird species dataset obtained from Kaggle. The dataset contains images of 525 different bird species. The images are divided into training, testing, and validation sets.

The dataset can be downloaded using the Kaggle API by following the instructions provided in the notebook. The downloaded dataset is stored in a zip file (100-bird-species.zip), which is then extracted to the appropriate directories for training, testing, and validation.

Preprocessing

Before training the model, the images are preprocessed using the following steps:

  1. Rescaling: The pixel values of the images are rescaled to a range of 0 to 1.

  2. Data Augmentation: Data augmentation techniques are applied to the training data to increase the diversity of the training set and improve the model's generalization.

Model Training

The model training process involves the following steps:

  1. Base Model Creation: The InceptionV3 architecture is used as the base model for transfer learning.

  2. Freezing Base Model Layers: Initially, all layers of the base model are frozen to prevent their weights from being updated during training.

  3. Model Compilation: The model is compiled with the categorical cross-entropy loss function, Adam optimizer, and accuracy metric.

  4. Fit the Model: The model is trained on the training data for a specified number of epochs, with early stopping based on validation loss.

Evaluation

After training the model, it is evaluated on the test data to assess its performance. The accuracy metric is used to measure the model's ability to correctly classify bird species.

Model Improvement

To further improve the model's performance, the top layers of the base model are unfrozen, and fine-tuning is applied. Only the last 10 layers of the base model are trainable, while the remaining layers are kept frozen.

The model is then recompiled and refit on the training data, with early stopping based on validation loss. The fine-tuning process aims to improve the model's ability to extract relevant features for bird species classification.

Saving the Models

Two versions of the trained models are saved:

  1. Base Model: The initial model before fine-tuning, saved as base_bird_model.h5.

  2. Tuned Model: The model after fine-tuning, saved as tuned_bird_model.h5.

These saved models can be used later without the need to retrain the models.

Additional Resources

For more details on the implementation and analysis, please refer to the Jupyter Notebook in this repository.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published