Skip to content

Here's the model written in Python using TensorFlow, where I employ Convolutional Neural Networks and deep learning techniques for the task of plant classification

License

Notifications You must be signed in to change notification settings

FrancescoZanella/Neural_networks_Plant_species_classification

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Plant Species Classification - README

Problem Description

The task is to classify images of plants into eight different species categories. Each category corresponds to a specific plant species. The goal is to build a machine learning model that can predict the correct class label for a given image.

Dataset Details

You can download the dataset here

  • Image Size: 96x96 pixels

  • Color Space: RGB

  • File Format: JPG

  • Number of Classes: 8

  • Classes:

    1. Species1
    2. Species2
    3. Species3
    4. Species4
    5. Species5
    6. Species6
    7. Species7
    8. Species8

Dataset Structure

The dataset is organized in a single folder named "training," which contains 3542 images. These images are already divided into sub-folders, each corresponding to a specific class. The distribution of training images per class is as follows:

  • Species1: 186 images
  • Species2: 532 images
  • Species3: 515 images
  • Species4: 511 images
  • Species5: 531 images
  • Species6: 222 images
  • Species7: 537 images
  • Species8: 508 images

Code Overview

The provided Python code aims to address the plant species classification task. Here's a high-level overview of the code's structure and the approach used:

  1. Setup and Dependencies

    • The code begins by importing necessary libraries and setting up the environment.
    • It installs the keras_tuner package and imports various TensorFlow and Keras components.
  2. Data Loading and Preprocessing

    • The code loads and preprocesses the dataset using TensorFlow utilities.
    • It applies data augmentation techniques to the training dataset to improve model generalization.
  3. Model Building

    • The code defines a neural network model for plant species classification.
    • It starts with a convolutional base followed by fully connected layers.
    • The model uses transfer learning with Xception and fine-tuning of layers.
  4. Training

    • The code trains the model using the training dataset.
    • Training includes an early stopping callback to prevent overfitting.
    • Three phases of training are conducted: base model, fine-tuning all layers, and fine-tuning specific layers.
  5. Keras Tuner

    • The code uses Keras Tuner to search for optimal hyperparameters for model training.
    • It defines a hyperparameter search space and performs a search to find the best hyperparameters.

How to Use the Code

  1. Ensure you have the required Python libraries installed, especially TensorFlow, Keras, and Keras Tuner.

  2. Organize your dataset into the structure described in the "Dataset Structure" section.

  3. Open the provided Python code in a compatible environment (e.g., Jupyter Notebook, Google Colab).

  4. Run the code step by step, following the order described in the code.

  5. After training, you can use the trained model for plant species classification on new images.

Report

For more details about the model you can read the report, where everyting is explained in detail.

Conclusion

This code is designed to address the plant species classification task with the provided dataset for ANNDL course challenge here at polimi. My team have received 5.5 out of 5.5 points doing this challenge.

About

Here's the model written in Python using TensorFlow, where I employ Convolutional Neural Networks and deep learning techniques for the task of plant classification

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published