Abstract
Diffusion models enable high-quality synthetic image generation but raise serious concerns about copyright infringement and semantic manipulation. Existing watermarking methods either rely on manual hyperparameter tuning or fail under semantic AIGC edits such as inpainting and instruction-based image modification. To address these limitations, we propose LatentShield, a robust watermarking framework that embeds messages directly into the latent space of a diffusion model and optimises the trade-off between imperceptibility, extraction accuracy, and robustness using a hybrid variant of the Fireworks Optimisation Algorithm. Unlike prior work that fine-tunes the denoising U-Net or VAE decoder, LatentShield leaves the generative network unchanged, embedding watermarks via a learnable projection into the VAE latent space. The extraction network is trained adversarially against both conventional distortions and simulated AIGC semantic edits. The Hybrid Deep Fireworks Algorithm (H-DFWA) dynamically calibrates the loss weights, automatically exploring the Pareto frontier without manual tuning. Experiments on COCO, ImageNet and MedPix demonstrate that LatentShield achieves 44.27 dB PSNR, maintains bit accuracy above 96% under conventional distortions (JPEG, rotation, cropping), and reaches 97.8% and 88.4% under challenging AIGC edits (inpainting and global instruction-based editing), significantly outperforming state-of-the-art methods. An extensive ablation study confirms the contribution of each component, while statistical testing establishes the significance of the reported improvements.