0115 966 7955 Today's Opening Times 10:00 - 20:00 (BST)

EEG-Based Processing Approach for Pain Detection

Published: Last Edited:

Disclaimer: This essay has been submitted by a student. This is not an example of the work written by our professional essay writers. You can view samples of our professional work here.

Any opinions, findings, conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views of UK Essays.

Abstract-To detect the pain based on EEG signals variability, several efforts has been made but no promising result has been achieved yet. In this study, we propose different features to classify pan. EEG signals of 28 healthy volunteers were recorded continuously while they experience pain through the known ice-water paradigm. To access the de-correlated EEG sources, Independent Component Analysis(ICA) scheme was used. Among them, the artifact and noise sources were removed and therefore pain dependent sources were determined and projected back. Before the classification, some features were extracted from the EEG signal. To select the best features, sequential forward selection (SFS) was applied which also eliminates the redundancy. The classification results provide 89% , 90% and 94% accuracy when one nearest neighbor (1NN), 3NN and support vector machine (SVM) were used, respectively.

Keywords: EEG sources, pain dependent features, entropy, feature selection.

  1. Introduction

Backonja et al. [1] proposed an ice-water bath as a gradual painful stimulus, termed as the cold presser test (CPT). in this study, CPT is applied as the pain inducing paradigm. Some studies, inveatigated the changes during pain. The result of some previous studies[2-5] was reported as an increase in the Delta and Beta bands and a decrease in the Alpha band during pain.

In another study, a tonic pain stimulus [6] increased the power of Delta, Beta-III and Gamma bands and decreased the Theta, Alpha-I and Alpha-II band powers. Intramuscular injection of hypertonic saline increases the Beta power[7]. In another research, inducing Capsaicin caused no significant change in the EEG bands. Another study implied changes of Alpha band activities interact in pain-perception process [8]. In another research, two levels of pain were classified by Naïve Bayes classifier which produces 86.3±8.4% classification accuracy [21]. In a different approach, fMRI images of the participants' brain were observed while they were experiencing pain by heat induction which resulted in 94% accuracy [9].

The most repeated findings of these studies is a general increase in the power of Beta band simultaneous to a decrease in the Alpha band with a possible coherence increases across different bands, as the brain response to pain.

In Section 2, the data recording and the preprocessing are explained; In Section 3, the methods are described in detail; in Section 4, the results are presented. Section 5 concludes the results.

  1. Data Recording and Preprocessing

2.1. Data Recording

For recording EEG signals, 30 electrodes were used by Scanlt EEG recording system. A cap based on 10-20 electrode placement system was used for recording. The impedance of all electrodes was less than 5 kilo ohms. The sampling rate was adjusted at 250 hertz and a bandpass filter with cut-off frequencies adjusted in 0.5 and 47 hertz was implemented to the signal.

In previous studies, laser, cuff pressure, hot/ice water, Electrocutaneous stimulation [10]-[13], have been used to induce pain. In this study, the ice-water (also called CPT) was selected to have minimum side-effect. The recording procedure took place in a quiet room. First, to achieve a baseline recording for each volunteer, a 30 second EEG signal were recorded in the resting position, which is called no-pain class. Then, by putting their hand in the cold water (1.7±0.2centigrad) after a while, they reported the pain. The recording continues till the tolerating time for each subject.

With respect to the fact of artifacts presence in the EEG signals and to record the noises with higher quality, some electrodes on the face muscles were put to detect EMG artifacts. Also, EOG is one of the other artifact sources in EEG.

2.2. EEG Artifacts Eliminating

Principal component analysis (PCA) and regression methods[14] are the methods used for eliminating the EEG artifacts such as muscle artifacts and eye artifacts. Also ICA has been introduced more effective for decomposing the recorded signals into uncorrelated sources [14] which is applied here to remove the EEG artifacts.

2.2.1. Independent Component Analysis (ICA)

The components x i {\displaystyle x_{i}} of the observed random vector x = ( x 1 , … , x m ) T {\displaystyle x=(x_{1},\ldots ,x_{m})^{T}} are generated as a sum of the independent components s k {\displaystyle s_{k}} x i = a i , 1 s 1 + ⋯ + a i , k s k + ⋯ + a i , n s n {\displaystyle x_{i}=a_{i,1}s_{1}+\cdots +a_{i,k}s_{k}+\cdots +a_{i,n}s_{n}} weighted by the mixing weights a i , k {\displaystyle a_{i,k}} [15]:

X= AS (1)

Where S is sources vector, X is the recorded signals (EEGs) matrix.

To calculate its inverse or pseudo-inverse, termed as W, the equation(3) is used:

S =WX, where W=A-1 (2)

2.2.2. EOG Artifact

To remove the most important EEG artifacts, which are EOG and EMG artifacts, the similar process was done. As the Fp1 channel is the most contained EEG channel, the correlation of this channel with all determined sources, was calculated Eq.4 is the correlation formula. If the value exceeded 0.7, the corresponding source was selected as the suspicious EOG source[16].


Where Ri is the correlation of the ith source with the recorded signal at Fp1.

Fig.1 shows the spectral map of the determined EOG source which is mostly on foreahed space.

Shanon Entropy


Fractal Dimension

L(k)= (5)

Description: Description: Description: C:\Users\ghazaleh\Desktop\payan\eeg1.jpg

Fig. 1. Spectral map of EOG component

2.2.3. EMG Artifacts

To remove the EMG artifacts, the correlation of all sources with the frontalis and temporalis channels were computed and the ones which were more than 0.7 were considered as the probable EMG sources. Commonly, EMG sources have higher power at high frequencies. Therefore, to precisely detect EMG sources, in addition to the correlation criterion, their brain map were investigated[17]. The scalp map and power spectrum of one of the detected EMG artifacts is shown in Fig. 2.

Description: Description: I:\figures\3.a.tif

  1. (b)

Fig. 2. An EMG source (a)Scalp map,(b) Activity Power Spectral

  1. Methods

This study is started from the data acquisition part in which 28 healthy subjects participated. We record their EEG signals through the resting condition (without imposing any pain stimulus) and pain condition.

Due to the presence of artifact and noise in the recorded signals, we apply independent component analysis (ICA) to EEG in order to remove the effect of electrooculogram (EOG), electromyogram (EMG) and movement artifacts. Non-artifact sources were projected back to electrode space and various features were extracted from them. To remove the redundancy and increasing the discriminability, an approach for selecting discriminative ones, Sequential Forward Selection(SFS) was applied. The candidate classifiers were support vector machine (SVM) and one nearest neighbor (1NN).

3.1. Features

The features used in this research are as follows; band power of the pain sources in five bands (Delta, Theta, Alpha, Beta, Gamma), fractal dimension, Shannon entropy, approximate entropy and spectral entropy.

As a brief description to the features, Five frequency bands including Delta (0-4 Hz), Theta (4-8 Hz), Alpha (8-13 Hz), Beta (13-30 Hz), and Gamma (>30Hz) were elicited for each time frame, from each channel. [17].

Shannon entropy [18] measures the amount of irregularity in a distribution.

Fractal dimensionmeasures the irregularity or roughness of a signal in a time frame[19].

The table below, demonstrates the brief procedure of calculating the features.

Where P()are the probabilities occurred in the ith bin.

is thethe average length, L(k) is the average length.

3.2. Feature selection

The high number of features extracted in this study, from 30 channels within each time frame caused a high amount of redundancy.

Search strategies need an objective function to select the suitable subset of features. This objective function is usually a statistical/ information/distance based criterion or the classifiers feedback, which are called filter and wrapper, respectively. Filter methods are fast and does not bias to the classifier type, while wrapper methods usually provide better results at high computational complexity cost.

3.2.1. Sequential Forward Selection (SFS)

Sequential forward selection mechanism starts with empty set of features and repeatedly adds the most significant features to reach the criterion[20].

Here the criterion is selected as the classification accuracy with the objective of SFS selects the most discriminative algorithm.

3.3. Classifiers

Two well-known classifiers, 1-NN and SVM, were used in this study. 1-NN is a local and nonlinear classifier, which is proper for classifying multimodal distributed samples[41]. From another angle, SVM with a suitable kernel is capable of classifying samples of two classes with overlap, which provides a great generalization property[21].

3.4. Classification

Investigating brain map through CPT gives us valuable information about the classification possibility. Two frequency ranges, centered at 2Hz (Delta) and 9.8Hz (Alpha), are observed as the most pain dependent features [3]-[5],[8],[22],[23]. The average brain map over all the subjects, in the Delta (Fig. 3) and Alpha (Fig. 4) bands, are exhibited in pain and no pain class.

Description: Description: Description: C:\Users\ghazaleh\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.Word\med2,4,12.jpg

Description: Description: Description: C:\Users\ghazaleh\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.Word\intolerable2,4,12.jpg



Fig. 3. The average brain map of subjects at 2Hz (Delta band): a) Non-pain, b) pain

Description: Description: Description: C:\Users\ghazaleh\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.Word\low6,10,22.jpg

Description: Description: Description: C:\Users\ghazaleh\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.Word\intolerable spect6,10,22.jpg



Fig. 4. The average brain map of subjects at 9.8Hz (Alpha band): a) Non-pain, b)pain

Fig. 3 illustrates an increase in the power of Delta band by feeling the pain, which changes the activity focus region from top to the right hemisphere. These findings were previously reported [3]-[5], [23]. In contrast, by feeling more pain, the power of Alpha band is decreased in the frontal lobe and increased in occipital lobes, as shown in Fig. 4, which is as the results obtained in former studies [3]-[5], [8], [22]-[23].

It is noted that the base of the classifier was just built up according to the detected differences on the spatial distribution of these two band power features. To use the other EEG features and find a discriminate subset of features, SFS was run. Therefore, by adding the other features, which were selected by SFS, it was expected to achieve a higher classification accuracy.

  1. Results

EEG signals from 30 electrodes were recorded and then EOG and EMG artifacts were removed by the ICA method, described in Section 2. Through the preprocessing, EMG or EOG sources and the sources caused by the bad connection of an electrode on the scalp, was projected outward of the brain.

The base of the classifier was just established upon the significant changes in the spatial distribution of band power features through feeling pain (Fig. 4). since reality is that applying just the selected band power features does not provide convincing results, the structure while considering the other features was proposed. The results of pain classification by the proposed structure and those band power features, which were selected through visual inspection, is shown in Table I. For now and on, all of the presented classification results in this paper is achieved by ten-times ten-folds cross validation was executed for the cross validation phase. The classification accuracies are illustrated in Table IV, once SVM was considered for all nodes and the other time 1-NN classifier was assigned.

Table I. The pain classification results of only the selected band power features





Pain Versus Non-pain




Table II shows the classification accuracies achieved by applying svm to the features that is introduced as the discriminative ones in previous studies [6]-[8], [10], [23]-[24].

Table II. The comparative results of pain and non-pain classification by applying the previous suggested features[6]-[8], [10], [23]-[24].

Suggested Band Power Features

in the Previous Studies

Classification Accuracy (%)

Alpha band


Beta and Alpha bands


Delta and Alpha and Beta bands


Theta and Alpha bands


Delta and Beta bands


Alpha and Gamma bands


Delta, Beta and Alpha &Gamma bands


These numerous features, in each time frame, were concatenated into successive feature vectors and therefore the classifiers were encountered with high-dimensional vectors. To remove the redundancy and customize an optimized subset of features , SFS was adopted, to select the pain dependent features and therefore improve the final results.

Nevertheless, while using wrapper method, the selected feature set depends on the classifier, the selected subsets of features are not necessary equal for SVM and 1-NN. SFS was run for each classifier separately. Also, since the test and train sets are changed through different folds, the selected features in different validation folds are not identical. As all of the reports which use wrapper approach, to demonstrate the list of selected features, the common features through folds were reported. The selected features by SFS at each node are listed in Table III. and for deploying SVM at all nodes presented and the 1NN features are listed in Table IV.

Table III. The selected features by SFS for SVM and 1-NN


List of the selected features


Alpha, Delta, Beta and Gamma bands, Shannon entropy, and fractal dimension


Alpha, Delta, Beta bands and Shannon entropy

The achieved classification results by applying the EEG features, customized using SFS, are illustrated in Table VI.

Table VI. Classification accuracy of the pain

Accuracy (%)





Pain vs. Non-Pain





As it is stated the list of selected features depends on the type of classifier.

  1. Discussion

EEG signals is the only non-invasive physiological-base measuring data that quantitatively records the brain activity. Also, the research in pain measurement is still in the beginning compared to other applications such as speech processing.

As it is mentioned, among the artifact removal schemes such as regression with PCA, adaptive filter and match filter, the best known method is still ICA. It provides this opportunity to eliminate different noise and artifact roots in the ICA space, where all of the sources were statistically independent. Some constraints were considered to assure us that the suspicious noisy sources were correctly selected. In other words, the variation of spatial distribution of the Delta and Alpha bands are visualized by brain map images through the time and this variation was translated into a succesfull classification.

We tried to select informative features to reveal the pain changes as highlight as possible. In this regard, instead of eliciting features from the correlated EEG signals on the scalp electrodes, variety of the known features were extracted from the pain dependent EEG source signals. Moreover, instead of ad-hoc methods, a heuristic search strategy, called as SFS, was employed to automatically select the suitable features. The high classification result demnstarates the propriety of the whole process.


[1] C.S. Cleeland, Y. Nakamura, E.W. Howland, N. R. Morgan, B. A. Edwards, M. Backonja, "Effects of oral morphine on cold pressor tolerance time and neuropsychological performance," Neuropsychopharmacology, vol. 15, pp. 252-262, 1996.

[2] A.C.N. Chen, P. Rappelsberger, "Brain and Human Pain: Topographic EEG Amplitude and Coherence Mapping," Brain Topography, vol. 7, pp.196-205, 1994.

[3] A.C.N. Chen, P. Rappelsberger, O. Filz, "Topology of EEG Coherence Changes May Reflect Differential Neural Network Activation in Cold and Pain Perception," Brain Topography, vol. 11 , pp. 125-132 , 1998.

[4] S. Ferracuti, S. Seri , D. Mattia , G. Cruccu, "Quantitative EEG modifications during the cold water pressor test: hemispheric and hand differences," Int. Journal of Psychophysiology, vol. 17, pp.261-268, 1992.

[5] A.C.N. Chen, S.F. Dworkin, J. Haug, J. Gehrig, "Topographic brain measures of human pain and pain responsivity," Pain, vol. 37 , pp.129-140, 1989.

[6] P. Veerasarn, C.S.Stohler, "The effect of experimental muscle pain on the background electrical brain activity," Pain, vol. 49 , pp.349-360, 1992.

[7] P.-F Chang, L. Arendt-Nielsen, T. Graven-Nielsen, P. Svensson, A.C.N. Chen, "Topographic effects of tonic cutaneious nociceptive stimulation on human electroencephalograph," Neuroscience Letters, vol. 35 , pp. 49-52, 2001.

[8] W. Penga, C. Babiloni, Y. Maod, Y. Hua, "Subjective pain perception mediated by alpha rhythms," Biological Psychology , vol. 109 ,pp. 141-150, 2015.

[9] T. Wager, L. Atlas, M. Lindquist, M. Roy, C. Woo, E. Kross. "An fMRI-Based Neurologic Signatureof Physical Pain," The new england journal of medicine, vol. 368, pp. 1388-1397, 2013.

[10] E. Schulz , A. Zherdin , L. Tiemann, C. Plant , M. Ploner , "Decoding an individual's sensitivity to pain from the multivariate analysis of EEG data," Cereb Cortex, vol. 22, pp. 18-23, 2012.

[11] P, Ravn , R. Frederiksen , A. Skovsen , LL. Christrup , Mu. Werner , " Prediction of pain sensitivity in healthy volunteers," Journal of Pain Research, vol. 5, pp. 326-313, Aug. 2012.

[12] S. Walter, S. Gruss, K. Limbrecht-Ecklundt, H. C. Traue, P. Werner, A. Al-Hamadi, N. Diniz, G. Moreira da Silva, A. O. Andrade "Automatic pain quantification using autonomic parameters," Psychology & Neuroscience, vol. 7 , pp.363-380, Nov. 2014.

[13] S.Gruss , R.Treister , P.Werner , S .Crawcour , A .Andrade , S .Walter ,"Pain Intensity recognition Rates via Biopotential Feature Patterns with Support Vector Machines," Biopotential Pattern of Pain via Machine Learning, vol. 10, oct. 2015.

[14] S. Makeig, AJ. Bell, T-P. Jung, TJ.Sejnowski, "Independent component analysis of electroencephalographic data," Advances in Neural Information Processing Systems, vol. 8 , pp.145-151, 1996.

[15] Sheng-Hsiou Hsu, Tim R. Mullen, Tzyy-Ping Jung,

Gert Cauwenberghs, "Real-Time Adaptive EEG Source Separation Using Online recursive Independent Component Analysis," IEEE Trans Neural Syst Rehabil Eng, vol. 24, 3, March 2016.

[16] T.Jung, S.Makeig, C.Humphries, T.Martin, J. Vicente , T.Sejnowski, "Removing electroencephalographic artifacts by blind source separation," Psychophysiology, vol. 37 , pp. 163-178, 2000.

[17] F.Ghassemi, "Independent Component Analysis of ERP for levelingVisual Sustained Attention," Amirkabir University of Technology , 2007.

[18] I. A. Rezek, S. J. Roberts, "Stochastic complexity measures for [33] D. Aba´solo1, R. Hornero1, P. Espino, D. A´ lvarez1, J.Poza, "Entropy analysis of the EEG background activity in Alzheimer's disease patients," Physiol Meas, vol.27, pp.241-253, 2006.

[19]M. Sabeti, S. Katebi, R.Boostani, "Entropy and complexity measures for EEG signal classification of schizophrenic and control participants," Elsevier Journal of Artificial intelligence in medicine, vol. 47 , pp.263-274, , 2009.

[20] S. Enshaeifar, S. Kouchaki, C. Cheong Took, and S. Sanei, "Quaternion Singular Spectrum Analysis of Electroencephalogram with Application in Sleep Analysis," IEEE Trans Neural Syst Rehabil Eng. Vol. 24, 1, Jan. 2016.

[21] M. Gram, C. Graversen, S.S. Olesen, A.M. Drewes, "Dynamic spectral indices of the electroencephalogram provide new insights into tonic pain". Clinical Neurophysiology, vol. 126, pp. 763-771, April 2015.

[22] M. Huber , J. Bartling, D. Pachur, S.Woikowsky, S. Lautenbacher, "EEG responses to tonic heat pain," Exp Brain Res, vol. 173, pp. 14-24, 2006.

[23] R. Dowman, D. Rissacher, S. Schuckers, "EEG indices of tonic pain-related activity in the somatosensory cortices,"See comment in PubMed Commons belowClinical Neurophysiology, vol. 119 , pp. 1201-1212 , 2008.

To export a reference to this article please select a referencing stye below:

Reference Copied to Clipboard.
Reference Copied to Clipboard.
Reference Copied to Clipboard.
Reference Copied to Clipboard.
Reference Copied to Clipboard.
Reference Copied to Clipboard.
Reference Copied to Clipboard.

Request Removal

If you are the original writer of this essay and no longer wish to have the essay published on the UK Essays website then please click on the link below to request removal:

More from UK Essays

We can help with your essay
Find out more
Build Time: 0.0032 Seconds