|
|
|
|
[Paper] | [GitHub] |
[Poster] |
|
As latent diffusion models (LDMs) democratize image generation capabilities, there is a growing need to detect fake images. A good detector should focus on the generative models fingerprints while ignoring image properties such as semantic content, resolution, file format, etc. Fake image detectors are usually built in a data driven way, where a model is trained to separate real from fake images. Existing works primarily investigate network architecture choices and training recipes. In this work, we argue that in addition to these algorithmic choices, we also require a well aligned dataset of real/fake images to train a robust detector. For the family of LDMs, we propose a very simple way to achieve this: we reconstruct all the real images using the LDMs autoencoder, without any denoising operation. We then train a model to separate these real images from their reconstructions. The fakes created this way are extremely similar to the real ones in almost every aspect (e.g., size, aspect ratio, semantic content), which forces the model to look for the LDM decoders artifacts. We empirically show that this way of creating aligned real/fake datasets, which also sidesteps the computationally expensive denoising process, helps in building a detector that focuses less on spurious correlations, something that a very popular existing method is susceptible to. Finally, to demonstrate just how effective the alignment in a dataset can be, we build a detector using images that are not natural objects, and present promising results. Overall, our work identifies the subtle but significant issues that arise when training a fake image detector and proposes a simple and inexpensive solution to address these problems. |
Mitigating Spurious Correlations: We observe that using misaligned data (in terms of resolution, compression etc) to train a fake image detector can induce the learning of false patterns. For the family of latent-diffusion models, we propose a simple fix. We reconstruct the real images using the latent diffusion VAE (instead of relying on the denoising process) and train a fake image detector on those images. We empirically demonstrate that a model trained this way is less-likely to learn spurious correlations. For example, an existing method learns to associate upsampling with fake images and downsampling with real images, by training the same detector using our approach we are able to sidestep such issues. |
|
Computational Efficiency: Since our dataset curation does not rely on the denoising step, our dataset curation process is computationally inexpensive compared to the existing paradigm of generating with the denoising process. |
|
Low Data Demand: In addition to being computationally inexpensive, our method is also more data-efficient. Since the real and fake images are near-identical, the detector is forced to look for more fundamental patterns as opposed to semantic patterns during training. |
|
Independent of Semantic Content: Furthermore, by leveraging an aligned dataset, we can train an effective fake image detector, even if the training data is semantically unrelated to the testing data. We demonstrate this by training a model using graphics generated (shaders) data and testing it on natural images. In this work we define fake images as images generated by a neural network, therefore procedurally generated images (shaders) are considered real. The promising performance of a detector trained in such a manner shows the efficacy of dataset alignment. |
|
|
Anirudh Sundara Rajan, Utkarsh Ojha, Jedidiah Schloesser, Yong Jae Lee. On the Effectiveness of Dataset Alignment for Fake Image Detection In arXiv, 2024. (hosted on ArXiv) |
Acknowledgements |