Vision drift monitoring with Great Expectations + Evidently + MLflow (Milestone A: DQ gates).
Project description
๐ฐ๏ธ 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.
Project details
Release history Release notifications | RSS feed
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: