Home

Awesome

<h1 align="center">Universal Adversarial Examples in Remote Sensing: Methodology and Benchmark</h1> <h3 align="center"> <a href="https://yonghaoxu.github.io/">Yonghao Xu</a> and <a href="http://pedram-ghamisi.com/">Pedram Ghamisi</a></h3> <br

This research has been conducted at the Institute of Advanced Research in Artificial Intelligence (IARAI).

This is the official PyTorch implementation of the black-box adversarial attack methods for remote sensing data in our paper Universal adversarial examples in remote sensing: Methodology and benchmark.

Presentation

<img src="https://github.com/YonghaoXu/UAE-RS/blob/main/Figure/presentation.png" width="500"/>

Table of content

  1. Dataset
  2. Supported methods and models
  3. Preparation
  4. Adversarial attacks on scene classification
  5. Adversarial attacks on semantic segmentation
  6. Performance evaluation on the UAE-RS dataset
  7. Paper
  8. Acknowledgement
  9. License

Dataset

We collect the generated universal adversarial examples in the dataset named UAE-RS, which is the first dataset that provides black-box adversarial samples in the remote sensing field.

šŸ“” Download links: Ā Google Drive Ā Ā Ā Ā Ā Ā  Baidu NetDisk (Code: 8g1r)

To build UAE-RS, we use the Mixcut-Attack method to attack ResNet18 with 1050 test samples from the UCM dataset and 5000 test samples from the AID dataset for scene classification, and use the Mixup-Attack method to attack FCN-8s with 5 test images from the Vaihingen dataset (image IDs: 11, 15, 28, 30, 34) and 5 test images from the Zurich Summer dataset (image IDs: 16, 17, 18, 19, 20) for semantic segmentation.

<p align="center">Example images in the UCM dataset and the corresponding adversarial examples in the UAE-RS dataset.</p>

<p align="center">Example images in the AID dataset and the corresponding adversarial examples in the UAE-RS dataset.</p>

<p align="center">Qualitative results of the black-box adversarial attacks from FCN-8s ā†’ SegNet on the Vaihingen dataset.</p> (a) The original clean test images in the Vaihingen dataset. (b) The corresponding adversarial examples in the UAE-RS dataset. (c) Segmentation results of SegNet on the clean images. (d) Segmentation results of SegNet on the adversarial images. (e) Ground-truth annotations.

Supported methods and models <a name="method"></a>

This repo contains implementations of black-box adversarial attacks for remote sensing data on both scene classification and semantic segmentation tasks.

Preparation

ā”œā”€ā”€ <THE-ROOT-PATH-OF-DATA>/
ā”‚   ā”œā”€ā”€ UCMerced_LandUse/     
|   |   ā”œā”€ā”€ Images/
|   |   |   ā”œā”€ā”€ agricultural/
|   |   |   ā”œā”€ā”€ airplane/
|   |   |   |ā”€ā”€ ...
ā”‚   ā”œā”€ā”€ AID/     
|   |   ā”œā”€ā”€ Airport/
|   |   ā”œā”€ā”€ BareLand/
|   |   |ā”€ā”€ ...
ā”‚   ā”œā”€ā”€ Vaihingen/     
|   |   ā”œā”€ā”€ img/
|   |   ā”œā”€ā”€ gt/
|   |   ā”œā”€ā”€ ...
ā”‚   ā”œā”€ā”€ Zurich/    
|   |   ā”œā”€ā”€ img/
|   |   ā”œā”€ā”€ gt/
|   |   ā”œā”€ā”€ ...
ā”‚   ā”œā”€ā”€ UAE-RS/    
|   |   ā”œā”€ā”€ UCM/
|   |   ā”œā”€ā”€ AID/
|   |   ā”œā”€ā”€ Vaihingen/
|   |   ā”œā”€ā”€ Zurich/
CUDA_VISIBLE_DEVICES=0,1 python pretrain_cls.py --network 'alexnet' --dataID 1 --root_dir <THE-ROOT-PATH-OF-DATA>
CUDA_VISIBLE_DEVICES=0,1 python pretrain_cls.py --network 'resnet18' --dataID 1 --root_dir <THE-ROOT-PATH-OF-DATA>
CUDA_VISIBLE_DEVICES=0,1 python pretrain_cls.py --network 'inception' --dataID 1 --root_dir <THE-ROOT-PATH-OF-DATA>
...
cd ./segmentation
CUDA_VISIBLE_DEVICES=0 python pretrain_seg.py --model 'fcn8s' --dataID 1 --root_dir <THE-ROOT-PATH-OF-DATA>
CUDA_VISIBLE_DEVICES=0 python pretrain_seg.py --model 'deeplabv2' --dataID 1 --root_dir <THE-ROOT-PATH-OF-DATA>
CUDA_VISIBLE_DEVICES=0 python pretrain_seg.py --model 'segnet' --dataID 1 --root_dir <THE-ROOT-PATH-OF-DATA>
...

Please replace <THE-ROOT-PATH-OF-DATA> with the local path where you store the remote sensing datasets.

Adversarial attacks on scene classification <a name="cls"></a>

CUDA_VISIBLE_DEVICES=0 python attack_cls.py --surrogate_model 'resnet18' \
                                            --attack_func 'fgsm' \
                                            --dataID 1 \
                                            --root_dir <THE-ROOT-PATH-OF-DATA>
CUDA_VISIBLE_DEVICES=0 python test_cls.py --surrogate_model 'resnet18' \
                                          --target_model 'inception' \
                                          --attack_func 'fgsm' \
                                          --dataID 1 \
                                          --root_dir <THE-ROOT-PATH-OF-DATA>

You can change parameters --surrogate_model, --attack_func, and --target_model to evaluate the performance with different attacking scenarios.

Adversarial attacks on semantic segmentation <a name="seg"></a>

cd ./segmentation
CUDA_VISIBLE_DEVICES=0 python attack_seg.py --surrogate_model 'fcn8s' \
                                            --attack_func 'fgsm' \
                                            --dataID 1 \
                                            --root_dir <THE-ROOT-PATH-OF-DATA>
CUDA_VISIBLE_DEVICES=0 python test_seg.py --surrogate_model 'fcn8s' \
                                          --target_model 'segnet' \
                                          --attack_func 'fgsm' \
                                          --dataID 1 \
                                          --root_dir <THE-ROOT-PATH-OF-DATA>

You can change parameters --surrogate_model, --attack_func, and --target_model to evaluate the performance with different attacking scenarios.

Performance evaluation on the UAE-RS dataset <a name="uaers"></a>

CUDA_VISIBLE_DEVICES=0 python test_cls_uae_rs.py --target_model 'inception' \
                                                 --dataID 1 \
                                                 --root_dir <THE-ROOT-PATH-OF-DATA>

Scene classification results of different deep neural networks on the clean and UAE-RS test sets:

UCMAID
ModelClean Test SetAdversarial Test SetOA GapClean Test SetAdversarial Test SetOA Gap
AlexNet90.2830.86-59.4289.7418.26-71.48
VGG1194.5726.57-68.0091.2212.62-78.60
VGG1693.0419.52-73.5290.0013.46-76.54
VGG1992.8529.62-63.2388.3015.44-72.86
Inception-v396.2824.86-71.4292.9823.48-69.50
ResNet1895.902.95-92.9594.760.02-94.74
ResNet5096.7625.52-71.2492.686.20-86.48
ResNet10195.8028.10-67.7092.929.74-83.18
ResNeXt5097.3326.76-70.5793.5011.78-81.72
ResNeXt10197.3333.52-63.8195.4612.60-82.86
DenseNet12197.0417.14-79.9095.5010.16-85.34
DenseNet16997.4225.90-71.5295.549.72-85.82
DenseNet20197.3326.38-70.9596.309.60-86.70
RegNetX-400MF94.5727.33-67.2494.3819.18-75.20
RegNetX-8GF97.1440.76-56.3896.2219.24-76.98
RegNetX-16GF97.9034.86-63.0495.8413.34-82.50
cd ./segmentation
CUDA_VISIBLE_DEVICES=0 python test_seg_uae_rs.py --target_model 'segnet' \
                                                 --dataID 1 \
                                                 --root_dir <THE-ROOT-PATH-OF-DATA>

Semantic segmentation results of different deep neural networks on the clean and UAE-RS test sets:

VaihingenZurich Summer
ModelClean Test SetAdversarial Test SetmF1 GapClean Test SetAdversarial Test SetmF1 Gap
FCN-32s69.4835.00-34.4866.2632.31-33.95
FCN-16s69.7027.02-42.6866.3434.80-31.54
FCN-8s82.2222.04-60.1879.9040.52-39.38
DeepLab-v277.0434.12-42.9274.3845.48-28.90
DeepLab-v3+84.3614.56-69.8082.5162.55-19.96
SegNet78.7017.84-60.8675.5935.58-40.01
ICNet80.8941.00-39.8978.8759.77-19.10
ContextNet81.1747.80-33.3777.8963.71-14.18
SQNet81.8539.08-42.7776.3255.29-21.03
PSPNet83.1121.43-61.6877.5565.39-12.16
U-Net83.6116.09-67.5280.7856.58-24.20
LinkNet82.3024.36-57.9479.9848.67-31.31
FRRNetA84.1716.75-67.4280.5058.20-22.30
FRRNetB84.2728.03-56.2479.2767.31-11.96

Paper

Universal adversarial examples in remote sensing: Methodology and benchmark

Please cite the following paper if you use the data or the code:

@article{uaers,
  title={Universal adversarial examples in remote sensing: Methodology and benchmark}, 
  author={Xu, Yonghao and Ghamisi, Pedram},
  journal={IEEE Trans. Geos. Remote Sens.},  
  volume={60},
  pages={1--15},
  year={2022},
}

Acknowledgement

The authors would like to thank Prof. Shawn Newsam for making the UCM dataset public available, Prof. Gui-Song Xia for providing the AID dataset, the International Society for Photogrammetry and Remote Sensing (ISPRS), and the German Society for Photogrammetry, Remote Sensing and Geoinformation (DGPF) for providing the Vaihingen dataset, and Dr. Michele Volpi for providing the Zurich Summer dataset.

Efficient-Segmentation-Networks

segmentation_models.pytorch

Adversarial-Attacks-PyTorch

License

This repo is distributed under MIT License. The UAE-RS dataset can be used for academic purposes only.