This repository contains the implementation of a Convolutional Neural Network (CNN) for detecting image splicing forgeries. Image splicing is a common manipulation technique where parts of different images are combined to create a forged image. With the rise of image editing tools, detecting such forgeries has become crucial to maintaining the reliability and trustworthiness of digital content.
Image splicing detection is the process of identifying manipulated images where segments from multiple sources are combined into a single image. This technique leverages machine learning models, such as Convolutional Neural Networks (CNNs), to analyze patterns and features in images that indicate tampering, thereby helping to maintain the integrity of digital media.
The primary goal of this project is to:
- Develop a CNN-based RELU method to accurately identify splicing forgeries in images.
- Enhance the reliability of digital images by detecting manipulations effectively.
- Deep Learning Approach: Utilizes a CNN for high accuracy in detecting splicing forgeries.
- Forgery Detection: Identifies areas of manipulation within an image.
- Scalable Design: Can be extended for other image forgery detection tasks.
-
Build a CNN Model:
- Create a Convolutional Neural Network (CNN) with ReLU activation to detect image splicing forgeries by extracting key features.
-
Improve Model Performance:
- Use BatchNormalization for stable training and Dropout layers to prevent overfitting, ensuring the CNN accurately distinguishes between real and manipulated images.
-
Implement and Test:
- Integrate the optimized CNN into practical applications for automated forgery detection.
- Evaluate its effectiveness across diverse datasets to maintain digital media integrity.
- Python 3.8+
- Jupyter Notebook
- TensorFlow/Keras
- NumPy
- OpenCV
- Matplotlib
Install the dependencies using pip:
pip install -r requirements.txt
ImageSplicingDetection.ipynb
: The main Jupyter Notebook containing the implementation of the CNN and the evaluation of results.data/
: Folder containing training and testing datasets of authentic and spliced images.models/
: Pre-trained or trained CNN models for the task.utils.py
: Utility functions for preprocessing, visualization, and evaluation (if applicable).
-
Clone the Repository:
git clone https://github.com/yourusername/image-splicing-detection.git cd image-splicing-detection
-
Prepare the Dataset:
- Place your training and testing images in the
data/
directory. - Ensure the dataset is labeled appropriately for spliced and authentic images.
- Place your training and testing images in the
-
Run the Notebook:
- Open the
ImageSplicingDetection.ipynb
file in Jupyter Notebook. - Execute the cells step-by-step to train the CNN model and evaluate its performance.
- Open the
This project uses the CASIA dataset for training and evaluating the model. The dataset contains both authentic and spliced images, providing a robust foundation for detecting image manipulations. Ensure the images are preprocessed and formatted appropriately for training.
- Detailed performance metrics such as accuracy, precision, recall, and F1-score are displayed in the notebook.
- Visualizations of detected spliced regions are provided to analyze the effectiveness of the model.
Contributions are welcome! If you have suggestions for improvement, feel free to fork the repository and submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
- This project was developed as a mini-project during the 3rd year (6th semester) of the Integrated MSc program.
- Thanks to the open-source community and datasets for enabling research in digital image forensics.
- Special acknowledgment to the creators of the CASIA dataset for providing a valuable resource for image splicing detection.