This is GitHub repository for research on robust overfitting in adversarial training.
Deep neural networks can be easily fooled by adversarial attacks, which are small, hidden changes to inputs that cause model to make wrong predictions. Adversarial training helps fix this, but models often run into a problem known as robust overfitting. This means that later in training, model's performance on test attacks gets worse even though its training loss keeps improving.
Research Objectives:
- Replicate adversarial training results from Rice et al. (2020) paper using a PreActResNet-18 model on CIFAR-10.
- Find exact point where model stops learning real robustness and starts memorizing specific perturbation patterns.
- Principal Investigator: Dr. Nicholas Q. Tran (Department of Mathematics and Computer Science)
- Student Researcher: Kaiwen Du (Computer Science)
- Create virtual environment (an isolated Python workspace that keeps this project's dependencies separate from other Python projects on your system):
python3 -m venv .venv
- Activate & install dependencies:
source .venv/bin/activate pip3 install -r requirements.txt - Verify setup:
python3 verify_setup.py
Robust-Overfitting/
├── Checkpoints/ # Saved model checkpoints during training
│ └── diagnostic/ # Local diagnostic run checkpoints (e.g., epoch_1.pt)
├── Models/ # Model architecture definitions
│ └── preact_resnet.py # PreActResNet-18 model architecture in PyTorch
├── Notes/ # Reading notes and progress reports
│ ├── Goodfellow.md # Literature notes on FGSM and adversarial training
│ ├── Rice.md # Literature notes on robust overfitting
│ └── Progress_report.md # Weekly progress reports
├── data/ # [Ignored] CIFAR-10 dataset files (downloaded automatically)
├── runs/ # [Ignored] TensorBoard logging directories
├── .gitignore # Files and folders ignored by Git
├── Proposal.md # Project proposal document
├── README.md # Project documentation and setup
├── requirements.txt # Python package dependencies
├── train.py # Core adversarial PGD training script
└── verify_setup.py # Setup verification script
-
Objective: Review and summarize foundational literature on adversarial training and robust overfitting.
- Read and digest "Explaining and Harnessing Adversarial Examples" by Goodfellow et al. (2014). Learn definitions of adversarial examples/attacks, how they are generated via Fast Gradient Sign Method (FGSM), analyzing adversarial examples, and learn about how to defend these adversarial attacks.
- Read and digest "Overfitting in Adversarially Robust Deep Learning" by Rice et al. (2020). Learn about robust overfitting during adversarial training, and learn what are some methods to stop/reduce robust overfitting.
- Compile detailed reading notes for ourselves, which will be saved to the
Notesfolder.
-
Expectations: A solid theoretical understanding of adversarial examples and early stopping.
-
Progress Report & Deliverables: Documented in
Notes/Progress_report.md.
-
Objective: Configure the local development environment, set up cloud compute resources, integrate the PreActResNet-18 model architecture, verify the setup with a verification script, and create the presentation slides based on feedback.
- Configure required Python virtual environment, set up gitignore, and specify dependencies in
requirements.txt. - Create a Lambda Labs cloud account, set up billing information and payment methods, and gain familiarity with the cloud platform for accessing high-performance GPU resources (such as NVIDIA A10G instances) needed to train deep learning models.
- Integrate the PreActResNet-18 model architecture in PyTorch (
Models/preact_resnet.py), which will be downloaded from standard implementations (as adopted in the Rice et al. 2020 codebase) for the purpose of ensuring exact experimental replication. - Write a setup verification script (
verify_setup.py) to verify package imports, check hardware/device availability (such as CUDA/MPS/CPU), and run a forward pass sanity check with the model to ensure the training environment is ready to go. - Create presentation slides summarizing the literature review with visual and mathematical explanations of adversarial attacks. These slides communicate our foundational understanding to the PI and will be reviewed and refined during the Friday meeting with Dr. Tran.
- Configure required Python virtual environment, set up gitignore, and specify dependencies in
-
Expectations: A fully operational local and cloud training environment, model implementation complete, and a completed presentation (with placeholders reserved for our own research findings) with a clear and logical flow.
-
Progress Report & Deliverables: Documented in
Notes/Progress_report.md.
-
Objective: Implement the Projected Gradient Descent (PGD)-based adversarial training pipeline and verify its correctness on a diagnostic test run. Lambda Labs will not be used yet this week; all local.
- Write the training script
train.pyusing thePreActResNet18architecture. Script should dynamically generate adversarial images using a 10-step PGD attack, which starts with random noise and makes pixel adjustments within a safety range (the$\epsilon$ -ball of$8/255$ ) so the edits remain invisible to human eyes. All of these should match exactly as in Rice et al. paper. - Configure and confirm that
train.pysaves model weights every 5 epochs toCheckpoints/folder. This allows us to analyze model's performance at different stages of training and pinpoint exactly where robust overfitting begins. - Configure and run a diagnostic test locally (for 1 epoch on 10% of CIFAR-10 data) to ensure the training loop, PGD attack, weight updates, checkpoints, and logging all work together without any memory crashes before moving to Lambda Labs.
- Write the training script
-
Expectations: A fully functional and verified training script (
train.py), ready for full training runs on Lambda Labs next week. -
Progress Report & Deliverables: Documented in
Notes/Progress_report.md.
-
Objective: Review and consolidate understanding of the Week 3 training pipeline, improve presentation skills and polish presentation slides, and run full training on Lambda Labs on Friday.
- Review
train.pyalongside the Week 3 progress report to make sure the full pipeline is understood and can be clearly explained. - Read "How To Give Strong Technical Presentations" provided by Dr. Tran and watch public speaking YouTube videos to improve delivery for upcoming presentations.
- Polish presentation slides, from teleprompter to figures and key talking points, with details spoken out loud from speaking notes.
- Adjust upcoming weekly schedules.
- Deploy
train.pyto Lambda Labs and start the full 200-epoch PGD adversarial training run, monitor for any unexpected timeouts or crashes, and download all model checkpoints once training completes (expected run time: 7-10 hours).
- Review
-
Expectations: A complete set of 40 model checkpoints in the
Checkpoints/directory covering the full 200-epoch run (saved every 5 epochs), ready for evaluation. -
Progress Report & Deliverables: Documented in
Notes/Progress_report.md.
-
Objective: Evaluate model robustness across all saved checkpoints to identify the robust overfitting point.
- Create an evaluation script
evaluate.pythat loads each of the 40 checkpoints produced by the Week 4 training run and tests them using PGD-20 on the CIFAR-10 test set. PGD-20 uses 20 attack steps instead of 10 used during training, making it a stronger test that gives a more rigorous and honest measure of how well each checkpoint actually holds up against adversarial images. - Record the clean accuracy, robust accuracy, and loss for each checkpoint in a CSV file so results can be reviewed conveniently.
- Plot the training and test robust accuracy curves across all 200 epochs using
matplotlibto identify the exact epoch where test robust accuracy peaks and begins to decline.
- Create an evaluation script
-
Expectations: A completed
evaluate.py, a populated results CSV, and a clear plot identifying the epoch where test robust accuracy peaks and begins to decline.
-
Objective: Run 3 additional training runs with different random seeds to confirm that the overfitting point identified in Week 5 is consistent and not a one-time result.
- Run
train.py3 more times from scratch using different--seedvalues. Using different starting points rules out the possibility that the overfitting point found in Week 5 was a coincidence of one particular run. train.pyautomatically saves TensorBoard logs for each run to theruns/directory, so accuracy and loss curves for all runs are captured without any extra setup.- Compare the peak robust accuracy epochs across all 4 runs (original plus 3 new) using
matplotlibto confirm the overfitting point appears consistently.
- Run
-
Expectations: Four total training runs (original plus 3 seed runs) with a confirmed consistent overfitting point across all runs.
-
Objective: Analyze results from all runs, generate final plots, and draft the findings section of the report.
- Aggregate the accuracy and loss metrics from all 4 training runs to compute the average and spread of the peak robust accuracy epoch across seeds.
- Create a plotting script
plot_results.pythat generates line charts showing clean vs. robust accuracy and training vs. test loss across all epochs and runs. - Draft the results section of the final report using the generated charts and aggregated numbers.
-
Expectations: A completed
plot_results.pywith final charts and a drafted results section.
-
Objective: Write the final report, update the presentation with our results, and clean up the repository.
- Write the final report
Report.mdcovering the research methodology, experimental setup, results, and conclusions. - Update
Notes/Presentation.pdfto include our experimental results and findings alongside the existing literature slides. - Clean up and add comments to
train.py,evaluate.py, andplot_results.pyso the code is easy to follow, and make sureREADME.mdandrequirements.txtare easy to follow for anyone else to run the project and replicate our behavior findings.
- Write the final report
-
Expectations: A submitted final report, an updated presentation with our results, and a clean public GitHub repository.
- Goodfellow, I. J., Shlens, J., and Szegedy, C. (2014). Explaining and Harnessing Adversarial Examples. ICLR.
- Rice, L., Wong, E., and Kolter, J. Z. (2020). Overfitting in adversarially robust deep learning. ICML.