Automatic seizure detection: improvements and evaluation

Automatic seizure detection: improvements and evaluation

Electroencephalography and clinwal Neurophysiology, 1990, 7 6 : 3 1 7 - 3 2 4 317 Elsevier Scientific Publishers Ireland, Ltd. EEG 89211 Automatic...

595KB Sizes 0 Downloads 83 Views

Electroencephalography and clinwal Neurophysiology, 1990, 7 6 : 3 1 7 - 3 2 4

317

Elsevier Scientific Publishers Ireland, Ltd.

EEG 89211

Automatic seizure detection: improvements and evaluation J. G o t m a n Montreal Neurological Institute, Department of Neurology and Neurosurgety, McGill University, Montreal, Que. (Canada) (Accepted for publication: 10 December 1989)

Summary. Improvements to an existing automatic seizure detection program are described. They are aimed at taking into account a larger temporal context and thus improving the specificity of the detections. Results were evaluated on 293 recordings from 49 patients, totaling 5303 h of 16-channel recording. They showed that 24% of the 244 seizures recorded were missed by the automatic detection; in 41% of the seizures, the patient alarm was not pressed but the computer made detections. The false detection rate was of the order of 1 false detection per hour of recording. Conclusions are: (1) automatic seizure detection must be used in conjunction with a patient alarm button since some seizures, having poorly defined EEG activity, are not detected; (2) the automatic detection allowed capture of many seizures, clinical and subclinical, for which the alarm was not pressed; (3) the low false detection rate indicates that lower detection threshold could be used, yielding better seizure detection. Key words: Seizure detection; Epilepsy; Validation

Long-term monitoring of epileptic patients is a common procedure, aimed at recording, usually on E E G and videotape, the patient's seizures. The only way to be absolutely sure that no seizure is missed is to have an observer watch continuously both EEG and patient since seizures could have behavioral but no E E G manifestations, or electroencephalographic but no behavioral manifestations. This is, however, an extremely labor intensive procedure and in many cases one has to rely on other methods to know if a seizure took place. At the Montreal Neurological Hospital, we have been relying for several years on a system which allows selective recording of the patient's seizures when either of the following takes place: the patient or an observer presses an alarm button or the computer detects a seizure in the E E G (Ives et al. 1976; G o t m a n et al. 1985). The method of seizure detection was described in G o t m a n (1982) and a review of this problem can be found in G o t m a n

Correspondence to: Dr. Jean Gotman, Neurophysiology Department, Montreal Neurological Institute, 3801 University Street, Montreal, Que. H3A 2B4 (Canada).

(1985). After several years of daily usage of this method, it was decided that some of its weaknesses could be alleviated in part. This paper describes improvements in the detection method and an evaluation of its performance.

Methods Seizure detection Details of the original seizure detection method are in G o t m a n (1982). Its main features can be summarized as follows: the E E G was digitally filtered to remove contamination from the mains frequency and broken down into elementary halfwaves. The characteristics of half-waves in each 2 sec epoch were then compared to the 'background.' The background was a 16 sec long section of E E G ending 12 sec before the epoch being analyzed (Fig. 3 of G o t m a n 1982). The 12 sec gap prevents a seizure starting gradually from being incorporated into the background before it is detected. We used amplitude thresholds relative to t h i s constantly updated background rather than thresholds of absolute amplitude so that thresholds

0013-4649/90/$03.50 © 1990 Elsevier Scientific Publishers Ireland, Ltd.

318

J. G O T M A N

M.S. 89-2424

Hip.

L

J'

Post ~'~'~'~'~"~"~'~'~'~v~r"~*~"~"~./~'~.

' % ~ ~ ~ ~ b ~ , ~ ]

H p.

R

Post Hip.

._-~

",

Fr. i

Fig. l. Seizure recorded from intracerebral electrode. It was detected automatically but the alarm button was not pressed. The seizure was detected because of the first improvement described in the text: a low amplitude, rapid and rhythrmc discharge. Detection at arrow. Hip, hippocampus; Post hip, posterior hippocampus; Fr, frontal lobe; L left; R, right.

Seizure Background A <

Gap ~..~

16s

Current~och ~

20s

Background B IIII ,~ • 2s 8s

Fig. 2. Schematic representation of the use of background in seizure detection. The gradual onset of a seizure is not included in the background because of the gap (first line). A detection takes place in the second line because the frequency during the current epoch is much higher than that of background A. In the third line there is no detection because the activity in the background following the current epoch is too low (background B).

AUTOMATIC SEIZURE DETECTION

would not depend on any particular montage (referentiaL bipolar, varying interelectrode distance) or type of electrode (scalp, intracerebral, epiduraL subdural), For a detection to take place, the following criteria had to be met: the average amplitude of half-waves in the epoch had to be at least 3 times that in the background, their average duration corresponding to frequencies between 3 and 20 Hz and the squared coefficient of variation of halfwave duration being below 0.36 (this coefficient of variation is the ratio of the variance to the square of the mean and measures the regularity of halfwave duration), This method has been in daily use for several years and has allowed capture of many seizures for which neither the patient nor an observer pressed the alarm button. In some cases, however, we found that seizures were missed despite quite a clear but low amplitude seizure discharge in the EEG. We also found in some recordings a very high number of false detections largely due to short bursts of rhythmic activity (e.g., bursts of spike and wave, polyspikes, high amplitude theta bursts and large spindles). The following 3 modifications were therefore made to the original method: (1) A detection can take place when the average amplitude of the waves in an epoch is simply equal to or larger than that of the background (rather than 3 times the background), provided that the average duration of the waves in the epoch is one-third shorter than the average duration of the waves in the background. This feature allows detection of seizure discharges consisting of rapid low amplitude activity. An example is shown in Fig. 1. This type of detection is in addition to the original criterion, requiring a large increase in amplitude, (2) The gap between the background and the current epoch was lengthened from 12 to 20 sec to be less sensitive to a gradual seizure onset, (3) The average amplitude of the waves following the current epoch was also taken into account, A period of 8 sec was used (Fig. 2). A detection in the current epoch was only retained if the average amplitude of the half-waves in this 8 sec section was at least 1.6 times that in the background. This

319

avoided many false detections due to short events. Epileptic seizures usually last more than 2 - 4 sec even if the very rhythmic part of the discharge may be brief.

Performance evaluation Subjects. Evaluating the performance of automatic methods of spike and seizure detection (or sleep staging algorithms) is very delicate and can be extremely misleading. Results are highly dependent on the method of selecting EEGs on which the evaluation is performed. When is an EEG too atypical or too contaminated by artefact to be included? Which seizures are to be included in the data base? To circumvent this problem, we performed the evaluation on 293 consecutit, e recordings from 49 patients being investigated at the Montreal Neurological Hospital. Subjects were selected strictly on clinical grounds and independently of this study. No recording was rejected. Most patients were adults or adolescents with medically refractory epilepsy being considered for possible surgical treatment. No child under 10 was included. The average duration of a recording was 18.1 h, ranging from 12 to 23 h. Thus the seizure detection method was evaluated on 5303 h of EEG. In 241 recordings from 44 subjects, bipolar scalp or scalp and sphenoidal montages were used. In 52 recordings from 5 patients, intracerebral bipolar recordings from temporal and frontal lobes were used. More details about the recordings are given in Table I. True and false detections. The following 5 parameters of performance were measured: (1) Missed detections: seizures that were recorded because the alarm button was pressed but that were missed by the computer. We did not consider as seizures the events where the alarm button was pressed but for which there was absolutely no evidence of seizure activity. The quantity of artefact and the quality of EEG seizure activity did not affect the decision to call an event a seizure (Fig. 3). Since we did not have a continuous recording, it is p o s s i b l e that other seizures took place and were not recorded by either the alarm button or the computer. The number of missed seizures may, therefore, be underestimated.

320

J. G O T M A N

P.B. 89-0346

Cz-C3,,~-.~ C 3 - T 3 ~

'

..~,,.,.,, ~...,-..~..~.,.~,L ~ , # ~ , , . . , , , , , , ~ , i ~ , ~

C4-Cz " " ~ r ' ~ , ~ H_EOG,/~"~.

~

~ ~ . ~ ,~ ~., .

~. ~

,

:.'

'.'

~'~ ' ."~, '

,

N i,)

,i

,'

v

W ,,'~' , ~,

k,

~-

,' i

v

- w

FP 1 F7 i

2 sec J150/.(V

T3_T5---,.-~- b

,

TS-O ] ~ . / . ~ , ,',

~

~ --

~

~

.... ,'

F8-T4,'411l~Jl

,

~i

- -

t

.

.

!

Fig. 3. Seizure missed by the automatic detection (recorded because of the alarm button). The seizure has a visible electrographic discharge; there is considerable E M G artefact and the discharge frequency is too low to be detected by the computer. H - E O G , horizontal EOG.

(2) True detections with alarm: seizures that were detected by the computer and for which the alarm button was pressed. (3) True detections without alarm: seizures detected by the computer and for which the alarm button was not pressed, (4) 'Interesting' false detections: detected events that cannot be called seizures but that are genuine paroxysmal EEG discharges which may be of interest to the EEGer (Fig. 4). The most frequent such events were bursts of spike and wave. (5) 'Uninteresting' false detections are those consisting of artefacts or EEG patterns having no direct relationship with the patient's epilepsy

problem (alpha activity, large sleep spindles, runs of theta activity in intracerebral recordings... ). Rather than giving the number of false detections or the proportion of false detections to total detections, we will give the false detection rate in number of false detections per hour. This is more meaningful because the effect of false detections in the monitoring system described above is simply to cause unnecessary EEG to be recorded. How much unnecessary EEG is best estimated by the number of false detections per unit of time. In presenting average results of missed and true detections, one is faced with the great heterogeneity of the patients: in some patients no seizures

AUTOMATIC SEIZURE DETECTION

321 D.H. 89-2467

Cz-C3 C3-T3'

T3-Spl Sp1 - S p 2 ' ~ ~ ~ ~ Sp2-T4~ ' ~ ~ 1 T4-C4~ ' ~ ' ~ 4 / s @ ~ ~ ~ i ~ ; ~

,~

~%!1~%/~'"'*~'~-*,~ ~

' ~ ' ~ ~ ~..l~t~~ ,:~..'~,A~"JfXP~'k/~'~'?~,

~

'l ~ f ~ ~ u v ~ , ' - ~ ~

~ ,,'

V

c4-cz E©®

Fp 1-F3 ~

~

~

F3-C3 C3-P3

P

3

-

O

]

~

)cP2-4F 4C" ! ~4F" ~~' ~~~ ~. " ~. ' ~~ ]

~

'

/

P4-0 2,~ " , ~ , ~ ~ ~ 4 , ~ 4 ~ , ~ ' v ~ ~ Fig. 4. 'Interesting" false detection. It is not quite clear what this burst of activity is, but it could be argued that it is a small electrographic seizure. In this patient seizures start in the right central region.

were recorded, in m a n y there were 1 - 5 seizures, but in a few there were over 30 or 40 seizures (e.g., simple partial seizures). Averaging such results could give very misleading numbers. We therefore elected, somewhat arbitrarily, to limit the n u m b e r of missed detections to a m a x i m u m of 10 per subject; the same limit was used for the n u m b e r of true detections with alarm and for the n u m b e r of true detections without alarm. W h e n giving the results, we will state in how m a n y subjects the limit was reached. The n u m b e r of false detections, whether interesting or not, was not limited since their distribution was less erratic,

Detection thresholds. Three thresholds were mentioned above for the detection p r o g r a m before it was changed: amplitude, above 3, coefficient of variaton, below 0.36, and frequency, between 3 and 20 Hz. In fact the following settings were used in this evaluation: amplitude above 2.7, coefficient of variation below 0.40 and frequency between 3 and 20 Hz for scalp recordings and between 5 and 20 Hz for intracranial recordings. The increased sensitivity afforded by thresholds at 2.7 and 0.40 was possible because of the great reduction in false detections b r o u g h t about by the use of improvement no. 3 above (the requirement of a large

322

J. GOTMAN

amplitude following the current epoch). In depth e l e c t r o d e r e c o r d i n g s , t h e r e are l e p t i f o r m b u r s t s o f 3 - 4 Hz, p a r t i c u l a r l y , a n d m o s t seizures ter a c t i v i t y so t h a t a m i n i m u m

frequent non-epiin f r o n t a l r e g i o n s h a v e b u r s t s o f fasf r e q u e n c y of 5 H z

is m o r e a d v a n t a g e o u s . All these t h r e s h o l d s w e r e d e t e r m i n e d by trial a n d e r r o r b e f o r e s t a r t i n g the evaluation procedure. They were not changed during the e v a l u a t i o n .

Results A total of 244 seizures w e r e r e c o r d e d . In 24% of t h e m (59 seizures), the a l a r m b u t t o n was p r e s s e d but no a u t o m a t i c d e t e c t i o n t o o k p l a c e ( T a b l e I, right c o l u m n ) . In 35% (86 seizures), b o t h the a l a r m a n d the c o m p u t e r d e t e c t i o n t o o k place. In 41% (99

TABLE I Subjects and results of evaluation. ASZ = automatic seizure detection. Values are total number of seizures or detections for all subjects. For false detections (ASZ, interesting and uninteresting), rates per hour are given in text. For the 3 "seizure" rows, see text for explanation of ceiling of 10/patient.

Number of recordings Number of subjects Seizure, alarm, ASZ Seizure, alarm, no ASZ Seizure, no alarm, ASZ ASZ, ' interesting' ASZ, ' uninteresting'

Surface 241 44 62 48 69 1051 2604

Depth 52 5 24 11 30 994 331

Total 293 49 86 59 99 2045 2935

seizures), t h e r e was c o m p u t e r d e t e c t i o n b u t n o a l a r m . R e s u l t s will b e g i v e n in m o r e d e t a i l sepa r a t e l y for s u r f a c e a n d d e p t h r e c o r d i n g s . P,L. 89-1125

Cz-C3 • C3-T3 T3-SD 1

. - - - - - ~ ' , . , w L /

~ ....

~~

~

.

T4-C4 2 sec J' 150 NV

......---.,,..~-~-,---".--~..~'~'~,.

C 4 - C z ~

Fp 1-F7"-"-~,r"~---~,..'~l#"~' ",.....---~.;~"'-',../k..,-.,.~.)~'~:',,v-...-,../','~ ."i~,~,,,..,,,--,r~,.u'v¢"-~Lt,,...4.,..,.~"~f'~Z.,', "~ [ F7-T 3"-----r~'~"-"~'~'-'~P ''--.-~ ',.,,.~%I'-~",.,."'~r,,,~/'?'.~,.p",-..'~r',.,,~v,,~'av,~i T3-T5 ~"'~'."'~-,,,'"-'~-~'~-~"'~..~.~@,"~,~-~,~.~,,""',,-~,,'.~~ Ts-o

F,..,2_F8.~.--v,..'--~"~I,,~'%,,,,~,,~, / T4-6~j!/~,~i,/i.

",

"%,-, "*'~"., "-v\,,,,.~ ,'"v, "i ""'-v.,,, ~a,..,,..'".,,, ,..u,,.,...v-.v',w.,V'.,.<"~

. ~'1.~\ ,,' ,,,. ~(,i,.j!!;,~m, li'~.. ,Ji!,,'~J,'~,;"~,~!~'!;'l,"/!~t!,lt~ril.~!J~'r

Fig, 5. Seizure recorded because of the automatic detection. The alarm button was not pressed although this was. upon review of the video recording, a clinical seizure. The electrographic seizure activity is not of very large amplitude and there are some artefacts but there are detections (arrow). H.-EOG, horizontal EOG.

AUTOMATIC SEIZURE DETECTION

Extracranial recordings Results are summarized in the left part of Table I. In the 241 recordings, 48 seizures were recorded because of the alarm button but were missed by the program. These 48 seizures came from 14 patients; in 2 of these, 10 and 11 seizures respectively were missed (with the above mentioned cut-off at 10, they accounted for 20 of the 48 seizures). Fig. 3 is an example of a missed seizure, The main causes for missed seizures were: seizure consisting only of a flattening of the E E G followed by movement or E M G artefact, seizures consisting of very slow activity only (1-2 Hz), or low amplitude discharge with irregular patterns, In 62 seizures, from these 241 recordings, the alarm button was pressed and the computer detected the seizure. They took place in 22 patients, 2 of whom had 10 or more (10 and 13 respectively), thus contributing 20 of the 62 seizures, In 69 seizures from extracranial recordings, the alarm button was not pressed; seizures were detected by the computer. These occurred in 14 patients, 3 of whom had more than 10 (86, 25 and 11) contributing 30 of the 69 seizures. 'Interesting' false detections occurred on the average at the rate of 0.24/h or approximately 1 / 4 h. 'Uninteresting' false detections were at 0 . 6 / h or 1/100 min. The total false detection rate was thus 0.84/h. Actual number of false detections are given in Table I.

Intracranial recordings Results are summarized in the center part of Table I. We are dealing with 5 patients having respectively 8, 6, 5, 20 and 13 recordings. In 2 of these patients seizures were missed by the cornputer: 1 in one patient and 41 in another, thus making 11 missed seizures (with the limit of 10). In 4 of the 5 patients 24 seizures were detected by alarm button and computer, 20 being contributed by 2 patients who actually had 20 and 12 seizures, In 30 seizures, the button was not pressed but the computer made a detection; these occurred in all 5 patients, 2 contributing 20 seizures but actually having 18 and 55. 'Interesting' false detections occurred at the average rate of 1 / h and 'uninteresting' ones at

323 0.35/h or 1 / 3 h. The total was thus 1.35/h. Total numbers are in Table I.

Discussion The use of automatic seizure detection in the context of long-term monitoring in epilepsy can facilitate the recording of seizures. The method described in G o t m a n (1982) is now in use in many centers and it is therefore important to try to improve its performance and also to establish its limitations. In improving performance we have tried to make it more sensitive to the detection of seizures but also to limit the number of false detections which was sometimes very high. This was done largely by increasing the length of context in which a 2 sec epoch is interpreted by the program. We have increased slightly the time before the epoch (from 28 to 36 sec) and introduced a time of 8 sec after the epoch. By widening the 'angle of view' that the computer has on the EEG, we have come a little closer to the human interpreter, who always interprets a pattern in a very wide context, taking into account several minutes before and after that pattern (turning the pages back and forth). When performing on-line analysis, it is technically difficult, although feasible, to use context after a particular pattern since the E E G is analyzed 'as it comes.' The use of a wide context in automatic E E G analysis has been advocated (Frost 1985) but rarely used. Assessing the performance of such a method is a difficult task because results depend so much on the selection of recording conditions and subjects. We have tried to be as non-selective as possible but one should be cautious in extrapolating results to other subjects or conditions. The age of patients, the type of epilepsy or the presence of particular technical artefacts could lead to different results. One should also be cautious about interpreting average results: seizures are not all equal. If a subject has 50 simple partial seizures in a week and the computer misses 10, the consequences are much less serious than missing 2 seizures in a patient who as 3 or 4 partial complex seizures per week.

324

J. GOTMAN

There is still a significant n u m b e r of seizures that are missed by the automatic method. A1though we will try to decrease this in the future, there will be a limit because some of the missed seizures have very poorly distinguishable E E G features. One must expect that some seizures cannot be detected because of the lack of specificity of the discharge morphology (Ajmone Marsan 1984). More seizures could obviously be detected by opening detection thresholds (see below). This has also been confirmed in an independent evaluation of this method (Chatrian, personal communication), M a n y seizures for which the alarm button was not pressed were detected by the computer. The button was not pressed because the patient and observer were not aware of a true clinical seizure or because the seizure was so called 'electrographic' (no clinical accompaniment). In our patients the button was not pressed for clinical seizures because the patient had no warning and no m e m o r y for the seizure and the nurse did not

3 to 2.7 and increase of the coefficient of variation threshold from 0.36 to 0.40 without causing a significant increase in the rate of false detection (compared to the rate evaluated on 260 recordings prior to changing the method). F o r the practical use of seizure detection, one m a y conclude the following: (1) It is not wise to rely exclusively on automated seizure detection. Patients and observers should always be carefully instructed to press the alarm b u t t o n when a seizure takes place. (2) The automatic detection method detects m a n y clinical and subclinical seizures that escape the attention of observers and patients. (3) We have kept the detection thresholds constant for this study, but they could be varied, particularly as a function of false detections: if there are few false detections or if false detections are of little concern, one could open the detection thresholds. This would certainly increase the yield of detected seizures.

notice a seizure with quiet, although very clear, clinical signs. In 1 patient with depth electrodes, almost all clinical seizures were recorded thanks to the automatic detection: m a n y occurred at night, lasted 1 - 2 min but consisted of long manual and facial automatisms with no noise. Seizures that have no apparent clinical manifestations are also important in the evaluation of patients since they often occur in the same location as clinical seizures. False detections are not a serious problem unless they are very numerous. Their effect is simply to lengthen the a m o u n t of E E G that has to be

This research was supported by Grant MA-10189 of the MedicalResearch Council of Canada. I am grateful to L. Allard and C. Dub~ for their help in data collection and to Jane Thibaudeau for typing the manuscript.

reviewed by the E E G e r and to increase the a m o u n t of disk storage space required to record EEGs. We obtained rates of less than 1 false detection per hour of recording, a practically very acceptable rate. In fact, this result p r o b a b l y indicates that lower detection thresholds could easily be used: thresholds that would double the false detection rate would still be acceptable and would certainly improve the detection of true seizures. The third improvement described above (use of 8 sec following the current epoch) was aimed at reducing false detections: it was judged very effective since it allowed reduction of the amplitude threshold from

References Ajmone Marsan, C. Electroencephalographic studies in seizure disorders: additional considerations. J. Clin. Neurophysiol., 1984, 1: 143-157. Frost, Jr., J.D. Automatic recognition and characterization of epileptiform discharges in the human EEG. J. Clin. Neurophysiol., 1985, 2: 231-249. Gotman, J. Automatic recognition of epileptic seizures in the EEG. Electroenceph. clin. Neurophysiol., 1982, 54: 530540. Gotman, J. Seizure recognition and analysis. In: J. Gotman, J.R. Ives and P. Gloor (Eds.), Long-Term Monitoring in Epilepsy. Elsevier, Amsterdam, 1985: 133-145. Gotman, J., Ives, J.R., Gloor, P., Quesney, L.F. and Bergsma, e. Monitoring at the Montreal Neurological Institute. In: J. Gotman, J.R. Ives and P. Gloor (Eds.), Long-Term Monitoring in Epilepsy. Elsevier, Amsterdam, 1985: 327-340. Ires, J.R.. Thompson, C.J. and Gloor, P. Seizure monitoring: a new tool in electroencephalography. Electroenceph. clin. Neurophysiol., 1976, 41: 422-427.