Spaces:
Sleeping
Sleeping
| # MorphGuard Documentation Index | |
| Complete guide to MorphGuard documentation and resources. | |
| --- | |
| ## π Getting Started | |
| **New to MorphGuard? Start here:** | |
| 1. **[README.md](README.md)** - Project overview and main documentation | |
| 2. **[GETTING_STARTED.md](GETTING_STARTED.md)** - Consolidated Setup & Workflow Guide | |
| 3. **[docs_archive/QUICKSTART.md](docs_archive/QUICKSTART.md)** - Quick Start Guide (Archived) | |
| --- | |
| ## π¦ Installation & Setup | |
| **Setting up your development environment:** | |
| - **[GETTING_STARTED.md](GETTING_STARTED.md)** - Master Setup Guide | |
| - **[docs_archive/SETUP_GUIDE.md](docs_archive/SETUP_GUIDE.md)** - Storage Setup/Migration Guide (Archived) | |
| - **[setup_conda_environment.sh](setup_conda_environment.sh)** - Automated Conda setup script | |
| - **[PYTORCH_DEPLOYMENT_GUIDE.md](PYTORCH_DEPLOYMENT_GUIDE.md)** - PyTorch with CUDA setup | |
| - **[BETA_DEPLOYMENT_GUIDE.md](BETA_DEPLOYMENT_GUIDE.md)** - Production deployment guide | |
| **Configuration Files:** | |
| - `.env.development` - Development environment variables | |
| - `.env.production` - Production environment variables | |
| --- | |
| ## π§ System Components | |
| ### Core Application | |
| - **[app.py](app.py)** - Main Flask application | |
| - **[start.sh](start.sh)** - Server startup script | |
| - **[COMPLETE_APPLICATION_WORKFLOW.md](COMPLETE_APPLICATION_WORKFLOW.md)** - Application workflow | |
| ### Models & AI | |
| **Detection Systems:** | |
| - **[src/models/morph_detector.py](src/models/morph_detector.py)** - M2TR Vision Transformer | |
| - **[src/deepfake/deepfake_detector.py](src/deepfake/deepfake_detector.py)** - XceptionNet deepfake detector | |
| - **[src/models/demorpher_model.py](src/models/demorpher_model.py)** - pSp GAN demorpher | |
| - **[src/models/identity_verifier.py](src/models/identity_verifier.py)** - ArcFace verifier | |
| **Documentation:** | |
| - **[MorphGuard.md](MorphGuard.md)** - Model architecture details | |
| - **[Research.md](Research.md)** - Research papers and references | |
| ### API & Integration | |
| - **[src/README_RESILIENT_API.md](src/README_RESILIENT_API.md)** - Resilient API design | |
| - **[src/README_API_UTILS.md](src/README_API_UTILS.md)** - API utility functions | |
| - **[INTEGRATE_AXI.md](INTEGRATE_AXI.md)** - AXI integration guide | |
| ### Blockchain | |
| - **[src/blockchain/](src/blockchain/)** - Ethereum smart contract integration | |
| - Verification logging and immutable audit trails | |
| ### Adversarial Defense | |
| - **[src/adversarial/](src/adversarial/)** - Adversarial attack defense | |
| - FGSM, PGD, C&W attack protection | |
| --- | |
| ## π Monitoring & Analytics | |
| **Real-time Monitoring:** | |
| - **[GRAFANA_SETUP_COMPLETE.md](GRAFANA_SETUP_COMPLETE.md)** - Grafana dashboard setup | |
| - **[configure_grafana_embed.sh](configure_grafana_embed.sh)** - Enable dashboard embedding | |
| - **[scripts/setup_timescaledb.py](scripts/setup_timescaledb.py)** - TimescaleDB initialization | |
| **Metrics & Dashboards:** | |
| - GPU utilization and temperature monitoring | |
| - Detection confidence tracking | |
| - Training progress visualization | |
| - System resource monitoring | |
| --- | |
| ## π¨ User Interface | |
| **Web Templates:** | |
| - **[templates/setup-improved.html](templates/setup-improved.html)** - Setup & training interface | |
| - **[templates/enhanced-ui.html](templates/enhanced-ui.html)** - Enhanced demo interface | |
| - **[templates/index.html](templates/index.html)** - Main landing page | |
| **UI/UX Documentation:** | |
| - **[UI_SPACING_FIXES.md](UI_SPACING_FIXES.md)** - Recent UI improvements | |
| - **[INTERFACE_STRATEGY.md](INTERFACE_STRATEGY.md)** - Interface design strategy | |
| - **[static/css/design-tokens.css](static/css/design-tokens.css)** - Design system | |
| --- | |
| ## ποΈ Training & Evaluation | |
| **Training Scripts:** | |
| - **[scripts/train_detector.py](scripts/train_detector.py)** - Train morph detector | |
| - **[scripts/train_demorpher.py](scripts/train_demorpher.py)** - Train demorpher | |
| - **[scripts/evaluate_model.py](scripts/evaluate_model.py)** - Model evaluation | |
| **Training Guides:** | |
| - Custom model training | |
| - Hyperparameter tuning | |
| - Transfer learning | |
| - Dataset preparation | |
| --- | |
| ## π Advanced Topics | |
| **System Architecture:** | |
| - **[COMPREHENSIVE_SYSTEM_ASSESSMENT.md](COMPREHENSIVE_SYSTEM_ASSESSMENT.md)** - System analysis | |
| - **[SETUP_ANALYSIS_REPORT.md](SETUP_ANALYSIS_REPORT.md)** - Setup analysis | |
| **Advanced Features:** | |
| - **[ADVANCED_FEATURES_SUMMARY.md](ADVANCED_FEATURES_SUMMARY.md)** - Advanced capabilities | |
| - **[COMPLIANCE_IMPLEMENTATION_SUMMARY.md](COMPLIANCE_IMPLEMENTATION_SUMMARY.md)** - GDPR/CCPA compliance | |
| - **[ENHANCED_SETUP_IMPLEMENTATION.md](ENHANCED_SETUP_IMPLEMENTATION.md)** - Enhanced setup features | |
| --- | |
| ## π Specialized Components | |
| ### pSp Demorpher | |
| - **[pSp/README.md](pSp/README.md)** - pixel2style2pixel encoder documentation | |
| - StyleGAN2 integration | |
| - Demorphing pipeline | |
| ### Data Cleaning | |
| - **[Cleaning/README.md](Cleaning/README.md)** - Data preprocessing scripts | |
| - Dataset cleaning utilities | |
| - Quality assurance | |
| --- | |
| ## π Troubleshooting | |
| **Common Issues:** | |
| 1. **Server Won't Start** | |
| - Check **[docs_archive/QUICKSTART.md](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 | |
| ```bash | |
| # 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 | |
| ```bash | |
| # Start training | |
| POST /api/train/detector | |
| POST /api/train/demorpher | |
| # Monitor training | |
| GET /api/train/status | |
| GET /api/train/metrics | |
| ``` | |
| ### System Endpoints | |
| ```bash | |
| # Health check | |
| GET /api/health | |
| # Device info | |
| GET /api/devices/cpu | |
| GET /api/devices/gpu | |
| # Metrics | |
| GET /api/metrics/recent | |
| ``` | |
| --- | |
| ## π Security & Compliance | |
| **Security Features:** | |
| - **[COMPLIANCE_IMPLEMENTATION_SUMMARY.md](COMPLIANCE_IMPLEMENTATION_SUMMARY.md)** | |
| - User authentication and authorization | |
| - API rate limiting | |
| - Input validation and sanitization | |
| - Adversarial attack defense | |
| **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 | |
| ```bash | |
| # 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](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](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. | |