• Keine Ergebnisse gefunden

12.2 Material and Methods

12.2.4 Automated artifact correction

One of the most prominent concerns with intracranial EEG data recorded from epileptic patients is that the data could contain epileptic activity. Obviously, testing would have been aborted if patients had had a seizure during the experiment, which did, however, not happen in any of the patients reported here. But even between seizures (inter-ictal), the EEG of epileptic patients may contain epileptic forms and other abnormal EEG characteristics.

Usually, visual inspection is employed to find artifacts in the episodes of interest.

However, doing manual artifact rejection sometimes was not a viable option in this

study due to the long duration of recording (i.e., during the two nights). Thus, a computer algorithm was employed to automatically find episodes with artifacts.

The algorithm was developed by Thorsten Kranz and is available online as part of a Python package for analyzing EEG data (https://github.com/thorstenkranz/

eegpy). In short, the algorithm is set up to detect parts of the signal in which either the amplitude was too high or the gradient too steep as compared to “normal”

parts of the data. Thus, the standard deviation of amplitude across all episodes of interest is calculated as well as the standard deviation of the first derivative of the signal. The first derivative reflects steepness of the slope of a tangent at each point of the signal. In this context, it is simply calculated as the difference between one time-point and the preceding time-point.

To account for the fact that EEG differs between persons, the two standard deviation values are calculated for each participant individually. They are also calculated separately for each electrode, or channel. This is sensible because some channels are more noisy than others and calculating the standard deviation across all, possibly very dissimilar channels, would increase false detection of artifacts in the most noisy channels. Based on the standard deviation, a cut-off is then determined for each participant and each channel: It is derived by multiplying the standard deviation of amplitude and first derivative each with a certain factor. For example, if the standard deviation for EEG amplitude in channel TL09 in participant A was found to be 15µV, the cut-off for this channel could be set to three times the standard deviation (45µV) or six times the standard deviation (90µV), depending on how strict or liberal the cut-off is meant to be.

If the signal in any channel at any given point in the epoch of interest exceeds this individualized cut-off, the episode is rejected for containing an artifact. Note that this is quite a conservative approach – if there is an artifact in only one of the channels, the complete epoch will still be rejected. Figure 12.2 shows the idea of the artifact correction in more detail.

In summary, epochs were rejected if either amplitude or slope exceeded a cut-off value based on what was found in “normal data” (which was reflected by the standard deviation of both amplitude and slope) and a mulitplication factor that could be freely chosen.

After systematically varying the factor with which the standard deviation was

Figure 12.2: Overview of the automated artifact rejection procedure. On the left side, five epochs are presented which correspond to EEG recordings of individual trials in one electrode. The blue line is the raw signal. The red dashed lines mark different cut-off values corresponding to multiples of the amplitude standard deviation (std), which was calculated in the same channel across all trials. It provides an indication which amplitude values can normally be expected in this particular electrode. The first epoch does not exceed any of these standard deviation based thresholds. The second epoch would be rejected if three times the standard deviation was the criterion. The third epoch exceeds even a threshold based on 7 times the standard deviation. On the right side of the figure, the first derivative of every left-side epoch is shown as blue line, indicating the steepness of the slope in the raw signal. The dashed green line marks the standard deviation of the first derivative that was computed for each channel across all trials. While the fourth epoch would have passed a liberalamplitudecriterion, its first derivative exceeds five times the standard deviation of theslope and would have been rejected.

.

Figure 12.3: Overview of all electrodes which were used for further analyses. Every color denotes a different patient. Electrodes were excluded if they contained an epileptic focus, appeared noisy in visual inspection or if more than 25% of epochs contained artifacts.

.

multiplied, it was determined that a factor of 8 for amplitude and 8.5 for the first derivative was best suited for the data recorded in this study. This is, of course, a somewhat arbitrary decision. In the current dataset, an average of 86.86% ± 8.27% mean±std of all trials during the memory task were retained with this cut-off criterion. As such, it satisfied both the need for good data quality and the necessity of retaining enough trials. The automated artifact rejection algorithm was performed with custom code for Python which is implemented in the eegpy-package by Thorsten Kranz (https://github.com/thorstenkranz/eegpy).