This is the mini project from EC601.
Author: Min Zhou
Email: [email protected]
In this mini project, I trained two different deep learning models to recognize roses and sunflowers.
- A simple model(without conv layer): only contains one simple flatten layer and two densely-connected NN layers.
- VGG-16 model: using the VGG-16 structure.
- Training, validation and test dataset:
Number of training examples = 1092
Number of validation examples = 274
Number of test examples = 152
X_train shape: (1092, 64, 64, 3)
y_train shape: (1092,)
X_val shape: (274, 64, 64, 3)
y_val shape: (274,)
rose
folder: images of rose.sunflower
folder: images of sunflower.test_images
folder: store all the images you want to test using the trained model. There are three images already if you don't have test images.flower_recognition_using_deep_learning.ipynb
: the Jupyter Notebook for developing and training the model.simple_flower_recognition.py
: the python API to run the trained "simple model".simple_model.h5
: trained model weights.simple_model.json
: trained model.vgg16_model.h5
: trained VGG-16 weights(This file is too big can't be uploaded to github)vgg16_model.json
: trained VGG-16 model.requirements.txt
: necessary python libraries.
The test accuracy of the simple model and VGG-16 model are 85.5% and 55.9% respectively. There are some main facts caused the lower accuracy of VGG-16 model:
- Overfitting
- Lack of data.
- The model is too complex for this simple binary classification problem.
- Optimal hyperparameters need to be tuned in the future.
git clone https://github.com/minzhou1003/deep-learning-miniproject.git
There are three images already if you don't have test images.
cd deep-learning-miniproject
virtualenv --python python3 env
source env/bin/activate
pip install -r requirements.txt
python simple_flower_recognition.py
$ python simple_flower_recognition.py
Using TensorFlow backend.
Did you put all test images to the "/test_images" folder? ("yes"/"no") yes
2018-10-22 01:33:58.746880: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
Model successfully loaded from disk!
Image: 15951588433_c0713cbfc6_m.jpg, Predict result: rose
Image: 15965652160_de91389965_m.jpg, Predict result: rose
Image: 15972975956_9a770ca9dd_n.jpg, Predict result: sunflower
- Use TensorFlow (or any tool you prefer) to recognize between two classes of objects.
- Roses and Sunflowers
- You need to capture the images yourself and tag them. You can use any Tagging system (e.g, https://hubs.ly/H0dktLv0 Neurala).
- You need to design your own Training, Testing, and Verification sets.
- You need to compare between two different systems based on the literature review you did and/or reading the material provided Bonus: [x] Provide an API with example code for another developer to use your system