Transfer Learning-Rock Paper Scissors Classifier

Transfer Learning-Rock Paper Scissors Classifier

How to use transfer learning for classifying images. Growing up building things using Lego has always been fun, so is building machine learning algorithm from scratch.

Growing up building things using Lego has always been fun, so is building machine learning algorithm from scratch. Usually, machine learning algorithms are sufficient for various applications but when it comes to huge data size and classifying images we need more powerful machine learning algorithms hence deep learning comes into picture. Building an algorithm is always beneficial but time consuming so why not use existing algorithms and model for similar type of data. The process of using the stored knowledge which is gained while solving one problem and applying it to a different but similar problem is called Transfer Learning. Let’s get a better picture of how we can use some really powerful convolutional neural network on our own data set.

Import dependencies

As usual before starting any machine learning problem we need to import the dependencies and the libraries — just laying the foundation to build our entire model on.

import tensorflow as tf
    import tensorflow_datasets as tfds
    import matplotlib.pyplot as plt
    import numpy as np
    import platform
    import datetime
    import os
    import math
    import random

    print('Python version:', platform.python_version())
    print('Tensorflow version:', tf.__version__)
    print('Keras version:', tf.keras.__version__)

Import data

The data we will be using are computer generated images of hands showing the different pose for rock paper scissors. The “rock paper scissors” dataset is available directly from the Tensorflow package. In the cells that follow, we’ll get the data, plot a few examples, and also do some pre-processing.

import tensorflow_datasets as tfds
    (ds_train, ds_test), ds_info = tfds.load(
        'rock_paper_scissors',
        split=['train', 'test'],
        shuffle_files=True,
        with_info=True
    )

To know how our data set looks like using the following cell.

fig = tfds.show_examples(ds_info, ds_train)
    classes = np.array(['rock', 'paper', 'scissors'])

image-classification data-science deep-learning machine-learning

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

What is Image Classification? Data Augmentation? Transfer Learning?

In this article, we will explore the image classification problem. The first part will present training a model from scratch, the second will present training with data augmentation, and the last transfer learning with pre-trained models.

Most popular Data Science and Machine Learning courses — July 2020

Most popular Data Science and Machine Learning courses — August 2020. This list was last updated in August 2020 — and will be updated regularly so as to keep it relevant

PyTorch for Deep Learning | Data Science | Machine Learning | Python

PyTorch for Deep Learning | Data Science | Machine Learning | Python. PyTorch is a library in Python which provides tools to build deep learning models. What python does for programming PyTorch does for deep learning. Python is a very flexible language for programming and just like python, the PyTorch library provides flexible tools for deep learning.

Image Classification with ANN | Data Science | Machine Learning | Python

ANN have gradually become quite different from their biological cousins. In this Article, I will build an Image Classification model with ANN to show you h

Image Classification with ANN | Data Science | Machine Learning | Python

ANN have gradually become quite different from their biological cousins. In this Article, I will build an Image Classification model with ANN to show you h