ReshanthGamiles/IMAGEFORENSICS
0
π¬ Deep Forensics β Copy-Move Image Forgery Detection
A Flask web application that detects copy-move forgery in images using OpenCV (SIFT/ORB) feature extraction and Scikit-learn DBSCAN clustering.
β¨ Features
π Project Structure
deep_forensics/
βββ app.py # Flask main application (history, batch, metadata, reports)
βββ detector.py # Core SIFT/ORB detection algorithm
βββ requirements.txt # Python dependencies
βββ templates/
β βββ index.html # Web UI (tabs, dark mode, batch, history)
βββ static/
β βββ uploads/ # Uploaded images (auto-created)
β βββ results/ # Annotated result images (auto-created)
βββ create_test_image.py # Generate a test forged image
βββ demo.py # CLI demo script
βββ run_dev.bat # Windows batch launcher
βββ run_dev.ps1 # PowerShell dev scriptβοΈ Setup Instructions
Step 1 β Prerequisites
Make sure you have Python 3.8+ installed.
Step 2 β Create Virtual Environment
python -m venv venv
venv\Scripts\activate # Windows
source venv/bin/activate # macOS / LinuxStep 3 β Install Dependencies
pip install -r requirements.txtStep 4 β Run the App
python app.pyOpen your browser at: http://127.0.0.1:5000
π How It Works
π API Endpoints
π§ͺ Test with a Forged Image
python create_test_image.py
python demo.pyOr invoke the detector from CLI:
python detector.py path/to/image.jpg -m SIFTπΈ Supported Formats
JPG, JPEG, PNG, BMP, TIFF, WEBP (Max 16MB)
π¨βπ» Technologies Used
- Python 3.x β Backend language
- Flask β Web framework
- OpenCV β Image processing + SIFT/ORB feature detection
- Scikit-learn β DBSCAN clustering
- Pillow β EXIF metadata extraction
- NumPy β Array operations
- MediaPipe β Face mesh landmarks for deepfake detection
- HTML/CSS/JS β Frontend UI with dark/light mode
π Deepfake Detection
A brandβnew deepfake module analyzes both images and videos via facial landmark heuristics.
Features:
- Supports face JPG/PNG uploads and MP4/WebM/MOV videos
- Uses MediaPipe face mesh for landmark extraction
- Computes eye aspect ratio variance and other metrics
- Provides overlay visuals showing detected landmarks
- Includes API endpoint
/api/detect-deepfakefor programmatic access - Results saved to history when logged in
Update your environment after editing requirements.txt and restart the server to enable deepfake functionality.
