This repository contains the code of the different unsupervised machine learning algorithms implemented in the paper to detect anomalies in Cloud Gaming Sessions. The paper was accepted and presented at the 4th International Workshop on High-Precision, Predictable and Low-Latency Networking (HiPNet 2022) colocated with the 18th International Conference on Network and Service Management (CNSM) in Thessaloniki, Greece.
DOI: Assessing Unsupervised Machine Learning solutions for Anomaly Detection in Cloud Gaming Sessions
The models implemented are :
The datasets can be download on this link.
Download and unzip the file in the data folder.
cd data/
tar -xvf ANR-19-CE25-0012_stadia_cg_webrtc_metrics.tar.xz .
The main dependencies are the following:
- Python 3.8+
- Torch
- Numpy
- Pandas
- Scikit-Learn
By assuming that conda is installed, you can run this to install the required dependencies.
conda create --name [ENV_NAME] python=3.8
conda activate [ENV_NAME]
pip install -r requirements.txt
From the root of the repository, the usage of the main file can be seen by running:
python3 -m main --help
This will output the following parameters to run the main program.
usage: main.py [-h] --model_name {pca,iforest,oc_svm,ae,lstm_vae} [--window_size WINDOW_SIZE] [--contamination-ratio CONTAMINATION_RATIO]
[--seed SEED] [--save-dir SAVE_DIR] [--data-dir DATA_DIR] [--if-mixed-data]
optional arguments:
-h, --help show this help message and exit
--model_name {pca,iforest,oc_svm,ae,lstm_vae}
The model to train and test.
--window_size WINDOW_SIZE
The window size. Default is 10.
--contamination-ratio CONTAMINATION_RATIO
The contamination ratio. Default is 0.
--seed SEED The random generator seed. Default is 42.
--save-dir SAVE_DIR The folder to store the model outputs.
--data-dir DATA_DIR The folder where the data are stored.
--if-mixed-data If datasets must be mixed or not. Default action is true.
The hyper-parameters of each model used in the paper are the default parameters in the code. They can be seen or changed in their respective code file (src\models\[model_name].py
).
To train an Auto-Encoder model with the default parameters, with the mixed-datasets splitting strategy, with an anomaly contamination of 5%, run :
python main.py --model_name ae --contamination-ratio 0.05