πΌοΈ Image Forgery Detection Model
license: mit pipeline_tag: image-classification library_name: tensorflow tags: - image-forgery-detection - ai-generated-images - deepfake-detection - fake-image-detection - image-forensics - computer-vision - mobilenetv2 - tensorflow - keras
π΅οΈ AI Image Forgery Detector (Real vs Fake)
This model detects whether an image is REAL (camera-captured) or FAKE (AI-generated / manipulated).
It is a fine-tuned MobileNetV2 model trained using TensorFlow/Keras, designed for AI image forgery detection, including synthetic and deepfake-style images.
π What This Model Can Do
β Detect AI-generated images
β Detect manipulated or synthetic content
β Works on faces, objects, landscapes, and artworks
β Outputs prediction + confidence score
Class Labels
- 0 β Fake
- 1 β Real
π§ Model Architecture
- Base model: MobileNetV2 (ImageNet pretrained)
- Framework: TensorFlow / Keras
- Input size: 224 Γ 224 RGB image
- Output: Sigmoid probability
- Task: Binary image classification
Additional layers:
- Global Average Pooling
- Dense (ReLU)
- Dropout (regularization)
- Sigmoid output layer
π Evaluation Results
The model was evaluated using accuracy, precision, recall, and F1-score, with threshold optimization based on macro F1-score to handle class imbalance.
Best Validation Results
- Accuracy: ~87%
- Fake class: High precision
- Real class: High recall
- Threshold: Optimized (~0.65)
Results may vary depending on image quality and source.
πΌοΈ Example Predictions
β Real Image (Correct Classification)
Prediction: REAL
Confidence: High
β AI-Generated Image (Correct Classification)
Prediction: FAKE
Confidence: High
π How to Use This Model
import tensorflow as tf
import numpy as np
from PIL import Image
IMG_SIZE = 224
# Load model
model = tf.keras.models.load_model("forgery_model.keras")
# Load and preprocess image
img = Image.open("test.jpg").convert("RGB")
img = img.resize((IMG_SIZE, IMG_SIZE))
img = np.array(img) / 255.0
img = np.expand_dims(img, axis=0)
# Predict
probability = model.predict(img)[0][0]
label = "REAL" if probability > 0.65 else "FAKE"
print("Prediction:", label)
print("Confidence:", probability)
π― Intended Use
This model is suitable for:
AI-generated image detection
Image forgery analysis
Academic projects
Research and experimentation
Educational demonstrations
β Not recommended for legal, forensic, or high-risk decision-making systems.
β οΈ Limitations
Extremely realistic AI images may still fool the model
Performance can drop on:
Heavy compression
Very low resolution
Extreme image edits
Model predictions are probabilistic, not absolute truth
Always validate outputs before real-world use.
π§ͺ Training Details
Base: MobileNetV2 (ImageNet weights)
Optimizer: Adam (low learning rate)
Loss: Binary Crossentropy
Data augmentation applied
Class imbalance handled using class weights
Threshold tuning performed after training
π§ Ethical Considerations
Predictions can be incorrect
False positives / negatives are possible
Use responsibly and transparently
Do not rely solely on this model for critical decisions
π License
This model is released under the MIT License.
π€ Author
Kumaran
Hugging Face: kumaran-0188
Built as part of an AI image forgery detection project using TensorFlow.
π Acknowledgements
TensorFlow & Keras
MobileNetV2
AI-generated image datasets (CIFAKE-style)
Hugging Face ecosystem
- Downloads last month
- 32
Inference Providers NEW
This model isn't deployed by any Inference Provider. π Ask for provider support

