Lab Assignment 9 - nikky4222/BigDataSpring2017 GitHub Wiki

Big Data Assignment 9


Student id:16231555
Class id:18
Name:Lakshmi Nikitha Kona

Task 1
Write a TensorFlow program for the following Task.
a.Implement a CNN model for image classification for the datasets that you consider relevant to your project.
b.Report accuracy and time to build the CNN model.
c.Visualizations (Tensor Board): training, loss, weights etc.
DataSet
Used a sub-set of CIFAR-10(10000 images) The CIFAR-10 dataset consists of 60000 32x32 colour images in 10 classes, with 6000 images per class. There are 50000 training images and 10000 test images. The dataset is divided into five training batches and one test batch, each with 10000 images. The test batch contains exactly 1000 randomly-selected images from each class. The training batches contain the remaining images in random order, but some training batches may contain more images from one class than another. Between them, the training batches contain exactly 5000 images from each class.


Program For CNN

data_path = "/home/nikky/Desktop/source/MNIST_SOFTMAX/data_new/CIFAR-10/data_batch_1"

fo = open(data_path, 'rb')

fo.seek(0)

dict_ = (pickle.load(fo,encoding='bytes'))

l=np.array(dict_[b'labels'])

d=np.array(dict_[b'data'])

fo.close()

trX,tstX,trY,tstY = train_test_split(d,l , test_size=0.33, random_state=42)

target=np.zeros((6700,10))

for i in range(0,len(target)-1):

x=trY[i]

target[i-1][x]=1
Convolutional Neural Networks are very similar to ordinary Neural Networks from the previous chapter: they are made up of neurons that have learnable weights and biases. Each neuron receives some inputs, performs a dot product and optionally follows it with a non-linearity. The whole network still expresses a single differentiable score function: from the raw image pixels on one end to class scores at the other. And they still have a loss function (e.g. SVM/Softmax) on the last (fully-connected) layer and all the tips/tricks we developed for learning regular Neural Networks still apply. So what does change? ConvNet architectures make the explicit assumption that the inputs are images, which allows us to encode certain properties into the architecture. These then make the forward function more efficient to implement and vastly reduce the amount of parameters in the network.

Accuracy & Execution



Graph


Other Tensor Board Graphs






Task 2
Develop a Web-based Application for Visual Question Answering that is relevant to your own project including the following features
a.Google Conversation API
b.Question answering for images
c.Connect it to Clarifai API or Spark AP.


API.AI makes it possible for your service to receive and respond to user queries in natural language. So whether you aim to answer questions or help users to be more productive, API.AI can help you build engaging experiences.

Data Retrival




Google Conversation



⚠️ **GitHub.com Fallback** ⚠️