Metadata-Version: 2.1
Name: constrained-attacks
Version: 0.1.1
Summary: constrained-attacks is a framework to generate adversarial examples under domain specific constraints.
License: MIT
Author: Thibault Simonetto
Author-email: thibault.simonetto.001@student.uni.lu
Requires-Python: >=3.8,<3.9
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Provides-Extra: tensorflow
Requires-Dist: adversarial-robustness-toolbox[tensorflow] (==1.10); extra == "tensorflow"
Requires-Dist: joblib (>=1.1.0,<2.0.0)
Requires-Dist: numpy (>=1.22.3,<2.0.0)
Requires-Dist: pandas (>=1.4.1,<2.0.0)
Requires-Dist: pymoo (>=0.5.0,<0.6.0)
Requires-Dist: tensorflow (==2.8); extra == "tensorflow"
Requires-Dist: tqdm (>=4.63.1,<5.0.0)
Description-Content-Type: text/markdown

# Constrained attacks
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![arXiv](https://img.shields.io/badge/arXiv-2112.01156-b31b1b.svg)](https://arxiv.org/abs/2112.01156)

## Description

Constrained attacks is a framework for constraints adversarial examples unified across multiple constraints' domain.
It currently supports a large diversity of constraints (linear and non-linear).
We instantiated our framework with two attacks:
- MoEvA2: a multi-objective genetic based approach
- C-PGD: a gradient based approach extended from PGD (cite) to support domain constraints.

To learn more, check out our paper [A Unified Framework for Adversarial Attack and Defense in Constrained Feature
    Space](https://arxiv.org/abs/2112.01156).

## Installation

### Using pip

```shell
pip install constrained-attacks
```

## Dependencies

constrained-attacks requires:

- python = "~3.8"
- numpy = "^1.22.3"
- joblib = "^1.1.0"
- pymoo = "^0.5.0"
- tqdm = "^4.63.1"
- pandas = "^1.4.1"

Additional optional requirements for C-PGD are:
- tensorflow = "2.8"
- adversarial-robustness-toolbox[tensorflow] = "1.10"

## Examples

You can find a usage example
- for MoEvA2: [tests/attacks/moeva/test_moeva_run.py](tests/attacks/moeva/test_moeva_run.py)
- for C-PGD: [tests/attacks/cpgd/test_pgd_run.py](tests/attacks/cpgd/test_pgd_run.py)
- for the constraints definition: [tests/attacks/moeva/url_constraints.py](tests/attacks/moeva/url_constraints.py).

## Citation

If you have used our framework for research purposes, you can cite our publication by:

BibTex:
```
@article{simonetto2021unified,
  title={A unified framework for adversarial attack and defense in constrained feature space},
  author={Simonetto, Thibault and Dyrmishi, Salijona and Ghamizi, Salah and Cordy, Maxime and Traon, Yves Le},
  journal={arXiv preprint arXiv:2112.01156},
  year={2021}
}
```

