Skip to content

Just Noticeable Robust Attack, an adversarial attack against diffusion model style-mimicry

Notifications You must be signed in to change notification settings

simone-dotolo/jnra

Repository files navigation


Just Noticeable Robust Attack (JNRA)

About The Project

The Just Noticeable Robust Attack is a novel approach designed to craft adversarial perturbations that are both imperceptible to human observers and robust against image purification defenses. This approach strategically inserts strong perturbations into regions of an image where they are less likely to be perceived by a human observer, using a simple Just Noticeable Difference (JND) model.

Installation

  1. Clone the repo:
    git clone https://github.com/simone-dotolo/jnra.git
  2. Create the virtual environment:
    conda env create -n jnra -f environment.yml

Usage

  1. To protect the artworks with JNRA:
    python3 jnra_protect.py
  2. To purify the protected artworks:
    python3 apply_purification.py --data_path data/wikiart_zdzislaw_beksinki/protected/jnra --purification jpeg --device cuda
  3. To finetune the model:
    python3 finetune.py --in_dir data/wikiart_zdzislaw_beksinki/protected_purified/jnra/jpeg/train --out_dir models/wikiart_zdzislaw-beksinki/protected_purified/jnra/jpeg
  4. To generate artworks:
    python3 generate.py --in_dir models/wikiart_zdzislaw-beksinki/protected_purified/jnra/jpeg --out_dir generated_images/wikiart_rene-magritte/protected_purified/jnra/jpeg --prompts prompts/wikiart_zdzislaw-beksinki.txt
  5. To evaluate the protection:
    python3 evaluate.py --original_path generated_images/wikiart_rene-magritte/original --generated_path generated_images/wikiart_rene-magritte/protected_purified/jnra/jpeg --device cuda:0

Acknowledgments

Contact

Simone Dotolo - sim.dotolo@gmail.com

LinkedIn: https://www.linkedin.com/in/simone-dotolo/

About

Just Noticeable Robust Attack, an adversarial attack against diffusion model style-mimicry

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages