## 2 Neural Network Architecture
### Building Blocks of the Network
#### 2.2.1 Contrast Detection Layer (CDL)  
As stated above, the proposed network is a photonic adaptation of a SCNN [36]. In this case, the first step of processing incorporates a difference of gaussian filter (DoG) that encodes the pixel's contrast to the spike latency. In our case, we replace this digital processing step with a bioinspired neural structure that partially mimics the operation of the retina ganglion cell (RGC) in the mammalian eye. In order to demonstrate the similarity of the digital filters with RGC, we provide an in-depth overview of its function. In biological systems, RGC's task is to transform the analogue optical signals from the eye's retina into a series of spikes (electric potentials) which can then be processed by the brain. The contrast of the input image is encoded to the repetition frequency of these spikes (rate encoding). More specifically, each RGC has its own receptive field which receives optical input from a specific area of the eye retina. The RGC's receptive field is divided into two regions, namely the Center (C) and the Surround (S) (see Figure 3). The firing rate is governed by the intensity contrast of inputs in the S and C regions [39]. In our work, a set of 10 VCSELs-neurons is used so as to emulate the RGC. More specifically, the first nine neurons realize the RGC's receptive field while the 10 th neuron emulates the operation of a single RGC cell. As far as the receptive field is concerned, the 9 VCSEL-neurons are organized in a \(3\times 3\) layout, where each one is associated with a specific area of the receptive field. In this scheme, the C area is implemented by a single excitatory neuron (Figure 3 green C-VCSEL) located at the center of the \(3\times 3\) layout, whereas the S area is implemented by 8 inhibitory neurons (Figure 3 red S-VCSELs) surrounding the  
Figure 2: Photonic Spiking Convolutional Neural Network (PSCNN) architectural view. External electrical pulses according to the pixel’s intensity are inserted at the Contrast Detection Layer (CDL). White pixels are encoded as rectangular pulses with power of 0.2 mW whereas black pixels are encoded as rectangular pulses with power equal to 2 \(\mu\)W. CDL’s output consists of spike trains with latency proportional to each pixel’s intensity. Different pixels are processed by the same neuron in a sequential function and output spikes are multiplexed in time. When CDL’s processing is complete then the output electrical spikes are inserted in the Synchronization Layer (Synch) in order to synchronize the spikes from different pixels and fit them to a specific time frame. After the synchronization is completed, spikes are inserted into the First Convolutional Layer (CLI) which detects spike patterns (features) according to their timing. When a pattern is detected the corresponding neuron of CL1 fires a spike (feature extraction). These new spikes originating from CL1 are transmitted to the Second Convolutional Layer (CL2) in order to detect more complex patterns. The same procedure is repeated in the Third Convolutional Layer (CL3). At the Classification Layer the network is able to classify the incoming image based on the detected patterns from all CL3. Throughout the network, synchronizing procedures are necessary in order for the spikes to coincide at the next layer. C-neuron. C-VCSEL and S-VCSELs are biased at the excitable regime which corresponds to an integrate-and-fire operation [9]. Their outputs are integrated by two photodiodes, PD\({}_{1}\) for the S-neurons and PD\({}_{2}\) for the C-neuron (Figure 3). The electrical outputs from the two PDs are weighted and summed (the negative weight for PD\({}_{1}\) and the positive weight for PD\({}_{2}\)) before driving the RGC neuron, which is biased at the spiking regime, meaning that it fires spikes at a constant firing rate under no injection [9]. However, DoG filters dictate for a slightly different operation [36], for this reason, we modified the typical RGC so as to act as a Contrast Detection Layer (CDL).