$ show aloshdenny/reverse-SynthID
This repository implements a comprehensive toolkit for detecting and removing Google DeepMind's SynthID watermark from AI-generated images, primarily targeting Gemini models. It provides multiple bypass versions (V1βV4) that use pure signal-processing techniquesβfrequency-domain phase scrambling, JPEG degradation, elastic deformation, VAE round-tripping, and cross-color consensus codebook subtractionβto disrupt the embedded watermark while preserving visual fidelity. The codebase includes a drag-and-drop GUI, CLI tools, batch processing scripts, and a human-in-the-loop calibration workflow. It also contains extensive watermark investigation scripts that validated the watermark's presence in over 123,000 image pairs. While primarily an application (tool for watermark removal), it has a strong research character due to its analytical components and large-scale validation studies.
The LLM identified 3 files worth highlighting for reuse:
SpectralCodebookV4 class implements a cross-color consensus method to isolate watermark carrier frequencies from image content. It builds per-model, per-resolution profiles from solid-color reference images, using phase consistency across colors to distinguish watermark signals from content-driven spectral energy. The class is self-contained with methods for extraction, saving/loading (rfft + float16/uint8 encoding), and live carrier-weight calibration. This pattern is reusable for any frequency-domain watermark detection or removal task where reference images are available.
The module contains pure-function FFT primitives (_rfft_to_full_sym, _rfft_to_full_anti, _estimate_watermark_fft_v4, _subtract_native_bins) and quality metrics (compute_psnr, compute_ssim) that are isolated, well-documented, and require no internal imports. These can be extracted into a standalone signal-processing utility library for any project involving frequency-domain image manipulation or quality assessment.
The BypassResult dataclass and the multi-stage bypass pipeline (with PSNR-gated rollback per stage) demonstrate a clean, modular pattern for applying a sequence of image transformations while ensuring quality constraints. Each stage (elastic deformation, resize-squeeze, color nudge, FFT subtraction, JPEG chain) is independently gated and can be reordered or omitted. This pattern is reusable for any image processing pipeline where quality preservation is critical.