This repository contains the code required to reproduce the results presented in the paper "VR-DIAMOND: Virtual Reality Dynamic Identification and Authentication via MOtion and Network Data".
The code is primarily designed to process the Questset dataset (https://researchdata.cab.unipd.it/1239/). However, it can be adapted to work with other datasets containing VR movement traces and/or network traffic traces.
.
├── pre-processing/
│ ├── synchronizer.py
│ ├── generate_frame_traces.py
| ├── feature_extraction.py
| ├── feature_extraction_before_attack.py
| ├── spoofing_parameters.py
│ └── feature_extraction_during_attack.py
│
├── main-codes/
│ ├── user_id.py
│ ├── user_auth.py
│ ├── user_auth_movement.py
│ └── user_auth_movement_spoofing.py
│
├── utils/
│ └── confidence_interval.py
│
└── README.md
The pre-processing stage synchronizes the raw data and extracts the features required by the identification and authentication algorithms.
synchronizer.py- Synchronizes raw movement and network traffic data.generate_frame_traces.py- Generates frame traces from the raw network traffic data.feature_extraction.py- Extracts movement, traffic, and frame-related features and generates the corresponding feature files.
-
feature_extraction_before_attack.py- Computes the mean values of the movement features over the training samples. It generatesslow_means.csvandfast_means.csv. -
spoofing_parameters.py- Uses the mean values computed byfeature_extraction_before_attack.pyto calculate the scale factors required to perform spoofing for all attacker-victim pairs. It generatesfast_scale_factors.csvandslow_scale_factors.csv. -
feature_extraction_during_attack.py- Computes the altered features resulting from the spoofing attack and generates the corresponding test files. Specifically,feature_extraction_during_attack.pygenerates the following files:test_data_post_attack_beat_saberX_test_only.pkl: Altered features for victim X during Beat Saber, considering all attackers in the test_only test set (Uout).test_data_post_attack_beat_saberX_test_trained.pkl: Altered features for victim X during Beat Saber, considering all attackers in the test_trained test set (Uin).test_data_post_attack_forklift_simulatorX_test_only.pkl: Altered features for victim X during Forklift Simulator, considering all attackers in the test_only test set (Uout).test_data_post_attack_forklift_simulatorX_test_trained.pkl: Altered features for victim X during Forklift Simulator, considering all attackers in the test_trained test set (Uin).
where, X represents the victim's user identifier.
The feature_extraction_during_attack.py script relies on the following inputs:
- Scale factors generated by
spoofing_parameters.py. - Height normalization factors.
- Genuine test data.
- Windows selected for the test set.
This implementation is designed to optimize computation by processing only the windows selected for testing, since these are the only samples required at test time.
The genuine test data and selected windows are extracted from the genuine user authentication implementation (user_auth_movement.py).
Height normalization factors are explicitly applied in this script to reproduce the behavior of a realistic system, in which the height normalization factor is estimated during training. This avoids using the height normalization procedure in user_auth.py, which would otherwise also account for altered features, resulting in undesired behavior.
The main-codes/ folder contains the following implementations:
user_id.py- Implements user identification.user_auth.py- Implements user authentication using all considered features.user_auth_movement.py- Implements user authentication using movement data only. It also generates the auxiliary files required to perform spoofing attacks.user_auth_movement_spoofing.py- Implements user authentication using movement data only, under a spoofing attack.
The utils/ folder contains one helper script used to generate the results presented in the paper:
confidence_interval.py- Computes confidence intervals for the voting effect, as reported in Figures 3, 7, 8, and 9 of the paper.
To reproduce the user identification or authentication results, execute the following scripts in the specified order:
- Run
synchronizer.pyto synchronize the raw movement and traffic data. - Run
generate_frame_traces.pyto generate frame traces from the raw traffic data. - Run
feature_extraction.pyto extract the required features. - Run the desired identification or authentication implementation:
user_id.pyfor user identification.user_auth.pyfor user authentication.user_auth_movement.pyfor movement-only user authentication.
To reproduce the spoofing attack experiments, execute the following steps in order:
- Run
feature_extraction_before_attack.pyto compute the mean movement features over the training samples. - Run
spoofing_parameters.pyto calculate the spoofing scale factors. - Run
user_auth_movement.pyafter uncommenting the lines responsible for generating the auxiliary files required by the spoofing implementation. These lines are clearly indicated in the script. - Run
feature_extraction_during_attack.pyto generate the altered test features. - Run
user_auth_movement_spoofing.pyto perform user authentication under the spoofing attack.
Important: The spoofing attack pipeline requires the output files generated at each previous step. Make sure to execute the scripts in the specified order.
If you use this code in your research, please cite the following paper:
S. Baldoni, F. Chiariotti, S. Benhamadi, M. Zorzi and F. Battisti, "VR-DIAMOND: Virtual Reality Dynamic Identification and Authentication via MOtion and Network Data," in IEEE Transactions on Mobile Computing, doi: 10.1109/TMC.2026.3751487.