AI Image Gradient + Frequency Inspector

Upload an image to analyze its gradient covariance (PCA on Sobel gradients) and frequency-domain power spectrum. With calibration, a tiny logistic model is fitted on your own real vs AI samples to produce an AI-likeness probability.

1 ▸ Images & Gradients

Original (scaled)
No image yet. Tap the area above to choose a photo.
Gradient Magnitude (Sobel)

Gradient pipeline: RGB → luminance (BT.709) → Sobel \(G_x,G_y\) → matrix \(M\in\mathbb{R}^{N\times 2}\) → covariance \(C = \tfrac{1}{N}(M - \bar M)^\top (M - \bar M)\) → eigenvalues \(\lambda_1 \ge \lambda_2\), anisotropy \(\rho=\lambda_1/\lambda_2\), coherence \(\kappa\).

2 ▸ AI-Likeness Probability

–.–%
waiting for image…
Idle
Real-like 50% AI-like
Gradient anisotropy ρ = λ₁ / λ₂
Real photos usually show ρ > 1 due to coherent structure. Diffusion images can lean toward ρ ≈ 1 (more isotropic gradients).
Coherence κ
κ = ((λ₁ − λ₂)/(λ₁ + λ₂))² ∈ [0,1]. Higher ⇒ gradients aligned along a main direction.
Sampled pixels
Gradients from a subsampled grid of pixels are used in the covariance (for speed).
Gradient energy E
E = λ₁ + λ₂, the total variance of gradient vectors (overall edge/texture strength).
Gradient-only heuristic
Heuristic AI probability from gradient anisotropy and coherence.
Frequency heuristic / β, η
From spectral slope β and high-frequency ratio η of the 2D power spectrum.

Detector tuning (heuristics)

ρ₀ = 1.50
β₀ = 1.70
Experimental heuristic + tiny model

By default, the tool uses handcrafted gradient & frequency heuristics. With calibration, it fits a small logistic model on your own labeled real vs AI images and uses that as the main AI-likeness probability. This is still not a forensic detector or ground truth classifier – treat it as an exploratory tool and calibrate it on the kind of images you actually care about.

3 ▸ Calibration (optional)

0 real samples
0 AI samples
Provide several real and AI images (ideally >= 10 per class) and click “Run calibration”. The tiny logistic model will learn weights on the features [ρ, κ, log₁₀E, β, η] and override the default heuristic for the main probability.