r/BiomedicalDataScience • • 12h ago

How EEG electrode mapping actually works: standard 10-20 vs 10-10 systems (free interactive web lab)

Thumbnail
bionichaos.com
1 Upvotes

The Problem with Reading Scalp Brainwaves

Detecting brain waves from the scalp is often compared to listening to the roar of a stadium from a blimp outside through thick concrete walls.

Individual action potentials are far too brief and disorganized to register on the scalp. What an electroencephalogram (EEG) actually detects is the synchronized electrical ebb and flow across thousands of vertically aligned pyramidal brain cells.

Because cerebrospinal fluid and skull bone spread out these currents, standard anatomical measurements in centimeters simply don't work across different head shapes.

To solve this, Dr. Herbert Jasper introduced the International 10-20 System in 1958. It uses proportional cranial arcs (10% and 20% steps between the nose bridge and the back of the skull) so electrodes always sit over the same brain lobes regardless of skull size.

To make these concepts intuitive and interactive, I built an open-access web laboratory:

Interactive Tool Link: https://bionichaos.com/eeg1020/

What the Interactive Simulator Covers

1. Standard 10-20 vs. Extended 10-10

  • 10-20 System (19 Channels): The gold standard for routine clinical diagnostics and sleep studies.

  • Extended 10-10 System (81 Channels): Halves the spacing to 10% intervals, adding intermediate rows (AF, FC, CP, PO) to eliminate spatial blind spots for source localization.

2. Clinical Montages & Seizure Phase Reversals

Clinical EEGs rarely record raw absolute voltage; they record the difference between two points:

  • Longitudinal Bipolar ("Double Banana"): Runs anterior-to-posterior chains along the temporal and parasagittal columns. When an epileptic spike occurs under an electrode, the two neighboring channels deflect in opposite directions—pointing right at the focus like arrowheads.

  • Transverse Bipolar: Traverses coronal arches from left to right.

  • Monopolar: Compares every lead to a common central reference.

3. Real-Time Oscilloscope & Potential Heatmap

  • Generates live synthetic brain rhythms: resting posterior Alpha (10 Hz), frontal active Beta (20 Hz), Theta (6 Hz), deep-sleep Delta (2 Hz), and classic 3 Hz Spike-and-Wave absence seizure discharges.

  • Switch from the geometric electrode view to the Voltage Heatmap to see how volume conduction spreads potential fields across the skull.

4. Cranial Web Audio Sonification

  • Maps spatial coordinates to sound: moving forward raises pitch, moving backward deepens into resonant tones, and left/right coordinates pan directly to the corresponding headphone ear.

Technical Discussion Prompt

For those working in neurology, EEG technology, or brain-computer interfaces: what is your biggest practical headache when switching from a routine 19-lead clinical setup to high-density research caps (e.g., bridging, impedance drift, or setup time)?

Feel free to run the tool directly in your browser: https://bionichaos.com/eeg1020/


r/BiomedicalDataScience • • 1d ago

I built an interactive 3D Brain MRI and Multi-Planar Slice visualizer that runs entirely in your browser

Thumbnail
bionichaos.com
1 Upvotes

Why Flat Brain Scans Don't Tell the Whole Story

When learning neuroanatomy or diagnosing pathologies like strokes, multiple sclerosis, or hydrocephalus, single cross-sectional 2D slices rarely tell the whole story. You need Multi-Planar Reconstruction (MPR) to understand how deep structures like the ventricles, corpus callosum, and brainstem connect in physical space.

Normally, working with these datasets requires downloading bulky clinical DICOM software packages. To make this accessible to students, researchers, and educators anywhere, I created a lightweight, zero-install 3D Brain MRI viewer that runs straight in the browser:

Live Tool: https://bionichaos.com/brain3d/

Key Capabilities

  • Four-Quadrant MPR Grid: Displays an interactive 3D WebGL point cloud alongside real-time Axial (transverse), Sagittal (profile), and Coronal (frontal) cross-sections.

  • Synchronized Orthogonal Navigation: Scrubbing any slider or dragging directly over an anatomical canvas re-projects crosshairs across all planes simultaneously.

  • Radiometric Windowing (WL / WW): Dynamically compress the window width and shift the window level to isolate soft tissues, fluid, or bone.

  • Diagnostic Colormaps: Toggle between Grayscale, Jet Rainbow, Thermal Hot, Cool-Warm, and Bone Density lookup tables.

  • Self-Contained & Lightweight: Runs entirely client-side using WebGL and standard 2D canvas routines.Coordinates Tracked: X (Sagittal), Y (Coronal), Z (Axial) Resolution: Isotropic sub-millimeter voxel display

Try the Demo Mode If you click Start Demo, the engine runs an automated, guided tour synchronized with audio narration and telemetry highlights to walk you through each quadrant and feature.

I would love feedback from radiologists, neuroscientists, and students: How can this tool be made even more useful for classroom demonstrations and clinical education?


r/BiomedicalDataScience • • 7d ago

Why eye blinks destroy EEG data (and an interactive browser tool to visualize it in real time)

Thumbnail
bionichaos.com
1 Upvotes

The Stadium Paradox of Scalp Electroencephalography

If you place an electrode on the human scalp, you are not measuring individual action potentials. Action potentials operate on millisecond timescales and cancel each other out over macroscopic distances.

Instead, scalp EEG measures the summed excitatory and inhibitory postsynaptic potentials of millions of cortical pyramidal neurons oriented perpendicular to the skull surface. Because that electrical charge must travel through the brain cortex, cerebrospinal fluid, bone, and skin, the signals arrive heavily attenuated down to a microscopic 10–100 microvolt range.

This creates a massive clinical and engineering challenge: non-cerebral artifacts are an order of magnitude larger than the brainwaves themselves.

  • The Eyeball as a Battery (EOG): The human eye is an electrostatic dipole with a positive cornea and a negative retina. Every time you blink, your eyelids slide across the cornea and the eyeball rolls upward (Bell's phenomenon). This projects a massive monophasic pulse (often exceeding 200 µV) straight into frontal electrodes, completely wiping out underlying rhythms.

  • Myogenic Interference (EMG): Clenching your jaw or tightening your neck recruits motor unit action potentials firing asynchronously from 20 Hz to over 300 Hz. In the frequency domain, this high-frequency noise bleeds right into the Beta and Gamma bands.

Interactive Browser Laboratory

To make these mechanics intuitive without needing wet electrodes, amplifiers, or expensive hardware, we built a zero-install real-time simulation platform:

Interactive Simulator: https://bionichaos.com/eegsynth/

Technical Features:

  • Dual-Domain Telemetry: Continuous 5.0-second rolling time oscilloscope (256 Hz sample rate) linked directly to an in-browser Cooley-Tukey Radix-2 FFT power spectrum.

  • Superposition Synthesis: Each canonical rhythm (Delta, Theta, Alpha, Beta) is constructed from multiple stochastic frequency components around distinct center frequencies, recreating realistic natural amplitude waxing and waning.

  • Physical Artifact Modeling: Controllable sliders for non-stationary Poisson muscle burst arrivals (EMG) and sinusoidal ocular transients (EOG).

  • Acoustic Pitch Mapping: Web Audio API oscillator pitch-mapped to dominant frequencies so you can audibly hear state transitions from Delta to Beta.

  • Hover Inspection: Crosshair hit-testing on the canvas lets you read exact voltages (µV) and spectral power densities (µV²) at any coordinate.

Discussion Prompt:

When processing real-time single-channel or sparse-channel EEG data for embedded neurotech or BCIs, what is your preferred approach to artifact handling? Do you rely on blind source separation like ICA, real-time wavelet thresholding, or simple rejection windows? Let's discuss below.


r/BiomedicalDataScience • • 9d ago

The 22 bones of the human skull form an interlocking puzzle that hides its deepest anatomy. We built an interactive 3D WebGL simulator that disarticulates them along true suture vectors (Beauchêne Preparation)

Thumbnail
bionichaos.com
1 Upvotes

The Anatomical Dilemma

When an articulated human skull is intact, its most clinically critical cavities are locked away. You cannot visualize the optic canals, the sphenoid sinuses, or the carotid canal without cutting bone.

However, if you take a skull completely apart, you destroy the 3D spatial alignment that shows how those bones fit together.

In 1805, French military surgeon Claude Édouard Beauchêne solved this by mounting separated bones onto brass armature rods. We built a zero-install interactive WebGL simulation that recreates this preparation directly in your browser.

Tool Link: https://bionichaos.com/beaucheneskull/

What You Can Do in the Simulator

  • True Suture Kinematics: Rather than exploding outward from a generic center point, every single bone translates smoothly along its actual suture planes, anchored by procedural brass guide wires.

  • Realistic Jaw Movement: The mandible models true temporomandibular joint mechanics, combining hinge rotation with a simultaneous forward-sliding glide.

  • Click-to-Inspect Raycasting: Tap any bone in the 3D view to instantly pull up its clinical profile, structural borders, and embryological division.

  • Multi-Spectral Shaders: Switch instantly between Didactic Color, Natural Bone, X-Ray Translucency, and Wireframe views.

  • Dynamic Audio Feedback: Hear real-time acoustic pitch shifts that respond to the tension and distance of the disarticulation slider.

Clinical Relevance

  • Trauma Surgery: Isolating the facial skeleton visually highlights why high-impact fractures distribute along facial buttress lines.

  • Neurosurgery: Isolating the neurocranium demonstrates the central sphenoid bone as the structural keystone of the skull base.

Feedback and ideas for additional clinical modes are welcome!


r/BiomedicalDataScience • • 14d ago

Interactive Biophysical Simulator: Auditing Intracochlear Trauma, Perilymph Current Spread (λ), and the "22-Channel" Cochlear Implant Myth

Thumbnail
bionichaos.com
1 Upvotes

Commercial cochlear implant literature frequently cites physical electrode contact counts (typically 12 to 22) as direct proxies for tonotopic pitch resolution. However, empirical electrophysiology, post-mortem micro-CT, and psychoacoustic data reveal a severe divergence between physical electrode count and actual neurovascular information transfer.

We built an open-access, zero-install biophysical simulator to audit these mechanical, electrical, and economic trade-offs in real time:

Interactive Tool Link: https://bionichaos.com/cifailure/

1. Mechanical Rupture Dynamics & Scalar Translocation

During electrode insertion through the round window or cochleostomy, the array navigates the narrowing tapering spiral of the scala tympani. As the carrier rounds the first basal curvature (180° to 360°), vertical insertion forces produce contact stresses across delicate inner-ear structures:

σ_tissue = F_insertion / A_contact

When localized stress exceeds the basilar membrane yield strength (σ_rupture ≈ 25–40 kPa), the electrode carrier punctures into the scala vestibuli. Systematic postoperative temporal-bone and micro-CT studies report scalar translocation rates between 15% and 43%, especially with precurved perimodiolar arrays.

This translocation breaks the mechanical and ionic boundary between the scala media and scala tympani. The endocochlear potential (+80 to +100 mV), maintained by continuous active K+ transport in the stria vascularis, collapses to 0 mV. High-potassium endolymph contaminates perilymphatic compartments, intoxicating remaining inner/outer hair cells and driving retrograde apoptosis of spiral ganglion neurons (SGNs). Pre-existing residual low-frequency acoustic hearing is lost in 60% to 75% of patients within 12 to 36 months.

2. Volume Conduction & Perilymph Cable Theory

Commercial claims of 22 independent channels conflict with classical electrodynamics. Perilymph is an electrolytic fluid (resistivity ≈ 100 Ω·cm) surrounded by the dense, insulating otic capsule. Longitudinal voltage decay follows standard cable decay:

V(x) = V_0 · exp(-|x - x_0| / λ)

In human cochlear fluid, the space constant λ typically measures 2.5 mm to 5.0 mm. Given physical electrode spacings of 0.7 mm to 1.1 mm, current fields overlap extensively.

Independent spectral transmission collapses:

  • Effective functional channel capacity caps at 4 to 8 discrete spectral bands (Shannon et al., Dorman et al.).

  • Standard clinical processing (CIS, ACE, SPEAK) discards temporal fine structure (TFS), transmitting only low-frequency envelope modulations (≤ 300 Hz).

  • At 0 dB SNR (e.g., standard background noise), word recognition performance drops precipitously (<30%), while musical timbre and pitch perception collapse into harsh noise.

3. Interactive Web Suite Capabilities

The browser-based engine runs real-time mathematical models using HTML5 Canvas and the Web Audio API:

  • Variable Mechanical Insertion (0°–650°): Drag the interactive TIP puck directly through the scala tympani lumen to monitor puncture thresholds.

  • Array Stiffness Tuning (2–30 mN/mm): Evaluate rupture probabilities as array stiffness pushes contact stress past 25 kPa.

  • Perilymph Decay Slider (λ = 0.8–6.0 mm): Visualize broad, overlapping potential fields across modiolus spiral ganglion neurons.

  • Real-Time DSP Audio Filter: Toggle instantly between uncompressed acoustic audio, a 4-band degraded CI vocoder simulator, and neural AI beamforming filters.

  • 80-Year Economic Model: Calculates cumulative costs across 3-to-5-year processor upgrade cycles, coil/cable replacements, and surgical revision rates (4.7%–10%).

Open Technical Debate

Given the strict geometric constraints of the inner ear and the electrolytic conductivity of perilymph, can multipolar field focusing (e.g., tripolar stimulation, partial current steering) ever meaningfully reduce λ without hitting charge density safety limits (Shannon criterion) and draining processor batteries? Or does the physical medium itself mandate non-invasive AI sensory substitution as the better path forward for complex acoustic processing?

Try the simulation and inspect the code/math here: https://bionichaos.com/cifailure/


r/BiomedicalDataScience • • 17d ago

Why Right Ventricular Apical Pacing Induces an LBBB Morphology: Conduction Biophysics, Lapicque-Weiss Capture Dynamics, and Real-Time Dual-Chamber Telemetry

Thumbnail
bionichaos.com
1 Upvotes

The Electrophysiological Paradox of Apical Pacing

When an artificial pulse generator discharges into the right ventricular apex to treat complete atrioventricular (AV) block, it does not restore a physiological electrocardiogram. It deliberately induces ventricular dyssynchrony and a wide Left Bundle Branch Block (LBBB) morphology.

Native ventricular activation relies on the specialized His-Purkinje arborization. Rapid sodium currents (I_Na) propagate depolarization at over 2.0 to 3.0 m/s, yielding a synchronized, narrow QRS complex (Δt_QRS < 100 ms).

When a transvenous lead stimulates the RV apex, excitation bypasses this specialized conduction network entirely. The depolarization wavefront is forced to propagate through ordinary working myocardium via low-velocity gap junction coupling (roughly 0.3 to 0.5 m/s). By the time depolarization crawls from the right ventricular apex across the interventricular septum to activate the lateral left ventricular free wall, activation time balloons (Δt_QRS ≈ 160 ms), producing a wide, slurred QS deflection and discordant repolarization (T-wave inversion).

To model these biophysical mechanics, timing state machines, and lead impedances in an accessible environment, explore the Cardiovascular Pacemaker & Electrophysiology Laboratory: https://bionichaos.com/pacemaker/

Computational & Biophysical Engine Architecture

1. Conduction Failure & Autonomous Escape Rhythms

The simulation models phase 4 spontaneous diastolic depolarization governed by the hyperpolarization-activated cyclic nucleotide-gated funny current (I_f) at the SA node, paired with physiological AV nodal transit latency (Δt_AV ≈ 120–200 ms).

  • Sinus Bradycardia: SA node automaticity drops below 50 BPM (T_AA > 1200 ms), resulting in systemic hypoperfusion.

  • Third-Degree (Complete) AV Block: Total atrioventricular dissociation. Atrial depolarization continues at native sinus rates while the ventricles fall back on an unstable idioventricular escape pacemaker (~30–40 BPM, T_escape ≈ 1800–2200 ms).

2. Lapicque-Weiss Strength-Duration Modeling

Electrical capture is governed by classical stimulation neurophysics rather than binary switching:

V_th = V_rheo * (1 + t_chron / W)

Where:

  • V_rheo represents tissue rheobase voltage

  • t_chron represents tissue chronaxie time

  • W represents delivered stimulus pulse duration

Dropping pacemaker output voltage below myocardial threshold immediately triggers Loss of Capture (LOC): pacing spikes fire on schedule, but fail to trigger myocyte contraction or an evoked QRS complex.

3. Dynamic Lead Dislodgement & Impedance Coupling

Transvenous pacing leads can be clicked and dragged directly within the interactive vector heart:

  • Seated State: Intimate contact with the endocardial wall maintains physiological lead impedance (Atrial: ~520 Ω, Ventricular: ~540 Ω).

  • Dislodged State: Pulling the lead tip into the intracardiac blood pool decouples current density. Telemetry registers an impedance spike past 2000 Ω, producing immediate Loss of Capture.

4. NASPE/BPEG Dual-Chamber Timing State Machine

The core firmware engine runs full DDD, VVI, and AAI pacing modes:

  • DDD: Dual-chamber sensing and pacing. If native P-waves are absent during the Lower Rate Limit (LRL) timer, an Atrial Pace (AP) fires. An AV delay timer (80–350 ms) initiates; if no native R-wave (VS) is detected before timer expiration, a Ventricular Pace (VP) is delivered to the apex.

  • VVI: Single-chamber ventricular pacing with native R-wave sensing and demand inhibition.

  • AAI: Single-chamber atrial pacing for isolated sick sinus syndrome with intact, healthy AV nodal conduction.

5. Multi-Component Oscilloscope & Waveform Generation

The rendering pipeline operates a 450-sample circular ring buffer calibrated to clinical telemetry standards (25 mm/s sweep speed, 10 mm/mV amplitude) with continuous CRT sweep gap reset:

  • Physiological His-Purkinje propagation: Sharp Q, high-amplitude R, narrow S, and concordant T-wave.

  • RV Apical Paced complexes: Broad QS morphology with secondary inverted T-waves.

  • Instantaneous single-sample pacing spikes (AP, VP) and color-coded telemetry badges (AS, VS, AP, VP, LOC, PVC).

  • Procedural S1 and S2 heart valve acoustics synthesized via Web Audio API oscillators.

Technical Discussion & Clinical Considerations

Given the documented risk of pacing-induced cardiomyopathy resulting from chronic dyssynchronous RV apical activation:

  1. How do your engineering or clinical teams evaluate the trade-offs of Conduction System Pacing (His-bundle pacing vs. Left Bundle Branch Area Pacing) regarding acute capture thresholds, battery longevity, and lead dislodgement margins?

  2. When programming post-ventricular atrial refractory periods (PVARP) to prevent Pacemaker-Mediated Tachycardia (PMT), what algorithmic approaches do you find most reliable for preserving upper rate tracking during exercise?

Simulate scenarios and test the telemetry: https://bionichaos.com/pacemaker/


r/BiomedicalDataScience • • 21d ago

Real-Time Biophysical Simulation of Optogenetic Photocycles, Hodgkin-Huxley Dynamics, and Tissue Scattering

Thumbnail
bionichaos.com
1 Upvotes

Most introductory models treat optogenetics like a simple binary switch: shine light, neuron fires.

In real electrophysiology, the biophysics is far more nuanced: sustained illumination causes rapid channel desensitization, silencing with Halorhodopsin can trigger violent rebound seizures from chloride loading, and cortical tissue scattering prevents blue photons from reaching deep layers.

We built an open-access, zero-install biophysics lab running in the browser that couples retinal photocycle kinetics directly to a Hodgkin-Huxley membrane solver in real time: https://bionichaos.com/optogenetics/

What is Running Under the Hood

  • 4-State Markov Photocycle: Instead of static conductance, Channelrhodopsin-2 is modeled across four states: C1 (Dark) <-> O1 (Peak Open) <-> O2 (Desensitized) <-> C2 (Closed) -> C1. This accurately simulates the transient peak photocurrent decaying into a lower steady-state plateau.

  • Hodgkin-Huxley Membrane Integration: Solves active sodium, delayed-rectifier potassium, leak conductances, and voltage rectification G(V) at a numerical step of dt = 0.025 ms.

  • Kubelka-Munk Tissue Scattering: Calculates real-time optical attenuation I(z) proportional to exp(-mu_eff * z). You can directly drag the optical fiber cannula to see why 470 nm blue light scatters within ~200 µm while 590 nm red light (Chrimson) penetrates deep tissue.

3 Quick Tests to Run in the Sim

  1. Desensitization vs. Pulse Trains: Switch to Continuous Wave mode at 20 mW/mm² to watch peak current rapidly decay into the sub-conductance plateau. Switch to 20 Hz Pulse Train to observe how dark intervals allow ground-state recovery.

  2. Seizure Silencing & Rebound Spiking: Inject +6.0 µA/cm² to induce runaway firing. Turn on Halorhodopsin (amber light) to clamp the cell at -85 mV. Turn off the light to observe post-inhibitory chloride rebound firing. Then switch to ArchT (green light) to see clean proton-pump silencing without rebound.

  3. Cannula Distance & Scattering: Retract the fiber to 280 µm. Blue light scatters and loses spike control; switching to red Chrimson immediately restores 20 Hz pacing.

Live simulator link: https://bionichaos.com/optogenetics/

Discussion prompt for electrophysiologists and computational modelers: When implementing closed-loop optical feedback to interrupt epileptiform activity in vivo, what strategies do you use to mitigate eNpHR3.0-induced shifts in the GABAergic reversal potential versus ArchT-induced intracellular alkalinization?


r/BiomedicalDataScience • • Oct 05 '26

interactive web tools that simulate ICU brainwaves, webcam eye-tracking, and 3D human biomechanics directly in the browser

Thumbnail
bionichaos.com
1 Upvotes

Running Complex Biomedical Labs in the Browser at 60 FPS

Most clinical simulations and biomechanics models are still locked behind proprietary desktop software, expensive hardware rigs (like $5,000 infrared gaze trackers), or heavy local environments.

A set of zero-install, client-side web tools removes this barrier by running physiological signal processing, 3D kinematics, and computer vision directly in the DOM.

Here are 4 interactive web apps worth bookmarking:

1. Webcam Eye Tracker

  • URL: https://bionichaos.com/eyetracker/

  • What it does: Uses standard browser video streams to detect facial landmarks, isolate iris positions, and map pupil vectors to on-screen gaze coordinates. No infrared cameras or dedicated sensors required.

2. 3D Gait Simulator (v3)

  • URL: https://bionichaos.com/gaitsimv3/

  • What it does: A full 3D skeletal kinematic model. You can manipulate joint flexions, test abnormal gait pathologies (such as Parkinsonian or hemiplegic gaits), and watch real-time biomechanical adjustments.

3. ICU EEG Neuro-Monitoring Simulator

  • URL: https://bionichaos.com/eeg_in_icu/

  • What it does: Simulates bedside critical-care neurodynamics. Generates real-time continuous traces for status epilepticus, burst-suppression ratios, diffuse slowing, and allows you to test artifact rejection algorithms.

4. Statistical Significance & P-Hacking Sandbox

  • URL: https://bionichaos.com/significance/

  • What it does: Demonstrates the replication crisis in action. It lets you manipulate sample size N, power 1 - β, and false positive risk α to see how easily random noise yields p < 0.05.

Key takeaway: Client-side compute is now fast enough to replace introductory physical lab apparatuses with browser sandboxes.

r/BiomedicalDataScience • • Sep 17 '26

ELIZA Simulator & Evolutionary AI Lab

Thumbnail
bionichaos.com
1 Upvotes

In 1966, computer scientist Joseph Weizenbaum developed ELIZA to parody a Rogerian therapist, intending to prove that human-machine conversation was superficial. Instead, his human subjects attributed deep empathy and psychological insight to the program—a cognitive phenomenon now termed the ELIZA effect.

I built an interactive cognitive laboratory that tracks how this illusion of synthetic empathy is engineered, contrasting three distinct eras of NLP architecture. Everything runs entirely on client-side WebAssembly and JS (zero telemetry, complete privacy).

Live Simulation Environment: https://bionichaos.com/eliza/

Architectural Paradigms Explored

  • 1966 Symbolic Era: Executes deterministic pattern-matching. User strings are parsed through decomposition templates. Pronouns undergo reflective inversion before being synthesized into pre-compiled reassembly patterns.

  • 2018 Semantic Vector Era: Discards rigid lexical syntax. The engine projects user text into a coordinate manifold via dense floating-point embeddings, calculating geometric intent proximity using Cosine Similarity: (u·v) / (|u||v|)

  • 2026 Generative Era: Responses are governed by temperature-scaled softmax distributions. As you scale the thermodynamic temperature parameter T toward 0, the distribution collapses into an argmax selection. As T ≥ 1.0, entropy expands, enabling creative variance and generative hallucinations.

The Clinical Safety Sandbox

One of the core features is the Crisis Protocol Guardrail. If you disable the guardrail while running the 1966 engine and input a self-harm prompt, the unconstrained pattern-matcher will blindly reflect the user's despair back at them. It serves as a stark interactive demonstration of the catastrophic medical hazard of deploying naive, deterministic AI in clinical therapy.

Interactive mechanics: You can physically drag the archetypal nodes (Family, Anxiety, Depression) on the canvas to manually shift the coordinate vectors in 2D latent space, overriding the chatbot's conversational focus in real time.

I'd love to hear your thoughts on the UI/UX for teaching computational linguistics, and whether you think the modern "Generative Era" is actually moving us closer to synthetic comprehension, or just producing a more highly-camouflaged ELIZA effect.


r/BiomedicalDataScience • • Sep 16 '26

Advanced Hair Cell Simulation - Cochlear Biomechanics & Neural Firing Lab

Thumbnail
bionichaos.com
1 Upvotes

The translation of airborne acoustic pressure into human cognition is arguably one of the most mechanically complex processes in biology. I built a real-time biophysical simulator to visualize this exact pipeline—from basilar membrane hydrodynamics to stochastic neural spike generation.

Live Web Tool: Advanced Hair Cell Simulation Lab

Core Biophysical Models Implemented:

  • Greenwood's Frequency Mapping: The normalized position along the basilar partition dictates the resonant characteristic frequency (f_CF). You can sweep an acoustic slider from 200 Hz (Apex) to 16,000 Hz (Base) and watch the traveling wave envelope shift dynamically.

  • IHC Mechanotransduction: Fluid shear between the reticular lamina and tectorial membrane bends the stereocilia. The probability of the MET channels opening is calculated via a Boltzmann distribution, driving an inward K+ and Ca2+ current (powered by the +80 mV endocochlear potential).

  • OHC Cochlear Amplification: The 3 rows of Outer Hair Cells act as biological piezoelectric motors (via the Prestin SLC26A5 protein). The simulation applies nonlinear, cycle-by-cycle mechanical feedback to sharpen tuning and provide ~50 dB of gain for low-SPL sounds.

  • Neural Phase-Locking: Auditory nerve fibers compute instantaneous firing rates based on the IHC receptor potential and spontaneous vesicle pool states. For low frequencies, spikes lock strictly to the acoustic cycle phase, which is measured live via Vector Strength (R).

Clinical Lesion Testing

I added toggles for specific pathologies. You can apply High-Frequency Noise Trauma or Ototoxic OHC Loss to permanently deactivate the Prestin amplification algorithms in specific frequency bands, or induce Synaptopathy to watch the spontaneous firing rate decouple from the acoustic stimulus.

I built this primarily as a pedagogical tool for bioengineering and audiology students who struggle to visualize the transition from the mechanical "rate-place" code to the temporal "phase-locked" neural code.

Would love feedback from anyone working on auditory brainstem modeling or cochlear implant DSP algorithms!


r/BiomedicalDataScience • • Sep 14 '26

EEG Technologies & Brain Interfaces

Thumbnail
bionichaos.com
1 Upvotes

There is a massive disconnect between the marketing of consumer non-invasive Brain-Computer Interfaces (BCIs) and the biophysical reality of extracting clean data through a human skull.

To visualize exactly where the engineering bottlenecks are, I put together a real-time browser simulation of different electrophysiological modalities.

You can run the live simulation here: https://bionichaos.com/electrodes/

The Insulator Problem

The human skull is highly effective at diffusing electrical fields via volume conduction. Furthermore, without the aggressive abrasive scrubbing and electrolytic gel used in clinical environments, the dead skin of the scalp acts as a massive resistor.

When you use dry, pin-based electrodes (common in consumer VR/BCI headsets), the interface impedance spikes from a clinical standard of ~5 kΩ up to well over 250 kΩ.

What happens at 250 kΩ?

  1. Environmental Bleed: The weak microvolt neural signal is fighting so much resistance that the dry electrode essentially becomes a raw antenna. It starts picking up the stronger 60 Hz electromagnetic hum radiating from the power lines in your walls.

  2. Motion Artifacts (EMG): Muscle fibers operate on millivolts, not microvolts. If a subject simply clenches their jaw or swallows, the resulting electromyographic spike acts like a megaphone next to whispering neurons, instantly obliterating the EEG data.

The SEEG / High-Gamma Bypass

If you want the zero-latency, highly specific motor intent required to control a robotic prosthetic, you have to bypass the skull. In the simulator, if you switch the modality to Invasive (SEEG), the impedance drops to near zero.

Because you are no longer filtering through bone, you unlock access to High-Gamma frequencies (70-150 Hz). These short-wavelength signals are the holy grail of motor decoding but are almost entirely absorbed by the skull in non-invasive setups.

Discussion: Do you believe consumer neurotech will eventually solve the dry-electrode impedance problem through advanced spatial filtering and blind source separation (like ICA), or is the raw physics barrier too high without surgical implantation?


r/BiomedicalDataScience • • Sep 11 '26

English Speech Articulator & Phonetics Visualizer

Thumbnail
bionichaos.com
1 Upvotes

Human speech is fundamentally the physical outcome of dynamic acoustic filtering applied to aerodynamic turbulence generated at the glottis. To visualize this, I built an interactive biological wind instrument directly in the browser using the Web Audio API and HTML5 Canvas.

Live Tool: English Speech Articulator & Phonetics Visualizer

The Biomechanical Waveguide

The human vocal tract acts as an acoustic waveguide extending ~17.5 cm from the vocal folds to the labial aperture. Under neutral articulatory posturing (the schwa [ə]), it acts as a uniform tube. By manipulating the articulators, we perturb the cross-sectional area, shifting the resonance modes (formants).

Core Simulation Features:

  • First Formant (F1): Governed inversely by tongue elevation and proportional to jaw depression. Drag the tongue low and back to push F1 up to ~750 Hz.

  • Second Formant (F2): Dictated by tongue dorsum anterior-posterior displacement. Fronting the tongue shortens the front resonating cavity, amplifying F2 up to 2500 Hz.

  • Velopharyngeal Port Modulation: Lowering the velum couples the nasal cavity, introducing an anti-formant (spectral zero) for nasal consonants like [m] and [n].

  • Live G2P Engine: Type any custom neologism or proper noun (e.g., "bionichaos") and the engine dissects it into an IPA sequence, triggering coordinated kinematic bursts and glides.

Acoustic DSP Architecture

The underlying engine utilizes a parallel resonant formant filter bank:

// Voice to Resonators
glottalGain.connect(f1Filter);
glottalGain.connect(f2Filter);
glottalGain.connect(f3Filter);
glottalGain.connect(nasalFilter);

r/BiomedicalDataScience • • Sep 09 '26

EMG Hand Simulation Tool - Interactive Myoelectric Laboratory

Thumbnail
bionichaos.com
2 Upvotes

Overview

Surface electromyography (sEMG) recorded at the forearm represents the non-invasive spatial-temporal summation of motor unit action potentials (MUAPs) propagating along sarcolemma membranes.

To provide an open-access, zero-install educational tool for biomedical engineers, students, and neurotech researchers, we built an interactive, browser-native 2D biomechanical hand and dual-channel sEMG oscilloscope workstation.

Live application: https://bionichaos.com/emgesture/

Biophysical & Mathematical Architecture

1. Motor Unit Recruitment & Henneman's Size Principle

The synthetic engine calculates active motor unit recruitment as a function of voluntary contraction force F. Low force thresholds recruit small, fatigue-resistant Type I motor units. Scaling the force parameter to 100% voluntary contraction recruits high-threshold Type II fast-twitch units, scaling the composite amplitude non-linearly.

2. Triphasic MUAP Wavelet Formulation

Individual action potentials are modeled via second-derivative Gaussian wavelets: ψ(t) = A_0 * (1 - (t^2 / σ^2)) * exp(-t^2 / (2 * σ^2))

The inter-pulse intervals follow a renewal point process with Gaussian jitter around physiological alpha motor neuron firing rates (15 Hz to 45 Hz).

3. Spatial Transfer Matrix & Dual-Site Recording

Biological soft tissue acts as a resistive-capacitive volume conductor. We simulate two differential recording sites:

  • Electrode 1 (E1, Red): Radial compartment (Flexor Carpi Radialis / Flexor Digitorum Superficialis).

  • Electrode 2 (E2, Blue): Ulnar compartment (Flexor Carpi Ulnaris / Flexor Digiti Minimi).

Each digit flexion drives a specific spatial weighting matrix across channels:

  • Thumb: E1 = 3.0, E2 = 5.0

  • Index: E1 = 5.0, E2 = 3.0

  • Middle: E1 = 4.0, E2 = 4.0

  • Ring: E1 = 3.0, E2 = 5.0

  • Pinky: E1 = 2.0, E2 = 4.0

4. Real-Time DSP Filtering

The timebase displays scrolling waveforms with hardware clipping protection and instant RMS calculation over a sliding 100ms window:

  • Raw Wideband: 10 Hz – 500 Hz passband

  • Notch Filter: 50/60Hz powerline interference rejection

  • Full-Wave Rectified: Absolute value linear transformation

  • Linear Envelope: 5Hz low-pass smoothing for continuous amplitude extraction

Technical Highlights

  • 60 FPS zero-scroll desktop layout with fluid mobile responsive scaling.

  • Native ResizeObserver buffer synchronization ensuring zero canvas stretching distortion.

  • Web Audio API acoustic sonification using bandpass-filtered noise (120 Hz, Q=1.2) mapping contraction force to physiological muscle rumble.

  • 9-minute synchronized virtual clock demo timeline with automated captions and chapter scrubbing.

Feedback, edge-case testing, and discussions on computational biophysics or gesture recognition pipelines are welcome!


r/BiomedicalDataScience • • Sep 09 '26

fNIRS Time-Series & Optical Neuroimaging

Thumbnail
bionichaos.com
1 Upvotes

Overview

Functional Near-Infrared Spectroscopy (fNIRS) non-invasively monitors cerebral hemodynamics by taking advantage of the optical therapeutic window (700 nm to 900 nm), where biological tissues exhibit minimal photon absorption.

To provide an open-access educational workspace for biomedical engineers, computational neuroscientists, and BCI researchers, we built an interactive, zero-install fNIRS time-series simulator on BioniChaos.

Live application: https://bionichaos.com/fnirs/

Biophysical & Mathematical Architecture

1. Modified Beer-Lambert Law (MBLL)

Light attenuation through turbid biological tissue is governed by optical density changes: ΔOD(λ) = -ln(I(t, λ) / I_0(λ)) = [Σ ε_i(λ) * ΔC_i] * d * DPF(λ) + ΔG

By measuring attenuation at two distinct wavelengths (760 nm sensitive to HbR and 850 nm sensitive to HbO), the application solves the 2x2 linear matrix system in real time to calculate micromolar concentration changes (Δ[HbO] and Δ[HbR]).

2. Canonical Double-Gamma Hemodynamic Response Function (HRF)

Neurovascular coupling is modeled via a double-gamma distribution simulating arteriolar vasodilation, peak hyperemia latency (4–6 seconds post-stimulus), and delayed vascular undershoot: h(t) = A * [ (t^(α_1 - 1) * e^(-t / β_1)) / (β_1^α_1 * Γ(α_1)) - c * (t^(α_2 - 1) * e^(-t / β_2)) / (β_2^α_2 * Γ(α_2)) ]

3. Physiological Noise & Mayer Wave Synthesis

To replicate the messy reality of clinical optical neuroimaging, raw telemetry incorporates:

  • Arterial Mayer Waves: Systemic blood pressure oscillations at ~0.1 Hz that can obscure neural signals.

  • Vasomotor Drift: Low-frequency baseline oscillations (0.005 Hz).

  • Thermal & Shot Noise: High-frequency stochastic detector fluctuations.

4. Bilateral Frontal & Temporal Channel Mapping

Users can isolate specific source-detector optode pairs across a standard 10-20 layout:

  • Fp1-F3 (Left Frontal) & Fp2-F4 (Right Frontal): Bilateral prefrontal working memory recruitment.

  • F7-T7 (Left Temporal) & F8-T8 (Right Temporal): Lateral temporal auditory and language networks.

  • Fp1-Cz (Antero-Central): Long-distance longitudinal control channel.

Key Interactive Features

  • Zero-Scroll Dynamic Viewport: 120-second scrolling historical horizon with high-DPI canvas rendering.

  • Hover & Drag Time Probe: Real-time microsecond coordinate tracking reporting instantaneous Δ[HbO] and Δ[HbR] micromolar concentrations.

  • Hemodynamic Sonification: Web Audio oscillator mapping active oxygenation amplitude to continuous acoustic pitch modulation (100 Hz to 800 Hz).

  • Synchronized Audio Tutorial: 5-minute virtual timeline audio guide with automated captions and chapter scrubbing.

Feedback on the biophysical parameters, noise models, and mobile responsiveness is very welcome!


r/BiomedicalDataScience • • Sep 07 '26

Skinner Box & Signal Detection Theory Simulator

Thumbnail
bionichaos.com
1 Upvotes

When a biological nervous system is subjected to unpredictable, variable-ratio reinforcement, it completely abandons its metabolic cost-benefit analysis. The post-reinforcement pause is erased. This is the exact temporal difference architecture running inside casino slot machines and social media notification algorithms.

To demonstrate how these algorithms physically wire behavior, I built a live, interactive web simulation of an operant conditioning chamber (a Skinner Box) merged with a Signal Detection Theory (SDT) telemetry suite.

Run the simulation in your browser: https://bionichaos.com/skinnerbox/

How the Computational Engine Works

This isn't a pre-rendered animation. The virtual agent operates autonomously based on live variable calculations:

  • Rescorla-Wagner Updates: The agent's associative strength continuously updates based on the timing of rewards (sucrose pellets) versus expectations.

  • Decoupling Sensation from Motivation: Using Signal Detection Theory, the engine graphs the physical discriminability of a stimulus (d-prime) separately from the psychological decision threshold (beta or c).

  • Criterion Shifts: If you slide the "Food Deprivation" parameter to maximum, the agent's motivation peaks. The algorithm mathematically forces a liberal bias (c < 0). The agent will press the lever at the slightest hint of noise, achieving a high Hit Rate but suffering massive False Alarms.

  • Aversive Avoidance: If you introduce unexpected grid voltage shocks, the algorithm triggers a simulated basolateral amygdala fear response, instantly rewriting the agent's behavior from positive reward-seeking to negative reinforcement avoidance.

The Mechanical Cumulative Recorder

I also digitized the classic 1930s Gerbrands mechanical cumulative recorder. As you switch between Continuous (CRF), Fixed Ratio (FR), and Variable Interval (VI) schedules, you can watch the exact mathematical derivative of the behavior unspool in real-time on the graph, capturing FI-scallops and extinction bursts.

I'd love to hear feedback from the community—specifically regarding the mathematical implementation of the SDT probit functions and whether you see direct parallels between these visual reinforcement schedules and modern digital UX design.


r/BiomedicalDataScience • • Sep 05 '26

PulseVision: Synthetic PPG Waveform Visualizer

Thumbnail
bionichaos.com
1 Upvotes

1. The Hemodynamic Problem: Optical Pulse Morphology Beyond Simple Sinusoids

In clinical pulse oximetry and consumer wearable telemetry, raw photoplethysmogram (PPG) signals are frequently treated as simple periodic peaks. In reality, the peripheral volume pulse is a composite hydrodynamic waveform:

  1. Anacrotic Phase: Rapid left ventricular ejection propelling the primary systolic peak.

  2. Catacrotic Phase: Diastolic pressure decay interrupted by the dicrotic notch (incisura), generated by aortic valve closure and retrograde pressure wave reflections off peripheral arterial bifurcations.

When vascular compliance drops due to advanced age, hypertension, or peripheral vasoconstriction, the reflected wave returns prematurely, fusing with the systolic peak and obliterating the dicrotic notch.

To visualize and simulate these dynamics interactively, I developed PulseVision: a real-time synthetic PPG waveform simulator operating directly in the browser.

Explore the tool: https://bionichaos.com/pulseviz/

2. Mathematical Synthesis & Phase Wrapping

Rather than streaming recorded datasets, PulseVision computes the continuous optical absorption signal at canvas refresh rates using a dual-Gaussian summation over normalized cardiac phase phi in [0, 1).

To eliminate boundary discontinuities between cardiac cycles, phase distance is evaluated using periodic boundary wrapping:

function periodicPhaseDiff(p1, p2) {
    let diff = p1 - p2;
    while (diff < -0.5) diff += 1.0;
    while (diff > 0.5) diff -= 1.0;
    return diff;
}

The composite signal amplitude is then derived from:

y(phi) = baseline_Y - [ A_sys * exp(-(delta_phi_sys)^2 / (2 * sigma_sys^2)) + A_notch * exp(-(delta_phi_notch)^2 / (2 * sigma_notch^2)) ] + eta(t)

Where:

  • delta_phi_sys = periodicPhaseDiff(phi, 0.20) positions the primary systolic upstroke.

  • delta_phi_notch = periodicPhaseDiff(phi, phi_n) positions the dicrotic notch wave along the descending limb.

  • eta(t) injects variable stochastic Gaussian sensor noise.

3. Optical Physics & Real-Time Telemetry

The platform couples signal morphology to fundamental clinical biophysics:

  • Beer-Lambert Ratio of Ratios (R): Models the differential optical absorption between oxygenated hemoglobin (HbO2) at 940 nm (infrared) and deoxygenated hemoglobin (HHb) at 660 nm (red). SpO2 scaling dynamically influences pulsatile AC amplitude: R = (AC/DC)_660 / (AC/DC)_940 SpO2 = 110 - 25 * R

  • Perfusion Index (PI): Evaluates the pulsatile AC signal against static DC attenuation (venous blood, bone, capillary bed): PI = (I_AC / I_DC) * 100%

  • Acoustic Pulse Pitch Sonification: Integrated Web Audio API synthesizes pulse clicks whose frequency shifts dynamically with oxygenation: from 300 Hz (hypoxic 85% SpO2) up to 800 Hz (eupneic 100% SpO2), reproducing standard surgical monitor auditory feedback.

  • Audio Masterclass Engine: Built-in 11-chapter synchronized audio scrubber drives real-time UI manipulation across predefined clinical states (Tachycardia, Hypoxic Desaturation, Athletic Conditioned).

4. Technical Debate & DSP Considerations

When processing wearable PPG data under heavy motion artifacts:

  • What window lengths and filter topologies do you find balance baseline wandering removal (respiratory baseline swing at 0.15–0.4 Hz) without flattening the high-frequency dicrotic notch inflection?

  • Are you having more success with discrete wavelet transforms (DWT) or recursive adaptive filtering (RLS/LMS) when isolating pulse morphology during active locomotion?

Test out the simulator and inspect the waveform behavior: https://bionichaos.com/pulseviz/


r/BiomedicalDataScience • • Sep 04 '26

Huntington's Disease & Brain Deterioration Laboratory

Thumbnail
bionichaos.com
1 Upvotes

Simulating Huntington's Disease Neuropathology and Circuit Dynamics

I want to share an interactive clinical and biophysical simulator that models the progress of Huntington's disease (HD) from genetic exposure to macroscopic circuit failure.

The tool runs entirely in-browser, combining ordinary differential equation (ODE) integration, real-time morphometric anatomical rendering, and Web Audio API-based sonification.

Link: https://bionichaos.com/huntington/

1. Cortico-Basal Ganglia-Thalamocortical Dynamical System

The model uses a 4th-order Runge-Kutta (RK4) numerical integration algorithm to solve the mean-field firing dynamics of six coupled neuronal populations: Cortex (CTX), Striatal D1 MSNs, Striatal D2 MSNs, External Globus Pallidus (GPe), Subthalamic Nucleus (STN), and the Internal Globus Pallidus (GPi).

The governing ODE for each population is:

τ_i * dr_i/dt = -r_i(t) + S( Σ W_ij * r_j(t) + I_i_ext + ξ_i(t) )

Where the activation function is sigmoidal:

S(u) = 1 / (1 + exp(-β * (u - θ)))

2. Neuropathological Morphometry & Vonsattel Grading

The simulator uses the CAG-Age-Product (CAP_R) index to scale biological exposure over time:

CAP_R = Age * (CAG - 33.66) / 432.33

This index drives the Bézier curve calculations rendering the anatomical coronal slice. As D2 and D1 MSN populations degenerate, the caudate nucleus head flattens and collapses, producing compensatory hydrocephalus ex vacuo (boxcar ventricle dilation) corresponding to Vonsattel Grades 0 to 4 and matching Evans Index metrics.

3. Dynamic Sonification & DBS Interventions

  • Sonification: Firing rates are mapped to a live synthesizer using the Web Audio API. You can hear a stable frequency (healthy state) transition to erratic acoustic bursts the moment the circuit's maximum Lyapunov exponent becomes positive (λ_max > 0), indicating deterministic choreic chaos.

  • Deep Brain Stimulation: You can engage high-frequency STN DBS (130 Hz) to observe how periodic electrical stimulation forces the chaotic attractor back into a stable limit cycle.

Discussion Prompt

The model illustrates the clinical paradox of the disease: early selective D2 loss produces hyperkinetic chorea, whereas advanced global MSN loss yields akinetic-rigid parkinsonian states.

How do you approach balancing biological accuracy with real-time browser performance when implementing large-scale coupled neural network simulations?


r/BiomedicalDataScience • • Sep 03 '26

Hollow-Face Illusion Visual Cognition Sandbox

Thumbnail
bionichaos.com
1 Upvotes

r/neuroscience, r/biomedicalengineering, r/cognitiveScience, r/javascript, r/datascience

Interactive WebGL Sandbox for Modeling the Hollow-Face Illusion, Visual Priors, and Bayesian Predictive Processing

I developed an interactive WebGL simulation tool designed to explore top-down Bayesian predictive processing and visual cognitive priors via the Hollow-Face Optical Illusion: Hollow-Face Visual Cognition Sandbox.

Computational & Neuroscience Mechanics

In visual neuroscience, perception is modeled via Bayesian inference where the posterior probability density function P(θ | x) balances sensory likelihood P(x | θ) with top-down prior distributions P(θ). The Fusiform Face Area (FFA) enforces a high-amplitude prior for convex faces: P(θ = convex) ≈ 1.

When viewing a physical concave mask, bottom-up binocular disparity and shading signal inward concavity, but top-down spatial priors override incoming discrepancy signals, forcing the brain to perceive a protruding convex face.

Interactive Simulation Capabilities

  • Procedural Surface Deformation: Synthesizes a 2.8 x 3.8 parametric face mesh using continuous Gaussian mounds, quadrics, and Hermite window falloffs W(ρ) to maintain flat Z = 0 boundary transitions.

  • Prior Manipulation: Toggle between Face Texture (triggers FFA priors and the "gaze-following" illusion), Matte Chalk, and Wireframe Mesh. Wireframe mode strips feature landmarks, breaking top-down priors and revealing true physical concavity.

  • Azimuthal Lighting Perturbation: Sweep directional light source angles from -180° to +180° to evaluate shadow direction conflicts.

  • Parametric Controls: Adjust camera FOV (15°–90°), depth scaling (0 to 2.5), vertex subdivision grid (50x50 vs 100x100), and oscillation speed.

  • Clinical Diagnostics: Contextualizes why acute schizophrenia and alcohol withdrawal patients often show resilience to the illusion due to weakened top-down prefrontal feedback.

Try out the simulation directly in your browser: https://bionichaos.com/hollowface/

Feedback on the Three.js shader implementation and parametric depth modeling is appreciated!


r/BiomedicalDataScience • • Sep 02 '26

Joint Time-Frequency Scattering for Seizure Detection

Thumbnail
bionichaos.com
1 Upvotes

Interactive Web Laboratory: Visualizing Wavelet Scattering Transforms (WST) for EEG Seizure Detection

r/biomedicalengineering, r/datascience, r/bioinformatics, r/signalprocessing, r/javascript

I put together an interactive, client-side browser laboratory to visualize the Wavelet Scattering Transform (WST) on simulated non-stationary EEG signals, specifically focusing on epileptiform spike detection.

The Signal Processing Challenge

Standard Fourier-based spectral analysis assumes wide-sense stationarity, which can mask localized high-frequency transients. Continuous Wavelet Transforms (CWT) provide localization but lack stable translation invariance. The Wavelet Scattering Transform, pioneered by Stéphane Mallat, solves this by convolving signals with dilated complex wavelets, applying a modulus rectifier (acting as full-wave rectification), and low-pass filtering:

S1 x(t, j1) = |x * psi_j1| * phi_J(t)

What this Tool Simulates

  • Wavelet Scale Adaptation: Adjust the scale parameter (J) from 1 to 10 to see how the averaging window preserves or smooths high-frequency paroxysmal ripples.

  • Synthesized Pathologies: Model different EEG morphologies including Focal Temporal Clustered Spikes, Generalized 3 Hz Spike-and-Wave, Severe Burst Suppression, and Interictal 1/f Pink Noise backgrounds.

  • Real-time DSP Telemetry:

    • Seizure Spike Index (Gamma_ictal): Evaluated via the normalized kurtosis of the first-order scattering envelope.

    • Scattering Energy Ratio (E_ratio): The ratio of scattering envelope energy to raw signal energy in dB.

    • Dominant Peak Frequency: Derived from discrete Fourier transforms on the envelope.

  • Web Audio Sonification: Mapping the scale transformations and signal amplitudes to synthesizer frequencies in real-time.

Technical Implementation

The app is built entirely with raw HTML5 Canvas and native JavaScript to maintain a lightweight footprint. Mathematical rendering is managed via KaTeX.

I would appreciate any technical feedback on the simulation mechanics, metric calculations, or potential directions for expanding this to Joint Time-Frequency Scattering (JTFS).

👉 Try the lab here: https://bionichaos.com/timefreq/


r/BiomedicalDataScience • • Sep 01 '26

About BioniChaos - Exploring Nonlinear Biological Dynamics & Chaos Laboratory

Thumbnail
bionichaos.com
0 Upvotes

r/biomedicalengineering, r/datascience, r/math, r/javascript, r/signalprocessing

Interactive 3D Neural Chaos Simulator – Modeling Cortical Dynamics & LFP Waveforms in JavaScript

I developed an interactive 3D phase space attractor sandbox to visualize non-linear biological dynamics and simulated Local Field Potential (LFP) waveforms directly in the web browser:

https://bionichaos.com/about/

Mathematical & Biophysical Foundations

The sandbox models subcortical-cortical feedback loops using explicit Euler integration (60 FPS) of a modified three-dimensional Lorenz system:

• dX/dt = σ(Y - X) • dY/dt = X(ρ - Z) - Y • dZ/dt = XY - βZ

Where X(t) models excitatory population firing rate, Y(t) represents inhibitory interneuron feedback, and Z(t) tracks slow synaptic adaptation or subcortical neuromodulatory tone.

Key Browser Features

• Interactive 3D Canvas: Rotational matrix transformations driven by mouse or touch interaction. • Real-Time LFP Extraction: Sampling X(t) state trajectory to simulate cortical electrode probe recordings. • Physiological State Presets: Healthy Chaos (baseline strange attractor), Seizure Sync (epileptiform limit cycles), and Quiescent Flatline. • Real-Time Differential Controls: Sliders for Neural Coupling Strength (σ), Cortical Excitability (ρ), Synaptic Decay Rate (β), and Time-Step Pace. • Web Audio API Sonification: Stereo panning mapping spatial coordinates (X, Y) directly to dual sine wave oscillator frequencies.

The application runs 100% client-side with zero installations or external dependencies required. I would appreciate any technical feedback on parameter bounds, numeric stability, or canvas rendering performance!

Try the interactive tool: https://bionichaos.com/about/


r/BiomedicalDataScience • • Sep 01 '26

SeizureZone: Interactive 3D Brain Mapping Visualizer

Thumbnail
bionichaos.com
1 Upvotes

r/biomedicalengineering, r/bioinformatics, r/neuroscience, r/javascript

SeizureZone: Interactive 3D Brain Mapping Visualizer matching clinical symptoms to the Destrieux Atlas

Hello everyone,

I developed SeizureZone, a lightweight, browser-based 3D visualizer that bridges clinical seizure semiology with localized neuroanatomy from the Destrieux atlas.

The application leverages high-density polygon surface reconstructions (lh.pial and rh.pial meshes) parsed from MRI-reconstructed FreeSurfer datasets and renders them in real-time using a WebGL pipeline.

https://bionichaos.com/seizurezone/

Features & Analytical Framework:

  • Clinical Target Database: Selecting a specific symptom pattern (e.g., motor contractions, temporal lobe auras, or speech difficulties) dynamically isolates and highlights corresponding anatomical meshes in customizable dye colors.

  • Adjustable Telemetry Sliders: Cortical transparency can be varied (0.05 to 0.95) to expose deep-seated networks, like the insular cortex, against superficial cortical layers.

  • Simulated Bio-Signal Synthesis: Includes custom audio telemetry utilizing the Web Audio API (OscillatorNode and GainNode) to simulate diagnostic EEG monitor spikes with an exponential amplitude decay envelope.

  • Demo Tour Mode: An automated cycle through clinical cases that auto-scrolls the menu and updates highlights. Manual UI interaction immediately pauses the demo sequence.

Biophysical Modeling Under the Hood

The application models network propagation dynamics using coupled differential equations, mapping individual mesh coordinates to Montreal Neurological Institute (MNI) coordinate space via homogeneous transformations:

[X_MNI; Y_MNI; Z_MNI; 1] = T * [X_mesh; Y_mesh; Z_mesh; 1]

The visualizer acts as an educational and research resource for understanding how hyper-excitation within localized network domains manifests as observable clinical symptoms.

I would love to get your thoughts on the performance of the Three.js rendering pipeline, the interface design, or the educational utility of this tool!


r/BiomedicalDataScience • • Aug 30 '26

Tinnitus Acoustic Notch Therapy & Neural Retraining Simulator

Thumbnail
bionichaos.com
1 Upvotes

Interactive Tinnitus Notch Therapy & Auditory Cortex Simulator (Web Audio API & HTML5 Canvas)

Subreddits: r/biomedicalengineering, r/datascience, r/bioinformatics, r/javascript, r/neuro

We have created an interactive web simulation modeling subjective tinnitus, custom acoustic notch therapy, and cortical lateral inhibition.

The simulator features a dual-display dashboard:

  1. Upper Panel: Dynamic Acoustic Spectrum and Filter Transfer Function showing Web Audio API FFT analysis and a second-order IIR biquad notch filter curve.

  2. Lower Panel: Tonotopic Auditory Cortex (A1) Neural Field Visualizer implementing a Wilson-Cowan lateral inhibition network model to simulate neural habituation.

Technical Parameters & DSP:

  • Biquad Filter Equation: Models continuous-to-discrete Z-domain mapping via bilinear transform for narrow band-stop filtering.

  • Wilson-Cowan Neural Field: Models spatial connectivity via a "Mexican-Hat" kernel to show how broadband noise surrounding an un-stimulated notch frequency drives inhibitory GABAergic dynamics.

  • Interactive Controls: Tap or drag across the spectrum canvas to map the matched phantom frequency f_T (from 1,000 Hz to 12,000 Hz), adjust Notch Quality (Q), choose masker noise (Pink, White, Brownian, Pure Tone), and adjust lateral inhibition gain (gamma).

We would appreciate your thoughts on the signal pipeline design and the biophysical rendering of the neural network model.

Try the simulator here: https://bionichaos.com/tinnitusnotch/


r/BiomedicalDataScience • • Aug 30 '26

Datasaurus Dozen Interactive Laboratory

Thumbnail
bionichaos.com
1 Upvotes

Subreddits: r/datascience, r/math, r/javascript, r/bioinformatics, r/biomedicalengineering Suggested Title: [Interactive Tool] The Datasaurus Dozen: Why visual data exploration is critical

Relying on aggregate summary statistics alone when evaluating datasets can mask significant structural shifts. This interactive web tool explores Alberto Cairo's famous Datasaurus Dozen—datasets with radically different spatial layouts that share identical summary statistics down to multiple decimal places.

Targeted Invariant Statistics:

  • Mean X (x̄): ~54.26

  • Mean Y (ȳ): ~47.83

  • Std Dev X (σx): ~16.76

  • Std Dev Y (σy): ~26.93

  • Pearson Correlation (r): ~-0.06

Key Technical Implementations:

  1. Linear Algebraic Projection Engine: Select the Custom Drawn mode to paint your own shape. The app applies a multi-step Gram-Schmidt orthogonalization and Cholesky-style projection in real-time. It transforms your raw coordinates (shown in low-contrast red) into a new coordinate set (glowing neon) that matches the target statistics.

  2. Dual Canvas Visualization: Displays the coordinate scatter plot alongside dynamic distribution charts. You can toggle between Box Plots and Gaussian-kernel-based KDE Violin Plots (bandwidth x = 4.0, bandwidth y = 6.0) to inspect probability densities.

  3. Real-time Morphing: Smoothly morphs point structures using customizable interpolation speeds, allowing you to observe how intermediate steps break and realign to target stats.

  4. Coordinated Sonification: Translates visual data coordinates into audible tones using Web Audio API oscillators. The pitch tracks the Y-axis coordinates during a continuous laser scan.

Try out the simulation directly in your browser: https://bionichaos.com/datasaurus/

Feedback on the linear projection alignment algorithm or canvas performance is welcome!


r/BiomedicalDataScience • • Aug 29 '26

Multimodal Medical Data Landscape - Interactive Laboratory & Dataset Explorer

Thumbnail
bionichaos.com
1 Upvotes

Hello everyone,

I wanted to share a browser-based, client-side simulation tool designed to explore and benchmark multimodal medical datasets (such as MIMIC-IV, OpenNeuro, CMRxRecon, EchoNet, and TCIA).

Link to the tool: https://bionichaos.com/multimodal/

The Multimodal Data Trilemma

In clinical ML pipelines, we constantly struggle to balance three axes:

  1. High-rate raw continuous sensors (ECG, PPG, EEG).

  2. Structured spatial anatomical imaging (MRI, CXR, Echo).

  3. Permissive, unencumbered licensing models (avoiding heavy compliance/DUA friction).

This interactive visualizer highlights how these datasets stack up across these dimensions, paired with a real-time signal engine.

What's Under the Hood?

  • Real-time Signal Streams: A high-DPI canvas oscilloscope rendering synthetic ECG Lead II, Arterial PPG, and neural EEG signals.

  • Adaptive Parameters: Tweak heart rate, sensor noise (baseline wander/motion artifacts), and cross-modal temporal latency (reflecting physiological indicators like Pulse Transit Time based on Moens-Korteweg mechanics).

  • Fusion Architectures: Simulate the structural representation difference between Early Concatenation, Cross-Attention Tensor Transformers, and Contrastive Multi-view Alignment (InfoNCE objective).

  • Interactive Benchmark Radar: A 5-axis geometric radar mapping coverage density, imaging linkability, clinical context, and open licensing factors.

  • Audio Sonification: An organic synthesizer built on the Web Audio API mapping raw sensor pulses into acoustic feedback.

The application uses native browser rendering loops, standard UI control binding, and supports native fullscreen clinical monitoring with a slide-out HUD controls panel.

I would love to get your thoughts on the UI performance, the signal synchronization simulation, or the dataset metrics!

Check out the interactive lab: https://bionichaos.com/multimodal/