Capstone C4

Capstone — Mu/beta ERD

~300 min

2 claims on this page are unverified. TODO(confirm) marks a specific statement the author has not yet checked against a primary source. Everything else on this page has been reviewed. Treat a marked claim as provisional and go to the cited source rather than quoting the sentence.

Brief

On ds-eegbci’s motor-imagery runs — R04, R08 and R12, with the documented defective subjects excluded and the reason stated — compute event-related desynchronization maps for left-hand against right-hand imagery for every subject in a documented subset, show the contralateral lateralization at C3 and C4, run a cluster-permutation test on the difference, and use spectral parameterization to check that each subject actually has a mu peak — reporting, by name, the ones who do not.

That last deliverable is the point of the capstone, and it is what separates it from a plotting exercise. Level 4 spent a lesson (L4.6) establishing that band power in a band with no peak is a statement about the aperiodic spectrum, not about a rhythm. A cohort analysis of “mu ERD” that does not check which subjects have mu is exactly the analysis that lesson warns against, and here you have the tools to run the check on every subject before you aggregate anything.

There is a second trap waiting, and you have already seen it. The single subject L4.4 uses to teach the method, S001, was chosen from ten candidates as the one with the strongest C3 mu ERD: −47.9 %, where the median across those ten is −23.1 %, the range runs to +6.6 % — two of the ten increase at C3 — and only six of the ten have C3 more negative than C4 at all. Whatever your subset shows, it will not look like the teaching example, and reporting a cohort as though it did is the selection effect Level 6 exists to warn about.

Write the analysis plan first — subset rule, exclusions, epoch window, estimator and cycle scheme, baseline window, normalization and averaging order, bands, ROI, the peak criterion, and the test — and keep the file. Everything after that is execution.

Inputs

  • Data. ds-eegbci (EEGMMIDB; Schalk et al., 2004, via PhysioNet), ODC-By 1.0, open access, no hardware filters, 64 channels at 160 Hz, 60 Hz mains, 109 volunteers. The imagery runs are R04, R08 and R12; in those runs the annotations are T0 rest, T1 the onset of left-fist imagery and T2 the onset of right-fist imagery, and the EDF’s own annotation duration for the task interval is 4.1 s. Three runs come to roughly 7–8 MB per subject. TODO(confirm): the dataset’s own online reference is not documented in the catalogue, so whatever reference you use is your choice and has to be stated — the site’s own assets use an offline average over the 64 EEG channels and record that the C3 mu ERD roughly doubles under it.
  • Exclusions, fixed in advance. The catalogue records S088, S089, S092 and S100 as carrying inconsistent event timestamps; S038 and S104 are also commonly dropped. Exclude them by rule, before looking at any result, and say in the report which rule you used and how many subjects it removed.
  • Lessons. L4.1 (why total power and the ERP answer different questions), L4.2 (the estimator, the cycle scheme and the edge margin that determines your epoch length), L4.3 (the choice of estimator and what a bandwidth buys), L4.4 (baseline placement, normalization, the averaging order and ERD itself), L4.6 (the peak check, individualized bands and burst structure), L4.7 (the test and what it licenses). L4.5 is not required, but an ITC map of the same epochs is a defensible extension.
  • Your Level 2 pipeline, if you want cleaned data. It is not required here — the dataset has no hardware filters and the analysis is on band power rather than on an ERP — but if you use it, the configuration goes in the report unchanged and every parameter you altered is named with its reason.

Subset rule and runtime

Capstone notebooks run on a documented subset within the §11 limit of ten minutes on Colab’s free tier, and scale to the full cohort locally.

  • The documented subset for C4 is 10–20 subjects, listed by ID in the notebook’s first cells with the selection rule beside them. Select by a rule that cannot depend on the result — the first n subject IDs after the exclusions, in ID order — and not by who has the clearest ERD. If you do select on the result for a figure, label that figure as an example and keep it out of every aggregate.
  • A FULL_COHORT switch at the top (default False) extends the run to all eligible subjects locally. The per-subject function is identical; only the number of rows in the group table changes. Say which state every quoted number came from.
  • Three runs per subject at roughly 7–8 MB means a 20-subject subset downloads on the order of 150 MB. Cache locally, and delete raw downloads once the per-subject derived products exist.
  • Per-subject products that are expensive to recompute — epochs, per-subject time-frequency maps, per-subject spectra and fits — may be cached so that the group figures reproduce without the full download.
  • The notebook uses the shared helpers, contains no absolute paths, states every analysis parameter in one place with the seed, and prints in its final cell every number the report quotes.

Deliverables

  1. The analysis plan, written before any group result was computed and included verbatim: subset rule, exclusion rule, epoch window and the stored-versus-reported window, estimator and cycle scheme as formulas, baseline window and why it is edge-safe, normalization and averaging order, bands (canonical or individualized, and how), the C3/C4 ROI, the mu-peak criterion, the statistical test and its parameters, and α. A note of anything changed afterwards, with the reason.
  2. Per-subject ERD maps for left-hand and right-hand imagery at C3 and C4, normalized as declared, with the edge margin shaded or cropped and the trial counts per subject and condition in the caption. Show the raw, un-normalized maps for at least one subject as well, so a reader can see what the normalization did.
  3. The lateralization table. Per subject: mu and beta ERD at C3 and at C4, for left-hand and right-hand imagery, with the window and the averaging order stated once and applied everywhere. The quantity of interest is the interaction — contralateral minus ipsilateral, for each hand — not four numbers read separately.
  4. The spectral check, per subject. A parameterized fit of each subject’s own resting or pre-cue spectrum at C3 and C4: aperiodic offset and exponent, the fit range, the settings (peak_width_limits, max_n_peaks, min_peak_height, peak_threshold), the model fit quality, and the fitted peaks. State the criterion for “has a mu peak” before looking, apply it, and name the subjects who fail it. Report what you did with them: excluded from the mu analysis, analysed separately, or kept with the result flagged — any of the three is defensible, and not saying is not.
  5. Individualized bands, or an argument for not using them. If a subject has a mu peak, their band can be anchored on it (L4.6). If you use canonical edges instead, say why, and show that the conclusion does not depend on the choice.
  6. A cluster-permutation test on the left-versus-right difference, reported in full per L4.7: the tested space (channels, frequencies, times), the adjacency definition on all three axes including how channel neighbours were derived, the point-wise statistic, the cluster-forming threshold or the TFCE settings, the permutation scheme, the number of permutations, the seed, α, the tails, and every cluster with its statistic and p-value — including the ones that did not survive. The smallest attainable p-value — 1 divided by the number of permutations, because the identity relabelling counts as one of them — stated so the reader can see whether yours is at the floor.
  7. A pre-specified ROI test beside it. One number per subject per condition from the declared ROI, band and window, and a paired test on it with an effect size and a confidence interval. This is the analysis that can support a claim about mu at C3; the cluster test supports a claim that something differs somewhere.
  8. A topography of the effect at a declared latency and band, electrodes drawn, reference stated, shared colour scale across panels.
  9. Burst structure for at least one subject (L4.6): the alpha or mu envelope with the detection rule stated, and the burst count and duty cycle across a range of thresholds rather than at one. The point is to show what the rule costs, so the sensitivity is the deliverable, not the single number.
  10. One paragraph on what the cohort shows, with the per-subject spread rather than only the mean: how many subjects show contralateral dominance, how many show the reverse, how many have no mu peak, and what that implies for a single-subject application such as a brain-computer interface (L5.7, L7.1).

Rubric

  • Baseline choice justified and edge-safe — the baseline window lies entirely outside the edge-effect margin of the widest wavelet used, ends before the cue with room for the estimator’s forward smoothing, and is long enough to be a stable estimate. The margin is computed from the cycle scheme and stated as a number (pf-tf-edge-effects).
  • Normalization stated — dB, percent or z, with the formula, the baseline window, the averaging order (band-first or cell-first) and, for z, which spread is in the denominator. The same normalization is used everywhere a number is quoted.
  • Cluster interpretation correct — the result is stated as a difference somewhere in the tested space with family-wise error controlled; cluster extent in channels, time and frequency is reported as a description of the sample, not as an estimate of a location, an onset or a band (pf-cluster-inference-misread).
  • Subjects without a mu peak handled explicitly — the criterion was fixed in advance, every failing subject is named, and what was done with them is stated (pf-band-power-slope).
  • Documented defective subjects excluded with reason — by a rule applied before any result was seen, with the count.
  • The estimator, cycle scheme and frequency grid are stated as formulas, and the analysis epoch is longer than the reported window by at least the edge margin.
  • Trial counts are reported per subject and per condition, and any subject-level exclusion for low trial count used a threshold fixed in advance.
  • The lateralization is tested as an interaction across subjects, not asserted from two numbers in one subject.
  • The per-subject spread is shown — a table or a plot with one point per subject — not only a group mean, and no figure selected for its clarity is used as evidence about the cohort.
  • The notebook runs top to bottom on the documented subset inside the §11 runtime limit, states the FULL_COHORT state of every quoted number, and prints every number the report quotes in its final cell.
  • A reader with the dataset could reproduce every number from the report alone.

Example report structure

  1. Analysis plan. Reproduced verbatim, with the date it was fixed and a list of deviations with reasons.
  2. Data and subset. Runs, annotation codes and what they mean, exclusion rule and the subjects it removed, subset rule and the subjects it selected, FULL_COHORT state, download size, reference, licence and citation.
  3. Preprocessing. What was and was not done, with the reason: this dataset has no hardware filters, and an ERD analysis on band power needs less cleaning than an ERP does — say what you relied on instead.
  4. Estimation. Estimator, cycle scheme as a formula, frequency grid, the epoch actually transformed, the edge margin as a number, and the reporting window it was cropped to.
  5. Normalization. Formula, baseline window with its distance from the edge margin and from the cue, averaging order, and the raw maps for one subject beside the normalized ones.
  6. Spectral check. Per-subject fits, settings, fit quality, peak table, the pre-declared mu-peak criterion, the subjects who fail it, and what was done with them.
  7. ERD results. Per-subject maps, the lateralization table, the interaction, and the per-subject spread plot.
  8. Statistics. The pre-specified ROI test in full with an effect size and interval; then the cluster test in full with the map and the cluster outlined; then one sentence saying exactly what has been established.
  9. Burst structure. One subject’s envelope, the detection rule, and the sensitivity of the count and duty cycle to the threshold.
  10. Discussion. What the cohort shows, how many subjects the effect is actually present in, what that means for a single-subject application, and what would have to change to make the analysis a claim about a population rather than about this subset.
  11. Reproducibility. Package versions, seed, parameter block, runtime, and what a reader would need in order to re-run it.

Estimated time: TODO(confirm) — the minutes value in the frontmatter is a site-design estimate, not from the spec.

Rubric — self-assessment

Check each item you can honestly demonstrate in your report. This is the "submit" step: it is stored in your browser only.

0 / 5 rubric items checked. Self-assessment only; stored in this browser.

Notebook

Capstone C4, mu/beta ERD: left against right hand imagery over a documented subset, contralateral lateralisation, a cluster test on the difference, and which subjects have no mu peak, with a FULL_COHORT switch nb-c4-mu-beta-erd

Level 4 capstone ~6 min
notebooks/capstones/nb-c4-mu-beta-erd.ipynb

Downloads from ds-eegbci.

Open in Colab Download Read it here