A deep learning and computer vision research tool designed to extract, visualize, and analyze hidden imperceptible watermarks (specifically targeting Google's SynthID) embedded in AI-generated images.
This project provides both a Python/Flask backend utilizing scientific computing libraries (SciPy, PyWavelets) and a Client-Side (OpenCV.js) implementation for rapid browser-based analysis.
SynthID and similar invisible watermarking technologies embed data within the high-frequency components of an image. This tool reverse-engineers the visual traces of these watermarks using a three-step forensic pipeline:
- Noise Extraction (High-Pass Filtering): - Python: Utilizes Discrete Wavelet Transform (
db4wavelets viaPyWavelets) to separate the low-frequency structural image data from the high-frequency residual noise.- JavaScript: Uses a Difference of Gaussians (DoG) approximation to isolate the noise layer.
- Residual Amplification: The extracted noise is heavily amplified (e.g., 50x) to make the imperceptible pixel variations visible to the human eye, often revealing grid-like or wave patterns.
- Frequency Domain Analysis (FFT): A Fast Fourier Transform (FFT) converts the spatial noise map into a frequency spectrum. By shifting the DC component to the center and applying a logarithmic scale, the tool reveals "star patterns" or bright dots.
- Pattern Matching: The tool overlays known "secret" carrier frequencies (derived from research) onto the FFT spectrum. If the bright spots in the frequency domain align exactly with these targeted coordinates, it indicates a high probability of SynthID presence.
The repository contains two distinct implementations:
A robust server-side application for deep analysis.
app.py: The Flask web server handling uploads and routing.analysis_engine.py: The core scientific pipeline performing wavelet denoising and FFT generation.requirements.txt: Python dependencies.templates/&static/: Frontend UI and storage for generated analysis maps.
A lightweight, browser-only tool leveraging OpenCV.js.
index.html: The UI for the client-side tool.js/visualizer.js: Handles image processing, FFT, and canvas rendering entirely in the browser.assets/carriers.json: The coordinate map of known SynthID carrier frequencies.
- Clone the repository and navigate to the project directory.
- Install the required dependencies:
pip install -r requirements.txt(Requires: Flask, numpy, opencv-python, scipy, PyWavelets, matplotlib)
- Start the Flask server:
python app.py
- Open your browser and navigate to
http://127.0.0.1:5000/. Upload an image to see the noise residual and frequency fingerprint.
- Navigate to the
SynthID-Visualizerdirectory. - Serve the directory using any local web server to avoid CORS issues with the local JSON file. For example:
python -m http.server 8000
- Open
http://localhost:8000/index.htmlin your browser.
When an image is analyzed, you will see two primary outputs:
- Extracted Noise: A static-like image. Look for repeating diagonal or grid-like textures hidden within the noise.
- Frequency Fingerprint: A heatmap of the frequency domain.
- Look for the Green Circles (the known carrier frequencies).
- If bright white/yellow dots appear perfectly centered inside these green circles, the image exhibits the signature of a Gemini/SynthID watermark.
This is an educational research tool designed to demonstrate computer vision and signal processing techniques. It relies on approximated client-side and open-source methods to visualize frequency patterns and is not an official Google SynthID decoding tool.