Skip to content

BCI: simulating calibration and noise

Explanation

We ran our own Monte Carlo experiment to study how much personal data improves a BCI decoder. Its generator is fitted to 540 EEG trials from 12 people, actually processed in our previous analysis. The new campaigns are simulated: they predict the behavior of a model of human measurement, and they are not new measurements in humans.

Each virtual person produces calibration observations, then an independent test. We vary the number of personal trials, the noise and the stability of the signal. Our criterion, chosen for this experiment, is a mean gain of at least five points over the same system without any labeled personal trial. It is not a clinical threshold.

In the scenario that keeps the contrasts fitted to the EEG, this criterion is reached at 64 labeled trials with reference correction, against 128 with uncorrected added noise. The correction also requires 256 unlabeled personal observations. The result therefore concerns the reduction of guided trials; the total cost of data collection must include this reference.

The number required depends strongly on the assumptions. If we halve the contrast between the tasks, or triple the amplitude of the drift between blocks, the criterion is no longer reached up to 256 trials. Here a simulation gives a conditional answer and situations to test, not a universal number valid for everyone.

Detailed analysis

1. What we simulate of a human measurement

Our starting point is the PhysioNet EEG Motor Movement/Imagery dataset, attributed to Gerwin Schalk and the BCI2000 contributors. We keep six values per trial: the log powers of C3, Cz and C4 in two bands, from 8 to under 13 Hz and from 13 to under 30 Hz. They come from the three-second human segments already extracted.

For each person, we fit a mean level, a difference between the left/right cues, the joint fluctuations of the six values and a shift between recording blocks. The Monte Carlo draws new observations from these distributions. It produces the values our decoder receives; it reconstructs neither an anatomy nor a complete EEG waveform.

Each campaign picks one of the twelve fitted profiles. The other eleven profiles each generate 48 trials for the starting model. The target profile separately generates the calibration and 1,200 test trials. The decoder receives neither the hidden parameters of the virtual person nor the test answers. Repeated campaigns do not create additional biological diversity.

The original data contain 45 trials per person. Higher budgets extrapolate the fitted distributions. Differences between classes may also contain effects of the visual cue or artifacts: our simulation does not prove that all the information is a motor intention.

2. A repeated experiment, with its assumptions written down

We ran 600 campaigns per assumption, with budgets of 0, 4, 8, 16, 32, 64, 128 and 256 labeled trials. The classes are balanced. A budget consists of the first trials of the budgets that follow it; the test is entirely separate. The conditions share their random draws to allow a paired comparison.

The starting model is a linear discriminant analysis. Personal calibration adapts its means and its covariance: the weight of the personal trials is \(n/(n+16)\), for \(n\) trials. The rest comes from the source model. The decoder’s regularization is fixed at 0.1 toward the covariance diagonal. We also computed a comparator that uses only the personal trials. The parameters were fixed before the curves, without external preregistration.

The four assumptions keep the empirical contrasts, halve them, triple the drift, or remove all contrast between classes. The two modifications are chosen sensitivity tests, with no claim to represent a particular clinical population. The no-contrast case serves as a negative control.

3. Added noise and ways to reduce it

The initial level already contains the variability that comes from human EEG. We add two perturbations, correlated across channels, in feature space. They represent a common nuisance, with a fixed intensity. This model is not an electromagnetic simulation: its units are neither volts nor teslas, and it does not reproduce 50 Hz interference in the time domain.

  • No added noise. Keep the variability of the generator fitted to human data.
  • Added noise, no correction. Perturb the target person’s measurement during calibration and test.
  • Reference correction. Also measure the interference with imperfect virtual sensors, learn its contribution from 256 independent unlabeled observations, then subtract it.
  • Assumed attenuation. Reduce the amplitude of the added interference to 20%. This is an assumption of the simulator, not a demonstrated hardware performance.
  • Contaminated reference. Let part of the useful activity reach the reference sensor, to test the risk of removing it along with the noise.

The reference observations are an additional personal cost. The source model also uses the synthetic observations of the other profiles. “Zero labeled trials” therefore means no guided calibration; in the corrected condition, personal reference data remain.

4. How many trials improve the decoder in this model?

The criterion requires a mean gain of at least five points, a positive Monte Carlo lower bound, and the criterion holding at every higher budget tested. We keep the first budget on the grid that satisfies it. The accuracy is balanced, since the test contains as many trials of each class.

Empirical scenario: first tested budget meeting the mean-gain criterion
Simulated conditionLabelled trialsAdditional reference observations
No added noise640
Added noise, uncorrected1280
Correction using a reference64256
Assumed attenuation640
Contaminated reference64256

With the reference, the score goes from 52.1% to 58.1% between zero and 64 labels: a gain of 6.0 points, with a Monte Carlo interval from 5.5 to 6.5 points. At the same budget of 64, uncorrected noise gives 55.6%. The score remains modest, even when the exploratory criterion is reached.

The minimum of 128 under uncorrected noise is more fragile: its mean gain is 5.03 points, with an interval from 4.6 to 5.5 points that crosses the five-point boundary. The grid and the numerical precision do not allow us to claim that one trial fewer would make the method fail.

Gain by simulated calibration

600 campaigns per condition, empirical scenario.

Curves of the mean gain by number of trials. Reference correction reaches the criterion at 64 trials, uncorrected noise at 128, in the empirical scenario.
The horizontal axis doubles at each tick. Each curve measures the gain over its own zero-label point. The bands show the 95% Monte Carlo precision under the fixed model; they do not include the human uncertainty about its parameters.
Read the mean scores at each budget
Simulated accuracy, balanced classes
Labelled trialsNo added noiseUncorrected noiseReference
052.1%51.6%52.1%
453.3%51.7%53.3%
854.4%52.4%54.4%
1655.7%53.5%55.5%
3257.0%54.5%56.7%
6458.2%55.6%58.1%
12859.2%56.6%59.0%
25659.8%57.3%59.6%

The corrected budget includes 64 guided trials and 256 reference observations, that is, 320 personal observations in our construction. The uncorrected budget of 128 does not carry this reference cost. We have therefore shown a conditional reduction in the labels required, while making the extra measurement visible. No human session duration is inferred from these numbers.

5. When more data is not enough

After reference correction, the gain at 256 trials falls to 3.3 points when the contrast is halved, and to 4.6 points when the drift amplitude triples. The criterion is reached in neither scenario on the grid studied. This does not show that it would be impossible at every higher budget; we did not simulate those budgets.

Sensitivity to the measurement assumptions

Reference correction, same paired campaigns.

The empirical curve crosses five points. The halved-contrast and tripled-drift curves stay below five points up to 256 trials.
The sensitivity parameters are chosen to test the conclusion. They are not measured patient categories. The intervals remain conditional on each model.

The contaminated reference gives 57.2% at 64 trials, against 58.1% with the reference independent of the useful signal. Denoising can remove the information being sought. A smoother trace or a lower reconstruction error therefore does not remove the need to check the final task.

The empirical contrasts were estimated from few trials and may be overestimated. The reduced-contrast scenario shows the possible consequence of this uncertainty; it does not provide an exact correction for it. The observed drift comes from three runs of a single session, with no measurement of change between days, of fatigue or of human learning.

6. What we take from the Chinese laboratories

Beihang and its Ningbo institute act on the field before the MEG measurement. Dou et al., 2025, combine a shielded enclosure, low-noise coils and active compensation control. The sensor measures the residual field and the controller corrects it. Our hypothetical attenuation reproduces neither this setup nor its performance.

In Shenzhen, the NCCLab at SUSTech builds controlled comparisons. In EEGdenoiseNet, the authors contaminate reference EEG with ocular or muscle artifacts and evaluate the reconstruction. We adopt this principle of a known perturbation. Our experiment uses its own statistical model, without reusing their networks or their results.

Three problems remain separate: external interference measured by the sensors, artifacts from the body, and the change in features between people or between sessions. For EEG, component separation and frequency filtering are other tools. Their effect on the useful information must be checked. A magnetic compensation result does not directly give a number of EEG calibration trials.

7. What the checks establish

The 48,000 decisions of one checked campaign match an independent computation of Gaussian densities in SciPy. The reference correction is checked against scikit-learn, and the twenty thresholds are recomputed separately. An analytical example confirms the generator. In the scenario with no difference between classes, the largest deviation of the mean score from 50% is 0.13 points.

We also fitted a model on two human runs and examined the third: 93.1% of the observations fall inside an indicative 95% Gaussian ellipse. This diagnostic checks one aspect of the dispersion. Since the ellipse parameters are estimated, it is neither an exact test nor a validation of the number of trials that will be needed in the future.

The useful results of this experiment are the conditional curves, their calibration costs and their sensitivity. A future human study will have to confront these predictions with new sessions, measure the real noise, hold out trials chronologically and also count involuntary commands at rest. The Monte Carlo helps us define this study and identify the assumptions on which its success depends.