Developing a CNN

Tags: control and think
Personhours: 12
Developing a CNN By Arjun and Abhi

Task: Begin developing a Convolutional Neural Network using TensorFlow and Python

Now that we have gathered and labeled our training data, we began writing our Convolutional Neural Network. Since Abhi had used Python and TensorFlow to write a neural network in the past during his visit to MIT over the summer, we decided to do the same now.

After running our model, however, we noticed that it was not very accurate. Though we knew that was due to a bad choice of layer structure or hyperparameters, we were not able to determine the exact cause. (Hyperparameters are special parameters that need to be just right for the neural network to do well. If they are off, the neural network will not work well.) We fiddled with many of the hyperparameters and layer structure options, but were unable to fix the inaccuracy levels.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
model = Sequential()
model.add(Conv2D(64, activation="relu", input_shape=(n_rows, n_cols, 1), kernel_size=(3,3)))
model.add(Conv2D(32, activation="relu", kernel_size=(3,3)))
model.add(MaxPooling2D(pool_size=(8, 8), padding="same"))
model.add(Conv2D(8, activation="tanh", kernel_size=(3,3)))
model.add(MaxPooling2D(pool_size=(8, 8), padding="same"))
model.add(Conv2D(4, activation="relu", kernel_size=(3,3)))
model.add(Conv2D(4, activation="tanh", kernel_size=(1,1)))
model.add(Flatten())
model.add(Dense(2, activation="linear"))
model.summary()

Next Steps

We have not fully given up, though. We plan to keep attempting to improve the accuracy of our neural network model.

Date | October 13, 2018