Clinical event detection

Name: clinical event
Category: clinical
Dataset: Harati2015 (TUEV)
Objective: Multilabel classification
Split: Predefined

Usage

neuralbench eeg clinical_event
Show config.yaml
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.

data:
  study:
    source:
      name: Harati2015Tuev
    split:
      name: PredefinedSplit
      test_split_query: "split == 'eval'"
      col_name: split
      valid_split_by: subject
      valid_split_ratio: 0.2
      valid_random_state: 33
  neuro:
    # Excluded: FT9, FT10 (not in all recordings)
    picks:
      - Fp1
      - Fp2
      - F3
      - F4
      - C3
      - C4
      - P3
      - P4
      - O1
      - O2
      - F7
      - F8
      - T7
      - T8
      - P7
      - P8
      - T9
      - T10
      - Fz
      - Cz
      - Pz
  target:
    =replace=: true
    name: LabelEncoder
    event_types: [EpileptiformActivity, Artifact]
    event_field: state
    return_one_hot: true
    aggregation: sum
    allow_missing: true
  trigger_event_type: [EpileptiformActivity, Artifact]
  start: -1.0
  duration: 3.0
  stride: 1.0
  stride_drop_incomplete: false
  summary_columns: [state]
compute_class_weights: true
brain_model_output_size: &brain_model_output_size 6
trainer_config.monitor: val/f1_score_macro
trainer_config.mode: max
loss:
  =replace=: true
  name: BCEWithLogitsLoss
metrics: !!python/object/apply:neuralbench.defaults.metrics.get_classification_metric_configs
  - *brain_model_output_size
  - multilabel

Description

The goal of the artifact classification task is to predict whether 3-second sliding EEG windows contain one or more of the following event classes [Harati2015]:

  • Artifact (“artf”)

  • Eye movements (“eyem”)

  • Generalized periodic epileptiform discharges (“gped”)

  • Periodic lateralized epileptiform discharges (“pled”)

  • Spike and slow wave (“spsw”)

  • Background, i.e. if the event is clearly not any of the other five classes (“bckg”)

Of note, we only extract sliding windows that contain at least one of the above event types.

Dataset Notes

Previous work (BIOT, LaBraM, CBraMod, etc.) trains and tests on 5-s windows centered around every event contained in the .rec files of the original dataset. Since these events are defined at every second and for every channel that is affected by an event, this means (1) examples can have as much as 4-s of overlap, and (2) each example can be repeated up to C times (where C=21 is the number of EEG channels for which the events are defined). Also, (3), multiple annotations can overlap (e.g. artifact + epileptiform activity at the same time), meaning some windows appear more than once in the training set, but with a different label.

Instead, we suggest a modified framing which addresses issues 2 and 3: 1. Combine consecutive events in .rec such that events now correspond to complete start-end blocks, and overlapping events defined for different channels together 2. Extract sliding windows within the events

Issue 3 is further tackled by framing the problem as a multilabel classification task rather than a multiclass classification task.

References

[Harati2015]

Harati, Amir, et al. “Improved EEG event classification using differential energy.” 2015 IEEE Signal Processing in Medicine and Biology Symposium (SPMB). IEEE, 2015.