# Training Spiking Neural Networks with Metaheuristic Algorithms
## 1 Introduction  
In recent years, artificial neural networks (ANNs) have become the best-known approach in artificial intelligence (AI) and have achieved superb performance in various application fields, such as video processing [1], computer vision [2], autonomous driving drones [3], natural language processing (NLP) [4], medical diagnosis [5], game playing [6], and text processing [7]. The emergence of deep learning (DL) has again brought enormous attention to ANNs. They have become state-of-the-art models and won different machine learning (ML) challenges. Despite being inspired by the brain, these networks lack biological plausibility and have structural differences. The human brain can learn from a few samples and generalizes well. It stores a large amount of information and has amazing energy efficiency. For many years, a belief in neuroscience was that neurons encode essential information via frequencies of spikes. Recent neurophysiological findings show that the precise timing of action potentials is also necessary for effective information processing in brain systems [8, 9]. ANN models can be divided into three generations based on their computational units, as shown in Figure 1. First-generation ANNs utilize the traditional McCulloch and Pitts neuron model as computational units, in which the output value is a binary variable ('0' or '1'). The second generation is characterized by the use of continuous activation functions in neural networks, such as perceptron and Hopfield. The thirdgeneration of neural algorithms is represented by spiking neural networks (SNNs) [10]. In this model, information is encoded into spikes inspired by neuroscience. Moreover, this neuron model mimics biological neurons and synaptic communication mechanisms based on action potentials [11]. In spiking neurons, inputs are integrated into a membrane potential only when spikes are received and generate spikes when the membrane potential reaches a certain threshold voltage. These operations enable event-driven computation and are exceptionally energy efficient [12; 13], which makes them appealing for real-time embedded AI systems and edge computing solutions [14]. Table 1 shows the differences between SNNs and ANNs in terms of neurons and information processing. Existing works reveal that SNNs are executed on neuromorphic chips handling spike-based accumulate (AC) operations. Thus, SNNs can save energy by orders of magnitude compared with ANNs that are dominated by energy-hungry multiply-and-accumulate (MAC) operations on conventional dense computing hardware, such as GPUs. Recently, many neuromorphic processors have been developed, such as IBM's TrueNorth [15], Intel's Loihi [16], and SpiNNaker [17], to implement SNNs. In recent years, SNNs have received extensive attention in numerous applications, including the brain-machine interface [18], machine control and navigation systems [19], event detection [20], and pattern recognition [21]. Although they offer many advantages, there are still some barriers to overcome. Learning strategies in SNNs are integrated with various elements of a neural network, including how information is encoded and the neuron model. Thus, training an SNN is difficult due to the non-differentiable nature of activation functions [22] (Figure 1). In recent years, tremendous efforts have been devoted to the training algorithms of SNNs. Conventionally, there are two main approaches to training SNNs: converting ANNs to SNNs and directly training SNNs. In the first case, conventional ANNs are fully trained, using backpropagation (BP), before being converted to an equivalent model consisting of spiking \begin{table}
\begin{tabular}{c c c} \hline \hline  & **Spiking Neural Network** & **Artificial Neural Network** \\ \hline \multirow{3}{*}{Neuron} & Spiking neuron (e.g., & \\  & Integrate-and-Fire, & \\  & Hodgkin–Huxley, Izhikevich) & \\ \hline \multirow{2}{*}{Data Processing} & Spike-based & Frame-based \\ \hline \multirow{2}{*}{Time Processing} & Continues & Sampled \\ \hline \hline \end{tabular}
\end{table}