-
Notifications
You must be signed in to change notification settings - Fork 34
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
Malicious attack: Gradient inversion #137
Conversation
src/configs/algo_config.py
Outdated
|
||
default_config_list: List[ConfigType] = [traditional_fl] | ||
# default_config_list: List[ConfigType] = [traditional_fl] | ||
default_config_list: List[ConfigType] = [test_fl_inversion] |
There was a problem hiding this comment.
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
src/configs/sys_config.py
Outdated
@@ -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/" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
revert this change
src/configs/sys_config.py
Outdated
"gia_attackers":[1] | ||
} | ||
|
||
current_config = grpc_system_config_gia |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
revert this change too
src/data_loaders/cifar.py
Outdated
@@ -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), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why?
src/test_inversion.ipynb
Outdated
There was a problem hiding this comment.
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) | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this required?
src/utils/model_utils.py
Outdated
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") |
There was a problem hiding this comment.
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
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