Functional Connectivity-guided spectral band selection for Motor Imagery Brain-Computer Interfaces (MI-BCIs). Ranks frequency bands using phase-based connectivity (wPLI, PLV, PLI) across sensorimotor channels to identify subject-specific discriminative bands, reducing CSP pipeline dimensionality while maintaining classification accuracy.
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
A direct command skips the review prompt. Inspect the source before running it.
Functional Connectivity-guided spectral band selection for Motor Imagery Brain-Computer Interfaces (MI-BCIs). Ranks frequency bands using phase-based connectivity (wPLI, PLV, PLI) across sensorimotor channels to identify subject-specific discriminative bands, reducing CSP pipeline dimensionality while maintaining classification accuracy.
["FC-guided band selection","functional connectivity BCI","MI-BCI spectral selection","wPLI PLV band selection","filter bank CSP band selection","phase connectivity motor imagery","subject-specific frequency bands","hemispheric coupling BCI"]
This skill implements Functional Connectivity (FC)-guided spectral band selection for Motor Imagery Brain-Computer Interfaces (MI-BCIs), based on the methodology described in "Functional Connectivity-Guided Band Selection for Motor Imagery Brain-Computer Interfaces" (arXiv: 2605.00746, Araújo do Carmo & Nagarajan, 2026).
The core insight: rather than using predefined frequency sub-bands in Filter Bank CSP (FBCSP), this method identifies the most discriminative spectral bands by calculating phase-based functional connectivity across sensorimotor channels, ranking bands by the effect size of their hemispheric coupling differences, and pruning to the top-K bands for feature extraction and classification.
Problem Statement
CSP Performance Dependency on Spectral Range
The Common Spatial Pattern (CSP) algorithm is the cornerstone of MI-BCI decoding, but its performance depends critically on the spectral range of the input EEG data:
Individual variability: User-specific neural rhythms (μ and β bands) vary significantly across individuals in both center frequency and bandwidth
Heuristic limitations: Standard FBCSP uses predefined, evenly-spaced frequency sub-bands (e.g., 4-8, 8-12, 12-16 Hz) that are not selected using subject-specific physiological criteria
Dimensionality waste: Using all bands in a filter bank increases computational cost and may include non-discriminative frequency ranges, introducing noise and overfitting
Volume conduction artifacts: Traditional coherence measures are contaminated by zero-lag volume conduction, obscuring true neural connectivity
Key Questions Addressed
Which frequency bands carry the most discriminative information for a given subject?
What is the minimum number of bands (K*) required to maintain performance within a 2% equivalence zone of the full filter bank baseline?
Which phase-based connectivity metric (wPLI, PLV, or PLI) provides the best trade-off between dimensionality reduction and inter-session robustness?
Methodology
1. Filter Bank Design
The EEG signal is decomposed into a filter bank of 9 contiguous sub-bands spanning 4–40 Hz:
Band Index
Frequency Range (Hz)
Physiological Interpretation
1
4–8
Theta
2
8–12
μ (mu) — sensorimotor rhythm
3
12–16
Low β (beta)
4
16–20
Low-mid β
5
20–24
Mid β
6
24–28
Mid-high β
7
28–32
High β
8
32–36
High β / low γ
9
36–40
Low γ
Each band is extracted using a zero-phase bandpass filter (e.g., 4th-order Butterworth, forward-backward via scipy.signal.filtfilt) to avoid phase distortion.
2. Phase-Based Connectivity Metrics
Three complementary phase-based connectivity metrics are computed for each band:
Weighted Phase Lag Index (wPLI)
Measures the asymmetry of the imaginary component of the cross-spectrum, weighted by magnitude:
wPLI = |E[|Im{X}| · sgn(Im{X})]| / E[|Im{X}|]
Advantage: Robust to volume conduction and common source artifacts
Mitigates volume conduction by weighting non-zero-lag components
More stable across recording sessions with varying electrode setups
Better generalization to unseen data
Weaknesses:
May require more bands (higher K*) to reach equivalence zone
Computationally slightly more expensive than PLV
May miss genuine zero-lag functional connectivity
Practical Recommendation
Use Case
Recommended Metric
Maximum compression, single-session
PLV
Cross-session / longitudinal studies
wPLI
Quick screening / resource-constrained
PLI
Clinical / real-world BCI deployment
wPLI
Research / maximum accuracy
Compare all three
Usage Examples
Basic Usage
from your_module import FCGuidedBandSelector, FBCSPWithFCSelection
# Initialize with PLV for aggressive dimensionality reduction
pipeline = FBCSPWithFCSelection(sfreq=250, metric='plv', n_csp_components=4)
# Fit on training data (shape: n_trials x n_channels x n_timepoints)
pipeline.fit(X_train, y_train, k=4) # Select top 4 bands# Predict
predictions = pipeline.predict(X_test)
# Access selected bandsprint(f"Selected bands: {pipeline.selector.selected_bands_}")
print(f"Band rankings: {pipeline.selector.band_rankings_}")
Finding Optimal K*
# Evaluate all K values
selector = FCGuidedBandSelector(sfreq=250, metric='wpli')
# ... (compute connectivity and rank bands as above) ...# Get accuracies for each K (requires cross-validation loop)
accuracies_k = {}
for k inrange(1, 9):
acc = cross_validate_with_k(X, y, k, ranked_indices)
accuracies_k[k] = acc
# Find optimal K*
baseline_acc = cross_validate_with_k(X, y, 9, ranked_indices)
k_star = selector.find_optimal_k(ranked_indices, accuracies_k, baseline_acc)
print(f"Optimal K*: {k_star} (baseline accuracy: {baseline_acc:.3f})")
Working with MNE-Python Datasets
import mne
from mne.datasets import eegbci
# Load BCI Competition IV-2a data (via MNE)# Note: Use the official dataset download for Competition IV-2a
raw = mne.io.read_raw_edf('A01T.edf', preload=True)
raw.filter(0.5, 100)
raw.notch_filter([50])
# Extract epochs
events = mne.find_events(raw, stim_channel='STI 014')
epochs = mne.Epochs(raw, events, event_id={
'left_hand': 1, 'right_hand': 2,
'foot': 3, 'tongue': 4
}, tmin=0, tmax=4, baseline=None, preload=True)
# Pick sensorimotor channels
epochs.pick_channels(['C3', 'CP3', 'C4', 'CP4'])
# Convert to numpy array
X = epochs.get_data()
y = epochs.events[:, 2]
# Run FC-guided band selection
pipeline = FBCSPWithFCSelection(sfreq=250, metric='wpli')
pipeline.fit(X, y, k=4)
Configuration Parameters
Parameter
Type
Default
Description
sfreq
float
250
EEG sampling frequency (Hz)
metric
str
'wpli'
Connectivity metric: 'wpli', 'plv', 'pli'
band_edges
list
9 bands 4–40 Hz
Custom filter bank definitions
n_csp_components
int
4
Number of CSP spatial filters per band
k
int
None (use all)
Number of top bands to select
equivalence_tolerance
float
0.02
2% accuracy tolerance for K* selection
channel_pairs
list
4 pairs
Sensorimotor channel indices for FC
Limitations and Considerations
Static vs. Adaptive: This method uses static band selection (computed once per subject). For adaptive BCIs, consider re-ranking bands online as neural patterns shift.
Channel Selection: The 4-channel sensorimotor selection is optimal for hand MI. Foot and tongue imagery may require additional channel pairs (e.g., Cz, FCz).
Filter Design: The 4 Hz band width is a design choice. Narrower bands increase frequency resolution but may reduce signal-to-noise ratio.
Effect Size Sensitivity: Cohen's d assumes approximately normal distributions. For small trial counts, consider permutation-based effect size estimation.
Multi-class Extension: The current methodology is demonstrated on 2-class MI. For 4-class (Competition IV-2a), apply the ranking per class pair and aggregate via voting or mean effect size.
Computational Cost: Connectivity computation scales as O(n_bands × n_channel_pairs × n_trials × n_timepoints). For large datasets, consider subsampling trials or using parallel computation.
Related Skills
eeg-brain-connectivity-bci: General EEG-based brain connectivity analysis for BCI applications
fc-guided-band-selection-mi-bci: Variant focusing on motor imagery-specific implementations
hermes-brain-connectivity: Comprehensive brain connectivity toolkit with multiple modalities
References
Araújo do Carmo, N., & Nagarajan, A. (2026). Functional Connectivity-Guided Band Selection for Motor Imagery Brain-Computer Interfaces. arXiv:2605.00746 [q-bio.NC, eess.SP].
Blankertz, B., et al. (2008). Optimizing spatial filters for robust EEG single-trial analysis. IEEE Signal Processing Magazine, 25(1), 41-56.
Vinck, M., et al. (2011). An improved index of phase-synchronization for electrophysiological data in the presence of volume-conduction, noise and sample-size bias. NeuroImage, 55(4), 1548-1565.
Lachaux, J.-P., et al. (1999). Measuring phase synchrony in brain signals. Human Brain Mapping, 8(4), 194-208.
Stam, C. J., et al. (2007). Phase lag index: Assessment of functional connectivity from multi channel EEG and MEG with diminished bias from common sources. Human Brain Mapping, 28(11), 1178-1193.
Ang, K. K., et al. (2008). Filter bank common spatial pattern (FBCSP) in brain-computer interface. IJCNN, 2390-2397.