Neural Vault is a research pipeline that derives stable, 256-bit cryptographic keys directly from fMRI cortical activity. It ingests per-vertex cortical surface predictions generated by the TRIBEv2 brain-encoding model, feeds them through a few-shot Transformer encoder trained with triplet metric learning, and passes the resulting L2-normalized embedding through HKDF-SHA256 to produce a reproducible, high-entropy key. The result is a biometric authenticator that achieves a 0.75% Equal Error Rate and a d-prime of 5.95 — compared to ~50% EER (indistinguishable from random guessing) when SHA-256 or HMAC are applied naively to the same raw neural signals.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Skieriya/fMRI-key-generation-with-TRIBEv2/llms.txt
Use this file to discover all available pages before exploring further.
Neural Vault is a research pipeline. It requires TRIBEv2 cortical-prediction data (
5classpreds.csv) generated by running data.py against the five stimulus video files. No synthetic fallback is provided for the full benchmark; model.py ships a synthetic stand-in for local development only.What Neural Vault Does
Traditional cryptographic hashing functions — SHA-256, HMAC — are deterministic but not robust to noise: small session-to-session variation in a neural signal produces a completely different hash output, driving EER toward 50%. Neural Vault solves this by learning an embedding space in which all fMRI recordings of the same stimulus class cluster tightly around a prototype centroid, while recordings from different stimuli are pushed far apart. Verification then becomes a cosine-similarity comparison on the unit hypersphere, and key derivation operates on the stable prototype embedding rather than the raw, noisy signal.Stimulus Classes
The model is trained and evaluated on five video stimuli (v1 through v5), each processed by TRIBEv2 to produce per-timestep cortical predictions across 20,484 vertices on the fsaverage5 surface (10,242 left hemisphere + 10,242 right hemisphere). These five classes form the classification vocabulary for the few-shot episodes.
System Architecture
The end-to-end pipeline flows through the following stages:Two Entry Points
Neural Vault ships two Python entry points serving different purposes:| File | Purpose |
|---|---|
main.py | Full benchmark pipeline: trains the model, runs 40 few-shot episodes, evaluates SHA-256 / HMAC / BioHashing / Neural / NeuralVault methods, stress-tests under AWGN and motion artifacts, exports a JSON results file, a 6-panel visualization dashboard, and a Markdown benchmark report. |
model.py | Standalone enrollment and verification demo: loads (or synthesizes) data, trains the few-shot model for 150 epochs with cosine LR annealing, computes a user prototype, derives a 256-bit key, and plots similarity distributions, ROC, DET, and d-prime curves. |
main.py to reproduce the published benchmark numbers. Run model.py to explore the enrollment-and-verification flow interactively.
Benchmark Highlights
The table below reproduces the published results frombenchmark/reports/BENCHMARK_REPORT.md, generated against real TRIBEv2 predictions.
| Method | d-prime | EER | Notes |
|---|---|---|---|
| Neural (binarized embeddings) | 5.95 | 0.75% | Transformer embeddings, Hamming distance |
| NeuralVault (cosine similarity) | 4.84 | 0.94% | Prototype cosine verification |
| BioHashing | 2.21 | 15.09% | GaussianRandomProjection + binarize |
| SHA-256 | 0.14 | 48.4% | Raw signal hash, near-random |
| HMAC | 0.25 | 52.6% | Keyed hash, near-random |
Explore the Documentation
Quickstart
Install dependencies, generate
5classpreds.csv with data.py, and run your first benchmark in under ten minutes.Concepts
Deep-dives into triplet metric learning, prototypical networks, HKDF-SHA256 key derivation, EER, and d-prime.
Pipeline
Step-by-step walkthrough of the full data-processing and training pipeline from raw MP4 files to derived keys.
Benchmarking
Reproduce the full benchmark suite — noise robustness curves, motion artifact tests, and the 6-panel dashboard.