Lossless Compression of Data From Static and Mobile Dynamic Vision Sensors-Performance and Trade-Offs

Dynamic Vision Sensors (DVS) are emerging retinomorphic visual capturing devices, with great advantages over conventional vision sensors in terms of wide dynamic range, low power consumption, and high temporal resolution. The bio-inspired approach of the DVS results in lower data rates than conventional vision sensors. Still, such data can be further compressed. Compression of DVS data is an emerging research area and a detailed performance comparison of different compression strategies for these data is still missing. This paper addresses lossless compression strategies for data output by neuromorphic visual sensors. We compare the performance of a number of strategies, including the only strategy developed specifically for such data and other more generic data compression strategies, tailored here to the case of neuromorphic data. We perform the comparison in terms of compression ratio, as well as compression and decompression speed and latency. Moreover, the compression performance analysis is performed under diverse scenarios including stationary and mobile DVS. According to the detailed experimental analysis, Lempel-Ziv-Markov chain algorithm (LZMA) achieves the best compression ratios among all the considered strategies for the case when the DVS is static. On the other hand, Spike coding achieves the best compression ratios under the scenario when spike events are produced by a sensor in motion. However, both strategies result in low compression speed and high latency which restrict the applications of these strategies in real-time scenarios. The Brotli strategy achieves the best trade-off between compression ratio, speed and latency under static as well as mobile scenarios. We also observe a significant decrease in compression and decompression performance (in terms of ratio, speed and latency) of all the strategies under mobile DVS scenarios.


I. INTRODUCTION
Dynamic Vision Sensors (DVS) [1], [2] mimic the visual processing characteristics of living organisms, i.e., they capture only changes in scene reflectance. Conventional videos are captured and stored in the form of synchronous frames, whereas DVS respond to the temporal luminance changes with an asynchronous stream of spike events, fired independently. The Address Event Representation (AER) protocol is utilized to output the spike event stream. A spike event The associate editor coordinating the review of this manuscript and approving it for publication was Paolo Napoletano .
consists of four essential elements, which are represented by a tuple < X , Y , t, p >: the spatial addresses X and Y , the timestamp t and the polarity flag p. Spike events occur whenever there is either movement/change of lights conditions in the scene or motion of the sensor or both. In other words, there is no spike event output for static scenes and motionless sensors. The unique spike firing mechanism enables DVS to satisfy low-bandwidth, low-power and low-latency requirements. Figure 1 shows an example of the conventional camera and DVS output. The first row shows the DVS output, where spatio-temporal coordinates {X , Y , t} and polarity p of the neuromorphic sequence are rendered as frames. In each of the VOLUME 8, 2020 This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ rendered DVS frames in the figure, spike events fired owing to the increase in luminance intensity (polarity p = 1) are represented by the ''green'' color. On the other hand, spike events associated to decrease in brightness (polarity p = 0) are represented by the ''red'' color.
The spike event rate of the DVS is dependent on scene complexity [3] and relative motion of the camera w.r.t scene objects [4]. Because the output of the DVS is quite different from conventional frame-based image sequences, existing computer vision techniques cannot be directly applied to the series of neuromorphic spike events. To address this issue, many algorithms have been specifically tailored to leverage spike events data for a diverse range of applications (object detection, classifications, optical flow estimation, etc.). A good survey of these algorithms in a wide range of applications is provided in [5].

A. MOTIVATION
The unique characteristics of the DVS offer advantages over conventional vision sensors in real-time interaction systems such as robotics [6], [7], drones [8] and autonomous driving [9], [10]. In the near future, most of the envisaged services performing object/gesture recognition or classification will be performed via cloud / edge computing. Therefore, these services would require the transmission of the spike events to cloud / edge servers for the processing of visual data [11]. Furthermore many scenarios, such as the collaboration of multiple intelligent cars or drones forming an Internet of Intelligent Vehicles (IoV) also require real-time transmission. Even if the data acquisition of DVS yields an inherent compression, further compression of the spike data would be highly desirable in the aforementioned scenarios.
A preliminary version of this paper has been presented at IEEE ICASSP 2020 [12]. The main extensions of this work are summarized in the subsequent sections.

B. CONTRIBUTIONS 1) COMPRESSION PERFORMANCE ANALYSIS OF DIVERSE STRATEGIES
This paper addresses lossless compression strategies, i.e., strategies where compression does not involve loss of information. The output of the DVS is a multivariate stream of integers (X and Y spatial addresses, time-stamp field, and the polarity flag). Hence, it is worth investigating the performance on DVS data of general purpose lossless compression strategies, IoT specific compression algorithms, integer based compression approaches, that we tailored for DVS data. We also investigate the performance of DVS data specific compression approach.

2) PERFORMANCE ANALYSIS UNDER DIVERSE SCENARIOS
We analyse existing lossless data compression strategies and their suitability for the compression of neuromorphic data under diverse scenarios. These scenarios include stationary and mobile sensor for indoor and outdoor conditions. Compression performance evaluation under these diverse scenarios is very important since these represent many emerging applications; for instance drones [8], self-driving cars [9], [10], and stereo vision [13]- [15] demonstrate the case of mobile DVS sensor in outdoor conditions, whereas surveillance and monitoring [16], [17] highlight the application of stationary DVS sensors, also in outdoor conditions. The work in [18], [19] explores the application of DVS in a mobile robot for the indoor environments. Furthermore, tactile sensing [7], [20] and automated fall detection monitoring [21] highlight the potential of DVS under static indoor environments.

3) PERFORMANCE ANALYSIS IN TERMS OF COMPRESSION RATIO, COMPRESSION AND DECOMPRESSION SPEED, AND LATENCY
We perform comparisons in terms of compression ratio, as well as compression and decompression speed and latency. Compression speed is an important performance indicator as compression needs to be fast enough to keep up with the rate of data ingestion, in particular if compression is performed onboard, at the sensor location. The majority of the potential applications of DVS involve complex visual processing, such as diverse types of machine and deep learning strategies [7], [9], [13], [14], [20], [21]. Therefore, the majority of DVS applications would require computation offloading, i.e., transfer of resource intensive computation tasks to a cluster, grid or a cloud. Computation offloading of the compressed data over a network can overcome resource limitations of a device. In computation offloading, the decompression speed of an encoding strategy is of paramount importance since high decompression speed would reduce cloud service latency. Therefore, it is important to have an algorithm that could function efficiently in a central database or cloud storage.
Existing data compression strategies that can be used for neuromorphic visual sensor data are reviewed in Section II. We introduce the datasets considered for the tests and the simulation set-up in Section III, while comparative simulation results are reported in Sections IV and V, where the trade-offs to be addressed are also discussed. In particular, we analyse the compression performance for spike events emitted from static DVS in Section IV, whereas the compression performance of mobile DVS data is analysed in Section V. Finally, the concluding remarks appear in Section VI.

II. RELEVANT DATA COMPRESSION STRATEGIES
The potential strategies to compress DVS data are reported in Figure 2, clustered in five classes, and described in detail below. Section II-A discusses the spike coding strategy specifically designed for DVS data, whereas general purpose, IoT specific, and integer based compression approaches are discussed in Section II-B.

A. DVS SPECIFIC COMPRESSION APPROACH
The authors in [22] proposed the first lossless coding strategy for DVS data. According to the proposed strategy, the event sequence is partitioned into multiple three dimensional macrocubes, as shown in Figure 3, where the X and Y dimensions of the macrocube span the full spatial resolution of the pixel array (for instance, X max = 240 and Y max = 180 for DVS240B). The third dimension of the macrocube is the time dimension (in terms of number of spike events). Each macrocube coding has two modes which are Address-Prior (AP) and Time-Prior (TP) modes, as shown in Figure 3. The AP mode is designed for spatially decentralized macrocubes, i.e., for the case where events are distributed over the entire spatial resolution. On the other hand, the TP mode is designed for spatially centralized macrocubes, i.e., for the case where events occur among neighboring pixels. For each macrocube, both the modes are tried and the one achieving the best compression is chosen. The prediction residuals of the chosen mode are fed into a CABAC (Context-adaptive binary arithmetic coding) entropy coder.
The coding strategy is based on the spike firing mechanism of the DVS, which indicates the presence of temporal and spatial redundancy.
• Temporal redundancy: According to the spike firing model [22], when the luminance intensity is stably changing, linearly increasing or decreasing, the time intervals between consecutive spikes at the same pixel appear to be nearly equal, which may induce temporal correlations.
• Spatial redundancy: The adjacent pixels receive almost the same luminance concurrently, indicating the presence of spatial correlation.

1) TIME-PRIOR MODE
The TP mode of the strategy, exemplified in the right part of Figure 3, exploits spatial redundancy when the majority of the neighboring pixels elicit spike events. This mode finds a centre point (x 3 , y 3 in Figure 3) and projects all other spike events w.r.t the centre point. In this mode, the events are projected in an increasing order of their time-stamps and delta coding is applied to the time-stamp field as shown in Figure 3. Since the time-stamp field comprises a stream of incremental integers, delta coding results in an efficient compression of this field. Spike events are centralized in the spatial field, therefore, the offsets of the spike events to the centre point result in compression of the spatial address field. The residuals of both the fields (spatial address and timestamp) are fed to the CABAC for further compression.

2) ADDRESS-PRIOR MODE
The AP mode exploits temporal redundancy of the spike firing mechanism. Since events are spread over the entire spatial resolution, the TP mode cannot achieve high compression gains for the spatial address field, i.e., the offsets of the events to the centre point cannot efficiently reduce the size of the spatial addresses. In AP mode, the number of spikes at each pixel is recorded, as shown in the left part of Figure 3. Since the time intervals between consecutive events at a pixel are approximately equal (as shown below in the left part of Figure 3), differencing (delta coding) between successive events time-stamps results in a series of approximately similar integers which is exploited by the entropy coder (CABAC). Therefore, efficient compression gains can be achieved for the spatially decentralized macrocubes by projecting the spike event count in a macrocube to the XY plane, and delta coding the time-stamps of the successive events on each pixel.

3) SPIKE EVENT POLARITY
The spike polarity field is separately fed to the entropy coder. Luminance increases (or decreases) in a steady state [22], therefore, the temporal correlation of the polarity on a pixel VOLUME 8, 2020 is high. In other words, if the polarity of the previous spike event is one (or zero) on a pixel, there is a high probability that the next event polarity will be one (or zero) on the same pixel. Hence, the encoding of the current spike event polarity exploits the polarity of the previous spike event, i.e., previous spike polarity becomes the context of the current spike event and fed to the context adaptive binary coder (CABAC).

B. GENERAL PURPOSE, IoT AND INTEGER BASED COMPRESSION APPROACHES 1) ENTROPY CODING
Entropy coding is a lossless compression technique applicable to all types of data, hence the most fundamental building block of many compression strategies. Entropy coders are quite versatile, i.e., they can compress any type of data. Therefore, most of the complex compression strategies have an entropy coder as their final compression step. In entropy coding, the length of the codeword that the encoder associates to each input symbol is directly proportional to the negative logarithm of the probability of each symbol. The most common entropy coding strategies are Huffman [23] and Arithmetic [24]. Huffman is a prefix encoder that uses variable length codewords for encoding the input data symbols. On the other hand, Arithmetic coding encodes a group of symbols into a single number.

2) DICTIONARY BASED COMPRESSION
Dictionary coding strategies operate by searching for matches between the data to be compressed and a set of strings contained in a dictionary. The dictionary is a data structure (maintained by the encoder), which is either static or dynamic, containing the set of strings. The main goal of a dictionary encoder is to find a match between the content of the dictionary and the data to be compressed. When an exact match is found, the encoder substitutes a short reference to the position of the string in the dictionary. The majority of advanced encoders use a dynamic dictionary whose content changes according to the content of the data to be compressed. For instance, LZ77 [25] holds the last N bytes of the processed data in a sliding window buffer. This sliding buffer serves as the dictionary storing every substring of N bytes of data as dictionary entries. There are many advanced level dictionary-based compression strategies, such as LZMA [26], Zstandard (Zstd) [27], Zlib [28] and Brotli [29], having sophisticated data structures. These strategies have huge dictionary sizes and use multi-level encoding to achieve high compression ratios. For instance, LZMA uses a multi-level compression where the dictionary based output is further compressed by an adaptive binary range coder. On the other hand, Zstd combines a dictionary based coding strategy with a hybrid entropy coder. The hybrid encoder achieves fast compression and comprises a combination of Finite State Entropy (FSE) [30] and Huffman encoding. Similarly Brotli combines dictionary based encoding with Huffman and second order context modelling. Another well known dictionary based encoder is Zlib which utilises the combination of LZ77 and Huffman encoding where a sliding window buffer can be adjusted to achieve a trade-off between compression ratio and speed.

3) IoT SPECIFIC COMPRESSION
The authors in [31] proposed a time-series compression algorithm, called Sprintz, for resource constrained devices. The strategy achieves state-of-the-art compression ratios with very low memory requirements (less than 1 KB memory) and virtually adds no latency. The main goal of the strategy is to exploit correlation among successive samples in multivariate time series data. The first step of the strategy is based on a forecaster, also known as Fast Integer Regression (FIRE), which encodes the difference between the actual and the predicted sample. The next step is to apply a bit packing algorithm to the prediction residuals. In the final step, Huffman coding is applied to the residuals. The strategy combining the predictive coder (FIRE) and Huffman coding is called Sprintz-FIRE. In order to achieve a trade-off between speed and compression, Sprintz has several variants. For instance, Sprintz-Delta skips the Huffman coding step and utilizes delta coding, instead of forecasting (FIRE), for a better compression speed. On the other hand, Sprintz-Delta-Huf combines delta coding and Huffman encoding to achieve better compression at the expense of lower compression speed. Encoding steps of Sprintz-Delta-Huf on time-stamp and spatial address fields are shown in Figure 4, where delta coding and bit packing greatly reduce the size of the timestamp field (32 bits to only 3 bits). Since spatial address differencing results in negative integers, an additional zigzag encoding step is applied to the signed residuals as shown in Figure 4.

4) FAST INTEGER COMPRESSION
Another class of potential candidates for compressing neuromorphic data are the Fast Integer compressors like SIMDBP128 [32], Simple8B [33], Memcpy, FastPFOR [32] and SNAPPY [34]. These algorithms are known for their superlative compression speed as they are specifically designed for encoding and decoding billions of arrays of integers for search engines and relational database applications. The fastest known method of compressing integers is SIMDBP128 [32] and Memcpy, whereas FastPFOR [32] achieves better compression ratios with a little compromise on compression speed. Another well known fast integer compression algorithm is SNAPPY [34], developed by Google and used by various distributed file systems such as Hadoop, InfluxDB, KairosDB, etc.

III. EXPERIMENT SETUP A. DATASETS
In order to compare the different compression strategies over a variety of scenes and sensor speeds, we consider two datasets, for fixed and moving visual sensor. The datasets are described below.

1) DATASET FOR STATIONARY DVS
To evaluate the performance of the considered strategies for static DVS, we utilized the PKU-DVS dataset for spike coding [35]. For static DVS scenarios, spike events are produced due to object movements (change of light conditions) in the scene, whereas the sensor remains stationary. The considered dataset is divided into indoor and outdoor scenarios. These scenarios are captured under diverse circumstances; for instance the outdoor sequences include daytime, night, slow speed movement (pedestrian scenarios) and high speed movement (vehicular speed movements). Similarly the indoor scenarios include diverse types of object movements ranging from pendulum motion to a jumping movement of a person. The spike event rate, in Kilo-event per second (Kev/s), along with the sequence duration of all the indoor and outdoor scenarios is reported in Table 1.

2) DATASET FOR MOBILE DVS
In order to assess the compression performance on mobile DVS data, we consider the Dynamic and Active-pixel Vision Sensor (DAVIS) dataset [36]. DAVIS incorporates a conventional global-shutter camera and an event-based sensor in the same pixel array. The compression performance of the considered strategies is evaluated on the asynchronous spike event stream. The DAVIS dataset is specifically designed for high-speed and high-dynamic-range robotics and computervision applications for indoor and outdoor scenarios. In addition to the visual output (spike event stream and intensity images), the dataset also includes the speed of the sensor. The indoor and outdoor scenarios are captured under widely varied motion (angular and linear motion of the sensor) and dynamic range. The inclusion of intensity images also makes it possible to compute scene complexity [4] of different outdoor and indoor scenes. Figure 5 shows some of the considered indoor and outdoor scenes [36]. The extracted sequences considered for compression performance evaluation, with different content complexity and sensor speed, are shown in Table2. The higher the scene complexity and sensor speed, the higher the event rate [4]. For instance, the Boxes sequence exhibits an event rate of 4288.65 Kev/s, whereas the bandwidth of the Shapes sequence is only 245.61 Kev/s owing to the low content complexity and slow speed of the sensor. The scene complexity and motion speed information of the dataset is reported in [4].   Figure 6 shows the recorded data format of spike events in terms of AER: a series of 8-byte words, where time-stamp VOLUME 8, 2020 information is represented by the first 32 bits. One bit is reserved for the neuromorphic vision sensor type (DVS or Asynchronous Time-based Image Sensor (ATIS)). The spatial address information in terms of X and Y is represented by 10 and 9 bits respectively.
The ATIS has built in acceleration, temperature and gyroscope sensors, therefore 10 bits are reserved for Analog to Digital Converter (ADC) samples of these sensors, as shown in Figure 6. One bit (44 th bit) represents the DVS polarity field, whereas DVS trigger information is also represented by one bit (43 rd bit). There are several ways to compress the AER data, the most common approach consisting of compressing the data as a single variable vector, i.e., as a single stream of 8 byte integers. According to our study [12], the most effective approach is to convert the data into a multivariate stream by extracting the relevant information (time-stamps, spatial addresses and the polarity bit) from the 64-bit AER data. This approach is shown in Figure 6, where all the four relevant fields are extracted from the AER data format. It is important to note that we divide the 32-bit timestamp field into four 8-bit integers. The multivariate stream now consists of seven columns (each 1 byte long) where time-stamp information consists of four columns, whereas the spatial addresses and the polarity flag fields comprise three columns. The multivariate data stream is then converted into row-major and column-major formats. In row-major order, consecutive elements of the rows of the array are contiguous in memory, whereas in column-major order the consecutive elements of the columns are contiguous, as shown in Figure 6. The row major format is primarily used for the IoT specific compression strategies, whereas Entropy, Dictionary and Fast integer compression strategies utilize the column major format.
In order to compress the DVS data by utilizing the spike coding strategy, the spatial resolution of the macrocube is the same as that of the DAVIS, i.e., X max = 240, and Y max = 180. Furthermore, the third dimension (number of spikes) of the macrocube is set to 32768, for optimum compression performance recommended by [37].

C. KEY PERFORMANCE INDICATORS 1) COMPRESSION RATIO
The performance of the considered and benchmark strategies is evaluated by computing the compression ratio (CR): where γ is the size (in bytes) of the compressed output stream and N events is the total number of spike events, with each event equal to 8 bytes.

2) COMPRESSION AND DECOMPRESSION SPEED
In order to evaluate data compression algorithms, speed (compression and decompression) is measured in terms of uncompressed data handled per second. The compression speed (CS) and decompression speed (DS) is evaluated as: and where T c and T d are the time (seconds) required to compress and decompress the spike events data respectively. All experiments use a single thread on a 2015 Macbook Pro with a 2.2GHz Quad-Core Intel Core i7 processor and 16 GB, 1600 MHz DDR3 RAM.

3) COMPRESSION AND DECOMPRESSION DELAY FACTOR
We define the compression (and decompression) delay factor as the ratio between the bit rate of the source and the compression (and decompression) speed. This is evaluated as reported below: and where T s is the time duration (in seconds) of the DVS sequence.
In order to analyse the latency performance of each of the considered algorithms, first we compute the bitrate of a single DVS sequence followed by the computation of the average bitrate of all the video sequences. The compression delay factor, for instance, of an algorithm is computed as the ratio between the average bit rate of all the sequences and the average compression speed. This is equivalent to the ratio between the time required to compress the DVS data sequence and the time duration of the DVS sequence.
In the following, the compression performance analysis of the static and mobile DVS data is discussed in Section IV and V respectively.

IV. COMPRESSION PERFORMANCE ON DVS DATA GENERATED BY STATIC SENSOR FOR OUTDOOR AND INDOOR SCENARIOS
In this section we first analyse the different spike event fields of the DVS data for static scenarios, followed by a detailed analysis of the compression performance of all the considered strategies.

A. HISTOGRAM ANALYSIS OF DIFFERENT FIELDS OF THE DVS DATA UNDER STATIC SCENARIOS
In order to analyse the compression performance of all the considered strategies on the DVS data for the static scenario, we computed the histogram of different sequences (Nighttraffic, Pendulum and Daytime-traffic2), as shown in Figure 7. The figure shows the histogram of the spatial address fields (X and Y) in the first two columns and of the the deltacoded time-stamp field in the third column. The histogram of the spatial address highlights the locations receiving spike events (change of luminance intensity). For static sensor scenarios, objects' movements usually lead to spike events firing over adjacent pixels (neighbouring spatial address).
In other words, the spatial address integer field in the spike event stream (due to objects movements) is highly correlated. For instance if we analyse the histogram of the Night-traffic sequence (first row of Figure 7), the majority of the the spike events are elicited over a specific range of spatial addresses (X = 180 to 220 and Y = 130 to 170). Similarly, for the other two sequences spike events are fired at a specific range of pixels. For instance, the motion of pendulum elicits luminance variations at a handful of pixels location, as shown by the histogram bins of the Pendulum sequence (second row of Figure 7). On the other hand, the delta coding of the time-stamp field reduces the range of the 32 bit integer down to fewer bits. For instance, in the time-stamp histogram of the Night-traffic sequence (top right in Figure 7) there are only two bins. Therefore, only one bit (0 or 1) is required to represent the delta coded time-stamp field of the Night-traffic sequence. Similarly the number of bins for the Pendulum and Daytime-traffic2 sequences is less than 200. These sequences require only 8 bits to represent the delta coded time-stamp field (2 8 = 256 > 200). The histogram analysis of the static DVS data reveals a highly correlated spike event sequence, i.e., the stream of multivariate integers exhibits a high degree of correlation.

B. COMPRESSION PERFORMANCE ANALYSIS
In the following, we analyse the compression performance of the considered strategies. As a summary, Table 3 reports the compression ratios of all the considered strategies, whereas the compression and decompression speed, in Mega-byte per second (MB/s), is reported in Table 4. The best strategy for each scene is highlighted in bold. According to Table 3, spike coding and dictionary based strategies show impressive lossless compression ratios.
Details on the compression performance of each strategy are reported below:

1) COMPRESSION PERFORMANCE OF DICTIONARY BASED STRATEGIES
Dictionary based compression strategies yield excellent compression performance, as reported in Table 3. The histogram analysis of the static DVS data shows a highly correlated multivariate stream of integers. The main design goal of dictionary based strategies is to exploit redundancy in the data. The higher the correlation in the data, the higher the compression performance of these strategies.
LZMA shows the best performance in term of compression ratio among the considered strategies. LZMA utilizes a huge dictionary size as compared to LZ4 and has a range encoder as the final compression step. The range encoder utilizes a complex mathematical model to make probability predictions on a bit basis (as compared to byte predictions models in other dictionary based strategies). Therefore, encoding data on a bit by bit bases allows LZMA to efficiently exploit correlation between consecutive spike events. The encoding of single bit by the range encoder allows many encoding possibilities, therefore, LZMA uses Dynamic Programming VOLUME 8, 2020  algorithm to select an optimal encoding mode. The utilization of range encoder and dynamic programming for encoding mode selection is computationally expensive, therefore the compression and decompression speed for LZMA is the slowest among all the considered dictionary based strategies. Zstd also performs well in terms of compression ratios as it also uses an entropy coder as the final compression step. However, instead of using the computationally expensive binary range encoder, it utilizes a combination of the finite state entropy and Huffman encoding strategy. This results in fast compression and decompression speed with a slight reduction in compression ratio. The use of Finite State Entropy as the final encoding step achieves very high decompression speed for Zstd as shown in Figure 4. Brotli achieves the best trade-off between compression ratio and speed (compression and decompression) as shown in Table 3 and Table 4. The better compression and decompression speed for Brotli is mainly due to the utilization of Huffman encoding as the final compression step. Furthermore, second order context modelling achieves superior compression ratios for Brotli as compared to Zstd and Zlib.

2) SPIKE CODING COMPRESSION PERFORMANCE
The spike coding strategy encodes spike events by projecting them over a series of macrocubes. A limited number of spikes are projected within each macrocube. In this study, we consider 32678 number of spike events per macrocube as recommended by [37]. In order to fix the size of the entropy coder, the spike coding strategy limits the number of spike events per macrocube. The histogram analysis of static DVS data shows the firing of spike events among a group of adjacent pixels. For such scenarios, spike coding utilizes the TP mode, where spike events are projected based on their firing time as shown in Figure 3. The TP mode exploits spatial redundancy with in each macrocube. In dictionary based strategies, correlation among millions of consecutive spike events (multivariate stream of integers) is exploited because of the huge dictionary size. On the other hand, the spike coding exploits spatial redundancy among 32678 spike events, i.e., with in each macrocube. Therefore, dictionary based compression strategies such as Brotli and LZMA outperform the spike coding strategy. The cube-based spike coding mechanism achieves good compression ratios by exploiting the spatial redundancies in the DVS data. The compression ratios achieved for the datasets Jump, Game, Pendulum and Daytime-traffic2 are the best among all the considered strategies. It is important to note that the spatial and temporal prediction residuals are further compressed by CABAC. However, CABAC is computationally expensive, therefore the compression and decompression speed achieved by spike coding is the lowest among all the considered strategies, as reported in Table 4. Moreover, the process of trying both the modes, AP and TP, and the selection of the best mode (yielding maximum compression) further reduces the compression speed. Table 3 shows that IoT specific compression strategies yield low compression ratios. These strategies consider only 8 samples per block, i.e., 8 consecutive samples for each spike's field. These strategies are mostly designed for sensor generated time-series data exhibiting slow time-varying characteristics, i.e. when consecutive samples in sensor generated data have high correlation. However, the correlation among the 8 spatial address integers can be low when the spike events are fired at 8 different spatial locations. Sprintz-Delta-Huff shows the best compression ratio among the IoT specific compression strategies, which shows that delta coding yields better compression than Sprintz forecasting algorithm FIRE. This is mainly because it is difficult to forecast the firing location of the spike events.

3) IoT SPECIFIC COMPRESSION PERFORMANCE
The time-stamp field of the spike events is the most compressible field since it is an incremental integer. Delta coding followed by bitpacking greatly reduces redundancy, as shown in Figure 4, where the 32 bits time-stamp field is reduced to 3 bits. It is important to note that Huffman coding as the final compression step improves the compression ratio of the Sprintz strategy as shown in Table 3, where Sprintz-Delta-Huf outperforms Sprintz-Delta at the expense of a higher compression speed. The main advantage of the Sprintz strategy is its low memory consumption (less than 1 kB), which makes it suitable for resource constrained devices.

4) HUFFMAN CODING COMPRESSION PERFORMANCE
Huffman encoding as the only compression strategy achieves low compression ratio. However, the combination of Huffman coding with the Sprintz and Dictionary based strategies yields promising results. For instance, the compression ratio is more than doubled (from 2.67 to 5.72) by employing Huffman encoding to further compress the residuals of Sprintz-Delta encoding. Similarly the performance of the classic dictionary based strategy (LZ4, yielding compression ratio of 7.63) is enhanced by using Huffman encoding as the final compression step in the Zlib strategy, which increases the compression ratio to 13.53 as shown in Table 3. However, the improved compression ratio comes at the cost of decrease in the compression and decompression speed, as shown in Table 4.

5) FAST INTEGER COMPRESSION PERFORMANCE
Fast compression strategies such as Memcpy, Simple8B, FastPFOR and SIMDBP128 hardly compress the DVS data. These strategies do not aim at maximum compression, but rather at high compression and decompression speed. For instance, Memcpy and SIMDBP128 achieve compression speed of 12745.76 and 9967.79 MB/s respectively, as reported in Table 4. Snappy achieves the best compression ratio among the fast integer based compression approaches. VOLUME 8, 2020  Figure 8 reports the average compression and decompression delay factor w.r.t compression and decompression ratios respectively. The average compression delay factor is a function of input data rate and compression speed. The higher the compression speed and lower the data rate, the lower the delay factor. Spike coding and LZMA exhibit a higher compression delay factor of approximately 0.45 and 0.25 respectively. This implies that spike coding and LZMA need 0.45 and 0.25 seconds respectively to compress one second of data on average. The higher latency performance of both the strategies is mainly because of the utilization of computationally expensive binary arithmetic encoding. Furthermore, the process of finding the best compression mode (TP or AP) for each macrocube increases the average compression delay factor (to approximately 0.45) for the spike coding strategy. On the other hand, LZ4 achieves the lowest compression delay factor of less than 0.005 (less than 5 ms of latency in compressing one second of data) because this strategy skips the entropy coding step, unlike other dictionary based strategies. Snappy also shows impressive compression delay factor performance because the main design goal of the strategy is the high compression speed with a reasonable compression ratio. IoT specific Sprintz strategies also incur low compression latency (less than 20 ms) owing to the encoding of only 8 spike events per block. Dictionary based strategies such as Brotli, Zstd and Zlib are also suitable for real-time compression mainly because of the delay factor of less than 0.06, i.e, less than than 60 ms of compression latency is required by these strategies.

C. AVERAGE COMPRESSION AND DECOMPRESSION DELAY FACTOR ANALYSIS FOR STATIC DVS
All the considered strategies show impressive decompression delay factor (less than 60 ms needed to decompress one second of data on average) performance as shown in Figure 8. This is mainly because of the higher decompression speed of all the considered strategies.
In the following, we analyse the compression and decompression performance of the different strategies on data acquired by a DVS sensor in motion.

V. COMPRESSION PERFORMANCE ON DVS DATA GENERATED BY MOBILE SENSOR FOR OUTDOOR AND INDOOR SCENARIOS
The compression ratios of mobile DVS sensor data for the outdoor and indoor scenarios are shown in Table 5, whereas the compression and decompression speed performance is shown in Table 6. For mobile sensor scenarios, spike coding achieves the best compression performance followed by the dictionary based compression strategies.
A summary of the key observations from the results is reported subsequently.

A. LOW COMPRESSION RATIO PERFORMANCE FOR MOBILE DVS DATA
The compression gains achieved by different strategies are lower compared to the scenarios of the static sensor. Table 5 also reports the percentage decrease in compression gains w.r.t static sensor. For instance, the gains achieved by the spike coding strategy decrease by 72.2 % (14.35 to 3.99), whereas the compression performance of LZMA decreases to 3.57 (79.14 % decrease). There is also a sharp decline in compression performance of other dictionary based strategies, for instance the performance of Zstd, Zlib, Brotli and LZ4 decreases by 76.66 %, 76.63 %, 77.18 % and 67.40 % respectively. The decrease in the compression performance of different Sprintz strategies is lower as compared to the dictionary based strategies. For instance Sprintz-Delta-Huff, Sprintz-Fire and Sprintz-Delta show a decline of 50.21 %, 44.38 % and 9.40 % respectively. The compression performance of the fast integer compression strategies remains approximately the same.

B. THE COMPRESSION RATIO INCREASES WITH THE EVENT RATE
Another important observation is that higher event rate sequences result in better compression performance, i.e., all the considered strategies compress higher event rate sequences more than low event rate sequences. For instance, among the considered sequences, Poster and Boxes yield the highest compression gains. On the other hand, the compression performance of the Shapes sequence is the lowest.
In the following, we find the reasoning behind the aforementioned observations of higher event rate sequences yielding better compression, and the low compression ratios for the mobile DVS data. Figure 9 shows the frequency distribution (histogram) of the X, Y, and delta coded time-stamp fields of the Poster, high rate sequence, and Shapes, low rate sequence. Furthermore, the figure also reports the entropy of these fields.

1) HISTOGRAM AND ENTROPY COMPUTATION
The entropy is evaluated as: The corresponding source with the same alphabet and uniform probability distribution, i.e., with equiprobable symbols (incompressible source in the memoryless case if we do not accept losses) would result in the maximum entropy: The maximum entropy of spatial address X is hence log 2 240 = 7.9069, and for Y it is log 2 180 = 7.4919.
The entropy of both the spatial address fields is close to that of the uncompressible source for both the sequences, as shown in Figure 9, where the entropy of the spatial addresses of both the sequences is reported. In other words, the spatial address fields exhibit a stream of nearly equally distributed random integers for mobile DVS scenarios. It is important to note that both, high and low complexity sequences, show similar entropy for the spatial address field. The other considered outdoor and indoor scenes also exhibit approximately the same level of entropy for the spatial address fields (not shown here for brevity). The proximity to an equiprobable distribution in the spatial address fields of the spike events (produced by the moving DVS) is the main reason for the low lossless compression performance as analysed in Section V-A.  Figure 9 also shows the histogram and entropy of the delta coded time-stamp field. The entropy of the delta coded (differences between the consecutive integers) time-stamps is very low. Furthermore, the frequency distribution of the delta coded time-stamp field ranges from 0 to 1, and 0 to 20 for the Poster and Shapes sequences respectively. In other words, delta coding of time-stamp integers produces a series of zeros and ones for the high rate Poster sequence and a stream of integers with the range 0 to 20 for the low rate Shapes sequence. This implies that the time-stamp information for the Poster and Shapes sequences require only one and five bits respectively. Contrary to the spatial address field, the time-stamp field is highly compressible as shown (Figure 9) by the lower entropy computation of this field. Furthermore, the higher the event rate of the mobile DVS, the lower the number of bins of the delta coded time-stamp. Since the spatial address field is nearly incompressible, the delta coded time-stamp field determines the compression performance of a sequence. Therefore, the higher the event rate, the higher the compression ratio as analysed in Section V-B.
Another key observation is the decrease in compression and decompression speed of the mobile DVS scenarios as compared to the scenarios of the static DVS.

C. DECREASE IN COMPRESSION AND DECOMPRESSION SPEED FOR MOBILE DVS SCENARIOS
The majority of the considered strategies (especially dictionary based strategies) shows a considerable decrease in compression and decompression speed for mobile sensor data vs. fixed sensor data. For instance the compression speed of LZMA shows a decline of 65.67 % (25.63 to 8.84). Similarly Zlib, Zstd, Brotli and LZ4 exhibit a decrease of 60.97 %, 30.77 %, 37.54 % and 20.71 % respectively. This is mainly because of the lack of patterns (randomness) in the stream of consecutive spike events. DVS motion fires spike events across the entire pixel array and the spatial address fields (X and Y) in the spike events represent a random stream of integers as depicted by the histogram in Figure 9. The compression and decompression speed depend upon the compressibility of the data. For instance, in dictionary based strategies, repeatable items are stored in a dictionary and a code is assigned as a substitute. The higher the repeatable items in the data to be compressed, the smaller the size of the dictionary and vice versa. Randomness in the data causes the dictionary to fill more quickly. When the dictionary becomes full, a new one is created on the fly and new codes are assigned to the repeatable items in the data. This process requires a lot of computation which results in a decrease of compression and decompression speed.
For mobile sensor data, the decrease in the compression and decompression speed of the Sprintz strategy is negligible (comparing Table 4 and Table 6). This is mainly because the Sprintz strategy encodes only a block of eight consecutive spike events. Therefore, the randomness in the data only affects the compression ratio but does not impact the compression and decompression speed. Furthermore, the Sprintz strategy virtually adds no latency and requires less than 1 KB of memory. The performance difference in the compression ratio between the Sprintz and the best performing strategies is between 10 % to 40 %. Hence, the Sprintz strategy becomes a good candidate to compress mobile DVS data for IoT scenarios where computation resources are limited.
In the subsequent section, we analyse how the spike coding strategy achieves the best compression gains for the mobile DVS data.

D. SPIKE CODING ACHIEVES THE BEST COMPRESSION RATIOS FOR MOBILE DVS SCENARIOS
The spike event distribution in space is either centralized or decentralized. In static sensor scenarios, the motion of objects leads to a number of neighbouring pixels to elicit spikes (spatial-centralized). On other hand, the motion of the DVS sensor causes spike firing across the full resolution of the pixel array (spatial-decentralized). However, the firing of spike events across the entire pixel array produces a random stream of integers (X and Y), shown in Figure 9, which are hardly compressible. The AP mode of the spike coding strategy is specifically designed for such scenarios. For instance, consider Figure 10, which shows spike firing across the entire pixel array of the macrocubes (the four macrocubes contain the location histogram event count). The first macrocube contains 36 events, which are represented by 36 bytes, i.e., each pixel has an event and each event count is represented by a byte. In the second macrocube, the event count per pixel is doubled but the number of bytes required to represent spike event count remains the same. Thus, the higher the average event count per macrocube, the higher the compression performance of the spike coding strategy. Furthermore, the temporal correlation between the successive macrocubes' spike event count is also exploited, which results in a better compression performance for the spike coding strategy as compared to the dictionary based strategies.

E. INCREASE IN COMPRESSION AND DECOMPRESSION LATENCY UNDER MOBILE DVS SCENARIOS
The delay factor performance (w.r.t compression ratio) for mobile scenarios is reported in Figure 11. A significant increase in compression and decompression delay factors is observed as compared to the latency performance under static DVS scenarios reported in Figure 8. This is mainly because of the high event rate of mobile DVS and low compression and decompression speed. The comparison of the delay factors between the static and mobile scenarios is reported in Figure 12. According to the figure, the average one second compression latency (delay factor) for spike coding is increased from 450 ms to 1352 ms (an increase of 200.44 %). For LZMA, the average compression latency per second is increased by 476.89 % (225 ms to 1298 ms). LZ4 and Snappy achieve the lowest compression latency (less than 10 ms) as shown in Figure 11. Brotli and Zstd are the other two low latency dictionary based compression strategies, incurring a delay of 54 and 33 ms respectively (for the mobile DVS scenarios). It is important to note that the compression speed of the Sprintz strategies remains the same for the static and mobile DVS scenarios. Therefore, the Sprintz strategies exhibit an impressive compression latency of less than 50 ms (1 s of DVS data compressed in less than 50 ms) for mobile scenarios.
Apart from spike coding and LZMA, all the strategies exhibit a decompression latency of less than 50 ms. The impact of DVS mobility on decompression latency is the highest for LZMA and spike coding algorithms, where the latency is approximately 200 ms.

VI. CONCLUSION
Spike event cameras are revolutionary sensors, that offer many advantages over conventional frame-based vision sensors, such as low power, wide dynamic range, low latency and high temporal resolution. The pixels in DVS respond to luminance changes by firing an asynchronous stream of spike events. The spike stream comprises the X and Y spatial addresses, firing time, and the polarity of each spike event. The compression of the DVS output is important for efficient transmission, storage, on-board detection, monitoring and recording. Since the output of the DVS comprises a multivariate stream of integers, it is worth investigating the performance of integer based compression approaches, IoT specific compression strategies, general purpose lossless compression algorithms, and many other similar compression approaches. This work provides a detailed lossless compression performance analysis of diverse strategies under diverse scenarios including outdoor static DVS, outdoor mobile DVS, indoor static DVS and outdoor static DVS.
According to the detailed experimental analysis provided, LZMA achieves the best compression ratios among all the considered strategies for the case when the DVS is static. On the other hand, Spike coding achieves the best compression ratios when spike events are produced by a visual sensor in motion. In terms of compression and decompression speed and latency, LZ4 and Snappy provide the best performance, while the Brotli algorithm represents a good compromise between compression ratio, compression and decompression speed and latency. We observe a significant compression performance degradation, in terms of ratio, speed and latency, for mobile sensor scenarios vs. fixed sensor scenarios. The detailed analysis presented in this paper provides a benchmark in the selection of a lossless compression approach for a particular application. Furthermore, such a detailed study also provides a benchmark for an efficient design of spike coding algorithms.