Keywords

1 Introduction

In this paper, we focus on analyzing EEG data sets that stimulated by EEG motion detection or environment change; and using the optimized methods to recognize the EEG data patterns. Environment change generally refers to the environment that EEG lab participants stay in has been changed, which results in EEG status change. Through conducting sensory stimulation, the cerebral cortex corresponding to cognitive center will generate corresponding electrical activities to create recognizable EEG patterns.

Electroencephalogram (EEG) is a graph obtained by continuously amplifying the spontaneous biological potential of the brain with the aid of precise electronic instruments and recording the rhythmic and spontaneous electrical activity of brain cell group by electric motor. EEG’s most signification advantage is that it can record the change of brain wave during brain activity accurately, with a time resolution of 1 ms. The traditional EEG recognition adopts classification methods [1, 2].

Traditionally, EEG data analysis models have been utilized in studying the properties of cerebral and neural networks in neurosciences. In recent years, health informatics applications based on EEG have been successfully adopted in many fields, e.g. psychological research, physical recovery, robotic control, and so on [1,2,3].

The major disadvantages of EEG based methods can be briefly summarized as: (1) EEG analytical methods have poor spatial resolution, which cannot efficiently identify the location of the source of brain activity. (2) EEG signals are basically magnified signals, which normally can produce high noises. However, EEG-based models have the obvious advantages. The expanses of EEG equipment are much lower than MRI scanning and EEG is relatively tolerable to subject movements as compared to MRI. In addition, EEG caps can be flexibly applied to various applications. EEG based systems allow persons who are unable to make motor response to send signals. [1,2,3].

In this paper, we investigate motion actions induced EEG data. Our research indicates that motion actions can produce recognizable EEG patterns. In this research, EEG signals are acquired synchronously by EEG signal acquisition equipment; and the EEG signals are recorded. Relevant EEG signal characteristics are extracted and analyzed by corresponding signal analysis methods. This paper explores the research on the psychology and consciousness of users and their changing trend in different motion statues. Therefore, discovering consumers’ brain activities through on EEG analysis based on motion change or cognitive environment change, such as background music, is this paper’s major contribution and objective.

Existing EEG pattern recognition models are facing the challenging of dealing with time series data. In this paper, we propose an optimized model for EEG pattern recognition based on SEGPA [3]. The SEGPA model incorporates the clustering method, i.e. K-means, with logistic regression method for EEG pattern discovery.

Based on the above methods, the SEGPA model can dynamically adapt to the EEG recognition process, which can be more efficient than traditional classification methods. Currently, the SEGPA model is less efficient in dynamic adaptation and real time processing. The reminder of this paper is structured as follows. Section 2 reviews the existing research work on EEG-based classification and recognition. Section 3 proposes the optimized SEGPA model and the related methods used in the model. Section 4 provides the experimental design and analysis. The final section concludes the research findings.

2 Related Work

2.1 Classification Methods for EEG Analysis

Traditional classification methods for EEG recognition include linear discriminant analysis (LDA), regularized LDA and Support Vector Machines (SVMs), Neural networks (NN), Learning Vector Quantization (LVQ), Non-linear Bayesian classifiers, Bayes quadratic classifiers and hidden Markov models (HMMs), etc. However, the main challenges faced by classification methods for EEG recognition or BCI are the low signal-to-noise ratio of EEG signals and their nonstationarity over time among users [3,4,5,6,7], the limited amount of training data that is available to quantify the classifiers, and the overall low reliability and performance of current EEG pattern recognition and BCI data analysis [4, 8].

Bayesian classifier is a popular method for EEG analysis [4]. It is one of the classifiers with the least classification error probability or the least average risk at a given cost. Bayesian classifier is a statistical method. Its principle is to calculate the posterior probability of an object by using the Bayesian equation (as shown in Eq. 1); and select the category with the maximum posterior probability as the category of the object.

$$ p(c|a) = \frac{p(a|c)P(c)}{P(a)} $$
(1)

Bayes rule is about the conditional probability and marginal probability of random events A and B. Which Eq. 1 can be further extended as below. Non-linear Bayesian classifiers model the probability distributions of each class and use Bayes’ rule to select the class to assign to the current feature vector [3, 4].

$$ \begin{aligned} p(y|x_{1} , \ldots .,x_{n} ) = \frac{{p(x_{1} |y)p(x_{2} |y) \ldots p(x_{n} |y)p(y)}}{{p(x_{1} )p(x_{2} ) \ldots p(x_{n} )}} \hfill \\ \, = \frac{{p(y)\prod\nolimits_{i = 1}^{n} {p(x_{i} |y)} }}{{p(x_{1} )p(x_{2} ) \ldots p(x_{n} )}} \hfill \\ \end{aligned} $$
(2)

where P(C|A) is the possibility of occurrence of A when B occurs. A1, A2, …An is a complete event group. Pr(A|B) is the conditional probability of A after the occurrence of B, known as a posterior probability due to the value obtained from B.

Support vector machine (SVM) is a typical classifier for EEG classification, which classifies data according to supervised learning. Its decision boundary is the maximum margin hyperplane for learning samples. Least Square SVM (LS-SVM) is a variant of standard SVM. The difference between them is that LS-SVM does not use hinge loss function, but rewrites its optimization problem into a form similar to ridge regression. The optimization problems of soft margin SVM and LS-SVM are as follows.

$$ \begin{aligned} \mathop {max}\limits_{w,b} \frac{1}{2}\left\| w \right\|^{2} + C\sum\limits_{i = 1}^{N} {e_{i}^{2} } ,e_{i} = y_{i} - (w^{T} X_{i} + b) \hfill \\ s.t.\quad y_{i} (w^{T} X_{i} + b) \ge 1 - e_{i} \hfill \\ \end{aligned} $$
(3)

where the hyper-plane normal vector w is the only optimization objective. Given the input data and learning objective: x = {x1,…, xn}, y = {y1,…, yn}. SVM is a fast and dependable classification algorithm that performs efficiently with a relatively small amount of data.

2.2 New EEG Classification Methods and Other Methods

The research on emerging and novel classification algorithms studied in past ten years focus on addressing the major EEG recognition challenges. Specifically, the adaptive classifiers and their parameters are incrementally updated and developed to deal with EEG non-stationarity in order to track changes [4].

The parameters of adaptive classifiers, e.g. the weights attributed to each feature in a linear discriminant hyperplane, are incrementally re-evaluated and renewed when new EEG data sets are collected [4, 9]. Unsupervised deployment of classifiers is more difficult, due to the class labels is unknown. Therefore, unsupervised methods have been proposed to estimate the class labels of new samples before adapting classifiers based on their estimation [4].

Some new classification methods are introduced recently, such as FAHT (Fairness-Aware Hoeffding Tree). FAHT is an extension of the well-known Hoeffding Tree algorithm for decision tree induction over streams, that also accounts for fairness. It is able to deal with discrimination in streaming environments, while maintaining a moderate performance over the stream [10]. The splitting criterion of FAHT to consider the fairness gain of a potential split is expressed as below.

$$ fg(d,a) = \left| {disc(d)} \right| - \sum\limits_{v \in dom(a)} {\frac{{\left| {d_{v} } \right|}}{d}\left| {disc(d_{v} )} \right|} $$
(4)

where dv, v∈dom(a) are the partitions induced by A.

Some researchers have been working on graph-based EEG pattern recognition methods in recent years. In [11], the EEG selection process adopts the graph-based method, which aims to search maximum weight cliques for EEG analysis.

3 An Optimized Pattern Recognition Model for Online Education

The optimized EEG pattern recognition model is proposed in this paper through combining clustering methods with association rule methods based on the SEGPA model. The major steps of this model can be summarized into six major steps. Each step has dependency to its previous process, which are introduced below.

The SEGPA model introduced in the previous work [12] consists of five major steps: (1) EEG data segmentation; (2) optimized Piecewise Linear Approximation (PLA) or granular computing; (3) processed EEG K-means clustering; (4) Logistic classification results generation; and (5) EEG pattern recognition based on classification and intelligent agents. The SEGPA model utilizes the clustering algorithm to generate EEG data clusters and takes time series data dependency analysis into consideration based on Savit and Green [17]. The SEGPA model generalizes the δj’s that are sensitive to the assumption of j-dependence in k dimensions as below [17]:

$$ \delta_{j}^{[k]} = \frac{{C_{k} - (C_{j} /C_{j - 1} )^{k - j} C_{j} }}{{C_{k} }} = 1 - \left( {\frac{{C_{j} }}{{C_{j - 1} }}} \right)^{k - j} \frac{{C_{j} }}{{C_{k} }} $$
(5)

where δj denotes dependencies that are the result of averages over regions of a map.

The algorithm of the SEGPA pattern recognition is modified based on the previous graph-based EEG PR method; and the algorithm is listed as below:

figure a

3.1 EEG Segmentation and PLA/Granular Method

In the previous work, we discovered that a segment of a large data set with proper size will inherit the original data set’s characteristic [13]. EEG data sets follow Normal Distribution (ND) and Poisson Distribution (PD) in different statues. Based on this theory, splitting and extracting a smaller size of segment from a large EEG data set can still contain the crucial data information. In this way, the ND/PD based data splitting methods can be more efficient for dealing with large data sets [13].

The PDA/NDA segmentation procedures generate EEG data segments, which have been greatly minimized in size without much losing crucial information such as means, standard deviation, etc. A ND-based segmented EEG data example is shown as below (Table 1).

Table 1. Segmented EEG data based on ND model

The ND/PD segmentation methods are combined and deployed in the first stage in order to accommodate EEG real-time analytical requirements. EEG caps normally consist of multi-channels for data collection. Therefore, EEG data is a multivariate distribution issue. The multivariate ND f(z) is defined as follow.

$$ \begin{array}{*{20}l} {f (z )= \frac{ 1}{{ (\sqrt { 2\pi } )^{n} \sigma_{z} }}e^{{ - \frac{{z^{ 2} }}{ 2}}} ,\;z = \frac{x - \mu }{\sigma } ,} \hfill \\ {z^{ 2} = \frac{{ (x_{ 1} - \mu_{ 1} )^{ 2} }}{{\sigma_{ 1}^{ 2} }} + \frac{{ (x_{ 2} - \mu_{ 2} )^{ 2} }}{{\sigma_{ 2}^{ 2} }} \cdots + \frac{{ (x_{n} - \mu_{n} )^{ 2} }}{{\sigma_{n}^{ 2} }} ,} \hfill \\ {\;\;\;\;\;\;\;\;\;\;\sigma_{z} = \sigma_{ 1} \sigma_{ 2} \cdots \sigma_{n} } \hfill \\ \end{array} $$
(6)

where μ is the mean or expectation of the distribution, σ is its standard deviation, f(z) denotes multivariate distribution. The joint probability for a Multivariate Poisson distribution is a limiting distribution of binomial distribution B(N, pi) as N→∞ under the condition of N, pi = λt where λt is a non-negative fixed parameter.

The PD model in this paper adopts the Gamma function is employed for dealing with real and complex numbers, which is expressed as follows:

$$ \Upgamma (z) = \int_{0}^{\infty } {\left[ {\ln \left( {\frac{1}{t}} \right)} \right]}^{z - 1} dt $$
(7)

For a as integer n,

$$ \begin{aligned} \Upgamma (n,x) = (n - 1)!e^{ - x} \sum\limits_{k = 0}^{n - 1} {\frac{{x^{{_{k} }} }}{k!}} \hfill \\ \quad \quad \quad = (n - 1)!e^{ - x} e_{n - 1} (x) \hfill \\ \end{aligned} $$
(8)

where en(x) is the exponential sum function, which is implemented as Gamma[a, z] in the Wolfram Language.

The granular computing is an emerging concept and computing paradigm of information processing, covers all the theories, methods, technologies and tools related to granularity. It is mainly used for the intelligent processing of uncertain and incomplete fuzzy massive information. Some researchers have applied granular methods for data abstraction in order to reduce data volume. In this model, the optimal PLA method has been applied to reduce data volume and improve EEG recognition process for real-time processing. The optimal PLA computes slp[1, k] and \( \overline{\text{slp}} \)[1, k] by using incremental and localization strategies, which can be expressed as follows[14]:

$$ \left\{ \begin{aligned} \underline{slp} \left[ {1,k} \right] = \mathop {\hbox{max} }\limits_{a \le i \le d} \left\{ {\frac{{(y_{k} - \delta ) - (y_{i} + \delta )}}{{(x_{k} - x_{i} )}},\underline{slp} \left[ {1,k - 1} \right]} \right\}, \hfill \\ \overline{slp} \left[ {1,k} \right] = \mathop {\hbox{min} }\limits_{b \le i \le c} \left\{ {\frac{{(y_{k} + \delta ) - (y_{i} - \delta )}}{{(x_{k} - x_{i} )}},\overline{slp} \left[ {1,k - 1} \right]} \right\}. \hfill \\ \end{aligned} \right. $$
(9)

where slp [i, j] denotes the slope of a \( \delta \) - representative line on time slot[xi, xj]. \( \delta \) denotes the error bound for approximation (>0). (xi, yi) denotes at time slot xi with value yi.

The time complexity of Algorithm 1 is the sum of Aproiri time complexity and K-Means time complexity that is: O(2|D|) + O(n2), where |D| is the horizontal width (the total number of items) present in the data sets and n is the input data size. Equation 9 is the pre-processing phase for generating segmented EEG data sets for down stream processing, such as Algorithm 1 and other related procedures.

3.2 Combining K-means Clustering with Logistic Regression

The K-means clustering algorithm has been applied to the proposed model to generate the clusters that can distinguish the differences of various EEG instances. Table 2 shows the clustered EEG data instances based on K-means algorithm. The clustered instances are based on EEG data differentiation by time, i.e. the current EEG data point at time t minimizes the previous EEG data point at time t − 0.01.

Table 2. Clustered EEG data based on K-means algorithm

The main goal of K-means clustering is to segment n observations into k (≤n) clusters. The distance within each cluster is minimized, which can expressed in the following Eq. (10) [15]. The K-means algorithm begins with initial Κ centroids, which can be randomly generated or selected from the data set.

$$ \mathop {\arg \hbox{min} }\limits_{s} \sum\limits_{i = 1}^{k} {\sum\limits_{{x \in S_{i} }} {\left\| {x - \mu_{i} } \right\|^{2} = } } \mathop {\arg \hbox{min} }\limits_{s} \sum\limits_{i = 1}^{k} {\left| {S_{i} } \right|VarS_{i} } $$
(10)

where μi is the mean of points in Si; Si denotes a clustering set; x is a data item. The results are illustrated as below.

The clustering analysis can produce data sets according to centroids, which normally represents the average value of a cluster. We compare the EEG data sets collected from different EEG statuses using the clustering methods to distinguish the difference between different statuses. The clustering analysis is the initial step of EEG pattern analysis. The value distribution of centroids generates electrode recognizable and value bounded figures. The electrode recognizable figures meaning that independent electrodes have their recognizable electrode value change activities.

In order to further improve the SEGPA model efficiency; each node is assigned with pro-active and self-adaptive capability. We discovered that intelligent agents can efficiently fulfill the needs of the SEGPA model since multi-agent systems (MAS) promote the development of distributed applications in complex and dynamic environments to deal with complex problems [16]. The proposed new model aims combining MAS with SEGPA, which forms a multi-objective coordination model for brain research. Theoretically, the proposed model is efficient in terms of EEG data characteristic and brain activities.

4 Experimental Results

The experimental design and configuration are listed as follows. The collected EEG data instances are based on a 5–7 min online shopping simulation. The hardware and software configurations are: Windows 8 64-bit OS, Intel N3540 CPU, 4G RAM, C++ for ND segmentation software, Weka analytical software. The EEG recording time interval is 0.01 s for CONTEC KT88 used in this research. The lab environment and configurations are shown as below (Fig. 1).

Fig. 1.
figure 1

EEG lab settings and configuration.

Our online poll shows that 31.3% students would like to have some Artificial Intelligence (AI) related applications for assisting their studying. The poll further indicates that 65.4% students demand customized tutorials for their studies. The proposed EEG-based method could provide students with customized tutorials that can fulfill students’ demands specially during the COVID19 period.

The LR classifier in the SEGPA model has a relatively high accuracy because of the efficient K-means clustering process. The clustering process actually replaces discretization process, which categorizes discrete EEG data in certain range. The clustering process in this paper generates simple cluster numbers as inputs for LR classifier, which improves the classification results and efficiency.

The prediction for electron 1 based on other electrons’ EEG instances using LR classifier can achieve 97.3% accuracy. In this paper, we adopt one segment for experimental analysis. Mean absolute error is: 0.0174, total number of instances is: 1334. The classifier using 10 cross-validation mode can achieve 97.3% accuracy; the accuracy remains the same 97.3% accuracy through using training set mode.

Table 3 and 4 show the prediction for electron 1 and 5 based on electron 0–4 EEG instances using LR classifier can achieve 91.9% accuracy. Mean absolute error is: 0.0467, total number of instances is: 1334. The classifier using 10 cross-validation mode can achieve 91.9% accuracy; the accuracy can be improved to 92.12% through using training set mode.

Table 3. LR for electron 1 based on segmented EEG
Table 4. LR for electron 5 based on segmented EEG

The segmentation software generated 15 segments for each electrode. The LR classifier for each segment require 0.5 s by using training set mode and 0.7 s by using cross-validation mode.

The results of PLA experiments are based on the full size of the original full driving simulation data since we are going to assess the overall PLA performance. In practice, this data sets can be replaced by ND/Poisson segmented data sets. The PLA compressed results are shown as below. Due to space limitation, we only illustrate the PLA results of 6 electrodes. The original driving simulation EEG data and full PLA compression and ND segmented results can be acquired upon requests.

The optimized model based on the combination of ND/PD model and PLA process has achieved medium high accuracy performance and dramatic data reduction performance.

5 Conclusion

An optimized data analytical model has been introduced in this paper to identify statuses of brain activities and further discover potential patterns. The proposed model, the optimized SEGPA, incorporates optimized data processing methods and EEG-based analytical for EEG data analysis. In particular, the data segmentation techniques are incorporated in SEGPA model.

The experimental results show that EEG data sets can generate different results for ‘meditation’, ‘meditating-left-hand-rise’, ‘meditating-right-hand-rise’, ‘left-hand-rise’ and ‘right-hand-rise’. Based on various results, we discovered some preliminary patterns for analysis. The future work will focus on delivering more efficient algorithm for EEG pattern generation and improve the EEG experimental data variety. The combination of the Association Rule algorithm with clustering K-Means algorithm has demonstrated the efficiency in reducing EEG data size by clustering and establishing connections among EEG electrons by association. The results evident the efficiency of the combination.

This research proposes a potentially efficient method for recognizing human brain activities that can be used for machinery control. The experimental results reveal the high classification accuracy that reflects the efficiency of the proposed model for EEG data analysis based on the optimized sampling methods. Our future work may seek the possibility of utilizing graph-based method in EEG pattern recognition.