# Training Spiking Neural Networks with Metaheuristic Algorithms
## 1 Introduction
The main research question of this work is: 'How to develop a supervised learning method to address the challenge of gradient descent with spiking neurons?' In this paper, a novel metaheuristic-based supervised learning method for SNNs based on adapting the temporal error function is introduced for solving classification problems. The procedure is as follows: each input pattern is converted into a spike, then the Integrate-and-Fire neuron is stimulated and emits a spike when it reaches its threshold, and finally, the temporal error function is computed. We used seven well-known algorithms, from modern to simple ones, called evolutionary algorithms (EAs), such as Genetic Algorithm (GA), Differential Evolution (DE) and Grammatical Evolution (GE), and swarm intelligence algorithms (SIAs), such as Particle Swarm Optimization (PSO) and Artificial Bee Colony (ABC). There are also nature-based methods, such as the Cuckoo Search algorithm (CS), and a family of physical algorithms, such as Harmony Search (HS). To define target firing times, relative target firing times were used instead of fixed and predetermined ones. The key benefit is that our proposed model makes predictions with only a single output spike, making the computation of the error function simpler. The main finding was that, due to the success of the metaheuristic algorithms, we effectively avoided the significant drawbacks of the gradient descent training method falling into local minima. The outcome is that our proposed approach demonstrated competitive accuracy on UCI datasets. All seven metaheuristic algorithms converged to the optimal solution; however, the CS algorithm reported the highest results and showed a faster convergence rate for most evaluated datasets. To the best of our knowledge, this is the first study to investigate seven metaheuristic algorithms for training SNNs. The following are the contributions of this paper:  
* This work proposes a novel metaheuristic-based supervised learning method for multilayer SNNs to classify UCI datasets. * This work uses seven well-known metaheuristic algorithms for the training of SNNs in order to overcome the issue of falling into local minima associated with gradient descent training. * To simplify the computation of the error function, our proposed model makes predictions with only a single output spike. Moreover, this work uses relative target firing times instead of fixed and predetermined ones. * To evaluate the efficiency of our proposed model, the trained network was tested on five benchmark classification datasets. The model performance was comparable to state-of-the-art methods, with accuracy levels of 0.9858, 0.9768, 0.9591, 0.7752, and 0.6871 for iris, cancer, wine, diabetes, and liver datasets, respectively. Among the seven metaheuristic algorithms, CS showed the most satisfactory performance. The rest of the paper is organized as follows. Section 2 describes a theoretical framework and concepts of metaheuristic algorithms. Section 3 explains the SNN model and the proposed methodology for training multilayer spiking neural networks with temporal error. Section 4 describes the experimental configuration of this work and compares the efficiency of the proposed approaches against several existing metaheuristic and non-metaheuristic SNN learning models. Section 5 presents a discussion of the results. In the last section, conclusions are drawn and future research directions are indicated.