Lab 6 - AvniM/Big-Data-Analytics GitHub Wiki

Link to source code

Team Members:

Name: Avni Mehta, Class Id: 11

Name: (Trinadha) Raji Muppala, Class Id: 14

Task 1 Objective:

Create android application for image classification using Spark API

Input:

The dataset for our project is MS COCO dataset. COCO is a large-scale object detection and segment detection dataset. We have picked interior domain. The categories in this domain is kitchen, bathroom, bedroom, living room.

Data Pre-processing:

No pre-processing of data required.

Code:

Explanation: • The code for Spark API is created using ionic application.

• Ionic is calls the spark server and the server calls the random forest classifier that is trained on our project dataset.

Output:

Android application using Spark

Task 2 Objective:

Create android application TensorFlow REST API and Web Client.

Input:

The dataset for our project is MS COCO dataset. COCO is a large-scale object detection and segment detection dataset. We have picked interior domain. The categories in this domain is kitchen, bathroom, bedroom, living room.

Data Pre-processing:

No pre-processing of data required for TensorFlow Inception model. However, for Softmax and CNN we had to change the data in MNIST format.

Code:

Explanation:

• The code for TensorFlow Rest API is created using ionic application.

• Ionic is used to connect the FLASK API with android application.

• The FLASK API calls the inception model that is trained on our project dataset.

• Only the last layer of the inception model is retrained for our project categories

• The hyper parameters set are learning rate = 0.01, train_batch_size = 100, n_epochs = 200

Output:

The TensorFlow Inception model is run on web is able to predict the category of the dataset. Out of 20 test images, 2 were classified incorrectly. However, we are facing issues while running on android

After clicking predict we are getting this error. The same code is working on web but not on android.

Tensorboard Visualization: We have the following visualization:

Task 3 Objective:

Implement android application for Image classification using TensorFlow Lite.

Input:

The dataset for our project is MS COCO dataset. COCO is a large-scale object detection and segment detection dataset. We have picked interior domain. The categories in this domain is kitchen, bathroom, bedroom, living room.

Data Pre-processing:

No pre-processing of data required for TensorFlow Inception model. However, for Softmax and CNN we had to change the data in MNIST format.

Code:

Explanation:

a. The code for TensorFlow Lite is adapted from this link.

b. This app basically takes single input at a time. It resizes the input frame to a fixed height and width, and the resized image is converted to Byte Buffer.

c. The trained model has over 1000 categories and the application sorts the probability of the categories and displays top three.

d. It basically gives fuzzy classification for an image

Output:

The image is predicted correctly

The image is not predicted correctly as the image is taken using camera from image on the laptop