Phei Watermark for Fish-Speech 1.5
VQ-TTS 三层水印系统(语义层 / VQ 编码层 / 音频层)的预训练模型 + 可直接运行的推理包。
基于 fishaudio/fish-speech 1.5,在其 Slow + Fast Transformer 上做 Stage 3 水印兼容性微调。
一键运行(推荐)
下载 phei_watermark_bundle.tar.gz(2.8 GB),解压即可。
🇨🇳 国内用户(autodl / 阿里云等) —— 强烈建议用 hf-mirror.com,直连 huggingface.co 会卡:
# aria2c 多线程(最快,推荐)
apt-get install -y aria2 # 没装的话先装
aria2c -x 16 -s 16 -o phei_watermark_bundle.tar.gz \
https://hf-mirror.com/taopeng/phei-watermark-fish-speech-1.5/resolve/main/phei_watermark_bundle.tar.gz
# 或 wget 断点续传
wget -c -O phei_watermark_bundle.tar.gz \
https://hf-mirror.com/taopeng/phei-watermark-fish-speech-1.5/resolve/main/phei_watermark_bundle.tar.gz
# 或 hf cli + 镜像
pip install -U "huggingface_hub[cli]"
export HF_ENDPOINT=https://hf-mirror.com
hf download taopeng/phei-watermark-fish-speech-1.5 phei_watermark_bundle.tar.gz --local-dir .
国外用户 —— 直接走 huggingface.co:
wget -O phei_watermark_bundle.tar.gz \
https://huggingface.co/taopeng/phei-watermark-fish-speech-1.5/resolve/main/phei_watermark_bundle.tar.gz
然后解压运行:
tar xzf phei_watermark_bundle.tar.gz
cd phei_watermark_bundle
bash RUN.sh
Python 依赖
bundle 里只内置了 einops / einx / ijson / frozendict / vector_quantize_pytorch。
你的 Python 环境还需要安装基础依赖:
pip install torch torchaudio loguru hydra-core lightning soundfile librosa numpy
输出:
outputs/
├── clean/output_clean.wav # 不带水印
└── watermarked/output_wm.wav # 带水印 + 检测结果
控制台会打印检测结果:
Detection: detected=True, id_match=True, fused_conf=0.844
vq: detected=False conf=0.523 thr=0.7
audio: detected=True conf=0.672 thr=0.5
详细使用见解压后的 README.md。
仓库文件
| 文件 | 大小 | 说明 |
|---|---|---|
phei_watermark_bundle.tar.gz |
2.8 GB | 一键运行包(含模型 + 推理代码 + 示例 prompt) |
step_000001500.ckpt |
3.6 GB | Stage 3 水印 ckpt(裸文件,需要自行配 fish-speech 环境) |
training_config.yaml |
— | Stage 3 训练 Hydra 配置 |
stage2_config.yaml |
— | Stage 2 域适应训练配置 |
base_model_config.json |
— | 主干 (Slow+Fast Transformer) 结构 |
模型架构
- 主干: Fish-Speech 1.5 Dual-AR Transformer (Slow + Fast, 637M 参数)
- Codec: Firefly v1.5 FSQ (8 codebooks × 1000 levels, 21 Hz)
- 水印模块: 三层并行
- 语义层 — 同义 token 替换(SHA-256 派生)
- VQ 编码层 — CB6/CB7 上的 32×128 BPSK 扩频码
- 音频层 — 8-16 kHz 心理声学掩蔽下的扩频水印
检测策略:任一层置信度过阈即检出 (sem 0.6 / vq 0.7 / audio 0.5),fused 用 Noisy-OR 累积。
用自己的环境推理(不用 bundle)
git clone https://github.com/fishaudio/fish-speech # 用 v1.5 tag
cd fish-speech
# ... 加上本仓库 phei_watermark/ 下的水印模块 + Stage 3 ckpt
也可以参考解压后的 bundle 里 tools/synthesize_with_watermark.py,完全自包含。
文献
@thesis{phei2026watermark,
title={面向大规模 VQ-TTS 模型的多层水印系统设计与实现},
school={北京电子科技学院},
year={2026}
}
致谢:
- fishaudio/fish-speech — TTS 主干
- wenet-e2e/WenetSpeech — 训练数据