Metadata-Version: 2.4
Name: laundromatic
Version: 0.0.1
Summary: Red team toolkit for deepfake detection benchmarking
Author-email: Coefficient Systems Ltd <contact@coefficient.ai>
Classifier: Development Status :: 1 - Planning
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Multimedia :: Sound/Audio :: Analysis
Classifier: Topic :: Multimedia :: Video
Classifier: Topic :: Scientific/Engineering :: Image Processing
Requires-Python: >=3.12
Requires-Dist: exifread<4,>=3
Requires-Dist: imageio-ffmpeg<1,>=0.5
Requires-Dist: librosa<1,>=0.10
Requires-Dist: loguru<1,>=0.7
Requires-Dist: moviepy<3,>=2
Requires-Dist: mutagen<2,>=1.47
Requires-Dist: numpy<3,>=1.26
Requires-Dist: opencv-python<5,>=4.10
Requires-Dist: pillow<12,>=10
Requires-Dist: pydub<1,>=0.25
Requires-Dist: rich<14,>=13
Requires-Dist: scikit-image<1,>=0.24
Requires-Dist: scipy<2,>=1.14
Requires-Dist: soundfile<1,>=0.12
Requires-Dist: torch<3,>=2.4
Requires-Dist: torchaudio<3,>=2.4
Requires-Dist: torchvision<1,>=0.19
Requires-Dist: tqdm<5,>=4.66
Requires-Dist: typer<1,>=0.15
Provides-Extra: ml
Requires-Dist: accelerate<2,>=1; extra == 'ml'
Requires-Dist: diffusers<1,>=0.30; extra == 'ml'
Requires-Dist: foolbox<4,>=3.3; extra == 'ml'
Requires-Dist: transformers<5,>=4.45; extra == 'ml'
Description-Content-Type: text/markdown

# Laundromatic

[![Python 3.12+](https://img.shields.io/badge/python-3.12+-blue.svg)](https://www.python.org/downloads/)
[![License](https://img.shields.io/badge/license-TBD-lightgrey.svg)](LICENSE)
[![Code style: ruff](https://img.shields.io/badge/code%20style-ruff-000000.svg)](https://github.com/astral-sh/ruff)

**Red team toolkit for testing deepfake detection system robustness.**

Laundromatic applies anti-forensic transformations to images, audio, and video to evaluate how well detection systems perform against adversarial manipulation. It is designed for defensive security research and benchmarking.

## Purpose

This toolkit exists to help detection system developers and security researchers:

- **Test robustness**: Evaluate how detection systems perform against common evasion techniques
- **Benchmark solutions**: Compare vendor solutions under standardised adversarial conditions
- **Identify weaknesses**: Discover vulnerabilities before malicious actors exploit them
- **Improve defences**: Use findings to strengthen detection capabilities

## Intended Users

- Detection system vendors conducting internal red team exercises
- Security researchers evaluating deepfake detection robustness
- Government programmes benchmarking detection solutions (e.g., UK Home Office C581.2)
- Academic researchers studying anti-forensics and detection evasion

## Installation

Requires Python 3.12+.

```bash
# Using UV (recommended)
uv sync
uv run laundromatic --help

# Using pip
pip install laundromatic
laundromatic --help
```

For advanced ML transforms (adversarial perturbations, generative laundering):

```bash
uv sync --extra ml
# or
pip install laundromatic[ml]
```

## Quick Start

```bash
# Apply blur to an image
laundromatic image blur input.jpg output.jpg --strength 2.0

# Compress audio
laundromatic audio compress input.wav output.mp3 --bitrate 128

# Batch process a folder (apply random transforms to 30% of files)
laundromatic batch transform ./input ./output --percent 30
```

### Python API

```python
from laundromatic.transforms.image import blur, add_noise, compress

# Apply transforms programmatically
blurred = blur(image, strength=2.0)
noisy = add_noise(image, sigma=10)
compressed = compress(image, quality=75)
```

## Available Transforms

| Category | Transforms |
|----------|------------|
| **Image** | blur, noise, compression, resize, crop, rotation, colour shift, EXIF manipulation, and more |
| **Audio** | compression, noise injection, speed change, pitch shift, codec transcoding |
| **Video** | frame-level image transforms, recompression, framerate manipulation |

## Documentation

Full documentation: *Coming soon*

## Responsible Use

This toolkit is intended **exclusively for defensive security research, authorised red team exercises, and detection system benchmarking**.

**Do not use this software to:**
- Evade detection for malicious deepfakes
- Spread misinformation or disinformation
- Deceive individuals or organisations
- Violate any applicable laws or regulations

Users are responsible for ensuring their use complies with all applicable laws, regulations, and ethical guidelines. The authors accept no liability for misuse.

## Contributing

Contributions welcome. Please ensure code passes `ruff check .` and `pytest` before submitting.

## License

*License TBD*

---

Built for the UK Home Office Deepfake Detection Challenge (C581.2).
