This project contains the official implementation for the IEEE TPAMI 2025 Paper DynamicPAE: Generating Scene-Aware Physical Adversarial Examples in Real-Time.
This repository follows the directory structure of https://github.com/hujinCN/aiworkflow.
model definition: models
simulation stages definition: stages.py
base trainer module & digital classification module: bask_atk_model.py
- install torch & torchvision. verified on torch 2.0.1 and 2.7.0.
Please refer to the official installation code on pytorch.org.
conda install pytorch torchvision torchaudio pytorch-cuda=12.4 -c pytorch -c nvidia- install other packages. Note that ultralytics version needs to be recheck, since this package is under development
conda install pytorch-lightning==2.2.1 seaborn loguru tensorboard --yes
pip install ultralytics==8.3.29 easydict pycocotools timm einops pytorch-msssim lpips torchmetrics==1.2.0
pip install diffusers torchattacks kornia imgaug openai-clip opencv-python matplotlib- prepare detlib
See README.md, section Pretrained models.
This submodule is from T-SEA project. See LICENSE.
- Download the datasets.
Put all datasets under a directory, and modify the path in path_cfg.yml.
For INRIA dataset, please convert to COCO format.
The prepared dataset directory structure shall be as follows:
coco
|-- train2017
|-- val2017
|-- annotations
INRIAPerson
|-- Train
|-- Test
|-- test_ann_xywh.json
|-- train_ann_xywh.json
-
Model Training:
cd sources_root/dynamic_example bash run.shApproximate time: 1 day for single 4090 GPU. Result may be different due to randomness.
-
Model Evaluation:
cd sources_root/dynamic_example bash test.sh
Refer to the shell scripts for more details.
The results are stored in the logs directory. Please refer to https://github.com/hujinCN/aiworkflow for format details.
@ARTICLE{hu2025dynamicpae,
author={Hu, Jin and Liu, Xianglong and Wang, Jiakai and Zhang, Junkai and Yang, Xianqi and Qin, Haotong and Ma, Yuqing and Xu, Ke},
journal={IEEE Transactions on Pattern Analysis and Machine Intelligence},
title={DynamicPAE: Generating Scene-Aware Physical Adversarial Examples in Real-Time},
year={2026},
volume={48},
number={3},
pages={2413-2430},
doi={10.1109/TPAMI.2025.3626068}
}
This project is licensed under the MIT License - see the LICENSE file for details.