Recently, test-time adaptation (TTA) has been proposed as a promising solution for addressing distribution shifts. It allows a base model to adapt to an unforeseen distribution during inference by leveraging the information from the batch of (unlabeled) test data. However, we uncover a novel security vulnerability of TTA based on the insight that predictions on benign samples can be impacted by malicious samples in the same batch. To exploit this vulnerability, we propose Distribution Invading Attack (DIA), which injects a small fraction of malicious data into the test batch. DIA causes models using TTA to misclassify benign and unperturbed test data, providing an entirely new capability for adversaries that is infeasible in canonical machine learning pipelines. Through comprehensive evaluations, we demonstrate the high effectiveness of our attack on multiple benchmarks across six TTA methods. In response, we investigate two countermeasures to robustify the existing insecure TTA implementations, following the principle of "security by design". Together, we hope our findings can make the community aware of the utility-security tradeoffs in deploying TTA and provide valuable insights for developing robust TTA approaches.
翻译:最近,有人提议试验时间适应(TTA)是解决分销转移问题的一个很有希望的解决办法,通过利用一组(未贴标签的)测试数据提供的信息,使一个基准模型能够适应在推断过程中的意外分布;然而,我们发现TTA在安全方面的新脆弱性,其依据是,根据对良性样品的预测会受到同一批恶意样品的影响的洞察力,我们发现对无害样品的预测会受到同一批中的恶性样品的影响。为了利用这一脆弱性,我们提议分配干预攻击(DIA),它将一小部分恶意数据输入试验批次。DIA造成模型使用TA将良性和无扰的测试数据错误分类,为对手提供在金刚机学习管道上不可行的全新能力。通过全面评估,我们展示了我们对六种TA方法多重基准的攻击的高度效力。作为回应,我们根据“设计安全”的原则,调查两种反措施,以巩固现有的不安全TTA执行。我们希望我们的调查结果能够使社区了解部署TTA的效用-安全权衡,并为发展可靠的TTATA方法提供宝贵的洞察。