TextAttack Adversarial ML: Attacking a Sentiment Classifier
A DistilBERT experiment using TextFooler to flip sentiment predictions with semantically preserving single-word substitutions.
Problem addressed
Demonstrating how semantically preserving input changes can produce high-confidence misclassification.
Personal Contribution
I built the classifier experiment and custom TextAttack model wrapper, ran a 20-example attack dataset, collected metrics, and mapped the technique to MITRE ATLAS.
Technologies
Architecture & System Design
The experiment used distilbert-base-uncased-finetuned-sst-2-english, a custom SentimentWrapper for TextAttack, the TextFoolerJin2019 recipe, and CSV result logging.
Review Methodology
Ran TextFooler against 20 examples, collected per-example word-change metrics and overall results, and mapped the attack to MITRE ATLAS AML.T0043 and OWASP LLM09.
Security Findings
Single-word substitutions flipped model predictions with greater than 99% confidence in documented examples while preserving semantic meaning.
Security Controls
Documented defensive directions include adversarial training, input normalization before tokenization, and ensemble-based anomaly detection.
Abstract
A reproducible adversarial-example experiment examining how minimal synonym substitutions affect high-confidence sentiment classification.
Limitations
The documented results describe a controlled sentiment-classifier experiment, not a generalized evaluation of other models or production systems.
Skills Demonstrated
Related Work
Security Labs & External Evidence
Supporting Evidence
https://vinayavasu.github.io/#projects
Read Research Details