ReSSL icon indicating copy to clipboard operation
ReSSL copied to clipboard

KNN evaluation

Open YoadTew opened this issue 4 years ago • 4 comments

Hey, Great paper! By the design of the loss and architecture , I would guess the learned representation should be good or even SOTA in KNN evaluation (that was also showed In DINO paper). I did not see such results on imagenet in the paper, did you try it? And if yes, can you share your results? Thanks!

YoadTew avatar Jul 27 '21 15:07 YoadTew

Sorry, I haven't done anything about the KNN evaluation, but it's a good idea to include this result. I'm currently working on other stuff, I will update this result when I'm free.

mingkai-zheng avatar Jul 28 '21 04:07 mingkai-zheng

BTW, you can use the following Code Snippet to load the pre-trained ResNet50 model (without the projection head). If you really need this result right now, I recommend you initialize the pre-trained model in this way and run it in the eval_knn.py file in dino repository.

    pre_train = resnet50()
    state_dict = torch.load(checkpoint_path, map_location='cpu')['model']
    for k in list(state_dict.keys()):
        if not k.startswith('module.encoder_q.net.'):
            del state_dict[k]
        if k.startswith('module.encoder_q.net.'):
            state_dict[k[len("module.encoder_q.net."):]] = state_dict[k]
            del state_dict[k]
    pre_train.load_state_dict(state_dict)

mingkai-zheng avatar Jul 28 '21 04:07 mingkai-zheng

If I will have time I will try to run this evaluation, I think it could be a nice addition to the paper. I will updade here If I will have the results

YoadTew avatar Jul 28 '21 10:07 YoadTew

Hi all, our article slightly improves this outstanding work and provides KNN results for the ReSSL method in the article (only experimental results in CIFAR-10, CIFAR-100, STL-10, and Tiny ImageNet are provided due to lack of experimental equipment). We welcome you to come together to exchange and learn. We also welcome your constructive comments on our work. The source code repository is here.

pc-cp avatar Jun 01 '23 03:06 pc-cp