FederatedAI / FATE

An Industrial Grade Federated Learning Framework
Apache License 2.0
5.59k stars 1.54k forks source link

fedpass算法实现相关问题 #5543

Closed 123bazhahei closed 1 week ago

123bazhahei commented 4 months ago

请问 python/fate/ml/nn/test/test_fedpass_lenet.py 是否是论文 FedPass: Privacy-Preserving Vertical Federated Deep Learning with Adaptive Obfuscation 中的算法实现? image 如果是的话,有下面几个问题:

  1. test_fedpass_lenet.py 似乎没有 passive party 对 feature 的 obfuscation
  2. fedpass 实现在 agg_layer 中,是在 host(passive方)经过 bottom_model 之后执行,按上图不应该是在 guest(activate方)执行嘛
talkingwallace commented 4 months ago

hi,这个是按照论文开发的 混淆的逻辑在agglayer里,可以参考下agglayer里的代码

talkingwallace commented 4 months ago

具体代码在model_zoo 下的agg layer

123bazhahei commented 4 months ago

看到 agg_layer 了,混淆逻辑没问题,只是看论文里的用法:在 passive party feature 上使用,active party top_model 之前使用 和单测中的用法不一样,所以单测只是为了测试混淆逻辑,还是说单测还原了论文的实验?

talkingwallace commented 4 months ago

是会有一点不一样的 但是这个代码使用的是原论文的代码方法。单侧(passive party)的用法也是和原论文一致,还原了效果的

123bazhahei commented 4 months ago

好奇问一点,feature 的混淆逻辑为啥不做呢? 我理解论文中的做法:passive party feature 混淆 保护 feature,active party 混淆 保护 label;按照单侧的做法 passive party 在 agg_layer 混淆 embedding(论文中这个混淆在 active party),active party 因为没有自己的 feature 只是把 embedding 做聚合+top model,这么做似乎不能保护 label

123bazhahei commented 4 months ago

还有一个问题:predict 的时候 这个 passport 还是需要过的对吧

talkingwallace commented 4 months ago
  1. 没太明白您的意思,passive party的feature 混淆要用到passport,不会在active party 进行的?
  2. passport会跟随模型保存的,预测需要passport
123bazhahei commented 4 months ago

第一个问题:这个图里 g_theta 的实现在哪里 image image

123bazhahei commented 4 months ago

第二个问题:图中 g_w 这个passport 应该是在 active party(guest) 执行,为什么在代码里看上去在 passive party(host) 中执行 image

talkingwallace commented 4 months ago

guest(acitve) & host(passive) 都有这个agglayer,但是host的agglayer会执行passport相关的逻辑,而guest的是负责从host接受数据&反向传播,详细的可以看agglayer下fedpass 在host方的代码(你想要了解的图片里的红框部分)

123bazhahei commented 4 months ago

你还没明白我的问题,我的问题是论文的图上画的 host feature 需要执行 passport,但代码里 host feature 并没有执行passport 呀 image image 请问 bottom model 在哪里执行了 passport

talkingwallace commented 4 months ago

image passport相关的逻辑在这里

下面的这个过程 image 就是在 feature -> bottom_model -> agg_layer这个过程里完成的

123bazhahei commented 4 months ago

image 这里 g_theta 是 passport 呀,G_theta 是 bottom_model,应该是 feature -> passport -> bottom_model,代码里 feature -> bottom_model -> passport 不是和论文里不一样吗

talkingwallace commented 4 months ago

Hi, 你可以把这部分理解为一个完整的过程。这里实现的时候也是以论文代码为准的,论文代码里,比如说Lenet model,也是遵顼一个feature-> bottom_model -> passport的顺序的: image

123bazhahei commented 4 months ago

请问论文代码有开源吗,看上去和论文的图是反着的... image

talkingwallace commented 4 months ago

Hi~ 你可以发邮件问一下作者的,我不知道作者是否允许把代码分享其他人

123bazhahei commented 3 months ago

好的,谢谢