## 4 Methods  
Network models of the visual cortex are simulated with spiking neurons using Hodgkin and Huxley equations [23]. Retinal ganglion cells convey the visual image from the eye to the brain [24; 25]. Receptive fields exist in the visual cortex; however, an accurate representation of the neuron circuits for the visual cortex is still unclear. Neural network models have been proposed explaining how the visual system is able to process an image efficiently, and more research is desired to further our understanding of the visual cortex [26]. As ANNs grow in complexity, their associated energy consumption becomes a challenging problem. Such challenges also exist for computing edges in images, where the computing devices are resource-constrained while operating on a limited energy budget. Therefore, specialized optimizations for deep learning have to be performed at both software and hardware levels. Edge detection can be achieved using a spiking neuron model [19]. Spiking neural networks offer a low-energy computational alternative with only a few layers, while maintaining edge features. Our solution for spike-based edge detection uses only one layer of Hodgkin-Huxley-type neurons (1 neuron/pixel) with five spike processing layers, one conductance calculation layer and a synaptic current update layer. The simple form of Hodgkin-Huxley neurons used in the network are similar to the conductance-based leaky integrate-and-fire neurons, which are frequently used in neuromorphic hardware implementation [1; 2]. To implement a neuromorphic analogue of the Canny detector, we invented spike-based computation using the five key steps introduced earlier and implemented in MATLAB. Figure 1 illustrates the flowchart of the algorithmic steps in the spike domain computation of Canny edge detection. The image \(I(x,y)\), where \((x,y)\) are the coordinates of the pixels, is first converted into grayscale \(I(grayscale)(x,y)\) and scaled such that \(I(grayscale)_{max}\) = 0.01 to match the units of the model parameters of the Hodgkin-Huxley neuron model. Then, it is assigned as peak conductance for excitatory synapse \(q_{ex}\) and peak conductance for inhibitory synapse \(q_{in}\). The peak synapses are then converted into time-dependenceconductances, \(g_{ex}\) and \(g_{in}\), for excitatory and inhibitory synapses, respectively, using the equations  
\[g_{ex}=q_{ex}(\tau_{ex}\times dt)/(\tau_{ex}+dt) \tag{1}\]  
\[g_{in}=q_{in}(\tau_{in}\times dt)/(\tau_{in}+dt), \tag{2}\]  
where \(\tau_{ex}=4\) ms and \(\tau_{in}=7\) ms are the time constants for excitatory, inhibitory synapses, respectively [27]. Then, the conductances are processed using a Gaussian kernel of \(5\times 5\), to calculate the synaptic current at each time step \(t\)[28]:  
\[I_{z}(t)=g_{ex}(V-V_{ex})+g_{in}(V-V_{in}), \tag{3}\]  
where \(V_{ex}\) and \(V_{in}\) are the reverse potentials for excitatory and inhibitory synapses, respectively. Note that the kernel size was smaller than \(5\times 5\) for edge pixels. The synaptic current is then used as the input to the Hodgkin-Huxley neurons where the membrane potential in the Hodgkin-Huxley (HH) neuron model [23] is governed by the differential equation:  
\[C\frac{dV}{dt}=I_{z}(t)-G_{K}n^{4}(V(t)-V_{K})-G_{Na}m^{3}h(V(t)- V_{Na})\] \[-G_{L}(V(t)-V_{L}), \tag{4}\]  
where \(C\) is the capacitance per unit area of the lipid bi-layer membrane, \(I_{z}(t)\) represents the total membrane current per unit area, \(G_{K}\) is the potassium conductance per unit area, \(G_{Na}\) is the sodium conductance per unit area, \(V\) is the membrane potential, \(V_{K}\) is the potassium reverse potential, \(V_{Na}\) is the sodium reverse potential, \(G_{L}\) is the leak conductance per unit area, \(V_{L}\) is leak reverse voltage, \(m\) is the activation variable for Na\({}^{+}\) channels, \(h\) is the inactivation variables for the Na\({}^{+}\) channels, and \(n\) is the K\({}^{+}\) inactivation variable.