VLSI Implementation of an Efficient Lossless EEG Compression Design for Wireless Body Area Network

Data transmission of electroencephalography (EEG) signals over Wireless Body Area Network (WBAN) is currently a widely used system that comes together with challenges in terms of efficiency and effectivity. In this study, an effective Very-Large-Scale Integration (VLSI) circuit design of lossless EEG compression circuit is proposed to increase both efficiency and effectivity of EEG signal transmission over WBAN. The proposed design was realized based on a novel lossless compression algorithm which consists of an adaptive fuzzy predictor, a voting-based scheme and a tri-stage entropy encoder. The tri-stage entropy encoder is composed of a two-stage Huffman and Golomb-Rice encoders with static coding table using basic comparator and multiplexer components. A pipelining technique was incorporated to enhance the performance of the proposed design. The proposed design was fabricated using a 0.18 μm CMOS technology containing 8405 gates with 2.58 mW simulated power consumption under an operating condition of 100 MHz clock speed. The CHB-MIT Scalp EEG Database was used to test the performance of the proposed technique in terms of compression rate which yielded an average value of 2.35 for 23 channels. Compared with previously proposed hardware-oriented lossless EEG compression designs, this work provided a 14.6% increase in compression rate with a 37.3% reduction in hardware cost while maintaining a low system complexity.


Introduction
The electroencephalogram (EEG) [1,2] signal has always been considered an inherent and crucial reference for the neurologist to diagnose any brain disorder. EEG is a technique used to record electrical activity generated by the human brain [3]. Other problems associated with the abnormal functioning of the brain which can be diagnosed by using EEG signals include coma, confusion, stroke, and tumors. Among various modalities available, ambulatory or portable EEG is expected to emerge as a potentially viable area for data compressions in EEG devices. This is attributed to the ease of accessibility and high patient comfort offered during the EEG signal acquisition procedure.
Traditional EEG monitors and recorders transmit EEG signals via cables. In recent years, the Wireless Body Sensor Network (WBSN) technology is being widely developed since it can greatly enhance the way people live in terms of comfort and convenience [4][5][6]. WBAN is also being developed due to its high potential to replace the use of batteries for portable devices [7][8][9]. Most portable wireless devices in the market, however, is limited to their onboard battery capacity as their main constraint for the long-term use of the device. One of the approaches to improve the efficiency of current wireless EEG recorders is making use of a lossless compression technique to reduce the power consumption during the transmission of EEG data.
In this paper, a novel dynamic voting prediction methodology is proposed in order to adaptively choose the optimal prediction function. In addition, a fuzzy decision unit is incorporated to improve the accuracy of prediction. A novel dynamic voting scheme is combined with the adaptive fuzzy prediction methodology for the EEG compression. Moreover, a novel tri-stage entropy encoding method is combined with the adaptive fuzzy and voting-based prediction. The comparators and multiplexer components were used to replace the complex computing components to achieve hardware sharing. A pipelining technique is used to improve the performance of this design. Simulation results showed that the proposed algorithm significantly improved the compression rate with a relatively low complexity in its VLSI implementation.
This paper is organized as follows: Section 2 presents a literature review of several lossless compression algorithms. Section 3 discusses the methodology of the proposed novel lossless EEG compression algorithm. This includes dynamic voting prediction, tri-stage entropy coding and its VLSI architecture. Section 4 lists and discusses the results of the proposed lossless EEG compression algorithm and its performance. A comparison with previous studies in terms of compression rate and VLSI design performance is also presented. Conclusions were summarized in Section 5.

Literature Review
A Chaotic Compressive Sensing (CCS) algorithm was proposed in [10] to solve both problems of energy saving and data security. A combined compression algorithm [4] provided different biomedical signals that showed a significant improvement in the compression ratio with a small maximum error for optimizing the network resource usage over Wireless Sensor Networks (WSN). A lossy compression algorithm based on online dictionaries provided a quantitative assessment for compression, reconstruction and energy consumption of wearable Internet of Things (IoT) was presented in [11].
Several varieties of EEG compression algorithms have been proposed in literature. Srinivasan et al. [12] proposed a high performance wavelet-based EEG compression while Sriraam et al. [13] presented an adaptive error modeling scheme. Shaw et al. [14] presented an excellent algorithm for EEG signals in high dimensionality. Shaw et al. proposed a compression method for multichannel EEG data with improved storage capacity and efficiency in transmission. A lossless and near-lossless algorithm of EEG compression was presented in [15]. The literature proposed two modes of compression for different platform with individual capability. An algorithm for classifying multichannel EEG data through a promising tool called the fuzzy multichannel EEG classifier was proposed in [16]. This supports different EEG signals that were collected at different time instants.
The previously proposed algorithms were able to attain a high performance in terms of both compression rate and complexity in their VLSI architecture. Chua et al. [17] proposed a VLSI implementation of a mixed bio-signal lossless data compression together with its EEG signal compression. The said work presented a detailed figure of merits for the different compression methodologies.
On the other hand, several compression techniques were also proposed for electrocardiography (ECG) signals. Chen et al. [18] developed a slope prediction based algorithm while Chen et al. [19] proposed a novel adaptive trending prediction with Huffman coding architecture that was extended by implementing a fuzzy decision technique for a more efficient and precise signal prediction [20]. These 3 previously proposed methods in literature provided a reliable reference for EEG compression in VLSI implementation. Recently, an adaptive resolution control [21] and a fuzzy resolution control [22] techniques for body signals have been proposed. Although these variable resolution control techniques can improve the compression rate efficiently, there is significant information that was lost in the body signal.

Lossless EEG Compression Algorithm
The proposed novel lossless EEG compression algorithm consists of a predictor and an encoder. The result of the predictor is used as the input to the encoder. The predictor implements a voting-based scheme operating with the fuzzy decision technique that is designed to improve the efficiency of the entropy coding. The entropy encoder is a tri-stage design that involves pre-processing of data through the use of a two-stage Huffman encoder and a Golomb-Rice encoder. The following subsections discuss each of these components.

Dynamic Voting Prediction
Biomedical signals are by nature chaotic and fluctuate rapidly. As such, there is no single generic prediction function that is capable of accurately predicting a biomedical signal while maintaining a low system complexity. As opposed to designing several prediction algorithms for each and every kind of biomedical signal, this study proposes a dynamic voting prediction algorithm that is independent to the type of body signal in order to enhance the overall performance of the signal prediction. The dynamic voting prediction scheme proposed in this study is composed of the following steps: the first-stage prediction, second-stage prediction, and the voting prediction stage.

First-Stage Prediction
This preliminary step ensures that the data distribution will converge. This step made use of three ECG signal prediction functions that were proposed in previous studies namely linear, slope, and adaptive trending functions by Chen et al. [6], Chen et al. [18] and Chen et al. [23], respectively. These functions were simulated and tested to predict a given ECG signal. Table 1 lists the prediction functions and their respective compression rate on the ECG signals provided by the MIT-BIH arrhythmia database [24]. The adaptive trending function had the highest compression rate achieved. Table 1. Compression rate on ECG signals of previously-proposed prediction functions.

Second-Stage Prediction
The second-stage prediction involves a fuzzy decision component [20]. This step organizes the results of the first-stage prediction according to the two slope values diff_1 and diff_2 as shown in Figure 1. The values of diff_1 and diff_2 are equivalent to the absolute differences of X(n − 1) and X(n − 1), and X(n − 1) and X(n − 2), respectively.  Table 1, the adaptive trending method shows higher performance than the linear and slope functions for ECG signal. Hence, the use of the fuzzy decision rule is selected as the base prediction scheme for the proposed prediction methodology for EEG signals.   Table 1, the adaptive trending method shows higher performance than the linear and slope functions for ECG signal. Hence, the use of the fuzzy decision rule is selected as the base prediction scheme for the proposed prediction methodology for EEG signals.  Table 1, the adaptive trending method shows higher performance than the linear and slope functions for ECG signal. Hence, the use of the fuzzy decision rule is selected as the base prediction scheme for the proposed prediction methodology for EEG signals.

Dynamic Voting Scheme
The dynamic voting scheme component is developed to dynamically choose the optimal function during signal trend fluctuations. For every prediction session, one of the six modules will be activated to receive the data coming from the fuzzy decision module. Each of the modules contain five second-stage prediction functions, as shown in Figure 2. The following lists the constant and/or preset values: e ij is a constant where 1 ≤ i ≤ 6 and 1 ≤ j ≤ 6. Each fuzzy module contains 5 prediction equations, where each prediction equation has its own e ij value. e ij denotes the jth e value of the ith fuzzy module. A preset coefficient e ij value was used that is from the distribution of the difference value between the sampling points in the EEG dataset. The parameter S is determined by getting the absolute value of diff_2 over diff_2. The number of votes for each function is monitored using five registers. The number of votes for each function is equal to the number of times that that particular function has the closest prediction among the five prediction functions. The function with the most number of votes will be executed with its resulting value stored in register PD 2 of the said voting prediction stage. The same procedure is performed for all the other four functions. Figure 3 shows the dynamic voting procedure. PD 1 is the subtractor output with inputs X(n) and X(n − 1). The upper flow shows that given PD 1 , the optimal function is selected according to the highest number of votes where its value is to be stored in PD 2 . The lower flow of data acquires the current result of the prediction module. The current prediction result will be used as a vote to change the numbers of the corresponding function and contribute to the next prediction session. Register PD 2 stores the resulting value of the function with the highest number of votes. Dynamic Voting Scheme The dynamic voting scheme component is developed to dynamically choose the optimal function during signal trend fluctuations. For every prediction session, one of the six modules will be activated to receive the data coming from the fuzzy decision module. Each of the modules contain five second-stage prediction functions, as shown in Figure 2. The following lists the constant and/or preset values: is a constant where 1 ≤ ≤ 6 and 1 ≤ ≤ 6 . Each fuzzy module contains 5 prediction equations, where each prediction equation has its own value. denotes the jth e value of the ith fuzzy module. A preset coefficient value was used that is from the distribution of the difference value between the sampling points in the EEG dataset. The parameter S is determined by getting the absolute value of diff_2 over diff_2. The number of votes for each function is monitored using five registers. The number of votes for each function is equal to the number of times that that particular function has the closest prediction among the five prediction functions. The function with the most number of votes will be executed with its resulting value stored in register PD2 of the said voting prediction stage. The same procedure is performed for all the other four functions. Figure 3 shows the dynamic voting procedure. PD1 is the subtractor output with inputs X(n) and X(n − 1). The upper flow shows that given PD1, the optimal function is selected according to the highest number of votes where its value is to be stored in PD2. The lower flow of data acquires the current result of the prediction module. The current prediction result will be used as a vote to change the numbers of the corresponding function and contribute to the next prediction session. Register PD2 stores the resulting value of the function with the highest number of votes.   Figure 4a shows the result of each function together with the number of votes for each corresponding function. As can be seen, function 2 has the largest number of votes. Hence, the value stored in PD2 register is chosen as the output of function 2. However, in this session, function 1 has a resulting function value that is closest to −1. As such, the optimal function is function 1 rather than function 2. As such, the dynamic voting predictor will cast a vote to function 1 as shown in Figure 4b.   Figure 4a shows the result of each function together with the number of votes for each corresponding function. As can be seen, function 2 has the largest number of votes. Hence, the value stored in PD 2 register is chosen as the output of function 2. However, in this session, function 1 has a resulting function value that is closest to −1. As such, the optimal function is function 1 rather than function 2. As such, the dynamic voting predictor will cast a vote to function 1 as shown in Figure 4b.

Tri-Stage Entropy Coding
The entropy encoder incorporates both the Huffman coding and the Golomb-Rice coding algorithm. The Huffman coding encodes symbols that have higher probabilities with shorter code length according to the Huffman tree. However, as the value of the EEG signal data varies in a wide range, the Huffman tree would group up outstandingly. It is difficult to design a low-cost and a high performing VLSI architecture that has a block circuit and implements a tree with a very large depth. For this reason, a two-stage Huffman encoding technique [19] is applied to the data whose values have high probabilities. For the PD2 values whose probabilities are relatively low, the absolute value is not too large. As such, the Golomb-Rice coding technique can efficiently shorten the length of the code by choosing an appropriate divider. This further enhances the performance of the Golomb-Rice coding. The PD2 value can be transformed into a smaller value PD'(n) using Equation (1).
where k is the first position in the Golomb-Rice table. Figure 5 shows the VLSI architecture of the proposed lossless EEG compression VLSI design. It illustrates its components which are composed of a dynamic voting predictor, a two-stage Huffman encoder, a Golomb-Rice encoder, pipeline registers, and their interconnections.   Figure 5. VLSI architecture of the proposed lossless EEG compression algorithm.

Tri-Stage Entropy Coding
The entropy encoder incorporates both the Huffman coding and the Golomb-Rice coding algorithm. The Huffman coding encodes symbols that have higher probabilities with shorter code length according to the Huffman tree. However, as the value of the EEG signal data varies in a wide range, the Huffman tree would group up outstandingly. It is difficult to design a low-cost and a high performing VLSI architecture that has a block circuit and implements a tree with a very large depth. For this reason, a two-stage Huffman encoding technique [19] is applied to the data whose values have high probabilities. For the PD 2 values whose probabilities are relatively low, the absolute value is not too large. As such, the Golomb-Rice coding technique can efficiently shorten the length of the code by choosing an appropriate divider. This further enhances the performance of the Golomb-Rice coding. The PD 2 value can be transformed into a smaller value PD'(n) using Equation (1).
where k is the first position in the Golomb-Rice table. Figure 5 shows the VLSI architecture of the proposed lossless EEG compression VLSI design. It illustrates its components which are composed of a dynamic voting predictor, a two-stage Huffman encoder, a Golomb-Rice encoder, pipeline registers, and their interconnections.

Tri-Stage Entropy Coding
The entropy encoder incorporates both the Huffman coding and the Golomb-Rice coding algorithm. The Huffman coding encodes symbols that have higher probabilities with shorter code length according to the Huffman tree. However, as the value of the EEG signal data varies in a wide range, the Huffman tree would group up outstandingly. It is difficult to design a low-cost and a high performing VLSI architecture that has a block circuit and implements a tree with a very large depth. For this reason, a two-stage Huffman encoding technique [19] is applied to the data whose values have high probabilities. For the PD2 values whose probabilities are relatively low, the absolute value is not too large. As such, the Golomb-Rice coding technique can efficiently shorten the length of the code by choosing an appropriate divider. This further enhances the performance of the Golomb-Rice coding. The PD2 value can be transformed into a smaller value PD'(n) using Equation (1).
where k is the first position in the Golomb-Rice table. Figure 5 shows the VLSI architecture of the proposed lossless EEG compression VLSI design. It illustrates its components which are composed of a dynamic voting predictor, a two-stage Huffman encoder, a Golomb-Rice encoder, pipeline registers, and their interconnections.   Figure 5. VLSI architecture of the proposed lossless EEG compression algorithm.

Dynamic Voting Predictor
The predictor component in Figure 5 illustrates that the voting predictor is composed of five registers, three subtractors, one fuzzy controller, and one voting predictor. The four registers in the input stage are used to store the input data X(n), X(n − 1), X(n − 2) and X(n − 3). The three subtractors provide the values for PD 1 , diff_1, and diff_2. Both diff_1 and diff_2 are used as inputs to the fuzzy controller. Their output together with PD 1 are used as inputs to the voting predictor. The fifth register PD 2 holds the final output value of the adaptive voting predictor. Register PD 2 is interconnected to both of the two-stage Huffman and Golomb-Rice encoders and is also used as the pipeline register to improve the performance of the proposed design.

Entropy Encoder
The entropy encoder is composed of both the two-stage Huffman and Golomb-Rice components as shown in Figure 5. In the two-stage Huffman encoder component, two Huffman tables were used as look-up tables. The two-stage Huffman encoder checks the value of PD 2 which stores the output of the adaptive voting predictor. If the value is within the encoding range of the two-stage Huffman encoder, the value of PD 2 will be encoded using the two-stage Huffman encoder and will be directly sent as the final output. Otherwise, the value of PD 2 will be passed through a pre-processing stage where Equation (1) is utilized. The pre-processing procedure ensures that the data will be passed on to the Golomb-Rice encoder through a multiplexer, which has a range of values that will better fit what is required by the Golomb-Rice look-up table. The resulting data of the Golomb-Rice encoder is of a variable length code that will be the output of the proposed lossless EEG controller that is ready for transmission.

Simulation and Dataset
The CHB-MIT Scalp EEG Database [25] was utilized to examine the proposed algorithm in terms of its compression rate. The standard EEG pattern is recorded in European Data Format (edf) containing one uninterrupted digitized polygraphic recording. The original EEG signals in 23 channels were sampled at 256 samples per second with 16-bit resolution and 1 hour duration. A software program was used to extract the information from the edf file as well as to restore the original EEG pattern. The extracted data from the edf file was compressed into a bitstream of data by using the different prediction and entropy encoders. The resulting encoded bitstream of data was decoded to verify that it has the same data as that of the original data extracted from the edf file. The compression rates were computed by getting the ratio of the size of the original data and the size of the encoded bitstream.
The proposed lossless EEG encoding algorithm was implemented using Verilog code and was simulated using the ncverilog tool. The VLSI architecture was synthesized using a design compiler with a TSMC 0.18 µm CMOS generic logic process technology. Table 2 lists the compression rates for all four functions: linear, slope, adaptive trending and the proposed fuzzy and dynamic voting predictors operating with Huffman and Golomb-Rice encoders. The compression rates of the EEG signals are presented using the average compression rate using all 23 channels of the EEG signals. It is apparent that the voting prediction with entropy coding design proposed in this study has significantly improved the compression rates. Moreover, it drastically decreased the entropy coding size. The design of the prediction methodology is crucial since the prediction optimizes the frequency distribution of the values by making the values closer to a certain value that is usually 0. In addition, the prediction minimizes the absolute values which significantly improves the performance of the entropy coding by assigning the length of the codes according to the values of the input data.  Table 3 shows the specification of the area, power and the gate-count of the previous lossless compression designs in [6,17] and this work. The advantage of the proposed design in terms of area is the use of a combinational logic that occupied most of the cell area which resulted to a reduction in the hardware cost to at least 37.3% compared to previous designs. The proposed design of this work has a total power consumption of 2.5867 mW at a global operating voltage of 1.62 V and a clock frequency of 100 MHz. Even though the combinational logic occupied most of the cell area, it consumed only one-tenth of the power with the registers consuming 89.26%. Based on the results listed in Table 4, a limitation of the proposed design is its power consumption. Thus, minimizing the power consumed by the registers is a major concern in future improvement.

Results and Discussion
Looking into the cell report of this design, the gate count resulted to 8405 NAND-equivalent gates for the entire design with the voting prediction component contributing 68.48% of the total gate count. This is mainly due to the fact that the voting prediction component is the most complex step in the compression algorithm. Previous studies in [6,17] showed a gate count of 13,400 and 53,900, respectively. Compared with the previous studies, this work showed a 37.3% reduction in terms of gate count. Moreover, this work showed an 84.4% reduction in hardware cost.
The proposed lossless EEG encoding algorithm was tested using the CHB-MIT Scalp EEG Database and conceded an average of 2.35 compression rate. Previous studies in [6,17] showed an average compression rate of 2.05 and 1.37, respectively. This work showed a 14.6% and 58.30% increase in the compression rate compared to [6,17], respectively. The performance of the proposed VLSI architecture was also verified. Synthesis results recorded that the submitted encoder design contains 8405 NAND-equivalent gate counts, which is 37.3% and 84.4% less than the previous studies in [6,12], respectively. The core area in this design is 578,000 µm 2 while its power consumption is 2.58 mW operating at 100 MHz. The power saving of this study reaches 54.77% which is better than 51.21% and 27% in previous studies in [6,17], respectively.  Table 4 lists the energy savings of the original data and the compressed data using both the Bluetooth and Zigbee wireless transmitters. The Ecomp is derived using the power consumption with a clock frequency of 100 MHz for the input data rate used in circuit simulation per bit divided. In addition, the power has a high-positive correlation to the amount of data. Consequently, the power consumption is reduced relative to the compression rate. The Etx_original and Etotal_original are the energy and the total energy of the original data which are raw and uncompressed. Using the CR value of 2.35, the energy after compression is computed as Etx_CR and Etotal_CR. It is clearly shown that the amount of data is reduced 2.35 times by CR and thus the energy is significantly. The results show that even though this design consumes more power than previous designs, its energy savings using wireless transmitters can be improved.

Conclusions
This paper presented a novel lossless, high-compression-rate with a low-complexity EEG compression algorithm that is based on a fuzzy decision, dynamic voting prediction and tri-stage entropy coding. The proposed VLSI design had significantly increased the compression rate to 14.6% and significantly reduced the hardware cost to 37.3% compared to previously reported designs in literatures. A limitation of the proposed design is its power consumption which can be reduced by improving the power consumption of the registers for future works. The proposed design is suitable for applications in WBAN, WBSN, wearable devices, as well as in Internet of Things (IoT) devices.

Conflicts of Interest:
The authors declare no conflict of interest.