Skip to content

Classification of CIFAR dataset with CNN which has %91 accuracy and deployment of the model with FLASK.

Notifications You must be signed in to change notification settings

MelihGulum/CIFAR-10-CNN-FLASK-Deployment

Repository files navigation

CIFAR-10 CNN and FLASK Deployment

This project has been done in the field of image processing, which is one of the pursuits of artificial intelligence. In the project ,well known CIFAR10 dataset and CNN architecture, which has proven itself successfully in image processing from deep learning is used.

  1. DATASET
  2. Deep Learning - CNN
  3. FLASK
  4. How to Run

1. DATASET

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. It was collected by Alex Krizhevsky, Vinod Nair, and Geoffrey Hinton.

2. Deep Learning - CNN

First we normalized the data and then made it categorical. Afterwards for data augmentation we used ImageDataGenerator. CNN architecture is shown belown. There are some changes in the model. These are:

  • This model has been strengthened by increasing its complexity.
  • Optimizer is chosen as Adam and default parameters set.
  • ReduceLROnPlateau and EarlyStopping callbacks added to prevent overfitting and overtraining.

After the model training is finished, the accuracy and loss graphs of the training are shown in the following two figures. The accuracy of the model is %91.74.

3. FLASK

Flask is a micro web framework written in Python. It is classified as a microframework because it does not require particular tools or libraries.

  • You can load a local image or a url.
  • The top 3 predictions of the image that loaded and their percentage will be shown in redirected page. The following two figure are outputs of the web programming, FLASK.

4. How to Run

  1. Fork this repository.
$ git clone https://github.com/MelihGulum/CIFAR-10-CNN-FLASK-Deployment.git
  1. Load the dependencies of the project

NOTE: This dependencies not including the Deep Learning part. Colab meet all dependencies (such as tensorflow).

pip install -r requirements.txt
  1. Now you can run app.py. But if you want you can run .ipynb and you can build your own model. It is up to you.