# 实验分析计划

> 本页由仓库源文件生成。请不要直接编辑本页；修改下方 source 文件后运行 `vp run docs:generate`。

> 中文支持说明：本页是中文站点镜像，保留论文标题、证据状态和来源字段的原始表述，避免未经核实的翻译改变证据边界。

> 来源: `experiments/analysis-plan.md`

## SAH-BRI-Grasp Experiment Baseline And Analysis Plan

Status: `pre-data analysis freeze draft`

This plan freezes the intended baseline families, primary endpoints, analysis units, and claim boundaries for Exp1-Exp4 before data collection. It does not report results, effect sizes, p-values, or hardware-specific thresholds.

Companion files:

* `pre-data-freeze-checklist.md`: required items before evidence-producing sessions;
* `hardware-inventory.md`: canonical hardware and calibration inventory;
* `templates/session-record.md`: per-session record;
* `templates/threshold-freeze-record.md`: numeric thresholds frozen before data collection;
* `templates/trial-log-schema.md`: one-row-per-attempted-trial logging schema.

## Evidence Boundary

* Literature evidence supports the rationale for SSVEP selection, MI mode control, shared autonomy, object detection, grasp planning, and hand-eye calibration.
* Project performance claims remain `needs confirmation` until local experiments produce data.
* Thresholds for advancement, safety, and acceptance must be set before each data-collection session and recorded with the protocol version.

## Common Pre-Data Rules

1. Freeze the protocol version, software commit, hardware identifiers, calibration files, and randomization plan before collecting a session.
2. Record all attempted trials, including aborted, timed-out, rejected, and safety-blocked trials.
3. Separate training, pilot tuning, validation, and held-out test data. Do not tune thresholds on held-out test trials.
4. Report excluded trials with reasons; do not silently remove target-loss, no-control, planning-failure, or emergency-stop events.
5. Use within-participant comparisons where possible because BCI performance varies strongly across participants.
6. Report confidence intervals and failure-mode counts even when formal hypothesis tests are not yet justified.

## Analysis Unit And Dataset Split

| Item | Draft Binding | Remaining Confirmation |
| --- | --- | --- |
| primary analysis unit | attempted trial | exact trial counts per condition |
| repeated-measures unit | participant/session | participant count and session count |
| confirmatory dataset | held-out online or held-out replay trials collected after threshold freeze | final split sizes |
| tuning dataset | calibration, pilot, and validation trials only | pilot/test boundary per experiment |
| excluded data | retained in logs with exclusion reason | exclusion criteria before recruitment |
| failed/safety-blocked trials | included in denominators unless a pre-frozen exclusion rule applies | exact denominator per metric |
| randomization | block/order generated before session and stored with seed/file | final block sizes |

## Statistical Draft

The default analysis should be paired or within-participant when the same participant completes multiple conditions. If sample size is too small for confirmatory modeling, report descriptive estimates, confidence intervals where appropriate, and full failure-mode counts.

| Outcome Family | Preferred Draft Model | Fallback |
| --- | --- | --- |
| binary success/failure | mixed-effects logistic model or paired condition contrast | paired proportions and confidence intervals |
| continuous latency/time | mixed-effects model on latency or nonparametric paired comparison | median/IQR per condition |
| count outcomes | count model or paired rate comparison | count/rate table per condition |
| workload/preference | paired descriptive comparison | descriptive table only |

This draft does not authorize p-value or effect-size claims until participant count, trial count, and comparison strategy are frozen.

## ITR Timing Definitions

Use two `T` definitions when reporting ITR:

| ITR Variant | `T` Definition | Use |
| --- | --- | --- |
| raw-window ITR | EEG decision-window duration only | decoder comparison |
| practical-selection ITR | time from candidate freeze or stimulus onset to accepted selection, including confirmation/correction if the condition requires it | system-facing selection rate |

Both variants must report `M`, `P`, `T`, accepted-trial denominator, rejected-trial count, and whether corrections were included.

## Common Log Fields

Each experiment should log:

| Field | Purpose |
| --- | --- |
| participant/session/trial ID | reproducibility and repeated-measures analysis |
| protocol version and software commit | result traceability |
| condition and baseline label | planned comparisons |
| target object or command label | correctness scoring |
| EEG channels, window length, decoder, and confidence | BCI analysis |
| visual candidate boxes, track IDs, jitter, and loss events | scene-aware command-space analysis |
| MI command output and no-control state | false-activation analysis |
| robot plan, execution state, safety gate, and abort reason | closed-loop failure analysis |
| timestamps for stimulus, decision, plan, execution, and completion | latency decomposition |
| hardware and calibration record IDs | physical-system traceability |

## ITR Formula

Use the standard SSVEP/BCI ITR form:

```text
ITR = [log2(M) + P log2(P) + (1 - P) log2((1 - P) / (M - 1))] * 60 / T
```

`SSVEP-005` gives this form and notes that practical ITR should include gaze-shifting time in `T`; `BCI-001` supports bit rate / information transfer rate as a BCI evaluation metric. For Exp1, report both raw-window ITR and practical-selection ITR when candidate freeze, gaze/attention shift, confirmation, or correction time differ from the EEG window.

## Exp1: SSVEP-YOLO Dynamic Target Selection

Primary endpoint:

* Correct accepted target selection by visual condition and object count.

Primary baselines:

| Baseline | Role |
| --- | --- |
| fixed UI button SSVEP | controlled SSVEP selection reference |
| static scene candidate boxes | object-box layout without detector motion |
| recorded YOLO candidate boxes | realistic visual dynamics with replay control |
| live YOLO candidate boxes | online scene-aware target generation |

Secondary endpoints:

* response time;
* ITR;
* false selection rate;
* candidate jitter;
* target lost rate;
* correction count;
* workload.

Analysis rules:

* Treat participant as a repeated-measures factor.
* Plot speed-accuracy curves by EEG window length.
* Report target-loss and candidate-jitter events as explanatory variables, not only as exclusions.
* Compare fixed UI, static boxes, recorded YOLO, and live YOLO before using live detections in Exp3.

Advancement gate:

* Live YOLO candidate boxes should enter Exp3 only after pre-set selection-accuracy, target-loss, and jitter criteria are met. The numeric thresholds are `needs confirmation`.

## Exp2: MI Mode Control

Primary endpoints:

* false activation during rest/no-control;
* successful mode transitions for requested commands.

Primary baselines:

| Stage | Role |
| --- | --- |
| binary command set | establish separability |
| ternary command set | add no-control rejection |
| four-state command set | approximate full system mode control |

Secondary endpoints:

* classification accuracy;
* command latency;
* training time;
* per-class confusion;
* participant-specific stability.

Analysis rules:

* Report confusion matrices for each command set.
* Treat no-control rejection as a safety-critical endpoint, not as a secondary convenience metric.
* Analyze latency distributions separately from classification accuracy.
* Keep offline and online feedback results separate.

Progression gate:

* Move from binary to ternary and from ternary to four-state only after pre-set accuracy and false-activation criteria are met. The numeric thresholds are `needs confirmation`.

## Exp3: Closed-Loop Robotic Grasping

Primary endpoints:

* task success rate;
* grasp success rate.

Primary baselines:

| Baseline | Role |
| --- | --- |
| fixed command space vs scene-aware command space | tests the scene-aware command-space contribution |
| SSVEP-only vs SSVEP+MI | tests the hybrid BCI contribution |
| low-level discrete commands vs shared-autonomy high-level intent | tests autonomy delegation |
| simulation, offline replay, and physical robot ladder | separates software readiness from real-world execution risk |

Secondary endpoints:

* completion time;
* correction count;
* false activation;
* emergency stop frequency;
* abort rate;
* target lost rate;
* planning failure rate;
* unsafe command blocked count;
* workload and user preference.

Analysis rules:

* Report task-level outcomes and component-level failures separately.
* Use a failure taxonomy that distinguishes BCI error, target loss, grasp-pose failure, hand-eye/calibration failure, planning failure, execution failure, and safety stop.
* Decompose latency into perception, selection, confirmation, planning, execution, and verification intervals.
* Do not interpret YOLO detection success as grasp success.

Physical-robot gate:

* Physical trials require a validated hand-eye calibration record, a non-contact dry run, collision checks, pause/cancel controls, and emergency-stop verification. Calibration thresholds remain `needs confirmation` until hardware is bound.

## Exp4: Low-Channel Ablation

Primary endpoint:

* performance retained by reduced channel sets relative to the 16-channel reference.

Primary baselines:

| Baseline | Role |
| --- | --- |
| 16ch full-core | reference acquisition condition |
| 12ch, 8ch, 6ch subsets | staged low-channel reduction |
| 3ch SSVEP-only and 3ch MI-only | modality-specific minimal subsets |

Secondary endpoints:

* SSVEP accuracy and ITR;
* MI accuracy and false activation;
* closed-loop task success and completion time;
* setup time and subjective burden.

Analysis rules:

* Run offline replay before online low-channel control.
* Keep fixed-model channel-masking and subset-retrained analyses separate.
* Report degradation relative to 16ch rather than only absolute accuracy.
* Do not claim wearable readiness from offline replay alone.

Online gate:

* A reduced channel set should move to online control only after pre-set retention and false-activation criteria are met. The numeric thresholds and exact electrode sets are `needs confirmation`.

## Fields Still To Freeze

Before data collection, define:

* participant inclusion/exclusion criteria;
* trial counts per condition;
* exact EEG channel montage;
* EEG preprocessing and decoder training splits;
* exact `T` definition for raw-window and practical-selection ITR;
* statistical model or paired comparison strategy;
* multiple-comparison handling;
* numerical advancement and safety thresholds;
* hardware, robot, camera, calibration target, and control-stack identifiers.
