/NICE

Primary LanguagePython

Neural Image Compression Explaination

This reposityory contains the PyTorch implementation of "Neural Image Compression and Explanation".

Expalanation Examples

Learned sparse explanations from LeNet-5 on MNIST examples:

demo

Requirements

PyTorch >= 0.4.0

Quick Start

Follow the below 3 steps to run our algorithm:

  1. Train a target model to explain
python train_target_model.py 
  1. Train NICE
python main.py --r [1] 

-r: The hyperparameter to balance data loss and sparsity loss. Please read our paper for details.

  1. Visualize results
python visualize_explanation.py

Citation

If you found this code useful, please cite our paper.

@article{nice20,
  title   = {Neural Image Compression and Explanation},
  author  = {Xiang Li and Shihao Ji}, 
  journal = {IEEE Access},
  volume  = {8},
  month   = {Nov.},
  year    = {2020}
}