Sunday, February 28, 2021
  • Setup menu at Appearance » Menus and assign menu to Top Bar Navigation
Advertisement
  • AI Development
    • Artificial Intelligence
    • Machine Learning
    • Neural Networks
    • Learn to Code
  • Data
    • Blockchain
    • Big Data
    • Data Science
  • IT Security
    • Internet Privacy
    • Internet Security
  • Marketing
    • Digital Marketing
    • Marketing Technology
  • Technology Companies
  • Crypto News
No Result
View All Result
NikolaNews
  • AI Development
    • Artificial Intelligence
    • Machine Learning
    • Neural Networks
    • Learn to Code
  • Data
    • Blockchain
    • Big Data
    • Data Science
  • IT Security
    • Internet Privacy
    • Internet Security
  • Marketing
    • Digital Marketing
    • Marketing Technology
  • Technology Companies
  • Crypto News
No Result
View All Result
NikolaNews
No Result
View All Result
Home Neural Networks

A visual and intuitive understanding of image classification

June 3, 2020
in Neural Networks
A visual and intuitive understanding of image classification
585
SHARES
3.3k
VIEWS
Share on FacebookShare on Twitter

We are going to start a new deep learning series — Image classification step by step! This is the first part of this tutorial series.

For a 2D image like this, after flattening it into a 1D vector, we are going to feed it into a model to classify the image into one of the single-digit numbers, ranging from 0 to 9.

You might also like

How AI Can Be Used in Agriculture Sector for Higher Productivity? | by ANOLYTICS

Future Tech: Artificial Intelligence and the Singularity | by Jason Sherman | Feb, 2021

Tackling ethics in AI algorithms: the case of Salesforce | by Iflexion | Feb, 2021

Let’s just call this model a network for now. This simple network has only two layers. The input size is 6 times 6, which is 36 in total. The output size is 10. 10 is the number of classes we have.

Each connection between the input layer and the output layer is a model parameter. In this case, we have 360 parameters.

Jobs in AI

Now let’s look at how to do image classification with this model, assuming the model parameters are already optimized.

The first step is to perform a linear weighted sum of the input with the model weights. The output from this step is z, which is just a 1 by 10 vector which stores the scores for each output class.

Then we can feed these scores to a Softmax function. Softmax function will normalize the input vector into the range from 0 to 1, which can now be interpreted as a probability for each class. In this case, we have the highest probability for digit 7. So the model will predict the input image as 7.

This is almost all the math and concept you need to know. Here, I will walk you through the code about how to import the dataset, define the model in this part.

1. AI for CFD: Intro (part 1)

2. Using Artificial Intelligence to detect COVID-19

3. Real vs Fake Tweet Detection using a BERT Transformer Model in few lines of code

4. Machine Learning System Design

Let’s first have a look at the libraries we are using. Pytorch, Numpy and Sklearn, they are all very famous libraries commonly used in both research and industry.

The first step is to import the dataset. Torchvision from Pytorch allows us to import and download the MNIST dataset directly from its API. The MNIST dataset here is one of the most common datasets used for image classification. It is a dataset of handwritten digits, which contains 60 thousand training images and 10 thousand testing images.

Then, we use Dataloader to load the data into an iterator. During this process, we randomly shuffle the dataset and split the dataset into baches. Shuffling the data serves the purpose of reducing variance and making sure that models remain general and overfit less. For example, you need to shuffle your data if it is sorted by their class.

Here for each batch, there are 4 images in it. This line of code will help us to get 1 batch of images. And let’s have a closer look at one of the images. The image has 28 times 28 pixels, which is 784 in total. each pixel holds a number range from 0 to 1 that represents the greyscale value of the corresponding pixels.

Now it is time to define the model. This line of the code will help us to define the model structure. It is a simple two-layer network structure, The input dimension is 28 times 28, which is 784 in total. And the output dimension is 10. There is a connection between each pair of input and output, and each connection here represents a model parameter.

In the forward function, we define how the model is going to be run from input to output. First we need to reshape the 2d image into 1d, so the total number of input here is 784, which matches the network input. And the next step is to calculate the weighted sum of the input x with the model parameter w. Finally, we can return the output, .

So that’s an introduction and how do we import data and define the model for our image classification task. Here, I will also provide the source code with colab notebook for this part. In the next part, I’m going to talk about softmax and cross-entropy which is important concepts for model training.

The full video is also provided. Don’t forget to subscribe to us and ring the notification bell if you like the video!

Follow us on Youtube

Follow us on Twitter

Follow us on Instagram


Credit:
BecomingHuman By: Peter Pan

Previous Post

Seven Questions to Ask When Hiring a PR Agency

Next Post

Amazon Web Services, BigML, Inc., Fair Isaac Corporation, Google – Cole Reports

Related Posts

How AI Can Be Used in Agriculture Sector for Higher Productivity? | by ANOLYTICS
Neural Networks

How AI Can Be Used in Agriculture Sector for Higher Productivity? | by ANOLYTICS

February 27, 2021
Future Tech: Artificial Intelligence and the Singularity | by Jason Sherman | Feb, 2021
Neural Networks

Future Tech: Artificial Intelligence and the Singularity | by Jason Sherman | Feb, 2021

February 27, 2021
Tackling ethics in AI algorithms: the case of Salesforce | by Iflexion | Feb, 2021
Neural Networks

Tackling ethics in AI algorithms: the case of Salesforce | by Iflexion | Feb, 2021

February 27, 2021
Creative Destruction and Godlike Technology in the 21st Century | by Madhav Kunal
Neural Networks

Creative Destruction and Godlike Technology in the 21st Century | by Madhav Kunal

February 26, 2021
How 3D Cuboid Annotation Service is better than free Tool? | by ANOLYTICS
Neural Networks

How 3D Cuboid Annotation Service is better than free Tool? | by ANOLYTICS

February 26, 2021
Next Post
Amazon Web Services, BigML, Inc., Fair Isaac Corporation, Google – Cole Reports

Amazon Web Services, BigML, Inc., Fair Isaac Corporation, Google – Cole Reports

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recommended

Plasticity in Deep Learning: Dynamic Adaptations for AI Self-Driving Cars

Plasticity in Deep Learning: Dynamic Adaptations for AI Self-Driving Cars

January 6, 2019
Microsoft, Google Use Artificial Intelligence to Fight Hackers

Microsoft, Google Use Artificial Intelligence to Fight Hackers

January 6, 2019

Categories

  • Artificial Intelligence
  • Big Data
  • Blockchain
  • Crypto News
  • Data Science
  • Digital Marketing
  • Internet Privacy
  • Internet Security
  • Learn to Code
  • Machine Learning
  • Marketing Technology
  • Neural Networks
  • Technology Companies

Don't miss it

Accurate classification of COVID‐19 patients with different severity via machine learning – Sun – 2021 – Clinical and Translational Medicine
Machine Learning

Accurate classification of COVID‐19 patients with different severity via machine learning – Sun – 2021 – Clinical and Translational Medicine

February 28, 2021
Privacy Commissioner asks for clarity on minister’s powers in Critical Infrastructure Bill
Internet Security

Privacy Commissioner asks for clarity on minister’s powers in Critical Infrastructure Bill

February 28, 2021
Top Master’s Programs In Machine Learning In The US
Machine Learning

Top Master’s Programs In Machine Learning In The US

February 28, 2021
TikTok agrees to pay $92 million to settle teen privacy class-action lawsuit
Internet Security

TikTok agrees to pay $92 million to settle teen privacy class-action lawsuit

February 28, 2021
Machine Learning as a Service (MLaaS) Market 2020 Emerging Trend and Advancement Outlook 2025
Machine Learning

Key Company Profile, Production Revenue, Product Picture and Specifications 2025

February 28, 2021
Cybercrime groups are selling their hacking skills. Some countries are buying
Internet Security

Cybercrime groups are selling their hacking skills. Some countries are buying

February 28, 2021
NikolaNews

NikolaNews.com is an online News Portal which aims to share news about blockchain, AI, Big Data, and Data Privacy and more!

What’s New Here?

  • Accurate classification of COVID‐19 patients with different severity via machine learning – Sun – 2021 – Clinical and Translational Medicine February 28, 2021
  • Privacy Commissioner asks for clarity on minister’s powers in Critical Infrastructure Bill February 28, 2021
  • Top Master’s Programs In Machine Learning In The US February 28, 2021
  • TikTok agrees to pay $92 million to settle teen privacy class-action lawsuit February 28, 2021

Subscribe to get more!

© 2019 NikolaNews.com - Global Tech Updates

No Result
View All Result
  • AI Development
    • Artificial Intelligence
    • Machine Learning
    • Neural Networks
    • Learn to Code
  • Data
    • Blockchain
    • Big Data
    • Data Science
  • IT Security
    • Internet Privacy
    • Internet Security
  • Marketing
    • Digital Marketing
    • Marketing Technology
  • Technology Companies
  • Crypto News

© 2019 NikolaNews.com - Global Tech Updates