Skip to content

EEGEventsTUEV silently drops recordings without -REF channels (TUEV also has linked-ear recordings) #1473

Open

Description

@AxelNoun

EEGEventsTUEV.__call__ builds its 16 bipolar channels from EEG XX-REF channel names. When a name is missing, it catches the error and skips the whole recording without logging anything (except (ValueError, KeyError): continue in pyhealth/tasks/temple_university_EEG_tasks.py). EEGAbnormalTUAB skips unreadable files the same way.

The public AAREADME.txt of TUEV v2.0.1 says the corpus has two types of EEGs: averaged reference (AR) and linked ears reference (LE):
https://isip.piconepress.com/projects/nedc/data/tuh_eeg/tuh_eeg_events/v2.0.1/AAREADME.txt

If the LE files use -LE channel names (Braindecode's TUH loader strips both -REF and -LE), every LE recording is dropped and the user is never told. With synthetic data I reproduced it: a recording with -LE names gives 0 samples and 0 log records. The BIOT preprocessing this task follows (datasets/TUEV/process.py) skips the same files, but it prints a message.

What I can and cannot check. I am not affiliated with an institution, so I can't get TUH access (the NEDC form needs an institutional address and email). This means I can't measure how many recordings are dropped, or confirm the exact LE channel names. Could someone with access run this? It only reads EDF headers:

from pathlib import Path
import mne

root = Path("/path/to/tuh_eeg_events/v2.0.1/edf")  # holds train/ and eval/
wanted = ["FP1", "F7", "T3", "T5", "O1", "FP2", "F8", "T4",
          "T6", "O2", "F3", "C3", "P3", "F4", "C4", "P4"]
counts = {}
for split in ("train", "eval"):
    kept = dropped = 0
    suffixes = set()
    for edf in sorted((root / split).rglob("*.edf")):
        names = mne.io.read_raw_edf(edf, preload=False, verbose="error").ch_names
        if all(f"EEG {c}-REF" in names for c in wanted):
            kept += 1
        else:
            dropped += 1
            suffixes.update(n.rsplit("-", 1)[-1] for n in names if n.startswith("EEG "))
    counts[split] = (kept, dropped, sorted(suffixes))
print(counts)

Plan.

  1. A first PR (linked below) keeps the current behaviour, so results stay comparable with BIOT. It logs a warning with the file and the reason for every skipped recording, and documents it. It also fixes two small issues in the same file:
    • EEGAbnormalTUAB raises TypeError with a float resample_rate;
    • several docstrings are wrong (256 Hz instead of the 200 Hz default, np.ndarray instead of tensors, and the meaning of offending_channel).
  2. If the counts show that many recordings are dropped, I can follow up with opt-in support for LE recordings (same bipolar montage, -LE suffix). It would be off by default, because it changes the sample set. Would you want that?

Activity

  1. solarsys commented on Nov 27, 2026

    @solarsys
    Collaborator

    Update: the silent part is fixed on master by #1474. Skipped recordings now log Skipping <file>: channel ... not found (temple_university_EEG_tasks.py:229, covered in test_tuev.py), and the docstring says linked-ear recordings are skipped. Supporting the LE recordings still needs someone with TUH access to confirm their channel names with your header script, so leaving this open for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions