AGENT SKILL

brain-computer-interfaces

BCI design and evaluation — signal decoding, calibration, closed-loop paradigms, and performance metrics.

License 许可
MIT
所属仓库
TanNhatCMS/jarvis
最近更新
2026-11-07
Stars
★ 0
Forks
1

01 前言 Front Matter

name
brain-computer-interfaces
category
scientific
description
BCI design and evaluation — signal decoding, calibration, closed-loop paradigms, and performance metrics.

03 SKILL.md 正文

Overview

brain-computer-interfaces covers the engineering and neuroscience of systems that translate neural activity into control signals: invasive ( Utah arrays, Neuropixels, ECoG) and non-invasive (EEG, fNIRS) BCIs for communication, motor restoration, and control. It focuses on the closed loop — decoding must work in real time, adapt to non-stationary brains, and be evaluated on metrics that reflect actual usability, not offline accuracy.

A BCI is not a decoder; it is a system comprising signal acquisition, preprocessing, decoding, feedback, and a user learning to use it. Failures usually live in the loop, not the classifier.

When to use

  • Choosing a BCI paradigm: motor imagery, P300 spellers, SSVEP, ECoG high-gamma, intracortical kinematic decoding.
  • Designing calibration: open-loop training data collection, session length, avoiding user fatigue.
  • Building the real-time pipeline: latency budgets, feature extraction, decoder updates.
  • Closed-loop decoder adaptation: CLDA, recalibration, handling non-stationarity.
  • Evaluation: information transfer rate, bit rate, task success, user-centered metrics.
  • Safety and ethics: informed consent, data privacy, managing user expectations.

Core concepts

  • Paradigms. Motor imagery (EEG mu/beta desynchronization — slow, needs training); P300 (oddball responses — no training, slow spelling); SSVEP (flicker-driven — fast, fatiguing); ECoG high-gamma (excellent spatial specificity, requires implants); intracortical (single-unit kinematics — highest performance, surgical risk). Match paradigm to user capability and goal.
  • The non-stationarity problem. Neural signals drift within and across sessions (electrode shifts, learning, fatigue). Decoders trained once decay. Solutions: daily recalibration, adaptive decoders (closed-loop decoder adaptation), and features robust to drift.
  • Latency budget. Total loop delay (acquisition → processing → feedback) must stay low — <100-300 ms for motor BCIs, or the user cannot close the loop. Offline accuracy with 2-second windows is irrelevant if the real-time system lags.
  • Calibration design. Collect labeled data with the actual task the user will perform; keep sessions short (fatigue degrades both signal and motivation); interleave rest. More calibration data is not always better — stale data hurts adaptive decoders.
  • Closed-loop adaptation (CLDA). Update decoder parameters during use, guided by the user's intended vs decoded output. This co-adaptation (brain + algorithm learning together) is what makes chronic BCIs work — but unstable updates can diverge, so bound the learning rate.
  • Evaluation metrics. Information transfer rate (bits/min) for communication; target acquisition time and success rate for motor tasks; and crucially, metrics measured closed-loop with the user in the loop — offline cross-validation overestimates real performance.
  • User learning. The brain adapts to the decoder. Provide consistent, immediate feedback; keep the mapping stable enough to learn but adaptive enough to track drift. Report learning curves, not just final performance.
  • Ethics and expectations. Neural data is uniquely sensitive (medical, potentially identifiable). Consent must cover data reuse; never promise restored function a system cannot deliver — hype harms patients.

Practical workflow

  1. Define the task. What will the user actually do (spell, move a cursor, control a robotic arm)? Define success in user terms first, then derive engineering specs.
  2. Pick modality + paradigm. Non-invasive for accessibility, invasive for performance; choose the paradigm that fits the user's residual abilities.
  3. Build the real-time chain. Acquisition → preprocessing (causal filters only — no filtfilt in real time) → features → decoder → feedback. Measure end-to-end latency before any user testing.
  4. Calibrate. Short open-loop session with the real task; train an initial decoder; verify above-chance closed-loop control in the same session.
  5. Close the loop with adaptation. Enable CLDA with conservative updates; monitor for divergence; schedule recalibration.
  6. Evaluate properly. Closed-loop metrics over multiple sessions: ITR, success rate, learning curves, user workload/fatigue questionnaires. Compare against sensible baselines (e.g. existing assistive tech), not just chance.
  7. Document. Decoder architecture, update rules, latency, failure modes, and ethical safeguards. Plan long-term support — abandoning a BCI user is a harm.

Example pipeline sketch:

# per incoming chunk (causal, low-latency):
x = bandpass_causal(chunk, 8, 30)          # no zero-phase filtering live
feat = log_bandpower(x, window=250ms)
cmd = decoder.predict(feat)                # previously calibrated
clda_update(decoder, cmd, intended)        # bounded adaptation
render_feedback(cmd)                       # <200 ms total budget

Common pitfalls

  • Reporting offline cross-validated accuracy as "BCI performance."
  • Non-causal filtering in the real-time path (filtfilt looks into the future).
  • Ignoring latency — a 90%-accurate decoder with 2 s lag is unusable.
  • One-shot calibration with no adaptation plan for drift.
  • Unstable CLDA updates that diverge mid-session.
  • Paradigm-user mismatch (e.g. SSVEP for photosensitive users).
  • Overpromising clinical outcomes; underplanning long-term maintenance and support.

04 同仓库更多 Skills

TanNhatCMS
TanNhatCMS/jarvis

web-scrape

Turn web pages into LLM-ready markdown via the Firecrawl API (renders JS, anti-bot handling). Use when browser_open/fetch fails on JS-heavy pages, or when you need clean markdown/structured extraction from a site. Requires FIRECRAWL_API_KEY.

★ 0
TanNhatCMS
TanNhatCMS/jarvis

design-taste-frontend

tasteskill v2, the anti-slop frontend skill. Art direction for websites, distilled from a study of 247 curated gallery sites (One Page Love, Awwwards Sites of the Day). Deals researched directions (idea, composition, type, palette, photographs, section blueprints) from a library, enforces a strict no-slop house style with a real-browser inspector, and runs a look-and-fix loop on screenshots. Use this whenever you build, design, redesign, restyle, polish or review a landing page, marketing site, portfolio, product page, one-pager, hero or any public-facing web page, in any stack (HTML/CSS, React, Next.js, Vue, Svelte, Astro, Tailwind) — also when the user says a page looks generic, templated, "AI-made", sloppy, or asks to make it look designed, premium, award-level or less like every other site. Not for dashboards or app screens.

★ 0
TanNhatCMS
TanNhatCMS/jarvis

test-driven-development

Use when implementing any feature or bugfix, before writing implementation code

★ 0
TanNhatCMS
TanNhatCMS/jarvis

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes

★ 0
TanNhatCMS
TanNhatCMS/jarvis

requesting-code-review

Use when completing tasks, implementing major features, or before merging to verify work meets requirements

★ 0
TanNhatCMS
TanNhatCMS/jarvis

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).

★ 0