🛰️ DriftRadar-Vision
ML-Driven Drift Detection, Auto-Retraining, and Promotion System for Vision Models
Built with Evidently, Great Expectations, MLflow, Hydra, and GitHub Actions
🌌 Overview
DriftRadar-Vision is an advanced, production-ready drift monitoring and adaptive retraining pipeline for vision models. It automatically detects dataset, embedding, and prediction drifts using Evidently and Great Expectations — then decides, retrains, stages, and promotes models via GitHub Actions and MLflow.
🚀 Designed for autonomous ML lifecycle management, vision model governance, and drift accountability.
🧱 Core Architecture
┌────────────────────────┐
│ data_prod.py │
│ (Simulate batches) │
└──────────┬─────────────┘
│
┌──────────▼─────────────┐
│ drift_check.py │
│ (Evidently + embedding)│
└──────────┬─────────────┘
│ summary.json
┌──────────▼─────────────┐
│ dq_validate.py │
│ (Great Expectations) │
└──────────┬─────────────┘
│
┌──────────▼─────────────┐
│ retrain.py │
│ (Policy-based trigger)│
└──────────┬─────────────┘
│
┌────────────▼───────────────┐
│ train.py / eval.py │
│ (MLflow + ONNX export) │
└────────────┬───────────────┘
│
┌────────────────▼────────────────┐
│ drift_cron.yml + retrain_smoke│
│ (GitHub Actions automation) │
└─────────────────────────────────┘
🧩 Features
| Category | Description |
|---|---|
| 🧠 Detection | Dataset drift, embedding drift (PSI), and prediction confidence drift |
| 🔍 Validation | Great Expectations quality checks on input batches |
| ⚙️ Retraining | Automatic retrain trigger from policy thresholds |
| 🧾 Reporting | Evidently + GE HTML reports stored under artifacts/reports/ |
| 🚀 Automation | Full CI/CD loop via GitHub Actions: Drift → PR → Smoke → Promote |
| 🧮 Backtesting | Historical drift replay simulation with backtest.py |
| 📊 Dashboard | Streamlit dashboard with 5 pages for QA, drift, metrics, backtests |
| 🧱 MLOps | MLflow registry, Hydra configs, ONNX export, reproducible runs |
⚙️ Quick Start
1️⃣ Create environment
conda create -n driftradar python=3.11
conda activate driftradar
pip install -r requirements.txt
2️⃣ Run initial training
python -m driftradar_vision.train --config-path configs --config-name model.yaml
3️⃣ Evaluate and export ONNX
python -m driftradar_vision.eval --config-path configs --config-name eval.yaml --model-config-path configs --model-config-name model.yaml
4️⃣ Drift check (Evidently)
python -m driftradar_vision.drift_check --config-path configs --config-name drift.yaml --data-config-path configs --data-config-name data.yaml
5️⃣ Policy-based retrain
python -m driftradar_vision.retrain --config-path configs --config-name policy.yaml
6️⃣ Backtest thresholds
python -m driftradar_vision.backtest --mode simulate --days 10 --clean-days 3 --drift-days 7
7️⃣ Compare metrics (PR body)
python -m driftradar_vision.artifacts --what metrics-delta
🧠 Example Decision Output
{
"retrain_triggered": true,
"reason": "conf_drop(56.1%)>=thr(10.0%)",
"embedding_top5_psi_mean": 15.29,
"psi_threshold": 0.2,
"run_id": "63a1a44c58b14e55b3e8e0b2d56f3bff",
"staging_version": 7,
"onnx_staging_path": "artifacts/runs/onnx/staging.onnx"
}
🔄 GitHub Actions CI/CD
| Workflow | Trigger | Purpose |
|---|---|---|
ci.yml |
Push / PR | Lint, build, pytest |
drift_cron.yml |
Schedule | Run drift_check + auto PR |
retrain_smoke.yml |
Pull Request | Mini retrain + GE + ONNX check |
promote.yml |
/promote comment |
Promote Staging → Production |
📈 Dashboard Pages
| Page | Description |
|---|---|
| Overview | Summary of latest production metrics and versions |
| Data Quality | Great Expectations blockers and warnings |
| Drift Monitor | Evidently HTML + PSI statistics |
| Model Metrics | MLflow metrics, latency, ECE, size |
| Backtest | Historical FPR/FNR, replayed days, threshold tuning |
🧪 Backtest Result Example
{
"mode": "simulate",
"n_days": 10,
"counts": {"tp": 6, "fp": 1, "tn": 3, "fn": 0},
"rates": {"precision": 0.857, "recall": 1.0, "fpr": 0.25, "fnr": 0.0, "accuracy": 0.9}
}
🧰 Stack
- 🧠 PyTorch 2.3 — vision model backbone (ResNet-18)
- ⚙️ Hydra — configuration management
- 📈 Evidently — dataset & embedding drift
- 🧮 Great Expectations — data quality validation
- 📊 MLflow — experiment tracking & model registry
- 🧰 ONNX Runtime — inference validation
- 💾 GitHub Actions — CI/CD orchestration
- 🌐 Streamlit — dashboard visualization
🧪 MLflow Registry Example
| Stage | Version | Accuracy | ECE | Size (MB) |
|---|---|---|---|---|
| Production | 6 | 92.8% | 0.031 | 88.7 |
| Staging | 7 | 93.1% | 0.028 | 89.1 |
| Δ (Staging–Prod) | +0.3 | −0.003 | +0.4 |
🧭 Configuration Files
| File | Purpose |
|---|---|
configs/model.yaml |
Main training hyperparameters |
configs/data.yaml |
Dataset paths and augmentations |
configs/drift.yaml |
Evidently and embedding drift settings |
configs/policy.yaml |
Retraining & threshold policy |
configs/eval.yaml |
Evaluation and ONNX export |
configs/model-ci.yaml |
Fast smoke test variant |
🤖 Automated Promotion
Once drift_cron.yml detects drift:
- A Pull Request opens → with
needs-review+ reports attached. retrain_smoke.ymlvalidates ONNX + GE expectations.- Maintainer comments
/promoteto approve. promote.ymltransitions model to Production and updates dashboard.
📜 Citation
If you use DriftRadar-Vision in your work, please cite:
@software{mutlu2025driftradar,
author = {Abdulvahap Mutlu},
title = {DriftRadar-Vision: Autonomous Drift Detection and Retraining Pipeline for Vision Models},
year = {2025},
url = {https://github.com/abdulvahapmutlu/driftradar-vision}
}
👤 Author
Abdulvahap Mutlu M.Sc. in Artificial Intelligence | Deep Learning Engineer & Researcher 🔗 Website · 🐙 GitHub · 💼 LinkedIn
🧩 Related Projects
| Repository | Description |
|---|---|
| 🧠 Sherpa-ML | ML project scaffolding CLI with CI/CD & Docker |
| 🧬 ReproKit-ML | Deterministic reproducibility toolkit |
| ⚙️ QuantLab-8bit | Quantization lab for PTQ vs QAT |
| 🚦 EdgeServe-AB | A/B model router for ONNX Runtime |
| 🧮 Orbit-Boost | Novel boosting method for tree ensembles |
⭐ Contributing
git clone https://github.com/abdulvahapmutlu/driftradar-vision
cd driftradar-vision
pip install -r requirements.txt
pytest -v
Contributions, ideas, and benchmarks are always welcome — feel free to open a pull request!
🪪 License
Released under the MIT License — see LICENSE.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file driftradar_vision-0.1.0.tar.gz.
File metadata
- Download URL: driftradar_vision-0.1.0.tar.gz
- Upload date:
- Size: 40.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
675c7f964622829ce35f94a35bb1c1a9da05dc5726416d93bff2057e2360f8c4
|
|
| MD5 |
8fde0a4ab89dd91abe55d4b4803645fb
|
|
| BLAKE2b-256 |
aaa206314f369ea053922300beb7d7debf21165de0fe1fd16d830f0c9c6006ee
|
Provenance
The following attestation bundles were made for driftradar_vision-0.1.0.tar.gz:
Publisher:
release.yml on abdulvahapmutlu/driftradar-vision
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
driftradar_vision-0.1.0.tar.gz -
Subject digest:
675c7f964622829ce35f94a35bb1c1a9da05dc5726416d93bff2057e2360f8c4 - Sigstore transparency entry: 601182126
- Sigstore integration time:
-
Permalink:
abdulvahapmutlu/driftradar-vision@00985d80eb2e6278cf8b232d31e31438fcf47c12 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/abdulvahapmutlu
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@00985d80eb2e6278cf8b232d31e31438fcf47c12 -
Trigger Event:
release
-
Statement type:
File details
Details for the file driftradar_vision-0.1.0-py3-none-any.whl.
File metadata
- Download URL: driftradar_vision-0.1.0-py3-none-any.whl
- Upload date:
- Size: 46.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f45ae6352b91d53788b63894f38db0cc9a4560dc75f777b65654583779e23a0b
|
|
| MD5 |
e2057d580a5e1769f47cd056f946a0a1
|
|
| BLAKE2b-256 |
b694b5f00ff4f6ea7dc882d0b72279c01b4588302f1dcfc6fe42a3d1ac51da2b
|
Provenance
The following attestation bundles were made for driftradar_vision-0.1.0-py3-none-any.whl:
Publisher:
release.yml on abdulvahapmutlu/driftradar-vision
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
driftradar_vision-0.1.0-py3-none-any.whl -
Subject digest:
f45ae6352b91d53788b63894f38db0cc9a4560dc75f777b65654583779e23a0b - Sigstore transparency entry: 601182127
- Sigstore integration time:
-
Permalink:
abdulvahapmutlu/driftradar-vision@00985d80eb2e6278cf8b232d31e31438fcf47c12 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/abdulvahapmutlu
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@00985d80eb2e6278cf8b232d31e31438fcf47c12 -
Trigger Event:
release
-
Statement type: