CogMorph: Cognitive Morphing Attacks for Text-to-Image Models
Abstract
The development of text-to-image (T2I) generative models, that enable the creation of high-quality synthetic images from textual prompts, has opened new frontiers in creative design and content generation. However, this paper reveals a significant and previously unrecognized ethical risk inherent in this technology and introduces a novel method, termed the Cognitive Morphing Attack(CogMorph), which manipulates T2I models to generate images that retain the original core subjects but embeds toxic or harmful contextual elements. This nuanced manipulation exploits the cognitive principle that human perception of concepts is shaped by the entire visual scene and its context, producing images that amplify emotional harm far beyond attacks that merely preserve the original semantics. To address this, we first construct an imagery toxicity taxonomy spanning 10 major and 48 sub-categories, aligned with human cognitive-perceptual dimensions, and further build a toxicity risk matrix resulting in 1,176 high-quality T2I toxic prompts. Based on this, ourCogMorphfirst introduces Cognitive Toxicity Augmentation, which develops a cognitive toxicity knowledge base with rich external toxic representations for humans (e.g., fine-grained visual features) that can be utilized to further guide the optimization of adversarial prompts. In addition, we present Contextual Hierarchical Morphing, which hierarchically extracts critical parts of the original prompt (e.g., scenes, subjects, and body parts), and then iteratively retrieves and fuses toxic features to inject harmful contexts. Extensive experiments on multiple open-source T2I models and black-box commercial APIs (e.g., DALL$\cdot$E-3) demonstrate the efficacy ofCogMorphwhich significantly outperforms other baselines by large margins (+20.62% on average). Our codes are available athttps://github.com/raykr/CogMorph.Warning: This paper contains harmful imagery that might be offensive to some readers.
Fields of Study & Subjects
Adversarial Robustness in Machine Learning
Generative Adversarial Networks and Image Synthesis
Digital Media Forensic Detection
Publication details
- Journal / source
- IEEE Transactions on Dependable and Secure Computing
- Volume
- 23
- Issue
- 3
- Pages
- 5287–5301
- Publication date
- 12 January 2026
- Language
- EN