Stable Signature is Unstable: Removing Image Watermark from Diffusion Models

## Abstract

Abstract Watermark has been widely deployed by industry to detect AI-generated images. A recent watermarking framework called Stable Signature (proposed by Meta) roots watermark into the parameters of a diffusion model’s decoder such that its generated images are inherently watermarked. Stable Signature makes it possible to watermark images generated by open-source diffusion models and was claimed to be robust against removal attacks. In this work, we propose a new attack to remove the watermark from a diffusion model by fine-tuning it. Our results show that our attack can effectively remove the watermark from a diffusion model such that its generated images are non-watermarked, while maintaining the visual quality of the generated images. Our results highlight that Stable Signature is not as stable as previously thought.

## 1 Introduction

With the rapid development of generative AI (GenAI), it becomes increasingly more difficult to distinguish AI-generated and non-AI-generated images. The misuse of AI-generated images presents a significant risk of spreading misinformation. Watermarking [bi2007robust, zhu2018hidden, UDH, 2019stegastamp, fernandez2023stable, wen2023tree] has emerged as a crucial technology for detecting AI-generated images and been widely deployed by industry. For instance, OpenAI incorporates a watermark into images generated by DALL-E [ramesh2021zero]; Stability AI deploys a watermarking technique in Stable Diffusion [stable-diffusion]; and Google has introduced SynthID as a watermarking solution for images generated by Imagen [saharia2022photorealistic]. In watermark-based detection, a watermark is embedded in AI-generated images before they are accessed by users. During detection, if the same watermark can be extracted from an image, it is identified as AI-generated.

Image watermark can be categorized into three groups based on the timing when watermark is embedded into AI-generated images: *post-generation*, *pre-generation*, and *in-generation*. Post-generation watermark [luo2020distortion, bi2007robust, zhu2018hidden, UDH, al2007combined, 2019stegastamp] embeds a watermark into an image after the image has been generated, while pre-generation watermark [wen2023tree] embeds a watermark into the initial noisy latent vector of a diffusion model. However, these watermarking methods are vulnerable when the diffusion models are open-source. In particular, an attacker can easily remove the watermarking components from the open-source diffusion model to generate non-watermarked images. In contrast, in-generation watermark (e.g., Stable Signature [fernandez2023stable]) roots watermark directly into the parameters of a diffusion model’s decoder. It enables the images generated by the diffusion model to be inherently watermarked without introducing any external watermarking components. This method is particularly suited for watermarking images generated by open-source diffusion models.

Watermark removal attacks aim to remove watermarks from watermarked images, and can be divided into two main types: *per-image-based* and *model-targeted*. Per-image-based attacks [jiang2023evading, an2024benchmarking, lukas2023leveraging, zhao2023invisible, saberi2023robustness] add a carefully crafted perturbation to each watermarked image individually. These removal attacks need to process watermarked images one by one, which is highly inefficient when removing watermarks from a large volume of watermarked images. In contrast, model-targeted attacks directly modify a diffusion model’s parameters to make its generated images non-watermarked. For instance, the authors of Stable Signature [fernandez2023stable] also proposed a model-targeted removal attack, called *model purification (MP)*, to attack Stable Signature. However, MP requires access to the diffusion model’s encoder and is not applicable when the encoder is not open-source. Moreover, MP significantly deteriorates image quality [fernandez2023stable], based on which Stable Signature was claimed to be robust against model-targeted removal attacks.

Figure: (a)

In this work, we propose a new model-targeted attack to remove in-generation watermark from open-source diffusion models. Our attack fine-tunes a diffusion model’s decoder using a set of non-watermarked images, which we call *attacking dataset*. Specifically, our attack consists of two steps. In Step I, we propose different methods to estimate a *denoised latent vector*
for each non-watermarked image in the attacking dataset in two settings, i.e., with and without access to the diffusion model’s encoder. The open-source diffusion model’s decoder takes a denoised latent vector as input and outputs a watermarked image that is visually similar to the corresponding non-watermarked image.
In Step II, we leverage the non-watermarked images in the attacking dataset and their corresponding estimated denoised latent vectors to fine-tune the diffusion model’s decoder to remove the watermark from it. Our key idea is to fine-tune the decoder such that its generated images based on the denoised latent vectors are close to the corresponding non-watermarked images in the attacking dataset.

We empirically evaluate our attack on the open-source diffusion model, i.e., Stable Diffusion 2.1, that is watermarked by Stable Signature. Our results show that our attack can effectively remove the watermark from the diffusion model such that its generated images are non-watermarked, while maintaining image quality. Moreover, our attack substantially outperforms MP,
the only existing model-targeted removal attack [fernandez2023stable], in the scenario in which it is applicable. As shown in Figure 2, our attack can retain most information in the image after removing the watermark, while MP results in a blurry image with significant loss of details. Our results suggest that Stable Signature is not as robust as previously thought, and the design of a robust watermarking strategy for images generated by open-source diffusion models remains an open challenge.

## 2 Related Works

### 2.1 Latent Diffusion Model

Figure: Figure 3: The main components of a latent diffusion model.

Diffusion models [dhariwal2021diffusion, NEURIPS2020_4c5bcfec, NEURIPS2021_b578f2a5, ho2022cascaded] exhibit exceptional capability in generating images. A *latent diffusion model* [rombach2022high] performs the diffusion process in the latent space, enhancing efficiency in both training of the diffusion model and image generation.
A latent diffusion model has four main components: an encoder $E$ to encode an image $x$ into a *latent vector* $E(x)$, diffusion process $DP$ to add Gaussian noise to the latent vector to obtain a *noisy latent vector* $z_{T}=DP(E(x))$ where $T$ denotes the number of steps in diffusion process, denoising layers $DN$ to obtain a *denoised latent vector* $z=DN(z_{T},c)$ where $c$ denotes the conditioning such as a text prompt or a depth map, and a decoder $D$ to reconstruct an image $D(z)$ from $z$. The diffusion process is a predefined probabilistic process that iteratively adds Gaussian noise to a latent vector, while the remaining three components are learnt using an image dataset. During image generation, a noisy latent vector $z_{T}^{\prime}$ is sampled from Gaussian distribution, and the denoising layers $DN$ and decoder $D$ are used to generate an image $D(DN(z_{T}^{\prime},c))$. The main components of a latent diffusion model are shown in Figure 3.

### 2.2 Image Watermark

Post-generation watermark:
Post-generation watermarking methods [bi2007robust, al2007combined, zhu2018hidden, 2019stegastamp, invisible-watermark, luo2020distortion, Jing_2021_ICCV] embed watermarks into images after the image generation process. These methods typically consist of three main components: a watermark (represented as a bitstring), a watermarking encoder for embedding the watermark into an image, and a watermarking decoder for extracting the watermark from an image. These methods can be categorized into two groups based on how the encoder and decoder are designed: *learning-based* and *non-learning-based*. Learning-based methods [zhu2018hidden, UDH, 2019stegastamp, luo2020distortion] leverage deep learning techniques, utilizing neural networks for both encoding and decoding, while non-learning-based methods [pereira2000robust, al2007combined, bi2007robust, invisible-watermark] rely on manually crafted encoding and decoding algorithms. In closed-source setting, where the diffusion model is proprietary and users can only interact with it through API, learning-based watermarking methods exhibit significant robustness against various attacks [an2024benchmarking, 2019stegastamp, jiang2023evading]. In open-source setting, however, such robustness is compromised. An attacker can easily remove the watermarking components from the open-source diffusion model, thus generating non-watermarked images without constraints.

Pre-generation watermark:
Pre-generation watermarking methods [wen2023tree] embed watermark into images before the image generation process. In diffusion models, for instance, a watermark can be incorporated into the noisy latent vector $z_{T}$ [wen2023tree]. Subsequently, the image generated from this watermarked noisy latent vector contains the watermark. The watermark retrieval process involves an inverse operation of DDIM sampling [song2020improved], which reconstructs the noisy latent vector from the generated image. However, such pre-generation watermark is also vulnerable in open-source setting. An attacker can substitute the watermarked noisy latent vector with a non-watermarked one, which is drawn from a Gaussian distribution. Consequently, image generated from this non-watermarked noisy latent vector does not contain the watermark.

In-generation watermark:
In-generation watermarking methods [fernandez2023stable] modify the parameters of the diffusion model’s decoder to ensure that all images generated by this diffusion model inherently contain a watermark. This method seamlessly incorporates the watermarking components into the image generation process. For instance, Stable Signature [fernandez2023stable] fine-tunes the diffusion model’s decoder using a HiDDeN [zhu2018hidden] watermarking decoder. After fine-tuning, each generated image carries a predetermined watermark which can be decoded by the watermarking decoder, i.e., directly incorporating the watermark into the diffusion model’s parameters. This method is well-suited for open-source diffusion models, because it prevents attackers from removing the watermark by simply discarding the model’s watermarking components.

### 2.3 Watermark Removal Attacks

Per-image-based:
Per-image-based removal attacks [jiang2023evading, an2024benchmarking, lukas2023leveraging, zhao2023invisible, saberi2023robustness] involve adding a carefully crafted perturbation on each watermarked image to remove the watermark. Common image processing techniques, such as JPEG compression and contrast adjustment, can introduce a perturbation for the watermarked image to remove the watermark. Furthermore, more sophisticated per-image-based removal attacks can be employed if the attacker has access to the watermarking decoder or detection API. For instance, Jiang et al. [jiang2023evading] proposed a white-box attack that assumes the attacker has access to the watermarking decoder, and a black-box attack that strategically manipulates the watermarked image based on detection API query results to remove the watermark.
These per-image-based removal attacks are applicable to all three groups of watermarks mentioned above as they do not require access to the image generation process.
However, they are inefficient when applied to a large volume of images due to the individualized design of perturbations for each watermarked image.

Model-targeted:
Model-targeted removal attacks [fernandez2023stable] are specifically designed for removing in-generation watermark. Such attacks involve modifying the diffusion model’s parameters such that its generated images are non-watermarked. For instance, Stable Signature [fernandez2023stable] proposed MP to attack their Stable Signature in-generation watermark. This method aims to purify the diffusion model’s decoder using non-watermarked images. However, it encounters challenges in effectively removing the watermark without significantly degrading image quality. Model-targeted removal attacks show high efficiency in removing watermark from numerous watermarked images, as it only requires a one-time modification of the diffusion model and images generated by the modified diffusion model are non-watermarked. These methods offer much higher efficiency compared to per-image-based removal attacks when handling numerous watermarked images.

## 3 Problem Formulation

### 3.1 Watermarked Diffusion Model Decoder D w subscript 𝐷 𝑤 D_{w} italic_D start_POSTSUBSCRIPT italic_w end_POSTSUBSCRIPT

We denote by $D_{c}$ a clean diffusion model decoder without watermark. $D_{c}$ is fine-tuned as a watermarked diffusion model decoder $D_{w}$ such that its generated images are inherently embedded with a ground-truth watermark $w_{g}$. Formally, any generated image $D_{w}(DN(z_{T},c))$ is embedded with $w_{g}$, where $z_{T}$ is a noisy latent vector sampled from a Gaussian distribution, $DN$ is the denoising layers, and $c$ is the conditioning. $D_{w}$ is made open-source, allowing users to generate watermarked images.

### 3.2 Threat Model

Attacker’s goals:  Given a watermarked diffusion model decoder $D_{w}$, an attacker aims to fine-tune it as a non-watermarked diffusion model decoder $D_{nw}$. Specifically, the attacker aims to achieve two goals: 1) *effectiveness goal*, and 2) *utility goal*. The effectiveness goal means that images generated by $D_{nw}$ do not have the watermark $w_{g}$ embedded; while the utility goal means that the images generated by $D_{nw}$ maintain visual quality, compared to those generated by $D_{w}$.

Attacker’s knowledge:
A watermarked latent diffusion model consists of an encoder $E$, diffusion process $DP$, denoising layers $DN$, and a watermarked decoder $D_{w}$.
The denoising layers $DN$ and decoder $D_{w}$ are involved when generating images, i.e., $D_{w}(DN(z_{T},c))$ is a generated image, where $z_{T}$ is a noisy latent vector sampled from Gaussian distribution and $c$ is the conditioning. We assume $DN$ and $D_{w}$ are open-source, and thus the attacker has access to them. Depending on whether $E$ and $DP$ are open-source, we consider the following two scenarios:

- •
Encoder-aware (E-aware).
In this scenario, the model provider also makes $E$ and $DP$ open-source. Therefore, the attacker has access to them. For instance, Stable Diffusion model makes its $E$ and $DP$ open-source.
- •
Encoder-agnostic (E-agnostic).
In this scenario, $E$ and $DP$ are not open-source, e.g., because image generation only requires $DN$ and $D_{w}$. Therefore, the attacker does not have access to $E$ and $DP$ in this setting.

Additionally, we assume the attacker has access to a set of non-watermarked images, which we call attacking dataset. For instance, the attacker can simply use popular benchmark images (e.g., ImageNet) as the attacking dataset. The attacking dataset is used to remove watermark from the watermarked diffusion model decoder $D_{w}$.

Attacker’s capability:
We assume the attacker can modify the parameters of the open-sourced watermarked latent diffusion model decoder $D_{w}$. The denoising layers $DN$, which are much larger than the decoder, requires much more computational resources to modify. For instance, in Stable Diffusion 2.1, the denoising layers have about 10 times more parameters than the decoder. Therefore, we assume the attacker modifies the decoder.

## 4 Our Attack

### 4.1 Overview

Figure: Figure 4: Overview of our attack. The solid arrows represent the direction of data flow and the dashed arrows represent the direction of gradient flow.

We propose a two-step method to fine-tune the decoder $D_{w}$ to make the diffusion model’s generated images non-watermarked using an attacking dataset of size $n$, as illustrated in Figure 4. In Step I, we estimate the denoised latent vector $z^{i}$ for each non-watermarked image $x^{i}$ in the attacking dataset, where $i=1,2,\ldots,n$. In Step II, by utilizing these images and their estimated denoised latent vectors, we fine-tune the decoder $D_{w}$ to ensure that the reconstructed images closely match the non-watermarked images when the inputs are the corresponding estimated denoised latent vectors.
Our intuition is that a watermarked decoder will transform a denoised latent vector $z^{i}$ to the watermarked version of $x^{i}$, denoted as $x^{i}_{w}$. Therefore, through fine-tuning the decoder to reconstruct $x^{i}$ from the input $z^{i}$, the decoder is trained to map any given denoised latent vector to the non-watermarked version of its corresponding image, effectively removing watermarks from images generated by the diffusion model.

### 4.2 Step I: Estimate the Denoised Latent Vector z 𝑧 z italic_z

To estimate the denoised latent vector $z^{i}$ for the non-watermarked image $x^{i}$, we propose different methods in different scenarios.

E-aware:
In this scenario, an attacker has access to the encoder $E$, diffusion process $DP$, denoising layers $DN$, and watermarked decoder $D_{w}$.
Based on the pipeline of the diffusion model, the denoised latent vector $z^{i}$ can be represented as $z^{i}=DN(DP(E(x^{i})),c^{i})$. However, since we don’t have access to the ground-truth conditioning $c^{i}$ to reconstruct $z^{i}$, we cannot directly compute $z^{i}$ even though we have access to $E$, $DP$, and $DN$.
We observe that the denoising layers $DN$ are trained to denoise the noisy latent vector $z_{T}$ such that $DN(z_{T},c)$ is close to $E(x)$. Therefore, the attacker can utilize the encoder to encode the non-watermarked image $x^{i}$ into the latent space to get an estimation of the denoised latent vector $z^{i}$, denoted by $\hat{z}^{i}$, as follows:

$$ $\displaystyle\hat{z}^{i}=E(x^{i}),\forall i.$ (1) $$

E-agnostic:
In this scenario, an attacker only has access to the denoising layers $DN$ and watermarked decoder $D_{w}$. The most straightforward way to estimate the denoised latent vector $z^{i}$ is to train a new encoder based on $DN$ and $D_{w}$ and use the method in E-aware scenario. However, training an encoder from scratch for a latent diffusion model to achieve good encoding performance requires a large number of data and computational resources, which is very time-consuming and infeasible for an attacker with limited resources. Recall that our goal is to estimate the denoised latent vector $z^{i}$ which will be mapped to the watermarked image $x^{i}_{w}$ by the watermarked decoder $D_{w}$. Formally, we can formulate an equation as follows:

$$ $\displaystyle D_{w}(z^{i})=x^{i}_{w},\forall i.$ (2) $$

This equation is difficult to solve since there are two variables in it, the denoised latent vector $z^{i}$ and watermarked image $x^{i}_{w}$. To reduce the number of variables, we use the known $x^{i}$ as an approximation of $x^{i}_{w}$ since the watermarked version of an image should be highly perceptually close to the non-watermarked version. Therefore, to get an estimation of $z^{i}$, we can reformulate the equation as follows:

$$ $\displaystyle D_{w}(\hat{z}^{i})=x^{i},\forall i.$ (3) $$

We can easily get an estimation of $z^{i}$ for Equation 3 if $D_{w}$ is invertible, i.e., $\hat{z}^{i}=D_{w}^{-1}(x^{i}),\forall i$. However, since the diffusion model’s decoder is a complicated neural network and it is usually infeasible to get its inverse function, solving the Equation 3 directly is challenging. To address the challenge, we can treat $\hat{z}^{i}$ as a trainable variable and reformulate Equation 3 into an optimization problem as follows:

$$ $\displaystyle\min_{\hat{z}^{i}}l_{p}(D_{w}(\hat{z}^{i}),x^{i}),\forall i,$ (4) $$

where $l_{p}(\cdot,\cdot)$ denotes the perceptual loss between two images to ensure the visual similarity. However, it is still challenging to make $D_{w}(\hat{z}^{i})$ closely resemble the non-watermarked image $x^{i}$ since $\hat{z}^{i}$ is randomly initialized and $D_{w}(\hat{z}^{i})$ is completely different from $x^{i}$ at the early stage of the optimization process.

Therefore, we propose a two-stage optimization method to solve the optimization problem described in Equation 4. At the first stage, for each $\hat{z}^{i}$, we randomly initialize it using a standard Gaussian distribution. Then we employ gradient descent to find an initial point $\hat{z}^{i}_{init}$ for $\hat{z}^{i}$ that minimizes the mean square error between $D_{w}(\hat{z}^{i}_{init})$ and $x^{i}$. This stage ensures that $D_{w}(\hat{z}^{i}_{init})$ roughly resembles $x^{i}$, though with a significant loss of detailed information. At the second stage, we initialize $\hat{z}^{i}$ with the initial point $\hat{z}^{i}_{init}$ obtained from the first stage. Then we set $l_{p}(\cdot,\cdot)$ to be the Watson-VGG perceptual loss introduced by Czolbe et al. [czolbe2020loss] and use gradient descent to further optimize $\hat{z}^{i}$, enabling it to capture and reconstruct the detailed information of the non-watermarked image $x^{i}$. The detailed method to estimate the denoised latent vector $z^{i}$ in E-agnostic scenario is shown in Algorithm 1 in Appendix.

### 4.3 Step II: Fine-tune the Decoder D w subscript 𝐷 𝑤 D_{w} italic_D start_POSTSUBSCRIPT italic_w end_POSTSUBSCRIPT

Given a set of estimated denoised latent vectors $\hat{z}^{i}$ and non-watermarked images $x^{i}$, our goal is to modify the parameters of the watermarked decoder $D_{w}$ to make the diffusion model’s generated images non-watermarked. The main idea is to modify the decoder’s parameters to enable it to map the denoised latent vector $z^{i}$, which is originally mapped to the watermarked image $x^{i}_{w}$, to the non-watermarked image $x^{i}$. To achieve this, we use the estimated denoised latent vectors $\hat{z}^{i}$ and non-watermarked images $x^{i}$ to fine-tune the decoder, ensuring that the reconstructed images closely resemble the non-watermarked images at the pixel level to effectively remove the watermark signal from each pixel. Formally, we can formulate the optimization problem as follows:

$$ $\displaystyle\min_{D_{w}}\frac{1}{n}\sum_{i=1}^{n}\|D_{w}(\hat{z}^{i})-x^{i}\| _{2}.$ (5) $$

However, since the mean square error measures the average difference between the non-watermarked and reconstructed images, it tends to penalize large errors more severely than small ones, leading to a smoothing effect where the reconstructed images may lose lots of detailed information. To solve this challenge, a perceptual loss that measures the distance of the high-level features produced by a pre-trained neural network between two images is employed to ensure the visual quality of the reconstructed images. Formally, we can reformulate the optimization problem as follows:

$$ $\displaystyle\min_{D_{w}}\frac{1}{n}\sum_{i=1}^{n}\|D_{w}(\hat{z}^{i})-x^{i}\| _{2}+\lambda\frac{1}{n}\sum_{i=1}^{n}l_{p}(D_{w}(\hat{z}^{i}),x^{i}),$ (6) $$

where $\lambda$ denotes the weight for the perceptual loss. To solve the optimization problem, we employ gradient descent to optimize the parameters of $D_{w}$ to minimize the objective function in Equation 6. During the optimization, we adopt a convolution neural network introduced by Zhu et al. [zhu2018hidden] as a discriminator to perform adversarial training. The discriminator is trained to distinguish $D_{w}(\hat{z}^{i})$ from $x^{i}$ and the decoder $D_{w}$ is trained to fool the discriminator. Formally, we reformulate the optimization problem as follows:

$$ $\displaystyle\min_{D_{w}}$ $\displaystyle\frac{1}{n}\sum_{i=1}^{n}\|D_{w}(\hat{z}^{i})-x^{i}\|_{2}+\lambda \frac{1}{n}\sum_{i=1}^{n}l_{p}(D_{w}(\hat{z}^{i}),x^{i})$ (7) $\displaystyle\quad+\mu\frac{1}{n}\sum_{i=1}^{n}log(1-disc(D_{w}(\hat{z}^{i}))),$ $$

where $disc$ denotes the discriminator and $\mu$ denotes the weight for the adversarial loss. The detailed method to fine-tune the decoder $D_{w}$ is shown in Algorithm 2 in Appendix.

## 5 Evaluation

### 5.1 Experimental Setup

Datasets:
We employ public non-AI-generated images as our attacking datasets. Specifically, we utilize three datasets: ImageNet [ILSVRC15], MS-COCO [lin2014microsoft], and Conceptual Captions [sharma-etal-2018-conceptual]. From each dataset, we randomly select 4,000 images as an attacking dataset to fine-tune the watermarked decoder. The images in the attacking datasets are resized to 256 $\times$ 256. For testing, we evaluate the effectiveness and utility goals using images generated by an open-source watermarked diffusion model and its versions fine-tuned by watermark removal attacks. These images are produced using text prompts from the Stable Diffusion Prompts dataset created by MagicPrompt [magic-prompt]. Specifically, we randomly sample 100 text prompts from the dataset to generate 100 images for testing.

Detecting watermark in an image:  A watermarking decoder $W_{d}$ is used to detect whether $w_{g}$ is in an image $x$. Specifically, $W_{d}$ is used to decode a watermark, represented as $W_{d}(x)$, from the image $x$. The bitwise accuracy $BA(w_{1},w_{2})$ between two watermarks $w_{1}$ and $w_{2}$ is the proportion of bits that are identical in $w_{1}$ and $w_{2}$. $x$ is detected as watermarked with $w_{g}$ if the bitwise accuracy $BA(W_{d}(x),w_{g})$ exceeds a detection threshold $\tau$ or falls below $1-\tau$, i.e., $BA(W_{d}(x),w_{g})>\tau$ or $BA(W_{d}(x),w_{g})<1-\tau$. Such detector is known as *double-tail detector* [jiang2023evading], which is more robust than *single-tail detector* that detects the image $x$ as watermarked if the bitwise accuracy $BA(W_{d}(x),w_{g})$ exceeds $\tau$. Therefore, we use double-tail detector in this work.

Diffusion model and watermarking decoder:
We use the open-source clean Stable Diffusion 2.1 and its watermarked version obtained by Stable Signature [fernandez2023stable]. For the watermarked version, the watermarked decoder $D_{w}$ is fine-tuned from the Stable Diffusion 2.1’s clean decoder $D_{c}$ with the MS-COCO dataset by Stable Signature. The images generated by the watermarked Stable Diffusion 2.1 are embedded with a ground-truth watermark $w_{g}$ that has 48 bits. For the watermarking decoder $W_{d}$, we use the open-source one [fernandez2023stable] in Stable Signature, which aims to detect whether $w_{g}$ is embedded in an image.

Different variants to estimate the denoised latent vector $z$:
In our experiments, we compare our two-stage optimization method (denoted by 2S) with the following variants to estimate the denoised latent vector $z$. All of these methods initialize $\hat{z}$ with a standard Gaussian distribution and treat it as a trainable variable.

- •
One-stage mean square error (1S-M)
This method optimizes $\hat{z}$ to minimize the mean square error between the reconstructed image $D_{w}(\hat{z})$ and the non-watermarked image $x$.
- •
One-stage perceptual loss (1S-P)
This method optimizes $\hat{z}$ to minimize the perceptual loss calculated by the Watson-VGG model between $D_{w}(\hat{z})$ and $x$.
- •
One-stage mixed loss (1S-Mix)
This method optimizes $\hat{z}$ to minimize the mixed loss consisting of mean square error and perceptual loss calculated by the Watson-VGG model between $D_{w}(\hat{z})$ and $x$. The weights for different loss functions are set to be 1.

Per-image-based removal attacks:
In our experiments, we compare our attack with five commonly used per-image-based removal attacks, including the state-of-the-art one proposed by Jiang et al. [jiang2023evading]. The details of the per-image-based removal attacks we use are shown in Appendix A.
It should be emphasized that all of these per-image-based attacks require to craft a perturbation for each watermarked image individually to remove watermark.

Model-targeted removal attack:
For model-targeted attacks, we compare our attack with MP introduced in Stable Signature [fernandez2023stable]. Specifically, MP involves fine-tuning the diffusion model’s encoder and decoder with the encoder’s parameters fixed to reconstruct non-watermarked images using mean square error as the reconstruction loss. Note that this method requires the access to the diffusion model’s encoder and is only applicable in the E-aware scenario. The parameter setting follows the configuration by Stable Signature [fernandez2023stable] as shown in Appendix B.

Evaluation metrics:
To evaluate whether our attack achieves the effectiveness goal, we utilize two metrics: *evasion rate* and *bitwise accuracy*. Evasion rate is the proportion of generated images (or perturbed images for per-image-based removal attacks) detected as watermarked by the watermark-based detector. Bitwise accuracy is the proportion of bits in the watermark decoded from a generated (or perturbed) image that matches with $w_{g}$. Additionally, to evaluate whether our attack achieves the utility goal, we use a commonly used metric for the generation quality of generative models, i.e., *Fréchet Inception Distance (FID)*. Specifically, we compute the FID in the testing set between generated (or perturbed) images and the watermarked images generated by the watermarked Stable Diffusion 2.1 with the same random seed. Note that the bitwise accuracy is averaged across 100 images in the testing set.

Parameter settings:
In the E-aware scenario, we use the Watson-VGG [czolbe2020loss] model to measure the perceptual loss in Step II.
However, in Step I of our attack, we use the Watson-VGG model to measure the perceptual loss in the E-agnostic scenario.
To avoid potential local minima issues that could emerge from using the same perceptual loss model, we use VGG-16 [torch-vgg] to measure the perceptual loss in E-agnostic scenario in Step II. For the discriminator $disc$, we employ the discriminator in HiDDeN [zhu2018hidden].

To estimate the denoised latent vector $z$ in the E-agnostic scenario, 2S is employed as the default method and we execute 500 epochs for each stage. In each stage, the Adam optimizer, with a learning rate of 0.1, is used to optimize $\hat{z}$. For other variants to estimate $z$, we execute 1,000 epochs–equivalent to the total epoch count in 2S–and maintain consistent optimizer settings.

For decoder fine-tuning, we execute 1 epoch in the E-aware scenario and 2 epochs in the E-agnostic scenario. We set the parameters $\lambda=1$ and $\mu=0.1$. Additionally, the AdamW optimizer is used, with a base learning rate of 0.0005 with a linear warm-up period of 20 iterations followed by a half-cycle cosine decay. The batch size is set to be 4. For optimizing the discriminator, the Adam optimizer is used with a learning rate of 0.001.

The detection threshold $\tau$ is set to ensure that the false positive rate of the double-tail detector does not exceed $10^{-4}$. Given that the watermark length in our experiments is 48, $\tau$ is set to be 0.77.

### 5.2 Experimental Results

Our attack achieves both the effectiveness and utility goals:

Figure: (a)

Figure 5 shows the evasion rate, bitwise accuracy, and FID of MP and our attack with the three attacking datasets. First, we observe that our attack is successful in evading watermark-based detection in both E-aware and E-agnostic scenarios. The evasion rate is higher than 94% and the bitwise accuracy is lower than 66%, while maintaining an FID lower than 27.5. Second, we observe that our attack outperforms MP in both scenarios. In the E-aware scenario, our attack has a higher evasion rate and lower bitwise accuracy while maintaining a much lower FID in all the three attacking datasets. In the E-agnostic scenario, our attack still has a comparable or higher evasion rate and comparable bitwise accuracy while maintaining a much lower FID in all the three attacking datasets. Note that MP assumes the attacker has access to the encoder while our attack in the E-agnostic scenario doesn’t. Figure 9 in Appendix shows some image examples of our attack compared with the clean and watermarked ones. We observe that the images produced by our non-watermarked decoder are almost the same as those produced by the clean and watermarked decoder.

Comparing with per-image-based removal attacks:

**Table 1: Utility and processing time of per-image-based attacks and our attack.**
|  | Utility | Time |  |  |  |
| --- | --- | --- | --- | --- | --- |
| Method | FID $\downarrow$ | PSNR $\uparrow$ | SSIM $\uparrow$ | Fine-tuning (min) $\downarrow$ | Removal (s/img) $\downarrow$ |
| JPEG | 61.48 | 28.57 | 0.84 | 0 | 0.036 |
| Brightness | 223.67 | 5.15 | 0.40 | 0 | 0.005 |
| Contrast | 172.44 | 10.10 | 0.32 | 0 | 0.002 |
| GN | 228.51 | 13.10 | 0.11 | 0 | 0.017 |
| WEvade-W-II | 5.80 | 38.94 | 0.99 | 0 | 651.034 |
| E-aware | 18.15 | 29.50 | 0.86 | 14.197 | 0 |
| E-agnostic | 25.68 | 29.40 | 0.86 | 8777.885 | 0 |

Table 1 shows the utility and the processing time of our attack compared with five per-image-based removal attacks when achieving similar evasion rate and bitwise accuracy. Figure 11 in Appendix shows the comparison of the generated (or perturbed) images by different attacks. We also show the *Peak signal-to-noise ratio (PSNR)* and *Structural Similarity Index Measure (SSIM)* which are the commonly used metrics for assessing per-image-based attacks’ utility. For the processing time, we divide it into two phases: decoder fine-tuning and watermark removal for each image. It is important to note that the fine-tuning time of our attack is on a single NVIDIA A6000 GPU. It can be significantly reduced when using multiple GPUs since the process of estimating $z$ which is the most time-consuming part in E-agnostic scenario can be parallelized. For instance, with four NVIDIA A6000 GPUs, it only takes about 2K minutes for fine-tuning in E-agnostic scenario.

First, we observe that the utility of our attack is much higher than most per-image-based removal attacks. Second, the removal time of our attack is 0 once the decoder is fine-tuned. Therefore, our attack shows much higher efficiency of removing watermark when the number of generated images is large. For instance, the efficiency of our attack outperforms WEvade-W-II when processing more than 1 image in E-aware scenario and 809 images in E-agnostic scenario. Note that WEvade-W-II requires the access to the watermarking decoder $W_{d}$ to perform a white-box attack, and it represents the upper bound of the utility that can be achieved by a removal attack. Though our attack maintains a slightly worse utility than WEvade-W-II when compared to the watermarked images, it is still difficult for human’s eyes to notice their differences with the watermarked images, as shown in Figure 11 in Appendix. It is worthwhile to mention that our attack maintains a similar utility as WEvade-W-II when compared to the clean non-watermarked images. It is because we optimize the decoder’s output close to the non-watermarked image rather than the watermarked one in the optimization problem we formulate.

Different variants to estimate $z$:

Figure: (a)

Figure 6 shows the FID and the examples of reconstructed image by different variants to estimate the denoised latent vector $z$ for a non-watermarked image. The FID is computed between 100 images randomly selected from ImageNet dataset and their reconstructed version by different variants. We observe that the images reconstructed by 2S are more similar to the original ones than those reconstructed by other variants. 2S achieves a much lower FID compared with other variants. Additionally, from the examples of reconstructed image shown, we observe that $z$ produced by our method can reconstruct more detail information in the original image and achieve a higher level of visual similarity to the original one.

Different $\lambda$:

Figure: (a)

Figure 7 shows the evasion rate, bitwise accuracy, and FID for different $\lambda$ in our attack. First, we observe that the effectiveness of our attack decreases when $\lambda$ increases. This trend can be attributed to the loss function placing greater emphasis on perceptual loss, thereby reducing the mean square error’s capability in removing watermarks. Second, we observe that the utility of our attack first increases and then slightly decreases when $\lambda$ increases. The early improvement in utility results from a higher weighting on perceptual loss, which enhances image fidelity. However, when $\lambda$ continues increasing, the reconstructed image starts to deviate from the non-watermarked image pixel-wisely since the loss function focus more on the perceptual loss than the mean square error, which results in a worse utility.

Different $\mu$:

Figure: (a)

Figure 8 shows the evasion rate, bitwise accuracy, and FID for different $\mu$ in our attack. First, we observe that the effectiveness of our attack remains constant, subsequently decreasing, while utility does not change in the E-aware scenario as $\mu$ increases. This phenomenon occurs because the reconstructed image is sufficiently similar to the non-watermarked image when $\mu$ is small; thus, increasing $\mu$ does not decrease their distance further to aid in watermark removal. Additionally, a larger weighting on perceptual loss reduces the mean square error’s capability in removing watermark, resulting in decreased effectiveness of our attack.
Conversely, in the E-agnostic scenario, both effectiveness and utility begin unchanged but later improve as $\mu$ increases. This improvement is attributed to the initial significant difference between the reconstructed and non-watermarked images. Increasing $\mu$ makes the reconstructed image closer to the non-watermarked one, thereby improving effectiveness and utility.

## 6 Conclusion and Future Work

In this work, we find that image watermark for open-source diffusion model is not robust as previously thought. Given a watermarked diffusion model, an attacker can remove the watermark from it by strategically fine-tuning its decoder. Our results show that our attack achieves both the effectiveness and utility goals in removing watermark from diffusion models in both E-aware and E-agnostic scenarios, and outperforms the existing model-targeted attack which is only applicable to E-aware scenario. Interesting future work is to design a more robust image watermarking method for open-source diffusion models.

Figure: Algorithm 1 Estimate the denoised latent vector $z$

Figure: Algorithm 2 Fine-tune the decoder $D_{w}$

## Appendix A Details of the per-image-based removal attacks

- •
JPEG
It is a commonly used image compression technique that can significantly decrease the size of image files while preserving high image quality. The quality of images processed by JPEG is governed by a quality factor. Using a smaller quality factor to post-process watermarked images can make the detection of watermarks within the image more difficult.
- •
Brightness
This method modifies the brightness of an image by initially converting the image to a color space that includes a brightness-related channel. It then isolates this channel, adjusts its intensity by multiplying it with a specified factor, and finally converts the image back to its original color space. This method may disrupt the watermark patterns in watermarked images to evade watermark detection.
- •
Contrast
This method alters the contrast of an image by modifying its pixel values. Specifically, for each pixel, it subtracts 127 from the pixel’s value, multiplies the result by a factor $k$, and then adds 127 to the outcome. The factor $k$ determines the level of contrast enhancement or reduction, with values greater than 1 increasing contrast and values between 0 and 1 decreasing it.
- •
Gaussian noise (GN)
This method adds a noise that follows a Gaussian distribution with a zero mean and a standard deviation of $\sigma$ to the watermarked image. It simulates the noise effects commonly encountered in the real world. A larger $\sigma$ value makes it more challenging to detect watermarks, simultaneously compromising image quality.
- •
WEvade-W-II [jiang2023evading]
This method employs projected gradient descent (PGD) to optimize a perturbation applied to the watermarked image such that the decoded watermark from the perturbed image by the model provider’s watermarking decoder closely matches a randomly generated watermark, with each bit uniformly sampled from $\{0,1\}$. We assume that the attacker has access to the watermarking decoder for this method.

## Appendix B Parameter settings for MP

Following the configuration by Fernandez et al. [fernandez2023stable], we employ AdamW and a learning rate of 0.0005 with a linear warm-up period of 20 iterations followed by a half-cycle cosine decay to fine-tune the decoder with a batch size of 4 to achieve similar bitwise accuracy on the attacking dataset as our attack in the E-aware scenario.

Figure: Figure 9: Image generated by the clean Stable Diffusion 2.1 (first row), Stable Diffusion 2.1 watermarked by Stable Signature (second row), watermarked Stable Diffusion 2.1 fine-tuned by our attack in E-aware scenario (third row), and watermarked Stable Diffusion 2.1 fine-tuned by our attack in E-agnostic scenario (fourth row). The same denoised latent vector is used by all diffusion models’ decoders to generate the images in the same column. The watermark can only be detected in the images generated by Stable Diffusion 2.1 watermarked by Stable Signature (second row).
Refer to caption: extracted/2405.07145v1/figure/main_results/image_comp/original/img_32.png

Figure: (a)
Refer to caption: extracted/2405.07145v1/figure/comp_with_pp/non_wm.png

## Peer Reviews

confidence: 3
contribution: 2
initial_rating: 5
presentation: 3
questions: 1. Why the e-agnostic scenario takes so much time in fine-tuning? Can the authors specify the process?
2. I’m confused about the changing of  evasion rate and the bitwise accuracy with respect to $\mu$, the weight of the adversarial loss. It seems contradictory that as $\mu$ increases, in terms of evasion rate and bitwise accuracy, the e-aware curve and e-agnostic curve has two different trending directions. Can the authors explain it?
3. The assumption is that the attacker can access the decoder of an open-sourced model. I’m quite confused about this setting. If the decoder can be accessed, why not just replace the decoder with the original one? It seems the application scenario of this method is not necessary in real-life? Can the authors explain it?
soundness: 3
strengths: 1. The approach can adapt to two different access levels. It’s flexible and close to real-world settings.
2. The watermark demonstrates high quality in watermark removal tasks and preserves image quality. Although E-agnostic takes long time to fine-tune, the proposed method is model-targeted and therefore needs no additional processing time once fine-tuned.
summary: The paper introduces a method to remove watermarks added by stable signature [1]. The method achieves high removal effect and good image quality compared to previous method MP [2]. The method builds on the assumption that the attacker can modify the parameters of the open-sourced watermarked latent diffusion model decoder. The approach consists of two steps: first, the method estimates a denoised latent vector for each non-watermarked image in an attacking dataset; then, it fine-tunes the decoder so that the generated images align closely with the non-watermarked images. In the encoder-aware scenario, the attacker has access to the model’s encoder, diffusion process, and denoising layers. In the encore-agnostic scenario, the attacker only has access to the denoising layers and decoder. The experiment results show that this method achieves high watermark removal rates with preserved image quality.

[1] Fernandez, P., Couairon, G., Jégou, H., Douze, M., & Furon, T. (2023). The stable signature: Rooting watermarks in latent diffusion models. In Proceedings of the IEEE/CVF International Conference on Computer Vision (pp. 22466-22477).
weaknesses: 1. It seems the novelty of the method is not very apparent. The method estimates the latent z and do fine-tuning on decoder based on the loss function, which is a common method in watermarking methods, see [1].
2. It’s still not very clear to me why the encoded latent $\hat{z}^i$ can be used to approximate the true $z^i$. Although the decoded image can be similar to the original image visually, the latents $\hat{z}^i$ and $z^i$ may differ significantly. suppose the distribution of the latent after the denoising process of the diffusion model is $P$, and the distribution of the latent after the encoding of a clean image using the encoder is $P'$. $z^i$ is sampled from $P$, while $\hat{z}^i$ is sampled from $P'$. It's obvious that $P$ and $P'$ is not the same, though they may be close to each other. The fine-tuning is actually a process that tries to adapt the input distribution of the decoder to $P'$.


[1] Zhang, L., Liu, X., Martin, A. V., Bearfield, C. X., Brun, Y., & Guan, H. (2024). Robust Image Watermarking using Stable Diffusion. arXiv preprint arXiv:2401.04247.

---

confidence: 4
contribution: 1
initial_rating: 3
presentation: 2
questions: 1. Given that some existing methods can remove watermarks with simpler forward processes, how does your approach justify its more complex optimization steps in terms of practical use cases?

2. The evaluation shows that the watermark removal performance varies under different conditions. How do you see your approach being adapted or scaled to scenarios where full access to the VAE or other internal components is not feasible?
soundness: 2
strengths: 1.This paper introduces a novel method of fine-tuning the decoder of a diffusion model to remove watermarks generated during the process. It demonstrates significant improvements in watermark removal while maintaining the visual quality of the output images, showing an enhancement over the Model Purification (MP) approach.

2. Comprehensive Evaluation: The study includes a thorough evaluation of the proposed attack across various scenarios (both encoder-aware and encoder-agnostic), datasets, and comparisons with existing methods like MP (Model Purification).
summary: The paper evaluates the robustness of the "StableSignature" watermarking technique embedded in the parameters of diffusion model decoders, proposed by Meta. The authors present a new model-targeted attack that effectively removes these watermarks while preserving image quality. Their results reveal that the robustness of Stable Signature is overestimated, highlighting potential vulnerabilities in in-generation watermarking techniques.
weaknesses: 1. This paper's main finding that "Stable Signature is not robust" is not novel; in fact, previous methods[2,3] have already made the same discovery. Existing watermark removal technologies such as DiffPure[1] and Controlgen[2] can remove Stable Signature watermarks through a simple forward pass. This contrasts with the attack method proposed in this paper, which requires multiple optimization iterations and potentially access to model components like the VAE and watermark decoder.

2. The method requires fine-tuning of the model's decoder and, in some cases, access to components such as the encoder or VAE. This requirement may not always be practical for real-world adversaries and limits the broader applicability of the proposed attack. The time overhead is extremely high, making it difficult to use in practice. If I can access the decoder of a certain watermarking method, removing the watermark through optimization iterations and image regularization is an expected outcome and lacks innovation.

3. This paper can only remove a single type of watermark. 

Reference: 
1. Diffusion Models for Adversarial Purification
2. Image Watermarks are Removable Using Controllable Regeneration from Clean Noise
3. WAVES: Benchmarking the Robustness of Image Watermarks

---

confidence: 4
contribution: 3
initial_rating: 5
presentation: 4
questions: 1.As stated in the weakness, the method relies on the model. The attack need to know and replace the decoder of the employed model to attack the targeted model. But it seems impossible. It seems to need two conditions. The first is that you can get the model of employed model. The second is that you can replace the decoder. Maybe it is useful when you buy a watermarked generated model from the owner and you want to escape the watermark generation. But it still need the owner give you the all model instead of an api. 
The author may can make some explanation about the limitation.
2.The method seems to design for fine-tuned watermarking method such as the stable signature[1] as the author states in the title. So how this method perform to other watermarking method for diffusion models such as Tree-ring[2]. So i wonder know whether this method is only suitable for watermarking method as stable signature, or
It can still perform well in other methods.
3.There are some watermark removal for invisible watermark such as [3], what is the difference between the performance?
[1]Fernandez P, Couairon G, Jégou H, et al. The stable signature: Rooting watermarks in latent diffusion models[C]//Proceedings of the IEEE/CVF International Conference on Computer Vision. 2023: 22466-22477.
[2]Wen Y, Kirchenbauer J, Geiping J, et al. Tree-ring watermarks: Fingerprints for diffusion images that are invisible and robust[J]. arXiv preprint arXiv:2305.20030, 2023.
[3]Saberi M, Sadasivan V S, Rezaei K, et al. Robustness of ai-image detectors: Fundamental limits and practical attacks[J]. arXiv preprint arXiv:2310.00076, 2023.
soundness: 4
strengths: 1.This paper propose a model-targeted attack to remove watermark.
2.The method is effective at removing watermark on a large scale.
3.This method can preserve the quality of image.
summary: This paper proposes an novel method to remove watermarks in generated images of diffusion model. Experiments show that it can remove watermarks as the paper states.
weaknesses: This method is model-targeted, so the watermark removal relies on fine-tuning model. It is a white-box method.

---

confidence: 4
contribution: 2
initial_rating: 5
presentation: 3
questions: The authors aim to eliminate watermark information from generated images by fine-tuning the decoder. However, I have a concern regarding whether the watermark information is genuinely removed or simply hidden. Since the authors only fine-tuned the diffusion model's decoder, this fine-tuning will certainly alter the distribution of the generated images. Meanwhile, the watermark model's decoder (in the case of Stable Signature, this is HiDDeN's decoder) is not fine-tuned in tandem, which would naturally lead to a decrease in watermark extraction accuracy.

If the watermark model's decoder were also fine-tuned simultaneously, would the authors' attack still remain effective? If it were still effective, this would imply that the authors' attack merely changes the distribution rather than genuinely removing the watermark information. In such a case, defenders could train a watermark model decoder to counter this attack.
soundness: 2
strengths: 1. The authors clearly articulate their motivation, and the introduction and related work sections are well-structured, allowing readers unfamiliar with the field to quickly grasp the background. The problem formulation is precise, with explicit statements regarding the attacker's goals and capabilities.
2. The experiments validate the effectiveness of the authors' E-aware and E-agnostic methods, particularly the E-aware attack on WOUAF, which achieves better FID and LPIPS scores than the "No attack" baseline.
summary: This paper presents a watermark removal attack targeting images generated by open-source diffusion models. The authors identify the limitations of existing in-generation watermark methods, such as Stable Signature, in the context of removal attacks. They explore two scenarios regarding the attacker's access to the encoder \( E \) and propose a novel two-step attack method. Experimental results demonstrate that their approach can effectively remove watermarks from diffusion model-generated images while maintaining visual quality.
weaknesses: 1. The proposed method has limitations in practical applications. Both the E-aware and E-agnostic approaches require the involvement of a watermarked decoder \( D_w \), rendering them unsuitable for commercial closed-source watermark models.
2. The comparative experimental setup is insufficient, especially regarding comparisons with per-image-based removal attacks. Although the authors cite several recent per-image-based attacks in Section 2.3, they only select WEvade for comparison, neglecting other diffusion-based watermark removal methods or optimization-based approaches. A more comprehensive and extensive comparison in the experimental section should be conducted.