Keywords

1 Introduction

Chan, or Dhyāna in Sanskrit, is a school of Mahāyāna Buddhism, which means “meditation”. The literal meaning of Chinese character Chan (禅) is transfer of the sovereign power. In Chan Buddhism, Chan means the transfer of Dharma eye, or prajna, which can be roughly interpreted as insightful wisdom. Chan has played an important role in the history of Eastern countries. In modern societies, Chan has also shown direct effects on people’s physical and psychological conditions.

Meditation is an essential part of Chan practice, and the primary way to achieve Chan state. Chan requires that the practitioners watch their thoughts at every moment, allowing them to arise and pass away without interference. This methodology, which is termed mindful meditation, is the most effective way to regulate one’s mind.

The four Dhyanas (catvari-dhyanani) theory clearly depicts the procedure of meditation in four stages, viz., the first Dhyana through the fourth Dhyana, named below.

  1. 1.

    First Dhyana: Bliss Born of Separation: One’s pulse stops, but this doesn’t mean one is dead. This brings a particular happiness which is unknown to those in the world.

  2. 2.

    Second Dhyana: Bliss Born of Samadhi (proper concentration and proper reception): One’s breathe stops. There is no detectible breathing in and out, but at that time an inner breathing takes over.

  3. 3.

    Third Dhyana: Wonderful Happiness of Being Apart from Bliss: One renounces the dhyana-bliss as food and the happiness of the Dharma that occurs in initial samadhi. One goes beyond that kind of happiness and reaches a sense of wonderful joy. It is something that one has never known before, that is inexpressible in its subtlety, and that is inconceivable.

  4. 4.

    Fourth Dhyana: Clear Purity of Casting Away Thought: In the Third Dhyana thoughts were stopped–held at bay–but they still had not been renounced altogether. In the heavens of the Fourth Dhyana, not only are thoughts stopped, they are done away with completely. There basically are no more cognitive considerations. This state is extremely pure, subtly wonderful, and particularly blissful.

(http://www.bhaisajyaguru.com/buddhist-ayurveda-encylopedia/four_dhyanas_sz-chan_sz-jing-chu_catvari-dhyanani_jhana.htm)

Patriarch Zhi Kai (智凯, AC 523-597), the first patriarch of the Tiantai School, gave the detailed methods of Dharma practice for each Dhyana stage with specific state of mind, the realm of sensory perspectives, possible interaction with spiritual beings, and methods to avoid deviations from the right path.in each stage [1]. His book has been used as guidance for meditation ever since.

While each Dhyana has specific bodily manifestations, four Dhyanas is actually very high achievement level in meditation practice and not so many meditators can achieve the four Dhyana levels. Therefore, in order to develop a physiological model of “meditation” state of common people, we have to use data analytics methods to test one’s proficiency level of meditation.

As accomplishments in Chan entail good behaviors and self-control, the effects of meditation may be reflected by mental health indicators, e.g., lust, anger, fear, cautiousness, balance in personality, etc., and these health indicators may be measurable by using psychological indicators, e.g., Functional Assessment of Cancer Therapy—General (FACT-G) [2], which consists of four subscales assessing physical well-being, social well-being, emotional well-being, and functional well-being. Another metric is Profile of Mood State, which measures mood [3]. Mruk & Hartzell, analyzed the therapeutic value of meditation and proposed six Zen (Japanese term of meditation) principles of psychotherapeutic value: acceptance (suffering), fearlessness (courage), truth (enlightenment), compassion (toward self and others), attachment (desire), impermanence (letting go) [4]. In addition, Zen is analyzed against the phenomenology of traditional psychotherapy in the biological approach, the learning theories, the cognitive approach, the psychodynamic perspective, and the humanistic approach.

The presentation of this paper will be as follows. In the second section, we will review how electroencephalogram (EEG) can be used to measure brain states. We will also discuss the feasibility of measuring meditation using EEG data by examining some sample data. In the third section, we will present the experimental results we have obtained. We will give concluding remarks in the end.

2 Brain State Detection Using EEG Data

Since the renowned scientist Galvani discovered electrical activity in living organism in the 18th century [5], EEG has been becoming a popular non-invasive technique to record brain activity in clinical and research settings. Hans Berger is the first electro physiologist who successfully recorded electrical activity from the human brain by measuring voltage oscillations due to ions flow in the neurons of the brain. Nowadays, EEG data have been widely used in various areas including human computer interaction, neurological sciences, and psychology. Recent development in data analytics aroused interests in brain state detecting by applying machine learning algorithms to EEG data. Using mathematical models and computing technology, scientists tried to decipher the complex relationship between brain activities and brain waves generated during those brain activities.

Brain waves are classified into five major waves, each linked to certain brain activities (Table 1). For example, Beta waves are associated with consciousness, while alpha waves are indicators of disengagement [6]. Theta waves are often shown in motionless but alert state [7], and finally, Delta waves are related to sleeping.

Table 1. Brainwave frequencies

In the study of brain-computer interaction (BCI), Yang et al. have proposed some novel feature extraction method to classify left and right hand motor imagery [8]. They have achieved 90% recognition accuracy in the separation of the classes extracted by proposed method. In a different study, Zhuang et al. analyzed the spectrum brain waves using specific music stimulus and various statistical models [9]. This study showed the positive correlation between upper alpha wave generation and memory formation in the brain.

EEG is also used in healthcare and biomedical research. Studies have been done to discover links between emotional states and brain activities using machine learning algorithms [10]. By analyzing EEG data collected during various emotional states from 40 Parkinson disease patients and healthy subjects using bispectrum feature, Yuvaraj et al. concluded that the higher frequency bands such as alpha, beta and gamma played important role in determining emotional states compared to lower frequency bands, delta and theta. In a different study, Direito et al. designed a model to identify the different states of the epileptic brain using topographic mapping relative to delta, theta, alpha, beta and gamma frequency [11]. The method achieved 89% accuracy in predicting abnormal vs normal brain states. These studies have revealed the variability in analysis due to two factors, viz., the feature extraction methods and the number of variables used in modeling. It is found that the model is directly proportional with the increase in the constant variables associated with the modeling equation.

Research pertaining to meditation generally can be classified into two major types. The first types involves using statistical tools to analyze the feedback, either objective or subjective, from the subjects, and find effects of meditation. The second type tries to find physiological indicators during the meditation practice [12]. One example of the first type is to study finite differences within the minds of those practicing meditation, and those who do not. Loizzo et al. performed a 20-week contemplative self-healing program study, which showed that a contemplative self-healing program can be effective in significantly reducing distress and disability among the testers [13]. Lengacher et al. performed a 6-week mindfulness-based stress reduction program, in which subjects demonstrated significant improvements in psychological status and quality of life compared with usual care [14]. In another study using EEG technologies, a group of Qigong practitioners were compared to a control group. Positive impact on the quality of life of cancer patients were observed [15].

Our research presented in this paper falls into the second type of the approaches. We focus on the statistical classification methods to analyze EEG collected from different brain states to build a model, and then use the model to test EEG data to find out the subject’s brain state. We consider using feature extractions from raw EEG data to improve the correct classification rates. Given that different areas of human’s brain exhibit different features while the brain stays in the same state [16], and sometimes EEG record also changes spontaneously [17], multiple statistical classification methods are used in analyzing EEG data. Supervised machine learning models include tree bagging, boost [18], random forest [19], and support vector machine [20]. We also used unsupervised machine learning algorithms, such as hierarchy clustering. Moreover, entropy was used as features of EEG data to improve the classification rates. For example, sample entropy measures the uncertainty inside a sequence of data [21]. We explored the effects of different types of entropy.

We measured an experienced meditator’s brainwaves while meditating and compared them to several other states including idle and talking. We found prominent differences between the experienced meditator’s brainwaves and those of other states. The experienced meditator’s brainwaves clearly displayed a stable state most of the time, as shown in Fig. 1(a), except for some certain times after the initial meditation stage, when extraordinary high waves were observed, as shown in Fig. 1(b).

Fig. 1.
figure 1

Experienced meditation

Figure 2 shows the brainwaves of idle, talking, and meditating from an inexperienced meditator. We can clearly see that the irregularities of these states are higher than the experienced meditator’s state, especially the idle and the talking states. The inexperienced meditator showed some similarity to the state shown in Fig. 1(a) but it didn’t show the features in Fig. 2(b). This initial study indicates that trained meditators can demonstrate regularity during meditation practice.

Fig. 2.
figure 2

Other states

In the following section, we demonstrate the results of the state classification using machine learning algorithms and feature extractions.

3 Identifying Meditation State

The regularity observed in the brain waves of meditation state suggests that entropy might be a right feature to use in the classification of brain states including meditation state. Entropy was introduced to calculate complexity or regularity of the real world in 1991 [22]. Shannon entropy is the basis of various types of entropy calculations. Approximate entropy (ApEn) was introduced as an approximation of entropy estimation for the imperfect biological data, while sample entropy (SampEn) is intended to measure the order in a time series [23].

The machine learning algorithms we use to classify EEG data are tree bagging, support vector machine (SVM), and Gaussian Mixture Model (GMM).

Tree bagging, or decision tree bootstrap aggregation, is an algorithm based on decision tree. It was proposed by Leo Breiman in 1994 to improve the classification by combining classifications of randomly generated training sets [24].

A Support vector machine (SVM) is a discriminative classifier formally defined by a separating hyperplane. Its kernel function projects data from a lower dimensional space to a higher dimensional space, thus gives the algorithm more flexibility comparing to other linear classification algorithms. This algorithm creates the boundary that achieves the least misclassified training data. The data located near the boundary are referred to as support vectors, as they are crucial for boundary determination [25].

A Gaussian mixture model (GMM) is a parametric probability density function represented as a weighted sum of Gaussian component densities [26].

We collected EEG data from subjects in three brain states, viz., idle, meditating, and talking, using Emotiv EPOC headsets. We used the well-contacted channels (AF3, F7, T7, O2, T8, F8, AF4, shown in Fig. 3, to ensure the quality of the EEG data. Based on our previous work, when we use tree bagging, we set number of trees equal to 2500, and we use linear kernel in support vector machine [27].

Fig. 3.
figure 3

Emotiv EPOC headset nodes

We firstly used approximate entropy as a feature in the machine learning procedure. We have misclassification rate of the three above methods in Table 2. Parameters are chosen by finding the largest mean of Hurst exponents of data. For GMM, we used EEE model type, which gave the least misclassification rate. This is also because approximate entropy from different channels had similar variances.

Table 2. Misclassification rates using approximate entropy

We can see that when time length is 10 s and embedding lag is 4, we have the smallest misclassification rate, which is around 4% given by either tree bagging or support vector machine. Compared to some of our previous misclassification results without using entropy (30% in [27]), this is significant improvement. Table 2 also shows that when using approximate entropy, the misclassification rate does not necessarily decrease when the time length increases. It is also observed that tree bagging has a higher likelihood to give the smallest misclassification rate.

We further test similar parameters and classification models using sample entropy. Unlike approximate entropy, which is an estimation of the true entropy, sample entropy tends to measure the level of chaotic complexity of a time series data. Our misclassification results can be seen in Table 3. It can be observed that for sample entropy the misclassification rates decrease when the time length increases. This makes sense according to the nature of sample entropy.

Table 3. Misclassification rates using sample entropy

We exhibit the plots of sample entropy with different time lengths and embedding lags in Fig. 4. In the plots, the sample entropy in talking is represented by triangles. Circles stand for the sample entropy in mediation, and rectangles are sample entropy in the idle state. Black filled shapes mark the misclassified data. We can see that with the increasing time length, sample entropy from different brain states tend to be more separated. We also notice that embedding lag becomes less influential when time length increases. Tree bagging, again, gives the smallest misclassification rates in most cases. Comparing our results from approximate entropy with those from sample entropy, we can see that sample entropy provide a more solid base to classify different brain states when using original EEG data.

Fig. 4.
figure 4

Sample entropy with different parameters. A. time = 1 s lag = 4 B. time = 1 s lag = 1 C. time = 30 s lag = 4 D. time = 10 s lag = 4 E. time = 60 s lag = 4 F. time = 60 s lag = 6

We further explored the use of discretized EEG data. A discretization method divides an attribute with continuous value into several intervals on amplitude axis, each interval is labeled with a different value, and all the data within an interval are assigned to the value of the interval’s label. We split the data into K intervals of the same range and label each range with a level, from 0 to K − 1. Therefore, continuous data are transformed into discrete data. We then calculate approximate entropy based on discretized data, and use the same techniques to classify different brain states. Based on our aforementioned results, we choose to use lag = 4 when we calculate approximate entropy. Figure 5 shows the comparison between the approximate entropy calculated from original (continuous) EEG data (Fig. 5(A)) and that calculated from discrete EEG data (Fig. 5(B)). Here we use time = 10 s, lag = 4; for B, K = 40. We can see that after discretization, approximate entropy calculated from EEG data exhibits less overlapping. We expect decreased misclassification rates using discretized data.

Fig. 5.
figure 5

Approximate Entropy with continuous (A) and discrete (B) EEG data. Blue circles – idle; green triangles – meditation; red rectangles - talk (Color figure online)

The misclassification rates are in Table 4, which confirms our prediction.

Table 4. Misclassification rates using approximate entropy with discretization

We can also see that with the increase of time length, misclassification rates decrease. It also appears that increasing discretization level does not necessarily decrease misclassification rates, suggesting that information redundancy could lead to confusion. Overall, tree bagging is the best performed algorithm, which is consistent with our previous observation.

Moreover, discretization of EEG data makes using Shannon entropy for classification possible, given the fact that, comparing to approximate entropy or sample entropy, Shannon entropy is more likely to work on discrete cases. Calculation of Shannon entropy is also faster than either calculating approximate entropy or sample entropy. Based on our previous results, we choose K = 40, time = 30 s. Misclassification rates given by tree bagging, GMM, and SVM are 0, 0.043, and 0.022, respectively. We present Shannon entropy on different channels in Fig. 6. We can see that there is a clear pattern of Shannon entropy calculated from different brain states.

Fig. 6.
figure 6

Shannon entropy with discrete EEG data. Blue circles – idle; green triangles – meditation; red rectangles - talk (Color figure online)

4 Conclusion

Meditation is a well-defined method for psychological and physical wellness training through the histories of multiple cultures. However, given the difficulty of reaching deep meditating state, how to define meditation state using physiological data, especially within practitioners below the master level, remains a research topic. In this paper, we present an experiment of using EEG data to classify meditation from other states. Our result shows that entropy is a great tool for this purpose, given the fact that the brain waves during meditation state tend to show greater regularity. The use of entropy decreases the misclassification rates strikingly. Discretizing EEG data can also improve the classification results. Approximate entropy based on discretized EEG data enhances classification results. Classification based on Shannon entropy gives slightly higher misclassification rates but with significant less computational complexity. Overall, tree bagging gives the least misclassification rates in all the cases. Our experimental results suggest that measuring meditation state using EEG data is feasible.