Adds the only legitimate BBB <-> MRI bridge in the platform — researcher
lane only. Fusion engine still excludes BBB as a diagnostic modality.
Modules:
- src/models/bbb_permeability_map.py: scalar BBB leakage score in [0,1]
with two modes. heuristic_proxy (default) reuses the 2D resnet18
Alzheimer classifier and computes 1 - P(NonDemented). dce_onnx loads
a real 4D DCE-MRI ONNX model from BBB_PERMEABILITY_DCE_PATH and
averages a normalised Ktrans map; raises a clear FileNotFoundError
with contract documentation when no artifact exists.
- src/research/drug_dose_adjuster.py: pure-function dose revision keyed
on (BBB intact?, drug BBB-permeable?). Permeable drugs see an
aggressive linear cut floored at 30%; non-permeable drugs see a mild
cut floored at 60%; intact BBB returns baseline unchanged. Unknown
drug permeability is treated as permeable (safer). Rationale always
includes the 'research suggestion, not medical advice' disclaimer.
API:
- POST /predict/bbb_permea…
User clarified intent:
1. MRI training is final — best_model.pt is the artifact, just load+predict.
Removed the ambiguous 'state_dict vs full model' blocker framing; tests
already use a synthetic dummy resnet18 so TDD works before the real .pt
lands. Real-artifact sanity test auto-skips when absent.
2. EEG pretrained model assumed present for the hackathon demo. Replaced
the OASIS-tabular fork with a stub-able EEG plan: src/models/eeg_model.py
loads any sklearn predict_proba classifier from joblib, with a synthetic
stub fixture so tests pass today. Real artifact swaps in at
data/processed/eeg_clf.joblib with zero code changes.
Roadmap, MRI plan, and the new EEG plan all preserve independence
guarantees and align on the same loader+stub pattern.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Roadmap + three sub-plans for integrating user-supplied external assets:
1. MRI DL 2D — pretrained resnet18 4-class Alzheimer's classifier from
user's training run (BEST_PARAMS: image_size=160, lr=3.75e-4,
weight_decay=1.96e-4, dropout=0.31). Adds src/models/mri_dl_2d.py
parallel to volumetric ONNX path, dispatched via MRI_MODEL_KIND env.
2. TF-IDF clinical RAG — 14 medical PDFs (Alzheimer/Parkinson/lifestyle)
with Turkish+English query expansion. Wraps user's pre-built sklearn
TF-IDF index as src/rag/clinical/. Existing FAISS RAG kept.
3. OASIS tabular classifier — sklearn RF on OASIS longitudinal biomarkers
(MMSE/eTIV/nWBV/ASF/...). NOTE: user described notebook as 'EEG model'
but it is OASIS tabular. Plan flags this prominently with branch 3a
(default: integrate as fusion modality) vs 3b (await real EEG model).
All three plans flag prerequisite blockers (artifact transfer, dataset
acquisition) and preserve independence guarantees from the clinical
platform …
Roadmap indexes six independent sub-projects with locked-in independence
guarantees: BBB / MRI / EEG / fusion pipelines all run standalone, with
sub-plan #3 (BBB-from-MRI) the only legitimate bridge.
Fusion engine plan is the foundation: 8 TDD tasks producing a pure-Python
multi-modal combiner (MRI + EEG + clinical scores -> per-disease confidence
with attribution) plus FastAPI route and agent tool registration. BBB is
explicitly excluded as a fusion modality and pinned by a regression test.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Plan covers dropping the template-only fallback in favor of real
OpenRouter LLM calls, with template kept as outage fallback only.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
docs(notes): manual click-through checklist for HF Space smoke verification
Code reviewer caught a latent blocker: with 4 EEG channels, ICA fits only 3
components, and find_bads_eog's default z-score measure cannot reach the
default 3.0 threshold (algebraic ceiling sqrt(n-1)). Switch to
measure='correlation', threshold=0.9 so the EOG-correlated component is
reliably flagged before Task 4 lands.
Add a comprehensive implementation plan for NeuroBridge Day 2: an EEG pipeline using MNE + ICA. The new markdown (docs/superpowers/plans/2026-04-30-day2-eeg-mne-ica-pipeline.md) specifies goals, architecture, public API (is_valid_epoch, bandpass_filter, remove_artifacts_with_ica, compute_features_from_epoch, extract_features_from_recording, run_pipeline), tech stack, file layout, TDD tasks (fixture, unit tests, feature implementation, orchestrator/CLI), expected behavior, logging, determinism requirements, Parquet output schema, and a Definition of Done checklist. The document provides step-by-step tasks and expected test outcomes to guide development and verification.
chore: track planning docs and ignore .sixth/ tooling dir