Previous ARC research examined the relationship between neural network similarity and attack transferability between those two networks.
In the second phase of model similarity research, we are now assessing the relationship between dataset similarity and attack transferability between identitical models trained on two different datasets.
We show that dataset similarity is predictive of attack transferability. This is in line with recent research that shows dataset similarity is predictive of successful transfer learning.
- Step 1: Generate target-surrogate pairs of datasets with differences between them
- Start with smaller-scale differences
- Step 2: Compute similarity metrics between target-surrogate pairs
- Step 3: Train a network holding architecture and hyperparameters constant on each pair
- We may relax the requirement that tuning be identical in the future
- Step 4: Perform transfer attack. Record transfer attack success metrics
- Step 5: Assess relationship between similarity metrics and transfer attack succes
- analysis: This folder contains notebooks and data (including a .csv file of the results from wandb) used to generate the plots in the report. See
analysis/README.md
for details. - configs: This folder contains config files for the experiments, defining experiment groups (transform groups in the report), metrics, attacks, dataset creation arguments, and model training arguments. See
scripts/README.md
for more details on how these are used. - scripts: This folder contains scripts for model training, computing dataset similarity metrics, computing attacks and their success metrics, and generating the LaTeX tables of correlations shown in the report. See
scripts/README.md
for usage. - src: This folder contains our source code for the project. This includes our implemenations of the dataset pairs, the ResNet-18 model, and the dataset similarity metrics.
- test: This folder contains the unit tests for the source code. See below for developer usage.
-
Clone this repository
-
Install with
pip
:pip install .
You can begin using the package code with an import command:
import modsim2
-
Install geomloss (required for otdd similarity metric)
poetry run python -m pip install geomloss
-
Install dependencies with Poetry
poetry update poetry install
-
Install pre-commit hooks:
poetry run pre-commit install --install-hooks
-
To run tests:
pytest tests
-
If you have setup pre-commit
flake8
,black
, andisort
will run automatically before making commits -
Or you can run them manually:
poetry run black . poetry run isort . poetry run flake8
- Your source code files should go in the
src/modsim2
directory. These will be available as a python package, i.e. you can dofrom modsim2 import myfunction
etc. - Add tests (in files with names like
test_*.py
and with functions with names startingtest_*
) thetests/
directory.