University project — Completed
EEG and eye state
Eye-state classification from EEG signals and causal analysis, with chronological evaluation.
The starting point
Can EEG signals predict whether eyes are open or closed? Does predictive ability establish a causal effect on future brain activity? Two questions investigated separately.
Analysis of 14,980 observations from 14 EEG channels, segmented into 117 windows of 128 observations. Comparison of predictive models and study of the effect of eye closure on future EEG activity. No statistically significant causal effect was detected.
How it works
- 114,980 samples · 14 channels
- 2128-sample windows
- 3Chronological split
- 4Models & evaluation
- 5Separate causal analysis
Architecture & implementation
- Signal preparation and segmentation into 128-observation windows.
- Chronological split: 78 training, 15 validation and 24 test windows.
- Comparison of logistic regression, Random Forest and a Transformer Encoder.
- ROC-AUC, macro F1 and balanced accuracy; five Transformer initializations.
- Causal estimation using regression with HAC errors and CausalForestDML.
Technical decisions
- Preserve temporal order and fit preprocessing on training data.
- Compare simpler models with a Transformer.
- Report variability and limitations of the small test set.
Lessons learned
- Predictive performance is not evidence of causation.
- Class imbalance and a small test set limit what metrics can establish.
Possible next steps
- Extend the analysis to multiple EEG recordings to improve generalization.
- Test more complex deep learning architectures (GRU, 1D CNN).
- Explore additional causal methods (DiD, IV).
Results & practical value
Predictive results on the test set
| Model | ROC-AUC | Balanced accuracy | F1 macro |
|---|---|---|---|
| Random Forest | 0.9318 | 0.8409 | 0.5872 |
| Transformer (5-run mean) | 0.8545 | 0.7318 | 0.5189 |
Transformer standard deviations: ROC-AUC ±0.2207; balanced accuracy ±0.1741; macro F1 ±0.2146. Only 24 test windows, including 2 closed-eye windows. These are descriptive results, not proof of clinical reliability.
A chronological evaluation
78 training windows → 15 validation windows → 24 test windows. Temporal order is preserved.
- Compare a deep model with tabular models rather than assume it will be better: Random Forest achieves higher balanced accuracy here than the Transformer’s average.
- Document a useful negative result: this analysis found no statistically significant causal effect.
- Transferable skills: time-series preparation, leakage prevention and communication of uncertainty.
Delivered so far
- Analysis and report completed in 2026.
- Transformer: mean ROC-AUC 0.8545 and mean balanced accuracy 0.7318 across five initializations.
- Test set limited to 24 windows, including only two closed-eye windows: results require cautious interpretation.
- No statistically significant causal effect detected in this analysis.



Scope & limitations
- The test contains only 24 windows, including 2 with closed eyes. Metrics are fragile and do not establish clinical generalization.
- Transformer: five initializations; standard deviations reflect their variability, not a population confidence interval.
- No medical application or business impact has been validated.
Source: 2026 EEG project report and notebook. Values reproduced from recorded results; models were not retrained for this portfolio.