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

Malicious attack: Gradient inversion #137

Merged
merged 17 commits into from
Nov 15, 2024

Conversation

photonshi
Copy link
Collaborator

Launches gradient inversion attack using Jonas Geiping's InvertingGradients method:

https://github.com/JonasGeiping/invertinggradients

current supports malicious server in traditional FL, and malicious participant in fl-static


default_config_list: List[ConfigType] = [traditional_fl]
# default_config_list: List[ConfigType] = [traditional_fl]
default_config_list: List[ConfigType] = [test_fl_inversion]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to revert this chaneg

@@ -156,7 +157,7 @@ def get_digit_five_support(num_users: int, domains: List[str] = DIGIT_FIVE):
CIAR10_DPATH = "./datasets/imgs/cifar10/"

NUM_COLLABORATORS = 1
DUMP_DIR = "/mas/camera/Experiments/SONAR/abhi/"
DUMP_DIR = "/u/yshi23/sonar/src/expt_dump/test/"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

revert this change

"gia_attackers":[1]
}

current_config = grpc_system_config_gia
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

revert this change too

@@ -18,8 +18,8 @@ def __init__(self, dpath: str, rot_angle: int = 0) -> None:

self.train_transform = T.Compose(
[
T.RandomCrop(32, padding=4),
T.RandomHorizontalFlip(),
# T.RandomCrop(32, padding=4),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this file needed?

@@ -59,6 +60,19 @@ def send(self, dest: str | int | List[str | int], data: Any, tag: int = 0):
else:
print(f"Sending data to {dest}")
self.comm.send(dest=int(dest), data=data)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this required?

if kwargs.get("gia", False):
# print(data.shape, target.shape)
node_id = kwargs.get("node_id")
plot_and_save(data, target, filename=f"data_target_plot_{node_id}.png")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be getting saved in the log folder. You can see how we are logging other things

@tremblerz tremblerz merged commit 5e960ab into aidecentralized:main Nov 15, 2024
0 of 2 checks passed
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

Successfully merging this pull request may close these issues.

2 participants