M3 β€” Image Forgery Detection (ELA + ResNet50 fusion)

Binary classifier that flags tampered images. Two-branch Keras model:

  • ELA branch β€” 3-block CNN over an Error Level Analysis map (JPEG quality 90, brightness scale 15).
  • RGB branch β€” frozen ImageNet ResNet50 backbone.
  • Branches are concatenated β†’ Dense(256) β†’ Dropout(0.5) β†’ sigmoid.

Output is the probability the image is forged (label 1); threshold 0.5.

Inputs

Two tensors in order [rgb, ela], each (224, 224, 3), float32 normalized to [0, 1] (no ResNet preprocess_input). See the Space's app.py for the exact preprocessing.

Usage

from huggingface_hub import hf_hub_download
import tensorflow as tf

path = hf_hub_download("salmanzaman777/image-forgery-m3", "M3_best.keras", revision="v1")
model = tf.keras.models.load_model(path)
prob = model.predict([rgb, ela])[0][0]   # >0.5 => forged

Training data

CASIA v2 (authentic + tampered), 70/15/15 stratified split, class-weighted loss.

Limitations

Research demo, not a forensic tool. Trained on CASIA v2 artifacts; performance degrades on out-of-distribution sources, heavy re-compression, or screenshots.

Downloads last month
147
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Space using salmanzaman777/image-forgery-m3 1