A research-prototype application for detecting AI-generated content in both text and images with explainability and reproducible forensic reporting.
- Multi-modal Detection: Detects AI-generated images (ViT/DeiT) and text (RoBERTa/DeBERTa)
- Forensic Analysis: ELA, EXIF metadata (images), stylometry, perplexity (text)
- Explainability: Grad-CAM/Attention Rollout (images), Integrated Gradients/SHAP (text)
- Fusion Layer: Calibrated probability averaging for robust classification
- Forensic Reports: PDF reports with hashes for reproducibility
- Deployment: FastAPI backend + Streamlit frontend, Dockerized
ACFS/
├── backend/ # FastAPI backend
│ ├── api/ # API endpoints
│ ├── models/ # Model inference modules
│ ├── forensics/ # Forensic analysis tools
│ ├── explainability/ # Explainability modules
│ ├── fusion/ # Fusion layer
│ └── reporting/ # PDF report generation
├── frontend/ # Streamlit UI
├── training/ # Model training scripts
├── data/ # Dataset directory (DVC managed)
├── models/ # Saved model checkpoints
├── reports/ # Generated forensic reports
├── tests/ # Unit and integration tests
├── docker/ # Docker configuration
└── config/ # Configuration files
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Initialize DVC
dvc init# Build Docker image
docker build -f docker/Dockerfile -t acfs:latest .
# Run container
docker run -p 8000:8000 -p 8501:8501 acfs:latestcd backend
uvicorn main:app --host 0.0.0.0 --port 8000 --reloadstreamlit run frontend/app.py --server.port 8501# Train image detection models
python training/train_image_models.py --model vit --epochs 10
# Train text detection models
python training/train_text_models.py --model roberta --epochs 5POST /api/analyze/image- Analyze image for AI generationPOST /api/analyze/text- Analyze text for AI generationGET /api/report/{report_id}- Download forensic reportGET /api/models/status- Check model status
All models, datasets, and reports include:
- SHA256 hashes for integrity verification
- Timestamps for audit trails
- DVC versioning for datasets
- Dockerized environment for consistency
- ML/DL: PyTorch, HuggingFace Transformers, timm
- Explainability: Captum, SHAP, pytorch-grad-cam
- Forensics: OpenCV, ExifRead, Pillow
- Backend: FastAPI, Pydantic
- Frontend: Streamlit
- Reporting: ReportLab
- Reproducibility: Docker, DVC
MIT License
Research Prototype - AI Content Forensics Suite Team