Skip to content

roinaveiro/corrupting_hmms

Repository files navigation

Code for Corrupting HMMs paper

This repository contains code for reproducing all the experiments in the paper "Manipulating Hidden-Markov-Model Inferences by Corrupting Batch Data"

Installation and dependencies

Install all required dependencies using

conda create -f corrupting_hmms

Finally, install package using

pip install -e .

Section 5.1 Experiments

Section 5.2 Experiments

Section 5.3 Experiments

Section 5.4 Experiments

Code for reproducing each of the experiments is provided in folder experiments5.4

Path Attraction

To replicate the outcomes related to the path attraction attack, execute the following command:

python experiments5.4/ner_experiment_path_attraction.py 

The predefined weight values are $w_1 = 2.0$ and $w_2 = 1.0$, with a default search time of 9000 seconds. The Dirichlet precision is configured to $\kappa = 1000000$, and the success probability for the attack is set at $rho=1.0$. To accommodate stochastic variations, 10 experiments are conducted. The designated target path is defined in params.py as attack1. Adjustments to these default values can be made at the end of the experiments5.4/ner_experiment_path_attraction.py file.

Upon completing the experiments, the results will be stored in pickle files within the results/ner_path_attraction directory. Plots can be generated by running the experiment5.4/plot_path_attraction.R R script.

Distribution Disruption

To replicate the findings related to distribution disruption attack, utilize the following command:

python experiments5.4/ner_experiment_sd.py 

The default weight choices are $w_1 = 2.0$ and $w_2 = 1.0$, with a default search time of 9000 seconds. The Dirichlet precision is configured to $\kappa = 1000000$, and the success probability for the attack is set at $rho=1.0$. To accommodate stochastic variations, 10 experiments are executed. The designated target time for the attack is t' = 5. Adjustments to these default values can be made at the end of the experiments5.4/ner_experiment_sd.py file.

Upon completion of the experiments, results will be saved in pickle files within the results/ner_sd directory. Plots can be by generated running the experiment5.4/plot_sd.R R script.

State Attraction and Repulsion

To replicate the outcomes associated with state attraction and repulsion attacks, run the following command:

python experiments5.4/ner_experiment_ss.py 

The default weight choices are $w_1 = 2.0$ and $w_2 = 1.0$, with a default search time of 9000 seconds. The Dirichlet precision is set to $\kappa = 1000000$, and the success probability for the attack is configured as $rho=1.0$. To account for stochastic variations, 10 experiments are executed. The specified target time for the attack is t' = 5, and the target hidden state is 14. Adjustments to these default values can be made at the end of the experiments5.4/ner_experiment_ss.py file. Specifically, set the parameter $c=1$ for state attraction and $c=-1$ for state repulsion.

Upon completing the experiments, the results will be stored in pickle files within the results/ner_ss_attraction for the state attraction attack and results/ner_ss_repulsion for the state repulsion attack. Plots can be generated by running the experiment5.4/plot_ss_att.R and experiment5.4/plot_ss_rep.R R scripts.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages