Lune

CCS2021Top-tier venue

EncoderMI: Membership Inference against Pre-trained Encoders in Contrastive Learning

Hongbin Liu, Jinyuan Jia, Wenjie Qu, Neil Zhenqiang Gong

Abstract

Given a set of unlabeled images or (image, text) pairs, contrastive learning aims to pre-train an image encoder that can be used as a feature extractor for many downstream tasks. In this work, we propose EncoderMI , the first membership inference method against image encoders pre-trained by contrastive learning. In particular, given an input and a black-box access to an image encoder, EncoderMI aims to infer whether the input is in the training dataset of the image encoder. EncoderMI can be used 1) by a data owner to audit whether its (public) data was used to pre-train an image encoder without its authorization or 2) by an attacker to compromise privacy of the training data when it is private/sensitive. Our EncoderMI exploits the overfitting of the image encoder towards its training data. In particular, an overfitted image encoder is more likely to output more (or less) similar feature vectors for two augmented versions of an input in (or not in) its training dataset. We evaluate EncoderMI on image encoders pre-trained on multiple datasets by ourselves as well as the Contrastive Language-Image Pre-training (CLIP) image encoder, which is pre-trained on 400 million (image, text) pairs collected from the Internet and released by OpenAI. Our results show that EncoderMI can achieve high accuracy, precision, and recall. We also explore a countermeasure against EncoderMI via preventing overfitting through early stopping. Our results show that it achieves trade-offs between accuracy of EncoderMI and utility of the image encoder, i.e., it can reduce the accuracy of EncoderMI, but it also incurs classification accuracy loss of the downstream classifiers built based on the image encoder.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

34 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • The Privacy Onion Effect: Memorization is Relative cites Membership Inference Attacks Against Machine Learning Models
  • The Privacy Onion Effect: Memorization is Relative cites Deep Learning with Differential Privacy
  • Membership Inference Attacks Against Machine Learning Models cites Stealing Machine Learning Models via Prediction APIs
  • Membership Inference Attacks Against Machine Learning Models cites Deep Learning with Differential Privacy
  • Dataset Inference for Self-Supervised Models cites A Simple Framework for Contrastive Learning of Visual Representations
  • Dataset Inference for Self-Supervised Models cites Stealing Machine Learning Models via Prediction APIs
  • Dataset Inference for Self-Supervised Models cites Learning Transferable Visual Models From Natural Language Supervision
  • AdvCLIP: Downstream-agnostic Adversarial Examples in Multimodal Contrastive Learning cites Learning Transferable Visual Models From Natural Language Supervision
  • AdvCLIP: Downstream-agnostic Adversarial Examples in Multimodal Contrastive Learning cites Downstream-agnostic Adversarial Examples
  • Downstream-agnostic Adversarial Examples cites AdvCLIP: Downstream-agnostic Adversarial Examples in Multimodal Contrastive Learning
  • Learning Transferable Visual Models From Natural Language Supervision cites A Simple Framework for Contrastive Learning of Visual Representations
  • Please Tell Me More: Privacy Impact of Explainability through the Lens of Membership Inference Attack cites Membership Inference Attacks Against Machine Learning Models
  • Please Tell Me More: Privacy Impact of Explainability through the Lens of Membership Inference Attack cites Deep Learning with Differential Privacy
  • Downstream-agnostic Adversarial Examples cites A Simple Framework for Contrastive Learning of Visual Representations
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers34

  1. The Privacy Onion Effect: Memorization is RelativeNicholas Carlini, Matthew Jagielski, Chiyuan Zhang, Nicolas Papernot et al.NeurIPS 2022 · 175 citations
  2. AdvCLIP: Downstream-agnostic Adversarial Examples in Multimodal Contrastive LearningZiqi Zhou, Shengshan Hu, Minghui Li, Hangtao Zhang et al.ACM MM 2023 · 62 citations
  3. Dataset Inference for Self-Supervised ModelsAdam Dziedzic, Haonan Duan, Muhammad Ahmad Kaleem, Nikita Dhawan et al.NeurIPS 2022 · 59 citations
  4. Please Tell Me More: Privacy Impact of Explainability through the Lens of Membership Inference AttackHan Liu, Yuhao Wu, Zhiyuan Yu, Ning ZhangS&P 2024 · 52 citations
  5. Downstream-agnostic Adversarial ExamplesZiqi Zhou, Shengshan Hu, Ruizhi Zhao, Qian Wang et al.ICCV 2023 · 45 citations

Builds on23

  1. Learning Transferable Visual Models From Natural Language SupervisionAlec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh et al.ICML 2021 · 47,906 citations
  2. A Simple Framework for Contrastive Learning of Visual RepresentationsTing Chen, Simon Kornblith, Mohammad Norouzi, Geoffrey E. HintonICML 2020 · 24,064 citations
  3. Deep Learning with Differential PrivacyMartín Abadi, Andy Chu, Ian J. Goodfellow, H. Brendan McMahan et al.CCS 2016 · 7,620 citations
  4. Membership Inference Attacks Against Machine Learning ModelsReza Shokri, Marco Stronati, Congzheng Song, Vitaly ShmatikovS&P 2017 · 5,137 citations
  5. Stealing Machine Learning Models via Prediction APIsFlorian Tramèr, Fan Zhang, Ari Juels, Michael K. Reiter et al.USENIX Security 2016 · 2,088 citations

Related papers

  1. StolenEncoder: Stealing Pre-trained Encoders in Self-supervised LearningYupei Liu, Jinyuan Jia, Hongbin Liu, Neil Zhenqiang GongCCS 2022 · 23 citations
  2. BadEncoder: Backdoor Attacks to Pre-trained Encoders in Self-Supervised LearningJinyuan Jia, Yupei Liu, Neil Zhenqiang GongS&P 2022 · 200 citations
  3. Detecting Backdoor Samples in Contrastive Language Image PretrainingHanxun Huang, Sarah Monazam Erfani, Yige Li, Xingjun Ma et al.ICLR 2025
  4. Practical Membership Inference Attacks Against Large-Scale Multi-Modal Models: A Pilot StudyMyeongseob Ko, Ming Jin, Chenguang Wang, Ruoxi JiaICCV 2023 · 51 citations
  5. Rethinking Membership Inference Attacks for CLIPLluís GómezAAAI 2026
Dusk over the sea between two cliffs drawn in fine vertical lines