floodsung / LearningToCompare_FSL

PyTorch code for CVPR 2018 paper: Learning to Compare: Relation Network for Few-Shot Learning (Few-Shot Learning part)
MIT License
1.04k stars 268 forks source link

Data Leakage! #48

Open HussainAlasmawi opened 2 years ago

HussainAlasmawi commented 2 years ago

I found that there is a data leakage in the testing which leads to an increase in the accuracy of the model.

The model contains batch normalization and the batch normalization is supposed to behave differently for training and testing. Since we are testing we suppose to put the model in the model.eval() mode to make the batch normalization behave as in testing but since we didn't add this mode the batch normalization will behave as in the training. it's considered as data leakage and it's increasing the accuracy (for example the Omniglot 5-way 1-shot increases the accuracy from ~90% to 99.6%). Kindly, we need to check this error.