0% found this document useful (0 votes)
395 views11 pages

Programming Assignment Page 1 of 11

This document describes the development and training of a neural network to recognize numbers 0 to 9 and letters A to F and H displayed on a 7-segment display. The author encoded the input and output patterns in a file to train the network using a basic Prop neural network simulator. After configuring a 3-layer feedforward network and loading the pattern file, the network was trained over 100,000 steps until the error rate reached 0.024, correctly recognizing all 17 test patterns. The author concluded they successfully accomplished supervised learning to train the neural network for this task.

Uploaded by

studyjunky
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
395 views11 pages

Programming Assignment Page 1 of 11

This document describes the development and training of a neural network to recognize numbers 0 to 9 and letters A to F and H displayed on a 7-segment display. The author encoded the input and output patterns in a file to train the network using a basic Prop neural network simulator. After configuring a 3-layer feedforward network and loading the pattern file, the network was trained over 100,000 steps until the error rate reached 0.024, correctly recognizing all 17 test patterns. The author concluded they successfully accomplished supervised learning to train the neural network for this task.

Uploaded by

studyjunky
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Programming Assignment Page 1 of 11

Programming Assignment

University of the People

CS 4407: Data Mining and Machine Learning

Unit 6: Artificial Neural Networks – Part 1

Name Removed
Programming Assignment Page 2 of 11

Introduction

This presentation will present my effort in developing and training a neural network

to detect the numbers 0 to 9 as well as the letters A through F and H of the alphabet when

displayed on a seven-segment display. It will include screenshots, comments, and brief

explanations (where appropriate), and will conclude with a short conclusion.

Preliminaries

I will create a network, load the pattern file, and then train the network to recognize

the letter or number based on the pattern of segments input using the Basic Prop neural

network simulator.

My design will be based on the seven-segment display shown below, with each

segment serving as one input to the neural network. This numbering will be sent into my

neural network as input. The ASCII code (in binary) of the letter or number determined by

the input pattern will be returned as the output.


Programming Assignment Page 3 of 11

ASCII Code set used:

Character ASCII Neural Network Output (Binary)

0 48 0110000

1 49 0110001

2 50 0110010

3 51 0110011

4 52 0110100

5 53 0110101

6 54 0110110

7 55 0110111

8 56 0111000

9 57 0111001

A 65 1000001

B 66 1000010

C 67 1000011

D 68 1000100

E 69 1000101

F 70 1000110

H 72 1001000
Programming Assignment Page 4 of 11

Part 1. Write the pattern file

The simple Prop simulator use the pattern file to train the network. In this case, I

encoded the input and output and converted the data into a format that the software could

understand.

a. The input is in binary format and is represented as a seven-element vector, with each

index indicating a different point on the display. I encoded the display unit segments in my

pattern file in the sequence 9 8 7 6 5 4 3 2 1 from left to right in order to match the binary

representation of the ASCII code (both read from left to right) and for my personal

convenience of reading the binary digits. If the position is lighted up for a number, the value

is one; otherwise, it is zero.

b. Because the software required binary input and output, I also encoded the output in

binary format. The values in ASCII have been translated to binary. Look at the graph

above.

c. This is a snapshot of the text file I'll be using to train the network, which has the

required extension (.pat) so that basic Prop recognizes it as an input pattern file. (See

pattern file 7segment.pat for details.)

Screenshot showing input/output encoding inside pattern file (parts a, b, c):


Programming Assignment Page 5 of 11

Part 2. Create the network

a. Configure the network by selecting Configure Network from the list of choices in the

Network menu.

I picked a three-layer feed-forward network of six neurons, with inputs and outputs

both equal to seven (as in the pattern I produced in part 1) and an output bias of one.

Screenshots are provided below (also, see attached file 7segment.net).


Programming Assignment Page 6 of 11

b. Load your pattern file into the network to train it. This may be accomplished by selecting

Load Patterns from the Patterns dropdown menu. Then choose the file you produced in

section

1. Then use the control panel on the right side to train your network.
Programming Assignment Page 7 of 11

Here's a snapshot of the parameters I chose (learning rate of.3, momentum of.8,

learning steps of 5000, weight range of -1, -1) and the pattern file loaded.

The network was then trained by clicking the Train button. Here are some screenshots of the

error progress graph as I worked through it.


Programming Assignment Page 8 of 11

As we can see, the errors are smoothly converging to 0, indicating that my model is

functioning. After 20,000 learning steps, it is already near to the desired error rate

percentage of less than 5% (.05), as specified by the assignment. Let's attempt another

5000 steps.

That reduced my error rate to.049, which was required, but now I'm going to try to

reduce it even lower.

The error rate is now at .03, after 50,000 learning steps, but now I’ll train it to 100,000 steps.

The error rate has now reached. 024, which is half of the minimum amount, thus I'll call my

testing a success.

I've provided a snapshot of the weights I changed to improve performance (also see

attached the weight file 7segment.wts).


Programming Assignment Page 9 of 11

c. Test the model by choosing individual patterns and Clicking the Test one button.

Here are some screenshots of the 17 distinct patterns from my pattern file being tested.
Programming Assignment Page 10 of 11

As you can see, the results of the testing for each unique pattern correspond to what I stored in
the pattern file.

Finally, here is my Test all screenshot (same as above testing).

Conclusion

These activities clearly show how to build up and train a basic feed-forward artificial

neural network. According to Gershenson (2003), training and learning entail applying an

algorithm to alter weights to get the intended result, i.e., supervised learning. I believe I

have accomplished this here while also learning something; now I simply need to lower my

own mistake rate.


Programming Assignment Page 11 of 11

References:

Gershenson, C. (2003). Artificial neural networks for beginners. Retrieved from:

http://arxiv.org/ftp/cs/papers/0308/0308031.pdf

Words: 850

You might also like