Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The problem of graph adversarial attacks #132

Open
renhl717445 opened this issue Mar 3, 2023 · 4 comments
Open

The problem of graph adversarial attacks #132

renhl717445 opened this issue Mar 3, 2023 · 4 comments

Comments

@renhl717445
Copy link

I would like to ask if the adversarial example attacks on the graph are all for GCN? Could it be applied to other inductive graph neural network models, such as GAT and GraphSAGE?

@ChandlerBang
Copy link
Collaborator

Hi,

Thanks for your interest in DeepRobust. I wanted to clarify a few points here:

  1. The most straightforward way to attack other models (GAT and GraphSAGE) is to use the attacked graph generated by GCN (which is the default backbone model). In detail, we first use attack methods to attack GCN model and obtain the attacked graph. Then we feed this attacked graph to other models. The attacked graph is shown to be able to transfer to attack other models.
  2. You can also use GraphSAGE/GAT as backbone models. But these models do not directly take the edge_weight as input, so we did modification on the model. An example is shown in test_prbcd_cora.py. Try:
pip install deeprobust==0.2.8
python examples/graph/test_prbcd_cora.py

@renhl717445
Copy link
Author

Thank you for your reply. I am running python examples/graph/test_gcn_jaccard.py --dataset cora, but an error occurs. Isn't the zip file loaded? I used python=3.8,pytorch=1.12.1,and deeprobust==0.2.7. There is no deeprobust==0.2.8.

/opt/conda/envs/graph/bin/python3.8 /root/.pycharm_helpers/pydev/pydevd.py --multiprocess --qt-support=auto --client localhost --port 37615 --file /home/Huali Ren/DeepRobust-master/examples/graph/test_gcn_jaccard.py
Connected to pydev debugger (build 223.8617.48)
cuda: True
Loading cora dataset...
python-BaseException
Traceback (most recent call last):
File "/opt/conda/envs/graph/lib/python3.8/site-packages/numpy/lib/npyio.py", line 420, in load
ret = NpzFile(fid, own_fid=own_fid, allow_pickle=allow_pickle,
File "/opt/conda/envs/graph/lib/python3.8/site-packages/numpy/lib/npyio.py", line 187, in init
_zip = zipfile_factory(fid)
File "/opt/conda/envs/graph/lib/python3.8/site-packages/numpy/lib/npyio.py", line 103, in zipfile_factory
return zipfile.ZipFile(file, *args, **kwargs)
File "/opt/conda/envs/graph/lib/python3.8/zipfile.py", line 1269, in init
self._RealGetContents()
File "/opt/conda/envs/graph/lib/python3.8/zipfile.py", line 1336, in _RealGetContents
raise BadZipFile("File is not a zip file")
zipfile.BadZipFile: File is not a zip file

Process finished with exit code 1

@ChandlerBang
Copy link
Collaborator

Hi, can you try it again? It works well on my side "pip install deeprobust==0.2.8"

@renhl717445
Copy link
Author

Yes, it still can't be installed on my side. In addition, I would like to ask whether IG's countersample generation code is provided by the source author? Because I found that the attack success rate obtained by running test_ig.py on citeseer dataset is less than 40%, but nettack's method can reach more than 90%. May I ask what parameters need to be adjusted?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants