Skip to content

deepbrainscu/ImageManipulation

Repository files navigation

DOI

Metaheuristic-Driven Optimization of Ensemble Deep Learning Model for Image Manipulation Classification

📌 Description

This repository provides the implementation of deep learning models for multi-manipulation classification in digital images.
The framework leverages SE-ResNet50, SE-DenseNet121, SE-InceptionV3, and ViT-Base/32 architectures to detect various preprocessing manipulations applied to images.
Models were trained from scratch (no transfer learning) and evaluated on three benchmark datasets.


📂 Dataset Information

This study utilized three benchmark datasets to evaluate the proposed method under diverse image formats and compression characteristics:

📏 Preprocessing

  • All images were resized to 512×512.
  • Split: 70% training / 20% testing / 10% validation.

⚙️ Manipulation Classes

To generate the manipulated image classes, preprocessing operations were applied with MATLAB:

🔹 Compressed-only image class

Double JPEG compression:

  • QF1 ∈ {85, 86, …, 97, 98} (random)
  • QF2 ∈ {75, 85, 95} (fixed)

🔹 Intensity-adjustment class

Gamma correction and histogram equalization:

imadjust(I, [low high] = stretchlim(I, 2/100), [], gamma=0.8)
imadjust(I, [low high] = stretchlim(I, 6/100), [], gamma=1.2)
histeq(I)

🔹 Low-pass class

Gaussian and average filtering:

imfilter(I, fspecial('gaussian', 3, 1), 'symmetric')
imfilter(I, fspecial('gaussian', 5, 1.5), 'symmetric')
imfilter(I, fspecial('average', 3), 'symmetric')

🔹 High-pass class

Sharpening filters:

imfilter(I, fspecial('unsharp', 0.5), 'symmetric')
imsharpen(I, 'Radius', 1.5, 'Amount', 2)
imsharpen(I, 'Radius', 2, 'Amount', 2)

🔹 Denoising class

Wiener and wavelet filtering:

wiener2(I, [3 3])
wiener2(I, [5 5])
wdencmp('gbl', I, 'db12', 2, 8, 'h', 'one')

🚀 Usage Instructions

Clone the repository:

git clone https://github.com/deepbrainscu/ImageManipulation.git
cd ImageManipulation

Install dependencies:

pip install -r requirements.txt

Prepare datasets (download from links above, preprocess as described).

Train a model:

python im_history.py

📥 Model Weights

Pretrained model weights can be downloaded from the following link:
👉 Download Weights (Google Drive)

Place the downloaded .h5 files in the weights/ directory or specify their path when running evaluation: Evaluate:

python predict_genetic_ucid.py --image "D:\\Imhistory\\ImageHistory\\Datasets\\UCID\\Test\\QF=75\\Adjustment\\3_uniformT75_adj1.jpg" --qf 75

📦 Requirements

  • Python 3.9+
  • TensorFlow 2.9+
  • NumPy
  • OpenCV
  • scikit-learn
  • Matplotlib

🧪 Methodology

  1. Preprocessing and manipulation of datasets using MATLAB functions.
  2. Training deep learning models from scratch (no transfer learning).
  3. Evaluation metrics: Accuracy, Precision, Recall, F1-Score.
  4. Comparison between standard CNNs and SE-enhanced versions, plus Vision Transformers.

📖 Citations

If you use this repository, please cite:

@article{karakis2025imagemanipulation,
  author    = {Karakis, Rukiye, Gurkahraman Kali, Unsal Emre, Ates Volkan},
  title     = {Metaheuristic-Driven Optimization of Ensemble Deep Learning Model for Image Manipulation Classification},
  journal   = {PeerJ Computer Science},
  year      = {2025},
  note      = {Under review}
}

Additional references:

  • He et al., 2016 – ResNet
  • Huang et al., 2017 – DenseNet
  • Szegedy et al., 2016 – InceptionV3
  • Hu et al., 2018 – Squeeze-and-Excitation Networks
  • Dosovitskiy et al., 2021 – Vision Transformers
  • Boroumand & Fridrich, 2018 – BOSSBase
  • Schaefer & Stich, 2003 – UCID

📜 License & Contributions

  • Licensed under the MIT License.
  • Contributions are welcome via pull requests.
  • Parts of SE-ResNet, SE-DenseNet, and SE-Inception implementations were adapted from:
    keras-squeeze-excite-network (MIT License).

🙏 Acknowledgments

We thank the authors of open-source repositories that inspired this work.
Special thanks to the DeepBrain research group and SCU team members for their support.

About

Image Manipulation Detection

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors