I am relatively new to neural networks and AI, and I have a question regarding the training method in such networks. In particular spiking neural networks (SNNs) are the type we are working with.

I am confused with the best way to train spiking neural networks when high accuracy is the most desired performance metric I am working towards.

For context, we are doing supervised learning with a SNN as an anomaly detector to classify various input data samples, inputted as spike trains, into 2 classes: Healthy and Unhealthy. Our training data has one healthy input sample that we want the SNN to recognise as healthy, and we make up random unhealthy input samples that we want the SNN to recognise as unhealthy. This leads to my question:

How should you train a SNN? Take an example where you have a training dataset with 100 samples and say 50% are healthy and the other 50% are unhealthy, how should this network be trained in terms of the ratio of healthy and unhealthy training samples used to train?

Do you need more than epoch, or iterations?

Should you leave some training samples unshown to the SNN for testing?

And as I only have one healthy sample, will this work?


1 Answer 1


There are many ways to train SNNs. This publication explains a few of them:


However, we can start with some useful tips.

SNNs highly depend on a variable threshold (according to max values), the learning rate, and the number of spikes per sample (impacts the weights training & prediction). You will want to make several trials to find the right parameters' values, and the right amount of iterations and checks before reaching a good result.

In addition to that, 150 samples could be enough as soon as they cover most cases. I don't know the data, so I can only speak in general terms.

Finally, weights initialization also plays an important role: testing several weights initialization could be necessary to reach good results.

Here are some codes that could be helpful:



  • $\begingroup$ Thanks, Nicolas, for your answer. Is there a basic sequence that you generally follow when building and training an SNN. As there are a lot of different parameters and training information (like encoding, network size, layers, learning at each layer, epochs, learning rate etc), can you recommend a basic sequence to go through for simple 2 class classifications of spike train inputs? $\endgroup$
    – David777
    Commented Nov 14, 2022 at 15:49
  • 1
    $\begingroup$ I would recommend to start with just one SNN with a simple signal input to understand precisely the core behavior monitoring weights and parameters. Seems a loss of time, but you’ll learn a lot and you will eventually reach good results faster. $\endgroup$ Commented Nov 14, 2022 at 20:39
  • $\begingroup$ Thanks Nicolas, I will do that. Can you give an example of simple input signals that a small SNN should be able to classify easily so I know I am on the right tracks? Say the SNN has 3 input nodes and I want to classify them into two outputs with just two training samples. What input signals should I apply? $\endgroup$
    – David777
    Commented Nov 15, 2022 at 9:46
  • $\begingroup$ The best would be to use your own data set, with a few signals that are meaningful to your project. In this way, you would start setting the rules that will be necessary to evaluate the main limits of the SNN. $\endgroup$ Commented Nov 15, 2022 at 17:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.