Home

Awesome

Object Detection with Spiking Neural Networks on Automotive Event Data

This work is supported by the French technological research agency (ANRT) through a CIFRE thesis in collaboration between Renault and Université Côte d'Azur.

This repository contains the codes for the paper Object Detection with Spiking Neural Networks on Automotive Event Data, accepted to the IJCNN 2022, presenting the first SNNs capable of doing object detection on the complex Prophesee GEN1 event dataset.

Video demo

Our main contributions are:

  1. We present a novel approach to encode event data called voxel cube that preserves their binarity and temporal information while keeping a low number of timesteps. (see the datasets module)
  2. We propose a new challenging dataset for classification on automotive event data: GEN1 Automotive Classification, generated using the Prophesee object detection dataset of the same name. (see datasets/classification_datasets.py)
  3. We train four different spiking neural networks for classification tasks based on popular neural network architectures (SqueezeNet, VGG, MobileNet, DenseNet) and evaluate them on two automotive event datasets, setting new state-of-the-art results for spiking neural networks. (see the models module)
  4. We present spiking neural networks for object detection composed of a spiking backbone and SSD bounding box regression heads that achieve qualitative results on the real-world GEN1 Automotive Detection event dataset. (see object_detection_module.py)

Our codes require SpikingJelly 0.0.0.0.4, PyTorch 1.11.0, Torchvision 0.11.1, PyTorch Lightning 1.4.4 and Torchmetrics 0.5.0.

Results

Since the publication of the paper, results have been improved by correcting errors in the dataset generation and using more epochs for classification tasks (30 epochs instead of 10).

Object Detection on Prophesee GEN1

Models#ParamsACCs/tsCOCO mAP ↑Sparsity ↓
VGG-11 + SSD12.64M11.07G0.17422.22%
MobileNet-64 + SSD24.26M4.34G0.14729.44%
DenseNet121-24 + SSD8.2M2.33G0.18937.20%

Train a VGG-11 + SSD model on Prophesee GEN1 with 5 timesteps and 2 tbins:

python object_detection.py -path path/to/GEN1_dataset -backbone vgg-11 -T 5 -tbin 2 -save_ckpt

To measure test mAP and sparsity on a pretrained model:

python object_detection.py -path path/to/GEN1_dataset -backbone vgg-11 -T 5 -tbin 2 -pretrained path/to/pretrained_model -no_train -test

Other parameters are available in object_detection.py.

Classification on Prophesee NCARS and Prophesee GEN1 Classification datasets

Models#ParamsACCs/tsNCARS acc ↑NCARS sparsity ↓GEN1 Classif acc ↑GEN1 Classif sparsity ↓
SqueezeNet 1.00.74M0.05G0.73131.26%0.6276.65%
SqueezeNet 1.10.72M0.02G0.84625.13%0.6746.79%
VGG-119.23M0.61G0.92412.04%0.96914.69%
VGG-139.41M0.92G0.91014.53%0.97019.03%
VGG-1614.72M1.26G0.90514.91%0.97718.79%
MobileNet-161.18M0.27G0.84217.57%0.94915.15%
MobileNet-327.41M1.06G0.90218.53%0.95514.37%
MobileNet-6418.81M4.20G0.91717.14%0.96630.60%
DenseNet121-161.76M1.01G0.88927.99%0.97020.31%
DenseNet169-163.16M1.19G0.89330.12%0.96923.12%
DenseNet121-243.93M2.25G0.90433.59%0.97527.26%
DenseNet169-247.05M2.66G0.87934.02%0.96228.29%
DenseNet121-326.95M3.98G0.89838.32%0.96629.46%
DenseNet169-3212.484.72G0.82537.48%0.96740.35%

Train a DenseNet121-16 on Prophesee NCARS with 5 timesteps and 2 tbins:

python classification.py -dataset ncars -path path/to/NCARS_dataset -model densenet121-16 -T 5 -tbin 2

To measure test accuracy and sparsity on a pretrained model:

python object_detection.py -dataset ncars -path path/to/NCARS_dataset -model densenet121-16 -T 5 -tbin 2 -pretrained path/to/pretrained_model -no_train -test

Other parameters are available in classification.py.

Citation

If you find this work useful feel free to cite our IJCNN paper:

L. Cordone, B. Miramond and P. Thierion, "Object Detection with Spiking Neural Networks on Automotive Event Data", International Joint Conference on Neural Networks, 2022.
<br>
@InProceedings{Cordone_2022_IJCNN,
    author    = {Cordone, Loic and Miramond, Benoît and Thierion, Phillipe},
    title     = {Object Detection with Spiking Neural Networks on Automotive Event Data},
    booktitle = {Proceedings of the IEEE International Joint Conference on Neural Networks (IJCNN)},
    month     = {July},
    year      = {2022},
    pages     = {}
}