Skip to content

A self-supervised approach to train Graph Neural Networks to defend itself against Adversarial Attacks through Contrastive Learning and Negative Sampling

Notifications You must be signed in to change notification settings

Deceptrax123/Defending-Graph-Neural-Networks-against-Adversarial-Attacks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Defending Graph Neural Networks against Adversarial Attacks

This repository was used in the Molecular Property Prediction Project. The pre-trained backbone can be extended for several other uses cases as well.

Running the Scripts

  • Follow the procedure detailed here to save the tensors of all molecular graphs.
  • You may use the SMILE strings from either Zinc or TwoSides. Note that TwoSides has 2 molecules per instance and different pairing and batching strategies need to be used to successfully run the scripts. The procedure for such a usecase is detailed here
  • Run the following command:
    pip install -r requirements.txt
  • Set the values for the paths in a .env file. The keys are detailed below.
  • Run train.py for the dataset of your choice. Further, you may be required to re-set the environment path. For such cases, linux/macOS users may use:
    export PYTHONPATH="/path/to/project/root"
  • Windows users are suggested to use bash terminal and run the above command.

Datasets Used

  • ZINC
  • TwoSIDES

Environment Variables

Key Value
graph_files path/to/graphs/data/processed/

You may send an email or raise an issue if there are any bugs.

About

A self-supervised approach to train Graph Neural Networks to defend itself against Adversarial Attacks through Contrastive Learning and Negative Sampling

Topics

Resources

Stars

Watchers

Forks

Languages