MorphGuard / DOCUMENTATION_INDEX.md
juanquy's picture
Initial clean commit of modular MorphGuard
2978bba
|
Raw
History Blame Contribute Delete
9.17 kB

MorphGuard Documentation Index

Complete guide to MorphGuard documentation and resources.


πŸš€ Getting Started

New to MorphGuard? Start here:

  1. README.md - Project overview and main documentation
  2. GETTING_STARTED.md - Consolidated Setup & Workflow Guide
  3. docs_archive/QUICKSTART.md - Quick Start Guide (Archived)

πŸ“¦ Installation & Setup

Setting up your development environment:

Configuration Files:

  • .env.development - Development environment variables
  • .env.production - Production environment variables

πŸ”§ System Components

Core Application

Models & AI

Detection Systems:

Documentation:

API & Integration

Blockchain

  • src/blockchain/ - Ethereum smart contract integration
  • Verification logging and immutable audit trails

Adversarial Defense

  • src/adversarial/ - Adversarial attack defense
  • FGSM, PGD, C&W attack protection

πŸ“Š Monitoring & Analytics

Real-time Monitoring:

Metrics & Dashboards:

  • GPU utilization and temperature monitoring
  • Detection confidence tracking
  • Training progress visualization
  • System resource monitoring

🎨 User Interface

Web Templates:

UI/UX Documentation:


πŸ‹οΈ Training & Evaluation

Training Scripts:

Training Guides:

  • Custom model training
  • Hyperparameter tuning
  • Transfer learning
  • Dataset preparation

πŸ“š Advanced Topics

System Architecture:

Advanced Features:


πŸ” Specialized Components

pSp Demorpher

  • pSp/README.md - pixel2style2pixel encoder documentation
  • StyleGAN2 integration
  • Demorphing pipeline

Data Cleaning

  • Cleaning/README.md - Data preprocessing scripts
  • Dataset cleaning utilities
  • Quality assurance

πŸ› Troubleshooting

Common Issues:

  1. Server Won't Start

    • Check docs_archive/QUICKSTART.md Section 7 (Troubleshooting)
    • Verify GPU availability: nvidia-smi
    • Check port conflicts: lsof -i :5000
  2. CUDA Out of Memory

    • Close other GPU applications
    • Reduce batch size in config
    • Enable mixed precision
  3. Database Connection Failed

    • Check PostgreSQL: sudo systemctl status postgresql
    • Run setup: python scripts/setup_timescaledb.py
  4. Models Not Loading

    • Verify model files: ls -lh models/
    • Check PyTorch: python -c "import torch; print(torch.cuda.is_available())"

πŸ“– API Reference

Endpoint Documentation:

Detection Endpoints

# Morph detection
POST /api/detect
POST /api/detect/heatmap

# Deepfake detection
POST /api/detect/deepfake
POST /api/detect/deepfake/heatmap

# Combined detection
POST /api/detect/comprehensive

Training Endpoints

# Start training
POST /api/train/detector
POST /api/train/demorpher

# Monitor training
GET /api/train/status
GET /api/train/metrics

System Endpoints

# Health check
GET /api/health

# Device info
GET /api/devices/cpu
GET /api/devices/gpu

# Metrics
GET /api/metrics/recent

πŸ” Security & Compliance

Security Features:

Privacy:

  • GDPR compliance
  • CCPA compliance
  • Data retention policies
  • Audit logging

πŸ§ͺ Testing

Test Files:

  • Unit tests for models
  • Integration tests for API
  • Performance benchmarks
  • Adversarial robustness tests
# Run all tests
pytest tests/

# Run specific test suite
pytest tests/test_detector.py

# Run with coverage
pytest --cov=src tests/

πŸ“¦ Dependencies

Core Dependencies:

  • PyTorch 2.6+ (CUDA 12.8)
  • Flask 2.3+
  • TimescaleDB 2.x
  • Grafana 10.x
  • PostgreSQL 15+

Python Packages: See requirements.txt and environment.yml


πŸš€ Deployment

Production Deployment:

  • BETA_DEPLOYMENT_GUIDE.md - Complete deployment guide
  • Docker containerization
  • NGINX reverse proxy
  • SSL/TLS configuration
  • Load balancing
  • Auto-scaling

πŸ“ Version History

Latest Updates:

  • v2.3.0 - Added deepfake detection (XceptionNet)
  • v2.2.0 - Live Grafana dashboards
  • v2.1.0 - UI/UX improvements
  • v2.0.0 - Blockchain integration

See CHANGELOG.md for full history.


🀝 Contributing

How to Contribute:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

Guidelines:

  • Follow PEP 8 style guide
  • Write unit tests
  • Update documentation
  • Add docstrings

πŸ“§ Support & Community

Get Help:

  • GitHub Issues: Report bugs
  • GitHub Discussions: Ask questions
  • Email: support@morphguard.ai
  • Documentation: This index!

πŸ” Quick Reference

Most Common Tasks:

Task Command/File
Start server ./start.sh
Stop server pkill -f "python.*app.py"
Setup environment sudo ./setup_conda_environment.sh
Train detector python scripts/train_detector.py
Test API curl http://localhost:5000/api/health
View logs tail -f nohup.out
Check GPU nvidia-smi
Configure Grafana ./configure_grafana_embed.sh

πŸ“š External Resources

Research Papers:

  • M2TR: Morphing Detection Transformers
  • pSp: Encoding in Style
  • XceptionNet: Depthwise Separable Convolutions
  • ArcFace: Additive Angular Margin Loss

Useful Links:

  • PyTorch Documentation
  • TimescaleDB Documentation
  • Grafana Documentation
  • Flask Documentation

πŸ—ΊοΈ Documentation Roadmap

Planned Documentation:

  • Detailed API reference
  • Training tutorial with examples
  • Deployment best practices
  • Performance optimization guide
  • Security hardening guide
  • Video processing guide
  • Batch processing guide

Last Updated: 2025-11-23 Documentation Version: 2.3.0

For the most up-to-date information, always refer to the latest version in the repository.