The Digital Image Forensics Dashboard is an advanced MATLAB-based system designed to authenticate digital images and detect malicious tampering. In an era of Deepfakes and AI-generated content, the ability to blindly detect image manipulations—such as splicing, copy-move forgery, and retouching—is critical for digital security, journalism, and legal forensics.
This project implements a "Defense-in-Depth" strategy, moving beyond single-algorithm detection to a robust Evidence Fusion Framework. By running five distinct passive forensic algorithms in parallel and synthesizing their results, this tool minimizes false positives and provides a high-confidence verdict on image integrity.
- Multi-Modal Analysis: Simultaneously analyzes compression artifacts, sensor noise fingerprints, edge gradients, and pixel block correlations.
- Evidence Fusion Engine: A novel weighted voting algorithm combines normalized outputs from all five detectors to generate a single "Combined Suspicion Map".
-
Automated Reporting: Generates a unified
$3 \times 4$ forensic dashboard visualizing every stage of analysis. -
Object-Oriented Architecture: Built on a modular
ImageTamperingDetectorclass, ensuring scalability and ease of integration. - Blind Detection: Requires no prior knowledge of the source camera or the original image to function effectively.
The core of the system lies in its ability to detect the "invisible scars" left by image manipulation. The following five forensic techniques are implemented:
- Forensic Principle: JPEG compression is lossy. When an image is resaved, valid pixels degrade at a known rate. Spliced regions, originating from a different source with a unique compression history, will degrade at a different rate (or "glow") when subjected to recompression.
-
Implementation Details:
- The image is resaved at 95% quality.
- The absolute pixel difference is computed:
$ELA = |Original - Resaved|$ . - Gamma Correction and Adaptive Histogram Equalization (CLAHE) are applied to the difference map to visualize subtle error residuals invisible to the naked eye.
- Forensic Principle: Every camera sensor imparts a unique, high-frequency noise pattern known as Photo-Response Non-Uniformity (PRNU). When an object is pasted from a different image, it carries a foreign noise fingerprint.
-
Implementation Details:
- A Wiener Filter is applied to estimate the "true" underlying image signal.
- The "Noise Residual" is extracted by subtracting the filtered image from the original.
-
K-Means Clustering (
$k=2$ or$k=3$ ) is deployed to segment the noise map, automatically isolating regions with statistically anomalous noise variance.
-
Forensic Principle: The JPEG standard processes images in non-overlapping
$8 \times 8$ pixel blocks. Manipulation operations like resizing, rotation, or splicing disrupt this rigid grid alignment. -
Implementation Details:
- The image is converted to the YCbCr color space to isolate the Luminance (Y) channel.
-
Block Processing (
blockproc) is used to compute the local Standard Deviation (std2) for every$8 \times 8$ block. - Discontinuities in block statistics reveal "ghost grids" or disjointed regions indicative of tampering.
- Forensic Principle: Artificial composites often exhibit edges that are unnatural compared to the global scene—either too sharp (due to hard cropping) or too blurry (due to feathering/smoothing).
-
Implementation Details:
- Edges are detected using a robust combination of Canny, Sobel, and Prewitt operators.
- The gradient magnitude is computed for every edge pixel using
imgradientxy. - Edges with magnitudes deviating more than
$2\sigma$ (standard deviations) from the median edge strength are flagged as suspicious outliers.
- Forensic Principle: A common forgery technique involves "cloning" a region of an image to hide an object or duplicate a crowd. This results in two identical regions within the same image.
-
Implementation Details:
- The image is divided into overlapping
$16 \times 16$ blocks. - Discrete Cosine Transform (DCT) coefficients are extracted for each block to create robust feature vectors.
- A Correlation Matrix is computed to find pairs of blocks with a correlation coefficient
$>0.95$ . - To filter out false positives (like flat sky areas), only pairs separated by a minimum Euclidean distance are flagged.
- The image is divided into overlapping
Ensure you have MATLAB (R2021a or newer) installed with the following toolboxes:
- Image Processing Toolbox™ (Required for
edge,blockproc,wiener2) - Statistics and Machine Learning Toolbox™ (Required for
kmeans)
-
Clone the Repository:
git clone [https://github.com/moonsandsk/Image-Forensics.git](https://github.com/moonsandsk/Image-Forensics.git) cd Image-Forensics -
Prepare Your Data:
- Place your suspect images (JPG, PNG, TIFF) into the
Data/folder. - (Optional): Use the provided sample images like
lion[1].jpgorbird_output.jpg.
- Place your suspect images (JPG, PNG, TIFF) into the
-
Run the Analysis:
- Open
run.min MATLAB. - Edit the
imageNamevariable to match your target image:imageName = 'my_suspect_image.jpg';
- Click Run or press F5.
- Open
The tool generates a comprehensive report saved automatically to the Outputs/ folder. Below is an example of the generated dashboard:
| Forensic Map | Interpretation Guide |
|---|---|
| ELA Enhanced | Bright, glowing regions indicate a compression anomaly. A genuine image should appear uniformly dark. |
| Noise Map | Solid, coherent shapes in the noise field are suspicious. Genuine sensor noise should look like random "salt-and-pepper" static. |
| JPEG Artifacts | Blocky islands that do not match the texture of the rest of the image suggest a grid misalignment caused by splicing. |
| Suspicious Edges | This map only displays edges that are statistically abnormal. If it clearly outlines an object, that object was likely pasted. |
| Copy-Move Map | White patches indicate confirmed cloned regions. This is a definitive sign of tampering. |
| Tampering Overlay | The Final Verdict. A red semi-transparent mask overlays the high-confidence tampered regions, synthesized from all 5 tests. |
This tool has been rigorously tested and validated on:
- CASIA 2.0 Image Tampering Detection Dataset: A benchmark dataset containing thousands of realistic spliced and copy-moved images.
- Custom Synthetic Dataset: Created manually using Adobe Photoshop and GIMP to simulate challenging scenarios, such as:
- Inserting objects into complex textured backgrounds.
- Cloning elements to hide distinct features.
While highly effective, the current implementation has specific constraints:
-
Computational Cost: The block-based Copy-Move algorithm has a time complexity of
$O(n^2)$ , making it slower for 4K+ resolution images.-
Future Work: Implement SIFT/SURF keypoint matching to reduce complexity to
$O(n \log n)$ .
-
Future Work: Implement SIFT/SURF keypoint matching to reduce complexity to
-
Uncompressed Sources: ELA and Artifact detection rely heavily on JPEG compression traces. Their efficacy is reduced on pristine RAW or TIFF images.
- Future Work: Integration of a Convolutional Neural Network (CNN) trained on noise residuals to detect manipulation in uncompressed media.
Developed by: Aditi Chandra & Abheeshta V Aradhya
