This repository contains the code used for the master thesis "Hiding Money Laundering with an Intelligent Multi-Agent System Simulation" from Ingeborg van Keulen. It heavily relies on AMLSim (see https://github.com/IBM/AMLSim).
Ensure javac is set to 1.8 by running
javac -version
If you don't have any javac installed, you can install it with
sudo dnf install java-1.8.0-openjdk.x86_64
sudo dnf install java-1.8.0-openjdk-devel.x86_64
If the version is not set to 1.8, then run
sudo update-alternatives –config javac
You might also need to run chmod +x on run_simulation.
conda create -n venv python=3.7
Conda is recommended for making your life easier with installing pygraphviz in the next steps. See https://docs.conda.io/projects/conda/en/latest/user-guide/install/linux.html for installation instructions for conda.
conda activate venv
pygraphviz fails, which is solved by runningconda install pygraphviz
pip install -r requirements.txt
AMLSim/jarsIn the directory toy_examples the four different models (Random, SVM, DQN and BDQN) scripts can be found.
These scripts only work with some easy business rules that are defined in create_action_space.py in the same
directory. You can change the used parameters and add/modify/delete business rules in these scripts.
Each one of them can be run with python3 launder_as_much_<model>.py. If everything went okay, then you should
see a directory setting_1000_<id> (check the path in the script to see where it should have written to).
In this directory you can find a plot, showing the learning behaviour (in case of BDQN this one does not make much sense since it includes all heads), a json file containing the parameters used in the setting, and a CSV file containing all the states-actions taken during the games. In case of BDQN the final weights of the heads are also stored.
For more complex business rules the file Game.py in the directory q_agent can be used. It is called with
python3 Game.py, all the needed params need to be defined in the script itself. Note that you need to link a
business rule engine (some code that detects transactions according to some logic) yourself.
There are a lot of variables that can be changed. (like a lot lot)
br_engine/business_rules.py,
the days the rules should be applied to are defined in confs/engine_conf.jsonconfs/learning_conf.jsonconfs/amlsim_conf.json, otherwise:
AMLSim/paramFiles/ml_agent/alertPatterns.csvAMLSim/paramFiles/ml_agent/accounts.csv when is_aggregated_accounts=True,
otherwise it should work in confs/amlsim_conf.jsonAMLSim/paramFiles/ml_agent/degree.csv.
Haven't tested yet, but they possibly can be generated with the script AMLSim/scripts/generate_scalefree.py given the arguments num_vertices and edge_factorSee PARAMETERS.md for an extensive explanation of all parameters.
3 commits
Python
71.3%
Java
24.5%
Groovy
3.4%
This repository contains the code used for the master thesis "Hiding Money Laundering with an Intelligent Multi-Agent System Simulation" from Ingeborg van Keulen. It heavily relies on AMLSim (see https://github.com/IBM/AMLSim).
Ensure javac is set to 1.8 by running
javac -version
If you don't have any javac installed, you can install it with
sudo dnf install java-1.8.0-openjdk.x86_64
sudo dnf install java-1.8.0-openjdk-devel.x86_64
If the version is not set to 1.8, then run
sudo update-alternatives –config javac
You might also need to run chmod +x on run_simulation.
conda create -n venv python=3.7
Conda is recommended for making your life easier with installing pygraphviz in the next steps. See https://docs.conda.io/projects/conda/en/latest/user-guide/install/linux.html for installation instructions for conda.
conda activate venv
pygraphviz fails, which is solved by runningconda install pygraphviz
pip install -r requirements.txt
AMLSim/jarsIn the directory toy_examples the four different models (Random, SVM, DQN and BDQN) scripts can be found.
These scripts only work with some easy business rules that are defined in create_action_space.py in the same
directory. You can change the used parameters and add/modify/delete business rules in these scripts.
Each one of them can be run with python3 launder_as_much_<model>.py. If everything went okay, then you should
see a directory setting_1000_<id> (check the path in the script to see where it should have written to).
In this directory you can find a plot, showing the learning behaviour (in case of BDQN this one does not make much sense since it includes all heads), a json file containing the parameters used in the setting, and a CSV file containing all the states-actions taken during the games. In case of BDQN the final weights of the heads are also stored.
For more complex business rules the file Game.py in the directory q_agent can be used. It is called with
python3 Game.py, all the needed params need to be defined in the script itself. Note that you need to link a
business rule engine (some code that detects transactions according to some logic) yourself.
There are a lot of variables that can be changed. (like a lot lot)
br_engine/business_rules.py,
the days the rules should be applied to are defined in confs/engine_conf.jsonconfs/learning_conf.jsonconfs/amlsim_conf.json, otherwise:
AMLSim/paramFiles/ml_agent/alertPatterns.csvAMLSim/paramFiles/ml_agent/accounts.csv when is_aggregated_accounts=True,
otherwise it should work in confs/amlsim_conf.jsonAMLSim/paramFiles/ml_agent/degree.csv.
Haven't tested yet, but they possibly can be generated with the script AMLSim/scripts/generate_scalefree.py given the arguments num_vertices and edge_factorSee PARAMETERS.md for an extensive explanation of all parameters.
3 commits
Python
71.3%
Java
24.5%
Groovy
3.4%