<p>An &quot;error related potential&quot; is just a difference in EEG traces between error and non-error trials.</p>
<p>To calculate an (anything)-related potential, you average trials with and without (anything), and subtract one from the other. It's possible to do this in time or frequency domains, though you'll likely get different answers due to evoked vs induced components (see <em>David, O., Kilner, J. M., &amp; Friston, K. J. (2006). Mechanisms of evoked and induced responses in MEG/EEG. Neuroimage, 31(4), 1580-1591.</em> ). If you want to isolate <em>errors</em> specifically, you'll want to match trials where other things are constant. For example, if your subjects are choosing left or right, you may want to subtract trials where they chose left as a correct option from those where they chose left as an error. The exact way of doing this depends entirely on your experimental paradigm. Read the literature for ideas, but the specifics depend on <em>your</em> specifics.</p>
<p>Since you know which trials are errors, you do not need to detect errors on single trials to demonstrate if some error signal is present.</p>
<p>If you want to do single-trial detection, that will be a matter of finding the features in the average error signal in a single trial or identifying non-phase locked features (such as power changes) that don't show up well in averages. You might look for power in particular frequencies, voltage at a specific moment in time relative to a stimulus/decision, phase relationships on different channels, etc. You could train a neural network (or use other AI/ML approaches) to detect these features using standard approaches in those fields (cross-validation, etc).</p>
<p>Single-trial detection with EEG is very difficult. I suspect you will fail to distinguish on single trials from EEG with high accuracy despite what you've read, but you're welcome to try, and can probably exceed chance performance if the quality of recordings and strength of signal are good.</p>
<p>Here are a few papers where people have done similar things:</p>
<p><em>Chavarriaga, R., &amp; Millán, J. D. R. (2010). Learning from EEG error-related potentials in noninvasive brain-computer interfaces. IEEE transactions on neural systems and rehabilitation engineering, 18(4), 381-388.</em></p>
<p><em>Ferracuti, F., Casadei, V., Marcantoni, I., Iarlori, S., Burattini, L., Monteriù, A., &amp; Porcaro, C. (2020). A functional source separation algorithm to enhance error-related potentials monitoring in noninvasive brain-computer interface. Computer Methods and Programs in Biomedicine, 191, 105419.</em></p>
<p><em>Salazar-Gomez, A. F., DelPreto, J., Gil, S., Guenther, F. H., &amp; Rus, D. (2017, May). Correcting robot mistakes in real time using EEG signals. In 2017 IEEE international conference on robotics and automation (ICRA) (pp. 6570-6577). IEEE.</em></p>
<p>None of their approaches are identical; there is no &quot;right&quot; answer here.</p>

CC BY-SA 4.0
2022-03-01T09:53:08.483Z
Thanks for this awesome reply. I saw it the first time you posted it but I realized I lack general information and I read at least 20 articles about this topic. And now I can understand what you mean more clear.
Enes Kuz
CC BY-SA 4.0
2022-03-01T10:00:07.920Z
I also realized my interest is in single trial detection of ErrP signals. Lets say we have an epochs of EEG where t=0 is onset of an event and the epochs ends in t=500. And we know this epochs have error signals inside of them.  And we have epochs with no error potentials. And we would like to create an application which will classify a random epoch as includes error signal or correct.  Does it make sense to feed raw signals without any feature extraction to basic neural network?
Enes Kuz
CC BY-SA 4.0
2022-03-01T15:05:31.710Z
@EnesKuz Probably not, but I wouldn't say it's impossible either, given enough training data. Probably need to train separately on every subject. I think your bigger issue will be simply on the recording side: EEG is a very noisy modality. I wouldn't reinvent the wheel on this, though, there are lots of papers where people have attempted similar things, it just seems the accuracy is usually pretty crap. People will spend years and a PhD thesis on questions like this.
Bryan Krause
CC BY-SA 4.0
2022-03-03T11:01:53.660Z
Yeah it is not an easy task. That's why I am not concerned about accuracy score. I think doing this will be a good start for my future research.
Enes Kuz
CC BY-SA 4.0
2022-02-17T19:55:54.373Z
2022-02-17T19:55:54.373Z
Bryan Krause
<p>I have EEG recordings of an experiment. In some of these recordings subject made an error during the experiment. We know these error cause brain to output ErrP signals. I want to detect this. There are not many sources about single trial detection of ErrP's. What are the main steps to detect these error indicator signals?</p>
<blockquote>
<p>Error-related potentials (ErrPs) are neurophysiological signals
associated with error processing. They are generated when wrong
actions are perceived and have been reported in many contexts in the
past two decades, namely when a subject perceives that he/she has
committed an error and recognizes it immediately (‘response ErrP’),
when a subject receives the feedback of a previous choice without
knowing whether it was wrong (‘feedback ErrP’), when observing
mistakes of another person or agent (‘observation ErrP’)’ or during
the interaction with a brain-computer interface (BCI) when the
feedback is not the expected one (‘interaction ErrP’). The components
of an ErrP appear within a time window of 500 ms and are naturally
elicited in the brain without the user’s explicit intention. Thus, its
automatic detection can be used in myriad ways, in real-time, and in
human-machine interaction processes. In particular, interaction and
observation ErrPs have been applied as a proof-of-concept in several
applications, for example, for detection and correction of BCI choices
to increase reliability, to adapt BCI systems over the time, or to
make intelligent systems (e.g., external agents) learn. There is also
a growing interest for ErrPs in clinical applications for disorders
where error monitoring is impaired.</p>
</blockquote>

CC BY-SA 4.0
2022-02-17T19:41:35.540Z
It seems you are quoting a long passage from some source. It is imperative that you cite the source when you do this, to give proper credit and to avoid plagiarism.
Bryan Krause
<eeg><error-related-negativity>
What are the steps to detect ErrP (Error related potentials) in EEG signals?
Enes Kuz
# What are the steps to detect ErrP (Error related potentials) in EEG signals?

(Asked by: username_0 on 2022-02-17)

I have EEG recordings of an experiment. In some of these recordings subject made an error during the experiment. We know these error cause brain to output ErrP signals. I want to detect this. There are not many sources about single trial detection of ErrP's. What are the main steps to detect these error indicator signals?

> Error-related potentials (ErrPs) are neurophysiological signals
> associated with error processing. They are generated when wrong
> actions are perceived and have been reported in many contexts in the
> past two decades, namely when a subject perceives that he/she has
> committed an error and recognizes it immediately (‘response ErrP’),
> when a subject receives the feedback of a previous choice without
> knowing whether it was wrong (‘feedback ErrP’), when observing
> mistakes of another person or agent (‘observation ErrP’)’ or during
> the interaction with a brain-computer interface (BCI) when the
> feedback is not the expected one (‘interaction ErrP’). The components
> of an ErrP appear within a time window of 500 ms and are naturally
> elicited in the brain without the user’s explicit intention. Thus, its
> automatic detection can be used in myriad ways, in real-time, and in
> human-machine interaction processes. In particular, interaction and
> observation ErrPs have been applied as a proof-of-concept in several
> applications, for example, for detection and correction of BCI choices
> to increase reliability, to adapt BCI systems over the time, or to
> make intelligent systems (e.g., external agents) learn. There is also
> a growing interest for ErrPs in clinical applications for disorders
> where error monitoring is impaired.

**Tags:** eeg, error-related-negativity

> **Comments:**
> **username_1**: It seems you are quoting a long passage from some source. It is imperative that you cite the source when you do this, to give proper credit and to avoid plagiarism.  

---

## 1 answers

### Answer by username_1 on 2022-02-17. Score: 1

An "error related potential" is just a difference in EEG traces between error and non-error trials.

To calculate an (anything)-related potential, you average trials with and without (anything), and subtract one from the other. It's possible to do this in time or frequency domains, though you'll likely get different answers due to evoked vs induced components (see *David, O., Kilner, J. M., & Friston, K. J. (2006). Mechanisms of evoked and induced responses in MEG/EEG. Neuroimage, 31(4), 1580-1591.* ). If you want to isolate *errors* specifically, you'll want to match trials where other things are constant. For example, if your subjects are choosing left or right, you may want to subtract trials where they chose left as a correct option from those where they chose left as an error. The exact way of doing this depends entirely on your experimental paradigm. Read the literature for ideas, but the specifics depend on *your* specifics.

Since you know which trials are errors, you do not need to detect errors on single trials to demonstrate if some error signal is present.

If you want to do single-trial detection, that will be a matter of finding the features in the average error signal in a single trial or identifying non-phase locked features (such as power changes) that don't show up well in averages. You might look for power in particular frequencies, voltage at a specific moment in time relative to a stimulus/decision, phase relationships on different channels, etc. You could train a neural network (or use other AI/ML approaches) to detect these features using standard approaches in those fields (cross-validation, etc).

Single-trial detection with EEG is very difficult. I suspect you will fail to distinguish on single trials from EEG with high accuracy despite what you've read, but you're welcome to try, and can probably exceed chance performance if the quality of recordings and strength of signal are good.

Here are a few papers where people have done similar things:

*Chavarriaga, R., & Millán, J. D. R. (2010). Learning from EEG error-related potentials in noninvasive brain-computer interfaces. IEEE transactions on neural systems and rehabilitation engineering, 18(4), 381-388.*

*Ferracuti, F., Casadei, V., Marcantoni, I., Iarlori, S., Burattini, L., Monteriù, A., & Porcaro, C. (2020). A functional source separation algorithm to enhance error-related potentials monitoring in noninvasive brain-computer interface. Computer Methods and Programs in Biomedicine, 191, 105419.*

*Salazar-Gomez, A. F., DelPreto, J., Gil, S., Guenther, F. H., & Rus, D. (2017, May). Correcting robot mistakes in real time using EEG signals. In 2017 IEEE international conference on robotics and automation (ICRA) (pp. 6570-6577). IEEE.*

None of their approaches are identical; there is no "right" answer here.

> **Comments:**
> **username_0**: Thanks for this awesome reply. I saw it the first time you posted it but I realized I lack general information and I read at least 20 articles about this topic. And now I can understand what you mean more clear.  
> **username_0**: I also realized my interest is in single trial detection of ErrP signals. Lets say we have an epochs of EEG where t=0 is onset of an event and the epochs ends in t=500. And we know this epochs have error signals inside of them.  And we have epochs with no error potentials. And we would like to create an application which will classify a random epoch as includes error signal or correct.  Does it make sense to feed raw signals without any feature extraction to basic neural network?  
> **username_1**: @EnesKuz Probably not, but I wouldn't say it's impossible either, given enough training data. Probably need to train separately on every subject. I think your bigger issue will be simply on the recording side: EEG is a very noisy modality. I wouldn't reinvent the wheel on this, though, there are lots of papers where people have attempted similar things, it just seems the accuracy is usually pretty crap. People will spend years and a PhD thesis on questions like this.  
> **username_0**: Yeah it is not an easy task. That's why I am not concerned about accuracy score. I think doing this will be a good start for my future research.  

---

