Multiclass Classification with CNN-2D

Multiclass Classification with CNN-2D

Multiclass Classification with CNN-2D. I know there are many blogs about CNN and multi-class classification, but maybe this blog wouldn't be that similar to the other blogs.

In Multiclass classification, the instances can be classified into one of three or more classes. Here, the Dataset contains image data of Natural Scenes around the world that are distributed into 6 different categories. {‘buildings’- 0, ‘forest’- 1, ‘glacier’- 2, ‘mountain’- 3, ‘sea’ - 4, ‘street’ - 5 }

There are 14034 images in Train data and 3000 images in Test data.

Data Source: https://www.kaggle.com/puneet6060/intel-image-classification

Import Libraries

import tensorflow
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Conv2D
from tensorflow.keras.layers import MaxPooling2D
from tensorflow.keras.layers import Flatten
from tensorflow.keras.layers import Dense, Dropout
from tensorflow.keras.utils import to_categorical
print('Tensorflow Version: ',tensorflow.__version__)

Image for post

CNN-2D Model

## ImageDataGenerator generate batches of tensor image data with real-time data augmentation.
from tensorflow.keras.preprocessing.image import ImageDataGenerator

train_datagen = ImageDataGenerator(rescale = 1./255,
                                   shear_range = 0.2,
                                   zoom_range = 0.2,
                                   horizontal_flip = True)
test_datagen = ImageDataGenerator(rescale = 1./255)
training_set= train_datagen.flow_from_directory('dataset/seg_train',
                                  target_size = (64, 64),
                                  batch_size = 32,
                                  class_mode='binary')
test_set = test_datagen.flow_from_directory('dataset/seg_test',
                                            target_size = (64, 64),
                                            batch_size = 32,
                                            class_mode='binary')

multiclass-classification tensorflow convolution-neural-net

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

jQuery Ajax CRUD in ASP.NET Core MVC with Modal Popup

In this article, we’ll discuss how to use jQuery Ajax for ASP.NET Core MVC CRUD Operations using Bootstrap Modal. With jQuery Ajax, we can make HTTP request to controller action methods without reloading the entire page, like a single page application.

Complete Guide to CNN for MNIST Digits Classification with Tensorflow 2.x

We will learn, What is a CNN? And build a CNN model for digits classification. Complete Guide to CNN for MNIST Digits Classification with Tensorflow 2.x

Convolutional Neural Networks-An Intuitive approach

Artificial intelligence has seen a tremendous growth over the last few years, The gap between machines and humans is slowly but steadily decreasing.

Satellite image classification with a convolutional neural network.

My latest project at Flatiron was to use neural networks to classify satellite image tiles. I chose to use a convolutional neural network (CNN).

Real-World Python Neural Nets Tutorial (Image Classification w/ CNN) | Tensorflow & Keras

In this video we walk through the process of training a convolutional neural net to classify images of rock, paper, & scissors. We do this using the Tensorflow & Keras libraries. This is a follow-up to the first video I posted on neural networks.