DeepTrace is a production-ready, SaaS-grade platform designed to detect whether an image is AI-generated or genuine. Built with a scalable microservices architecture, it features a hybrid deep learning inference pipeline, visual explainability, secure role-based authentication, and a complete administrative suite for platform monitoring.
- Advanced Inference Engine: Utilizes a dual-stream architecture combining spatial CNN analysis and frequency domain mapping to expose synthetic artifacts invisible to the human eye.
- Visual Explainability: Provides transparent results through Grad-CAM heatmaps and frequency spectrogram overlays, showing why an image was flagged.
- Complete SaaS Experience: Full authentication flow (JWT, bcrypt), user profiles, and persistent prediction history.
- Enterprise Security: Role-based access control (RBAC), strict CORS, SlowAPI rate limiting, and immutable audit logs for administrative actions.
- Admin Analytics: Comprehensive React Recharts dashboards tracking platform usage, detection confidence trends, and system health in real-time.
| Feature | Standard CNN Checkers | DeepTrace Platform |
|---|---|---|
| Spatial Artifact Detection | ✅ | ✅ |
| Frequency Spectrum (FFT) Detection | ❌ | ✅ |
| Visual Explainability (Grad-CAM) | ❌ | ✅ |
| Full User Authentication & History | ❌ | ✅ |
| Admin Analytics Dashboard | ❌ | ✅ |
| Containerized Microservices | ❌ | ✅ |
DeepTrace is structured as a modern, decoupled microservices application.
graph LR
Client[React SPA] -->|HTTPS REST| API[FastAPI Gateway]
API --> Auth[JWT Auth Service]
API --> Inference[Hybrid ML Pipeline]
Inference --> Spatial[Spatial CNN Stream]
Inference --> Freq[Frequency CNN Stream]
API --> DB[(PostgreSQL)]
- Frontend: React 18, Vite, TypeScript, Tailwind CSS, Framer Motion, Zustand.
- Backend: Python 3.10+, FastAPI, SQLAlchemy 2.0, Pydantic, Passlib (bcrypt), JWT.
- Machine Learning: PyTorch, OpenCV, SciPy, Pillow.
- Infrastructure: Docker, Docker Compose, PostgreSQL (Prod) / SQLite (Dev), Vercel + Render.
(See Architecture Documentation for detailed diagrams and component breakdowns.)
DeepTrace is optimized for CPU-first cloud environments (like Render or AWS Fargate) to minimize operational costs while maintaining low latency.
- Inference Time (CPU - PyTorch): ~350ms per image.
- RAM Footprint (Backend): ~250MB under load (Lightweight EfficientNet/ResNet backbone).
- Frontend Bundle Size: <200KB (Gzipped).
- API Response Latency: <50ms (Excluding ML inference).
The fastest way to launch the complete DeepTrace stack is via Docker Compose.
- Configure Environment
Create a
.envfile in the root directory (useinfra/.env.exampleas a template):
APP_ENV=development
JWT_SECRET_KEY=change_this_to_a_secure_random_string
ADMIN_EMAIL=admin@deeptrace.ai
ADMIN_PASSWORD=changeme123
DATABASE_URL=postgresql://deeptrace:deeptrace_dev@db:5432/deeptrace- Launch the Stack
cd infra
docker-compose up --build -d- Access the Platform
- Frontend Application:
http://localhost:3000 - API Documentation:
http://localhost:8000/docs
For a public launch, the following monitoring tools are highly recommended:
- Sentry: For real-time frontend/backend crash reporting and unhandled exception tracing.
- Prometheus + Grafana: To visualize the inference timing metrics already being logged via Python's
loggingframework. - Logtail / Datadog: For centralized log aggregation, particularly tracking the
DeepTrace.inferencelogger to catch edge-case images causing ML pipeline degradation.
Detailed documentation is located in the docs/ directory:
- Architecture Overview
- Deployment Guide & Cloud Deployment
- API Reference
- Model Setup
- Testing Infrastructure
When contributing, please adhere to the existing architectural patterns:
- Maintain strong typing (TypeScript/Pydantic).
- Ensure UI components utilize the established Tailwind/Framer Motion design system.
- Keep the backend decoupled (Routers -> Services -> Models).
This project is licensed under the MIT License - see the LICENSE file for details.