I-171Run Length Matrix Analysis

Statistical Analysisimage1975

Computes gray-level run-length matrix features for texture characterization — detects AI smoothing artifacts (Galloway, 1975).

Run Length Matrix Analysis Analysis Algorithm
This method applies Galloway's (1975) Gray Level Run Length Matrix (GLRLM) for texture-based forensic analysis:1. Run Length Encoding: For each direction θ (0°, 45°, 90°, 135°), the image is scanned to identify runs — consecutive pixels with the same gray level. The GLRLM R(i,j|θ) counts the number of runs with gray level i and length j in direction θ.2. Feature Extraction: Standard GLRLM features are computed:
- Short Run Emphasis (SRE): Measures fine texture density

- Long Run Emphasis (LRE): Quantifies coarse texture presence

- Gray Level Non-Uniformity (GLN): Measures gray level distribution uniformity

- Run Length Non-Uniformity (RLN): Quantifies run length distribution uniformity

- Run Percentage (RP): Ratio of runs to total pixel count
3. Directional Consistency Analysis: Natural images show smooth, physically motivated directional variation in GLRLM features. AI-generated images often exhibit either excessive directional uniformity (over-smoothed textures) or implausible directional discontinuities at generation boundaries.4. Higher-Order Statistics: Following Tang (1998), higher-order run length features including Low/High Gray Level Run Emphasis (LGRE/HGRE) capture subtle gray level-run length correlations that differ between natural and synthetic textures.5. Forensic Scoring: GLRLM feature vectors from image blocks are compared against natural image texture statistics. AI-generated images typically produce anomalous short-run-to-long-run ratios and unnatural gray level uniformity patterns, yielding elevated detection scores.
Analysis type: automated statistical\nScore range: 0 (authentic) to 100 (AI-generated)\nMinimum input size: varies by media type
Moderate to High — 70-85% accuracy depending on input quality and method combination.
• Research-backed methodology\n• Fast computation time\n• Complementary to other detection methods\n• Works across different AI generators
• Accuracy varies with input quality\n• Best used in combination with other methods\n• May require calibration for new AI models
Used as part of multi-signal analysis pipeline to detect AI-generated content.