Using AutoLearn

 

 

Change History:

 

2006.05.09 Replaced AutoLearn context menu command Insert AutoLearn Comment with three commands: Mark as Correct (add Comment), Mark as Incorrect (add Comment), and Update NN from Selected Comment. These commands decouple the functionality of adding comments and updating the NN. Added section Incremental Learning to show use of new commands and highlight importance of incremental learning, which was lost in previous user interface.

 

 

Using AutoLearn................................................................................................................. 1

Getting Started.................................................................................................................... 2

Retrospective Analysis....................................................................................................... 2

Incremental Learning........................................................................................................ 11

Retrospective Analysis with MagicMarker...................................................................... 18

Monitoring with Notifications.......................................................................................... 25

Monitoring with Notifications and MagicMarker........................................................... 30

Analysis of Continuation Records.................................................................................... 33

Advanced Settings............................................................................................................ 36

Display.......................................................................................................................... 36

Training......................................................................................................................... 37

General.......................................................................................................................... 37

Create Feature Instruments from Selected Channels................................................... 37

Other Examples................................................................................................................. 37

EMU.............................................................................................................................. 37

Neonatal........................................................................................................................ 43

ICU Example 1.............................................................................................................. 49

References......................................................................................................................... 56

 


Getting Started

Open the record AutoLearn000.lay, which has lots of left-temporal seizures. Set the montage and filters to as you like. (BP-Longitudinal, 1 sec, 20 Hz, and 60 Hz work well for this example.) Comments are created during these examples and you may want to turn off the File|Auto Save/Restore option and select No when prompted to save changes. Otherwise, you will need to delete the added comments or write protect the AutoLearn000.lay file.

 

In these first examples, we’ll mark the first seizure in the record and train the AutoLearn NN to find similar events in the remainder of the record. The examples will vary both the AutoLearn input and output. AutoLearn discovery can be initiated while viewing either the raw EEG (Review tab) or the long-term trends (MMarker tab). Output consists either of a very-long-term trend (AutoLearn tab) for retrospective analysis or the ongoing monitoring of a notification condition which will result in an audible and/or visual alert (and the creation of event).

 

You will probably just use a single method depending on your reading style and configuration of the reading station. The properties you set are stored in the registry and will be restored the next time you run InsightII.

Retrospective Analysis

Before starting this example, reset the AutoLearn properties by selecting Properties from the dropdown (Commands) menu of the AutoLearn toolbar. The Advanced property options should be set as follows:

 

 

Select the raw EEG (Review tab) and scroll until you see the seizure onset at about 15 s. Note that the first four channels are involved – select these channels by dragging a box around the channel labels. Then, place the cursor at the onset and type @Sz.

 

 

Scroll to the seizure offset and drag-n-drop the End (endpoint) onto the EEGPage to set the seizure duration.

 

 

Press OK to complete the event description. Scroll to a point clearly past the end of the seizure, e.g. to 1:40 .

 

Press Start on the AutoLearn toolbar to find similar seizures. The record duration between 10 s and 100 s is used to train the AutoLearn NN, which is then applied to the rest of the record. (By default, the training range extends from slightly after the start of the records, to allow the amplifiers to settle, and the current caret position. Different training methods can be employed as discussed in the advanced methods section.)

 

 

The top display is the AutoLearn very-long-term trend. Plotted is the seizure probability as a function of time. Also displayed are Comment (event) marks and the Time. Click on an area of high probability to find another seizure and the underlying EEG will be shown below.

 

 

 

 

 

The time scale of the AutoLearn display is controlled by the Speed (sec/page, shown as 90 sec) and Zoom (shown as 1/25x). More or less room is given to the probability graph as the Comment and Time lines are toggled on or off.

 

Each time you find a seizure that you want to mark, right click to bring up the context menu and select Insert AutoLearn Comment.

 

 

This will automatically add a new @Sz comment for you. The endpoints will be placed at probability 0.5.

 

 

You can adjust the probability via the Increase Sensitivity and Decrease Sensitivity commands on the context menu. (The sensitivity can also be set directly by editing the AutoLearn instrument via the montage bar.) Also adjust the amount of smoothing via the context menu.

Incremental Learning

The following two examples highlight a special feature of the AutoLearn neural network – its ability to support incremental learning, i.e. to continue learning after its initial training phase. We show this by focusing our analysis on a highly stereotyped portion of the seizure pattern that is only found at the onset of a few of the seizures in the record investigated above. These examples show how to refine the AutoLearn neural network to discriminate between similar patterns, whether they are variants of the same pattern or true patterns of interest and artifacts.

 

Train AutoLearn like we did above and then investigate the onset of the seizure near 00:18:00 to see the stereotypical pattern. Surprisingly, this pattern has been assigned a relatively low probability, which means that this pattern was not represented in the original seizure. Additionally, there are probably a few epochs of high voltage activity with similar frequency components in the “background” that make the stereotypical pattern ambiguous rather than more similar to the seizure epochs as we would expect.

 

 

The following steps will add the stereotypical pattern to the neural network training cases. Right click on the seizure probability curve near its maximum at 00:18:00 and select Mark as Correct (add Comment).

 

 

An @Sz comment is automatically added. (We could have added this comment manually just as easily on either the AutoLearn or EEGPage.)

 

 

We change the start time of the comment to include the stereotypical onset.

 

 

Right click on the seizure probability curve and select Update NN from Selected Comment. (The selected comment is the one we just added. The selected comment is highlighted in the Comment List.) As expected the seizure probability curve changed to correctly identify the onset of the seizure at 00:18:00. It also dramatically changed to identify the seizure onset at 00:05:20 .

 

 

 

(TODO: Would like to replace this with example that results in false positive detections being removed by updating NN.)

 

In this second example, we focus our attention on only the stereotypical pattern by placing a ten second @Sz comment at 00:05:19 and using just channel F7-T3. The stereotypical training pattern is found.

 

 

A second stereotypical pattern is found.

 

 

A non-stereotypical pattern is found. (This is certainly seizure, but for our very particular criterion it is “contaminated” with high frequency activity.)

 

 

Right click on the seizure probability curve and select Mark as Incorrect (add Comment) and then right click again and select Update NN from Selected Comment. (The added comment has the text @Background.) The largest change is the removal of the “incorrect” seizure, but the tails of the other two events were also reduced so that only the highly stereotyped patterns remain.

 

Retrospective Analysis with MagicMarker

This example follows the approach above except that we use MagicMarker as input for AutoLearn. The record has been processed with 4 s epochs, and the first three and a half seizures are highlighted with red ellipses centered around 8 Hz. Concomitant muscle activity extending from 20-40 Hz is also visible.

 

 

Since the seizure is lateralized to the left hemisphere, and both spectrogram and artifact instrument appear to include relevant information, we select them both by clicking on the montage bar. Next we place the caret beyond the end of the marked seizure (@Sz comment, dotted line at above the times) but before the start of the second seizure.

 

 

Press AutoLearn Start.

 

 

The result is similar to that achieved above, but somewhat over smoothed. Right click on the probability curve and repeatedly select Decrease Smoothing until you achieve an acceptable result.

 

 

While AutoLearn has found many of the seizures in the record, it has also missed a few too as shown below.

 

 

Right click on the montage bar and select Edit Selected to edit the AutoLearn instrument.

 

 

Change the Sensitivity (log 10) from 0 to 5.

 

 

AutoLearn identifies this seizure (and other seizures), but requires a boost in sensitivity. As you are reading, you can incrementally increase or decrease the sensitivity via the context menu. (Aside: the AutoLearn accuracy is decreased by the inclusion of the non-involved channels F3-C3, etc. in Left_avg. This can be avoided to some extent by using smaller channel groups like LeftTemp_avg and LeftPar_avg.)

Monitoring with Notifications

If the record you are analyzing is currently being acquired, you want to be notified when other similar events occur. We will mimic that scenario with our existing record again by marking the first seizure. Additionally we create a notification condition that is monitored as the record is “processed.”

 

From the point of view of notification monitoring, what constitutes “processing” the record is pretty liberal. It includes manually scrolling the record via the page down and right arrow buttons or using the mouse and scrollbar. It includes automatic paging via the toolbar buttons (Page Forward Slow, Page Forward Fast, Audio Playback) and the identical Scroll menu items. All of the methods listed so far will check the notification conditions for the EEG data as you scroll through it. That is, you can stop, examine the notification condition that fired (a comment is added to the comment list), and then continue as you like. (You can also backtrack, i.e. scroll backwards, and notifications will pick up where they left off.) The two methods that work specifically with records as they are being collected are Track Online Recording for the EEGPage and Start for MagicMarker. Both of these methods will automatically track the end of the recording as more data becomes available.

 

Open AutoLearn000.lay. Select View|Notifications Bar and View|Comment List so that your display is arranged as shown.

 

 

Select Properties from the dropdown (Commands) menu of the AutoLearn toolbar and make the following changes:

 

 

Select channels FP1-F7 to T5-O1 and scroll to 1:40 and press AutoLearn|Start.

 

 

Before we start scrolling, select Montage|Notification Properties. Turn off the Audible and Relay Box notifications and on the Visual notifications.

 

 

Begin scrolling through the EEG using the Page Down key. As you enter a new seizure, you will see the “@Sz” text displayed in the Notification Bar and a comment added to the Comment List.

 

 

Right click on the AutoLearn instrument in the montage bar and select Add/Edit Notification to see the parameters that can be adjusted. Applying the On True condition is equivalent to using the Upper Limit condition with a threshold of 0.5. A relay box can be used to drive custom applications (contact Persyst). The Severity controls the precedence of the notification’s display if multiple notifications fire at the same time and its visual display (Advisory=White, Warning=Yellow, Crisis=Red).

 

 

Monitoring with Notifications and MagicMarker

The method detailed above can be used with MagicMarker. Open AutoLearn000.lay and select the MMarker tab. Select MMarker|New to clear the previous analysis. Select MMarker|Start and then MMarker|Stop after processing only the first few minutes of EEG.

 

 

Select the left spectrogram and artifact instruments and press AutoLearn|Start.

 

 

Press MMarker|Start and let it run to the end of the record, then press MMarker|Stop.

 

Analysis of Continuation Records

For patients with multi-day recordings, you can use an AutoLearn instrument trained on one day to find events on another day.

 

Open AutoLearn000.lay. Select Properties from the dropdown (Commands) menu of the AutoLearn toolbar and make the following changes:

 

 

Select channels FP1-F7 to T5-O1 and scroll to 1:40 and press AutoLearn|Start. Right click on the seizure probability graph and select Save. Press Save to save the NN as AutoLearn000.psn.

 

Click on the EEGPage in the lower half of the display to activate that view. Select Montage|Save Montage, type the name AutoLearnTest and select the checkbox Save Filters.

 

Close InsightII. Restart InsightII. In this example we will pretend that AutoLearn000.lay is a second record from the same patient – open AutoLearn000.lay. The montage AutoLearnTest is automatically applied since it was last used. Right click on the montage bar and select Unhide Hidden…. This dialog box shows the hidden instruments created previously by AutoLearn. Select Cancel.

 

 

Without selecting any instruments, select AutoLearn|Start. Press Yes in response in response to the question “Use existing AutoLearn instrument?” The AutoLearn NN is applied to this “new” record.

 

 

Advanced Settings

Here we investigate the some of the things you can do by changing the settings available from the Properties item of the dropdown (Commands) menu of the AutoLearn toolbar.

 

Display

HideAddedInstruments will automatically hide the FFT Spectrogram, Event Density, and AutoLearn instruments that are created (only as needed) for the AutoLearn processing. (Recall the Unhide Hidden dialog box above.) ShowAutoLearnInstrument will show the AutoLearn instrument even if HideAddedInstruments is True. If NoViewChangeOnStart is True, then the display will not automatically change to the very long-term AutoLearn display after AutoLearn|Start is pressed. (You can always press the AutoLearn tab to activate this display.) AddAutoLearnNotification antomatically adds a notification condition to the AutoLearn instrument.

Training

FindText indicates the text of the comment to be used as the training example. The FindText “@Sz” will match comments “@Sz”, “@Sz r=1”, etc. and is case sensitive. RangeStartMethod can be one of the following: AfterRecordStart, BeforeSelectedEvents, BeforeCursor, or Fixed. RangeStartOffset is a duration in seconds. RangeEndMethod can be one of the following: BeforeRecordEnd, AfterSelectedEvents, AfterCursor, or Fixed. RangeEndOffset is a duration in seconds.

 

These methods allow you to employ a variety of training methods with one or more marked events. Note that these settings are also available from the Properties tab.

General

We previously showed the effect of the sensitivity and smoothing on the seizure probability curve. You can set the default values here. Setting AutoSetSmoothWindowLength to True will automatically reduce the smoothing when very short (e.g. < 4 s) training events are encountered.

Create Feature Instruments from Selected Channels

AutoLearn automatically creates a FFT Spectrogram for each selected EEG channel. The settings used here (Dowsample=128 Hz, EpochStep=1 s, FFTEpochDuration=1 s, FFTFrequencyMax=16 Hz) have been shown to work well for a wide variety of seizure types from both the EMU and ICU. They may be adjusted to better suit your application.

Other Examples

EMU

This is another record from the EMU. It was marked by four epileptologists in a study comparing the correlation of human experts (Wilson et al. 2003). Only the first seizure marked by reader 1 (“@Sz r=1”, Time=52:03) was used to train AutoLearn. The sensitivity was set to -1 to highlight the difference between seizure and non-seizure activity.

 

Here is the training seizure.

 

Here is what the pre and post seizure activities look like.

 

 

 

Here is a seizure marked only by reader 3, but with a low perception value (p=0.3).

 

 

Here are the other two seizures marked by all readers.

 

 

Neonatal

This record is on the Persyst ICU Demo Data DVD in the Neonatal folder. It contains a number of brief bursts of fast spike-wave discharges and a lot of regular chewing artifact that was sometimes at a similar frequency. To show the amount of chewing contamination, we trained AutoLearn on a segment of chewing artifact and display the “chewing probability graph” below.

 

 

AutoLearn was trained with the first spike-wave discharge shown below.

 

 

We needed to turn off the smoothing (because the bursts are so short) and decrease the sensitivity (to -1 to remove the chewing artifact) to optimize the seizure probability display.

 

 

Here are the other bursts that AutoLearn found.

 

 

 

ICU Example 1

Seizures recorded in the ICU are often slower than those found in the EMU, and rather they often wax and wane rather than having distinct onsets and offsets. Here are a couple of examples, again trained with just the first seizure in the record.

 

Here is the training seizure, 101 s and approximately 1.5 Hz.

 

 

Here is the next “burst” of delta activity.

 

 

Here the pattern has decreased but not disappeared completely.

 

 

Then it is back again.

 

 

Here is another record ICU record with the training seizure shown below.

 

 

The training seizure (marked by the epileptologist) included a short waning section as shown by the probability graph below.

 

 

More seizure activity begins after a short pause.

 

References

Wilson, S. B., Scheuer, M. L., Plummer C., Young, B., and Pacia, S. Seizure detection: correlation of human experts. Clin. Neuroph. 114(11): 2156-64, 2003.

Wilson, SB. A neural network method for automatic and incremental learning applied to patient-dependent seizure detection. Clin. Neuroph. 116(8):1785-95, 2005.

Wilson , SB. Algorithm architectures for patient dependent seizure detection. Clin. Neuroph. in press.