Corresponding repo for "Busting the Ballot: Voting Meets Adversarial Machine Learning". We show the security risk associated with using machine learning classifiers in United States election tabulators using adversarial machine learning attacks.
- Dataset DOI: https://zenodo.org/records/15458710
- Paper: coming soon!
Models/: Architecture code for SVM, SimpleCNN, VGG-16, ResNet-20, CaiT, and Twins transformer presented in paper. Denoising Autoencoder architecture is also present here.Train/: Training pipeline with hyperparameters for each model across each dataset.Utilities: Helper functions compiled for modifying dataloaders, evaluating model accuracy, converting dataloaders to images, etc.ImageProcessing: Pipeline for creating pages then extracting bubbles from said pages post-print. Broken down into three parts:ExtraSpacePNG.py- takes a directory of bubbles and creates .png pages for printing.ImageRegistration.py- registers a page post-print and scan and aligns it with the pages pre-print.ExtractBubblesFromWhitespacePNG.py- takes registered pages and extracts bubbles.
Twins: Dependent files for training and running Twins model, taken from: https://github.com/Meituan-AutoML/Twins
Before training, the voter dataset needs to be downloaded.
- Run
python3 LoadVoterData.pyin Utilities. This should create a folder titleddatain your Utilities folder. - Run
python3 VoterLab_Classifier_Functions.pyin Utilities. This should create two foldersTrained_RGB_VoterLab_Models/andTrained_Grayscale_VoterLab_Modelsin yourTrainfolder. Inside these folders areTrainLoaders.thandTrainGrayscaleLoaders.thwhich contain the training and validation loaders for your RGB and Grayscale models respectively.
.yml with necessary libraries are provided. It is worth noting that most dependent libraries are for the Twins model.
Training, validation, and image processing (as shown in the paper) were done using a NVIDIA TITAN RTX and NVIDIA GeForce RTX 4090.