Phasic← Overview

The model zoo

Models are not part of Phasic and are not included in the application. Each is obtained separately — usually with Get models (below) — and each carries its own licence.

Read the licence before using a model. Phasic can run a model; it cannot grant you the right to use it for your purpose. A non-commercial licence means exactly that, whatever you are using Phasic itself for.

Phasic reads the licence from each manifest and shows it in the inference pane, so the terms travel with the model rather than living only in a repository you cloned once.


SleepFM — clinical sleep staging

Task:      Sleep staging
Classes:   Wake, N1, N2, N3, REM
Input:     128 Hz, 300 s windows, non-overlapping
Groups:    BAS (brain), RESP (respiration), EKG, EMG — all dynamically sized
Graphs:    2 stages
Licence:   CC BY-NC 4.0 — NON-COMMERCIAL USE ONLY
Source:    https://github.com/zou-group/sleepfm-clinical

A multimodal model: it takes brain, respiratory, cardiac and muscle channels as separate inputs rather than one concatenated block, and needs all four groups populated.

Each group is dynamically sized — it takes whatever matching channels the recording has and sizes itself to them, rather than padding to a fixed width. This is the honest description of an encoder whose channel axis is genuinely variable.

Five-minute windows mean a short recording may produce no predictions at all.

Licence constraint

CC BY-NC 4.0 prohibits commercial use. This covers using the model in the course of commercial activity, not only selling it. If your use is commercial in any sense, this model is not available to you regardless of what you paid for anything else.

Phasic detects the non-commercial marker in the manifest and flags it in the interface.

On accuracy

Expect agreement with human scoring in the 70–80% range. That is not a shortfall: human inter-scorer agreement on sleep staging is itself only around 82%. Agreement near 100% would indicate the evaluation labels had leaked into the input, not that the model is excellent.


BIOT — seizure detection (CHB-MIT)

Task:      Seizure detection
Classes:   non_seizure, seizure
Input:     200 Hz, 10 s windows, non-overlapping
Groups:    eeg16 — exactly 16 EEG channels
Graphs:    1 stage
Licence:   BIOT code + SSL encoder: MIT
           CHB-MIT data: Open Data Commons Attribution License v1.0
Source:    https://github.com/ycq091044/BIOT
           https://physionet.org/content/chbmit/1.0.0/

A single-stage classifier over a fixed 16-channel EEG montage.

Required citation

The training data is open but attribution-licensed. Work using this model should cite:

  • Shoeb (2009) — the CHB-MIT scalp EEG database
  • Goldberger et al. (2000) — PhysioNet

On interpreting the output

This model is badly calibrated and you should not read its class output directly. It was trained on roughly 1.1% positives and labels effectively every window non_seizure.

Use the probabilities, not the class. Quality is properly measured by AUROC — a ranking metric — because accuracy at 1% prevalence is satisfied by always answering “no”. The published cross-patient result for this model on CHB-MIT is around 0.7 AUROC, which is what to expect.

This is a property of the model, not of Phasic’s port; the port is verified separately. See Correctness.


Obtaining models

Pane:       Inference ▸ MODEL ▸ Get models…
Requires:   onnx
Network:    GitHub (the model's authors), the uv release, the Python package index

Get models installs a model in one step: open an Inference pane, click Get models…, choose the model, read its licence, and click Install. A model whose licence forbids commercial use cannot be installed until you tick “I will use this model only for non-commercial purposes”.

Phasic does not distribute the model. What it ships is a recipe — where the authors publish it (one pinned commit), the SHA-256 of every file the conversion uses, and a converter script — and the install runs on your computer:

Step What happens
Getting conversion tools Uses uv from your PATH (0.9.21 or newer, the version the converter is tested with); otherwise downloads a pinned uv release and checks its hash. On Windows, install uv yourself
Downloading from the authors Fetches the authors’ source archive at the pinned commit
Verifying files Unpacks only the pinned files and checks each against its hash. A mismatch stops the install; nothing unverified is ever run
Converting and checking accuracy Runs the converter in an isolated Python environment. It exports ONNX and compares every graph against the original PyTorch model; a mismatch is not installed
Installing Records the licence, attribution, source commit, install time and the time you accepted the licence in the manifest, puts the authors’ LICENSE beside it, and moves the model into place in one step

Installed models live in your user data directory (~/.local/share/phasic/models on Linux, ~/Library/Application Support/Phasic/models on macOS, %APPDATA%\Phasic\data\models on Windows) and appear in the Inference pane’s MODELS list. When a model is loaded, the line under its name says where that copy came from.

The first install also downloads Python and PyTorch for the conversion — about 1.4 GB of disk in total, roughly two minutes on a fast connection (measured on Linux). Later installs reuse them. Free conversion tools in the same window deletes them; installed models stay.

Other routes, from the same window:

  • Import converted folder… — install a model directory (one with a manifest.json) converted on another machine. For offline computers.
  • Save converter… — save the conversion script and copy the terminal commands to the clipboard, to run the conversion yourself. Run by hand, the hash checks are yours to do.

PHASIC_USER_DIR overrides the user data directory (see Environment variables).

Models can still be exported by hand with the scripts in scripts/ and placed in the project’s models/. The list tags these dev copy; a model opened with Load from file… is tagged from file. When the same model exists in several places it is listed once, and the installed copy is the one that runs.

Because models are data, a model directory can be copied between machines and will work wherever Phasic can find it. See File layout.