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.

Biometric key generation systems operating on fMRI signals must remain stable under real-world acquisition conditions. Signal quality in fMRI recordings is affected by thermal noise in scanner hardware, subject head motion, and electrode displacement artifacts. The Neural Vault benchmark simulates both classes of corruption systematically, sweeping SNR levels from 30 dB down to 0 dB and dropout probabilities from 0% to 30%, then measuring how each method’s Equal Error Rate responds to degraded input.

Noise Injection Functions

Additive White Gaussian Noise

add_gaussian_noise computes the average signal power of the input, derives the required noise power from the target SNR in decibels, and injects zero-mean Gaussian noise at that power level.
def add_gaussian_noise(x, snr_db):
    """Injects custom levels of Additive White Gaussian Noise."""
    x_pure = np.nan_to_num(x)
    sig_avg_watts = np.mean(x_pure ** 2)
    sig_avg_db = 10 * np.log10(sig_avg_watts + 1e-9)
    noise_avg_db = sig_avg_db - snr_db
    noise_avg_watts = 10 ** (noise_avg_db / 10)
    return x_pure + np.random.normal(0, np.sqrt(noise_avg_watts), size=x_pure.shape)
SNR levels tested: [30, 20, 15, 10, 5, 0] dB. At 0 dB the noise power equals the signal power, representing an extremely degraded acquisition.

Motion Artifact Simulation

add_motion_artifacts stochastically replaces a fraction of feature values with draws from a high-variance Gaussian distribution, simulating the effect of electrode displacement during scanning or transient signal dropout.
def add_motion_artifacts(x, prob):
    """Simulates channel signal dropping and raw sensor distortion drift."""
    mask = np.random.binomial(1, prob, size=x.shape).astype(bool)
    x_noisy = np.nan_to_num(x.copy())
    x_noisy[mask] = np.random.normal(0, 3.0, size=mask.sum())
    return x_noisy
Artifact probability levels tested: [0.0, 0.05, 0.10, 0.15, 0.20, 0.30]. At prob=0.30, 30% of all feature values are independently replaced with N(0, 3.0) noise — a severe corruption scenario.

AWGN Noise Robustness Results

EER (%) for each key generation method at each SNR level. Lower EER is better; values near 50% indicate random performance (genuine and impostor keys are indistinguishable).
SNR (dB)SHA256 EERHMAC EERBioHashing EERNeural EER
3049.20%50.00%15.63%0.75%
2049.03%51.06%16.98%0.75%
1549.74%51.15%15.28%0.75%
1051.51%50.67%16.98%1.13%
550.13%51.72%14.34%0.47%
049.33%48.75%11.49%1.13%
SHA256 and HMAC hover near 50% EER at every SNR level because cryptographic hash functions are designed to be maximally sensitive to input changes — a single bit flip in the feature vector produces a completely different 256-bit digest. This means genuine samples with slightly noisy features produce keys that are as far from the prototype key as random impostor samples. The Hamming distance distributions for genuine and impostor pairs collapse onto each other, making discrimination impossible regardless of noise level.

Motion Artifact Robustness Results

EER (%) for each method as a fraction of feature values are randomly corrupted with N(0, 3.0) noise.
Artifact ProbSHA256 EERHMAC EERBioHashing EERNeural EER
0.0048.39%52.58%15.09%0.75%
0.0550.83%50.53%13.21%1.26%
0.1051.55%50.76%11.79%1.42%
0.1550.27%50.67%11.32%0.94%
0.2050.56%49.09%12.74%1.13%
0.3047.73%51.17%10.06%0.94%

Key Findings

Neural method stability. The Neural key generation method stays below 1.5% EER across all tested noise and artifact conditions — including 0 dB SNR (noise power equal to signal power) and 30% feature dropout. The learned transformer embedding provides a smooth, noise-tolerant manifold where small perturbations to the input map to small changes in the latent representation, preserving the identity signal. SHA256 and HMAC are insensitive to input structure. Both cryptographic methods produce EER values that oscillate randomly between roughly 47% and 53% across all conditions. They are not degrading — they were already at chance performance on the clean data. Their Hamming distance distributions are flat because hash functions are designed for collision resistance, not biometric similarity. BioHashing counterintuitively improves under artifacts. BioHashing EER decreases from 15.09% at zero artifacts down to 10.06% at 30% dropout. This is a consequence of the random projection geometry: high-variance artifact noise partially orthogonalizes the projected features, reducing overlap between genuine and impostor projected distributions. The effect is not reliable and should not be interpreted as robustness — the baseline EER is already 15× worse than the Neural method at zero noise.
The artifact simulation replaces corrupted values with N(0, 3.0) noise, which has a standard deviation of 3.0 against a StandardScaler-normalized input with σ=1.0. This represents a 3× amplitude corruption, more severe than typical motion artifacts in clinical fMRI. The Neural method’s stability under these conditions demonstrates genuine robustness beyond what standard artifact rejection pipelines would encounter.

Build docs developers (and LLMs) love