## 2 Neural Network Architecture
### Building Blocks of the Network
#### 2.2.1 Contrast Detection Layer (CDL)
This variation of the typical RGC encodes the information-contrast of the images not at the firing rate, but on the latency of the generated spikes [40]. In detail, CDL, in our case, scans the image pixel by pixel and encodes the contrast of each pixel (injected to C-VCSEL) with respect to its surrounding ones (injected to the S-VCSELs) at the latency of the generated spike event. In order to accomplish this, a scanning window (SW) (Figure 3 red box in input image) of 3 \(\times\) 3 pixels is formed with the processing pixel located at the center. When a pixel in the SW is white, then its input power is a rectangular pulse of 0.2 mW with 5 ns duration. When a pixel is black, then the input power is set to a lower power amplitude 2 \(\mu\)W while having the same duration as before. The 5 ns time slot will be referred as \(T_{ep}\) and is linked to the inherent refractory period of the VCSEL-neurons used in this work. These electrical input signals associated with each SW drive the C and S neurons of the CDL, whose optical outputs are integrated, weighted and summed before they are injected in the RGC neuron. In the 5 ns time window the RGC is able to produce only a single spike in contrast to the rate encoding scheme of biological RGC. The latency of this specific spike encodes the contrast of the center pixel of the SW that is imposed on the CDL. To understand the way in which CDL encodes pixel's contrast at the timing of the spikes, the following analysis is given. When the input of a C-neuron corresponds to a  
Figure 3: VCSEL based retina ganglion cell (RGC) calculating the contrast of a specific pixel (green box). Each VCSEL takes input from a specific pixel of the SW (red box). Depending on that input, the first 9 VCSEL-neurons, which realize the receptive field of the human eye, produce spikes or remain stable. The outputs of C and S VCSELs are integrated by two photodiodes (PD) whose outputs are weighted and summed before they are injected into the RGC VCSEL. The C-VCSEL (green) has an excitatory effect (positive weight) on the RGC-VCSEL while the outputs of the S-VCSELs (red) have an inhibitory effect (negative weight). The RGC-VCSEL produces a spike for each pixel and according to the spatial distribution of the black and white pixels the spike latency is increased or decreased. white pixel whereas the S-neurons have no input (black pixels) (Figure 4 case 1) the RGC will generate a pulse at \(t_{1}\) (C-ON and S-OFF). In this case, the central pixel has the greatest possible contrast with respect to its surrounding pixels. However, apart from the C-neuron, if one of the S-neurons is also stimulated (Figure 4 case 2) then the pulse will be produced at a time \(t_{2}>t_{1}\). If two S-neurons are stimulated (Figure 4 case 3) then the spike will be produced at \(t_{3}>t_{2}>t_{1}\). The more S-neurons are stimulated, the greater the latency will be. The delay is attributed to the inhibitory effect of the S-neurons (negative weight). On the contrary if the C-neuron has no input but all of the S-neurons are stimulated (Figure 4 case 7) then the spike will be produced at a time \(t_{7}\) (\(t_{7}>t_{3}>t_{2}>t_{1}\)) (C-OFF and S-ON). In this case, the central pixel exhibits the highest negative possible contrast with respect to its surrounding pixels. Moreover, if one of the S-VCSELs has no input, then the pulse of the RGC neuron will be produced at \(t_{6}\) (\(t_{7}>t_{6}>t_{3}>t_{2}>t_{1}\)) (Figure 4 case 6). Therefore, by varying the spatial information, the latency of the produced spike event by the RGC neuron decreases or increases. In a typical implementation each pixel will be processed by a different CDL, which will increase the number of physical neurons. Nonetheless, by exploiting the nanosecond refractory period of VCSELs, we devise a more hardware friendly approach, employing only a single CDL which serially scans every pixel of the input image.