| name | bandroutenet-eeg-artifact-removal |
| description | Adaptive frequency-aware neural network for EEG artifact removal using band-specific processing and routing mechanisms. Activation triggers: EEG denoising, artifact removal, BandRouteNet, EOG removal, EMG removal. |
BandRouteNet: Adaptive Band Routing Neural Network for EEG Artifact Removal
BandRouteNet introduces a novel adaptive frequency-aware neural network architecture that jointly exploits band-specific processing and full-band contextual modeling for effective EEG denoising.
Metadata
- Source: arXiv:2604.24428v1
- Authors: Phat Lam
- Published: 2026-04-27
- Category: Neuroscience, Signal Processing, Deep Learning
Core Methodology
Problem Statement
EEG signals are highly susceptible to contamination from:
- Electrooculographic (EOG) artifacts (eye movements, blinks)
- Electromyographic (EMG) artifacts (muscle activity)
- Mixed artifact conditions with diverse, temporally varying distributions
- Distinct spectral characteristics across frequency bands
Traditional denoising methods struggle because artifact patterns are frequency-dependent and time-varying.
Key Innovation
BandRouteNet combines:
- Band-wise denoising - explicitly captures frequency-dependent artifact patterns
- Adaptive routing mechanism - determines where and to what extent denoising should be applied across temporal locations within each frequency band
- Full-band conditioner - extracts global temporal context from original noisy EEG
Architecture
Noisy EEG Input
↓
┌─────────────────────────────────────┐
│ Full-Band Conditioner │
│ - Extracts global temporal context │
│ - Produces conditional parameters │
│ - Provides coarse signal refinement│
└──────────────────┬──────────────────┘
↓
┌─────────────┼─────────────┐
↓ ↓ ↓
[Delta Band] [Theta Band] [Alpha Band] ... (Band-wise Pathways)
↓ ↓ ↓
[Band-specific Denoising + Adaptive Routing]
↓ ↓ ↓
└─────────────┴─────────────┘
↓
[Signal Reconstruction]
↓
Clean EEG Output
Technical Components
1. Band-wise Processing Pathway
- Decomposes EEG into multiple frequency bands (delta, theta, alpha, beta, gamma)
- Each band processed independently to capture band-specific artifact patterns
- Adaptive routing determines temporal locations requiring denoising
2. Adaptive Routing Mechanism
- Learns to identify artifact-contaminated time segments
- Dynamically controls denoising intensity per band and time point
- Reduces over-denoising of clean signal regions
3. Full-Band Conditioner
- Processes original multi-band EEG signal
- Extracts global temporal dependencies
- Generates conditioning parameters for band-wise pathways
- Provides coarse-grained signal-level refinement
4. Multi-scale Fusion
- Combines band-specific outputs with global context
- Preserves frequency-specific features while maintaining temporal coherence
Implementation Guide
Prerequisites
torch >= 2.0
numpy
scipy
mne
Architecture Implementation
import torch
import torch.nn as nn
import torch.nn.functional as F
class AdaptiveBandRouter(nn.Module):
"""
Adaptive routing mechanism for band-specific denoising.
Determines where and how much to denoise within each frequency band.
"""
def __init__(self, channels, temporal_dim):
super().__init__()
self.routing_net = nn.Sequential(
nn.Conv1d(channels, channels//2, kernel_size=3, padding=1),
nn.ReLU(),
nn.Conv1d(channels//2, channels//4, kernel_size=3, padding=1),
nn.ReLU(),
nn.Conv1d(channels//4, 1, kernel_size=1),
nn.Sigmoid()
)
def forward(self, x):
routing_weights = self.routing_net(x)
return routing_weights
class BandWiseDenoiser(nn.Module):
"""
Band-specific denoising module with adaptive routing.
"""
def __init__(self, in_channels, hidden_channels):
super().__init__()
self.feature_extractor = nn.Sequential(
nn.Conv1d(in_channels, hidden_channels, kernel_size=5, padding=2),
nn.BatchNorm1d(hidden_channels),
nn.ReLU(),
nn.Conv1d(hidden_channels, hidden_channels, kernel_size=, padding=),
nn.BatchNorm1d(hidden_channels),
nn.ReLU()
)
.router = AdaptiveBandRouter(hidden_channels, temporal_dim=)
.denoising_head = nn.Conv1d(hidden_channels, in_channels, kernel_size=, padding=)
():
features = .feature_extractor(x)
routing_weights = .router(features)
denoised = .denoising_head(features)
output = routing_weights * denoised + ( - routing_weights) * x
output
(nn.Module):
():
().__init__()
.encoder = nn.Sequential(
nn.Conv1d(in_channels, , kernel_size=, padding=),
nn.ReLU(),
nn.MaxPool1d(),
nn.Conv1d(, , kernel_size=, padding=),
nn.ReLU(),
nn.MaxPool1d(),
nn.Conv1d(, cond_dim, kernel_size=, padding=),
nn.AdaptiveAvgPool1d()
)
():
.encoder(x).squeeze(-)
(nn.Module):
():
().__init__()
.n_bands = n_bands
.band_denoisers = nn.ModuleList([
BandWiseDenoiser(channels_per_band, hidden_channels=)
_ (n_bands)
])
.conditioner = FullBandConditioner(
in_channels=n_bands * channels_per_band,
cond_dim=cond_dim
)
.cond_projectors = nn.ModuleList([
nn.Linear(cond_dim, ) _ (n_bands)
])
.reconstruction = nn.Sequential(
nn.Conv1d(n_bands * channels_per_band, , kernel_size=, padding=),
nn.ReLU(),
nn.Conv1d(, n_bands * channels_per_band, kernel_size=)
)
():
x_full = torch.cat(x_bands, dim=)
cond = .conditioner(x_full)
denoised_bands = []
i, (denoiser, proj) ((.band_denoisers, .cond_projectors)):
band_cond = proj(cond)
denoised = denoiser(x_bands[i])
denoised_bands.append(denoised)
combined = torch.cat(denoised_bands, dim=)
refined = .reconstruction(combined)
output = refined + x_full
output_bands = torch.chunk(output, .n_bands, dim=)
output_bands
Preprocessing Pipeline
import numpy as np
from scipy import signal
def decompose_eeg_bands(eeg_signal, fs=256):
"""
Decompose EEG into frequency bands.
Args:
eeg_signal: [channels, time] EEG data
fs: Sampling frequency
Returns:
bands: Dict of band_name -> band_signal
"""
bands = {}
band_ranges = {
'delta': (0.5, 4),
'theta': (4, 8),
'alpha': (8, 13),
'beta': (13, 30),
'gamma': (30, 100)
}
for band_name, (low, high) in band_ranges.items():
nyquist = fs / 2
low_norm = low / nyquist
high_norm = high / nyquist
b, a = signal.butter(4, [low_norm, high_norm], btype='band')
filtered = signal.filtfilt(b, a, eeg_signal, axis=-1)
bands[band_name] = filtered
return bands
Training
def train_bandroutenet(model, train_loader, epochs=100, lr=1e-3):
optimizer = torch.optim.Adam(model.parameters(), lr=lr)
criterion = nn.MSELoss()
for epoch in range(epochs):
model.train()
total_loss = 0
for noisy_bands, clean_bands in train_loader:
optimizer.zero_grad()
denoised_bands = model(noisy_bands)
loss = sum(criterion(d, c) for d, c in zip(denoised_bands, clean_bands))
loss.backward()
optimizer.step()
total_loss += loss.item()
print(f"Epoch {epoch+1}/{epochs}, Loss: {total_loss/len(train_loader):.4f}")
Applications
- Neurological Diagnosis - Clean EEG for epilepsy detection, sleep staging
- Brain-Computer Interfaces - Artifact-free signals for BCI control
- Cognitive Neuroscience - High-quality data for ERP studies
- Clinical Monitoring - Continuous EEG in ICU settings
- Mobile EEG - Real-time denoising for wearable devices
Key Metrics
- Model Size: Only 0.2M trainable parameters (highly parameter-efficient)
- Performance: Outperforms existing methods on EEGDenoiseNet benchmark
- Artifacts: Handles EOG, EMG, and mixed artifacts
- Metrics: Optimized for RRMSE and SNR improvement
Pitfalls
- Band Selection - Frequency bands may need adjustment for specific applications
- Training Data - Requires paired clean/noisy EEG data for supervision
- Computational Cost - Multiple band pathways increase inference time
- Artifact Types - May not generalize to uncommon artifact types not in training
- Channel Count - Architecture assumes fixed number of input channels
Related Skills
- eeg-structure-guided-diffusion - EEG-based visual reconstruction
- eeg-tinnitus-biomarker-robustness - EEG biomarker analysis
- eeg-foundation-model-adapters - EEG foundation models
References
@article{lam2026bandroutenet,
title={BandRouteNet: An Adaptive Band Routing Neural Network for EEG Artifact Removal},
author={Lam, Phat},
journal={arXiv preprint arXiv:2604.24428},
year={2026}
}