triplet-reid icon indicating copy to clipboard operation
triplet-reid copied to clipboard

some question about triplet selection and training logs

Open zouxinh opened this issue 8 years ago • 7 comments

Thanks your work firstly. I have some question want to ask you: (1) In your paper 3.3 , your set batch size to 72 containing 18 persons with 4 images. I want to know whether you mean there are 72 triplet(if use batch hard) in one iteration during training and whether you update the network parameter when choose new batch in every iteration. (2) In your supplementary material, you provided the typical training logs. I can't understand the Subfigure (b) (blue plots) in Figures 6, 7, 8, and 9. Whether the 0,5,50,95,and 100-percenties within a mini-batch stand for the diffenerent distance between anchor-positive and anchor-nagetive?

Looking forward to your reply.

zouxinh avatar Sep 19 '17 06:09 zouxinh

Hi!

  1. Yes, there are 72 triplets in the batch-hard case in one iteration of the training. Yes, one iteration includes computing the gradient of the average loss across those 72 triplets, and then updating the network's parameters once using that gradient.
  2. The percentiles are a way of "plotting" a distribution along the Y axis. So they are the percentile of different things for the three different subplots, see the label on the Y axis of each plot for what it represents. More details: 2.1. The top left plot shows the length (2-norm) of the embedding vectors. 2.2. The top right plot shows the distribution of values (numbers) present in the embedding vectors. Take all embeddings, concatenate them into one huge vector, it's the distribution of numbers in that vector. 2.3. The bottom left plot, "Distance between embeddings," means all distances between all embeddings in one mini-batch, this includes both positives and negatives, but excludes a sample with itself. That's why the 5-percentile is so low there. This is the most important plot.

Hope that clears things up.

lucasb-eyer avatar Sep 19 '17 07:09 lucasb-eyer

Thanks for your quickly reply. I reference to your paper idea which use batch hard generate triplet, but I use the pre-train model(trained from softmax) to generate triplet list off-line. And I can't get a satisfactory result, so I think its important to train triplet on-line.

zouxinh avatar Sep 19 '17 09:09 zouxinh

I would definitely do online triplet selection, I played around with off-line first, and it was horrible.

I have heard people getting good results with training softmax first and then fine-tuning using triplets, so I would recommend you pursue that direction. It might be useful in that case to normalize the embeddings, though. I would be happy/curious if you can share results.

lucasb-eyer avatar Sep 20 '17 08:09 lucasb-eyer

I used triplet loss for face verification. Yes, there are some work use triplet alone to finetune classification model and succeed, like "deep face recognition". I have did some training finetune on webface dataset, but all of them seemed can't leave the "difficult" phase (loss was beyond 0.1 during 30000 iteration, and distance between embeddings can't be separated ). I think there are some tricks when use triplet alone finetune softmax model, and I want to adjust the some parameters like lr firstly. I will come back to tell you if I train a good model.

zouxinh avatar Sep 21 '17 06:09 zouxinh

Thanks for the details, and looking forward to your results, I'd even be interested to know what you tried if you don't get it to work! Adjusting lr is definitely the most important thing of all. Good luck!

lucasb-eyer avatar Sep 21 '17 10:09 lucasb-eyer

@lucasb-eyer Hi, I have some quetions about batch size, too. You said 'Yes, there are 72 triplets in the batch-hard case in one iteration of the training'. Is it for a batch containing 18 persons with 4 images? Because I carefully read your paper and my understanding is that there are 24 triplets in this case with 3x24=18x4.Have I got its meaning rigth? Oh, I figure it out. I mixed the concept of triplets and B in '3B'

liangbh6 avatar Dec 11 '17 04:12 liangbh6

Cool, glad you sorted it out!

lucasb-eyer avatar Dec 15 '17 14:12 lucasb-eyer