Using CNN with Keras and Tensorflow, we have a deployed a solution which can train any image on the fly. Code uses Google Api to fetch new images, VGG16 model to train the model and is deployed using Python Django framework
A Journey Into the Emotions of Software Developers
Object classification using CNN & VGG16 Model (Keras and Tensorflow)
1. Object Classification using CNN
Lalit Jain https://www.linkedin.com/in/lalit7jain/
Rohit Agarwal https://www.linkedin.com/in/rohitag04/
Shivam Goel https://www.linkedin.com/in/goelshi/
Hina Gandhi: https://www.linkedin.com/in/hina-gandhi-52834356/
Big Data & Engineering Systems
Under the guidance of Professor. Dino Konstantopoulos
2. Agenda
1. Case Study
2. Building a Convolutional Neural Network
3. Time Complexity
4. Using VGG16 model
5. Demo
6. Results
7. Limitations & Challenges
8. Future Scope
Agenda
4. Approach
1. Using Google API to download 100 images from the front end using a Keyword
2. Prepare the image by cleaning and augmentation
3. Train the model based on the image downloaded with Convolutional Neural Network
using Keras and Tensorflow
4. Classify the image
Technology Stack:
Programming Language: Python
Front End: Django Framework
Machine Specifications:
Libraries: Keras, Tensorflow, VGG16, etc
8. About the Dataset
We have taken two datasets :
Static Model:
One dataset is related to natural calamities where we have trained our
models for 4 classes “earthquake”, “hurricane”, “tornado” and “volcanic
eruption”.
Dynamic Model:
Other dataset is related to personality identification which will work on the
fly. During demo, we will add one personality on the fly in addition to the
existing classes (Donald Trump, Morgan Freeman)
9. Use case and Scope
1. Using static model, identify one of the 4 natural calamities
2. Using the trained dynamic model, identify the personality
Out of Scope/ Limitations:
1. Being able to identify a class which is not trained
2. Being able to identify 0 as output if image does not match
3. Misclassification of images due to training on uncleaned and inaccurate
image labels
11. Data augmentation for improving the
model
By applying random transformation to our train set, we artificially enhance our
dataset with new unseen images.
shear_range: Rotate image by 0.2
zoom_range: Zoom the image by 0.2
horizontal_flip: Randomly flip inputs horizontally
rescale: rescaling factor (1./255)
12. Building CNN from Scratch
Basic CNN model (the model that was
developed from scratch) gave ~74% accuracy.
16. Using the VGG16 Model
We have created our own sequential model and then added to VGG16.
17. Improvement
Using this approach, the accuracy was improved to 87%.
Time to run the model was still 2-3 hours.
Can we improve the
time?
18. Using GPU machine
Running the model on a AWS instance with Nvidia GK104 GPU (4 GB) powered instance
The epochs that took 1 hour to train 140 images are now executing in under a minute as
shown in next slide with an accuracy of 95%
21. CHALLENGES
1. Limitation of Google API custom search to return only 10 images.
2. Compressing large size images before writing to disk.
3. Basic CNN model took more than 8 hours to run from scratch
4. The total images in all the classes should be same and the batch size should be the
GCD of total images in train and test classes.
5. Django installation and other software installations required lot of configurations in
GPU instance
6. Tried to install quiver engine for visualization of each convoluted layer.
22. Future Scope
1. Facial key point detection
2. Analysis of satellite images for disaster detection
3. Real Time Criminal Detection through Video analysis
4. And many more…