Code for the paper: NeuPerm: Disrupting Malware Hidden in Neural Network Parameters by Leveraging Permutation Symmetry.
This work is based on a patent-pending request, and is licensed for non-commerical non-derivative use only.
See the License.
- Create a
condaPython environment:conda create --channel-priority flexible -n neuperm -f environment.yaml. - Set
IMAGENET12_ROOTin neu_perm/config.py to a directory that contains the files of the ImageNet12 validation dataset.
- Configure run parameters in experiments/exp1.py:
model_names: List of model names; options are:['densenet121','resnet50','resnet101','vgg11','llama-3.2-1b']prune_amounts: List of floats between 0 and 1; what fraction of the parameters to prune.epsilons: List of floats to use as the scale of the normal random noise.n_repeats: Positive integer. number of times to repeat experiments.device: Either'cpu'or'cuda'. What device to run models on.batch_size: Batch size for inference.
- Run the script:
- (Recommended) run detached from terminal:
nohup python -u experiments/exp1.py > out_exp1.txt
- (Recommended) run detached from terminal:
Since this is based on replicated MaleficNet models, I won't publish the code for this experiment as it's based on code that's not mine.