Assignment title: Information


ECE 535 Homework 1 Spring 2016 Due: 24 March 2016 In this homework, you are going to perform handwritten digit recognition using the backpropagation rule. The MATLAB file hw1.mat contains the data. The variable data in the file is a 256 × 1593 matrix. Each column of the matrix represents a 16 × 16 binary image containing a handwritten digit

written by a different person. Each column is composed of -1's and 1's, where -1's represent white pixels and 1's represent black pixels. This is very similar to the dataset we used in class; the only difference is that here the digits are handwritten by real people. The variable true digits is a 1 ×1593 matrix. Each entry gives the digit encoded in the corresponding column of the data matrix. This database is taken from the UCI Machine Learning Repository. There are many interesting machine learning and pattern recognition datasets in this web site. Google it and check it out if you

are interested. Problem. Train a multilayer perceptron with one hidden layer using the backpropagation rule for recognition of these digits. Pay attention to the following information: • Randomly split the data into two sets: the training set and the test set. Use 1200 samples for

training the network and the remaining 393 samples for testing. • The number of neurons in the input layer should be 256 (plus one bias neuron). • Use the hyperbolic tangent function as the activation function. • Use 10 neurons in the output layer. The output neuron corresponding to the true digit should output 1, and others should output -1. For example, if the true digit is 5, the desired output

should be (−1 − 1 − 1 − 1 − 1 + 1 − 1 − 1 − 1 − 1)T. (Note that digit 5 corresponds to the sixth neuron because the digits start from zero.) • Stop the training when an error of 0.02 is reached, or after 1000 epochs.

• Test the network using the training set. What is the average error? For each sample, find the output neuron that outputs the maximum value, and assign the sample the digit corresponding

to that neuron. How many of the training samples are correctly recognized by the network? • Test the network using the test set. What is the average error? For each sample, find the output neuron that outputs the maximum value, and assign the sample the digit corresponding to that

neuron. How many of the test samples are correctly recognized by the network? • Use different choices for the number of neurons in the hidden layer and the learning rate. For example, use N = 10, 20, 30 neurons in the hidden layer and use learning rates of α = 0.02, 0.2, 2. Report your results for each combination.

• Submit your homework in the form of a well-documented report in printed form. Provide comments on the results you obtained. Submit all codes, outputs, command line prompts, etc. attached in the Appendix part of your homework. Do not submit any MATLAB files by e-mail;

only the printed report will be graded.