An Enhanced Disentanglement Autoencoder for Robust Image Steganography without Embedding
Xiyao Liu, Ziping Ma, Hui Fang, Jian Zhang, Gerald Schaefer, Kehua Guo, Yuesheng Zhu and Shichao Zhang
This repo provides pre-trained networks of EDA-RISE for evaluation.
- Only Linux is supported.
- Ninja >= 1.10.2, GCC/G++ >= 9.4.0
- One high-end NVIDIA GPU with at least 11GB of memory. We have done all testing using a NVIDIA RTX 2080Ti.
- Python >= 3.7 and PyTorch >= 1.8.2.
- CUDA toolkit 11.2 or later.
- Python libraries:
pip install lmdb imutils opencv-python pandas tqdm
. We use the Anaconda3 2020.11 distribution which installs most of these by default.
Please download the pre-trained models of EDA-RISE from Google Drive.
| Bedroom N=1 | Bedroom N=2 | Church N=1 | Church N=2 | FFHQ N=1 | FFHQ N=2 |
- The extraction accuracies of EDA-RISE under various attacks can be evaluated using test_accuracies_under_attacks.py.
python test_accuracies_under_attacks.py --checkpoint_path <path of a downloaded model>
- The evaluating results will be saved in
./accuracy_results/
by default, in the form of .csv files like:
Attack Name | Accuracy | |
---|---|---|
0 | w/o Attack | 1.0 |
1 | Gaussian Noise sig. = 0.05 | 0.999709375 |
... | ... | ... |
63 | Shearing r = 10 | 0.9699296875 |
- Use
--save_result_dir
to change the directory for saving .csv files.
python test_accuracies_under_attacks.py --checkpoint_path <path of a downloaded model> --save_result_dir <your saving directory>
- Use
--use_tqdm
to show the evaluating progress through a bar.
python test_accuracies_under_attacks.py --checkpoint_path <path of a downloaded model> --use_tqdm
- Use
--test_num
to change the number of tests, which is1000
by default.
python test_accuracies_under_attacks.py --checkpoint_path <path of a downloaded model> --test_num 10
- Synthesise container images using synthesise_container_image_samples.py.
python synthesise_container_image_samples.py checkpoint_path <path of a downloaded model>
- The synthesised images are save in
./synthesised_samples/
by default, or you can change the saving directory using--save_result_dir
.
python synthesise_container_image_samples.py checkpoint_path <path of a downloaded model> --save_result_dir <your saving directory>
- You can also use
--use_tqdm
to show the synthesising progress.
python synthesise_container_image_samples.py checkpoint_path <path of a downloaded model> --use_tqdm
- Use calculate_fid_score.py to calculate the FID score for evaluation.
python calculate_fid_score.py <path of dataset statistics> <directory of synthesised images>
- We provide prepared dataset statistics in
./dataset_statistics/
for calculation. For example, you can evaluate the FID score of the pre-trained Bedroom N=1 model by using the prepared statistics of LSUN Bedroom dataset.
python calculate_fid_score.py ./synthesised_samples/synthesised_Bedroon_N=1_checkpoint_samples ./dataset_statistics/bedroom.npz
- Or you can prepare the dataset statistics by your self, using prepare_dataset_statistical_features.py.
python prepare_dataset_statistical_features.py --dataset_path <path of dataset> --dataset_type <type of dataset> --dataset_name <name of dataset>
- Our code support two types of datasets, including
official_lmdb
for lmdb datasets downloaded from LSUN, andimage_folder
for datasets consisting of folders. - The prepared dataset statistics will be saved as
./dataset_statistics/<dataset_name>.npz
.