Skip to main content

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 biometric cryptographic system that turns fMRI brain activity into stable, unique 256-bit cryptographic keys. By combining a Transformer-based few-shot encoder (trained with triplet metric learning on TRIBEv2 cortical predictions) with HKDF-SHA256 key derivation, it achieves an Equal Error Rate of 0.75% and a d-prime separability of 5.95 — far outperforming traditional SHA256 or HMAC approaches applied directly to neural signals.

Introduction

Understand what Neural Vault is, why brain-based biometrics matter, and how the system fits together.

Quickstart

Install dependencies, run the pipeline on your own fMRI data, and derive your first cryptographic key.

Pipeline

Deep-dive into each stage: data processing, model training, key derivation, and verification.

Benchmarking

Explore benchmark results comparing Neural, BioHashing, HMAC, and SHA256 key generation methods.

API Reference

Complete function signatures, parameters, and return types for every public Python function.

Concepts

Learn the key concepts: metric learning, prototypical networks, HKDF, EER, and d-prime.

How it works

1

Prepare fMRI Data

Run TRIBEv2 on video stimuli to generate cortical predictions. The data.py script processes up to 5 video files and saves a 5classpreds.csv feature matrix with shape (N_timesteps × N_vertices, 3).
2

Train the Neural Vault Model

NeuralVaultFewShot — a Transformer encoder with a 128-d latent embedding head — is trained for 100 epochs using triplet loss. Genuine samples from the same stimulus class are pulled together; impostors are pushed apart.
3

Enroll: Compute Class Prototypes

After training, compute the mean embedding for each stimulus class. These prototype vectors serve as the stable biometric template from which keys are derived.
4

Derive Cryptographic Keys

Each prototype embedding is quantized to int16, then passed through HKDF-SHA256 with the info string neural-vault-few-shot-v1 to produce a deterministic 256-bit key.
Neural Vault is a research pipeline. It requires 5classpreds.csv — TRIBEv2 cortical predictions — as input. See Data Preparation for how to generate this file.

Build docs developers (and LLMs) love