This repository implements DNN-Oriented JPEG compression introduced in the following paper
Feature Distillation: DNN-Oriented JPEG Compression Against Adversarial Examples
Figure 1: Diagram of DNN-Oriented JPEG compression
python jpeg.py --image fig/lena.png --component dnn
usage: jpeg.py [-h] [--image IMAGE] [--component COMPONENT] [--factor FACTOR]
optional arguments:
-h, --help show this help message and exit
--image IMAGE image name
--component COMPONENT
dnn-oriented or jpeg standard
--factor FACTOR compression factor
Figure 2: Standard JPEG compression (Q = 50)
Figure 3: DNN-Oriented JPEG compression (Q = 50)
- zigzag sorting
- sorting by standard deviation
- adversarial defense evaluation
If you find a bug, feel free to create an issue.