EEG classification · Core ML
CBraMod · Motor imagery
Left or right, from fourteen channels.
A cue-paced left/right motor-imagery classifier for a 14-channel EPOC X-style montage, in a single Core ML model.
- Input
- 14 × 1,000 at 200 Hz
- Window
- 1.0–4.5 s after the cue
- Output
- Left / right logits
- Unseen users
- 0.784, subject-grouped CV
- License
- BSD-3-Clause
- Updated
- 20 Aug 2026
Overview
Imagine squeezing your left hand, then your right. The difference shows up in EEG, weakly. This model reads it from a single cue-locked window on a 14-channel consumer layout. It needs no per-user training: one model, evaluated on people it never saw.
It is a CBraMod backbone fine-tuned on research recordings from 109 subjects, subset to the Emotiv EPOC X channels, and exported as one fp32 Core ML model.
Fig. 01 · Illustration
One cue-paced trial
The model reads a fixed window after the imagery cue: 1.0 to 4.5 seconds, 896 samples at 256 Hz, resampled to 700 at 200 Hz and zero-padded to 1,000.
Evaluation
Fig. 02 · Unseen users
Accuracy on people the model never saw
Subject-grouped cross-validation keeps every recording of a person in the same fold, so each score comes from people the model never saw. That is the claim: 0.784 on unseen users, against a chance level of 0.50. Accuracy on the training subjects is higher and is not a claim.
The montage is a real handicap. The EPOC X layout has no electrodes over the central motor strip (C3, C4), where motor imagery is usually strongest.
PyTorch to Core ML
The port is gated on real EEG, not random tensors. Relative error is ill-posed for a classifier (near-zero logits on genuinely ambiguous trials explode the denominator), so the gates are absolute.
| Check | Result | Gate |
|---|---|---|
| torch.export against eager PyTorch | Bit-exact | — |
| Worst absolute logit error | 7.0 × 10⁻⁶ | < 10⁻⁴ |
| Decision agreement | 210 of 210 | 100% |
| Worst softmax difference | 2.4 × 10⁻⁶ | < 10⁻⁴ |
Input contract
- Window
- 1.0 to 4.5 s after imagery onset, 896 samples at 256 Hz
- Preprocessing
- Average reference, global z-score
- Model input
eeg, float32 [1, 14, 1000]: resampled to 200 Hz, padded to 1,000- Output
logits, [1, 2] in the order left, right- Channels
- AF3 F7 F3 FC5 T7 P7 O1 O2 P8 T8 FC6 F4 F8 AF4
Know the boundaries
- Cue-paced only. It depends on a known imagery onset and the specified window. It is not an asynchronous intent decoder.
- Offline evaluation. Research recordings subset to a consumer montage are not a live consumer headset. Timing, hardware and artifacts can all change the problem.
- Two classes. Left versus right hand, nothing else.
- Not a medical device, and not clinically validated.
About this page
Summarized from the public model card and its published files. Repository updated 20 Aug 2026; reviewed 26 Sep 2026. The Hugging Face card is the source of truth for licenses and current details.
Upstream: CBraMod / braindecode