# Artificial Neural Networks

## Lab Project 3: Radial Basis Function Neural Networks

### Objective

In this project, you will develop techniques for designing radial basis function (RBF) models for solving complex function approximation and  classification problems. This project has four parts. In Part 1, you will exercise your RBF model to solve canonical logic-gate problems. In Part 2, you will attempt to use your RBF model for performing function approximation. In Parts 3, 4, and 5 you will solve pattern recognition problems.

### Pre-Lab Exercise

1. Radial basis function neural networks are modeled in Matlab in a 2-step process:
1. The function newrb creates and trains an RBF neural network
2. The function sim is used to simulate/test the RBF neural network
Do >> help newrb  for more details

2.  The following exercise (identical to the classroom demo) is used to model an RBF network
1. %Radial Basis Function Network
%S. Mandayam/ECE Dept./Rowan University
%Neural Nets/Fall 10
clear;close all;
%generate training data (input and target)
p = [0:0.25:4];
t = sin(p*pi);
%Define and train RBF Network
net = newrb(p,t);
plot(p,t,'*r');hold;
%generate test data
p1 = [0:0.1:4];
%test network
y = sim(net,p1);
plot(p1,y,'ob');

legend('Training','Test');
xlabel('input, p');
ylabel('target, t')

3. Experiment with different number of training data, network types, etc.

### Part 1

In this part, you are required to demonstrate the capability of an RBF network to model the XOR logic gate. Generate performance curves/surfacess for these RBF-models as the inputs vary continuously from 0.0 to 1.0.

### Part 2

In this part you are required to demonstrate the capability of an RBF to approximate the function
f(t) = sin(t)*exp(-t/20); 0 < t < 50
You are required to generate Matlab code for this portion of the project by formulating the RBF network from first principles - in other words, you may not use the newrb and sim functions. Implement a K-means clustering algorithm (see Lecture 6) for determining the centers. Experiment with varying the number of centers, number of hidden nodes, etc.

### Part 3

PrRepeat the double-moon classification computer experiment where the distance between the two moons is set at d = 0 and d = -5. Comment on the findings of your experiment in light of the corresponding experiment performed on the perceptron in Part3 of  Lab Project 2.

### Part 4

Repeat Part 3 of Lab Project 2 by using a radial basis function neural network to separate classes in the Iris database of the UCI Machine Learning Repository: http://www.ics.uci.edu/~mlearn/MLRepository.html

### Part 5

In this part, you will design and implement a handwritten character-recognition algorithm using RBF neural networks. As part of the project design process, you will define the problem specifications. This will include:
• Defining a uniform format for generating input data for training and testing. To simplify the problem, handwritten character samples can be expected to conform to a uniform size (all characters can be written inside of a 1"x1" block for example. The characters may be in the Palm Computing Platform's Graffitti(R)2 format (see http://www.palm.com/us/support/handbooks/graffiti2_sticker.pdf for details).
• Defining the number and type of characters to be recognized.
• Defining the sample data collection process - how many people? How many samples from each?
• Other suitable problem specifications for developing a justifiable character recognition system.
As part of your neural network design process, you will experiment with
• Choosing appropriate training and test data
• Data preprocessing - feeding raw image vectors vs. image features
• Number and type of output vectors
• Network architectures (number of hidden nodes and layers)
• Training algorithms and strategies
• Images corrupted with noise (use the imnoise function). Identify the SNR for network failure. Not familiar with SNR concepts? See ECOMMS Class Lab Project 1 Pre-Lab Lecture and ECOMMS Class Lab Project 1.
Tabulate your percentage correct classification results for each of these runs. Be aware that as in any real neural network, you will have misclassifications. You are required to draw conclusions from this study as you develop the most "optimal" RBF model for this problem.

Your laboratory report (individual report is required of each student) should be in the usual format.