Neural Networks Laboratory EE 329 A

Similar documents
Simulation of Back Propagation Neural Network for Iris Flower Classification

MATLAB representation of neural network Outline Neural network with single-layer of neurons. Neural network with multiple-layer of neurons.

Argha Roy* Dept. of CSE Netaji Subhash Engg. College West Bengal, India.

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

An Algorithm For Training Multilayer Perceptron (MLP) For Image Reconstruction Using Neural Network Without Overfitting.

Lecture 2 Notes. Outline. Neural Networks. The Big Idea. Architecture. Instructors: Parth Shah, Riju Pahwa

Neuro-Fuzzy Computing

A neural network that classifies glass either as window or non-window depending on the glass chemistry.

Lecture 17: Neural Networks and Deep Learning. Instructor: Saravanan Thirumuruganathan

Planar Robot Arm Performance: Analysis with Feedforward Neural Networks

Machine Learning 13. week

A Systematic Overview of Data Mining Algorithms. Sargur Srihari University at Buffalo The State University of New York

IN recent years, neural networks have attracted considerable attention

A *69>H>N6 #DJGC6A DG C<>C::G>C<,8>:C8:H /DA 'D 2:6G, ()-"&"3 -"(' ( +-" " " % '.+ % ' -0(+$,

Introduction to Artificial Intelligence

LECTURE NOTES Professor Anita Wasilewska NEURAL NETWORKS

Techniques for Dealing with Missing Values in Feedforward Networks

Ensemble methods in machine learning. Example. Neural networks. Neural networks

Week 3: Perceptron and Multi-layer Perceptron

Assignment # 5. Farrukh Jabeen Due Date: November 2, Neural Networks: Backpropation

Notes on Multilayer, Feedforward Neural Networks

Neural Networks. Lab 3: Multi layer perceptrons. Nonlinear regression and prediction.

CHAPTER VI BACK PROPAGATION ALGORITHM

Optimizing Number of Hidden Nodes for Artificial Neural Network using Competitive Learning Approach

1. Approximation and Prediction Problems

Neural Network Approach for Automatic Landuse Classification of Satellite Images: One-Against-Rest and Multi-Class Classifiers

CS 4510/9010 Applied Machine Learning

Neural Network Neurons

Supervised Learning in Neural Networks (Part 2)

Neural Networks. CE-725: Statistical Pattern Recognition Sharif University of Technology Spring Soleymani

International Journal of Electrical and Computer Engineering 4: Application of Neural Network in User Authentication for Smart Home System

Back propagation Algorithm:

4.12 Generalization. In back-propagation learning, as many training examples as possible are typically used.

Lecture #11: The Perceptron

2. Neural network basics

CMU Lecture 18: Deep learning and Vision: Convolutional neural networks. Teacher: Gianni A. Di Caro

Image Compression: An Artificial Neural Network Approach

Deep Learning for Visual Computing Prof. Debdoot Sheet Department of Electrical Engineering Indian Institute of Technology, Kharagpur

Neural Nets. CSCI 5582, Fall 2007

Learning internal representations

Technical University of Munich. Exercise 7: Neural Network Basics

In this assignment, we investigated the use of neural networks for supervised classification

Performance Analysis of Data Mining Classification Techniques

KTH ROYAL INSTITUTE OF TECHNOLOGY. Lecture 14 Machine Learning. K-means, knn

Visual object classification by sparse convolutional neural networks

Center for Automation and Autonomous Complex Systems. Computer Science Department, Tulane University. New Orleans, LA June 5, 1991.

COMPUTATIONAL INTELLIGENCE

The Mathematics Behind Neural Networks

Classification and Regression using Linear Networks, Multilayer Perceptrons and Radial Basis Functions

Deep Learning. Vladimir Golkov Technical University of Munich Computer Vision Group

Neural Nets. General Model Building

ANN exercise session

Neuron Selectivity as a Biologically Plausible Alternative to Backpropagation

Traffic Signs Recognition using HP and HOG Descriptors Combined to MLP and SVM Classifiers

Supervised Learning with Neural Networks. We now look at how an agent might learn to solve a general problem by seeing examples.

COMPUTATIONAL INTELLIGENCE

A USER-FRIENDLY AUTOMATIC TOOL FOR IMAGE CLASSIFICATION BASED ON NEURAL NETWORKS

COMBINING NEURAL NETWORKS FOR SKIN DETECTION

CS6220: DATA MINING TECHNIQUES

Exercise: Training Simple MLP by Backpropagation. Using Netlab.

Review on Methods of Selecting Number of Hidden Nodes in Artificial Neural Network

INVESTIGATING DATA MINING BY ARTIFICIAL NEURAL NETWORK: A CASE OF REAL ESTATE PROPERTY EVALUATION

DEEP LEARNING REVIEW. Yann LeCun, Yoshua Bengio & Geoffrey Hinton Nature Presented by Divya Chitimalla

MULTILAYER PERCEPTRON WITH ADAPTIVE ACTIVATION FUNCTIONS CHINMAY RANE. Presented to the Faculty of Graduate School of

Performance Evaluation of Artificial Neural Networks for Spatial Data Analysis

Neural Network and Adaptive Feature Extraction Technique for Pattern Recognition

A Matlab based Face Recognition GUI system Using Principal Component Analysis and Artificial Neural Network

Role of Hidden Neurons in an Elman Recurrent Neural Network in Classification of Cavitation Signals

EE 589 INTRODUCTION TO ARTIFICIAL NETWORK REPORT OF THE TERM PROJECT REAL TIME ODOR RECOGNATION SYSTEM FATMA ÖZYURT SANCAR

Optimum size of feed forward neural network for Iris data set.

Applying Neural Network Architecture for Inverse Kinematics Problem in Robotics

6. NEURAL NETWORK BASED PATH PLANNING ALGORITHM 6.1 INTRODUCTION

Deep Learning. Practical introduction with Keras JORDI TORRES 27/05/2018. Chapter 3 JORDI TORRES

Comparative Analysis of Swarm Intelligence Techniques for Data Classification

Data Mining. Neural Networks

CSC 578 Neural Networks and Deep Learning

Deep Learning With Noise

Hand Writing Numbers detection using Artificial Neural Networks

APPLICATION OF A MULTI- LAYER PERCEPTRON FOR MASS VALUATION OF REAL ESTATES

IMPROVEMENTS TO THE BACKPROPAGATION ALGORITHM

CONTROLO E DECISÃO INTELIGENTE 08/09

Performance analysis of a MLP weight initialization algorithm

A Class of Instantaneously Trained Neural Networks

Assignment 2. Classification and Regression using Linear Networks, Multilayer Perceptron Networks, and Radial Basis Functions

This leads to our algorithm which is outlined in Section III, along with a tabular summary of it's performance on several benchmarks. The last section

IEEE TRANSACTIONS ON NEURAL NETWORKS, VOL. 10, NO. 6, NOVEMBER Inverting Feedforward Neural Networks Using Linear and Nonlinear Programming

Non-destructive Watermelon Ripeness Determination Using Image Processing and Artificial Neural Network (ANN)

ARCHITECTURE OPTIMIZATION MODEL FOR THE MULTILAYER PERCEPTRON AND CLUSTERING

Cursive Handwriting Recognition System Using Feature Extraction and Artificial Neural Network

More on Learning. Neural Nets Support Vectors Machines Unsupervised Learning (Clustering) K-Means Expectation-Maximization

Linear Separability. Linear Separability. Capabilities of Threshold Neurons. Capabilities of Threshold Neurons. Capabilities of Threshold Neurons

PERFORMANCE ANALYSIS AND VALIDATION OF CLUSTERING ALGORITHMS USING SOFT COMPUTING TECHNIQUES

Natural Language Processing CS 6320 Lecture 6 Neural Language Models. Instructor: Sanda Harabagiu

Using the NNET Toolbox

Early tube leak detection system for steam boiler at KEV power plant

A Framework of Hyperspectral Image Compression using Neural Networks

Lecture 13. Deep Belief Networks. Michael Picheny, Bhuvana Ramabhadran, Stanley F. Chen

Reification of Boolean Logic

Input: Concepts, Instances, Attributes

11/14/2010 Intelligent Systems and Soft Computing 1

Transcription:

Neural Networks Laboratory EE 329 A Introduction: Artificial Neural Networks (ANN) are widely used to approximate complex systems that are difficult to model using conventional modeling techniques such as mathematical modeling. The most common applications are function approximation (feature extraction), and pattern recognition and classification. There is no exact available formula to decide what architecture of ANN and which training algorithm will solve a given problem. The best solution is obtained by trial and error. One can get an idea by looking at a problem and decide to start with simple networks; going on to complex ones till the solution is within the acceptable limits of error. This laboratory has been designed to give one an opportunity to try different network architectures and training algorithms, to solve a simple classification problem, and comment on their performance. There are different neural network architectures. The basic architectures include multilayered feed-forward networks (Figure 1) that are trained using back-propagation training algorithms. Inputs First Hidden layer Second Hidden Layer Output Layer Figure 1: Multi-layered feed-forward neural network. A variation in the architecture of such a network can be due to a variation of the number of layers, the number of neurons in each layer, the transfer function of neurons in each layer. Problem Description: The iris flower (Figure 2) data set is widely used, as an example, to show the application of neural networks as a data classifier. Three types of similar flowers from the IRIS family have been chosen. They are: 1. I. Setosa 2. I. Verginica 3. I. Versicolor

Figure 2: Iris Verginica (Left). Parts of a flower. Note the Sepal and the petal. (Source: http://www.bbg.org/gar2/topics/botany/parts_flower_parts.html ) Four distinguishing features were chosen in order to classify a particular flower to its category. The four features (Figure 2) are: 1. Petal width 2. Petal length 3. Sepal width 4. Sepal length The goal is to use an ANN to classify a specimen into its category using the above mentioned four features. You will be using Multilayered Perceptrons (MLP) feedforward networks using different backpropagation training algorithms. Data Setup (Pre-processing): The features obtained from many specimens are actually considered as raw data. Some amount of pre-processing is always carried out on the input and output data in order to make it suitable for the network. These procedures help obtain faster and efficient training. There are four features that are used as inputs to the neural networks. Each feature has a range of values. If the neurons have nonlinear transfer functions (whose output range is from -1 to 1 or 0 to 1), the data is typically normalized for efficiency. Each feature is normalized using one of the two subroutines available in MATLAB. Since there are three classes of flowers, a three-state numerical code must be assigned. The network must be trained to reproduce the code at the outputs. The output can be left in decimal form where the decimal numbers 1, 2, and 3 represent the classes or the classes can be coded in binary form. For this problem the outputs are coded in binary form as 1. I. Setosa : Code 00 2. I. Verginica : Code 01 3. I. Versicolor : Code 10

Architecture Details (factors to be taken into account): As such, one can employ as many layers of neurons to develop the architecture. But, 3-4 layers are generally sufficient to approximate most of the functions. While building the architecture, you can adjust the number of layers and the number of neurons in each layer. Since the output of the network is in 2 bit binary form, the output layer will have to have two neurons. If you had decided to code the output in decimal form (1, 2, and 3), the output layer would only need one neuron. Software: One can develop ANN architectures and write training algorithms in any known higher level language. MATLAB has a proven tool box that helps one apply, already developed training algorithms, to solve the problem. MATLAB also has a GUI based system. This windows-based platform provides a step-by-step visual procedure to build, train and simulate the ANN. Startup: Start MATLAB. You have been provided with a file data.mat. This file has data already formatted and ready for usage. Load the file by typing the command load ( data.mat ); in the command window. This command uploads the file and includes all the variables setup in the current workspace. Typing in the command whos, you will see all the variables in the data file. Of these, the most important ones are: o train_inputs (4 120): 4 rows by 120 columns. The number 4 represents the normalized features which will be presented, one-by-one, in parallel fashion. Each pattern of 4 features is called a vector and there are 120 such vectors for training o train_outputs (2 120): There are two outputs for each feature vector (coded in binary). There are 120 such vectors for training and will be the targets for the input vectors. o test_inputs (4 30): Once the network has been trained, it has to be tested on data that it has not seen before. 30 vectors will be used for testing the network. o test_outputs (2 30): These are the expected classes for the test inputs. The simulated outputs of the network will be compared to these actual classes in order to determine the performance of the trained network. Typing the command NNTool brings up the GUI based neural network developer called the Network/Data Manager. First you import some data. Click on the Import button. A new window opens up. Here you can specify the source of your data. Since the workspace is already loaded, you can import data from there. Select the variable train_inputs and since this variable pertains to inputs, in the destination section, select the inputs option and click on the import button. You will see that in the inputs sub window, the variable train_inputs has appeared. Similarly import test_inputs as inputs. Also

import train_outputs and test_outputs as targets. Also, import pn as an input, which is actually the entire normalized input data and will be used to specify the range of the data. Next you build the network. o Click on the New Network button. You can give a name to your network. You can select the different types of networks you can build and train. The Feed-forward backpropagation neural network is the default choice and is the type used in this laboratory. o Next you provide the range of values of the input data. This operation can be done by selecting the source in the right hand sub window and selecting pn. The network manager will automatically calculate the range of the input values. o Next, the training algorithm needs to be specified. During lecture, the gradient descent training algorithm was explained. That training algorithm is the TRAINGD. Select this one first. o Next you select the learning function. This operation sets up the weight update rule. Select LEARNGD, which was explained in class. o Choose MSE as the performance function, which stands for mean squared error. o Next choose the number of layers that you want in your network. Type in 2 (to begin with) and press enter. This will tell the network manager that you would like 2 layers for the network. o Once you have chosen the number of layers, you have to specify the properties of each layer. You can select an individual layer and specify the number of neurons in that layer and the transfer function of neurons for that layer. You will definitely need two neurons for the output layer (remember the 2 bit binary coding) and 4 neurons in the first input layer (You can vary this number later). Choose LOGSIG as the transfer function as you would like the outputs to either move towards a zero or one. o Finally, click on the create button and you will see your network name appear in the Networks sub window of the network manager. o When you select the network you have just created, you will see a number of buttons become active in Networks only area of the manager. o Review the different sections. First, look at the view sections, where you see a visual description of your ANN architecture. Note, the number of layers and number of neurons in each layer and their respective transfer functions. Next look at the initialize section. You will see the ranges of the input values that have been already set earlier. Here you can initialize the weights by clicking on the initialize weights button. The weights will be initialized randomly between -1 and 1. You can look at the weight matrices and the biases in the Weights section. o After the weights have been initialized, the network is ready for training. Select the Train section, which has three subsections

Training info: Selecting this section, you will have to specify the training data. Under the Training Data select train_inputs as inputs and train_outputs as the targets. Training Parameters: Here you should specify some performance parameters pertaining to the type of training algorithm that you are going to use. The most important ones for all the algorithms are the Epochs: This decides for how many cycles you would like to train the network. For example, if the number of epochs is 100 then the entire training data will be presented 100 times. Set this value to 500. Min_grad: This decides the acceptable error that you would prefer. If this MSE (mean squared error) is reached the network has converged and training will stop. Generally this value is 1e-5. Show: This tells the software to show you the performance error after a fixed number of epochs. For e.g. if the number is 25, then the MSE will be calculated after every 25 epochs and shown to you. Optional Info.: Here you can specify any validation data set (used for early stopping and is generally used when you have a large data set) or a testing data set that you will add for simulating the network. Leave this section as it is. After initializing all the parameters the network is read to be trained. Click on the Train Network button on the right bottom corner of the window and you will see a new window show up and a blue line go across from left to light. The network is now training and the MSE is being shown every 25 epochs. If the MSE reaches the set value the network has converged and training stops. If the network does not converge and the number of epochs has reached the set value, then the network has not converged. You will have to retrain the network, by changing some of the parameters or the training algorithm or the network architecture (that is the number of layers and the number of neurons in each layer). o Once you have trained the network, the network will be simulated with a set of inputs that the network has not seen. Go to the Simulate section of the network manager. In the Simulation Data section, select test_inputs as your inputs and then click on Simulate Network button on the right bottom corner of the current window. You can also provide the test_outputs so that the software will calculate the errors between the simulated output of the network and the expected outputs. But, the feature is not needed since our classes are binary based. Even though we have trained the network on these binary classes, the simulated outputs will not be exactly 0s and 1s. Some post-processing is needed to figure out whether the output bits are 0s or 1s. To do this a routine (already built for you) is run from the command window of MATLAB. But first you will export the simulated outputs to the workspace. Your simulated outputs

will be stored in the variable network1_outputs. Going back to the Network/Data Manager window, click on the Export button. Select this variable and click on Export. You also have a facility to store this information on a disk. Once you have done this, go to the command window and type whos and you will see the variable network1_outputs present there. You will now run the subroutine post_proc.m. In this routine, you will replace network1_outputs with the variable that will be exported from your network/data manager to your workspace. Your final outputs will be stored under the variable sim_output. Be sure to give a different name to this variable when ever you try to post process new simulated outputs. o Compare the post-processed outputs and the test_outputs and see how many test vectors were classified incorrectly. Please fill in the following blanks. This process will summarize the entire operation and results that you have just obtained. Type of architecture: Number of Layers (hidden + output): Details of number of neurons and transfer function used. Layer Number Number of Neurons Transfer Function 1 2 3 4 5 Training algorithm used **: Number of epochs required for training: Number of test_vectors classified correctly: o You should try architectures with varying number of hidden layers (go up to a maximum of 3 layers), number of neurons in hidden layer. Observe the effect on the result due to a variation in training times (number of epochs) and training function. Prepare the summary chart (as shown above) for each variation of network you train and simulate. Comment on what architecture of network and training algorithm gave the best results. For your report, provide details of TWO networks implemented that have good results. ** Training algorithms: There are different training algorithms available for training a feed-forward back-propagation neural network. The algorithm explained to you in class is the TRAINGD algorithm. This is the simplest of all and sometimes ineffective in training a network. Some of the more power full ones are TRAINCGP/CGF and TRAINOSS (for big networks) and TRAINLM (for small networks).