{'fraction_non_alphanumeric': 0.030455107933452494, 'fraction_numerical': 0.01746184518080572, 'mean_word_length': 4.8966355897851646, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Classifying neuromorphic data using a deep learning framework for image classification

In the field of artificial intelligence, neuromorphic computing has been around for several decades. Deep learning has however made much recent progress such that it consistently outperforms neuromorphic learning algorithms in classification tasks in terms of accuracy. Specifically in the field of image classification, neuromorphic computing has been traditionally using either the temporal or rate code for encoding static images in datasets into spike trains. It is only till recently, that neuromorphic vision sensors are widely used by the neuromorphic research community, and provides an alternative to such encoding methods. Since then, several neuromorphic datasets as obtained by applying such sensors on image datasets (e.g. the neuromorphic CALTECH 101) have been introduced. These data are encoded in spike trains and hence seem ideal for benchmarking of neuromorphic learning algorithms. Specifically, we train a deep learning framework used for image classification on the CALTECH 101 and a collapsed version of the neuromorphic CALTECH 101 datasets. We obtained an accuracy of 91.66% and 78.01% for the CALTECH 101 and neuromorphic CALTECH 101 datasets respectively. For CALTECH 101, our accuracy is close to the best reported accuracy, while for neuromorphic CALTECH 101, it outperforms the last best reported accuracy by over 10%. This raises the question of the suitability of such datasets as benchmarks for neuromorphic learning algorithms.


I. INTRODUCTION
Neuromorphic computing has been around for three decades. In the late 1980s, Carver Mead developed the concept of neuromorphic computing. He described the use of analog circuits in very-large-scale integration (VLSI) systems to mimic the neuro-biological functionalities present in the human brain [1]. Due to the complexity in understanding the complete functionality of the human brain and sensory systems, neuromorphic computing is still an open field of exploratory research.
Meanwhile neuromorphic vision sensors [2] has emerged as an active field of research, along with neuromorphic computing. The sensory signals from neuromorphic sensors, which is very close to human sensory signals, could be directly used by neuromorphic computing algorithms, in particular those implemented on spiking neural network (SNN) [3]. Neuromorphic datasets had been created based on popular deep learning datasets, MNIST [4], CALTECH [5] and CIFAR-10 [6], so that the research on neuromorphic computing and its class of learning algorithms could be done This  Deep learning has been hugely successful in many areas of machine learning, in particular, with the advent of convolutional neural networks (CNN) [7], it has achieved humanlevel performance in many image classification tasks [8], [9]. With the exponential growth of research in deep learning, and increased applications in many fields of artificial intelligence such as autonomous vehicles [10], [11] and face recognition [9], deep learning is certain to drive the new industrial revolution 4.0 [12] in the coming years.
Part of the ongoing research in deep learning is directed towards the development of deep learning accelerators. This is mainly due to the fact that firstly, deep learning networks typically need to be trained with large amount of data, and secondly the training needs to be done iteratively, which requires much computing resources for reasonably sized networks. GPUs have shown a better performance compared to CPUs. However, deep learning accelerators like TPU [13] and other application specific integrated circuits (ASICs) are also in the competition. In comparison, neuromorphic computing chips [14] have been around for several decades but are generally not used for deep learning purposes, partly due to poor classification performance but also a lack of neuromorphic datasets. The lack of neuromorphic datasets is now however partially addressed when neuromorphic sensors such as the digital vision sensors (DVS) camera [15] are used to generate neuromorphic datasets which can be used to gauge classification performance of neuromorphic learning algorithms.
In this paper, we explored the possibility of using neuromorphic datasets in a deep learning framework. Specifically, we collapsed spike-timing data of a neuromorphic dataset into an image, which is then used to train a CNN. In doing so, we are able to obtain a classification accuracy of 78.01% for the neuromorphic CALTECH dataset. While this is still some gap from the actual best classfication accuracy obtained for the CALTECH dataset (91.66%) as shown in table I, it is already the best accuracy for neuromorphic dataset (the best reported so far being 64.2% [16]), to the best of our knowledge. The rest of the paper is organized as follows. Section II elaborates on the processing of the dataset and the deep learning model used for our experiments. Section III further describes the experiments conducted while Section IV reports on the results obtained. The paper is then concluded in Section V. arXiv:1807.00578v1 [cs.CV] 2 Jul 2018

A. Datasets
The deep learning models used in our experiments are trained on three datasets, namely, IMAGENET [17], CALTECH101 and neuromorphic CALTECH101 or N-CALTECH [18].
IMAGENET: The popular image dataset comprises of 1000 categories, with over a million training images and 50,000 validation images. We use the original images in RGB format for training a deep learning model, and also a grayscale version of the original images for training another similar deep learning model. The original dataset is in JPEG format with size of 224×224 in each of the 3 RGB channels. In the grayscale format however, each image is converted to single channel using the formula 0.21 × R + 0.72 × G + 0.07 × B. However, for training the deep learning model, each grayscale image is read as three identical images, so as to maintain the same amount of trainable weights as per the deep learning model used for RGB images.
CALTECH: The original CALTECH dataset consists of images of 101 categories. Each category contains 40 to 800 image samples. Each image is roughly 300 × 200 in size. The original images are in RGB format, with 3 color channels. We have also the grayscale version, converted from the original dataset, also in JPEG format. Similar to IMAGENET, we duplicate the grayscale images to 3 channels when fed into the deep learning models.
N-CALTECH: We explored using a time-collapsed version of the N-CALTECH dataset. The original dataset is collapsed along the time-dimension to form static images, with pixel intensity proportional to the number of spikes at each pixel. The conversion from address event representation (AER) signals to static images is done as follows. Each pattern p can be represented as a set of spike trains, one for each pixel. The spike train for pattern p, pixel x is s x,p = {t x,p 1 , t x,p 2 , ...t x,p n } whereby each element denotes the time of spike. Here, we consider two collapsed versions of the N-CALTECH dataset, one based on only 1 saccade (N-CALTECH 1 saccade), and the other based on 3 saccades (N-CALTECH 3 saccade), both with ON polarity.
So C x,p is normalized by the highest spike count per pixel in pattern p. Note that spike counts are normalized per pattern, such that the normalizing terms differ between patterns of low and high spike counts.
For training and testing purposes, samples in each category of the entire dataset is randomly divided into training and validation images with the proportion of 85:15. The collapsed images are converted to bitmap format (.bmp) for both N-CALTECH 1 saccade and N-CALTECH 3 saccade dataset. One sample image from each CALTECH dataset is shown in figure 1.

B. Deep Learning Architecture
The deep learning architecture used for the experiments is VGG-16 [19]. It has a total of 16 layers, with 13 convolutional layers and 3 fully connected layers.
The VGG-16 architecture is shown in figure 2. It contains 5 blocks of convolutional layers (each blocks are shown in different colors). First 2 blocks contains 2 convolutional layers stacked together, followed by a max-pooling layer. The next 3 block contains 3 convolutional layers stacked together, followed by a max-pooling layer. After these 5 blocks of convolutional layers, there are 3 fully connected layers followed by a softmax layer for classification. Each computational layer contains a nonlinear activation, 'RELU'. Batch normalization is used before each nonlinear activation function. A dropout of 0.5 is used in between the fully connected layers.

III. EXPERIMENTAL FRAMEWORK
Entire experiments are run on a system with 4 GPUs. The deep learning models are trained on either Tensorpack [20], or Keras [21], with Tensorflow backend [22]. There are two main class of experiments: one is to train the VGG-16 architecture from scratch using CALTECH-based datasets, and another is to do transfer learning: by retraining an IMAGENET (both RGB and grayscale) trained VGG-16 using CALTECH-based datasets. The loss function used is cross entropy and the Adam optimizer is applied. The weights are initialized as per [8].

A. Training from scratch
We trained the CALTECH-based datasets (CALTECH RGB, CALTECH grayscale, N-CALTECH 1 saccade and N-CALTECH 3 saccade) from scratch on the VGG-16 architecture, as described in subsection II-B. The inputs across all datasets are kept to 224x224x3.
Both CALTECH RGB and grayscale are trained from scratch using Tensorpack, while N-CALTECH datasets are trained from scratch using Keras. All images are resized to 224×224. Each N-CALTECH image pattern p is a 224×224 image with intensity value C x,p (eq.1) at each pixel before re-sizing.

B. Transfer learning
The re-training of top layers or fully connected layers of an IMAGENET pre-trained VGG-16 using CALTECHbased datasets is described here. This approach is taken as CALTECH datasets are small and prone to over-fitting when trained from scratch, while using the features in the convolutional layers of the pre-trained VGG-16 may help to improve classification accuracy for the CALTECH-based datasets. The convolution layers of the base model is not trainable i.e their weights are freezed; whereas the fully connected layers are re-trained. We may further fine-tune the weights in the top convolutional layers in attempt to further improve classification accuracy, but this was not done in the present study. For the CALTECH datasets, retraining of the CALTECH RGB dataset is done on the pre-trained VGG-16 using RGB IMAGENET or original IMAGENET dataset, whereas for the CALTECH grayscale dataset, retraining is done on the pre-trained VGG-16 using grayscale IMAGENET dataset.
For the case of the N-CALTECH datasets (both 1 and 3 saccades), re-training is done for each on both pre-trained VGG-16 using RGB and grayscale IMAGENET.

IV. RESULTS
The results for "training from scratch" and "retraining" experiments as mentioned in section III is shown in table I. Table I has 4 datasets in one column and two columns for training and testing accuracies for each experiment, "training from scratch" and "retraining". We have obtained the best accuracy of 78.01% for image classification on neuromorphic CALTECH dataset, N-CALTECH 3 saccade, by retraining on the VGG-16 deep learning architecture pre-trained using grayscale IMAGENET dataset. Also, we have obtained close to best accuracy, 91.66% for image classification on CALTECH dataset, CALTECH RGB, by retraining on the VGG-16 deep learning architecture pre-trained using RGB IMAGENET dataset [23].
Observations: From table I, it is clear that the validation accuracy for retraining is better than that of training from scratch for all datasets. The training and testing accuracies in the case of "training from scratch" are showing com- paratively larger differences in comparison to those of the retrained case.
Reason: These observations are mainly because of the lesser number of samples in the dataset. The training from scratch experiment suffers from the over-fitting problem, whereas in the case of re-training using IMAGENET pretrained VGG-16, training is more stable and shows consistent improvement in validation accuracies, as illustrated in Fig.   3x3  3. It is therefore not surprising that the pre-trained models give the best accuracies overall.

V. CONCLUSION
To the best of our knowledge, we have got the best accuracy of 78.01% for image classification on the neuromorphic CALTECH dataset by re-training on an IMAGENET trained VGG-16 architecture, while the best classification accuracy to date is only 64.2% [16]. This has several implications for advancing the research of learning algorithms for the neuromorphic community. Firstly, what constitutes a truly neuromorphic dataset? Our study seems to suggest that the spatial data alone in neuromorphic datasets derived from saccades across images may be sufficient for good classification results. If this is indeed the case, then using such datasets for the study of learning algorithms on SNN may not be the best way to elucidate the strengths and weaknesses of these algorithms. Another observation is that the CALTECH dataset in itself may not be sufficient for training from scratch a deep neural network for classification of its own images. This would make evaluation of learning algorithms trained on the CALTECH dataset difficult. Secondly, there is much the learning algorithms for SNN may borrow from deep learning in general. For instance, the initialization of the weights, batch normalization, are techniques that can be even more critical for SNN, given that the activations of the neurons in SNN are binary and sparse; no learning can take place if there are no activation. Thirdly, we have demonstrated how a deep learning architecture can outperform other SNN algorithms on an image classification task based on a neurmorphic dataset. This is somewhat counter-intuitive. But this also demonstrates the potential of combining neuromorphic sensors with deep learning architectures, so that we can take advantage of the event-driven nature of such sensors, and feeding the output data into a deep learning architecture for accurate classification. With the advancement of neuromorphic hardware and learning algorithms, such that reasonable classification results may be obtained using low precision weights, activation etc whilst being highly power efficient, this can be an attractive and viable proposition.