Skillpedia
الوكلاء35k · #7818

detecting-data-and-model-poisoning

ما الذي تفعله

تتحقق هذه المهارة مما إذا كانت بيانات التدريب أو نماذج الذكاء الاصطناعي قد أُفسدت عن قصد. تبحث عن شذوذات قد تجعل النموذج يتصرف بشكل خاطئ أو تحتوي على عيوب مخفية.

متى تستخدمها

  • ✓عندما تريد تدريب نموذج ببيانات ليست من إنتاجك.
  • ✓عندما تستخدم نموذجًا مدرّبًا مسبقًا تم تنزيله من الإنترنت.
  • ✓عندما تشتبه في أن نموذجًا يتصرف بشكل غريب.

رابط المهارة

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/detecting-data-and-model-poisoning/SKILL.md

انسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.

طريقة الاستخدام

أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.

رسالة جاهزة للصق

استخدم هذه المهارة لمساعدتي: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/detecting-data-and-model-poisoning/SKILL.md اقرأ ملف SKILL.md في هذا الرابط ونفّذ تعليماته لمهمتي.
تريد أن يجد الذكاء الاصطناعي مهارات مثل هذه بنفسه؟ثبّت خادم Skillpedia MCP المجاني: سطر واحد، ويبحث في 15,000+ مهارة قبل كل مهمة.ثبّته في دقيقة واحدة →

مثال على ما تطلبه من الذكاء الاصطناعي

“تحقق مما إذا كان هذا النموذج المُنزّل آمنًا قبل استخدامه.”

5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.

كيف تعمل

تستخدم المهارة تقنيات لتحليل البيانات والنموذج. تبحث عن أنماط غير معتادة في بيانات التدريب، وتتحقق مما إذا كان النموذج يتفاعل بشكل غريب مع « مُحفِّزات » خفية معينة.

المحتوى التقني (ملف SKILL.md الأصلي)

النص الأصلي من المؤلف، مباشرة من GitHub.

Detecting Data and Model Poisoning

Authorized-use-only notice: This skill includes routines that craft poisoned samples and backdoor triggers for defensive validation. Generate and use poisoned data and backdoored models only in isolated test environments you control. Never deploy a backdoored model or distribute poisoned datasets.

Overview

Data poisoning and model backdooring attack the integrity of an ML system at training time rather than at inference. In data poisoning (MITRE ATLAS AML.T0020 Poison Training Data), an adversary injects manipulated samples into the training, fine-tuning, or RAG corpus so the resulting model misbehaves — degraded accuracy, targeted misclassification, or an attacker-chosen bias. In model backdooring (MITRE ATLAS AML.T0018 Backdoor ML Model), the model behaves normally on clean inputs but produces an attacker-chosen output whenever a hidden trigger (a pixel patch, a rare token, a phrase) is present. Both are amplified by ML supply-chain compromise (AML.T0010): poisoned public datasets, trojaned pre-trained weights downloaded from a hub, or a malicious model serialization. This is OWASP LLM04:2025 Data and Model Poisoning.

Detection spans the pipeline. On the data side: provenance and integrity checks, statistical outlier and label-flip detection, and de-duplication of suspiciously near-identical samples. On the model side: activation-clustering and spectral-signature analysis (which exploit the fact that poisoned samples activate the network differently than clean ones) and trigger reconstruction. On the supply-chain side: verifying weights hashes/signatures and refusing unsafe serialization formats (pickle-based .bin/.pt) in favor of safetensors. This skill implements all three using IBM's Adversarial Robustness Toolbox (ART), Cleanlab for label-quality issues, and integrity tooling.

When to Use

  • Before training/fine-tuning on third-party or user-contributed data.
  • Before deploying a model built on a downloaded pre-trained checkpoint.
  • During an ML supply-chain security review.
  • When investigating anomalous model behavior tied to specific inputs (possible backdoor trigger).
  • As a CI/CD gate that scans datasets and model artifacts before they enter the pipeline.

Prerequisites

  • Python 3.10+ and a virtual environment.
  • Install the tooling:
python -m venv .venv && source .venv/bin/activate

# IBM Adversarial Robustness Toolbox — poisoning detection defenses
pip install adversarial-robustness-toolbox

# Cleanlab — label/data quality issue detection
pip install cleanlab

# Modeling + safe serialization + hashing
pip install numpy scikit-learn safetensors

# (Choose one framework backend ART can wrap)
pip install tensorflow   # or: pip install torch

Objectives

  • Verify dataset and model-weight provenance and integrity (hashes/signatures, safe formats).
  • Detect label-quality issues and outliers in training data with Cleanlab.
  • Detect poisoned samples in a trained model using ART activation clustering.
  • Confirm findings with ART spectral-signature analysis.
  • Probe a suspect model for backdoor triggers and quantify trigger-induced misclassification.
  • Produce a poisoning-assessment report mapped to ATLAS AML.T0020 / AML.T0018.

MITRE ATT&CK Mapping

ID Official Name Relevance
AML.T0020 Poison Training Data Injection of manipulated samples into the training corpus
AML.T0018 Backdoor ML Model Trigger-activated hidden behavior in the trained model
AML.T0010 ML Supply Chain Compromise Poisoned public datasets / trojaned downloaded weights
AML.T0024 Exfiltration via ML Inference API Some poisoning aims to leak data via the model's responses

Workflow

1. Verify data and model provenance/integrity

Refuse artifacts whose hash/signature you cannot verify, and prefer safetensors over pickle-based formats (pickle can execute code on load).

# Verify a downloaded checkpoint against a published SHA-256
sha256sum model.safetensors
# compare to the hub-published digest

# Flag unsafe pickle-based weights in a directory
find ./models -type f \( -name "*.bin" -o -name "*.pt" -o -name "*.pkl" -o -name "*.ckpt" \)
# safe_load.py — load weights without executing pickle
from safetensors.numpy import load_file
weights = load_file("model.safetensors")   # no arbitrary code execution

…

الأسئلة الشائعة

ما هو « data poisoning »؟

هو أن يُدخل شخص بيانات مزيفة أو معدّلة في تدريب النموذج، ليجعله يخطئ أو يحمل تحيزات.

ما هو « model backdooring »؟

هو أن يعمل النموذج بشكل طبيعي، لكنه يُنفّذ إجراءً غير مرغوب فيه عند ظهور كلمة أو صورة معينة (« المحفّز ») في المدخلات.

لماذا أتحقق من « سلسلة التوريد »؟

لضمان ألا تكون النماذج والبيانات التي تنزّلها من مصادر أخرى قد عُبث بها لتحتوي على عيوب أمنية أو « أبواب خلفية ».

التفاصيل

الوصف الأصلي من المؤلف

Identify poisoned training data and backdoored ML models across the pipeline using IBM's Adversarial Robustness Toolbox (activation clustering, spectral signatures, trigger reconstruction), Cleanlab for label-quality issues, and supply-chain checks like weight-hash verification and safetensors enforcement. Use before training or deploying on third-party/user-contributed data or downloaded checkpoi

repo: mukul975/Anthropic-Cybersecurity-Skills

الشعبية

نجوم GitHub
35k
الترتيب
#7818
الترخيص
Apache-2.0
آخر تحديث
31‏/8‏/2026

هل هذه المهارة مفيدة؟

0

سجّل الدخول للتصويت.

التعليقات

  • …

المزيد من المهارات من هذا المستودع

مهارات مشابهة