As far as I can tell the current pixel loss compares the ground truth spoof traces with spoof traces generated from real live images.
Should it not be the following instead? (Changed selection of traces_a)
Please correct me if I'm wrong, and thank you for your time.
Original:
traces_a[:bsize,...] - Selects the spoof traces from live images
img - dimenstions [2 * bsize, ...] Where first half are real live images and other half is real spoof images.
synth1 - dimenstions [bsize, ...] Where all are synthetic spoof images.
You concat live images with synthetic spoof images for batch normalisation. Assuming that tf.cond() always picks img_a2 for simplicity.
_imga2 - dimensions [2 bsize, ...] Where all first half is real live images and the other half are synthetic spoof images.
_tracesa - dimensions [2 bsize, ...] Where all first half are spoof traces from live images, the other half are spoof traces from the synthetic spoof images.
_tracesa[:bsize,...] - Selects the spoof traces from live images.
_tracesa[bsize:,...] - Would select the spoof traces from the synthetic spoof images.
Issue:
https://github.com/yaojieliu/ECCV20-STDN/blob/c79f1f8c615d2b8471b3df29da881bb18dd54c90/train.py#L108
As far as I can tell the current pixel loss compares the ground truth spoof traces with spoof traces generated from real live images. Should it not be the following instead? (Changed selection of traces_a) Please correct me if I'm wrong, and thank you for your time.
Original: traces_a[:bsize,...] - Selects the spoof traces from live images
pixel_loss = l1_loss(traces_a[:bsize,...], tf.stop_gradient(trace_warp))
Proposed change: traces_a[bsize:,...] - Would select the spoof traces from the synthetic spoof images
pixel_loss = l1_loss(traces_a[bsize:,...], tf.stop_gradient(trace_warp))
In your paper you mention that you calculate per pixel loss of spoof traces like this:
The flow of data according to train.py:
img - dimenstions [2 * bsize, ...] Where first half are real live images and other half is real spoof images. synth1 - dimenstions [bsize, ...] Where all are synthetic spoof images.
_imga2 - dimensions [2 bsize, ...] Where all first half is real live images and the other half are synthetic spoof images. _tracesa - dimensions [2 bsize, ...] Where all first half are spoof traces from live images, the other half are spoof traces from the synthetic spoof images.
The loss step.
pixel_loss = l1_loss(traces_a[:bsize,...], tf.stop_gradient(trace_warp))
_tracesa[:bsize,...] - Selects the spoof traces from live images. _tracesa[bsize:,...] - Would select the spoof traces from the synthetic spoof images.