Hiring experts in STEM, law, finance and more, with pay up to $100+/hr in some fields. Learn more →
← All projects

Adversarial Attack on ML

Coder, Tester, Data Analyzer & Researcher · 2025

PythonsklearnTensorFlow
Adversarial Attack ML logo

Overview

Machine learning firewalls and intrusion detection systems learn to block malicious network traffic from labelled examples, which makes their training data a target. This project studies data poisoning, where an attacker injects or manipulates training records to corrupt what the model learns. Using the NSL-KDD network traffic benchmark, we trained binary classifiers (normal vs. attack) on balanced data, then compared a clean model against models trained on poisoned data using three strategies: attack hiding, DoS poisoning and random label flipping.

What I did

I worked on this as part of a team. I wrote the code that prepares the data before training: poisoning it with the attack strategies, randomly flipping labels, and balancing the normal and attack classes so the models weren't biased toward the majority class. I also tested how the models performed on clean and poisoned data, analyzed the results across the different attacks, and researched how data poisoning works and how it affects detection systems.

Adversarial Attack ML training plots clean_accuracy data
Accuracy training plot for model trained with clean data
Adversarial Attack ML training plots clean_loss data
Loss training plot for model trained with clean data

Gallery

Adversarial Attack 10% DOS Confusion Matrix result
10% DOS poisoned training material
Adversarial Attack 10% Attack Hiding Confusion Matrix result
10% Attack hiding poisoned training material
Adversarial Attack 10% Random Flipping Confusion Matrix result
10% Random Flipping poisoned training material