Build a Convolutional Neural Network for image classification by using Tensorflow library
Image classification is an important task that may be needed in several fields in our daily life, there are many datasets on which machine learning algorithms are applied.
In this article, I'll show a basic program for a constitutional neural network applied on MNIST dataset for handwritten images using Keras.
MNIST dataset Overview
Each image is black and white and has a size of 28x28 pixels.
This image shows some samples.
To load the dataset in a Python program, Kears gives a simle command line to do so.
what is a CNN?
CNN's architecture is very simple. It's in the form of convolution layers stacked to fully connected layers. The convolution layers aim to reduce the conditionality of the input data before feeding it to the neural network.
This idea was first introduced by Yann Lecun who is an artificial intelligence scientist in Facebook. The special thing about CNN is that they are capable of learning the most characterizing features in an image.
In our case, a simple architecture of CNN is used with two convolution layers followed by maxpooling layers. At last we have two dense layers.
RESULTS
Keep reading, there are some visuals at the end.
LOG:
After 3 epochs of training, we've got this 98% accuracy on the test data. We can achieve better result by parameter tuning.
Commentaires
Enregistrer un commentaire