Interactive Demo
Watch the AI Predict a Craving
Press Start Demo then Simulate AI Craving Spike to trigger the full intervention sequence.
Receive Signal
2-channel EEG captured
Denoise
SoftThresholding layer
Classify
Dual-head CNN scores
Intervene
JITAI delivered
Hierarchical Multi-Head Output
Both heads share the same salience backbone — trained independently
SUD Head
Substance Use Disorder
Low-Theta Coherence
Chemical urge marker
Behavioral Head
Gaming / Gambling / CSBD
Late Positive Potential
Behavioral signal marker
Pipeline Output
Real Analysis Results
Output from running the BIDS pipeline on 5 synthetic subjects × 2 conditions (rest vs craving). Each recording: Fp1 + Fp2, 256 Hz, 120 s.
Subjects
5
synthetic dataset
Epoch Pass Rate
87.1%
514 / 590 epochs kept
Bad Channel Rate
4%
detected + interpolated
Fp1 Band Power (µV²)
Theta is the key craving marker — elevated 3.8× above rest
Fp1–Fp2 Theta Coherence · Primary SUD Marker
Rest
0.29
Craving
0.71
+145%
elevation
Low-theta synchrony between Fp1 and Fp2 is the chemical urge marker targeted by the SUD head. Threshold for intervention: 0.60.
Pipeline Configuration
Technical Architecture
Mindfully Hierarchical Net
A TensorFlow/Keras 1D-CNN designed for edge deployment. Compresses to a .tflite file via int8 post-training quantization.
Model Pipeline
EEG INPUT
(256 samples × 2 channels)
1 second · 256 Hz · Fp1 + Fp2
BLOCK 1 — Temporal Extraction
Conv1D (16 filters, kernel=32, stride=2)
BatchNormalization → ReLU
SOFT-THRESHOLDING 1
artifact_denoising_1
Adaptive blink + EMG suppression
MaxPooling1D (pool=2)
Spatial downsampling
BLOCK 2 — Salience Backbone
Conv1D (32 filters, kernel=16)
Learns dopamine anticipation signature
SOFT-THRESHOLDING 2
artifact_denoising_2
BLOCK 3 — Deep Features
Conv1D (64 filters, kernel=8)
BatchNormalization → ReLU
GLOBAL AVERAGE POOLING
shared_salience_features
64-dim vector · Dropout(0.4)
SUD HEAD
Dense(32) · Dropout(0.3)
Softmax(2) output
Low-theta coherence Substance urge marker
BEH HEAD
Dense(32) · Dropout(0.3)
Softmax(2) output
Late Positive Potential Gaming / gambling marker
SoftThresholding — The Core Innovation
With only 2 EEG channels, spatial ICA is impossible. This layer learns to suppress high-amplitude blink/EMG artifacts during backprop, preserving the low-amplitude Theta (4–8 Hz) and Gamma (30–80 Hz) waves that encode craving states.
Engineering Roadmap
Attention Mechanisms
Replace Conv1D Block 2 with CoTAttention / DAFM
Edge Quantization
PTQ float32→int8 via tf.lite.TFLiteConverter
Ablation Pipeline
OpenNeuro BIDS dataset · drop 62/64 channels
Autoregressive Forecasting
Predict craving at t + 15 min (ego-depletion)