PHINN-EEG · Intellectual Property

PHINN-EEG: The Shape of Dreams

Topological Time-Series Analysis for Dream-State EEG Classification and Synthesis. A paradigm shift from “how much brain activity?” to “what shape is the brain’s activity?”

  • Projected AUC = 0.82–0.90 on the DREAM database
  • ≈340 topological features via persistent homology
  • Topology-conditioned rectified flow synthesis

From Science Fiction to Science Fact

Reading the architecture of dreams.

In Christopher Nolan’s Inception (2010), Dom Cobb and his team infiltrate dreams using dream-sharing technology—extracting secrets and implanting ideas by entering the geometric architecture of the subconscious mind. The film imagined a world where the structure of dreams could be read, understood, and even engineered.

That future is closer than you think. PHINN-EEG—developed at Mugen.Codes—introduces the first topological time-series framework for EEG-based dream mentation analysis. Instead of asking “how much brain energy is present?” (the approach that limits current dream detection to AUC ≈ 0.70), PHINN-EEG asks: “What shape does the neural activity form in phase space?”

Just as Inception’s dream extractors read the architecture of dreams, PHINN-EEG reads the topological architecture of neural activity—extracting the geometric fingerprints of dreaming from multichannel EEG signals.

The Breakthrough

From Energy to Geometry.

The Ceiling of Energy-Based Methods

Current state-of-the-art dream detection relies on power spectral density (PSD) and statistical moment features—measuring how much brain activity exists in each frequency band. The ceiling? AUC ≈ 0.70 on the DREAM database (Wong et al., 2025, Nature Communications).

The PHINN-EEG Leap

PHINN-EEG replaces this energy-based paradigm with topological feature extraction. The result? Projected AUC = 0.82–0.90—a leap beyond the current benchmark.

  • Takens delay embeddings reconstruct high-dimensional phase-space trajectories from EEG signals
  • Vietoris-Rips filtrations sweep across scales to reveal persistent topological features
  • Dynamic Betti Curves (β₀, β₁, β₂) track connected components, loops, and voids as they evolve over time

Topology-Conditioned Synthesis

Dream engineering—not Hollywood, but mathematics.

Beyond classification, PHINN-EEG introduces a topology-conditioned rectified flow model for dream-state EEG synthesis. The generative model learns to produce synthetic EEG signals that match not just spectral statistics, but the topological fingerprints of real dream-state neural activity.

This is dream engineering—not in the Hollywood sense of Inception, but in the rigorous mathematical sense of persistent homology and flow matching.

The Technology

Core Pipeline.

01

Multichannel EEG Preprocessing

Zero-phase bandpass filtering, artifact rejection, and channel harmonization.

02

Phase-Space Reconstruction

Takens delay embedding with FNN-optimized dimensions (d ∈ {5, 7, 10, 15}).

03

Topological Feature Extraction

Vietoris-Rips filtration producing Dynamic Betti Curves, persistence landscapes, persistent entropy, Euler characteristic trajectories, and Certified Persistence Ratio (CPR).

04

Classification

XGBoost ensemble on ≈340 topological features, with rigorous ablation controls (PSD/catch22 baselines, PCA-reduced dimensionality matching).

05

Generative Synthesis

Topology-conditioned rectified flow matching with spectral-conditioned and unconditional baselines for ablation.

Evaluation Framework

Rigorous validation on open data.

Dataset
1,462 open-access awakenings from the DREAM database (263 participants, 20 laboratories)
Validation
Leave-One-Dataset-Out (LODO) cross-validation with harmonized-reference folding
Classification Metrics
AUC, balanced accuracy, Cohen's κ, per-class F1, MCC
Generative Quality
Fréchet EEG Distance (FED), spectral coherence, Scenario Coverage Rate (SCR)

Why Topology Beats Spectra

PSD sees energy; topology sees structure.

Two EEG epochs can have identical power spectra yet fundamentally different phase-space geometry.

Integrated Information Theory (IIT)

Consciousness involves integrated network architectures.

Global Workspace Theory (GWT)

Conscious content corresponds to globally broadcast neural assemblies.

Persistent Homology

The mathematical machinery to measure precisely this geometric integration.

PHINN-EEG doesn’t just detect that you’re dreaming—it reads the shape of the dream itself.

About Mugen.Codes

Mission-critical engineering meets topological AI.

Mugen.Codes develops mission-critical software for defense, space, and brain-computer interface applications. We combine Japanese engineering discipline with calm, documented workflows to deliver systems that stay reliable for decades.

  • BCI & Neural Signal Processing — OpenBCI, BrainVision, Intan, Neuralynx, LSL, neural pipelines
  • Edge AI & Autonomous Systems — TensorRT, ONNX, embedded inference, model optimization
  • Real-Time & Embedded Systems — VxWorks, FreeRTOS, QNX, Linux RT
  • High-Compliance Engineering — ITAR-aware workflows, FIPS, DISA STIGs, formal verification

PHINN-EEG is the latest in our series of topological AI breakthroughs, following PHINN (Persistent Homology Inspired Neural Network for rare-event time-series synthesis).

Read the Paper

Full technical details.

The complete methodology, ablation studies, and evaluation results are available in our preprint on arXiv.

arXiv:2607.09662 →

The Future of Dream Engineering

From Inception to real-world EEG topology.

“This work represents a paradigm shift from asking ‘how much brain activity?’ to ‘what shape is the brain’s activity?’ in the context of conscious dreaming.” From Inception’s dream extractors to real-world EEG topology, the ability to read and synthesize the geometry of dreams is no longer science fiction. It is mathematics, engineered.