photoguard  by MadryLab

Research paper code for defending against AI image manipulation

created 2 years ago
608 stars

Top 54.7% on sourcepulse

GitHubView on GitHub
1 Expert Loves This Project
Project Summary

This repository provides code and methods to defend images against malicious AI-powered editing, specifically targeting Stable Diffusion models. It's designed for researchers and developers working with generative AI, offering techniques to prevent unwanted alterations and ensure image integrity.

How It Works

The project implements adversarial attacks on Stable Diffusion's image generation process. It focuses on perturbing image embeddings (Encoder Attack) or the entire diffusion model (Diffusion Attack) to degrade the quality or alter the content of AI-generated edits. This approach aims to increase the computational cost and difficulty for malicious actors attempting to manipulate images using AI.

Quick Start & Requirements

  • Install via pip install -r requirements.txt after cloning the repository and activating a conda environment with Python 3.10.
  • Requires huggingface-cli login.
  • Local demo available: cd demo && python app.py.
  • Official demo: https://huggingface.co/spaces/hadisalman/photoguard

Highlighted Details

  • Defends against both image-to-image and inpainting pipelines.
  • Implements both "Encoder Attack" and "Diffusion Attack" strategies.
  • Demonstrates efficacy through notebooks and an interactive demo.
  • Code relies on Hugging Face's Stable Diffusion implementation.

Maintenance & Community

Licensing & Compatibility

  • The repository does not explicitly state a license in the README.

Limitations & Caveats

The project's reliance on specific versions of Stable Diffusion and Hugging Face libraries may lead to compatibility issues with future updates. The effectiveness of the "raising the cost" approach is dependent on the computational resources available to potential attackers.

Health Check
Last commit

2 years ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
13 stars in the last 90 days

Explore Similar Projects

Starred by Dan Abramov Dan Abramov(Core Contributor to React), Patrick von Platen Patrick von Platen(Core Contributor to Hugging Face Transformers and Diffusers), and
28 more.

stable-diffusion by CompVis

0.1%
71k
Latent text-to-image diffusion model
created 3 years ago
updated 1 year ago
Feedback? Help us improve.