I-127Luma Gradient Angle
Analyzes luminance gradient angle distribution
Algorithm / Model
Luma Gradient Angle — Pixel-Level Spatial Analysis
How it works
This method analyzes luminance gradient angles for image forensic analysis following the rich model framework of Fridrich & Kodovsky (2012):1. Gradient Computation: The luminance gradient vector is computed at each pixel using finite differences or Sobel operators: (∂I/∂x, ∂I/∂y). The gradient angle θ = arctan(∂I/∂y / ∂I/∂x) captures the local edge orientation.2. Gradient Angle Statistics: The distribution of gradient angles across the image is analyzed. Natural images show characteristic angle distributions shaped by scene content. The method extracts statistical features from the gradient angle histogram — moments, entropy, and directional energy ratios.3. Local Gradient Angle Patterns: Co-occurrence patterns of gradient angles between neighboring pixels are analyzed, similar to the rich model approach. Natural images show specific gradient angle co-occurrence patterns arising from smooth edge curves and continuous surfaces. AI artifacts disrupt these patterns.4. Gradient Angle Consistency: The spatial consistency of gradient angles along edges is checked. Real edges show gradually varying gradient angles (smooth contours). AI-generated images may show abrupt angle changes along edges or gradient angle patterns inconsistent with the expected camera imaging pipeline.5. Forensic Score from Gradient Features: The gradient angle features (histogram statistics, co-occurrence patterns, consistency measures) are combined into a forensic score. Features are evaluated against models trained on natural vs. AI-generated images, following the rich model steganalysis framework adapted for AI detection.
Technical Parameters
Analysis type: pixel
Media: image
Input: Raw pixel data / image file
Output: Confidence score (0-100)
Processing: Client-side Canvas API
Color spaces: RGB, Grayscale as applicable
Media: image
Input: Raw pixel data / image file
Output: Confidence score (0-100)
Processing: Client-side Canvas API
Color spaces: RGB, Grayscale as applicable
Accuracy & Reliability
Moderate to High — 70-90% standalone accuracy. Performance is highest on uncompressed images and may decrease with heavy JPEG compression or social media re-encoding.
Strengths
• Fast client-side processing using Canvas API
• Effective at detecting specific AI generation artifacts
• Works with common image formats (JPEG, PNG, WebP)
• Can be combined with complementary analysis methods
• Based on established image forensics research
• Effective at detecting specific AI generation artifacts
• Works with common image formats (JPEG, PNG, WebP)
• Can be combined with complementary analysis methods
• Based on established image forensics research
Limitations
• Performance may vary with image compression level
• Social media re-encoding can affect accuracy
• Best used in combination with other forensic methods
• May produce false positives on heavily processed authentic images
• Effectiveness depends on the AI generation model used
• Social media re-encoding can affect accuracy
• Best used in combination with other forensic methods
• May produce false positives on heavily processed authentic images
• Effectiveness depends on the AI generation model used
Use Case
Detection of AI-generated or manipulated images through luma gradient angle analysis. This method identifies patterns and artifacts that are characteristic of AI generation, contributing to a comprehensive image forensic analysis.