A powerful, AI-driven image forensics analysis platform that combines state-of-the-art machine learning models to detect image tampering, AI-generated content, perform facial analysis, and enable reverse image search. Built with React frontend and Python FastAPI backend.
- TruFor Model: State-of-the-art image forgery detection
- Detection Types: Copy-move, splicing, and other manipulations
- Output: Integrity scores with confidence levels and localization maps
- SDXL Detector: Detects AI-generated images with high accuracy
- Confidence Scoring: Provides generation probability scores
- Model: Hugging Face Transformers-based detection
- InsightFace Model: Advanced facial analysis capabilities
- Features:
- Age estimation with confidence scores
- Gender detection
- Facial keypoint detection (5-point landmarks)
- Emotion analysis (happy/sad/neutral)
- High Accuracy: Buffalo_L model for reliable results
- Complete Extraction: Camera settings, timestamps, GPS data
- Smart Handling: Graceful handling of images without EXIF data
- User Guidance: Helpful messages for images from social media/screenshots
- Note: Many images from social media have EXIF data stripped for privacy
- Multiple Engines: Google Lens, Bing, Yandex, TinEye
- Dynamic URLs: Automatically adapts to any deployment environment
- Public Access: Works with Cloudflare Tunnel and cloud providers
- React 18 with TypeScript
- Vite for fast development and building
- Tailwind CSS for modern, responsive design
- Framer Motion for smooth animations
- Lucide React for beautiful icons
- Python 3.10+ with FastAPI
- PyTorch for deep learning inference
- OpenCV for image processing
- NumPy for numerical computations
- Uvicorn ASGI server
- TruFor: Image forgery detection and localization
- InsightFace: Face detection and analysis
- SDXL Detector: AI generation detection
- Custom Emotion Analysis: Keypoint-based facial expression analysis
- Python 3.10+
- Node.js 18+
- Git
- Clone the repository
git clone https://github.com/owaissafa/Image-Forensic.git
cd Image-Forensic- Run the setup script
chmod +x setup.sh
./setup.shNote: The repository includes AI model files but not the virtual environment to keep the repository size manageable. Large model files are handled by Git LFS for efficient storage. The setup.sh script will create the virtual environment when you first run it. Some AI models like SDXL detector are downloaded automatically by their respective libraries on first use.
- Start the application
chmod +x start.sh
./start.shThe setup script will automatically:
- Install system dependencies
- Set up Python virtual environment
- Install backend requirements
- Install frontend dependencies
- Download and install Cloudflare Tunnel
- Backend runs on
http://localhost:8000 - Frontend runs on
http://localhost:5173 - Automatic service discovery
- Automatic Setup: Included in the start script
- Public Access: Access from anywhere in the world
- HTTPS: Secure connections automatically
- Dynamic URLs: Automatically detects tunnel URLs
# Backend setup
cd backend
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
# Frontend setup
cd ..
npm install
# Start services
cd backend && source venv/bin/activate && python app.py &
npm run dev &Image-Forensic/
βββ backend/
β βββ api/ # FastAPI routes
β βββ config/ # Configuration management
β βββ models/ # AI models and weights
β βββ services/ # Analysis services
β βββ utils/ # Utility functions
β βββ app.py # FastAPI application
βββ src/
β βββ components/ # React components
β βββ hooks/ # Custom React hooks
β βββ types/ # TypeScript definitions
β βββ App.tsx # Main application
βββ setup.sh # One-time setup script
βββ start.sh # Application startup script
βββ README.md
The system requires zero manual configuration for most deployments:
- Local Development: Works automatically
- Cloudflare Tunnel: Detects tunnel URLs from headers
- Cloud Providers: Detects environment and gets public IP
- Platform Deployments: Reads platform environment variables
If needed, set environment variables:
# For custom domain
export PUBLIC_BASE_URL=https://yourdomain.com
# For Cloudflare Tunnel
export CLOUDFLARE_TUNNEL_URL=https://your-tunnel.trycloudflare.comThe backend automatically detects and uses:
- GPU acceleration if available (CUDA)
- CPU optimization with multi-threading
- Model caching for faster inference
- Dynamic public URLs for any deployment
- Upload an Image: Drag and drop or click to upload any image
- Automatic Analysis: The system will run all analysis types
- View Results: Check each tab for detailed results
- Reverse Search: Use the search engines to find similar images online
- Tamper Detection: Check for image manipulation
- AI Detection: Determine if image is AI-generated
- Face Analysis: Get age, gender, and emotion data
- Metadata: View EXIF data and camera information
- Reverse Search: Find similar images online
EXIF Data Not Found
- This is normal for images from social media or screenshots
- Try uploading images directly from cameras for best results
- The system provides helpful guidance messages
Frontend Not Loading
- Check if port 5173 is available
- The system automatically detects alternative ports
- Ensure all dependencies are installed
Cloudflare Tunnel Issues
- The tunnel is automatically configured in
start.sh - Check the
cloudflare.logfor any errors - Ensure
cloudflaredis properly installed
Model Download Issues
- Models are downloaded automatically on first use
- Check internet connection for initial downloads
- Models are cached locally for future use
Minimum
- 4GB RAM
- 2GB free disk space
- Python 3.10+
- Node.js 18+
Recommended
- 8GB RAM
- 5GB free disk space
- GPU with CUDA support (optional)
The following AI models are included in the repository:
- TruFor: ~200MB - Included in repository
- InsightFace: ~500MB - Included in repository
The following models are downloaded automatically on first use:
- SDXL Detector: ~1.5GB - Downloaded by Hugging Face Transformers
Note: First-time setup may take 2-3 minutes depending on your internet connection.
This repository uses Git Large File Storage (LFS) to handle large AI model files efficiently. When cloning the repository, you may need to install Git LFS:
# Install Git LFS (if not already installed)
git lfs install
# Clone the repository
git clone https://github.com/owaissafa/Image-Forensic.git
cd Image-Forensic- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
This project was developed with significant assistance from AI tools:
- Code Generation: AI helped generate boilerplate code, API endpoints, and React components
- Debugging: AI assisted in identifying and fixing complex issues like Cloudflare tunnel configuration
- Documentation: AI helped create comprehensive documentation and README files
- Problem Solving: AI provided solutions for deployment challenges and system integration
- Code Optimization: AI suggested improvements for performance and user experience
- TruFor for image forgery detection
- InsightFace for facial analysis
- SDXL Detector for AI generation detection
- FastAPI for the backend framework
- React for the frontend framework
If you encounter any issues or have questions:
- Check the troubleshooting section above
- Review the logs in the project directory
- Open an issue on GitHub with detailed information
Made with β€οΈ by owaissafa