BioniChaos Logo
  • Home
  • About
  • Contact

EEG CONTROL TERMINAL

Expert Consensus Probability HIGH AGREEMENT
LPD
85%
GPD
5%
LRDA
2%
GRDA
1%
SEIZURE
5%
OTHER
2%
Advanced Signal Diagnostics
Dominant Frequency:8.4 Hz
Signal-to-Noise Ratio:18.2 dB
DC Offset Voltage:+0.2 mV
Peak Amplitude:142 µV
Filter Attenuation:-24 dB

Overview: The Mechanics of EEG Data Handling and Label Consensus

Electroencephalography (EEG) measures the voltage fluctuations resulting from ionic current flows within the brain's neurons. In clinical neurology and critical care settings, continuous multi-channel scalp EEG tracking is indispensable for diagnosing status epilepticus, non-convulsive seizures, metabolic encephalopathies, and focal brain lesions. However, raw EEG data acquired from clinical trials—such as the benchmark datasets utilized in the Kaggle Harmful Brain Activity Classification challenge—present extreme analytical difficulties due to transient physiological artifacts, equipment noise, and high inter-rater variability among board-certified epileptologists.

Distinguishing true epileptiform patterns from physiological mimicry requires analyzing dynamic spatial distribution and temporal continuity. Clinical classifications strictly distinguish between distinct patterns: Lateralized Periodic Discharges (LPDs), Generalized Periodic Discharges (GPDs), Lateralized Rhythmic Delta Activity (LRDA), Generalized Rhythmic Delta Activity (GRDA), electrographic seizures, and benign background rhythms. Mislabeling a periodic discharge as an active seizure can lead to improper aggressive administration of anti-seizure medications, whereas failing to detect non-convulsive status epilepticus risks permanent neurological deficits.

A primary bottleneck in real-world machine learning pipelines for neurodiagnostics stems from the choice between short segmented data snippets (e.g., isolated 10-second clips) versus continuous long-term recordings. Short snippets frequently suffer from windowing edge artifacts and fail to capture signal evolution—such as the spatial propagation and progressive frequency slowing characteristic of electrographic seizures. Furthermore, severe recording anomalies like Direct Current (DC) baseline shifts, 60 Hz powerline hum, high-frequency electromyographic (EMG) muscle tension, and slow respiratory baseline wander corrupt both raw time-series traces and Short-Time Fourier Transform (STFT) spectrogram matrices.

How to Use the Interactive Laboratory

This laboratory visualizer replicates the clinical EEG data review workflow, allowing you to manipulate signal synthesis parameters, apply active hardware-style digital filters, inject real-world physiological artifacts, and evaluate the impact on dynamic expert consensus probability scores in real time.

1. Epileptiform Pattern Selector: Select from six baseline neurological patterns (LPD, GPD, LRDA, GRDA, SEIZURE, or NORMAL). Observe how the multi-channel time-series traces (representing Fp1-F3, F3-C3, C3-P3, and P3-O1 longitudinal bipolar montage chains) shift in phase, amplitude, and spatial distribution across channels.

2. Artifact & Noise Injection: Toggle various real-world signal distortions. Toggle DC SHIFT to inject a sudden voltage step shift; toggle 60Hz HUM to introduce high-frequency powerline mains noise; activate EMG NOISE to add dense muscular contraction spikes; or turn on DRIFT to synthesize low-frequency respiratory baseline wander.

3. Active Digital Filters: Engage or bypass digital filtering blocks. The 0.5Hz HPF (High-Pass Filter) suppresses DC baseline shifts and slow drifts. The 35Hz LPF (Low-Pass Filter) eliminates high-frequency muscle artifacts. The 60Hz NOTCH filter sharply cuts out mains hum. Observe how stripping these filters dramatically degrades signal clarity and distorts the lower Fourier Spectrogram heatmap.

4. Display & Sonification Controls: Use VIEW MODE to toggle between a split-screen view (waveforms + spectrogram waterfall), full time-series view, or enlarged spectral view. Toggle SOUND to activate Web Audio API sonification, which maps raw electrical potential amplitudes into audible pitch frequencies for auditory pattern recognition.

5. Automated Demo & Baseline Reset: Click ▶ START DEMO located at the top of the control panel to initiate an automated diagnostic walkthrough that systematically cycles through patterns, injects noise, and demonstrates filter isolation. The button text will switch to ⏹ STOP DEMO with a pulsing indicator. Click STOP DEMO or adjust any control parameter to immediately halt the demo and restore your prior manual settings. Click ↺ RESET BASELINE to clear all noise and restore optimal filter parameters.

Technical Details: Mathematical Synthesis and Digital Filtering Engine

The visualizer generates synthesized multi-channel EEG signals in real time using linear combinations of harmonic trigonometric functions, stochastic Gaussian white noise, and discrete transient pulse functions. The baseline continuous activity for channel $k$ at time $t$ is formulated as:

$V_k(t) = A_{\alpha} \sin(2\pi f_{\alpha} t + \phi_k) + A_{\beta} \sin(2\pi f_{\beta} t) + A_{\delta} \sin(2\pi f_{\delta} t) + \eta(t)$

where $f_{\alpha} \approx 10\text{ Hz}$ represents occipital alpha rhythms, $f_{\beta} \approx 18\text{ Hz}$ represents frontal beta activity, $f_{\delta} \approx 2\text{ Hz}$ represents delta activity, and $\eta(t)$ represents background cortical noise. Transient epileptiform discharges like LPDs and GPDs are introduced via periodic sharp-wave kernel functions $\mathcal{S}(t) = \exp(-\lambda (t \pmod T)) \cdot \cos(2\pi f_{sp} t)$, localized across lateralized channels (Ch 1–2 for LPD) or synchronously across all channels (Ch 1–4 for GPD).

Digital filtering is computed using recursive infinite impulse response (IIR) single-pole and two-pole discrete-time implementations. The high-pass filter eliminates low-frequency baseline drift using the transfer equation:

$y[n] = \alpha \cdot (y[n-1] + x[n] - x[n-1]), \quad \text{where } \alpha = \frac{RC}{RC + \Delta t}$

The Short-Time Fourier Transform (STFT) spectrogram computes power spectral density across 32 discrete frequency bins spanning $0.5\text{ Hz}$ to $40\text{ Hz}$. A sliding window matrix buffers the recent 128 time samples of Channel 1, mapping log-transformed spectral power $P(f, t) = \log_{10}(1 + |X(f, t)|^2)$ into a dynamic color-mapped visual waterfall canvas ranging from deep black (zero power) to electric cyan, radiant amber, and pure white (peak power density).

Expert consensus probability scores are calculated dynamically using a soft-max response model over extracted signal features—including signal-to-noise ratio (SNR), spectral power ratio $\frac{P_{\delta}}{P_{\alpha}}$, inter-channel cross-correlation coefficients, and temporal periodicity variance. High noise levels without active filtering inflate the "OTHER" or "UNCLASSIFIED" probability bands, simulating the uncertainty faced by expert annotators when analyzing corrupted clinical recordings.

Future Directions & Clinical Engineering Integration

Future iterations of this laboratory suite aim to expand native 19-channel 10-20 international montage display support, incorporating dynamic topological scalp heatmaps rendered via WebGL shader pipelines. Integrating Independent Component Analysis (ICA) algorithms directly in client-side WebAssembly (WASM) will allow users to interactively isolate and blind-source-separate ocular blink artifacts and cardiac ECG artifacts from raw scalp signals.

Additionally, future updates will incorporate deep learning model inference (such as lightweight ONNX runtime execution of 1D ResNet and EfficientNet architectures trained on the Kaggle HMS dataset). This will enable direct comparison between simulated human expert consensus distributions and automated deep learning classification confidence vectors under varying real-world signal degradation scenarios.

Explore Related Biomedical Simulation Environments

  • Seizure Simulation & Dynamic 3D EEG Visualizer

    Simulate 3D cortical seizure propagation, epileptiform spike-wave dynamics, and full 19-channel EEG montage layouts.

  • ICA/PCA EEG Signal Blind Source Separation Visualizer

    Apply Independent Component Analysis and Principal Component Analysis to untangle overlapping neuronal signals and artifacts.

  • Real-Time Acoustic & Bio-Signal Spectrogram Analyzer

    Analyze frequency spectra and short-time Fourier transforms with interactive high-resolution waterfall displays.

  • Live Neural Mapping & Neurofeedback Training Visualizer

    Explore real-time cognitive metric streaming, frequency band power monitoring, and neurofeedback state dynamics.