Skip to content

Latest commit

 

History

History
117 lines (78 loc) · 3.46 KB

File metadata and controls

117 lines (78 loc) · 3.46 KB

Image-Bench: 图像水印鲁棒性评估基准

Python 3.8+ License: MIT Dataset: W-Bench

评估图像水印算法在传统失真攻击下的鲁棒性,基于W-Bench DISTORTION_1K数据集(1000张图像 × 25种攻击配置)。


🚀 快速开始

1. 安装依赖

# 必需依赖
pip install pillow numpy torch tqdm pyyaml

# 质量指标计算
pip install scikit-image lpips

2. 下载数据集

huggingface-cli download Shilin-LU/W-Bench \
  --repo-type=dataset \
  --local-dir dataset/W-Bench \
  --include "DISTORTION_1K/**"

数据集大小: ~9GB 验证下载: ls dataset/W-Bench/DISTORTION_1K/image/ | wc -l 应输出 1000

3. 运行评估

python benchmarks/Image-Bench/run_benchmark.py

结果输出: results/videoseal_distortion/metrics.json


📊 评估流程

支持的攻击类型

攻击类型 强度参数 说明
Brightness [1.2, 1.4, 1.6, 1.8, 2.0] 亮度增强(倍数)
Contrast [0.2, 0.4, 0.6, 0.8, 1.0] 对比度降低(倍数)
Blurring [1, 3, 5, 7, 9] 高斯模糊(核大小)
Noise [0.01, 0.03, 0.05, 0.07, 0.1] 高斯噪声(标准差)
JPEG Compression [95, 90, 80, 70, 60] JPEG质量

共计 5种攻击 × 5个强度 = 25种配置

评估指标

指标类别 指标 判定阈值 指标说明
质量 PSNR ≥ 35.0 dB Peak Signal-to-Noise Ratio(峰值信噪比),越高越好
质量 SSIM ≥ 0.95 Structural Similarity Index(结构相似度),越接近 1 越好
质量 LPIPS ≤ 0.015 Learned Perceptual Similarity(感知相似度),越低越好
鲁棒性 TPR ≥ 0.80 True Positive Rate(检测成功率),越高表示鲁棒性越强
鲁棒性 Bit Accuracy ≥ 0.85 水印比特准确率,决定解码结果与原始水印的接近程度

📈 可视化分析

生成雷达图以可视化水印鲁棒性:

python benchmarks/Image-Bench/utils/plot_radar.py \
    benchmarks/Image-Bench/results/videoseal_distortion/metrics.json
TPR Bit Accuracy 质量评估指标
VideoSeal TPR Radar VideoSeal Bit Accuracy Radar
指标数值达到阈值
PSNR45.52 dB
SSIM0.9953
LPIPS0.0025

🏆 致谢

本项目基于以下开源工作:

  • VINE - W-Bench数据集和失真攻击实现
  • VideoSeal - 视频/图像水印算法