For the units 6-7 assignment you will be required to build and train a neural network to recognize letters of the alphabet and numbers based upon their design using a seven segment display where each segment of the display is one input into the neural net

For t h e u nit s 6 -7 a ssig nm en t y o u w il l b e r e q uir e d t o b uild a n d t r a in a n eu ra l n etw ork t o r e co gniz e

le tte rs o f t h e a lp hab et a n d n um bers b ased u pon t h eir d esig n u sin g a s even s eg m en t d is p la y w here

each s eg m en t o f t h e d is p la y i s o n e in put i n to t h e n eu ra l n etw ork .

Usin g t h e n um berin g f o r t h e s eg m en ts in t h e p re vio us f ig ure a s t h e in puts in to y o ur n eu ra l n etw ork .

You a re w elc o m e t o u se a n y n etw ork d esig n t h at w ill a ccu ra te ly s o lv e t h e p ro ble m . In t h is c ase y o ur

netw ork m ust b e a b le t o id en tif y t h e le tt e r o r n um ber b ased u pon t h e p atte rn o f s eg m en ts . F or

exam ple if t h e s eg m en ts 1 ,2 ,3 ,4 , a n d 7 a re lig hte d t h en t h e p atte rn w ould r e p re sen t t h e n um ber 3 . T he

num ber t h re e m ust b e r e p re sen te d a s a b in ary n um ber t h at is t h e o utp u t o f t h e n eu ra l n etw ork .

Not a ll o f t h e le tte rs o f t h e a lp hab et c an b e a ccu ra te ly r e co gniz e d . T he f o llo w in g c h art r e p re sen ts t h e

num bers a n d le tte rs t h at y o u r n etw ork m ust b e a b le t o r e co gniz e w it h t h e e xcep tio n o f le tte rs S a n d Z

whic h c an not b e d is tin guis h ed f r o m t h e n um bers 2 a n d 5 .

The o utp ut o f y o ur n etw ork w ill b e t h e A SC II c o de o f t h e le tte r o r n um ber d efin ed in t h e f o llo w in g lis t

an d r e p re sen te d a s b in ary . S in ce t h e l a rg est n um ber is 7 2 y o u w ill r e q uir e 7 o utp uts t o r e p re sen t a n y

of t h e 7 s eg m en t n um era ls .

 -  1  -  

Chara cte r ASC II Neu ra l N etw ork O utp u t ( B in ary )

0 48 0110 000

1 49 0110 001

2 50 0110 010

3 51 0110 011

4 52 0110 100

5 53 0110 101

6 54 0110 110

7 55 0110 111

8 56 0111 000

9 57 0111 001

A 65 1000 001

B 66 1000 010

C 67 1000 011

D 68 1000 100

E 69 1000 101

F 70 1000 110

H 72 1001 000

We a re u sin g a 7 s eg m en t d is p la y t o r e co gniz e le tte rs a n d n um bers , h ow ever it is im porta n t t o k n ow

th at w e c o uld u se t h e s am e a p pro ach t o r e c o gniz e v ir tu ally a n yth in g. W e a re u sin g a 7 s eg m en t

dis p la y b ecau se o ur s im ula te d n eu ra l n etw ork o nly h as t h e c ap acit y t o a cco m modate 1 0 in put v alu es.

How ever if w e h ad m ore in pu t v alu es w e c o uld r e co gniz e a n y h an dw rit t e n le tte r o r n um ber. C onsid er

th e f o llo w in g e xam ple s e xam ple . A ssu m e t h at w e h ad a m atr ix t h at w as 1 6 x 1 6 ( t o ta l o f 2 56 p oin t) a n d

each o f t h e p oin ts w ere a n in put i n to o ur n eu ra l n etw ork . F urth er a ssu m e t h at w e c o uld o verla y a h an d

writ te n le tte r o r n um ber o nto t h is m atr ix . E very p ix el t h at w as c o lo re d b y t h e le tte r w ould h ave a v alu e

of 1 a n d a n y p ix el t h at w as n ot c o lo re d w ould h ave a v alu e o f 0 .

 -  2  -  

Usin g t h is a s in put w e c o uld e as il y t r a in a n eu ra l n etw ork t o ‘r e co gniz e ’ v ario us h an d w rit te n le tte rs .

As t h e a m ount o f t r a in in g in cre ase s t h e a ccu ra cy o f t h e n etw ork t o d ete ct s im ila r le tte rs t h at m ig ht n ot

have t h e e xact s am e s h ap e ( b u t a s im il a r o ne) w ould in cre ase.

Let’s c o nsid er a n oth er e xam ple . A ssu m e t h at w e h ad a n eu ra l n etw ork a n d in ste ad o f t h e in puts b ein g

1 o r 0 , w e h ad t h e a b ilit y t o d ete rm in e a v alu e b etw een 0 a n d 1 a s in put w here 0 w as t h e c o lo r w hit e a n d

1 t h e c o lo r b la ck a n d s h ad es o f g re y a s v alu es in b etw een 0 a n d 1 .

Usin g t h is a p pro ach w e c o uld t r a in t h e n eu ra l n etw ork t o r e co gniz e f a c es, p eo ple , a n d o bje cts … s u ch

as A lb ert E in ste in h ere . In p ra c tic e, f a cia l r e c o gnit io n s o ftw are w ill t y p ic ally lim it t h e a m ount o f

‘f e atu re s’ t h at a re u sed a s i n pu t t o t h e n eu ra l n etw ork t o a re as t h at h ave t h e g re ate s t p re d ic tiv e p ow er

su ch a s t h e p osit io n o f t h e e yes , n o se, m outh , a n d p erh ap s c h in , b ut t h e p rin cip le r e m ain s t h e s am e a s

th e n etw ork t h at w e w ill b uild t o r e c o gniz e t h e le tte rs in t h e 7 s eg m en t d is p la y.

 -  3  -  

To c o m ple te t h is a ssig nm en t, y o u w ill n ee d t o d ow nlo ad a n d in sta ll t h e B asic P ro p n eu ra l n etw ork

sim ula to r. B asic P ro p is d is tr ib ute d a s a n e x ecu ta b le J ava J ar f ile . Y ou c an e it h er e xecu te t h e f ile o n

yo ur lo cal c o m pute r o r y o u c a n a cce ss t h e s im ula to r in t h e V ir tu al C om putin g L ab . T o r u n t h e

sim ula to r o n y o ur lo cal c o m pute r y o u w il l n eed t o h ave t h e J ava J R E ( ja va r u ntim e e n vir o nm en t)

vers io n 1 .5 o r g re ate r in sta ll e d o n y o ur c o m pu te r.

The s im ula to r c an b e d ow nlo ad ed f r o m t h e b asic p ro p w eb sit e a t t h e f o llo w in g U RL:

http ://b asic p ro p.w ord pre ss .c o m /2 011 /1 2/2 1/in tr o ducin g-b asic -p ro p-a -s im ple -n eu ra l- n etw or/

As p art o f t h e a ssig nm en t y o u w ill n eed t o c re ate a p atte rn f ile f o r t h e 7 s eg m en t d is p la y in put d ata .

You c an s ee a n e xam ple o f a p atte rn f il e o n t h e b asic p ro p w eb sit e .

I h ave p ro vid ed a n e xam ple o f a p atte rn f ile b elo w . In t h is c ase I h ave s et u p t h e p atte rn f ile t o t e ach t h e

neu ra l n etw ork t o a d d t w o b in ary n u m bers . N otic e t h at t h e f ir s t s et o f d ig it s is t h e in put v alu e in b in ary .

The s eco nd s et o f d ig it s is t h e o utp ut v alu e o f t h e n etw ork . N otic e h ow in t h e f ir s t s et o f d ig it s I h ave 0

0 0 0 1 0 0 0 0 0 1 a s in put. In t h is e xam ple w hic h a d ds t w o n um bers t o geth er, I h ave d efin ed t h e in put

as t w o b in ary n um bers e ach 5 d ig it s in le n gth ( in t h e f ir s t e xam ple t h e t w o n um bers a re 1 in b in ary ).

The s eco nd s et o f d ig it s a re t h e o utp ut o f t h e n etw ork in t h e e xam ple it w ould b e 2 in b in ary ( 0 0 0 1 0 )

….1 p lu s 1 is 2 .

The n etw ork is t h en ‘t a u gh t’ t o a d d t h e t w o n um bers t o g eth er.

Num ber o f p atte rn s = 3

Num ber o f in puts = 1 0

Num ber o f o utp uts = 5

[P atte rn s]

0 0 0 0 1 0 0 0 0 1 0 0 0 1 0

0 0 0 1 0 0 0 0 0 1 0 0 0 1 1

0 0 0 1 1 0 0 0 1 0 0 0 1 0 1

Anoth er e xam ple is u sin g t h e n eu ra l n etw ork t o p ro cess lo gic p atte rn s s u ch a s A ND, O R, a n d t h e X O R.

You c an d ow nlo ad t h e p att e rn f ile f o r A N D lo gic a n d u se t h e s am e f ile f o rm at f o r a n etw ork t h at c an

so lv e t h e 7 s eg m en t d is p la y p ro ble m ( y o u c o uld a ls o c u t a n d p aste m y a d d n um bers p atte rn f ile f r o m

ab ove). W hen y o u h ave c re ate d t h e p atte rn f ile ( th e p atte rn f ile d efin es t h e n um ber o f in puts a n d t h e

outp uts in t h e p ro ble m a n d t h e n um ber o f t e st c ases y o u c an u se it t o t r a in a n d t e s t y o ur n eu ra l

netw ork .

Usin g t h e s im ula to r y o u w il l n eed t o d esig n a n etw ork , lo ad t h e p atte rn f ile , a n d t h en t r a in t h e n etw ork .

You s h ould e xp erim en t w it h y o ur n etw ork d esig n t o m ake s u re t h at y o ur n etw ork a n d s o lv e a ll o f t h e

te st c ases. If y o ur n etw ork i s n o t s o lv in g a ll o f t h e c ases, t h en y o u s h ould a lt e r t h e d esig n o f t h e

netw ork a n d t r a in t h e n etw ork a g ain . When y o u h ave w ork ab le n etw ork d esig n t h at s o lv es a ll o f t h e

cases:

● You s h ould s av e y o u r n etw ork , c ap tu re a s cre en s h ot o f y o ur s im ula to r w it h t h e c o m ple te d

so lu tio n, a n d s av e y o ur p atte rn f ile .

● You m ust r e p ort o n t h e r e s u lt s o f t e s tin g y o ur n etw ork a fte r it h as b een t r a in ed .

● You m ust in clu de t h e a v era g e p er p atte rn e rro r m etr ic a s p art o f y o ur t e stin g r e su lt s .

● Your e rro r s h ou ld b e u nder 5 % in o rd er f o r t h e n etw ork t o b e a ccep ta b le .

● You m ust r e p ort t h e n u m ber o f t r a in in g s te p s t h at y o ur n etw ork r e q uir e d .

 -  4  -  

● You s h ould r e p o rt t h e m etr ic s c h osen in b asic p ro p f o r t r a in in g y o ur n etw ork r e p ort t h e

defa u lt s if y o u d o n o t c h an ge t h em .

● You s h ould r e p o rt t h ese m etr ic s f o r E A CH n etw ork t h at y o u t e s t id en tif y in g t h e n etw ork

th at y o u s ele cte d a s t h e s o lu tio n f o r y o ur a ssig nm en t.

● You s h ould a ls o u se t h e f e a tu re in b as ic p ro p t o s ave y o ur w eig hts t o a f ile .

● All o f t h ese it e m s s h ould b e s u bm it te d a s p art o f y o ur a ssig nm en t.

● You s h ould a ls o w rit e a s h ort p ap er e xp la in in g t h e p ro cess t h at y o u w en t t h ro ugh t o

develo p y o ur n etw ork in clu din g a n y n etw ork d esig ns t h at w ere u nab le t o a ccu ra te ly

dete rm in e w hat e ac h in put c h ara cte r w as a n d t h e r e aso ns t h at y o u d is co vere d t h e n etw ork

desig n w as n o t s u cces sfu l.

NO TE : Y ou w ill h ave 2 w eeks t o c o m pete t h is a ssig nm en t; it w ill b e d ue a t t h e e n d o f W eek/U nit 7 .

 -  5  -