/convolutional-neural-network

Convolutional neural network using Tensorflow 2.0 for computer vision / image recognition.

Primary LanguageJupyter Notebook

Convolutional Neural Network - TensorFlow 2.0

Tensorflow

Colab

Background

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.

The classes are completely mutually exclusive. There is no overlap between automobiles and trucks. "Automobile" includes sedans, SUVs, things of that sort. "Truck" includes only big trucks. Neither includes pickup trucks.

The original dataset can be found here: https://www.cs.toronto.edu/~kriz/cifar.html

Labels (Object Classes)

Each training and test example is assigned to one of the following pontential labels:

  • airplane
  • automobile
  • bird
  • cat
  • deer
  • dog
  • frog
  • horse
  • ship
  • truck

Approach

In this example, I'm using a convolutional neural network with Tensorflow 2.0 consisting of two convolutional layers, each one followed by a max pooling layer. The results of the final pooling layer are flattened and then passed into an artificial neural network consitently of two layers, one with 128 neurons and the other with 256 neurons, each having dropout of 20-40% to prevent overfitting.

On the training set, I was able to achieve about 96% accuracy, however the test set maxed out at 70% which suggests there is some overfitting on the training data. Work in progress, but more or less to just get some more practice with TF-2.0.

Links

  • KaizenTek - IT Consulting & Cloud Professional Services