Skip to content

Repository files navigation

🖼️ MDIF: A Multi-Domain Inconsistency Framework for Image Forgery Detection

Image Proc


Paper

The paper describing MDIF is available in the paper directory.


Architecture

The architecture for MDIF is shown in the below flowchart

flowchart LR
    A[Image Input]

    subgraph Stream-A [Stream A]
        B[MobileNetV3-Small] --> C[576D Spatial<br>Feature Vector]
    end

    subgraph Stream-B [Stream B]
        D[Signal Processing<br>using DCT + DFT] --> E[192D Spectral<br>Feature Vector]
    end

    subgraph Stream-C [Stream C]
        F[Extract Depth Features<br>using Sobel Operator] --> G[Train MiDaS 3.0] --> H[9D Depth<br>Feature Vector]
    end

    A --> B
    A --> D
    A --> F

    C --> I[777D Concatenated<br>Vector]
    E --> I
    H --> I

    I --> J[3 Layer MLP]

    J --> Classes

    subgraph Classes
        K[Authentic<br>Photograph]
        L[Fully<br>AI-Generated]
        M[Partially<br>AI-Inpainted]
    end

    style Stream-A fill:#e1f5fe,stroke:#03a9f4,stroke-width:2px,color:#000
    style Stream-B fill:#e8f5e9,stroke:#4caf50,stroke-width:2px,color:#000
    style Stream-C fill:#fff3e0,stroke:#ff9800,stroke-width:2px,color:#000
Loading

Datasets Used

Note

Refer to the readme in the data/* directory for how to set up the datasets!

Dataset Type
CIFAKE Generated Images
Unbiased Tiny GenImage Generated Images
AutoSplice Inpainted Images
CocoGlide Inpainted Images
SAGI Inpainted Images

Getting Started

Firstly, clone this repo,

git clone https://github.com/joejo-joestar/MDIF.git
cd MDIF

Then install Miniconda from the Anaconda Website.

Note

The notebooks running locally assumes you are using a conda environment!

Then open a command prompt, and run the following. This will create and activate a python 3.11 environment called mdif. The environment.yml will be used to create the environment and install all needed dependencies.

conda env create
conda activate mdif

After running this, your CMD prompt should have a "(mdif)" prefixed at the start.

Then install the mdif/* directory as an editable package

pip install -e .

And now you can check out the mdif.ipynb notebook to see how the framework works!

Tip

To deactivate the environment, simply run:

conda deactivate

To remove the environment completely, run:

conda env remove -n mdif

Note

Remember to select mdif as the kernel for all the notebooks!


Acknowledgments

This work is builds on and uses Intel ISL's MiDaS and Qualcomm's MobileNet V3 Small model.

The framework has been fine-tuned and trained on the AutoSplice, CIFAKE, CocoGlide, and Unbiased Tiny GenImage datasets.

The sample image app/sample/flower_real is a photo by joejo joestar on Unsplash and the app/sample/flower_gen was generated using Google's Nano Banana (Gemini 2.5 Flash Image)

Note

This repo also includes the isl-org/MIDAS repository to help speed up the deployed streamlit app!


Authors

ID No. Name
2022A7PS0019U Joseph Cijo
2022A7PS0077U Adithya Sunoj
2022A7PS0140U Akamksha Ranil

About

🖼 A Multi-Domain Inconsistency Framework proposed for our Image Processing course (CS F311)

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages