MNIST Image Recognition Convultional Neural Network (CNN) | by Jose M Serra Jr | Jan, 2024

While exploring TensorFlow for designing, building, and testing a CNN on the image recognition task of MNIST dataset. The MNIST dataset that I am using a grayscale handwritten number system where I am reading in values using the TensorFlow library. Afterwards, I began dabbling in the design of a CNN, and came up with a Functional TensorFlow Deep Learning model:

input_data = Input([28,28,1])
x = Conv2D(128, kernel_size=3,strides=(2,2), activation='relu')(input_data)
x = MaxPooling2D((2,2))(x)
x_1 = Conv2D(128, kernel_size=3, strides=(2,2),activation='tanh')(input_data)
x_1 = MaxPooling2D((2,2))(x_1)
cat_1 = Concatenate(axis=1)([x,x_1])
act_1 = Dense(64,activation='relu')(cat_1)
flat = Flatten()(act_1)
output = Dense(10,activation='softmax')(flat)
model = Model(input_data,output)

I decided on this structure because I wanted to test out features such as the Concatenation layer which is used in the Visual Geometry Group 19th, and 16th layer CNN. My two layer architecture achieved an classification accuracy of 0.99959. Improvements I could suggest would be to try to decrease the number of units that each Convolutional Layer, and try to make the size of the CNN smaller.

Source link

Be the first to comment

Leave a Reply

Your email address will not be published.