Built to order

Image Forgery Detection using Error Level Analysis

An image-forensics tool that exposes spliced and copy-move forgeries using Error Level Analysis. It re-saves a JPEG at a known quality, amplifies the pixel-wise compression difference into a heatmap, and flags regions whose error signature does not match the rest of the photo; an XGBoost classifier trained on ELA statistics from the CASIA v2.0 benchmark then scores each image as authentic or tampered. Everything runs as a Python/OpenCV pipeline with a Flask demo UI for uploading photos and inspecting heatmaps. Suitable for B.E./B.Tech final-year projects in Computer Science, AI/ML and

Image Forgery Detection using Error Level Analysis - project prototype demo screenshot
More project photos (2)

The problem

Doctored photos travel faster than the truth: a spliced image can mislead thousands before anyone checks whether it is genuine. Journalists, fact-checkers and curious users need a practical way to inspect a suspicious JPEG — more rigorous than gut feeling but simpler than professional forensic software. Error level analysis fills that gap: each time a JPEG is saved, the whole image shares one compression history, but a region pasted from another photo usually carries a different one. Recompress at a known quality, measure the pixel-wise difference, and the pasted region lights up against the background. This project builds an ELA-based forgery analyzer on that principle — adjustable recompression quality, colorized heatmaps, connected-region detection and a confidence panel — evaluated honestly on the public CASIA v2 dataset. Its limits are part of the story: the project teaches exactly when ELA works, when it fails, and why it can never be called proof.

How it works

  1. The uploaded JPEG is recompressed at a controlled quality setting and the pixel-wise difference (the error level) is computed.
  2. The error map is amplified and colorized into an ELA heatmap, making recompression inconsistencies visible to the eye.
  3. Connected-component analysis isolates regions whose error level deviates sharply from the image background.
  4. Per-region statistics — mean error, size, deviation — feed a scoring rule that ranks regions by suspicion.
  5. The demo app presents the original photo, the ELA heatmap and the flagged regions with their confidence scores.
  6. The evaluation script runs the pipeline over CASIA v2 manipulated images and computes detection accuracy and false-positive rate during your build.

Tech stack:

  • Python 3.10 (core ELA pipeline and analysis scripts)
  • Pillow (JPEG recompression and error computation)
  • OpenCV (heatmap rendering, connected components, overlays)
  • NumPy (error statistics and region scoring)
  • CASIA v2 dataset (public manipulated-image evaluation set)
  • pandas (batch summary reports)
  • Matplotlib (error distributions and evaluation plots)
  • Streamlit demo app (photo upload, ELA heatmap, confidence panel)
Parameter Value
Method JPEG error level analysis with recompression-error region scoring
Training-free Classical pipeline — no model weights; thresholds tuned on CASIA v2
Design target Target ~80%+ detection accuracy on CASIA v2 manipulated images — accuracy and false-positive rate are computed by the evaluation script during your build
Input JPEG photographs with compression history
Output ELA heatmap, flagged suspicious regions, confidence panel, batch CSV report

Project features

  • Genuine ELA heatmap generator: re-saves any JPEG at a configurable quality and renders the amplified pixel-wise difference as a forensic heatmap
  • Adjustable analysis controls — re-save quality (70–98) and amplification factor — so the report can demonstrate how parameter choice affects visibility
  • Block-level statistical feature extraction: error histograms, block variance and edge-density features computed over the ELA map
  • XGBoost classifier trained on ELA feature vectors from the CASIA v2.0 benchmark, separating authentic from tampered images
  • Batch folder scanning that processes whole image sets and writes a per-image tamper-score CSV report
  • Flask demo UI with drag-and-drop upload, side-by-side original/ELA comparison and an adjustable tamper-score meter
  • Evaluation notebook computing precision, recall, F1-score and ROC-AUC on your CASIA v2.0 split, with heatmap galleries of correct and missed cases

What is included

  • Complete source code (ELA generator, feature extraction, classifier training, batch scanner, demo app)
  • Jupyter training and evaluation notebook (buyer-run procedure: prepare CASIA v2.0 split, train, evaluate)
  • Project report PDF (forensics background, ELA theory, methodology, evaluation, error analysis)
  • PPT presentation for final review
  • Viva Q&A preparation document (JPEG compression, DCT blocks, ELA interpretation, XGBoost, CASIA)
  • Setup guide (environment, dataset download, running your own analyses)

Limitations & prerequisites

  • ELA only works on JPEGs: PNGs, screenshots and repeatedly recompressed images have no usable compression history, and the report states this plainly.
  • Spliced regions saved at the same quality as the host photo can be invisible to ELA — the method detects inconsistencies, not manipulation itself.
  • This is an analysis aid, NOT forensic evidence: it never substitutes for expert examination and must never be used to support legal claims.

Frequently Asked Questions

What is error level analysis?

Recompress a JPEG at a known quality and measure the pixel-wise difference: regions with different compression histories — usually pasted content — show up brighter than the background.

Why does it fail on PNGs?

PNG is lossless, so there is no compression-history signal for ELA to read; the error map comes out uniform.

How is it evaluated?

The evaluation script runs the pipeline over the CASIA v2 manipulated-image set and computes detection accuracy and false-positive rate during your build.

Can it detect AI-generated faces or deepfakes?

No. It detects JPEG recompression inconsistencies, not synthetic imagery — a freshly generated JPEG needs different detectors, and the report states this boundary.

Can I analyze my own photos?

Yes — the demo app accepts any JPEG. Treat the output as an advisory visualization, not proof of forgery.

What accuracy does it reach?

The design target is ~80%+ on CASIA v2 manipulated images; the honest figure is the one your evaluation run produces. Suitable for B.E./B.Tech final-year projects in Computer Science, AI/ML and Data Science.

Components & software requirements
  • Python 3.10 (core ELA pipeline and analysis scripts)
  • Pillow (JPEG recompression and error computation)
  • OpenCV (heatmap rendering, connected components, overlays)
  • NumPy (error statistics and region scoring)
  • CASIA v2 dataset (public manipulated-image evaluation set)
  • pandas (batch summary reports)
  • Matplotlib (error distributions and evaluation plots)
  • Streamlit demo app (photo upload, ELA heatmap, confidence panel)
Delivery information

Built-to-order project. Delivery timeline is shared after order confirmation based on current queue.

Support terms

Complete documentation, setup guide, and viva preparation included. Support for setup and explanation provided.

Download abstract (PDF)

Related guides

All guides
Illustration of object tracking showing video frames with bounding boxes and persistent ID labels following people and vehicles, comparing motion prediction and appearance matching.B.E./B.Tech Computer Science and Electronics students building video analytics projects — people counting, vehicle tracking, sports analysis — who have detection working and need

Object Tracking: DeepSORT and ByteTrack Explained

Detection finds objects per frame; tracking keeps their identities across frames. This guide explains tracking-by-detection, Kalman motion models, DeepSORT's appearance embeddings vs ByteTrack's low-confidence box recovery, tracking metrics (HOTA, IDF1, ID switches), and the tuning parameters that determine real-world quality.

Read guide
Illustration of image segmentation showing U-Net's U-shaped encoder-decoder with skip connections producing pixel masks, alongside Mask R-CNN detecting instances with masks.B.E./B.Tech Computer Science and AI/ML students moving from image classification or detection to pixel-level understanding — medical imaging, defect detection, autonomous driving

Image Segmentation: U-Net and Mask R-CNN

When projects need pixel-level answers, segmentation delivers. This guide explains semantic vs instance vs panoptic segmentation, U-Net's encoder-decoder with skip connections, Mask R-CNN's parallel mask head, Dice and IoU evaluation, paired augmentation, and how to choose the right architecture for your data and question.

Read guide
Illustration of Whisper speech-to-text showing sound waves flowing into a neural network and emerging as transcribed text with timestamps and speaker labels.B.E./B.Tech Computer Science and AI/ML students adding speech-to-text to projects — voice assistants, meeting transcription, accessibility tools

Whisper for Speech-to-Text in Student Projects

Whisper transcribes speech in dozens of languages with no training required. This guide covers how it works, choosing among model sizes, running it locally with faster-whisper, handling hour-long audio, timestamps and speaker diarization, multilingual quirks, and honest evaluation with word error rate.

Read guide
Get a quotation