# Image Interpolation Based on Spiking Neural Network Model
## 4 Proposed Method
### Proposed SNN Model for Edge Detection  
In this study, a new SNN model shown in Figure 4 is proposed for edge detection to be used in the interpolation process. The proposed model consists of three layers. The first layer is the receptor layer, which transmits the gray-level values from the pixels to the neurons. The network model detects the edges in four different directions (\(0^{\circ}\), \(45^{\circ}\), \(90^{\circ}\), and \(135^{\circ}\)) for an image. Although the structure of the proposed SNN model is based on the model developed for ADFs [36], the interlayer structure is modified for line detection [29] purposes to detect edges. Thus, the edges in four different directions are obtained as four different output values instead of a single output value. Figure 4: Proposed SNN model. Figure 3: Example of synaptic connections of conductance-based IF neuron model. In the first layer, the receptor layer, each pixel in the SNN model corresponds to a receptor. Data from the receptor layer are transmitted to the intermediate layer via synaptic connections. Each of all eight neurons in the intermediate layer is connected to the receptor layer by different synaptic connections. The connections of the neurons in the intermediate layer are structured with the help of synaptic matrices. X and \(\Delta\) symbols in synaptic matrices indicate excitatory and inhibitory synapses, respectively. The neurons in the intermediate layer are connected to four separate output neurons in pairs according to their edge directions. The firing number of each neuron in the output layer in a time interval corresponds to the gray-level value of the edge image specified by the output neuron. Thus, each output neuron creates a gray-level edge image. In the receptor layer, there is a 3 \(\times\) 3 receptor field (RF) that centers each pixel in the image. Each RF is connected to eight neurons in the intermediate layer (M\({}_{\rm A1}\), M\({}_{\rm A2}\), M\({}_{\rm B1}\), M\({}_{\rm B2}\), M\({}_{\rm C1}\), M\({}_{\rm C2}\), M\({}_{\rm D1}\), and M\({}_{\rm D2}\)) with eight individual synaptic matrices (m\({}_{\rm A1}\), m\({}_{\rm A2}\), m\({}_{\rm B1}\), m\({}_{\rm B2}\), m\({}_{\rm C1}\), m\({}_{\rm C2}\), m\({}_{\rm D1}\), and m\({}_{\rm D2}\)). Each pair of neurons in the intermediate layer determines the edges located at the angles 90\({}^{\circ}\), 0\({}^{\circ}\), 45\({}^{\circ}\), and 135\({}^{\circ}\), respectively. For example, synaptic signals from RF to M\({}_{\rm A1}\) via m\({}_{\rm A1}\) are calculated between the horizontal pixels in the center and the other six neighboring pixels. The center pixel in the RF and its neighbors to its left and right have an excitatory synaptic connection through the matrix m\({}_{\rm A1}\), whereas other pixels have an inhibitory synaptic connection. If the excitatory pixels have a higher gray-level value than the inhibitory pixels, the membrane potential of the neuron M\({}_{\rm A1}\) will increase and the neuron will generate spikes at intervals. Otherwise, the membrane potential of m\({}_{\rm A1}\) will not change and the neuron will not generate any spike. The same is true for the neuron M\({}_{\rm A2}\), which has synaptic connections opposite to that of the neuron M\({}_{\rm A1}\). In the matrix m\({}_{\rm A2}\), the central pixel and its left and right neighbors have inhibitory synaptic connections, whereas the other six neighbors have excitatory connections. So, if the pixels on the central horizontal plane have a lower gray-level value than those of the other neighbors, the membrane potential of the neuron M\({}_{\rm A2}\) will increase and the neuron will generate spike(s). The greater the difference between the signals from the excitatory and inhibitory synapses, the higher the frequency of spike generation will be. If the pixels on the central horizontal plane and the gray-level values of the other six neighbors are the same or close, neither of the neurons M\({}_{\rm A1}\) and M\({}_{\rm A2}\) will generate spikes.