Skip to content

joshua840/AMM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fooling CAM via Adversarial Model Manipulation

Python PyTorch Lightning Code style: black

[Conference]

Description

This repository provides a new implementation of the paper Fooling Neural Network Interpretations via Adversarial Model Manipulation (https://arxiv.org/abs/1902.02041, https://github.com/rmrisforbidden/Fooling_Neural_Network-Interpretations). It includes code for fooling deep neural networks, including recently published architectures, as well as various CAM-based interpretation methods implemented in the TorchCAM (https://github.com/frgfm/torch-cam) repository. The implementation is built using PyTorch Lightning.

Things to do before running

# clone project   
git clone https://github.com/joshua840/AMM.git

# create environment
conda env create -f env.yaml 
conda activate torch2.5_cuda12.4

After finishing the above setting, you can directly run the following code:

# run experiments
bash scripts/amm.sh

The checkpoints will be saved in .neptune directory.

Configuration tips

Trainer args

In Lightining, the Trainer class includes arguments that are commonly used for model training. For more details on the Trainer class, please refer the following API documentation.:(https://lightning.ai/docs/pytorch/stable/common/trainer.html).

The argument lists are available as well using the following command:

python -m src.main -h

LightningModule args and using YAML files

In Lightining, arguments of module classes inherenting from Lightning.pytorch.LightningModule are automatically registered in argparse lists. This feature keeps the codes clean by eliminating redundant argparse declarations.

Another advantage of Lightning is built-in support for using YAML files to pass the hyperparameters, including class-level arguments.

For more details, please refer to the Lightning tutorials

Citation

@article{YourName,
  title={Your Title},
  author={Your team},
  journal={Location},
  year={Year}
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors