<p>The field of study you should focus on is the one for which you have already identified in your paragraph above which is EEG based &quot;brain-computer interface&quot;.</p>
<p>EEG signals are compared by their &quot;features&quot;. Each of the signal you have provided above have different features. These features can be mean, variance, frequency, kurtosis, skewness of each of the signals (statistical parameters which also includes fractal dimension, Hjorth parameters, common spatial pattern, fano factor... ...) or power as computed through frequency space algorithms such as fast fourier transform.</p>
<p>More sophisticated techniques such as blind source separation, empirical mode decomposition and wavelet coherence (a phase domain approach) should yield additional insights but these are more reserved for research purposes.</p>
<p>The most common algorithm for post processing is the wavelet transform which plots the energy as a function of both time and frequency.</p>
<p>During a seizure, the wavelet transform will display a clear high energy periodic signal at the lower frequency. While highly efficient in pin pointing exactly where and how the seizure is happening, the wavelet transform is highly advanced (challenging to implement) and runs at O(n^2) for a naive implementation and O(nlogn) for a fast implementation. It is quite computationally expensive.</p>
<p><img src="https://i.sstatic.net/ZPt6p.png" alt="enter image description here" /></p>
<p>What you need to implement is a real time seizure detection based on EEG features.</p>
<p>(offline)
This is done first by grabbing the EEG signal when he has a seizure using EEG headsets or through research, estimate what the characteristics of this type of seizures are. (this can be done even with a single electrode).</p>
<p>(real time)
Once this done, hook the patient with the EEG headset and compute the features of the seizure signal at every other other second worth of samples as they stream into a computing platform. The features are constantly compared to the threshold features. When all these features are have their respective threshold (A and B and C and D all meets threshold). Send alert that a seizure is happening.</p>
<p>The threshold approach is a basic one, but because our brain continuously changing and EEG depends on many many external variables, what is commonly used in practice are the detection of seizure through artificial neural networks (ANN) - it will not only tell you when a seizure is happening but could in fact PREDICT when a seizure will occur! (*)</p>
<p>One challenge I can see with what you are attempting to do is that the patient will be constantly hooked up with a headset in order to perform real time seizure prediction. The distance between your USB and the headset will be a hard constraint. The headsets needs to be recharged frequently. Emotiv EPOC (one popular headset) contains 16 electrodes which can be quite burdensome when worn. Wet electrodes provides better data but requires delicate preparation which can take a long time. If worn constantly, I would pick a headset containing a few electrodes at key places like the frontal-polar lobe (since seizure is more easily picked up than other EEG patterns, we don't need many electrodes) and would choose one that is aesthetically pleasing (one from Neurosky or one of the recent headset from Emotiv i.e. insight) and has a long battery life time</p>
<p>Good luck</p>
<p>(*) <em>Prediction of seizure onset in an in-vitro hippocampal slice model of epilepsy using Gaussian-based and wavelet-based artificial neural networks. - A. Chiu</em></p>

CC BY-SA 3.0
2014-11-20T22:21:30.100Z
I think you covered all the bases.  Nice answer!
Chuck Sherrington
CC BY-SA 3.0
2014-11-22T07:19:25.300Z
@Illegal Immigrant, I think with further research, I'll be able to heed your wise suggestions here. Thanks for the help :) Truly
Xina Torres
CC BY-SA 3.0
2014-11-22T08:06:36.067Z
@Illegal Immigrant, it says in here https://www.inkling.com/read/youmans-neurological-surgery-winn-6th/chapter-54/detection-of-nonconvulsive that the abnormalities occur in the boxed and encircle regions..in those specific channels...shouldn't I purchase a portable eeg device that measures the brain waves on those regions? I mean, I think each region has specific brain waves, right? So shouldn't I buy the EPOC headset rather than the Insight headset because it has more channels?
Xina Torres
CC BY-SA 3.0
2014-11-22T08:54:45.707Z
@user3754176 This is a real challenge for you because you need to determine for your patient exactly where the seizure is happening. This is best done while the patient is having a seizure in a highly controlled environment. Please consult an actual clinician before moving on to human trials. In that literature you've provided seizure activities are detected in the right frontal, parietal and central lobes but I suspect that further studies have been done since that provides a better spatiality as to where most of the nonconvulsive seizures occur
Fraïssé
CC BY-SA 3.0
2014-11-22T08:58:59.380Z
@user3754176 Furthermore, brain waves are irrespective of location but can be made more prominent or more suppressed while performing certain activities. Brain waves of all frequencies delta, theta, beta, mu, alpha, gamma, HFOs occurs at all times but some are more prominent for example while a person is sleeping, or while a person is closing his or her eyes. The reason seizure produces high amplitude brain wave is because the brain waves have all became in sync inside of the brain and in a sense added up with one another
Fraïssé
CC BY-SA 3.0
2014-11-22T09:02:59.913Z
@user3754176 So to your question, I think your major task at hand is the monitoring and not the diagnosis of his disorder. A diagnosis should be done in a clinical setting and the EEGs resulting from those trials can be used as raw data for you to develop your BCI (set your thresholds at whichever channel). In that respect, you should consider only using the headsets that is used for monitoring and that's why I am suggesting to use something that is easier to setup and wear (i.e. insight versus epoc).
Fraïssé
CC BY-SA 3.0
2014-11-24T16:22:16.723Z
@Illegal Immigrant, thanks for clearing that up. :)
Xina Torres
CC BY-SA 3.0
2014-12-04T15:34:30.163Z
@Illegal Immigrant, sorry about this... when you said, 'brain waves are irrespective of location'... did you mean that  measuring alpha amplitude as well as beta2 band at the P4 channel is somewhat the same as measuring the alpha and the beta in other channels? Sorry about this..
Xina Torres
CC BY-SA 3.0
2014-11-20T20:44:01.387Z
2014-11-21T04:27:54.743Z
2020-06-17T09:55:31.633Z
Fraïssé
<p>I'm a Java developer completely naive of brain waves and such. Could anyone tell me how to compare them? </p>

<p>For instance, how can I compare: </p>

<p><img src="https://i.sstatic.net/6CDRd.png" alt="enter image description here"></p>

<p>and this: </p>

<p><img src="https://i.sstatic.net/u9hpL.png" alt="enter image description here"></p>

<p>What fields of study should I focus on? I understand there are some Pattern Recognition involved. Other than that, what else? 
Related Questions: </p>

<ul>
<li><a href="https://cogsci.stackexchange.com/questions/6554/is-eeg-brain-computer-interface-reliable">Is EEG brain-computer interface reliable?</a></li>
<li><a href="https://cogsci.stackexchange.com/questions/8628/brain-computer-interface?rq=1">https://cogsci.stackexchange.com/questions/8628/brain-computer-interface?rq=1</a></li>
</ul>

CC BY-SA 3.0
2014-11-20T16:21:50.973Z
Self-help questions are discourage on this site. So if you could remove the personal references it would be appreciated.

Additionally, are those brain waves comparing readings during a seizure to normal state?

Finally, have you Googled "detecting seizures via EEG"?
Seanny123
CC BY-SA 3.0
2014-11-21T02:51:36.660Z
There are a number of important questions: How often would you like to do this, for how long, with what accuracy, with how many channels, and most importantly, to what purpose? If there are seizures that are asymptomatic, it has no clear purpose. If there are seizures that are symptomatic, but benign, than why bother? Lastly - please remove any identifying info as personal medical questions are misplaced here. Just say something like "I wish to detect seizures in a patient with X and synmptoms Y... Good luck. A noble cause, but think about the 'why' and 'whereto' before the 'how'.
AliceD
CC BY-SA 3.0
2014-11-22T07:02:15.010Z
@Seanny123, I apologize for that personal reference. Yes, I have.The image I posted in the question is actually taken from an EEG of a nonconvulsive seizure. I have also found a reference about it.
Xina Torres
CC BY-SA 3.0
2014-11-22T07:09:45.433Z
@ChrisStronks, I already removed it. Sorry about that. The patient's seizures are quite fatal. Sometimes his lips turn blue because he finds it hard to breathe when they happen. I have no idea with the accuracy. What I know is, I want to have the patient wear it everyday. I will be employing the use of a portable eeg headset for this. I'll probably be using an EPOC headset. The EPOC headset has 14 EEG channels.
Xina Torres
<computational-modeling><eeg><signal-detection>
How to compare brain waves?
Xina Torres
# How to compare brain waves?

(Asked by: username_0 on 2014-11-20)

I'm a Java developer completely naive of brain waves and such. Could anyone tell me how to compare them?

For instance, how can I compare:

![enter image description here](https://i.sstatic.net/6CDRd.png)

and this:

![enter image description here](https://i.sstatic.net/u9hpL.png)

What fields of study should I focus on? I understand there are some Pattern Recognition involved. Other than that, what else?
Related Questions:

* [Is EEG brain-computer interface reliable?](https://cogsci.stackexchange.com/questions/6554/is-eeg-brain-computer-interface-reliable)
* <https://cogsci.stackexchange.com/questions/8628/brain-computer-interface?rq=1>

**Tags:** computational-modeling, eeg, signal-detection

> **Comments:**
> **username_1**: Self-help questions are discourage on this site. So if you could remove the personal references it would be appreciated.  Additionally, are those brain waves comparing readings during a seizure to normal state?  Finally, have you Googled "detecting seizures via EEG"?  
> **username_2**: There are a number of important questions: How often would you like to do this, for how long, with what accuracy, with how many channels, and most importantly, to what purpose? If there are seizures that are asymptomatic, it has no clear purpose. If there are seizures that are symptomatic, but benign, than why bother? Lastly - please remove any identifying info as personal medical questions are misplaced here. Just say something like "I wish to detect seizures in a patient with X and synmptoms Y... Good luck. A noble cause, but think about the 'why' and 'whereto' before the 'how'.  
> **username_0**: @username_1, I apologize for that personal reference. Yes, I have.The image I posted in the question is actually taken from an EEG of a nonconvulsive seizure. I have also found a reference about it.  
> **username_0**: @ChrisStronks, I already removed it. Sorry about that. The patient's seizures are quite fatal. Sometimes his lips turn blue because he finds it hard to breathe when they happen. I have no idea with the accuracy. What I know is, I want to have the patient wear it everyday. I will be employing the use of a portable eeg headset for this. I'll probably be using an EPOC headset. The EPOC headset has 14 EEG channels.  

---

## 1 answers

### Answer by username_3 on 2014-11-20. Score: 8

The field of study you should focus on is the one for which you have already identified in your paragraph above which is EEG based "brain-computer interface".

EEG signals are compared by their "features". Each of the signal you have provided above have different features. These features can be mean, variance, frequency, kurtosis, skewness of each of the signals (statistical parameters which also includes fractal dimension, Hjorth parameters, common spatial pattern, fano factor... ...) or power as computed through frequency space algorithms such as fast fourier transform.

More sophisticated techniques such as blind source separation, empirical mode decomposition and wavelet coherence (a phase domain approach) should yield additional insights but these are more reserved for research purposes.

The most common algorithm for post processing is the wavelet transform which plots the energy as a function of both time and frequency.

During a seizure, the wavelet transform will display a clear high energy periodic signal at the lower frequency. While highly efficient in pin pointing exactly where and how the seizure is happening, the wavelet transform is highly advanced (challenging to implement) and runs at O(n^2) for a naive implementation and O(nlogn) for a fast implementation. It is quite computationally expensive.

![enter image description here](https://i.sstatic.net/ZPt6p.png)

What you need to implement is a real time seizure detection based on EEG features.

(offline)
This is done first by grabbing the EEG signal when he has a seizure using EEG headsets or through research, estimate what the characteristics of this type of seizures are. (this can be done even with a single electrode).

(real time)
Once this done, hook the patient with the EEG headset and compute the features of the seizure signal at every other other second worth of samples as they stream into a computing platform. The features are constantly compared to the threshold features. When all these features are have their respective threshold (A and B and C and D all meets threshold). Send alert that a seizure is happening.

The threshold approach is a basic one, but because our brain continuously changing and EEG depends on many many external variables, what is commonly used in practice are the detection of seizure through artificial neural networks (ANN) - it will not only tell you when a seizure is happening but could in fact PREDICT when a seizure will occur! (\*)

One challenge I can see with what you are attempting to do is that the patient will be constantly hooked up with a headset in order to perform real time seizure prediction. The distance between your USB and the headset will be a hard constraint. The headsets needs to be recharged frequently. Emotiv EPOC (one popular headset) contains 16 electrodes which can be quite burdensome when worn. Wet electrodes provides better data but requires delicate preparation which can take a long time. If worn constantly, I would pick a headset containing a few electrodes at key places like the frontal-polar lobe (since seizure is more easily picked up than other EEG patterns, we don't need many electrodes) and would choose one that is aesthetically pleasing (one from Neurosky or one of the recent headset from Emotiv i.e. insight) and has a long battery life time

Good luck

(\*) *Prediction of seizure onset in an in-vitro hippocampal slice model of epilepsy using Gaussian-based and wavelet-based artificial neural networks. - A. Chiu*

> **Comments:**
> **username_4**: I think you covered all the bases.  Nice answer!  
> **username_0**: @Illegal Immigrant, I think with further research, I'll be able to heed your wise suggestions here. Thanks for the help :) Truly  
> **username_0**: @Illegal Immigrant, it says in here https://www.inkling.com/read/youmans-neurological-surgery-winn-6th/chapter-54/detection-of-nonconvulsive that the abnormalities occur in the boxed and encircle regions..in those specific channels...shouldn't I purchase a portable eeg device that measures the brain waves on those regions? I mean, I think each region has specific brain waves, right? So shouldn't I buy the EPOC headset rather than the Insight headset because it has more channels?  
> **username_3**: @user3754176 This is a real challenge for you because you need to determine for your patient exactly where the seizure is happening. This is best done while the patient is having a seizure in a highly controlled environment. Please consult an actual clinician before moving on to human trials. In that literature you've provided seizure activities are detected in the right frontal, parietal and central lobes but I suspect that further studies have been done since that provides a better spatiality as to where most of the nonconvulsive seizures occur  
> **username_3**: @user3754176 Furthermore, brain waves are irrespective of location but can be made more prominent or more suppressed while performing certain activities. Brain waves of all frequencies delta, theta, beta, mu, alpha, gamma, HFOs occurs at all times but some are more prominent for example while a person is sleeping, or while a person is closing his or her eyes. The reason seizure produces high amplitude brain wave is because the brain waves have all became in sync inside of the brain and in a sense added up with one another  
> **username_3**: @user3754176 So to your question, I think your major task at hand is the monitoring and not the diagnosis of his disorder. A diagnosis should be done in a clinical setting and the EEGs resulting from those trials can be used as raw data for you to develop your BCI (set your thresholds at whichever channel). In that respect, you should consider only using the headsets that is used for monitoring and that's why I am suggesting to use something that is easier to setup and wear (i.e. insight versus epoc).  
> **username_0**: @Illegal Immigrant, thanks for clearing that up. :)  
> **username_0**: @Illegal Immigrant, sorry about this... when you said, 'brain waves are irrespective of location'... did you mean that  measuring alpha amplitude as well as beta2 band at the P4 channel is somewhat the same as measuring the alpha and the beta in other channels? Sorry about this..  

---

