# Wavelet-Based Multi-Class Seizure Type Classification System
## 2 Materials and Methods
### Proposed Technique
#### 2.2.2 Feature Extraction  
Wavelet transform (WT) methods have been employed successfully to solve various non-stationary signal problems [17; 35; 36], including EEG [20]. WT is a spectral estimation method that provides another representation of the signal at different scale components. Wavelet Transform (DWT) is one of the WT's most popular techniques that decomposes a given signal \(x[k]\) into a mutually orthogonal set of wavelets through convolution with filter banks. For \(j\) levels of decomposition, a signal \(x[k]\) is passed through two bandpass filters: high \(Hp[. ]\) and low \(Lp[. ]\) starting from level \(j=1\). The output of each level is two down sampled components, approximation \(Aj[i]\) and detail \(Dj[i]\), which are represented as  
\[D_{j}[i]=\sum_{k}x[k]\cdot Hp[2\cdot i-k] \tag{1}\]  
\[A_{j}[i]=\sum_{k}x[k]\cdot Lp[2\cdot i-k] \tag{2}\]  
The approximation component \(Aj[i]\) can be further decomposed into another level of \(A_{j+1}\) and \(D_{j+1}\) as shown in Figure 2 until the maximum or required level of \(j\) is reached. DWT has many successful applications; however, it has some drawbacks, such as insufficient information in high-frequency components, shift-variance, low directionality, and absence of phase shift. Over time, different enhancements have been introduced to cover the shortcomings of DWT. Dual-tree complex wavelet transform (DTCWT) is an extension of DWT which was proposed by [PERSON] [37] and developed later by [PERSON] et al. [38]. It uses extra double low-pass filters and an additional two high-pass filters to produce four components at each level which include real and imaginary parts. DTCWT can be imagined as two parallel DWTs, as shown in Figure 3. This transformation is approximately shift-invariant and directionally selective in two and higher dimensions, which are very important in applications such as pattern recognition and signal analysis. Therefore, DTCWT has less shift variance and more directionality as compared to DWT. Figure 2: The structure of three-scale level discrete wavelet transform (DWT). In our proposed technique, we decomposed the EEG signals into four levels using DTCWT using the Python library DTCWT [39] ([[https://github.com/rjvv57/dtcwt/tree/0.12.0](https://github.com/rjvv57/dtcwt/tree/0.12.0)]([https://github.com/rjvv57/dtcwt/tree/0.12.0](https://github.com/rjvv57/dtcwt/tree/0.12.0)), accessed on 10 May 2021). The level of decomposition was set manually based on trial and error after experimenting with different levels of decomposition based on the performance evaluation and computational efficiency. The decomposition process produces real and imaginary parts of complex wavelet coefficients, and we selected the magnitude of the complex coefficients. After the decomposition, we computed a set of statistical features from each of the coefficients. Although these coefficients may be directly fed into the machine learning algorithm, it has been observed that these decomposed signals are very sensitive to noise [40]. Therefore, we computed a set of statistical features from each of the coefficients as suggested in [1; 19]. Those sets of features were successfully applied in EEG research to discriminate between the signals, such as in abnormality detection [20]. The computed features and their corresponding mathematical representations are presented below. For mathematical representations, \(M\) is the length of the signal in each sub-band, which is taken as 500 in this study, while \(Y\{y_{1},y_{2},\ldots y_{M}\}\) and \(Z\{z_{1},z_{2},\ldots z_{M}\}\) are two adjacent sub-bands [19; 20; 41]. 1. Mean absolute values (MAV) of the coefficients in each sub-band, \(\mu\). \[\mu=\frac{1}{M}\sum_{j=1}^{M}|y_{j}|\] (3)
2. Average power (AVP) of the coefficients in each sub-band, \(\lambda\). \[\lambda=\sqrt{\frac{1}{M}\sum_{j=1}^{M}y_{j}^{2}}\] (4)  
Figure 3: The structure of three-scale level of DTCWT, giving real and imaginary parts of complex coefficients from tree A and tree B.