Collect representative telemetry
Gather structured logs or features used during model training, and label any known clean and poisoned examples where possible.
Detect poisoned training data. Flag suspicious records.
Data-poisoning detection aims to identify malicious or corrupted training inputs that would change model behaviour. Practical systems combine supervised signals where available, anomaly detection on telemetry, and analyst review to confirm true attacks. Key difficulties include attacker adaptiveness, feature drift, and maintaining low false positive load on analysts.
Learning concept · Not a validated service
Data-poisoning detection aims to identify malicious or corrupted training inputs that would change model behaviour. Practical systems combine supervised signals where available, anomaly detection on telemetry, and analyst review to confirm true attacks. Key difficulties include attacker adaptiveness, feature drift, and maintaining low false positive load on analysts.
A proposed application is an analyst-facing alerting tool that flags suspicious records (e.g. abnormal event rates or large egress volumes) for human review before those records are used to retrain models. For security settings a human reviewer must stay in charge — this starter is not suitable for automatic blocking in production.
Gather structured logs or features used during model training, and label any known clean and poisoned examples where possible.
Train an unsupervised detector such as Isolation Forest on known-good data and tune contamination to control analyst workload.
Measure recall on held-out synthetic or labelled poisoning cases and track analyst false positive rate and mean time to detect.
Surface alerts with feature slices and raw events so analysts can confirm, triage, and block poisoned inputs from training pipelines.
The supplied starter synthesises numeric 'logs' (normal and injected suspicious rows), fits an IsolationForest with contamination=0.05, adds a fitted -1/1 prediction column called 'anomaly_score', and prints the alerts. It uses purely synthetic features and an unsupervised anomaly detector rather than a dedicated poisoning classifier or instrumentation that links alerts to training inputs.
logs = pd.concat([normal, suspicious], ignore_index=True)
detector = IsolationForest(contamination=0.05, random_state=42)
logs["anomaly_score"] = detector.fit_predict(logs)
alerts = logs[logs["anomaly_score"] == -1]
The starter uses a tiny synthetic dataset of numeric aggregates and an IsolationForest to flag outliers; it does not implement poisoning-specific labelling, attack simulation against a model, or analysis of poisoned training examples. The synthetic 'suspicious' rows are simple outliers and do not demonstrate adaptive poisoning strategies, and the test does not measure recall or analyst false positive workload.
A proposed extension: link anomaly alerts to the training pipeline so flagged records are quarantined and presented in a triage UI where analysts can label and approve or reject them before retraining.
This is a potential application pathway, not a delivered product. The supplied starter does not implement this service or validate it with real users.
Networkers Home runs this topic inside its Cybersecurity Course, with placement support and hands-on labs.