Spiking neural network with ImageNet and CIFAR-10 database

Hi all,

I would like to convert a Keras model to a spiking neural network like the provided example in the website but with ImageNet and CIFAR-10 database. Is it possible? Is there any tutorial or example?

Thank you

Hi Amir, and welcome to our forums! :smiley:

The NengoDL documentation has a bunch of examples here. The Keras-to-SNN example is probably the one of most interest to you. It goes through step-by-step the process of converting a standard Keras network into a spiking neural network (using NengoDL).

We don’t have any ImageNet or CIFAR-10 examples for NengoDL, but the linked example above is generalizable. We do have a CIFAR-10 example here, and while it is tailored for the Loihi backend, it may be of help to you (to figure out what the input structure, or network structure to use is).

Hi, @xchoo Thanks a lot for the detailed explanation.

I also found the " CIFAR-10 classifier with a spiking CNN " Nengo extras. I’ve tried to run the code and face the following error:

Can you give me your advice?

Thank you

I have seen this error before, and I believe it is caused by having incompatible versions of Nengo and NengoOCL installed in your python environment. Can you provide the version numbers for the various Nengo packages you have installed in your environment are? The pip freeze | grep nengo command will get this information for you.

@xchoo Thank you for your prompt reply.

Here is the version numbers for the Nengo packages:


NengoExtras is out of date, so it doesn’t work with Nengo 3.0.0. I’m not sure the last version it works with.

NengoOCL now supports the nengo.Convolution operator introduced in Nengo 3.0.0, so I would use one of the examples @xchoo pointed to above.

@Eric Thank you very much for the explanation.