What happens between deliberate commands?
Imagine a detector recognises nine out of ten deliberate double blinks. That sounds useful, but it could still press the key repeatedly while you read or type. Recognition accuracy on a set of commands answers only the first question. Most time spent using a computer contains no intended blink command at all.
I therefore count both false commands during background recordings and missed commands in the injected examples. Ordinary blinks can come in pairs, so simply counting two nearby peaks is not enough to tell intention from everyday blinking. A stricter rule may reduce false commands while missing more intended ones; both numbers need to be visible.
One example: a command becomes the wrong command
How to read this trace. The top panel is a scaled signal from one held-out person; the middle panel is its smoothed size, called the envelope. The blue strip marks a simulated double-blink command added to the recording. At the bottom, x2 means a double-blink output and x3 a triple-blink output. A solid marker matches the added command; a hollow marker is an unwanted output. Here the original rule produces the wrong command, while both checks recover the double blink. I selected this window because it contains an error: one corrected example does not establish overall reliability.
How I tested the rules
Rebuild the existing rule. I ported MindClick’s blink path from control/control.ino (firmware 0.2.0) to Python. Firmware is the code running on the sensor board. The port lets me repeat the same comparison on saved recordings.
Filters suppress selected frequencies, then a 100 ms moving average of the absolute signal produces an envelope: a smoothed trace of signal size. The rule counts eligible crossings of the 40 to 55 envelope window, waits 200 ms before counting again (debounce), and looks for double or triple patterns in 600 ms windows.
At 512 readings per second (512 Hz), the Python filters reproduce the firmware’s coefficients, which a test checks. The public recordings use 160 Hz, so the filters use the same frequency cutoffs redesigned for that sampling rate. The thresholds use the firmware’s filtered analog-to-digital-converter units, while the recordings use microvolts. To put them on a comparable working scale, I multiply each person’s channel by a gain that maps its typical candidate blink peak to the simulator’s natural-blink peak.
Count unwanted commands on recorded data. I used the PhysioNet EEG Motor Movement/Imagery recordings from 20 people. Fp1, Fpz and Fp2 are three recording locations on the forehead, each providing a separate signal trace. There are 123.3 minutes per channel across all 20 people. Participants were moving or imagining movements, not issuing commands to this interface, so every emitted command counts as unwanted in this test.
Add known commands in a separate test. I injected simulated blink waveforms into copies of the recordings, aiming for four command events per run where no candidate natural blink was nearby. These are templates added by code. Knowing their type and timing lets me count missed commands: a hit needs the correct double- or triple-blink output within 1.5 seconds after the last injected blink.
Try two extra checks. A cooldown ignores further blinks for a waiting period after a command. A shape gate treats one rise-and-fall of the envelope as one blink, then rejects events that last too long or rise too high. I compare each check separately and both together. The settings shown below use a one-second cooldown and a gate that rejects durations above 300 ms or peaks above 1.8 times the upper threshold. The search also tried a check on triple-blink spacing; that optional check is off in these selected settings.
Choose settings before the final test. Ten people provide the calibration recordings used to choose thresholds and checks. Ten different, held-out people provide the final comparison. For each variant, I chose the lowest unwanted-command rate among settings that missed no more than 30% of injected commands on the calibration group. That 30% budget sets a common comparison rule; it is not a target for a usable interface.
Results: what the two numbers mean
The final test contains 61.5 minutes per channel from ten held-out people: 184.5 channel-minutes across three channels, plus 708 injected command patterns in separate copies. A channel-hour means one channel observed for an hour. Three channels observed for 20 minutes add up to one channel-hour; they are not an hour of one person’s use.
Unwanted commands / channel-hour counts outputs during the unchanged background recordings. Injected commands missed (%) is the share of the 708 added patterns that did not produce a matching output. Lower is better for both. The first is an event rate; the second is a percentage. They cannot be subtracted to get accuracy.
The firmware row is the Python version of the existing rule with adjusted thresholds. All four selected settings use scale 0.8, or thresholds 32 and 44 rather than the unadjusted 40 and 55. “+ cooldown” adds only the waiting period, “+ shape gate” adds only the shape check, and “+ both” adds both to the same baseline rule.
The brackets give a 95% confidence interval (CI), an uncertainty range calculated by repeatedly resampling whole people. For example, 42.0 [10.1, 79.3] means an estimated 42 unwanted commands per channel-hour, with a wide interval from 10.1 to 79.3. Those are rates, not percentages, and the interval is not a guaranteed range for each user.
Variant | Unwanted commands / channel-hour [95% CI] | Injected commands missed (%) |
|---|---|---|
Firmware rule (adjusted thresholds) | 54.3 [13.7, 101.5] | 25.8% |
+ cooldown (1 s) | 45.9 [11.4, 85.9] | 26.1% |
+ shape gate | 48.5 [10.7, 92.7] | 25.4% |
+ both | 42.0 [10.1, 79.3] | 25.6% |
Read the first row as: about 54 unwanted outputs per channel-hour, while about 26 of every 100 injected commands were missed. It does not mean the rule worked 54% of the time. In counts, it emitted 167 unwanted outputs on the background recordings and missed 183 of 708 injected patterns, recognising 525 (74.2%).
With both checks, the unwanted outputs fell from 167 to 129 over the same recording duration: 38 fewer, or a 23% relative reduction. Equivalently, the rate fell from 54.3 to 42.0, about 12.4 fewer unwanted commands per channel-hour. The paired 95% confidence interval for that reduction is 15% to 31%. This is what “23% [15%, 31%]” describes: uncertainty around the reduction in unwanted outputs, not a percentage of commands that worked.
Misses barely changed: 183 of 708 with the baseline, versus 181 with both checks. That is 25.8% versus 25.6% missed, or 74.2% versus 74.4% recognised. The change is about 0.3 percentage points, not 29 percentage points. The supported improvement here is fewer unwanted outputs at almost the same miss rate.
The improvement was not enough
The bars summarize the comparison above. Lower is better; the black whiskers show the 95% uncertainty intervals. The left panel uses entirely simulated signals. The right uses the ten held-out people: unwanted outputs are counted on unchanged public recordings, and the miss percentages below the bars come from separate copies with commands injected. The label “Firmware rule” means the Python port with adjusted thresholds, as in the table. The combined checks help much more in simulation, but even the lower right-hand bar still means about 42 unwanted outputs per channel-hour.
The cooldown alone reduced unwanted outputs by about 16%. The shape gate alone reduced them by about 11%, but its interval runs from a 2% increase to a 23% reduction, so this small sample does not establish a clear standalone benefit. On entirely simulated background signals, the gate alone reduced unwanted outputs by 55%. That larger result shows why testing only on a simulator would have been misleading.
Quieter can also mean more missed commands
Aim for the lower-left corner. Left means fewer unwanted outputs; down means fewer missed commands. The large markers show settings chosen using separate calibration groups, then tested on ten new simulator seeds or ten held-out people. The lines describe the best combinations among the tested settings on those evaluation groups; they do not identify an independently chosen setting for deployment. The dotted 30% line is the miss limit used during calibration, not a guarantee on new data. The simulator’s combined setting misses about 32% in its final test.
What the rules and recordings revealed
Recordings varied greatly between people. The baseline ranged from 0 to 198 unwanted commands per channel-hour across held-out people. Three of the ten people accounted for 84% of the total, despite each contributing the same duration. The same selected rule gave about 20 per channel-hour on the calibration group and 54 on the held-out group. This does not identify the cause of the difference, but it shows why settings need testing on different people.
One strong blink can count twice. Picture the envelope as a hill crossing a horizontal band. It enters the band while rising and enters it again while falling. If the crossings are more than 200 ms apart, the port can count both and turn a single blink into a double-blink command. Counting a complete rise-and-fall once addresses this particular failure in the software test.
The existing firmware variable BLINK_COOLDOWN_MS holds back focus votes after a blink action when a debug toggle is on; it does not provide the blink-command waiting period tested here. The linked firmware source makes that distinction inspectable.
What this test cannot settle
The miss rate depends strongly on the injected patterns. In the main test, deliberate blinks are 1.5 times the natural-blink amplitude, with 25% jitter, meaning random variation around the chosen blink parameters. When deliberate and natural blinks are the same size, all variants miss 84% to 89%. Real deliberate-command recordings are needed to find out which assumption fits actual use.
What the simulator assumes
This whole figure is simulated. Each column changes one ingredient while holding the selected rules fixed: jaw-like bursts, shifts in the signal’s baseline, background noise, or the size of deliberate blinks relative to ordinary ones. The top row counts unwanted outputs; the bottom row counts missed commands. The rightmost column is the warning: when deliberate and ordinary blinks have the same size (1.0 on the horizontal axis), every variant misses roughly 84–89% of commands. The result depends heavily on how I construct the examples.
The gain is estimated from all of each person’s recordings, including the final test windows. This is an optimistic offline calibration, more informed than a short device setup. Only ten people contribute to the final comparison, and the wide intervals show how uncertain the rates remain.
So, does it work?
The code runs and the extra checks reduce unwanted outputs in this study, but the interface is still too error-prone to call reliable. I reran the full experiment and reproduced the saved numerical results. Adding both checks cut unwanted outputs by about 23% without a meaningful change in the injected-command miss rate. That is a useful improvement in the rules, not a detector that can reliably tell whether every blink was intentional.
In everyday terms, the combined rule still produces about 42 unwanted outputs per recording-channel hour and misses roughly one in four injected commands. I would not turn that into a claim that MindClick is ready for dependable control. The next useful test is a device session that records both deliberate commands and ordinary reading, typing, blinking, jaw movement and head movement, then reports unwanted outputs alongside recognised commands and response time.
A stricter command rule can miss more commands
Recorded operating pointsCompare rules, then move between saved points on their measured frontier.
Interactive controls load when this figure enters view.
Recorded operating points
Rates use channel-hours. Real background means public forehead EEG with simulated command blinks inserted. These points are not physical MindClick trials. Simulator points use a separate synthetic background. Lines connect saved points; they do not measure the points between them. Read the saved result report.
Code and reproduction
The Quiet Blink source is public on GitHub under the MIT license. It includes the Python rules, experiments, tests, saved report and plots. The README has the exact download instructions for the 60 public EDF files: subjects 1 through 20, runs 06, 10 and 14, stored flat in one folder. You can run this study on a computer without an EEG device.
git clone https://github.com/Montekkundan/quiet-blink.git
cd quiet-blink
python3 -m venv .venv
source .venv/bin/activate
python -m pip install -e ".[dev]"
# Download the EDF files as shown in the README, then run:
OMP_NUM_THREADS=1 quietblink --data data/eegbci --out demo-results
pytest -qThe command writes a new report and four figures into demo-results/, preserving the archived results/ folder. To reuse an existing EDF download, pass its flat folder to --data. The project page gives the short overview.
References
Schalk, McFarland, Hinterberger, Birbaumer, Wolpaw (2004). BCI2000: a general-purpose brain-computer interface system. IEEE Trans. Biomed. Eng. 51(6), 1034-1043.
Goldberger et al. (2000). PhysioBank, PhysioToolkit, and PhysioNet. Circulation 101(23), e215-e220.
Efron (1979). Bootstrap methods: another look at the jackknife. Annals of Statistics 7(1), 1-26.
Inspect the recorded result
The saved study comes from source snapshot 5d5337f93257, with its report in results/metrics.json. A fresh full run during this review matched the saved numerical results; only execution timings changed.
Download recorded result report (JSON).
Cover image credit
Cover image: Openbci-brain-computer-interface-by-omphalosskeptic.png by Omphalosskeptic. CC BY-SA 4.0. Illustrative OpenBCI hardware photograph. The benchmark in this article is a software evaluation, and this board is separate from the MindClick setup. Resized for preview; image content preserved.