Closed forrestsz closed 3 years ago
Hi @linqinghong,
Thank you for your interest. There are indeed a few issues.
It looks that you are immediately clustering the validation set with KMeans. Notice that it is better to apply the KMeans algorithm to the training features first and perform the fit method on the validation set afterwards. The training set is much larger which will result in a better coverage of the feature space (and therefore better results).
You should also use the L2-normalized features before the MLP head. For a ResNet-18, the dimension of the features should be 512. These features are better disentangled than the ones after the MLP head.
I experimented with MiniBatchKMeans (CPU) and Faiss (GPU), but the final results are more or less the same.
Hope this helps.
Thank for your reply, I will try your suggestion as soon! Thank!
OK. Please reach out if something goes wrong. Closing this issue for now.
I am having this same issue.
I have also tried the following, to no avail:
Thanks for any advice
Hi @cag472,
I was also getting around 45.0% K-means clustering accuracy on training features before MLP head.
But it got improved to around 65% ACC when I used l2-normalized training features before MLP head. I would recommend trying out l2-normalization.
Thanks.
Using Spherical k-means would provide slightly better results when applying to training+testing set. Please kindly refer to ICLR 2021 MiCE
Hi, Thank for your nice work. It inspired me most. I want to implement the result of pretext task + kmeans on CIFAR10 (65% ACC in paper) First, I download the checkpoint in here: https://drive.google.com/file/d/1Cl5oAcJKoNE5FSTZsBSAKLcyA5jXGgTT/view Then, I add some code in the eval.py as follow:
But i get the following result, which is far lower than the 65% in paper
Maybe I make some mistake in the calculation, can you tell me where I am wrong? Great thank for your time!