Full text
Aminetal. Journal of NeuroEngineering and Rehabilitation (2023) 20:70 https://doi.org/10.1186/s12984-023-01179-8 RESEARCH Open Access © The Author(s) 2023. Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http:// creat iveco mmons. org/ licen ses/ by/4. 0/. The Creative Commons Public Domain Dedication waiver (http:// creat iveco mmons. org/ publi cdoma in/ zero/1. 0/) applies to the data made available in this article, unless otherwise stated in a credit line to the data. Journal of NeuroEngineering and Rehabilitation Single-trial extraction ofevent-related potentials (ERPs) andclassification ofvisual stimuli byensemble use ofdiscrete wavelet transform withHuffman coding andmachine learning techniques Hafeez Ullah Amin1, Rafi Ullah2, Mohammed Faruque Reza3 and Aamir Saeed Malik4* Abstract Background Presentation of visual stimuli can induce changes in EEG signals that are typically detectable by averaging together data from multiple trials for individual participant analysis as well as for groups or conditions analysis of multiple participants. This study proposes a new method based on the discrete wavelet transform with Huffman coding and machine learning for single-trial analysis of evenal (ERPs) and classification of different visual events in the visual object detection task. Methods EEG single trials are decomposed with discrete wavelet transform (DWT) up to the 4th level of decomposition using a biorthogonal B-spline wavelet. The coefficients of DWT in each trial are thresholded to discard sparse wavelet coefficients, while the quality of the signal is well maintained. The remaining optimum coefficients in each trial are encoded into bitstreams using Huffman coding, and the codewords are represented as a feature of the ERP signal. The performance of this method is tested with real visual ERPs of sixty-eight subjects. Results The proposed method significantly discards the spontaneous EEG activity, extracts the single-trial visual ERPs, represents the ERP waveform into a compact bitstream as a feature, and achieves promising results in classifying the visual objects with classification performance metrics: accuracies 93.60 ±6.5 , sensitivities 93.55 ±4.5 , specificities 94.85 ±4.2 , precisions 92.50 ±5.5 , and area under the curve (AUC) 0.93 ±0.3 using SVM and k-NN machine learning classifiers. Conclusion The proposed method suggests that the joint use of discrete wavelet transform (DWT) with Huffman coding has the potential to efficiently extract ERPs from background EEG for studying evoked responses in singletrial ERPs and classifying visual stimuli. The proposed approach has O(N) time complexity and could be implemented in real-time systems, such as the brain-computer interface (BCI), where fast detection of mental events is desired to smoothly operate a machine with minds. Keywords Single trials analysis (ERPs), Visual object detection, Discrete wavelet transform, Huffman coding, Machine learning classifiers *Correspondence: Aamir Saeed Malik [email protected].cz Full list of author information is available at the end of the article
Page 2 of 17 Aminetal. Journal of NeuroEngineering and Rehabilitation (2023) 20:70 Introduction Investigation of the neural mechanism of the human brain through non-invasive imaging modalities is the primary goal of neuroscientists. Electroencephalography (EEG) is a neuroimaging technique that is most commonly used as a non-invasive and cost-effective imaging modality in the research community. The utmost prominent field of study in which the use of the EEG technique is applied and reported its usefulness is event-related potentials (ERPs). In an ERP study, the stimuli (events) presentation is synchronized with brain responses through an EEG acquisition device. When an event occurs, or a stimulus presents to the participant, it triggers responses to specific cognitive, sensory, or motor regions that can be collected through the EEG technique over the scalp. ERPs are useful in studying cognitive processes, clinical applications, and developing brain-computer interface (BCI) systems [1]. A standard method to extract an ERP signal is to take an average on the entire set of EEG segments, which have recorded the evoked potentials against the visual or auditory events (also known as trials). The trials are time-locked EEG recordings that are made synchronized with the neural activity occurring inside the brain during an experimental setup. In addition, averaging cancels out the noise as well as other ongoing neural processes [2]. The common assumption for this approach is that the human brain continuously behaves exactly in the same manner to specific stimulation. However, this may not be true as habituation and attention can influence brain responses [3]. The analysis of brain dynamics with the average ERPs method is well-known to researchers. Presently, the single trials of ERPs analysis have become a new interest with additional challenges [4]. The trial-totrial variability is the limiting factor to getting high classification results between different types of events. Besides, single-trial responses are a mixture of task-related responses with tasks unrelated responses, which lowers the signal-to-noise ratio of the observed ERPs. The trialto-trial variability within the subject or inter subjects variability is present in amplitudes and latencies of the ERP signals [5]. Thus, it is recommendable to enhance the feature extraction process of the ERP signals before applying any type of classification algorithm [6]. Different feature extraction methods have been developed to discriminate the ERP signals from noise, including spatial and temporal filters, e.g., bandpass filter, notch filter, principal component analysis (PCA), and more advanced de-noising techniques, such as wavelet de-noising and blind source separation techniques [7]. Previous studies on ERP extraction reported the use of features extracted from the temporal, frequency, and spatial domain to separate trials belonging to certain categories based on a single trial basis. The steps in signal processing include pre-processing, spatial filtering, feature extraction, and modeling with machine-learning classifiers [6]. The pre-processing of EEG for time-locked signals employs a band-pass filter with a lower cut-off frequency from 0.1 to 0.5Hz and an upper cut-off frequency of 30Hz [8]. The band-pass filtering removes unwanted signals, such as high-frequency artifacts and DC components, and retains the desired range of frequencies where the event-related potential signal can be extracted. The EEG signal can then be segmented using the time-stamped information of stimuli onset and offset. The segments include a portion of the signal before the stimulus onset, such as 100ms pre-stimulus, as a baseline line and the whole duration of the stimulus presentation until offset. Some individual segments may be contaminated by eye blinks and eye movements, i.e., if the amplitude exceeded ±90µ V[9], which would either be discarded from further analysis or can be corrected by employing methods, such as ICA [10]. The segments (trials) can be visualized to detect those electrodes that may have lost contact in the event of widespread drift, as well as bad channels in the segments, spherical spline method is a good choice to correct bad channels [11]. Finally, the pre-processing step includes a data-independent spatial filtering technique called an averaged reference, which re-reference the data from the original single electrode used during data recording [12]. After the preprocessing, the next step in signal processing is feature extraction, which mines stimulus-related information from the preprocessed signals. The well-known methods of feature extraction include time, frequency, and time-frequency features. In the literature on visual object classification based on single-trial ERP, many studies have focused on extracting specific ERP components, combining the use of ERP components, and extracting features from the whole ERP signals, such as using the component of P2, P3, and N1/ N170. For instance, Zhang, etal. [13] have proposed a temporal principal component analysis-based method for N2 and P2 components extraction in single-trial for individual subjects. It also explored the influence of the number of trials (from 10 to 42 trials), on PCA decomposition by comparing temporal correlation, and spatial correlation with conventional time-domain analysis. A stable ERP N2 component with 20 trials and a P2 component with approximately 30 trials were obtained. Wang, etal. [14] reported ERP findings for visual stimulus classification, where the stimuli include four categories: building, car, cat, and face, and 64-channel EEG equipment was used to acquire the EEG signals which were extracted for the corresponding ERP components after preprocessing the signals. The classification results for two class problems using individual ERP components with Fisher
Page 3 of 17 Aminetal. Journal of NeuroEngineering and Rehabilitation (2023) 20:70 LDA (Fisher Linear Discriminant Analysis) classifier were above 50% detection accuracy, while the combined ERP components slightly enhanced the overall classification performance by 5%. The dataset of Wang etal. [14] was re-analyzed by Qin, etal. [15] and focused on EEG signals captured from the occipital lobe. Each visual stimulus data is considered independently as a subspace, and features extracted in each subspace were then fused using principal component analysis (PCA). The reported classification results based on kernel SVM was 72.57% accuracy, which is 6% higher than the results reported by Wang etal. [14]. Zhang, etal. [16] proposed a data augmentation approach for single trial detection based on a generative adversarial network to enhance the classification performance. The results proposed a 73% reduction of real subject data and acquisition cost and enhances the general classifier performance. Parashiva and Vinod [17] proposed a single-trial detection method based on temporal domain features, i.e., the standard deviation between the two categories of trials, for discriminating the correct and error trials employing a modified powerlaw based transformation. The reported results were presented from a sample of 10 subjects, and the average sensitivity and specificity were 86% and 92% respectively, for discriminating correct vs error trials. Similarly, Wirth, etal. [1] reported a single-trial classification method for discriminating between different error trials. The authors used two datasets were used with 25 and 14 participants to discriminate between error trials. The classification results show mean overall accuracy of 65.2% and 65.6% for two experimental tasks. Previously we have developed feature extraction methods for spontaneous EEG recordings [18, 19], such as eyes open and eyes closed recordings, and clinical EEG recordings for detecting epileptic seizure activities, where the authors have used discrete wavelet transform (DWT) with db4 mother wavelet as the db4 wavelet is most appropriate for detecting seizure spikes. Further, in our previous work [18, 19], the arithmetic coding technique was used to convert the wavelet coefficients into bitstreams because the spontaneous EEG recordings have a relatively long duration, and the signals have the potential of high redundant information. Also, the arithmetic coding technique provides superior results in reducing the redundant information in long signals relative to short-length signals like ERPs. However, for ERPs signals, the db4 wavelet does not provide a good resemblance with the ERP waveforms. Thus, the previously developed features extraction method for spontaneous EEG analysis was not promising enough to detect visual events in ERPs signals. However, it has been reported from previous single-trial analysis studies that the biorthogonal B-spline wavelet is the most suitable mother wavelet for ERPs signals [20]. Moreover, the ERPs signals are timelocked short EEG segments, usually from 500ms to 2000ms long. Thus, the discrete wavelet transform with a biorthogonal B-spline wavelet could be a suitable combination to extract the ERPs from the background EEG signals more efficiently, and the Huffman coding could be a choice to use for reducing the redundancy and computing the features for ERPs. Machine learning techniques proved helpful in braincomputer interface (BCI) applications e.g., to control motor prostheses. This kind of application requires accurate and fast detections of physical motor events corresponding with neuronal activity, which could be achievable with the use of machine learning. Many analysis methods and machine learning tools are reported to be used to achieve such accuracy in ERPs [21–23]. However, the ERP responses achieved through visual stimuli are less regular and also have a low signal-to-noise ratio as compared to the motor control task signals. Therefore, the classification of such ERPs is a challenging task and requires a robust feature extraction method that could give the best classification results by using machine learning classifiers. Machine learning classifiers such as k-NN and SVM have been used for the classification of mental states, diagnosis of mental disorders, and/or separation of different categories of stimuli based on EEG and ERP signals [24]. It is also reported that k-NN and SVM are also valuable for the detection of other health abnormalities, such as Purwar, etal. [25] reported the detection of mesangial hypercellularity MEST-C score in immunoglobulin using deep CNN. Similarly, in other studies, Purwar, etal. [26] and Purwar, etal. [27] reported the detection of microcytic hypochromic using cbc and blood film features extracted from convolution neural networks by different machine learning classifiers and using a fusion of deep image and clinical features for classification of Thalassemia patients. The study aims to develop a feature extraction method that could efficiently extract a compact set of useful information from background EEG segments for eventrelated potentials (ERPs) to detect visual events from evoked potentials accurately. The proposed method for ERPs would be a cost-effective feature extraction technique that could be used in the classification of visual events. The present work chooses the DWT with the biorthogonal B-spline wavelet to decompose the EEG segments up to several levels and get the DWT coefficients. Then a thresholding technique is applied to discard unnecessary coefficients and retain only significant coefficients that hold the relevant information of the ERP signal. The retained coefficients are encoded into bitstreams with Huffman coding to extract features. Moreover, the proposed feature extraction method can assist in
Page 4 of 17 Aminetal. Journal of NeuroEngineering and Rehabilitation (2023) 20:70 the real-time detection of visual event-related potentials, particularly desirable in applications of brain-machine interfaces or brain-computer interfaces. The organization of subsequent sections of the paper follows: the section Materials and Methods provides details of the experimental task, participants’ information, experimental procedure, EEG recording & preprocessing, details steps of the proposed feature extraction method, and analysis; the section’ Experimental Results and Discussion’ presents the findings of the study, comparison results, and provides discussion on the study findings and relevant to previous studies, and reporting the limitations of the study for future research; finally the paper is concluded. Materials andmethods This section provides the detail of data collection (including participants’ information, visual object detection task, experiment procedure, and preprocessing steps) wavelet transform, an explanation of the proposed method, and an overview of machine learning classifiers used in this work. Participants The sample size in this experiment was sixty-eight ostensibly healthy participants recruited for participation. Their age range was between 18-to-30 years and the mean (M) and standard deviation (SD) were 23.66, and ±3.63 , respectively. All of them had normal or ‘corrected to normal’ vision and were free from neurological disorders, medication, and hearing impairments. They signed a written informed consent document before starting the experiment as per the defined study protocol. This analysis is part of a research study that was approved by the Human Research Ethics Committee of the collaborating institution [28]. Visual object detection task andstimulus The visual object detection task is used for studying visual evoked potentials in ERP studies. The presentation of visual stimuli allows us to examine the neural activity elicited during attention-demanding cognitive events [29]. In the experimentation, the visual object detection task was performed by all the participants, where two shapes: a box and a sphere, were used to represent the target and standard stimuli. The duration of every trial was 1000ms in which the visual stimuli, either standard or target, were presented for 500ms time and 500ms time was used between two consecutive events as an inter-trial-interval (ITI), see Fig.1. The task demands the participants to use the button ‘0’ from the numeric keyboard to record responses against a target stimulus, and not to respond when a standard stimulus appears. All the participants were instructed to avoid errors and respond quickly as possible. Thus, the presentation software captured the reaction time and correct responses for target stimulus detection synchronized with the neural activities. In the task, a total of one hundred and thirty-five trials were used, in which thirty percent of trials possessed target stimulus trials and seventy percent possessed standard stimulus trials. Accordingly, forty trials belong to target stimulus events and ninety-five trials belong to standard stimulus events. The task was approximately four minutes long, which was adopted with modification from a previous ERP [30]. Experiment procedure The schedule of the data collection was communicated to all the participants, and according to their availability, experiments were conducted individually at the specified time. When a participant arrived, he/she was informed about the experimental procedure and instructed according to the defined study protocol. Then the participant was seated in a partially sound-attenuated EEG room for preparation. Head measurement was taken and accordingly an EEG electrodes cap of appropriate size was set up as per the device manual, and thus the participants completed the experiment, including the visual object detection task, which was completed in around four minutes. The experiment was run on a screen attached to a laptop to synchronize the stimuli presentation with the EEG recording using E-Prime Software [31]. EEG recording The EEG signals were captured during the experimental task from all the participants over the whole scalp of 128 locations by using the EEG device HydroCel Geodesic Sensor NetAmps 300 from Electrical Geodesic Inc., Eugene, OR, USA. In the EEG data acquisition, the EEG sensors were referenced to the Cz location, and raw EEG signals were amplified with the NetApms300 amplifier of EGI in net-station software. The filtering setting was kept as bandpass 0.1 to 100 Hz and a notch filter of 50 Hz; while the impedance was set below 50 K ensuring a good signal-to-noise ratio as per the manufacturer’s guidelines [11]. The continuous EEG signals were digitized with a sampling rate of 250 Hz. EEG pre‑processing EEG is a non-stationary and highly time-varying sensitive signal. During acquisition, EEGs are highly vulnerable to the external environment. The vulnerability to the external environment allows different unwanted interferences to the EEG, known as artifacts. The causes of artifacts could be due to physical activities,
Page 5 of 17 Aminetal. Journal of NeuroEngineering and Rehabilitation (2023) 20:70 such as cardiac activity (electrocardiogram, ECG), muscle contraction (electromyogram, EMG), ocular activity caused by eye movement and/or blinking (electromyogram, EOG), and interference from the EEG device (DC drift) itself and the line (line noise at 50Hz). These artifacts mixed with the EEG activity can greatly mislead the analysis results, especially in time-locked EEG such as ERPs, where EEG is synchronized with the visual or audio stimuli. Therefore, the EEG signals need proper pre-processing before considering the signals for extracting events relevant information, i.e., feature extraction, for further analysis. In general, the artifacts due to the EEG device itself and the line noise can be removed from the recordings by using band-pass filtering and notch filter. The artifacts due to physical activities can be handled with Blind Source Separation [32], spatial filtering, and adaptive filtering. In this study, the data pre-processing of raw EEG recordings was carried out with the following steps. The pre-processing included the EEG segmentation, as shown in Fig.2. 1 a bandpass filter 0.3–30 Hz, roll-off 12 dB octave was applied and discarded high-frequency artifacts and DC components. 2 the EEG signals were segmented with 600ms length including 100ms pre-stimulus time as a baseline and Fig. 1 An illustration of the visual object detection task Fig. 2 EEG preprocessing for ERPs analysis
Page 6 of 17 Aminetal. Journal of NeuroEngineering and Rehabilitation (2023) 20:70 500ms post-stimulus time for obtaining the individual EEG trials. 3 individual EEG segments (trials) if contaminated with eye blinks and eye movements, i.e., if the amplitude exceeded ±90µ V, were corrected with the independent component analysis (ICA) method [32]. 4 The EEG segments (trials) were visualized to detect the electrodes that had lost contact in the event of widespread drift, as well as bad channels in the segments, which were corrected with the spherical spline method [11]. 5 Finally, the data were re-referenced to the averaged reference from a single vertex Cz electrode and subsequently exported into *.mat format for further analysis as pre-processed EEG signals. The timestamps of stimulus onset, response, and offset were extracted from the stimuli presentation software. Wavelet transform The wavelet transform is the inner product of a given signal x(t) with dilated and translated versions of the wavelet function �a,b(t) is defined as: The parameters a,b∈ℜ represent the scale and translation, respectively. The scaling parameter dilates or compresses the wavelet function and the translation parameter changes its location [33]. The correlation of the signal x(t) with the dilated/contracted versions of the wavelet function �(a,b)(t) provides the low/high frequency components. Practically, the wavelet transform is defined at discrete scales aj= 2 j and times b ( j , k ) = 2 jk , called discrete wavelet transform (DWT). The DWT successfully divides the given signal into approximations and details coefficients at different scales. The lower scales give information about high-frequency components and the high scales give information about low-frequency components. The DWT decomposition in the present study is given in the description of the proposed method section. Huffman coding Huffman coding is a widely used technique for eliminating data redundancy and generating optimal codewords for data compression. For a given set of alphabets or data symbols with their probabilities of occurrences, it produces a set of variable-length codewords, having the shortest average length, and allocates the codewords (1) W�X(a,b)=�x,�a,b� (2) � a,b =| a | −1/2�( t − b a) to the given data symbols. First, it creates a sequence of source reductions by looking at the frequencies of occurrence (the probabilities) of the source symbols and taking the bottommost probabilities symbols into a single symbol that substitutes the source reduction. Repeating this process till reducing the source to two symbols. Second, to encode each reduced source, starting smallest source and going back to the original source. The minimal length binary code (0 and 1) is assigned to two symbols in an arbitrary style. Repeating this process for each reduced source symbol till it reached the original source. The average length of the final code can be obtained as: Where P(ai) represents the probability, and l(ai) denotes the code length of the ith symbol. Huffman coding is useful in many applications, such as data compression. In the present study, the Huffman coding method is used as one step after discarding wavelet coefficients with a threshold in the EEG feature extraction for single-trial analysis. Thus, the Huffman coding can transform the wavelet coefficients into bitstream which would be a compact representation of the ERPs. Proposed Feature Extraction Method forERPs Analysis The proposed method as illustrated in Fig.3 consists of three main steps, including (i) DWT decomposition, (ii) Features Computation, and (iii) Features Classification, besides the pre-processing steps which are described in the previous section ‘EEG Pre-processing’. The pre-processed EEG signal, represented as x[n] is decomposed by applying the DWT up to the fourth level with a biorthogonal B-spline wavelet with three vanishing moments in the reconstruction (synthesis) wavelet and five vanishing moments in the decomposition (analysis) wavelet, produces approximation and detailed coefficients, see Fig.4. The bi-orthogonal B-Spline was selected as the basic wavelet function due to its reported suitability for the analysis of ERPs data [20, 34, 35]. B-splines have compact support and possess a shape (see Fig.5) that resembles the ERP waveform [20], providing an optimal resolution in time-frequency for the input signal, which implies that the evoked responses are localized in a few coefficients. The localization of evoked responses in a compact number of wavelet coefficients allows the representation of the ERP signal within a few optimal coefficients and discards non-significant coefficients while fulfilling certain signal quality criteria, i.e., 99% energy in a reconstructed signal. The procedure of DWT in the decomposition applies consecutive lowpass h(n) and high pass g(n) filters, where the high pass filter g(n) represents the discrete mother wavelet and the low (3) L avg = � (Jn) (i=1) P(ai)l(ai )
Page 7 of 17 Aminetal. Journal of NeuroEngineering and Rehabilitation (2023) 20:70 pass filter h(n) represents its mirror version [36]. The h(n) and g(n) filters have a cutoff frequency that is onefourth of the input EEG signal’s sampling frequency. At the start of decomposition in the first level, the lowpass h(n) and high pass g(n) filters are concurrently applied to the input EEG signal and produce the corresponding outputs, which are referred to as approximation coefficients or (A1) and detailed coefficients or (D1) , respe ctively. The approximation and detailed coefficients are the dot product of the EEG signal and the specified basis function. Mathematically, in the ith level of decomposition the approximation coefficients Ai and the detailed coefficients Di can be expressed as below: where, ϕj , k (n) = 2 −j/2 h(2 −j n − k ) is the scaling function. where, φj , k (n) = 2 −j/2 h(2 −j n − k ) is the wavelet function. Here the parameters used in the above two equations represent the DWT decomposition which is used up to level 4, so J=4 ; while the length of the discrete EEG (4) Ai = 1 √M �nX(n).ϕj,k(n ) (5) D i = 1 √M �nX(n).φj,k(n ) signal x[n] is denoted with M. Likewise, the value of n=0, 1, 2, ..., M−1 ; and the value of j=0, 1, 2, ..., J−1 ; and value of k=0, 1, 2, ..., 2j−1 . The outputs of DWT decomposition including the last approximation (Ai=4) and all the detailed coefficients (Di=1,2,3,and4) are denoted with Djk and diminished after using a certain threshold value α which discarded the non-significant coefficients. The reconstructed signal is ensured to have more than 99% energy after using the threshold value α . Here the variables Xr represents the restored EEG signal and X refers to the original EEG signal. The criteria reported for computation of threshold parameter (α) by Donoho and Johnstone [37] is used, where the standard deviation of the noise (unwanted signal) is estimated by considering the last level of the detailed coefficients vector. Moreover, hard thresholding is used and the threshold value (α) is expressed as follows: (6) D jk = Djk, if |Djk |≥ α , 0, if | Djk |<α, (7) Energy (E)=(100×�Xr� 2 2) � X � 2 2 > 99% Classifiers SVM with RBF, and kNN provides Classification of visual events (target and standard) from ERPs DWT is applied up-to 4th level with Biorthogonal B-Spline mother wavelet, to decompose the signals into coefficients The wavelet coefficients are reduced by threshold, such that the reconstructed signal retained more than 99% energy Discrete Wavelet Decomposition Thresholding Classifiers’ Performance Evaluation (AUC, accuracy etc.) Classifier with Leave-One-Out (LOO) cross validation Huffman Coding and Computation of ERP Features Iterated the training and testing of the classifiers and computed the average values of performance metrics The optimum DWT coefficients are encoded into bitstreams using Huffman Coding, and compute the ERP Features DWT Decomposition Features Computation Features Classification Pre-Processed EEG Fig. 3 Illustration of the proposed method for single-trial analysis and classification of visual events
Page 8 of 17 Aminetal. Journal of NeuroEngineering and Rehabilitation (2023) 20:70 Here, the number of wavelet coefficients that exist in the last level of detailed (D4) is indicated with N. The value of σ is computed which is based on the median absolute deviation and expressed here as, Here, in the above equation, the term in the denominator reflects the scale factor, depending on the distribution of Djk , for normally distributed data the value is equal to 0.6745; while Djk represents the wavelet coefficients in the last level of the detailed coefficients. Accordingly, the use of a threshold parameter ensured the quality of the reconstructed EEG signal, which is obtained after discarding the non-significant coefficients. The thresholded DWT coefficients, denoted with D jk , are rounded off to the nearest integer, represented as Djk . (8) α= σ 2logN (9) σ= median| Djk | 0.6745 The rounded-off DWT coefficients D jk are converted into bitstreams by using the Huffman coding technique. In Huffman coding, the whole sequence of DWT coefficients D jk is assigned a codeword. The Huffman codewords represent the single-trial waveform in a compressed form. The size of DWT coefficients is reduced, resulting in a compressed single trial of the EEG signal. Accordingly, the DWT coefficients’ size is compacted, and subsequently, the signal is compressed. Finally, the Huffman coding output bitstreams provide the computation of features denoted with F as follows: Where, (10) F= 1 CR ×100 (11) CR = (x) (xc) 22 g[n] h[n] 22 g[n] h[n] 22 g[n] h[n] 22 g[n] h[n] x[n] d1: L1 detailed Coefficients Data: 80 points Freq: 62.5~125 Hz d2: L2 detailed Coefficients Data: 45 points Freq: 31.25~62.5 Hz d3: L3 detailed Coefficients Data: 28 points Freq: 15.625~31.25 Hz d4: L4 detailed Coefficients Data: 19 points Freq: 7.812~15.625 Hz a4: L4 Approx. Coefficients Data: 19 points Freq: 0~7.812 Hz a3: L3 Approx. Coefficients Data: 28 points Freq: 0~15.625 Hz a2: L2 Approx. Coefficients Data: 45 points Freq: 0~31.25 Hz a1: L1 Approx. Coefficients Data: 80 points Freq: 0~62.5 Hz x[n] a 0 : L0 Approximation Coefficients Single trial band pass EEG Data: 150 Points Freq: 0~125 Hz Fig. 4 Fourth-level DWT Decomposition, where d1 refers to detailed coefficients and a1 denotes the approximation coefficients at level 1, L refers to level, Freq. stands for frequency in hertz
Page 9 of 17 Aminetal. Journal of NeuroEngineering and Rehabilitation (2023) 20:70 Here, (x) represents the size of orignal ERP signal, and (xc) reflects the size of compressed ERP signal. This process is iterated for each participant’s data, including all the channels, visual events (target and standard), and trials. The feature matrix F for a single subject for each visual event can be represented as: where, m denotes the number of trials for the target or standard event and n represents the number of channels. The literature reported the wavelet decomposition for various applications of EEG classification with different levels, for instance, level 3, level 4, or higher [19, 38]. It is further reported that the range of basic EEG rhythms, including delta, theta, alpha, beta, and gamma waves, correspond to DWT coefficients located in D1 to D4 and A4 [38]. Thus, level 4 is chosen for DWT decomposition because of the corresponding frequencies in the EEG signals collected in this study. Moreover, it was observed that the number of wavelet coefficients that can be discarded without disturbing the quality of EEG signals was (12) F = 1··· n . . ..... . . m ··· m × n high in decomposition level 4, which allowed only thirty percent of the wavelet coefficients for the reconstruction of the original signal while retaining 99% of the signal energy. However, examining higher than four levels of DWT decomposition did not produce a significant rise in the number of discarded wavelet coefficients, see, Fig.6 shows an average ERP from 40 trials of one subject at Pz location for target trials and standard trials. Also, displays five trials for a single trial bandpass EEG signal (black), and the superimposed reconstructed ERP signal from optimum wavelet coefficients (red) of one subject at Pz both for target and standard trials. Machine learning classifiers andcross‑validation Machine learning classifiers are functions taking input data as independent variables and making predictions about the input data corresponding to the relevant class, the data points belong to [39]. To determine the efficiency of the proposed method in ERP single trials classification, we have used two machine learning classifiers: k-nearest neighbors (k-NN) with k=5 ; and Support Vector Machine (SVM) with radial basis function (RBF). Both classifiers are supervised learning techniques. The k-NN works to find a testing sample’s Fig. 5 Bi-orthogonal B-Spline mother wavelet (bior3.5) analysis and synthesis
Page 16 of 17 Aminetal. Journal of NeuroEngineering and Rehabilitation (2023) 20:70 Conclusion This paper demonstrated an efficient and automatic method for single-trial ERP analysis and classification of visual events in the object detection task. The method is based on the optimum coefficients of the discrete wavelet transform and the Huffman coding technique. The performance of the proposed method is evaluated with real EEG experimental data for visual object detection tasks and showed robust feature extractions for single-trial ERPs from background noisy EEG and the classification of targets vs. standard trials with the machine learning classifiers. The proposed method allows studying singletrial visual evoked responses and discrimination of visual events. ERPs are an established way of conducting cognitive neuroscience research and related disciplines. Many research studies have reported using ERPs to study the brain’s functions, different states, and pathologies. The proposed method for single-trial ERPs analysis with a machine learning approach, such as ensemble use of discrete wavelet transform with the Huffman coding, would allow robust feature extraction for single trials classification and further would assist in the data analysis that may give new insights into studying the sensory and cognitive processes in the healthy and affected brain. This method may be implemented in the future for real-time systems, such as BCI applications for detecting and discriminating different motor and cognitive events. Acknowledgements Not applicable. Author contributions HUA and ASM designed the experiment and collected the data and analyzed it. HUA, RU, developed the feature extraction method and did a simulation. ASM and MFR performed the interpretation of the results and drafted the manuscript. All authors read and approved the final manuscript. Funding This work was supported by the Brno University of Technology under project number FIT-S-23-8141, and a pump-priming internal grant from the University of Nottingham, Malaysia. The authors, therefore, acknowledge with thanks the financial support. Availability of data and materials The experimental data can be accessed by requesting the corresponding author through email. Declarations Ethics approval and consent to participate This analysis is part of a research study that was approved by the Human Research Ethics Committee, Universiti Sains Malaysia [28]. All the participants signed a written informed consent document for participation. Consent for publication All the participants provided written and informed consent for the publication of the data and relevant findings. Competing interests The corresponding author declares on behalf of all authors that there is no conflict of interest. Author details 1 School of Computer Science, Faculty of Science and Engineering, University of Nottingham, Jalan Broga, 43500 Semenyih, Malaysia. 2 Department of Computer and Information Sciences, Universiti Teknologi PETRONAS, 32610 Seri Iskandar, Malaysia. 3 Department of Neurosciences, School of Medical Sciences, Hospital Universiti Sains Malaysia, Kubang Kerian, 16150 Kota Bharu, Malaysia. 4 Faculty of Information Technology, Brno University of Technology, Brno, Czech Republic. Received: 17 May 2022 Accepted: 19 April 2023 References 1. Wirth C, Dockree PM, Harty S, Lacey E, Arvaneh M. Towards error categorisation in BCI: single-trial EEG classification between different errors. J Neural Eng. 2019;17(1): 016008. 2. Vanderperren K, Mijović B, Novitskiy N, Vanrumste B, Stiers P, Van den Bergh BR, Lagae L, Sunaert S, Wagemans J, Van Huffel S, et al. Single trial ERP reading based on parallel factor analysis. Psychophysiology. 2013;50(1):97–110. 3. Quiroga RQ, Atienza M, Cantero J, Jongsma M. What can we learn from single-trial event-related potentials? Chaos Complexity Lett. 2007;2(2):345–63. 4. Makeig S, Westerfield M, Jung T-P, Enghoff S, Townsend J, Courchesne E, Sejnowski TJ. Dynamic brain sources of visual evoked responses. Science. 2002;295(5555):690–4. 5. Guo J, Zhang Y, Chen L, Xu L, Mo X. Biocompatibility evaluation of electrospun PLCL/fibrinogen nanofibers in anterior cruciate ligament reconstruction. Sheng Wu Yi Xue Gong Cheng Xue Za Zhi. 2022;39(3):544–50. 6. Blankertz B, Lemm S, Treder M, Haufe S, Müller K-R. Single-trial analysis and classification of ERP components–a tutorial. Neuroimage. 2011;56(2):814–25. 7. Lemm S, Curio G, Hlushchuk Y, Muller K-R. Enhancing the signalto-noise ratio of ICA-based extracted ERPS. IEEE Trans Biomed Eng. 2006;53(4):601–7. 8. Malik AS, Amin HU. Designing EEG experiments for studying the brain: design code and example datasets. Cambridge: Academic Press; 2017. 9. Amin HU, Malik AS, Kamel N, Chooi W-T, Hussain M. P300 correlates with learning & memory abilities and fluid intelligence. J Neuroeng Rehabil. 2015;12(1):1–14. 10. Kotowski K, Ochab J, Stapor K, Sommer W. The importance of ocular artifact removal in single-trial ERP analysis: the case of the n250 in face learning. Biomed Signal Process Control. 2023;79: 104115. 11. Ferree TC, Luu P, Russell GS, Tucker DM. Scalp electrode impedance, infection risk, and EEG data quality. Clin Neurophysiol. 2001;112(3):536–44. 12. Qazi E-u-H, Hussain M, Aboalsamh H, Malik AS, Amin HU, Bamatraf S. Single trial EEG patterns for the prediction of individual differences in fluid intelligence. Front Hum Neurosci. 2017;10:687. 13. Zhang G, Li X, Lu Y, Tiihonen T, Chang Z, Cong F. Single-trial-based temporal principal component analysis on extracting event-related potentials of interest for an individual subject. J Neurosci Methods. 2023;385: 109768. 14. Rostro-Gonzalez H, Cessac B, Viéville T. Parameter estimation in spiking neural networks: a reverse-engineering approach. J Neural Eng. 2012;9(2): 026024. 15. Qin Y, Zhan Y, Wang C, Zhang J, Yao L, Guo X, Wu X, Hu B. Classifying fourcategory visual objects using multiple ERP components in single-trial ERP. Cogn Neurodyn. 2016;10:275–85. 16. Zhang R, Zeng Y, Tong L, Shu J, Lu R, Yang K, Li Z, Yan B. Erp-wgan: a data augmentation method for EEG single-trial detection. J Neurosci Methods. 2022;376: 109621. 17. Parashiva PK, Vinod AP. Single-trial detection of EEG error-related potentials using modified power-law transformation. Biomed Signal Process Control. 2021;67: 102563. 18. Amin HU, Yusoff MZ, Ahmad RF. A novel approach based on wavelet analysis and arithmetic coding for automated detection and diagnosis of epileptic seizure in eeg signals using machine learning techniques. Biomed Signal Process Control. 2020;56: 101707.
Page 17 of 17 Aminetal. Journal of NeuroEngineering and Rehabilitation (2023) 20:70 • fast, convenient online submission • thorough peer review by experienced researchers in your field • rapid publication on acceptance • support for research data, including large and complex data types • gold Open Access which fosters wider collaboration and increased citations maximum visibility for your research: over 100M website views per year • At BMC, research is always in progress. Learn more biomedcentral.com/submissions Ready to submit your research Ready to submit your research ? Choose BMC and benefit from: ? Choose BMC and benefit from: 19. Amin HU, Malik AS, Kamel N, Hussain M. A novel approach based on data redundancy for feature extraction of EEG signals. Brain Topogr. 2016;29:207–17. 20. Ahmadi M, Quiroga RQ. Automatic denoising of single-trial evoked potentials. Neuroimage. 2013;66:672–80. 21. Nagel S, Dreher W, Rosenstiel W, Spüler M. The effect of monitor raster latency on VEPS, ERPS and brain-computer interface performance. J Neurosci Methods. 2018;295:45–50. 22. Abibullaev B, Zollanvari A. Learning discriminative spatiospectral features of ERPS for accurate brain-computer interfaces. IEEE J Biomed Health Inform. 2019;23(5):2009–20. 23. Changoluisa V, Varona P, Rodríguez FDB. A low-cost computational method for characterizing event-related potentials for BCI applications and beyond. IEEE Access. 2020;8:111089–101. 24. Ahmad RF, Malik AS, Kamel N, Reza F, Amin HU, Hussain M. Visual brain activity patterns classification with simultaneous EEG-FMRI: a multimodal approach. Technol Health Care. 2017;25(3):471–85. 25. Purwar S, Tripathi R, Barwad AW, Dinda A. Detection of mesangial hypercellularity of MEST-C score in immunoglobulin a-nephropathy using deep convolutional neural network. Multimed Tools Appl. 2020;79:27683–703. 26. Purwar S, Tripathi RK, Ranjan R, Saxena R. Detection of microcytic hypochromia using CBC and blood film features extracted from convolution neural network by different classifiers. Multimed Tools Appl. 2020;79:4573–95. 27. Purwar S, Tripathi R, Ranjan R, Saxena R. Classification of thalassemia patients using a fusion of deep image and clinical features. In: 2021 11th International Conference on Cloud Computing, Data Science & Engineering (Confluence), IEEE 2021; pp. 410–415. 28. Amin HU, Ousta F, Yusoff MZ, Malik AS. Modulation of cortical activity in response to learning and long-term memory retrieval of 2D verses stereoscopic 3S educational contents: evidence from an EEG study. Comput Hum Behav. 2021;114: 106526. 29. Polich J. Updating p300: an integrative theory of P3a and P3b. Clin Neurophysiol. 2007;118(10):2128–48. 30. Huettel SA, McCarthy G. What is odd in the oddball task? Prefrontal cortex is activated by dynamic changes in response strategy. Neuropsychologia. 2004;42(3):379–86. 31. Schneider W, Eschman A, Zuccolotto A. E-Prime: User’s Guide. Reference guide. Getting started guide. Psychology Software Tools, Incorporated, 2002. 32. Dimigen O. Optimizing the ICA-based removal of ocular EEG artifacts from free viewing experiments. Neuroimage. 2020;207: 116117. 33. Grossmann A, Morlet J. Decomposition of hardy functions into square integrable wavelets of constant shape. SIAM J Math Anal. 1984;15(4):723–36. 34. Polikar R, Topalis A, Green D, Kounios J, Clark CM. Comparative multiresolution wavelet analysis of ERP spectral bands using an ensemble of classifiers approach for early diagnosis of alzheimer’s disease. Comput Biol Med. 2007;37(4):542–58. 35. Quiroga RQ, Garcia H. Single-trial event-related potentials with wavelet denoising. Clin Neurophysiol. 2003;114(2):376–90. 36. Subasi A. EEG signal classification using wavelet feature extraction and a mixture of expert model. Expert Syst Appl. 2007;32(4):1084–93. 37. Donoho DL, Johnstone IM. Ideal spatial adaptation by wavelet shrinkage. Biometrika. 1994;81(3):425–55. 38. Chen L-L, Zhang J, Zou J-Z, Zhao C-J, Wang G-S. A framework on waveletbased nonlinear features and extreme learning machine for epileptic seizure detection. Biomed Signal Process Control. 2014;10:1–10. 39. Pereira F, Mitchell T, Botvinick M. Machine learning classifiers and FMRI: a tutorial overview. Neuroimage. 2009;45(1):199–209. 40. Wong T-T. Performance evaluation of classification algorithms by k-fold and leave-one-out cross validation. Pattern Recogn. 2015;48(9):2839–46. 41. Blázquez-García A, Conde A, Mori U, Lozano JA. A review on outlier/anomaly detection in time series data. ACM Comput Surv. 2021;54(3):1–33. 42. Shapiro SS, Wilk MB. An analysis of variance test for normality (complete samples). Biometrika. 1965;52(3/4):591–611. 43. Lee WL, Tan T, Falkmer T, Leung YH. Single-trial event-related potential extraction through one-unit ICA-with-reference. J Neural Eng. 2016;13(6): 066010. 44. Mancini F, Pepe A, Bernacchia A, Di Stefano G, Mouraux A, Iannetti GD. Characterizing the short-term habituation of event-related evoked potentials. ENeuro. 2018. https:// doi. org/ 10. 1523/ ENEURO. 001418. 2018. 45. Lindín M, Zurrón M, Díaz F. Stimulus intensity effects on P300 amplitude across repetitions of a standard auditory oddball task. Biol Psychol. 2005;69(3):375–85. 46. Ouyang G, Sommer W, Zhou C. Reconstructing ERP amplitude effects after compensating for trial-to-trial latency jitter: a solution based on a novel application of residue iteration decomposition. Int J Psychophysiol. 2016;109:9–20. 47. Spencer KM. 10 averaging, detection and classification of single-trial ERPS. Event related potentials. A methods handbook, 2005; pp. 209–228. 48. Thornton ARD. Evaluation of a technique to measure latency jitter in event-related potentials. J Neurosci Methods. 2008;168(1):248–55. 49. Ouyang G, Sommer W, Zhou C. Updating and validating a new framework for restoring and analyzing latency-variable ERP components from single trials with residue iteration decomposition (ride). Psychophysiology. 2015;52(6):839–56. 50. Effern A, Lehnertz K, Fernandez G, Grunwald T, David P, Elger C. Single trial analysis of event related potentials: non-linear de-noising with wavelets. Clin Neurophysiol. 2000;111(12):2255–63. 51. Quiroga RQ. Obtaining single stimulus evoked potentials with wavelet denoising. Physica D. 2000;145(3–4):278–92. 52. Kosciessa JQ, Grandy TH, Garrett DD, Werkle-Bergner M. Single-trial characterization of neural rhythms: potential and challenges. Neuroimage. 2020;206: 116331. 53. Rajasekar P, Pushpalatha M. Huffman quantization approach for optimized EEG signal compression with transformation technique. Soft Comput. 2020;24:14545–59. Publisher’s Note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.