Skip to content

About

Offline, OS-neutral behavioural-authentication prototype for 1F916 listing 65 (synthetic data only)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

Marrow prototype — Listing 65

An offline, open-source prototype that decides whether the person at the computer is the enrolled user, using only ordinary input events: pointer movement and clicks, plus text as it arrives from a physical keyboard, an on-screen keyboard, or dictation/software insertion (including corrections). No audio, no camera, no capture driver, no device assumption.

One command from a fresh copy:

python3 main.py
# or
bash run.sh

It generates deterministic fake recordings, trains one profile per owner, locks a threshold on a validation split, scores a held-out test split, runs the swap test, prints FAR/FRR, and exits 0 only when all five listing conditions and the pre-registered targets pass. It is Python 3.10+ standard library only and never opens a network socket.

Result of the shipped run

owner FRR:    5.56%  (2/36, 95% CI 1.5%-18.1%)
stranger FAR: 2.78%  (2/72)
mimic FAR:    6.25%  (3/48)
combined FAR: 4.17%  (5/120, 95% CI 1.8%-9.4%)
ROC AUC:      0.979
swap test:    0/36 owner sessions opened by a profile trained on the same-style other person
swap, raw:    1/36 before the fixed 0.10 safety margin (diagnostic only)

The swap rule is stated in advance in PREREGISTRATION.md: a profile trained on a different person gets a 0.10 margin above its own validation threshold before it is used as a swap test. Without that margin, one Alice session would open; with the rule as locked, none do. Both numbers are reported.

Threshold: 0.459481, fixed on validation before the test split was opened (validation FAR 1.56%, FRR 0.00%). Per-style and per-owner tables are in RESULTS.md; the machine-readable run is artifacts/results.json, and the pre-test lock is artifacts/threshold_lock.json.

These are synthetic-data results. They are not a claim about real-world security.

What is in the fake data

Three input styles, each with an enrolled owner, a tired owner, a different person, and two mimics:

style modality owner same-style other people mimics
pointer_keyboard physical mouse + keyboard alice bruno, casey regular, noisy
slow_pointer_dictation slow joystick/head pointer + dictation software ravi devi, mira regular, noisy
switch_onscreen switch access + on-screen keyboard + dwell clicks nia oren, pax regular, noisy

The corpus has 372 sessions (train/validation/test), generated by marrow/synth.py from seed 20261108. Each identity has rested and tired sessions in every split. Mimics copy the owner's central habits — speed, key or phrase interval, correction rate, click rate, modality — but differ in dispersion, path shape, autocorrelation, burst rhythm and dwell variability. The two variants deliberately fail in opposite directions: one is too regular, the other too noisy. No real movement, text, audio or camera data is present. The generated recordings are CC0.

How the method works

  1. Read a plain recording. One JSONL header and events with millisecond timestamps; pointer x/y are screen fractions; clicks are down/up; text is insert/delete labelled typed, onscreen or software. Text content is never read — text_len is enough. See FORMAT.md.
  2. Extract behaviour, not device. Pointer speed, acceleration, jerk, direction change, stroke straightness/curvature, pause tails, click dwell, click interval and pre-click pauses; text rhythm inside a burst, pauses between bursts, phrase lengths, correction bursts and their latency; modality mix and session drift. Absolute timing is standardised within the observed text-arrival modality (typed / on-screen / software), so "uses a mouse" is not mistaken for "is Alice". A pointer-only or text-only session is still readable; missing groups are imputed.
  3. Fit a small profile. A diagonal linear discriminant is fitted to the owner's sessions against a background of other people, with presence filtering, correlation pruning and shrinkage. A two-sided shape gate rejects sessions that are outside the owner's own range in either direction — a mimic that is too regular fails just as a mimic that is too noisy does.
  4. Lock the threshold before testing. The accept threshold is chosen on the validation split by a rule fixed in code: maximise true-accept rate subject to validation FAR ≤ 5%; ties go to the higher threshold. The threshold, validation hashes, code hashes and anomaly gates are written to artifacts/threshold_lock.json before the test split is loaded.
  5. Run the swap test. For each owner, a separate profile is trained on the same-style other person, with the owner excluded from both its positives and its negatives. Its accept threshold is chosen on that person's validation sessions, then given a fixed 0.10 safety margin before the swap test. The owner is unseen. Result: 0/36 opens.

Run the tests

python3 -m unittest discover -s tests -v

The full demo is the integration test. A fresh-copy run is described in the submission note; python3 main.py and bash run.sh both work from a copy that contains only the repository files.

Use it on your own recordings

The demo is not needed. Record sessions in the format above with whatever tool you already use, then:

python3 tools/train_test.py train \
  --owner my-recordings/enrol/ \
  --background other-people/ \
  --validation-owner my-recordings/val/ \
  --validation-background other-people-val/ \
  --out me.profile.json

python3 tools/train_test.py test \
  --profile me.profile.json \
  --input my-recordings/new-session.jsonl

tools/train_test.py is offline and stdlib-only. It prints each session's score and accept/reject decision; --json gives machine-readable output.

Honest limits

  • The evaluation is on synthetic data produced by this repository. A good score on one generator is not evidence of real-world biometric security. Independent cross-generator tests are the right next step; this prototype should be judged on whether the method and its failure modes are inspectable, not on the headline numbers alone.
  • The profile is enrolled per input style. A user who switches from a mouse to a switch mid-profile would need a session in that style; the cross-style column is reported separately (0/144 here) but is not the headline claim.
  • Replay of a recorded session is not addressed. A production system needs a liveness/challenge layer, and this prototype does not pretend otherwise.
  • The shape gate and the 0.10 swap margin are deliberate conservative choices; they trade some genuine-user acceptance for impostor rejection. The exact values and the reasons are in the code and PREREGISTRATION.md.
  • No claim is made that this is sufficient authentication for a real account. It is a working, reproducible prototype of the decision method.

Files

path purpose
main.py one-command demo: data → train → lock → test → report
run.sh same, via bash
marrow/format.py recording loader/validator/writer
marrow/features.py device-neutral feature extraction
marrow/model.py normaliser, profile, anomaly gate, threshold rule
marrow/synth.py deterministic fake-data generator
marrow/evaluate.py splits, scoring, swap test, five-condition check
tools/train_test.py generic offline train/test CLI
FORMAT.md the OS-neutral recording format
PREREGISTRATION.md targets, threshold rule and swap rule
RESULTS.md generated result of the shipped run
data/ 372 synthetic JSONL recordings + manifest
tests/ format, feature and model tests

License

MIT for the code. The synthetic recordings in data/ are CC0-1.0. See LICENSE.

About

Offline, OS-neutral behavioural-authentication prototype for 1F916 listing 65 (synthetic data only)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages