An open API service indexing awesome lists of open source software.

https://github.com/donartkins/deepcheckai

DeepCheck AI is a comprehensive Python-based service for detecting manipulated media including images, videos, and audio files
https://github.com/donartkins/deepcheckai

cloudinary-api deepfake-detection flask-api python3 rest-api

Last synced: 10 months ago
JSON representation

DeepCheck AI is a comprehensive Python-based service for detecting manipulated media including images, videos, and audio files

Awesome Lists containing this project

README

          

# DeepCheck AI πŸ›‘οΈ

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

DeepCheck AI is a comprehensive Python-based service for detecting manipulated media including **images, videos, and audio files**. Built with a modular architecture, it integrates state-of-the-art deepfake detection models and provides easy-to-use REST API endpoints that can be seamlessly connected to web frontends.

---

## ✨ Key Features

- πŸ–ΌοΈ **Multi-Modal Detection**: Analyze images, videos, and audio files
- πŸ“Š **Confidence Scoring**: Get detailed confidence metrics for all results
- πŸ“ **Bulk Processing**: Upload and process multiple files simultaneously
- πŸ”§ **Modular Architecture**: Easy integration of new detection models
- 🌐 **REST API**: Ready-to-use Flask/FastAPI endpoints
- βš™οΈ **Configurable**: Flexible configuration via environment variables
- πŸš€ **Production Ready**: Optimized for deployment and scaling

---

## πŸ“‚ Project Structure

```
deepfake-ai-service/
β”œβ”€β”€ app/
β”‚ β”œβ”€β”€ main.py # Application entry point
β”‚ β”œβ”€β”€ models/ # AI detection models
β”‚ β”‚ β”œβ”€β”€ image_detector.py # Image deepfake detection
β”‚ β”‚ β”œβ”€β”€ video_detector.py # Video deepfake detection
β”‚ β”‚ └── audio_detector.py # Audio deepfake detection
β”‚ β”œβ”€β”€ utils/ # Utility functions
β”‚ β”‚ β”œβ”€β”€ preprocessing.py # Media preprocessing
β”‚ β”‚ β”œβ”€β”€ validation.py # Input validation
β”‚ β”‚ └── helpers.py # Common helper functions
β”‚ └── routes/ # API route definitions
β”‚ β”œβ”€β”€ api.py # Main API routes
β”‚ └── health.py # Health check endpoints
β”œβ”€β”€ config/
β”‚ β”œβ”€β”€ settings.py # Application settings
β”‚ └── logging.conf # Logging configuration
β”œβ”€β”€ tests/ # Test suite
β”‚ β”œβ”€β”€ test_models.py # Model tests
β”‚ β”œβ”€β”€ test_api.py # API endpoint tests
β”‚ └── fixtures/ # Test media files
β”œβ”€β”€ temp/ # Temporary file storage
β”œβ”€β”€ logs/ # Application logs
β”œβ”€β”€ requirements.txt # Python dependencies
β”œβ”€β”€ requirements-dev.txt # Development dependencies
β”œβ”€β”€ .env.example # Environment variables template
β”œβ”€β”€ .gitignore # Git ignore rules
β”œβ”€β”€ Dockerfile # Docker configuration
β”œβ”€β”€ docker-compose.yml # Docker Compose setup
β”œβ”€β”€ run.py # Application runner
β”œβ”€β”€ README.md # This file
└── CONTRIBUTING.md # Contribution guidelines
```

---

## πŸš€ Quick Start

### Prerequisites

- Python 3.8 or higher
- Git
- Virtual environment (recommended)

### Installation

1. **Clone the repository**

```bash
git clone https://github.com/YOUR_USERNAME/deepcheck-ai.git
cd deepcheck-ai
```

2. **Create and activate virtual environment**

```bash
# On macOS/Linux
python3 -m venv venv
source venv/bin/activate

# On Windows
python -m venv venv
venv\Scripts\activate
```

3. **Install dependencies**

```bash
pip install -r requirements.txt
```

4. **Configure environment**

```bash
cp .env.example .env
# Edit .env with your configuration
```

5. **Run the application**
```bash
python run.py
```

The service will be available at `http://localhost:5000`

---

## πŸ–₯️ Usage

### API Endpoints

#### Health Check

```bash
GET /health
```

#### Upload and Analyze Media

```bash
POST /api/analyze
Content-Type: multipart/form-data

# Parameters:
# - file: Media file (image/video/audio)
# - threshold: Confidence threshold (optional, default: 0.5)
```

#### Example Response

```json
{
"status": "success",
"file_type": "image",
"is_deepfake": false,
"confidence": 0.85,
"processing_time": 2.34,
"metadata": {
"model_version": "v2.1.0",
"timestamp": "2024-03-15T10:30:00Z"
}
}
```

### Python Client Example

```python
import requests

url = "http://localhost:5000/api/analyze"
files = {"file": open("suspicious_image.jpg", "rb")}
data = {"threshold": 0.7}

response = requests.post(url, files=files, data=data)
result = response.json()

print(f"Is deepfake: {result['is_deepfake']}")
print(f"Confidence: {result['confidence']}")
```

### Frontend Integration

The API is designed to work seamlessly with web frontends. For a complete example with Next.js, check out our [frontend repository](https://github.com/YOUR_USERNAME/deepcheck-frontend).

---

## πŸ”§ Configuration

### Environment Variables

Create a `.env` file in the root directory:

```env
# Server Configuration
PORT=5000
DEBUG=True
SECRET_KEY=your-secret-key-here

# Model Configuration
DEFAULT_THRESHOLD=0.5
MAX_FILE_SIZE=100MB
SUPPORTED_FORMATS=jpg,jpeg,png,mp4,avi,wav,mp3

# Storage Configuration
TEMP_DIR=./temp
LOG_LEVEL=INFO

# GPU Configuration (optional)
USE_GPU=True
CUDA_DEVICE=0
```

### Advanced Configuration

For advanced settings, modify `config/settings.py`:

```python
class Config:
# Model configurations
IMAGE_MODEL_PATH = "models/image_detector.pth"
VIDEO_MODEL_PATH = "models/video_detector.pth"
AUDIO_MODEL_PATH = "models/audio_detector.pth"

# Processing limits
MAX_VIDEO_DURATION = 300 # seconds
MAX_BATCH_SIZE = 10

# Performance tuning
WORKER_THREADS = 4
ENABLE_CACHING = True
```

---

## 🐳 Docker Deployment

### Using Docker Compose (Recommended)

```bash
docker-compose up -d
```

### Manual Docker Build

```bash
# Build image
docker build -t deepcheck-ai .

# Run container
docker run -p 5000:5000 -v $(pwd)/temp:/app/temp deepcheck-ai
```

---

## πŸ§ͺ Testing

Run the test suite:

```bash
# Install development dependencies
pip install -r requirements-dev.txt

# Run tests
python -m pytest tests/ -v

# Run with coverage
python -m pytest tests/ --cov=app --cov-report=html
```

---

## πŸ“ˆ Performance

### Benchmarks

| Media Type | Average Processing Time | GPU Acceleration |
| ---------- | --------------------------- | ---------------- |
| Images | 0.5s | 3x faster |
| Videos | 2-10s (depending on length) | 5x faster |
| Audio | 1-3s | 2x faster |

### Optimization Tips

- Enable GPU acceleration for significant performance gains
- Use batch processing for multiple files
- Configure appropriate worker threads based on your hardware
- Enable caching for repeated analyses

---

## πŸ›£οΈ Roadmap

### Version 2.0

- [ ] Advanced transformer-based models (BERT, Vision Transformer)
- [ ] Real-time streaming detection
- [ ] Enhanced GPU optimization (TensorRT integration)
- [ ] Multi-language support for API documentation

### Version 2.1

- [ ] Kubernetes deployment templates
- [ ] Advanced analytics dashboard
- [ ] Model fine-tuning capabilities
- [ ] Integration with cloud storage providers (AWS S3, Google Cloud)

### Version 3.0

- [ ] Federated learning support
- [ ] Custom model training interface
- [ ] Advanced forensic analysis features
- [ ] Mobile SDK for iOS/Android

---

## 🀝 Contributing

We welcome contributions from developers of all skill levels! Please see our [CONTRIBUTING.md](CONTRIBUTING.md) for detailed guidelines on how to contribute to DeepCheck AI.

### Quick Contribution Steps

1. Fork the repository
2. Create a feature branch
3. Make your changes
4. Add tests for new functionality
5. Submit a pull request

---

## πŸ“„ License

This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.

---

## πŸ™ Acknowledgements

We thank the following projects and research communities:

- **[DeepFace](https://github.com/serengil/deepface)** - Face recognition and analysis framework
- **[OpenCV](https://opencv.org/)** - Computer vision library
- **[PyTorch](https://pytorch.org/)** - Deep learning framework
- **[Librosa](https://librosa.org/)** - Audio analysis library
- **Academic Research Community** - For groundbreaking work in deepfake detection

### Research Papers

- "FaceForensics++: Learning to Detect Manipulated Facial Images" (RΓΆssler et al., 2019)
- "The DeepFake Detection Challenge (DFDC) Dataset" (Dolhansky et al., 2020)
- "DeeperForensics-1.0: A Large-Scale Dataset for Real-World Face Forgery Detection" (Jiang et al., 2020)

---

## πŸ“ž Support

- πŸ› **Bug Reports**: [GitHub Issues](https://github.com/YOUR_USERNAME/deepcheck-ai/issues)
- πŸ’‘ **Feature Requests**: [GitHub Discussions](https://github.com/YOUR_USERNAME/deepcheck-ai/discussions)
- πŸ“§ **Email**: support@deepcheck-ai.com
- πŸ’¬ **Discord**: [Join our community](https://discord.gg/deepcheck-ai)

---

## πŸ“Š Project Stats

![GitHub stars](https://img.shields.io/github/stars/YOUR_USERNAME/deepcheck-ai?style=social)
![GitHub forks](https://img.shields.io/github/forks/YOUR_USERNAME/deepcheck-ai?style=social)
![GitHub issues](https://img.shields.io/github/issues/YOUR_USERNAME/deepcheck-ai)
![GitHub pull requests](https://img.shields.io/github/issues-pr/YOUR_USERNAME/deepcheck-ai)

---


Built with ❀️ for a safer digital world