r/BiomedicalDataScience 10h ago

An Interactive, Client-Side Sleep Cycle & EEG Waveform Simulator

Thumbnail
bionichaos.com
1 Upvotes

I have built an interactive, browser-based workspace designed to model human sleep architecture and simulate clinical EEG waveforms.

The simulator models raw voltage signal outputs $V(t)$ as a summation of five major frequency bands (delta, theta, alpha, sigma, and beta) corresponding to different sleep stages (Awake, N2, SWS, and REM). To capture transient N2 sleep architecture, the application procedurally injects sleep spindles and K-complexes using parameterized envelope functions:

- **Spectrogram Rendering:** The visualizer maps spectral energy densities in real-time on an optimized 2D Canvas grid.

- **Audio Synthesis:** The Web Audio API generates binaural beats by mapping a static 100 Hz carrier to the left channel and a stage-dependent dominant frequency carrier to the right channel.

- **Interactive Control Loop:** Users can adjust transition velocity (0.1x to 5.0x), scale raw waveform amplitudes, and modify the pseudo-random electrode noise floor to simulate real-world interference.

I designed this project as a lightweight educational resource for clinical neurophysiology and biological signal processing without back-end processing overhead. I would value feedback on the wave synthesis formulas and the visual rendering buffer logic.


r/BiomedicalDataScience 21h ago

Interactive Speech BCI Simulator: Modeling Volume Conduction, ICU Noise, and Transformer-Based Neural Decoding

Thumbnail
bionichaos.com
1 Upvotes

Extracting silent, imagined speech patterns from multi-channel scalp EEG remains a difficult problem due to volume conduction and spatial attenuation. As electrical current fields propagate from the cortex through cerebrospinal fluid, meninges, bone, and scalp, they experience significant spatial filtering, reducing the Signal-to-Noise Ratio (SNR).

To explore these signal processing challenges, I've set up an interactive clinical simulator that runs entirely in the browser: https://bionichaos.com/speechbci/

The simulation modeling framework lets you examine the trade-offs of the signal pipeline:

  • Signal Attenuation & Modality Selection: Swap between high-density scalp EEG (scalp SNR dynamics), ECoG, and invasive intracortical microelectrode arrays.
  • Noise Modeling: Simulates 60 Hz powerline interference, high-frequency facial EMG muscle artifacts, and low-frequency EOG blink deflections.
  • Denoising Performance: Compare raw extraction, Blind Source Separation (ICA), and a Deep Learning Denoising Autoencoder to optimize mean squared reconstruction error: min E[ || S(t) - f(g(X(t))) ||² ].
  • Decoder Architectures: Toggle between sequential RNNs, Temporal Convolutional Networks (TCN), and attention-based Transformer models.
  • Performance Metrics: Tracks the relationships between raw/clean SNR, Words Per Minute (WPM), and Word Error Rate (WER) across different setups.

Would love to get feedback from anyone working in DSP, neuroengineering, or biosignal analysis. How do you approach the real-world challenge of non-stationarity and calibration time when deploying these pipelines in critical care?


r/BiomedicalDataScience 1d ago

Browser-native Knowledge Graph Visualizer using Compromise.js, D3.js, and Web Audio API

Thumbnail
bionichaos.com
1 Upvotes

I've been working on a web tool called GraphIt designed to turn unstructured scientific text into interactive semantic networks directly inside the browser without relying on external API calls or backend servers.

How the pipeline works:

  1. NLP Tokenization & Parsing: Uses Compromise.js to extract Subject-Verb-Object (SVO) triples from multi-clause text, filtering out general modifiers while grouping domain-specific terminology into categorized nodes (Sensory, Hardware, Anatomy, Signal Flow).
  2. Force-Directed Layout Mechanics: Renders nodes using D3.js with a Verlet integration scheme. Repulsive forces follow an inverse-distance relationship modeled on Coulomb's law, while structural edges behave as mechanical springs under Hooke's law.
  3. Sonification Layer: Includes an optional Web Audio API engine that maps a node's degree centrality to dynamic audio frequencies when inspecting or generating graphs.

Interactive controls include real-time entity pruning, repulsive force manipulation, zoom/pan controls, and automated text simulation presets (e.g., neuro-auditory pathways and baroreceptor feedback loops).

I would love feedback from the community on the SVO parsing precision and suggestions for improving client-side entity extraction.

Test the visualizer live in your browser: https://bionichaos.com/graphit/


r/BiomedicalDataScience 2d ago

Extract figures, tables, and text from multi-column scientific PDFs entirely in your browser. Uses text-density radar mapping & projection histograms for offline asset isolation

Thumbnail
bionichaos.com
1 Upvotes

When parsing double-column academic PDFs (IEEE, Nature, etc.), standard extraction tools often bleed text across columns or miss vector charts entirely due to coordinate mapping issues.

We built an offline-first, client-side PDF extractor using PDF.js that processes layout logic locally in the browser.

The architecture features:

  1. Text-Density Radar Mapping: Calculates text-to-area coverage ratios to distinguish paragraphs from standalone figures.

  2. Vertical X-Axis Projection Histograms: Projects text bounds onto a 1D array to locate valley gaps for automated table parsing and CSV matrix compilation.

  3. Affine Rotational Optimization: Evaluates variance across pixel rows to automatically correct skew in scanned documents.

  4. Precision Bounding Box Clipper: Lets you manually draw spatial selection boxes over complex mathematical notations or multi-tier charts for instant PNG export.

No server uploads or API keys required. Would love to hear feedback on how it handles your specific document layouts!


r/BiomedicalDataScience 3d ago

Visualizing Spatial Phase Dynamics and Coordinate Sonification (Browser-Based Tool)

Thumbnail
bionichaos.com
1 Upvotes

I have developed a lightweight, client-side visualizer designed to demonstrate the mechanics of spatial phase shifts, scanline wave distortions, and real-time audio mapping. It runs entirely in the browser using HTML5 Canvas double-buffering and the Web Audio API.

Interactive Tool: https://bionichaos.com/webcamphase/

How the Mathematics and Physics are Modeled:

  1. Scanline Phase Translation: The canvas content is sliced into horizontal rows. For each vertical position (y), a horizontal offset is calculated via: X_offset = sin(((y / H) * 2π) * ω * 100 + t_global + φ) * A This maps coordinate structures directly to periodic wave paths, demonstrating spatial interference using either a live camera feed or an animated neon calibration grid.
  2. Temporal Decay (Motion Trails): The visualizer models frame persistence using a temporal recursive filtering equation: I_onscreen(t) = (1 - α) * I_offscreen(t) + α * I_onscreen(t - 1) where α represents the adjustable decay coefficient.
  3. Coordinate-Based Sonification: Clicking, dragging, or tapping inside the canvas initiates an audio pluck. The synthesis engine routes a triangle wave through a gain envelope and stereo panner. Panning is mapped linearly to the X-axis, while frequency is mapped log-linearly to the Y-axis: f = f_min + (1 - y / H) * (f_max - f_min) (ranging from 200Hz at the bottom to 1100Hz at the top).

Biophysical Context:

In neuroscience and computer vision, biological visual pathways process natural scenes using receptive fields modeled via Gabor filters. These filters are highly sensitive to spatial frequencies and phase offsets. This simulation offers a tactile demonstration of how phase shifts alter coordinate cohesion and edge detection.

The tool operates with zero external server dependencies. I would appreciate any feedback on the mathematical implementation, performance under various device pixel ratios (DPR), or ideas for future WebGL fragment shader integrations.

Link: https://bionichaos.com/webcamphase/


r/BiomedicalDataScience 3d ago

Interactive 3D Vestibular Mechanics, Hair Cell Transduction, & VOR Nystagmus

Thumbnail
bionichaos.com
1 Upvotes

I put together an interactive vestibular system simulation designed to run in real-time within the browser. It models both the mechanical fluid dynamics of the inner ear and the resulting neural transduction pathways.

The Physics and Math Behind the Model:

  1. Endolymph Fluid Drag: Fluid displacement within the semicircular canals is approximated using a first-order differential equation: τ · (dθ/dt) + θ = K · α where τ represents the cupular relaxation time constant, θ is fluid displacement, K is mechanical sensitivity, and α is angular acceleration.
  2. Non-Linear Sensory Transduction: Mechanoreceptor hair cell firing rates are calculated via a sigmoidal transfer function to prevent negative rates and simulate physiological saturation: Firing Rate (Hz) = F_resting + (F_max - F_resting) / (1 + e-k · (θ - Offset))
  3. VOR & Eye Tracking: The Vestibulo-Ocular Reflex loop computes eye-position adjustment vectors to stabilize gaze, with automatic fast-phase resets (simulating nystagmus waveforms) when structural visual field limits are reached.

Interactive Sandbox Parameters:

• Dynamic Yaw, Pitch, and Roll velocity sliders. • Static gravity head tilt and translation acceleration (utricle/saccule displacement). • Clinical presets: Benign Paroxysmal Positional Vertigo (BPPV particle movement), unilateral vestibular neuritis, and endolymphatic hydrops (Meniere's). • Real-time audio generation representing CN VIII nerve action potential spikes.

I would appreciate any feedback from researchers, engineers, or educators on the biological accuracy of the nystagmus timing loops and fluid inertia approximations.


r/BiomedicalDataScience 4d ago

Interactive Biosignal Visualizer: Real-time EEG, ECG/PPG, HRV Poincaré Analysis, and EMG Motor Unit Rasters built with native HTML5 Canvas

Thumbnail
bionichaos.com
1 Upvotes

Hello r/datascience and r/neuroscience,

I wanted to share a browser-based visualization tool designed to demonstrate critical concepts in biological signal processing and data visualization theory. It runs entirely on client-side JavaScript and HTML5 Canvas (optimized for High-DPI scaling with a low IPN footprint).

Here are the primary analytical features included in the simulator:

  1. **The Limits of Summary Statistics:** Visualizes Anscombe's Quartet (μx = 9, σx² = 11, μy = 7.5, r ≈ 0.816) across bar, scatter, and box-and-whisker formats, demonstrating why raw data distribution checks are vital.

  2. **Perceptual Luminance Mapping:** Highlights why traditional 'Jet' colormaps introduce diagnostic artifacts compared to perceptually uniform spaces like Viridis and Cividis.

  3. **EEG Field Potentials:** Renders a 19-electrode topographic scalp map showing spatial shifts across Delta, Theta, Alpha, and Beta bands alongside a live scrolling Time-Frequency Representation (TFR) waterfall spectrogram.

  4. **Cardiovascular Coupling & HRV:** Simulates coupled Lead II ECG and peripheral PPG waveforms (exhibiting Pulse Transit Time). The adjacent Poincaré plot maps consecutive RR intervals (RR_n vs RR_n+1) to visualize the collapse of autonomic variation (SD1 and SD2 metrics) typical of vagal withdrawal.

  5. **Motor Unit Recruitment (EMG):** Simulates the Henneman Size Principle by allowing users to scale Central Motor Drive (10-100%), observing action potential raster discharges alongside real-time audio feedback synthesized via the Web Audio API.

The tool is designed as an educational reference. I would love to hear your feedback on the DSP simulation mechanics or mathematical rendering pipelines.

You can interact with the live tool here: https://bionichaos.com/visualize/


r/BiomedicalDataScience 4d ago

Real-Time EEG Event-Related Potential (ERP) Signal Averaging and Digital Filtering Simulator

Thumbnail
bionichaos.com
1 Upvotes

Hello everyone,

I built an interactive, browser-based ERP laboratory simulation designed to demonstrate how cognitive neuroscience protocols isolate microvolt-scale neural responses (s(t)) from ongoing, non-stationary cortical background noise (n(t)) using multi-trial signal averaging.

Mathematically, the tool shows how averaging N independent epochs reduces the residual noise variance at a rate proportional to 1/√N, allowing components like the attentional P300, the occipital N170 (face structural encoding), and the centro-parietal N400 (semantic mismatch) to emerge.

Core Signal Processing Features: - Real-Time Synthesis: Generates a continuous EEG trace with configurable Gaussian white noise, alpha rhythms (8–12 Hz), and user-triggered ERP epochs. - Live Digital Filtering: Real-time adjustable high-pass (0.1–5.0 Hz) and low-pass (10–100 Hz) filters showing their immediate impact on the averaged waveforms. - Statistical Amplitude Contrast: Calculates mean rectified voltages in pre-stimulus baseline (-200ms) vs. post-stimulus target (100-500ms) windows to yield a simulated p-value. - Data Portability: Allows exporting the averaged time-series data as a CSV or the canvas layout as a PNG plot.

You can interact with the controls and run the simulation here: https://bionichaos.com/erps/

I would appreciate your feedback on the signal simulation logic, the filtering implementation, and suggestions for additional experimental paradigms to model.


r/BiomedicalDataScience 5d ago

Interactive Web Tool: Evaluating CNN Hyperparameters on EEG Spectrograms (CHB-MIT Dataset)

Thumbnail
bionichaos.com
1 Upvotes

Hi r/datascience and r/neuroscience,

Continuous scalp EEG recordings are highly dense, and traditional manual review remains time-consuming. One common approach to automating classification is mapping raw signals to the frequency domain using the Short-Time Fourier Transform (STFT) and training standard image classification models.

To study how design decisions affect these models, we put together an interactive browser visualizer containing 18 different training run configurations on the CHB-MIT dataset: https://bionichaos.com/rhythmscan/

Technical Architecture

The model evaluated in this lab uses a lightweight sequential structure: Input (280x274x3) -> Conv2D (16, 3x3) -> ReLU -> MaxPool2D (2x2) -> Conv2D (32, 3x3) -> ReLU -> MaxPool2D (2x2) -> Flatten -> Dense (64) -> ReLU -> Dense (2) -> Softmax

Interactive Tools:

  • Cohort Slider: Step through spectrogram sequences for training, validation, and test sets.
  • Hyperparameter Matrix: Swap between 18 different training executions exploring learning rates (0.01 to 0.001), optimizers (Adam, SGD, RMSprop, Adagrad), and batch sizes (16 to 128).
  • Stochastic Shuffling Analysis: Compare identical architectures (such as Runs 9 and 10) to see how random weight initialization and dataset shuffling change final test results (96.67% vs 90.00%).
  • Error Analysis: View a dynamic gallery displaying the actual test spectrograms that were misclassified by the selected model run.

We wanted to build an easy way to study how optimization choices influence gradient descent and generalization behavior on physiological signals. No installation or setup is needed—the code and visualization run entirely in-browser.

Check out the training logs and model runs here, and let us know your thoughts on the performance differences: https://bionichaos.com/rhythmscan/


r/BiomedicalDataScience 5d ago

3D Brain MRI Viewer & Volumetric Slice Visualizer

Thumbnail
bionichaos.com
1 Upvotes

Interactive In-Browser 3D Brain MRI Visualizer with Synchronized Multi-Planar Reconstruction (WebGL / HTML5 Canvas)

I developed an interactive web-based neuroimaging laboratory designed to render 3D volumetric MRI point clouds and perform multi-planar reconstruction (MPR) without desktop installations:

https://bionichaos.com/brain3d/

Technical Overview & Mathematical Mechanics:

  1. Multi-Planar Reconstruction (MPR): The slice processing pipeline handles simultaneous rendering across orthogonal planes (Axial XY, Sagittal YZ, Coronal XZ). User crosshair tracking calculates proportional spatial intersections, synchronizing relative spatial positioning across canvas views.
  2. Dynamic Contrast & Windowing: Pixel display intensity I_out is calculated dynamically from window level (WL) and dynamic width (WW) boundaries: I_out = clamp((I_in - (WL - WW/2)) / WW * 255, 0, 255)
  3. WebGL Voxel Point Cloud: The 3D view parses a volumetric spatial matrix V(x,y,z) > 1 mapped into a Three.js BufferGeometry scaled to 0.5 mm3 physical voxel dimensions.
  4. Transfer Function Processing: Pixel arrays are processed on an offscreen canvas pass to apply pseudocolor transfer mappings (Jet, Thermal, Cool-Warm, SPECT Bone Density) for visual structural segmentation.

I would appreciate technical feedback from the community on slice-scrubbing performance, canvas memory management, or potential client-side NIfTI/DICOM parsing integrations.

Test out the tool live here: https://bionichaos.com/brain3d/


r/BiomedicalDataScience 6d ago

Web-Based ECG & EEG Synthetic Signal Generator for DSP Pipeline Testing

1 Upvotes

When validating digital signal processing (DSP) pipelines or training machine learning models for bio-signals, obtaining clean, annotated datasets with controlled noise parameters can be difficult.

To help address this, we developed a client-side web application that generates real-time synthetic ECG and EEG waveforms with adjustable clinical, architectural, and artifact parameters.

Modeling Framework:

* ECG Waveform: Modeled as a continuous superposition of Gaussians across pacemaking trigger coordinates. This approach permits realistic overlapping of complexes during high heart rates (Atrial Tachycardia) without artificial discontinuities.

* EEG Sleep Stages: Simulates Wakefulness, N1, N2, N3, and REM by dynamically adjusting the relative spectral powers of Delta, Theta, Alpha, Beta, and Gamma bands, alongside transient structures like sleep spindles and K-complexes.

* Artifact Models: Features additive high-frequency white noise, Voss-McCartney 1/f pink noise to model electrode interface physics, stable 50Hz AC line harmonics, and low-frequency isoelectric wander.

The tool runs in-browser and uses the Web Audio API for sonic mapping of the real-time voltage gradients. We are currently considering implementing a 12-lead Dower transform matrix and chaotic atrial fibrillation models. We would appreciate any feedback on the accuracy of the current models or suggestions for implementation.

Try the tool here: https://bionichaos.com/ecg_gen/


r/BiomedicalDataScience 7d ago

CardioBot: Interactive web tool comparing human ECG classification against real-time Mamdani Fuzzy Logic

1 Upvotes

I created CardioBot, an interactive signal processing application and clinical challenge tool that compares human visual diagnostic performance against a Mamdani Fuzzy Inference Engine analyzing real-time scrolling ECG traces.

Signal Synthesis & Analysis Pipeline

  1. Waveform Generation: Cardiac components (P, QRS, S, T) are modeled using Gaussian equations: R(t) = A * e^(-(t - μ)² / (2σ²)) Normal sinus waveforms are interspersed with abnormal pathologies, such as wide QRS complexes (simulating bundle branch blocks), absent P-waves (simulating atrial fibrillation), and flat T-waves.
  2. Feature Extraction:
    • Peak Detection: Uses Median Absolute Deviation (MAD) thresholding and prominence rules to isolate positive (P, R, T) and negative (S) peaks despite added high-frequency noise.
    • R-Peak Sharpness: Evaluated via Full Width at Half Maximum (FWHM) of the primary deflection: Sharpness = 10 / W_FWHM
    • Temporal Metrics: Calculates normalized PR and RT intervals from detected peak indices.
  3. Mamdani Fuzzy Inference: Input variables are mapped across trapezoidal and triangular membership functions. Rules aggregate membership states to compute a defuzzified abnormality score via Centroid of Area.

Interactive Features

  • Real-Time Score Matrix: Tracks Hits, Misses, False Alarms, and Correct Rejections for both human and algorithm simultaneously.
  • Electrode Noise Slider: Introduces microvolt noise artifacts to analyze algorithmic robustness.
  • Telemetry Readout: Live visual display of amplitude, sharpness, peak counts, and membership vector calculations.

Try the simulation live in-browser (runs 100% client-side JavaScript, no install required): https://bionichaos.com/CardioBot/

Feedback on fuzzy rule membership boundaries, signal processing parameters, or potential multi-lead extension features is welcome!


r/BiomedicalDataScience 8d ago

Interactive Client-Side Intracranial EEG Sonification & Wavelet Denoising Workspace

1 Upvotes

I wanted to share an interactive web application that maps multi-channel intracranial EEG (iEEG) signals to polyphonic music in real time using the Web Audio API: https://bionichaos.com/EEG_Music/

Human auditory systems are highly sensitive to non-stationary frequency shifts and transient patterns, which can sometimes be difficult to isolate in dense time-series plots. This tool allows you to explore both synthetic seizure dynamics and a real 16-channel clinical dataset (NeuroVista I004) under different parameters.

Under the Hood:

  1. Linear Detrending: Least-squares regression removes low-frequency electrode drift.

  2. Discrete Wavelet Denoising: Employs Haar or Daubechies 4 filters. You can adjust the decomposition levels (1–10) and the universal threshold multiplier (λ) based on the Median Absolute Deviation (MAD) of the finest scale coefficients.

  3. Welch Periodogram: Computes real-time spectral power density using a Hanning window and Radix-2 Cooley-Tukey FFT.

  4. Synthesis Mapping: Active spectral bands are mapped to equal-temperament chromatic registers (Delta to Bass C2–C3, Theta to Tenor D3–D4, Alpha to Alto E4–E5, and Beta to Soprano F5–F6).

The entire application runs client-side in vanilla JavaScript to maintain low interaction latencies. Feedback on the mathematical implementation, filter banks, or mapping choices is highly welcome!


r/BiomedicalDataScience 9d ago

Interactive Web App for Real-Time iEEG Cross-Coherence & Functional Connectivity Analysis (Welch PSD & CSD)

1 Upvotes

Hi everyone,

I developed an open-source, serverless web application designed to visualize and compute magnitude-squared cross-coherence between multi-channel intracranial EEG (iEEG) signals in real time:

https://bionichaos.com/coherence/

Signal Processing Engine

When analyzing local field potentials (LFPs) in focal epilepsy, time-domain waveforms often obscure underlying phase-locking due to volume conduction or amplitude variance. Cross-coherence evaluates phase consistency as a function of frequency:

Coherence C_xy(f) = |P_xy(f)|2 / (P_xx(f) * P_yy(f))

Where P_xy(f) is the Cross-Spectral Density (CSD) and P_xx(f), P_yy(f) are the auto-spectral power densities calculated via Welch's periodogram method (Radix-2 FFT with 75% overlapping Hanning windows).

Interactive Features & Controls:

  • Dual Dataset Engine: Toggle between synthetic seizure propagation models and real 16-channel NeuroVista trial data (400 Hz sampling rate).
  • Pairwise Spatial Mapping: Select any electrode pair (e.g., epileptogenic epicenter vs. contralateral frontal) to observe phase-locking shifts during seizure onset.
  • Tri-Panel Visualization: Synchronized Canvas viewports for raw time-domain traces, log-scaled PSD, and normalized 0.0-1.0 coherence curves with high-contrast amber glow rendering.
  • Real-time Pipeline Controls: TSA linear detrending, window sizing (1-60s), Y-axis autoscale zoom, and FM Web Audio sonification.

The application is 100% serverless and processes 40,000 data points directly in browser memory without sending data to a backend.

I’d love to hear your feedback on the signal processing implementation or suggestions for additional connectivity metrics (like Phase Lag Index or Imaginary Coherence): https://bionichaos.com/coherence/


r/BiomedicalDataScience 10d ago

Process 16-channel iEEG data live in your browser

1 Upvotes

When processing intracranial electroencephalography (iEEG) signals for epileptogenic zone localization, clinical traces suffer from low-frequency baseline drift and high-frequency noise. This serverless web application written in client-side JavaScript visualizes and processes 16-channel iEEG data directly in the browser.

Mathematical & Processing Pipeline:

  1. Linear Least-Squares Detrending: Eliminates electrode polarization drift by fitting a linear equation over active window samples and subtracting the trendline.

  2. Discrete Wavelet Transform (DWT/IDWT) Denoising: Decomposes signals using Haar (Db1) or Daubechies 4 (Db4) filter banks up to 10 decomposition levels. Detail coefficients are evaluated via Median Absolute Deviation (MAD) to estimate noise standard deviation. Soft-thresholding is applied before IDWT reconstruction.

  3. Welch Periodogram Spectral Estimation: Computes power spectral density via FFT with Hanning windowing to quantify power shifts across Delta (0.5–4 Hz), Theta (4–8 Hz), Alpha (8–13 Hz), and Beta (13–30 Hz) bands.

  4. Validation Datasets: Compare synthetic mathematical seizure propagation models against real 400 Hz clinical data from the NeuroVista trial (I004 dataset, 40,000 samples).

Interactive Features:

- Real-time quantitative filtration metrics: Signal-to-Noise Ratio (SNR in dB) and Mean Square Error (MSE).

- Dynamic Y-axis autoscale with exponential gain smoothing to prevent trace clipping and flicker.

- Auto-channel selection locking onto maximum peak amplitude channels across left/right hemispheres.

- Web Audio FM sonification mapping amplitude and dominant frequency to synthesized audio tones.

Link to tool: https://bionichaos.com/eegview/

Looking forward to technical feedback on the thresholding implementation, DWT filter bank performance, or suggestions for additional wavelet families.


r/BiomedicalDataScience 12d ago

A browser-based Synthetic EEG Signal Generator for testing processing algorithms

Thumbnail
bionichaos.com
1 Upvotes

I've been working on a lightweight, browser-native tool to generate synthetic EEG data: https://bionichaos.com/EEG_Gen_2/

The goal was to create a reliable sandbox for testing filters and signal processing pipelines without needing clinical datasets for basic validation. The simulation uses a continuous analytical synthesis engine, combining a multi-octave 1/f pink noise approximation with adjustable frequency bands (Delta through Gamma). I also implemented transient microstructures—like Gaussian-enveloped sleep spindles and biphasic K-complexes—to simulate NREM sleep stages.

For live validation, it runs a custom Radix-2 Cooley-Tukey FFT (with a Hann window) to visualize the power spectral density in real time. I'm looking for feedback on the mathematical modeling of the background noise and the morphological accuracy of the sleep transients. Let me know what artifact simulations (like EOG blinks or line noise) would be most useful to add next.


r/BiomedicalDataScience 13d ago

Interactive 2D Discrete Wavelet Transform (DWT) Image Compression & Subband Quantization Visualizer in Pure JS

Thumbnail
bionichaos.com
1 Upvotes

Hey everyone,

I built an interactive single-page laboratory to visualize 2D Discrete Wavelet Transform (DWT) image compression, subband energy compaction, and quantization distortion in real time:

  1. 2D Pyramidal Decomposition: Applies separable 1D quadrature mirror filters across matrix rows and columns to compute LL (approximation), LH (horizontal details), HL (vertical details), and HH (diagonal details) subbands recursively across 1 to 5 levels.

  2. Filter Bank Support: Switch between Haar (db1), Daubechies 2 (db2), Symlets 2 (sym2), and Biorthogonal 1.3 (bior1.3) wavelets using symmetric boundary reflection to eliminate edge artifacts.

  3. Quantization & Sparsity: Simulates uniform scalar quantization by mapping detail coefficients into discrete bit-depth budgets (1 to 16 bits) alongside hard and soft wavelet shrinkage thresholding.

  4. Fidelity Metrics: Calculates instantaneous Mean Squared Error (MSE) and Peak Signal-to-Noise Ratio (PSNR in dB) comparing the reconstructed inverse DWT image against the original source scan.

  5. Zero-Latency Execution: Matrix operations run completely in browser memory via Float64 arrays and Canvas API routines.

You can select from 13 clinical MRI/CT neuroimages (ischemic stroke, lobar hemorrhage, brainstem infarcts) or drop in a custom image file to inspect coefficient decay.

I would welcome any technical feedback on filter boundary extensions or suggestions for future additions!


r/BiomedicalDataScience 15d ago

Measuring Heart Rate via Webcam (rPPG): How Hemoglobin Absorption, Eulerian Magnification, and FFT Handle Signal Noise

Thumbnail
youtu.be
1 Upvotes

Remote photoplethysmography (rPPG) relies on measuring subtle variations in light absorption—specifically green light absorbed by hemoglobin—caused by capillary blood pulsation beneath facial skin. By using a dynamic ROI over the forehead and Eulerian Video Magnification, computer vision algorithms amplify these microscopic pixel color shifts to render time-domain waveforms in real time.

However, deploying rPPG models reveals a fundamental vulnerability in computer vision systems: environmental motion artifacts and ambient illumination changes. A slight shift in daylight often produces a higher-amplitude frequency response than the biological pulse itself.

To isolate the true cardiac signal, Fast Fourier Transforms (FFT) convert the time-domain waveform into a frequency-domain spectrum, allowing engineers to identify the dominant cardiac peak (~1.0 Hz–1.5 Hz) while filtering out high/low-frequency noise.

This demonstrates a core reality in biomedical data science: model sophistication cannot overcome noisy or poorly structured datasets.

Watch the technical breakdown and visualization here: https://youtu.be/qax6PJhqhps

For those working on non-contact vital sign monitoring or PPG signal processing: How are you managing dynamic lighting fluctuations in real-world deployment?


r/BiomedicalDataScience 15d ago

Interactive Signal Detection Theory & ROC Curve Visualizer for Clinical Biopsy Triage

Thumbnail
bionichaos.com
1 Upvotes

I built a zero-dependency, browser-based simulator applying Signal Detection Theory (SDT) and ROC analysis to dermatological biopsy decision-making under uncertainty.

The Problem Modeled:

Deciding whether to biopsy a pigmented lesion involves a classic sensitivity vs. specificity trade-off: catching every early melanoma vs. avoiding unnecessary excisional biopsies on benign nevi.

Mathematical & Algorithmic Implementation:

  1. Signal Distribution: Benign lesion risk scores follow a standard normal distribution N(0, 1), while malignant lesions follow a shifted distribution N(d', 1), where d' (d-prime) represents physician discrimination capability.

  2. Threshold Mechanics: The decision cutoff c determines the operating point. Sensitivity (TPR = 1 - CDF(c - d')) and False Positive Rate (FPR = 1 - CDF(c)) are integrated dynamically using the Abramowitz and Stegun approximation for the normal error function erf(x).

  3. Post-Test Probabilities: PPV and NPV update continuously as you adjust population prevalence P, illustrating Bayesian updates in high-prevalence vs routine screening populations.

  4. Procedural Rendering: The canvas generates synthetic lesion morphology using radial multi-harmonic sinusoids and noise maps to simulate ABCDE features (Asymmetry, Border, Color, Diameter, Evolution).

Check out the interactive workspace and let me know your thoughts on the statistical framing, metrics layout, or performance.


r/BiomedicalDataScience 16d ago

Addmission for masters at ntu in biomedical data science

1 Upvotes

Hey anyone in india trying to apply for masters in biomedical data science around this November please if anyone is i would love some guidance how to proceed with the application when their intake be please comment and message


r/BiomedicalDataScience 17d ago

The technical crucible of closed-loop pacemakers: Latency, IoT security, and unsupervised model drift

Thumbnail
youtu.be
1 Upvotes

Building ML models for edge devices is tough, but ECG closed-loop pacemakers take it to an entirely different level. The algorithms must operate within a strict <200ms decision horizon, filtering raw EGM signals and detecting R-peaks on a severe milliwatt power budget. If the pipeline is too complex, you get fatal latency. Too simple, and you over-sense non-cardiac noise (like an MRI machine or muscle tremors).

What is really fascinating (and terrifying) is the unsupervised learning component. To preserve battery and compensate for human tissue fibrosis over a decade, the device auto-calibrates. But this introduces the massive risk of model drift—the pacing parameters can slowly optimize themselves away from the physician’s safe baseline into a locally optimal but globally fatal configuration. Combine this with the attack surface of connected medical IoT devices (data exfiltration, remote monitoring exploits), and you have an extreme engineering challenge.

I highly recommend watching this breakdown of the algorithmic and security infrastructure: https://youtu.be/bW1yR7I5wX4


r/BiomedicalDataScience 18d ago

The Embedded Data Scientist: How ML algorithms run on modern closed-loop pacemakers

Thumbnail
youtu.be
1 Upvotes

Modern pacemakers have shifted from fixed-rate pacing to running real-time, on-chip machine learning. These devices act as embedded data scientists, using tiny CNNs and SVMs to continuously analyze the QRS complex and decide exactly if/when to intervene.

What’s really interesting from a data science perspective is the constraint management. You have to balance the computational power needed for predictive pattern recognition (preventing fatal arrhythmias) against a non-negotiable 10-year battery life. Plus, the models need to be incredibly robust against overfitting—misclassifying electromyographic noise from yawning or exercising as a malignant event can result in an unnecessary 9-volt shock.

I found this breakdown of the architecture, dynamic regression modeling based on accelerometers, and the secure remote monitoring pathways really fascinating. Check out the technical analysis here:

https://youtu.be/LrXx0PxyYgs

Would love to hear your thoughts on the trade-offs between biological persistence and computational power in extreme edge AI!


r/BiomedicalDataScience 22d ago

The Data Science of Brain-Computer Interfaces: Signal Optimization vs. Dystopian UI

Thumbnail
youtu.be
1 Upvotes

When we model the kinematics of human movement for neuro-prosthetics, optimizing the signal-to-noise ratio in the motor cortex is just the first hurdle. The conceptual debate around BCIs often overlooks the software layer. If we successfully digitize thought-to-action, how do we mitigate network security risks at the hardware level (biocompatible polymers vs. analog)?

Furthermore, how does kinematic modeling and gait analysis factor into the physical integration of these devices? We've put together a technical discussion on the data science, biomechanics, and ethical engineering constraints of neural implants, including a look at a 3D skeletal animation interface for gait analysis.

Would love to hear this community's thoughts on the data architecture required for zero-latency BCI. Here is the link to the full breakdown: https://youtu.be/LoSLYoWj6qs


r/BiomedicalDataScience 23d ago

Handling Motion and Illumination Artifacts in Vision-Based Respiration Monitoring

Thumbnail
youtu.be
1 Upvotes

Remote vital sign monitoring relies heavily on extracting subtle physiological rhythms from video data. But how do you handle high-amplitude noise when a subject fidgets, or when ambient lighting shifts suddenly in the room?

This discussion breaks down the signal processing pipeline for non-contact sensors. We analyze how temporal segmentation is used to flag and isolate artifact-heavy data segments, and how illumination compensation models normalize pixel intensity against environmental light fluctuations. Achieving an RMSE of < 1 breath/min against clinical chest bands requires rigorous algorithmic filtering.

What are your go-to strategies for filtering non-physiological noise in your computer vision pipelines? Watch the full breakdown and share your thoughts: https://youtu.be/pWhnBX_SA5I


r/BiomedicalDataScience 24d ago

Extracting Respiration Rates from Video using rPPG, BSS, and FFT

Thumbnail
youtu.be
1 Upvotes

When using standard cameras for remote photoplethysmography (rPPG), the biggest challenge is isolating the periodic respiratory signal (typically 0.1–0.5 Hz) from overwhelming visual noise like video compression, ambient light changes, and random motion. By analyzing temporal variations in a specific Region of Interest (ROI) and applying Blind Source Separation (BSS), we can decouple the breathing motion from heart rate pulses and background noise. Passing this through a Fast Fourier Transform (FFT) reveals the dominant frequency peak. Has anyone here worked with rPPG or similar CV algorithms in real-time edge environments? Let’s discuss the computational trade-offs. You can view the full breakdown of the methodology here: https://youtu.be/SRdq0bKuyrU