[February 1, 2017] Neural Networks for Dummies Rolf van Gelder, Eindhoven, NL

Similar documents
Back propagation Algorithm:

Excel Basics Rice Digital Media Commons Guide Written for Microsoft Excel 2010 Windows Edition by Eric Miller

Part 1. Summary of For Loops and While Loops

Lecture 3: Linear Classification

Lecture 19: Generative Adversarial Networks

BONE CONTROLLER ASSET VERSION 0.1 REV 1

CS311 - Neural Nets Lab Thursday, April 11

The name of our class will be Yo. Type that in where it says Class Name. Don t hit the OK button yet.

QUICK EXCEL TUTORIAL. The Very Basics

Artificial Intelligence Introduction Handwriting Recognition Kadir Eren Unal ( ), Jakob Heyder ( )

Animations involving numbers

Lecture #11: The Perceptron

Convolutional Neural Networks for Object Classication in CUDA

9 R1 Get another piece of paper. We re going to have fun keeping track of (inaudible). Um How much time do you have? Are you getting tired?

CS 4510/9010 Applied Machine Learning. Deep Learning. Paula Matuszek Fall copyright Paula Matuszek 2016

The MathType Window. The picture below shows MathType with all parts of its toolbar visible: Small bar. Tabs. Ruler. Selection.

WHAT TYPE OF NEURAL NETWORK IS IDEAL FOR PREDICTIONS OF SOLAR FLARES?

Neural Networks. By Laurence Squires

LECTURE NOTES Professor Anita Wasilewska NEURAL NETWORKS

Microsoft PowerPoint Presentations

Your Guide to NeuroTracker

CS231A Course Project Final Report Sign Language Recognition with Unsupervised Feature Learning


On the Web sun.com/aboutsun/comm_invest STAROFFICE 8 DRAW

The first thing we ll need is some numbers. I m going to use the set of times and drug concentration levels in a patient s bloodstream given below.

HTML/CSS Lesson Plans

Excel Basics: Working with Spreadsheets

PATTERN SEQUENCER GUIDE

CS 170 Algorithms Fall 2014 David Wagner HW12. Due Dec. 5, 6:00pm

Figure 1. Level Data: total possible: 32 mean: 8.19 SD: 5.98 low: draft 1

COMP9444 Neural Networks and Deep Learning 7. Image Processing. COMP9444 c Alan Blair, 2017

Module: Rasters. 8.1 Lesson: Working with Raster Data Follow along: Loading Raster Data CHAPTER 8

Why Use Graphs? Test Grade. Time Sleeping (Hrs) Time Sleeping (Hrs) Test Grade

Feature Extractors. CS 188: Artificial Intelligence Fall Some (Vague) Biology. The Binary Perceptron. Binary Decision Rule.

Mailman Max. The postcode is a great way to work out the next sorting office a letter should go to, so you ll use that.

Multi-Layer Perceptron Network For Handwritting English Character Recoginition

Final Report: Classification of Plankton Classes By Tae Ho Kim and Saaid Haseeb Arshad

Ages Donʼt Fall for Fake: Activity 1 Don t bite that phishing hook! Goals for children. Letʼs talk

UV Mapping to avoid texture flaws and enable proper shading

How to Tell a Human apart from a Computer. The Turing Test. (and Computer Literacy) Spring 2013 ITS B 1. Are Computers like Human Brains?

Accounts and Passwords

DRAWING VECTOR VS PIXEL SHAPES IN PHOTOSHOP CS6

1 Lab: Digit recognition

TECHNICAL TRAINING LAB INSTRUCTIONS

Lastly, in case you don t already know this, and don t have Excel on your computers, you can get it for free through IT s website under software.

Survey of Math: Excel Spreadsheet Guide (for Excel 2016) Page 1 of 9

2 A little on Spreadsheets

CS 4510/9010 Applied Machine Learning. Neural Nets. Paula Matuszek Fall copyright Paula Matuszek 2016

Improving the way neural networks learn Srikumar Ramalingam School of Computing University of Utah

Kernels and Clustering

Programming Principles 1 (CSC131) & 2 (CSC132) Software usage guide

SOLUTIONS GUIDE. I Don t Know What to or

Taskbar: Working with Several Windows at Once

Mobile & More: Preparing for the Latest Design Trends

Different Ways of Writing Windows Programs

Quick Guide. Choose It Maker 2. Overview/Introduction. ChooseIt!Maker2 is a motivating program at first because of the visual and musical

Using Microsoft Excel

PowerPoint Basics: Create a Photo Slide Show

Within Kodi you can add additional programs called addons. Each of these addons provides access to lots of different types of video content.

Heuristic Evaluation of Math Out of the Box

HOUR 4 Understanding Events

EE121 Foundation Review Session Page 1 of 16 Winter Learning to Love Xilinx Foundation 4.1i in 40 Easy Steps

The Polygonal Lasso Tool In Photoshop

CS 177 Recitation. Week 1 Intro to Java

MLISP: Machine Learning in Signal Processing Spring Lecture 18 June 22

DB2 is a complex system, with a major impact upon your processing environment. There are substantial performance and instrumentation changes in

Machine Learning With Python. Bin Chen Nov. 7, 2017 Research Computing Center

GUI Tips. GUI Blooper

Segmentation of Kannada Handwritten Characters and Recognition Using Twelve Directional Feature Extraction Techniques

Deep Learning. Deep Learning provided breakthrough results in speech recognition and image classification. Why?

Good and Bad UX Examples and analysis. Billy Hollis Hater of bad UX nextver.com billy at nextver dot com

1.7 Limit of a Function

Classification Lecture Notes cse352. Neural Networks. Professor Anita Wasilewska

Introduction to WHO s DHIS2 Data Quality Tool

The Mathematics Behind Neural Networks

Lecture 1 - Introduction (Class Notes)

1Password for Mac. by Marcia Bolsinga for AshMUG 1/12/2019

CS 343: Artificial Intelligence

MIS2502: Data Analytics MySQL and SQL Workbench. Jing Gong

User Signature Identification and Image Pixel Pattern Verification

Software Tools. Scott Klemmer Autumn 2009

Programming Logic - Beginning

Welcome Back! Without further delay, let s get started! First Things First. If you haven t done it already, download Turbo Lister from ebay.

Excel Basic: Create Formulas

Entering Data in the Spreadsheet

CHAPTER 1 INTRODUCTION

ENGL 323: Writing for New Media Building a Blog Reader Using Links, Tables, Images, and Frames

Online Scams. Ready to get started? Click on the green button to continue.

Energy Based Models, Restricted Boltzmann Machines and Deep Networks. Jesse Eickholt

(Refer Slide Time 00:01:09)

Basic Input and Output

Report: Privacy-Preserving Classification on Deep Neural Network

Printing Envelopes in Microsoft Word

Océ DS10. Operator s manual

By Jeff Walker ProductLaunchFormula.com BLACKOUT.

Basic Input and Output

My First iphone App (for Xcode version 6.4)

Neural Network Application Design. Supervised Function Approximation. Supervised Function Approximation. Supervised Function Approximation

Design and create an app which uses sequence, selection, repetition and variables. Program, debug and refine the code for their app.

DOING MORE WITH EXCEL: MICROSOFT OFFICE 2010

Transcription:

[February 1, 2017] Neural Networks for Dummies 2017 Rolf van Gelder, Eindhoven, NL

Contents Introduction... 2 How does it work?... 4 Training a Network... 4 Testing / Using a Network... 4 The Test Case: Recognition of Handwritten Digits... 5 Goal of the Network... 5 Structure of the Network... 6 Step one: testing the untrained Network... 7 Step two: training the Network... 7 Step three: experimenting with the Hidden Layers... 7 Appendix I: Quick Reference rvg_neural_net.exe Demo Network... 9 Mouse... 9 Keyboard... 9 1

Neural Networks for Dummies Introduction Neural networks are self-learning computer programs and are normally created and configured to solve one specific problem. They are used in cases when it s too hard to use a traditional computer program. Like in the case I will explain later on: we want to build a network that will recognize handwritten digits. If you want to recognize handwritten digits with a traditional program, it probably will need many thousands lines of code. Our demo network will only use less than 1000 lines of code, and the best part: the same program code can be used for solving different problems (with just some minor adjustments). Nowadays many neural networks are used in my different fields: For instance Thunderbird (mail client) uses a neural network for identifying spam mails. When the user marks an email as spam, it will train the network with that information. (More about training later) Other applications: license plate recognition, OCR, face recognition and so on. In fact neural networks simulate a tiny part of a human brain. Like the human brain, a neural network is built with so-called neurons A neural network has several layers, built with neurons. There is always one input layer, zero or more hidden layers and one output layer. 2

Schematic of a neural network with one hidden layer: All neutrons are identical (same code) with one ex ception: neurons in the input layer don t have inputs themselves. Depending on the problem it has to solve, the number of input neurons, the number of hidden layers and the number of neurons of the hidden layers and the number of output neurons will be chosen. Ev ery neuron in a layer is connected to all the neurons in the next layer (see above illustration). In the above example there are already (20 * 30) + (30 * 10) = 900 connections (lines)! In our test case (further on) we will use 196 input neurons, 100 hidden neurons and 10 output neurons. That s (196 * 100) + (100 * 10) = 20,600 connections! During training and testing often the number of hidden layers and the number of hidden layer neurons will be changed to find the best configuration for performing that specific task. 3

How does it work? Well, so far, no one really understands how it actually works Especially the hidden layers are quite my sterious. There are two things you can do with the network: train the network and test and/or use the network. Training a Network Without training a network, the output of the network will be completely random. The network has no idea what to do with the input, so it just makes a guess. Training is like teaching children: You tell them 2 + 2 = 4. And you tell them 1 + 6 = 7 and so on. If y ou repeat that often enough, the child learns how to add two numbers. Same for the network: during its training period you put inputs in and you tell it what the output should be. Every neuron has two properties: weight and bias (sometimes also called threshold ). These two properties determine what the output value will be and what the neuron will pass on to the neurons in the next layer, based on its inputs. In short: the weight defines how important the value is; the bias defines how high the weight should be before passing it on to the next layer. Together they calculate the output value. When a training input is processed, it generates output values based on the current state of the neurons. These output values in the output layer are compared to the right answer. The properties will be changed a little bit, network will be tested again with the same input and the new output will be compared with the right answer. If the new output is better than the previous one, the new properties will be saved. So, the more often you train the network, the more reliable the output will become. Testing / Using a Network After every training session, the network will be tested: did the reliability improve? When the reliability is good enough, the network is ready for its job! Training and testing use different sets of data: training-data and testing-data. After training it, the network should be clever enough to also solve inputs it never saw before. These training- and testing datasets can be huge: millions of inputs. The basic rule is: the more the better! 4

The Test Case: Recognition of Handwritten Digits You can download and play with the demo Network yourself! Just download and run the rvg_neural_net.exe app from http://cagewebdev.com/wpcontent/uploads/2016/10/rvg_neural_net20_win32.zip Screen grab of the demo network in action (1 hidden layer with 64 neurons): Goal of the Network The goal is that our network will recognize handwritten digits. I warn you: the result won t be 100% accurate! 5

People also make mistakes reading handwritten digits: for instance many people will say it s a one while in fact it s meant to be a seven or the other way around. Depends on the handwriting style of the person who wrote it. So, our little network will also be fooled by that. The training- and test-sets for our network are from the MNIST database. MNIST, a foundation based in New Y ork asked many people to write down digits (and also the same digits many times). In total there are 60,000 training- and 10,000 handwritten testing-digits in our datasets. Structure of the Network Our network has 196 input neurons, a certain amount of hidden layers with a certain amount of neurons, which we can adjust, and 10 output neurons. Why 196 inputs? Because the images in the MNIST database are simplified to 14 x 14 (=196) pixels. So, there should be an input for every pixel. For instance (which apparently is a zero ): Like said: we can play around with the number of hidden layers and the number of neurons in the hidden layer(s). The output layer, in our test case, has 10 neurons: The darkness of the dots indicates what the network thinks the right answer is. The darker the color, the more sure it is that it s the right answer. In the above example, apparently the network thinks it s a one and it s not very sure about it (could be much darker, up to pitch black). 6

Step one: testing the untrained Network Just for fun: let s test the untrained network. Without any training the weights and biases of the neurons will be totally random. So, we easily can predict the outcome of this experiment will be around 10% accuracy (=success). If you guess a number between 0 and 9, in about 10% of the cases you will have guessed it right. A testing session means: putting 1000 (=adjustable amount) images into the network and measure the number of hits (correct answers). Based on the total number of hits, it calculates the percentage of accuracy of the network (success %). The images, by the way, are selected at random from the datasets. After downloading and starting the demo app (rvg_neural_net.exe), you click the right m ouse button to start a testing session. It will test 1000 test images per session. As you will see, the success percentage is somewhere around the 10% (since the network is not trained yet, as explained above). Step two: training the Network Next: let s see if training the network helps During a training session we ll put in a batch of 1000 (=adjustable amount) random images from the trainingset. For every image, the network will compare the actual output from the network with the wanted output and adjust the weights and biases of the neurons accordingly. Teaching it: Hey Network, this should be a two and not a five! After two training sessions (2000 images) it turns out that the accuracy already has gone up to around 65%. So, our network is actually learning! We can train it again and again and see what happens to the accuracy. Y ou can train the demo network (rvg_neural_net.exe) by clicking the left mouse button somewhere on the canvas. After one or more training sessions, just run the test session again (click the right m ouse button) and watch the success percentage go up. Step three: experimenting with the Hidden Layers Now we can experiment with the number of hidden layers. And the number of neurons per hidden layer. It s a purely empirical process: it s impossible to predict if the outcome will be better or worse. 7

Sometimes 1 hidden layer works much better than 5 hidden layers or the other way around. There are no formulas to calculate the most efficient number of hidden layers and neurons for solving the problem. It s just a matter of experimenting. That s part of the fact that no one really knows how it works. To increase the number of hidden layers in the demo network (rvg_neural_net.exe) press the L -key. To decrease the number of hidden layers in the demo network (rvg_neural_net.exe) press the l -key. To increase the number of neurons in the hidden layer(s) in the demo network (rvg_neural_net.exe) press the N -key. To increase the number of neurons in the hidden layer(s) in the demo network (rvg_neural_net.exe) press the n -key. 8

Appendix I: Quick Reference rvg_neural_net.exe Demo Network How to interact with the demo app (rvg_neural_net.exe)? Mouse Left-click: start a training session (= feed the network 1000 training images) Right-click: start a testing session (= feed the network 1000 testing images) Keyboard Spacebar: test the next image (one by one) b -key : decrease training batch size B -key: increase training batch size f or F -key: toggle between slow (non-animated) and fast (animated) training l -key: decrease the number of hidden layers (min = 0) L -key: increase the number of hidden layers (max = 5) n -key: decrease the number of neurons in the hidden layers (min = 25) N -key: increase the number of neurons in the hidden layers (max = 144) - -key: decrease the framerate (speed) for auto testing + -key: increase the framerate (speed) for auto testing 9