Towards Safe Synthetic Image Generation On the Web: A Multimodal Robust NSFW Defense and Million Scale Dataset
Muhammad Shahid Muneer, Simon S. Woo
TL;DR
The paper tackles the safety challenges of web-based image generation by addressing weaknesses in unimodal NSFW defenses against multimodal adversarial attacks. It introduces NSFWCorpus, a million-scale dataset of text–image pairs including safe, NSFW, and adversarial variants, and a multimodal defense that uses cross-attention between text and image modalities to detect NSFW content. Experimental results demonstrate reduced attack success rates and improved detection metrics compared with state-of-the-art unimodal defenses, highlighting the practical value of context-aware multimodal moderation. The work provides a scalable baseline for safer web content generation and points to extensions toward multilingual data and additional modalities like video and audio.
Abstract
In the past years, we have witnessed the remarkable success of Text-to-Image (T2I) models and their widespread use on the web. Extensive research in making T2I models produce hyper-realistic images has led to new concerns, such as generating Not-Safe-For-Work (NSFW) web content and polluting the web society. To help prevent misuse of T2I models and create a safer web environment for users features like NSFW filters and post-hoc security checks are used in these models. However, recent work unveiled how these methods can easily fail to prevent misuse. In particular, adversarial attacks on text and image modalities can easily outplay defensive measures. %Exploiting such leads to the growing concern of preventing adversarial attacks on text and image modalities. Moreover, there is currently no robust multimodal NSFW dataset that includes both prompt and image pairs and adversarial examples. This work proposes a million-scale prompt and image dataset generated using open-source diffusion models. Second, we develop a multimodal defense to distinguish safe and NSFW text and images, which is robust against adversarial attacks and directly alleviates current challenges. Our extensive experiments show that our model performs well against existing SOTA NSFW detection methods in terms of accuracy and recall, drastically reducing the Attack Success Rate (ASR) in multimodal adversarial attack scenarios. Code: https://github.com/shahidmuneer/multimodal-nsfw-defense.
