Learning to Sparsify Differences of Synaptic Signal for Efficient Event Processing(BMVC2021, Oral)
Our main contribution of the paper, mconv layer, TDSS loss, and macro-grad are implemented models/dss_layer.py and models/dss_utils.py. DSSConv2d layer is desinged to replace existing Conv2d layer with minimum modification.
Example network using the layer and the loss is implemented in models/dss_net, models/dss_mnist.py, models/dss_pilotnet.py, models/dss_VGG.py, and models/dss_object_det.py.
Dataloader and trainer are based on the code of Event-based Asynchronous Sparse Convolutional Networks, ECCV 2020 (Asyc-SSC, PDF). Refer to their original code and documentation to evaluate "Asyc-SSC" and 'Dense' model.
The following commands will run the main and ablation experiments shown in Tab.2.
The script will automatically train and evaluate for three times.
It will generate a folder depending on the settings under log/, and saves statistics and results during training.
bash run_exp.sh PI XXX // PilotNet, x=0,1,2,3,4,5,6,7
bash run_exp.sh NM XXX // N-MNIST, x=0,1,2,3,4,5,6,7
bash run_exp.sh NC XXX // N-Caltech101, x=0,1,2,3
bash run_exp.sh PS XXX // Prophesee Gen1 Automotive, x=0,1,2,3
'XXX' corresponds to the row of Tab.2 in the main paper (below the line highlighted in cyan).
Most statistics during training are saved in visualization/log.bin.
Use the following script to load the log (and plot figure like Fig.A.).
load_log.py
Use train.py with corresponding setting files as follows.
train.py --settings_file "config/settings_xxx.yaml`
XXX corresponds to a dataset name. It will output the same log file as described above.
One can adjust most of the basic training parameters/settings in the config/settings_XXX.yaml file without modifying the code.
XXX corresponds to a dataset to be evaluated.
Some of the essential parameters are described below.
-
Loss for reducing MAC is configured in
dss/MAC_losstag.1is our proposed TDSS loss of Eq.(12),0is TDAM loss of Eq.(6), and-1is also TDAM loss but it is evaluated layer-wise and the TDAM loss is not backpropagated through the network. -
Kernel type is configured in
dss/kernel_modetag.conv_nanrepresent to convolution, andconv_convrepresent masked convolution. Other kernels are not used in the main paper, but discussed in the supplement.). Available options are as follows:conv_nanconv_conv-
lrlc_lrlc(see supplement) -
lc_lc(see supplement) -
lrlc_nan(see supplement) -
lc_nan(see supplement)
-
Qunatizatation method is configured in 'dss/quantizer' tag. 'MG_xxx_yyy' represents represents proposed macro-grad and
LSQ_XXX_YYYrepresents LSQ. 'xxx' represents the order of division and multiplication of Eq.(2),divmulrepresents division followed by multiplication (same as Eq.(2)), andmuldivdoes this in reverse order. 'yyy' represents the parameterization of$s$ ,logparameterize$s$ in log-space, which is convenient to restrict the range of of$s$ in positive region. Available options are as follows:MG_divmul_linMG_muldiv_linMG_divmul_logMG_divmul_logLSQ_divmul_linLSQ_muldiv_linLSQ_divmul_logLSQ_muldiv_log
-
The quantization step size can be per channel or shared within a layer. It is configured in
dss/channel_wise_thtag. -
DSS scheduling parameters are configured in
dss/DSS_weight_step($\eta_{step}$ ) andmlc_dss/dss_criteria($\eta_{thr}$ ) tag. -
Network size is onfigured in
dss/expantion_ratiotag.1represents default size. -
The dataset could be configured in the
dataset/nameanddataset/name/dataset_pathtag.
Install the dependencies with pip as:
pip install -r requirements.txt
Install CPP Bindings for the event representation tool with pip as:
cd install event_representation_tool
pip install event_representation_tool
The following datasets are supported:
- Regression (steering angle prediction) on Nvidia Pilotnet (video)
- Classification on N-MNIST (event)
- Classification on N-Caltech101 (event)
- Object Detection on Prophesee Gen1 Automotive (event)
If you use the code in your research, please use the following BibTeX entry.
@inproceedings{sekikawa2021spr_sd,
author = {Yusuke Sekikawa and Keisuke Uto},
title = {Learning to Sparsify Differences of Synaptic Signal for Efficient Event Processing},
booktitle = {Proceedings of the British Machine Vision Conference 2021, {BMVC}
2021, Online, November 22-25, 2021},
publisher = {{BMVA} Press},
year = {2021},
url = {https://www.bmvc2021.com/},
}Yusuke Sekikawa, Denso IT Laboratory, Inc.
Copyright (C) 2020 Denso IT Laboratory, Inc. All Rights Reserved
Denso IT Laboratory, Inc. retains sole and exclusive ownership of all intellectual property rights including copyrights and patents related to this Software.
Permission is hereby granted, free of charge, to any person obtaining a copy of the Software and accompanying documentation to use, copy, modify, merge, publish, or distribute the Software or software derived from it for non-commercial purposes, such as academic study, education and personal use, subject to the following conditions:
-
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
-
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.