# AI Is Not Magic. How Neural Networks Learn

DevFeed: [AI Is Not Magic. How Neural Networks Learn](<https://devfeed.tech/articles/ai-is-not-magic-how-neural-networks-learn-24977.md>)

Original publisher: [Read original article](<https://codeahoy.com/2017/07/28/ai-is-not-magic-how-neural-networks-learn/>)

Author: umer

Published: 2017-07-28T00:00:00Z

Content type: tutorial

Language: en

Sources: [Code Ahoy - Articles](<https://devfeed.tech/sources/code-ahoy-articles.md>)

Topics: [Neural Network](<https://devfeed.tech/topics/neural-network.md>), [Algorithm](<https://devfeed.tech/topics/algorithm.md>), [App](<https://devfeed.tech/topics/app.md>), [Image](<https://devfeed.tech/topics/image.md>)

Tags: [algorithm](<https://devfeed.tech/tags/algorithm.md>), [app](<https://devfeed.tech/tags/app.md>), [images](<https://devfeed.tech/tags/images.md>), [neural-networks](<https://devfeed.tech/tags/neural-networks.md>)

## AI overview

A high-level tutorial explains how neural networks learn to recognize images. Using a hypothetical hot-dog classifier, it introduces labeled training data, artificial neurons, weights, biases, and the role of layered neurons in image recognition.

## Source excerpt

In my previous blog post, I claimed that "AI is not magic." In this post, my goal is to discuss how neural networks learn, and show that AI isn't a crystal ball or magic, just science and some very slick mathematics. I'll keep this very high level. Let's start with a hypothetical scenario. Suppose we are building an app to identify hot dogs. Take a picture and the app will tell you if it's a hotdog or not. Total App Store domination. To recognize images, we choose to implement a popular machine learning algorithm called the neural network. (In this hypothetical scenario) This decision was made after reading an online article which talked about how neural networks can learn to recognize objects by training on lots of labelled examples. Once trained, it can start identifying images it has never seen before. We go ahead and obtain a training set of 6000 images gathered from online sources. 1000 images of different types of hotdogs: New York vs Chicago, ketchup, no ketchup, hotdogs on a grill, etc. The other 5000 images are of various non-hotdog objects: shoes, hamburgers, burrito, human legs. Now all that remains is to build our neural network. To understand neural networks, we must first understand its elementary building block: the artificial neuron. An artificial neuron takes one ore more inputs and produces a single output. Looks familiar? It looks a lot like logic gates, which are elementary building blocks of digital circuits. The similarity ends there. Unlike logic gates, neurons can have several inputs and can change output for the same input values. This is possible because neurons have weights associated with each input, which is multiplied with the input value. These weights allow neurons to rate how important each input is. E.g. if the second input to a neuron isn't very important, neuron can assign it a weight close to 0 essentially cancelling it out. Neurons also have biases which controls how easy it is to get neuron to output or fire. If the bias is hug