Skip to content

Add visible watermark detection & upgrade invisible watermark confidence#17

Merged
MatrixA merged 2 commits intomainfrom
MatrixA/dreamina-watermark-detect
Mar 13, 2026
Merged

Add visible watermark detection & upgrade invisible watermark confidence#17
MatrixA merged 2 commits intomainfrom
MatrixA/dreamina-watermark-detect

Conversation

@MatrixA
Copy link
Owner

@MatrixA MatrixA commented Mar 13, 2026

Summary

Implement visible watermark detection for images with AI disclosure badges (e.g., Dreamina's "AI生成") and upgrade invisible watermark confidence from LOW to MEDIUM for exceptionally strong signals or complete indicator sets.

Changes

  • New detector module (src/detector/visible_watermark.rs): Analyzes image corners for bright text overlays characteristic of Chinese AI tools. Uses luminance clustering, horizontal run-length analysis, and bimodal distribution checks. Reports MEDIUM confidence for known AI positions (top-left, bottom-right) with 3+ indicators, LOW otherwise.
  • Enhanced invisible watermark confidence (src/detector/watermark.rs): Introduces "exceptionally strong" thresholds (bit agreement > 0.90, energy spread > 1.0). Confidence escalates to MEDIUM when all 3 indicators fire OR when 2 indicators with exceptionally strong values fire. Video frames now pass through actual confidence instead of hardcoded LOW.
  • Integration (src/detector/mod.rs): Visible watermark detector runs in deep mode alongside invisible watermark analysis for both images and video frames.
  • Tool recognition (src/known_tools.rs): Added "dreamina" to AI tool patterns (complements existing "jimeng"/"即梦").
  • Internationalization (all 7 locale files): Added signal descriptions for visible watermark badges and generic overlays.
  • Tests (tests/watermark_detection.rs): 3 new integration tests validate visible watermark detection, preventing false positives on clean and invisible-watermarked images.

Results

Content Before After
Dreamina image LOW (invisible only) MEDIUM (both watermarks)
Sora video LOW (2/3 indicators) MEDIUM (exceptionally strong)
Clean images No signals No signals ✓

Checklist

  • cargo fmt -- --check passes
  • cargo clippy -- -D warnings passes
  • cargo test passes (67/67 tests)
  • New detection methods include appropriate confidence tiers
  • i18n documentation complete (7 languages)

🤖 Generated with Claude Code

MatrixA and others added 2 commits March 13, 2026 12:51
…dence

Implement two key improvements:
1. Visible watermark detection: New detector analyzes image corners for bright text overlays characteristic of Chinese AI disclosure badges (e.g., "AI生成" on Dreamina images). Uses luminance clustering and text-run analysis to identify watermarks with MEDIUM confidence for known AI positions.
2. Invisible watermark confidence upgrade: Invisible watermark signals now report MEDIUM confidence when indicators are exceptionally strong (bit agreement > 0.90, energy spread > 1.0) or when all 3 indicators fire, instead of always reporting LOW confidence.

Changes:
- New module: src/detector/visible_watermark.rs (bottom-up text detection via corner region analysis)
- Enhanced: src/detector/watermark.rs (confidence escalation logic, video frame confidence passthrough)
- Enhanced: src/detector/mod.rs (integration of visible watermark detection)
- Enhanced: src/known_tools.rs (added "dreamina" pattern)
- Added: i18n strings in all 7 locale files
- Added: 3 integration tests for visible watermark detection
- Added: test fixture (Dreamina image with visible watermarks)

Results:
- Dreamina image: LOW → MEDIUM (now detects both invisible + visible watermarks)
- Sora video: LOW → MEDIUM (exceptionally strong invisible watermark signals)
- No false positives on clean images

All 67 tests passing.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@MatrixA MatrixA merged commit 604cc97 into main Mar 13, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant