Skip to content

About

Safe feature-space experiments for measuring defensive model robustness under adversarial drift.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Detector Resilience Lab

LR Lab ML SECURITY

Measure how detection fails.
Safe feature-drift experiments for defensive models

Stars Last commit Maintained

Profile · All projects · Issues

Project docs

Architecture · Benchmarks · Roadmap · Compatibility · Releasing · Security · Support · Change risk · Failure modes

5-minute demo · Examples · Source · Tests

Detector Resilience Lab

Detector Resilience Lab reproducible demo

Measure how detection fails.

Safe feature-space drift experiments for defensive model research.

Test Python 3.10+ MIT Version

30 秒看懂

在不可执行的数值特征上训练透明逻辑回归检测器,再对恶意标签样本施加固定种子的特征漂移,比较漂移前后的 TP / FP / TN / FN,并保留翻转样本的特征差值。

Labeled features → Train → Baseline → Safe drift → Degradation report

5 分钟 Demo

python -m pip install -e .
detector-resilience examples/features.csv --seed 7 --output report.json

仓库样例的固定结果:

阶段 TP FN Recall
Baseline 10 0 1.00
Feature drift 8 2 0.80

为什么值得研究

高测试集准确率不能说明模型面对分布漂移仍然可靠。报告同时输出模型退化、翻转样本和逐特征变化,便于讨论鲁棒性、反例与再训练策略。

边界

实验只修改 CSV 中的数值特征,不读取、生成或修改可执行文件,也不提供杀软绕过载荷。样例很小,只用于验证实验管线;结论不能外推到真实恶意软件数据集。

研究路线

加入交叉验证、校准曲线、多个分类器、特征归因、漂移检测与公开安全数据集适配器。

作者:LLR6 · MIT License

v0.2:不要只看一个分类阈值

模型在 0.5 阈值下掉 Recall,并不代表整个决策边界都同样脆弱。

现在可以同时扫描多个阈值:

detector-resilience examples/features.csv \
  --seed 7 \
  --strength 1.0 \
  --threshold 0.5 \
  --thresholds 0.3,0.4,0.5,0.6,0.7 \
  --output report.json

每个阈值都会记录:

  • baseline TP / FP / TN / FN
  • drift 后 TP / FP / TN / FN
  • recall_drop
  • false_positive_rate_delta

这样可以区分两件事:

  1. 模型本身在 feature drift 后整体退化;
  2. 只是某个固定 operating threshold 对 drift 特别敏感。

实验仍只修改数值特征 CSV,不处理或生成任何可执行文件。

Drift-strength curve

除了固定 --strength 和多阈值扫描,现在还可以直接观察 drift 强度曲线:

detector-resilience examples/features.csv \
  --seed 7 \
  --threshold 0.5 \
  --thresholds 0.3,0.5,0.7 \
  --strengths 0,0.5,1,1.5 \
  --output report.json

每个强度点记录:

  • baseline recall;
  • drift 后 recall;
  • recall drop;
  • drift 后 FPR;
  • flipped malicious sample 数。

strength=0 作为自检点,理论上不应产生 drift recall drop。CI 会自动运行这组实验并保存 JSON 报告。

Related LR Lab projects

Engineering Reference

Architecture · Security · Contributing · Changelog · Release checklist · Report schema

These files document the project's architecture, safety boundaries, reproducibility assumptions and release process.


Part of LR Lab · Security × AI × Android × Automation
Build things that are useful, inspectable, and reproducible.

About

Safe feature-space experiments for measuring defensive model robustness under adversarial drift.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages