loiccordone / object-detection-with-spiking-neural-networks

Repository code for the IJCNN 2022 paper "Object Detection with Spiking Neural Networks on Automotive Event Data"
MIT License
57 stars 12 forks source link

Error in binning operation? #25

Open LennardBo opened 1 year ago

LennardBo commented 1 year ago

I've recently noticed that in my own dataset implementation for the gen1 dataset which is derived from this repository's implementation there was curious artifact: The third channel for the event images did not contain any events!

I've traced it back to what could be the issue and I believe I have found it here in line 125 of the gen1_od_dataset.py:

tbin_feats = ((events['p']+1) * (tbin_coords+1)) - 1

The goal is to sort the events (under the default settings) into 2 time bins of each 2 polarities. However, with this line the result can never be "2" (as in, the third channel), assuming values of 0 or 1 for both the polarities and the tbin_coords. Positive changes of the first time bin are mixed together with negative changes of the second time bin, both resulting in 1 of this equation.

I believe the following line will do the intended:

tbin_feats = (2 * tbin_coords) + events["p"]

This does seem to solve the issue in my adapted copy. However, I first wanted to make sure that I didn't overlook anything before suggesting a pull request.

loiccordone commented 1 year ago

Hello, It seems that you are right. It would be interesting to see how this changes the results obtained in classification and in object detection.

Thank you for noticing that

LennardBo commented 1 year ago

My pleasure. Seeing as the data was still present in the 2nd channel, I guess the difference shouldn't be too great and for my model the performance didn't change much. Generally, I guess the only way is up.