Skip to content
04 / Texture Forensics / classical image forensics / case study

Yor AI vs. Real Image Detector

A classical computer-vision study that uses LBP and GLCM texture features with an SVM to classify AI-generated versus real imagery.

My role
Applied ML study · evaluation
Status
Evaluated study · public inference demo
Period
2026
Stack
Python · OpenCV · LBP · GLCM · RBF SVM
Visual introduction / artworkNot a live product capture

01 /Overview.

Synthetic-image cues change quickly, so a useful study must expose not just a headline score but also the feature representation and evaluation boundary.

Why it matters. Image-forensics results are easy to overstate when a small holdout is presented as a universal detector. Keeping the representation and split visible lets another engineer challenge the result.

Workflow. Images are converted to grayscale and resized, texture descriptors are extracted, and an RBF SVM produces a verdict within the fixed evaluation boundary.

Outcome. 78.5% accuracy on the repository's specific 107-image holdout.

02 /My contribution.

I built the interpretable preprocessing, texture-feature, classifier, and evaluation path represented by the repository, while keeping the result bounded to its documented holdout.

Constraints.

  • The reported result belongs to a specific 107-image holdout.
  • Texture features favor interpretability over end-to-end capacity.
  • The browser walkthrough cannot substitute for a fresh evaluation.

03 /System architecture.

Grayscale / resize
LBP + GLCM extraction
17-value feature vector
Scaler + RBF SVM
107-image holdout

04 /Technical implementation.

Primary technologies. Python · OpenCV · LBP · GLCM · RBF SVM

  • Inputs are grayscale-converted and resized to 224 × 224 before feature extraction.
  • LBP and GLCM features form the documented 17-value representation.
  • A scaler and RBF SVM carry the feature vector through inference and evaluation.

Hardest engineering problem. The methodology had to keep the dataset boundary beside the score. A higher headline number would be less useful if the split or feature path could not be reproduced.

01

Use interpretable texture families

LBP and GLCM make the feature story inspectable instead of hiding every decision inside an opaque end-to-end model.

02

Keep context beside the score

The 78.5% result is always paired with the 107-image holdout boundary.

03

Precompute browser examples

The portfolio reveals fixed feature views without uploading visitor images or invoking an inference service.

05 /Testing and validation.

  • The repository evaluation uses a deterministic stratified 80/20 split with `random_state=42`.
  • The supported sample boundary is 533 images: 426 training examples and a 107-image holdout.
  • The portfolio does not present its explanatory interaction as a live inference endpoint.

06 /Results and evidence.

The public URL runs the repository's Flask entrypoint with its checked-in SVM and scaler artifacts. The 78.5% result belongs to the repository's deterministic stratified 80/20 holdout with `random_state=42`; it is not a universal AI-image-detection accuracy claim.

  • 78.5% accuracy on the documented 107-image holdout.
  • The result is paired with the feature method, split boundary, and limitations so it can be evaluated honestly.
Holdout accuracy
78.5%107-image holdout; repository-stated evaluation
Feature representation
17 valuesLBP + GLCM texture features
Deterministic explanation / no external calls

Interactive system view.

LBP feature view selected. The portfolio walkthrough is explanatory, not live inference.

The shared machine world follows this project. This panel remains complete without graphics.

07 /Limitations.

  • The holdout is small relative to the breadth of image generators and styles.
  • No claim of robustness to unseen generators, manipulation, or distribution shift.
  • The portfolio interaction is explanatory, not live inference.
  • The public Vercel surface is a bounded demo, not an operational detection service or a universal authenticity guarantee.

08 /What I would build next.

Publish the dataset manifest, class balance, fixed seed, confusion matrix, and a fresh held-out evaluation before comparing against newer generators.

  • A metric without its dataset boundary is decoration.
  • Classical features can be valuable when interpretability is part of the product story.