AI-Assisted Image Infringement Detection
A robust, multi-layered forensic analysis tool designed to detect image infringement, derivative works, and manipulation. It combines cryptographic hashing, semantic AI analysis, and computer vision techniques to provide a comprehensive similarity score.
The tool employs a 4-Layer Analysis pipeline:
- Perceptual Hashing (Layer 1): fast retrieval using pHash, aHash, dHash, and wHash to detect near-duplicates.
- Semantic AI (Layer 2): uses CLIP (Contrastive Language-Image Pre-Training) to detect semantic similarity (concepts/content) even if the pixels are completely changed (requires User Flag).
- Visual Similarity (Layer 3):
- Pixel Logic: Structural Similarity Index (SSIM) and pixel-by-pixel comparison.
- Feature Matching: ORB (Oriented FAST and Rotated BRIEF) + RANSAC to detect geometric matches (crops, rotations, collages).
- Metadata Forensics (Layer 4): extracts and compares metadata using
exiftoolto find shared origin traces.
- Python 3.8+
- ExifTool (must be installed and in your system PATH)
# Clone the repository
git clone https://github.com/Slay3r00/PixelForensics.git
cd PixelForensics
# Create a virtual environment
python3 -m venv venv
source venv/bin/activate
# Install dependencies
pip install -r requirements.txtCompare two images to get a full forensic report:
python main.py -i source.jpg -c suspect.png-i, --image: Path to the original/source image.-c, --compare: Path to the suspect/comparison image.-o, --output-file: Save the report to a text file.--tolerance: Pixel matching tolerance (default: 0.05).--enable-ai: Enable CLIP-based semantic analysis (slower, requires downloading models).--show-diff: Display a visual difference map.--save-diff <path>: Save the difference map image.
python main.py -i assets/original.jpg -c assets/modified.jpg --enable-ai --show-diffimage_forensics/: Core package.utils/: Core logic and database handling.core.py: orchestrates the analysis pipeline.database.py: SQLite storage for cases, images, and analysis results.
layers/: modular logic for Hashing, AI, Visual, and Metadata.
main.py: CLI entry point.data/forensics.db: Local database auto-created to store analysis history.
Run tests:
python -m unittest discover testsMIT