PHINN-EEG: Topological Time-Series Analysis of Dream-State EEG -- Dynamic Betti Curves for Dream Content Classification and Topology-Conditioned Neural Signal Synthesis
By Ren Takahashi, Emre Yusuf, Jayabrata Bhaduri
"Introduces topological time-series features (Dynamic Betti Curves) via persistent homology for EEG dream detection, combined with flow matching for classification and synthesis, targeting improved AUC."
Abstract
Current electroencephalography (EEG)-based dream detection relies on power spectral density (PSD) and statistical moment features, achieving a state-of-the-art area under the receiver operating characteristic curve (AUC) of approximately 0.70 on the DREAM database (Wong et al., 2025, Nature Communications). We introduce PHINN-EEG (Persistent Homology Inspired Neural Network for EEG), the first topological time-series framework for dream mentation analysis. Using sliding-window Takens delay embeddings and Vietoris-Rips filtrations on multichannel pre-awakening EEG epochs, we extract Dynamic Betti Curves that characterize the geometric architecture of neural activity, not merely its energy. These topological invariants, combined with topology-conditioned flow matching, are analytically projected to outperform existing PSD and catch22 benchmarks, targeting AUC = 0.82-0.90 on the 1,462-awakening open-access subset of the DREAM database (drawn from a full registry of 3,191 total awakenings from 263 participants across 20 independent laboratories). We further introduce a topology-conditioned rectified flow model for dream-state EEG synthesis-with a spectral-conditioned flow model of comparable feature dimensionality as an additional ablation baseline to isolate the value of topological conditioning specifically-and propose a set of candidate Betti transition archetypes linking topology to phenomenological dream report categories, presented as an exploratory hypothesis space pending empirical validation. If validated, this work represents a paradigm shift from spectral energy to phase-space geometry in neural rare-event detection, with potential future implications for wearable BCI dream monitoring.
Technical Analysis & Implementation
Technical Breakdown§
Core Methodology§
PHINN-EEG (Persistent Homology Inspired Neural Network for EEG) introduces topological time-series analysis to dream-state EEG classification. The key idea is to extract topological invariants (Betti numbers) from sliding-window Takens delay embeddings of multichannel EEG epochs, capturing geometric structure beyond spectral power.
Pipeline: 1. Sliding-window Takens embedding: For each EEG epoch (e.g., 30s pre-awakening), apply time-delay embedding to each channel: $$X_i(t) = [x_i(t), x_i(t+\tau), \dots, x_i(t+(m-1)\tau)] \in \mathbb{R}^m$$ where $\tau$ is the delay and $m$ the embedding dimension. 2. Vietoris-Rips filtration: Build a point cloud from the embedded vectors across channels. Compute persistent homology on the resulting simplicial complex, tracking birth and death of homology groups $H_0$ (connected components) and $H_1$ (loops). 3. Dynamic Betti Curves (DBCs): Extract the evolution of Betti numbers over the filtration parameter $\epsilon$: $$\beta_k(\epsilon) = \text{rank}(H_k(\text{VR}_{\epsilon}))$$ These curves are used as topological features. 4. Classification: DBCs are fed into a neural network (or combined with spectral features) for binary classification (dream vs. no-dream). The paper claims AUC improvement from 0.70 (PSD baseline) to 0.82-0.90. 5. Topology-conditioned flow matching: For synthesis, a rectified flow model is conditioned on topological features (DBCs) to generate synthetic dream-state EEG. A spectral-conditioned baseline isolates the value of topological conditioning.
Implementation Details§
- Database: Open-access subset of DREAM database (1,462 awakenings from 3,191 total, 263 participants, 20 labs).
- EEG preprocessing: Bandpass filter 0.5-45 Hz, artifact removal, epoching (30s pre-awakening).
- Embedding parameters: $\tau$ = 10 ms, $m$ = 5 (empirically chosen).
- Filtration: Vietoris-Rips on combined point cloud from all channels (dimensionality reduction via PCA optional).
- Flow matching: Rectified flow (Liu et al., 2022) conditioned on DBCs or PSD. Training with noise-to-data mapping.
Code Snippet (PyTorch-style):
def compute_dbc(epoch, tau=10, m=5):
# epoch: (T, C) numpy
embedded = []
for c in range(epoch.shape[1]):
embedding = takens_embedding(epoch[:, c], delay=tau, dim=m)
embedded.append(embedding)
point_cloud = np.concatenate(embedded, axis=0) # (C*(T-(m-1)*tau), m)
# Vietoris-Rips filtration (using giotto-tda or ripserer)
dgm = ripser.ripser(point_cloud)['dgms']
# Compute Betti curves for H0 and H1
bc0 = betti_curve(dgm[0], max_eps=1.0)
bc1 = betti_curve(dgm[1], max_eps=1.0)
return np.concatenate([bc0, bc1])
class PHINNClassifier(nn.Module):
def __init__(self, input_dim, hidden=128):
super().__init__()
self.fc = nn.Sequential(
nn.Linear(input_dim, hidden),
nn.ReLU(),
nn.Linear(hidden, 1),
nn.Sigmoid()
)
def forward(self, dbc):
return self.fc(dbc)
# Training loop
for epoch, (batch_dbc, labels) in enumerate(dataloader):
preds = model(batch_dbc)
loss = F.binary_cross_entropy(preds, labels)
optimizer.zero_grad()
loss.backward()
optimizer.step()Potential Impact§
If validated, this approach shifts EEG analysis from spectral energy to phase-space geometry, applicable to rare-event neural detection. The synthesis model may enable data augmentation for imbalanced dream datasets.