A project utilizing transfer learning for flower species classification.
View Model Performance
Table of Contents
This image classification project attempts to classify images of ten species of flowers that were collected by various groups and individuals in Gainesville, Florida. Pictures
were taken for the following species:
- Garden Roses
- Southern Magnolias
- Lilies
- Sunflowers
- Orchids
- Marigold
- Hibiscus
- Fire Bush
- Pentas
- Bougainvillea
Over 125 training images of each species to be classified were amassed, as depicted in the bar graph below.
All necessary packages to create and test the accuracy of the image classification mentioned next only require the base packages bundled in the Anaconda python distribution
First, clone the repo!
git clone https://github.com/EEE3773-UF-Summer2022/final-project-flour-power.git
cd final-project-flour-powerNext, ensure execution of the python scripts is allowed
chmod u+x create_model.py
chmod u+x evaluate_model_performance.pyNext, copy the training imageset to the root of the project directory. The training imageset can be downloaded from canvas or found in the shared folder when working with HiperGator.
To train and create the image classification model, one may run
python create_model.py <name of training imageset> <name of training imageset labels>Note To create a test dataset and its labels from the training set, the --debug flag may be used
- Use of the debug flag is not required and is helpful when only a training dataset is provided
- Use of the --debug flag is seen below
For example, to create a model with the training images and corrected training labels as well as save a derived test set, one may run
python create_model.py data_train.npy corrected_labels.npy --debugThe script will output an image classification model in the h5 format, "image_model.h5" when it has ran successfully.
Note To use a pre-existing model, simply:
- Skip execution of the create_model.sh
- Copy your model file to the root of the project directory
- Specify your model file when running "evaluate_model_performance.py" as seen below
To evaluate the model's performance against a user-specified training or testing image set, one may run
python evaluate_model_performance.py <filename of dataset> <filename of dataset labels <filename of model.h>Warning The evaluate_model_performance.py script EXPECTS that the dataset specified is in following format
- 270,000 x M (numpy array, where M is the number of test samples)
For example, to evaulate the performance of the model with the debug test set generated above, one may run
python evaluate_model_performance.py debug/X_test_from_training.npy debug/X_test_from_training_labels.npy image_model.h5A jupyter notebook, 'Final Project - Training and Testing Examples.ipynb' has also been included in this repo. This notebook includes example code to run the test and train scripts detailed above.
The following accuracy was seen when using the test set and its labels generated from the --debug option with the training set
- David Moore - [email protected]
- Gunnar Fandrich - [email protected]
- Marc Martorell - [email protected]
- Garrett Bowman - [email protected]
Project Link: https://github.com/EEE3773-UF-Summer2022/final-project-flour-power.git
If you made it this far, thank you for reading along and possibly testing our model's performance!
This README was proudly written 100% with nano :)

