TabularBench
TabularBench: Adversarial robustness benchmark for tabular data
Leaderboard: https://serval-uni-lu.github.io/tabularbench/
Research papers:
- Benchmark: TabularBench: Benchmarking Adversarial Robustness for Tabular Deep Learning in Real-world Use-cases
- CAPGD and CAA attacks: Constrained Adaptive Attack: Effective Adversarial Attack Against Deep Neural Networks for Tabular Data
- MOEVA attack: A Unified Framework for Adversarial Attack and Defense in Constrained Feature Space
Installation
Using Docker (recommended)
-
Clone the repository
-
Build the Docker image
./tasks/docker_build.sh
-
Run the Docker container
./tasks/run_benchmark.sh
Note: The ./tasks/run_benchmark.sh script mounts the current directory to the /workspace directory in the Docker container.
This allows you to edit the code on your host machine and run the code in the Docker container without rebuilding.
With Pyenv and Poetry
-
Clone the repository
-
Create a virtual environment using Pyenv with Python 3.8.10.
-
Install the dependencies using Poetry.
poetry install
Using conda
-
Clone the repository
-
Create a virtual environment using Conda with Python 3.8.10.
conda create -n tabularbench python=3.8.10
-
Activate the conda environment.
conda activate tabularbench
-
Install the dependencies using Pip.
pip install -r requirements.txt
How to use
Run the benchmark
You can run the benchmark with the following command:
python -m tasks.run_benchmark
or with Docker:
docker_run_benchmark
Using the API
You can also use the API to run the benchmark. See tasks/run_benchmark.py for an example.
clean_acc, robust_acc = benchmark(
dataset="URL",
model="STG_Default",
distance="L2",
constraints=True,
)
Retrain the models
We provide the models and parameters used in the paper. You can retrain the models with the following command:
python -m tasks.train_model
Edit the tasks/train_model.py file to change the model, dataset, and training method.
Data availability
Datasets, pretrained models, and synthetic data are publicly available here. The folder structure on the Shared folder should be followed locally to ensure the code runs correctly.
Datasets: Datasets are downloaded automatically in data/datasets when used.
Models: Pretrained models are available in the folder data/models.
Model parameters: Optimal parameters (from hyperparameters search) are required to train models and are in data/model_parameters.
Synthetic data: The synthetic data generated by GANs is available in the folder data/synthetic.
Naming
For technical reasons, the names of datasets, models, and training methods are different from the paper. The mapping can be found in docs/naming.md.
Metadata
Release files for tabularbench 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tabularbench-0.1.0.tar.gz | 95.4 kB | Without provenance | Details for tabularbench-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tabularbench-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for tabularbench-0.1.0-py3-none-any.whl |
Total release size: 231.8 kB
Release files / tabularbench-0.1.0.tar.gz
| Download URL | tabularbench-0.1.0.tar.gz |
|---|---|
| Size | 95.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
64216226df1c1fbe502f76bf9f9e6fb8cf06d16cdc71bd63ae32c469ab343091
|
|
BLAKE2b-256 checksum How to use checksums |
f2a8e4ec309fd4a0f6a564d9c24316377496585c2f99a17429299ee61ef1bbfd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.2 CPython/3.8.10 Darwin/23.5.0
|
Release files / tabularbench-0.1.0-py3-none-any.whl
| Download URL | tabularbench-0.1.0-py3-none-any.whl |
|---|---|
| Size | 136.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5244d2de59336ebf5636c85e51b28506859f11065c29c3c921420b989ef66b7d
|
|
BLAKE2b-256 checksum How to use checksums |
4d4d12cd8c9855d6052425790ad177f2a5501eadc6611682ecc87e4a41798352
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.2 CPython/3.8.10 Darwin/23.5.0
|
Security for tabularbench 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.