Dreamento Dev Path

Chapter 8 — Connect It Back to Dreamento

The real model.py, nn.py, and realTimeAutoScoring.py code, the exact config Dreamento’s live scorer expects, and a concrete written plan for where a trained model would plug in.

Chapter 8 — Connect It Back to Dreamento

Think of it like this: you've built a go-kart engine (Chapter 6) in your own garage. This chapter is popping the hood of the real car (Dreamento) and finding exactly which socket your engine would need to bolt into — what shape, what voltage, what connector. Not swapping it in yet. Just mapping the socket.

What's Actually in the Repository

Four things to go read, straight from the real Dreamento repository:

The Real Numbers, Verified Straight From the Code

Open realTimeAutoScoring.py and you'll find a real config dictionary with exact values — not estimates, the literal numbers the live system expects:

The channel naming confirms the ZMax dual-channel format too: the code expects a signal_req (EEG L) and a signal_ref (EEG R), matching the EEG L.edf / EEG R.edf files ZMax actually produces.

THE DOOR IS DELIBERATELY LEFT OPEN

Dreamento's own README says this about real-time autoscoring: "open to any algorithm (is not ideal yet, still under development)." That's not a guess about where your Chapter 6 model might fit — it's the project's own maintainers saying, in writing, that this exact piece is unfinished and welcomes a better model. This is a real, acknowledged opportunity, not a reach.

About Actually Running It

The original learning path suggests running offline Dreamento on a sample recording. Worth knowing up front: Dreamento is a desktop GUI application (PyQt5, installed via Anaconda or pip per its own README), not something that runs inside Colab. Installing and running it locally is genuinely useful if you want hands-on experience with the real tool, but it's optional for finishing this chapter — the actual deliverable below doesn't require it.

Write It Down: Your Integration Plan

Same approach as Chapter 7 — answer these directly, a few sentences each, grounded in what you just read:

  1. Chapter 6's lab used 1 EEG channel, 256-sample windows resampled by MNE, and sequences of 10 epochs. Dreamento's real config expects 7680-sample windows (256 Hz × 30s) and different sequence handling. What exactly would need to change in your Chapter 6 code to match?
  2. realTimeAutoScoring.py imports TinySleepNet straight from model.py. If your own trained model needed to plug in here, what format would it need to be saved in, and what would the loading code need to call?
  3. DreamentoScorer (LightGBM) is what's actually running today, not a neural network. What would have to be true — in terms of accuracy, speed, or reliability — before swapping in a neural model would actually be worth doing?
  4. Name one concrete, scoped-down first step you could realistically take toward this integration, short of rewriting the whole real-time pipeline.

DONE WHEN

You have a concrete written integration plan — not code yet, just where a trained model goes and exactly what format conversion would be needed to get there.

That's Part 2 complete — the full machine learning pipeline, from a classical baseline through a real trained CNN+LSTM to a genuine, code-verified integration plan. Part 3 turns to lucid dreaming specifically: sleep staging tells you when someone is in REM, but not whether they're lucid — a separate, harder, and far less settled question.