Martlgap / octuplet-loss

Repo for our Paper: Octuplet Loss: Make Your Face Recognition Model Robust to Image Resolution
MIT License
45 stars 6 forks source link

training dataset #3

Closed abcsimple closed 1 year ago

abcsimple commented 2 years ago

hi Martlgap,

Your work was amazing. Are you willing to provide the dataset file ("/mnt/ssd2/test_embs.pkl") ? Meanwhile, the file seems contains both basic training data and downsimpled data, am I correct?

Thx

Martlgap commented 2 years ago

Hi @abcsimple, that code and file were just used for testing whether PyTorch and TensorFlow implementation produce the same results. I uploaded it with the purpose of demonstrating the usage of both loss functions. I haven´t saved the file - data:-> Embeddings of Aligned Images (first half original, second half downsampled versions), labels:-> Classes of Aligned Images Does this help you out?

abcsimple commented 2 years ago

@Martlgap thx for your reply, that's really helpful! Recently I'm trying to implement octuplet loss on my model and have few questions. Hope you can help me:

  1. I've trained a model based on arcface, and it has a good performance on my own test dataset. Then I tried to fine-tune the model based on octuplet loss, the accuracy decreases rapidly. Did you have such issue in the past?

  2. The paper said "... can be easily applied to existing networks to ...". Actually, I think octuplet loss is a little different with other loss functions, even triplet loss. Octuplet loss requires double the mini-batch, and the down-sampled imgs should be feeded to backbone to get the features first, after that, Octuplet loss can be used like any other loss function

  3. Can you explain the implement of "bicubic kernel" and "anti-aliasing"? (If you are willing to provide the code for training and data preprocessing, question 2&3 would be easier to figure out)

  4. I'm confused about the meaning of "empty set(LFW,CALFW,...,AgeDB)" in Table 1 of the paper. For example, the second result in the first row '50.82', it looks like you tested a resnet50 pretrained model in some test dataset, and the data was downsampled to 77 and upsampled to 112112, but I'm not sure what the target test dataset is.

Hope you don't mind my stupid questions ;p

Martlgap commented 1 year ago

Hi @abcsimple,

  1. It´s hard to tell what causes that decrease. Maybe check your learning rate and ensure your code is doing what you intend. We didn´t experienced such behavior.
  2. Sure, it is a little different than classical loss functions like, e.g. cross-entropy. But it should not be a big deal to double the batch size and then use the provided loss function.
  3. We use the bicubic Kernel of Tensorflow/PyTorch and their Anti-Aliasing. You can find more information about that in their documentation. (I'll upload our TensorFlow code for the resizing)
  4. The Ø - symbol in Table 1 is indicating the average across all datasets in the brackets (LFW, CALFW, ...). So we tested our models on all those datasets and report the mean accuracy. And yes, they were downsampled to 7x7px and upsampled to 112x112px.
abcsimple commented 1 year ago

hi @Martlgap, your reply is really helpful. One more question, to get the result in Table 1, what downsampled resolution did you use in the training data of octuplet loss fine-tuning. Did you train the model based on 7px/14px/.../112px and get the average or any specifical resolution? Meanwhile, did the pretrained models use the same training dataset with octuplet fine-tuning strategy (which is MS1M-V2)?

Martlgap commented 1 year ago

Hi @abcsimple,