EncoderMI: A Membership Inference Attack Against Contrastively Pretrained EncodersEncoderMI: Membership Inference against Pre-trained Encoders in Contrastive Learning
The researchers propose EncoderMI, a membership inference attack against contrastively pretrained image encoders, which the authors claim is the first membership inference method for such encoders. The method requires only black-box access to the encoder and exploits its overfitting to training data: for inputs in the training set, two augmented versions yield more similar feature vectors, whereas for inputs not in the training set they are less similar, and on this basis it determines whether an input is in the training dataset. The authors note that it can be used by data holders to audit whether public data was used without authorization for pretraining, and can also be used by attackers to harm the privacy of private or sensitive training data. The authors evaluate it on image encoders they pretrained themselves on multiple datasets and on OpenAI's released CLIP image encoder (pretrained on 400 million image-text pairs collected from the internet); results show the method achieves high accuracy, precision and recall. The authors also explore early stopping as a countermeasure to prevent overfitting; it can reduce the attack's accuracy, but it also causes classification accuracy loss in downstream classifiers built on that encoder, and there is a trade-off between the two.