GithubHelp home page GithubHelp logo

hubin111 / fiba Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hazardfy/fiba

0.0 0.0 0.0 814 KB

Code for paper 'FIBA: Frequency-Injection based Backdoor Attack in Medical Image Analysis'

Python 100.00%

fiba's Introduction

FIBA: Frequency-Injection based Backdoor Attack in Medical Image Analysis

Introduction

We introduce a novel backdoor attack method named FIBA in the Medical Image Analysis (MIA) domain. FIBA injects the trigger in the amplitude spectrum in the frequency domain. It preserves the semantics of the poisoned image pixels by maintaining the phase information, making it capable of delivering attacks to both classification and dense prediction models.

This is an official implementation of the CVPR 2022 Paper FIBA: Frequency-Injection based Backdoor Attack in Medical Image Analysis in Pytorch.

News

5/5/2022 - Our code of ISIC2019 has been relesed.

Requirements

  • Install required python packages:

    $ pip install -r requirements.txt

  • Download the ISIC2019 dataset and prepare the TXT files for dataset partitioning (shown in .\txt)

  • Download the trigger image and the noise images

Training

  1. Modify the contents of ./utils/dataloader.py depending on the way you save the dataset.

  2. Create ./checkpoints to save the model.

  3. Start traning:

    python train.py --target_label 3 –pc 0.1 --alpha 0.15 –beta 0.1 --target_img './coco_val75/000000002157.jpg' --cross_dir './coco_test1000' --split_idx 0 --experiment_idx 'demo'

    • target_label: The label of target class

    • pc: The ratio of poisoned images

    • alpha: The blend ratio $\alpha$

    • beta: $\beta$​ which determines the location and range of the low-frequency patch inside the amplitude spectrum to be blended

    • target_img: The path of trigger image

    • cross_dir: The path of the folder which saves noise images

    • split_idx: Used for multi-fold cross validation experiment

    • experiment_idx: The name of the experiment

The model will be save at checkpoints/ISIC2019/all2onedemo/best_acc_bd_ckpt.pth.tar

Test

python eval.py --target_label 3 --pc 0.1 --alpha 0.15 –beta 0.1 --target_img './coco_val75/000000002157.jpg' --cross_dir './coco_test1000' --split_idx 0 --test_model './checkpoints/ISIC2019/all2onedemo/best_acc_bd_ckpt.pth.tar'

  • test_model: The path of test model

ASR for segmentation and detection tasks

image image

Citation

If you find this repo useful for your research, please consider citing our paper

@InProceedings{Feng_2022_CVPR,
    author    = {Feng, Yu and Ma, Benteng and Zhang, Jing and Zhao, Shanshan and Xia, Yong and Tao, Dacheng},  
    title     = {FIBA: Frequency-Injection Based Backdoor Attack in Medical Image Analysis},   
    booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)}, 
    month     = {June},  
    year      = {2022},
    pages     = {20876-20885}  
}

Acknowledgement

Some of the code is adapted from WaNet and FedDG which have been cited in our paper.

fiba's People

Contributors

hazardfy 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.