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

Issues related to graph injection attacks on NIPA #145

Open
mmdhhhh opened this issue Aug 19, 2023 · 5 comments
Open

Issues related to graph injection attacks on NIPA #145

mmdhhhh opened this issue Aug 19, 2023 · 5 comments

Comments

@mmdhhhh
Copy link

mmdhhhh commented Aug 19, 2023

Hello author, I attempted to run the NIPA injection attack in the deeprobust library, but while reviewing the source code, I found some issues in the "deeprobust/graph/rl/nipa_env. py" file (as shown in the following figure). The variable N represents the number of nodes before injecting malicious nodes, self.all_nodes represent all nodes in the original graph. May I ask if self.injected_nodes represents the injected malignant nodes? If so, it should not take the index from the nodes in the original graph, is that correct?
`I O6OWS%D}BUSW9GHBC754

@ChandlerBang
Copy link
Collaborator

ChandlerBang commented Aug 19, 2023

Hi,

The input adjacency matrix already contains the injected nodes. Please see the file below.

def init_setup():
data = Dataset(root='/tmp/', name=args.dataset, setting='nettack')
injecting_nodes(data)

@mmdhhhh
Copy link
Author

mmdhhhh commented Aug 20, 2023

Thank you very much for your answer!
The input adjacency matrix does indeed include injection nodes, but at this point, the degree of the injected nodes is 0 because the injection nodes have not yet been connected to the nodes in the original graph (the "injecting_nodes" function in the "deeprobust/examples/graph/test_nipa. py" file seems to have only changed the shape of the initial adjacency matrix). However, the variable "N" in the "deeprobust/graph/rl/nipa_env. py" file represents the number of nodes with a degree greater than 0, which is the number of nodes in the original graph (the degree of all nodes in the graph I chose to attack is greater than 0), and the variable "self. all_nodes" should represent the index of all nodes in the original graph. I also debugged the code, which confirms my point.
PF$YVT){2DA3EP @5S_YL
In the above figure, I printed the shapes of the feature matrices before and after injecting nodes. Before injecting nodes, the number of nodes was 2708, and after injecting nodes, the number of nodes was 2735. Therefore, the index of the injected nodes should be 2708-2734. However, I checked the index stored in the variable "self.injected_nodes" in the "deeprobust/graph/rl/nipa_env. py" file, and it looks like this:
R$ XZ}9 @YGOROQQ 4K_X2P
The value of the variable "self.injected_nodes" is actually stored between 2681 and 2707.
I hope you can check it out and correct me if I'm wrong.

@mmdhhhh
Copy link
Author

mmdhhhh commented Aug 25, 2023

Hi,

The input adjacency matrix already contains the injected nodes. Please see the file below.

def init_setup():
data = Dataset(root='/tmp/', name=args.dataset, setting='nettack')
injecting_nodes(data)

Hi,

The input adjacency matrix already contains the injected nodes. Please see the file below.

def init_setup():
data = Dataset(root='/tmp/', name=args.dataset, setting='nettack')
injecting_nodes(data)

Hello, could you please reply to me?

@ChandlerBang
Copy link
Collaborator

Hi mmdhhhh,

Thank you for pointing out. I agree that there is a bug in this file. Can you help me fix this issue and submit a pull request to this repo? I appreciate your help.

@mmdhhhh
Copy link
Author

mmdhhhh commented Aug 30, 2023

Thank you for your answer!
I will submit a pull request soon.

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