Code Monkey home page Code Monkey logo

sacnet's Introduction

Self-Attention Context Network for Hyperspectral Image Classification

PyTorch implementation of SACNet for adversarial attacks and defenses in hyperspectral image classification.

Installation

git clone https://github.com/YonghaoXu/SACNet

Dataset

Usage

  • Data Preparation:

    • python GenSample.py --train_samples 300

    The default training set is generated by randomly selecting 300 samples from each category.

    You can change parameter --train_samples to check the performance in other training scenarios.

  • Performance on the Clean Test Set:

    To conduct HSI classification on the original clean test set without adversarial attack, simply run:

    • CUDA_VISIBLE_DEVICES=0 python Test_Clean.py --model SACNet

    You can also change parameter --model to check the performance with other models (e.g., --model SSFCN)

  • Adversarial Attack with the FGSM:

    • CUDA_VISIBLE_DEVICES=0 python Attack_FGSM.py --model SACNet
  • Adversarial Examples Visualization:

    • CUDA_VISIBLE_DEVICES=0 python GenAdvExample.py --model SACNet

Paper

Self-Attention Context Network: Addressing the Threat of Adversarial Attacks for Hyperspectral Image Classification

Please cite our paper if you find it useful for your research.

@article{sacnet,
  title={Self-Attention Context Network: Addressing the Threat of Adversarial Attacks for Hyperspectral Image Classification}, 
  author={Xu, Yonghao and Du, Bo and Zhang, Liangpei},
  journal={IEEE Trans. Image Process.}, 
  volume={30},
  pages={8671--8685},
  year={2021},
  doi={10.1109/TIP.2021.3118977}}
}

Acknowledgment

This code is partly borrowed from PyTorch-Encoding

sacnet's People

Contributors

yonghaoxu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.