One evaluation pipeline for image watermarking: embed, attack, extract, score and plot — for post-generation and in-generation methods alike. Eleven models, 44 attack configurations and 34 differentiable attackers ship with it.
pip install watermarklabFrom a single call to a full benchmark report — without wiring the parts together yourself.
A single wl.evaluate() call runs embedding, visual-quality measurement, the attack sweep, extraction and scoring. It reads the dataloader to decide whether your model is post-generation (images) or in-generation (prompts) and routes the run accordingly.
Compression (classic JPEG / JPEG2000 / WebP and learned BMSHJ2018 / MBT2018 / Cheng2020), adversarial embedding, noise, blur, geometric, colour and diffusion regeneration — each with a calibrated strength sweep, all built by AttackersWithFactorsModel().
Drop-in DiffAttacker layers for end-to-end adversarial training, including differentiable JPEG (mask / polynomial / Fourier), screen-capture PIMoG and print-capture StegaStamp.
Seven post-generation (DctDwt, DctDwtSvd, RivaGAN, StegaStamp, TrustMark, InvisMark, VINE), three in-generation (Tree-Ring, GaussianShading, StableSignature) and iSteganoGAN.
Robustness (BER, EA, NC, NEB, TPR@x%FPR) and imperceptibility (PSNR, SSIM, RMSE, MAE, LPIPS) metrics, plus FID for in-generation runs, over MS-COCO 2017 images and prompts, Kodak24 and USC-SIPI.
Robustness curves, model and attacker rankings, visual-quality and stego comparisons. Extend BaseWatermarkModel, BaseTestAttackModel, BaseMetric and the other base classes to plug in your own method.
Symbols and signatures are generated from the source tree by static AST analysis.
Ranked by cumulative RQ-AUC across the attack sweep. The strongest post-generation method is StegaStamp; in-generation methods lead overall.
Best overall. Only five attacks reach TPR@0.1%FPR = 0.8 against it.
Strongest post-generation method; weakest under flipping and rotation.
Sensitive to cropping — a 10% crop drops TPR@0.1%FPR to 0.01.
Eight modules — jump straight into any part of the API reference.
watermarksTen reference methods for comparative studies — seven post-generation and three in-generation.
→attackersTestAttacker for benchmarking robustness, and differentiable DiffAttacker for adversarial training and the development of new methods. The default AttackersWithFactorsModel() ships 44 attack configurations; the standard benchmark evaluates 34 of them.
metricsRobustness metrics (BER, EA, TPR@x%FPR) and imperceptibility metrics (PSNR, SSIM, LPIPS, FID), plus a base class for custom metrics.
→toolsAuxiliary utilities such as compression coding and reversible data hiding, supporting the development of robust reversible watermarking.
→datasetsMainstream benchmarks — MS-COCO 2017 images and captions, Kodak24 and USC-SIPI — with the batched loader that pairs data with watermark bits.
→laboratoriesThe evaluation platform for PGW and IGW methods, together with the base interfaces you implement to plug in your own model, attacker or metric.
→drawVisualization and interactive analysis: robustness curves, model and attacker rankings, visual-quality plots and stego / attack comparisons.
→steganographyiSteganoGAN, an improved SteganoGAN model that uses L-BFGS for more accurate and stable watermark extraction. It ships alongside the seven core modules and subclasses BaseWatermarkModel.
Instantiate a model, wrap the default attackers, and call wl.evaluate(). The API reference has the full signatures for every class and method.