# Human Visual System - Neural Nets

Since the beginning of time people have been interested in finding out how the brain works, and this project deals with line and edge detectors of the human visual system. This project will investigate neural network software for which there are packages available. Your task here is to try several free/shareware packages, choose one for experimentation, and then conduct the following experiments. Packages can be found, for example, on the internet or on CDs included with textbooks.

Most of the research and applications of neural networks involves feed-forward networks trained by the back-propagation algorithm, and the design of the networks does not correspond with our knowledge of the human brain. The experiments below attempt to design neural networks that simulate, at least to a reasonable extent, important aspects of the human visual system. Some programming will be required but not much if you can interface with an appropriate neural network package. This team will explore the available neural network software and conduct the following experiments:

## Experiment 1

Your initial experiment (just to test the neural-network software packages) is to show that a two-layer feed-forward Perceptron network (one input-unit layer, one output-unit layer, and one set of trainable weights between them) is not sufficient to separate the exclusive OR function, separating (0, 1) and (1, 0) from (0, 0) and (1, 1). This neural network has two binary input units and one output unit that is trained to be positive for (0, 1) and (1, 0) and negative for (0, 0) and (1, 1), see Figure 1A. Then show that a three-layer network (add a hidden layer of, say, two units between the input and output layer) that has two sets of adjustable weights easily solves this problem, see Figure 1B. Figures

## Experiment 2

Your first interesting experiment is to create a simple three-layer-Perceptron model (input, hidden, and output layers) of the visual system as follows (see Figure 2):
• Input (first) layer: 20x20 retina of binary (0 or 1) units, total of 400 units.
• Alphabet character input patterns: initially use the subset of the alphabet that consists of horizontal and vertical line segments, that is the uppercase letters E, F, H, I, L, T. Let each character be represented by a 5x7 bit pattern as follows:
```*****  *****  *   *    *    *      *****
*      *      *   *    *    *        *
*      *      *   *    *    *        *
****   ****   *****    *    *        *
*      *      *   *    *    *        *
*      *      *   *    *    *        *
*****  *      *   *    *    *****    *
```
Allow a bit pattern to be placed a any position inside on the 20x20 retina but not adjacent to an edge; by shifting the 5x7 character pattern around the retina there are 168 (12*14) possible non-retinal-edge positions of a character pattern.
• Input patterns for training and testing: For training, generate 40 random positions for each of the 6 characters for a total of 240 (40*6) input patterns. For testing, generate similarly another 240 input patterns.
• The second layer is a layer of 50 hidden units.
• The output layer consists of 6 units, one for each of the characters to be recognized.
• The system is trained to produce a positive output-unit response for the correct character and negative output-unit responses for the incorrect characters.
• The system is then tested on the test set of characters to obtain a percent accuracy.

## Experiment 3

This experiment incorporates Hubel/Wiesel-like cells into the model. This experiment should be completed by the halfway point of the semester and the results presented at our second in-class meeting. This model is as follows (see Figure 3):
• The input layer and input character patterns are as above for experiment 2.
• The second layer consists of Hubel/Wiesel-like line detectors for detecting horizontal and vertical lines. The horizontal and vertical line detectors are as follows:
```Horizontal    Vertical
+
---          -+-
+++++         -+-
---          -+-
+
```
Each of these detectors units has a threshold of 3. The input to a detector unit, when superimposed on an input pattern, is determined by adding the +'s and subtracting the -'s of underlying active input-pattern units. Then, if the input value is equal to or greater than the threshold, the detector is activated (set to 1); otherwise it is inactive (set to 0). There are a total of 224 (14*16) horizontal line detectors and similarly 224 vertical line detectors, one for each of the possible non-retinal-edge positions of a detector. Thus, there are 448 second-layer units.
• The third layer is a hidden layer of 50 units.
• The output (fourth) layer consists of 6 units as above for experiment 2.
• The system is trained and tested as above for experiment 2.

## Experiment 4

Elaborate on the previous experiment by doing as much of the following as time permits:
• Increase the alphabet to the full 26 uppercase letters, the first three as follows:
```  *    ****    ***
* *   *   *  *   *
*   *  *   *  *
*   *  ****   *
*****  *   *  *
*   *  *   *  *   *
*   *  ****    ***
```
• The second layer of Hubel/Wiesel-like line detectors is doubled to include detectors at angles in increments of 45 degrees, that is at angles of 0, 45, 90, and 135 degrees. We also add the following edge detectors for detecting edges:
``` ---               +++
+++      and      ---
```
oriented at the same angles.
• Conduct experiments with both clean and noisy input. Random noise is easily added to the input layer patterns: 2% (a random 8 of the 400 input units is changed, by either change 1 to 0, or 0 to 1), 5%, 10%, 15%, and 20% noise.
• The third layer is a hidden layer of 50 units, but also try 100 units.
• The output (fourth) layer is increased to 26 units, one for each of the characters to be recognized.

## Fast Agile XP Deliverables

We will use the agile methodology, particularly Extreme Programming (XP) which involves small releases and fast turnarounds in roughly two-week iterations. Many of these deliverables can be done in parallel by different members or subsets of the team. The following is the current list of deliverables (ordered by the date initiated, deliverable modifications marked in red, deliverable date marked in bold red if programming involved, completion date and related comments marked in green, pseudo-code marked in blue):
1. 9/24 (should complete this item in one or at most two weeks). Find an appropriate neural network package and complete experiment 1.
2. -