Measure how detection fails.
Safe feature-drift experiments for defensive models
Profile · All projects · Issues
Architecture · Benchmarks · Roadmap · Compatibility · Releasing · Security · Support · Change risk · Failure modes
5-minute demo · Examples · Source · Tests
Measure how detection fails.
Safe feature-space drift experiments for defensive model research.
在不可执行的数值特征上训练透明逻辑回归检测器,再对恶意标签样本施加固定种子的特征漂移,比较漂移前后的 TP / FP / TN / FN,并保留翻转样本的特征差值。
Labeled features → Train → Baseline → Safe drift → Degradation report
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
模型在 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_dropfalse_positive_rate_delta
这样可以区分两件事:
- 模型本身在 feature drift 后整体退化;
- 只是某个固定 operating threshold 对 drift 特别敏感。
实验仍只修改数值特征 CSV,不处理或生成任何可执行文件。
除了固定 --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 报告。
- Detection Threshold Lab — inspect threshold trade-offs before model drift.
- LR-SOC-Copilot — move from model output to evidence-backed investigation.
- NightWatch — rule-based detection and event correlation.
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.
