Search
moon
sun

Triplet loss (Weinberger et al. 2006) operates on a triplet of vectors whose labels follow ๐‘ฆ_๐‘–=๐‘ฆ_๐‘— and ๐‘ฆ_๐‘–โ‰ ๐‘ฆ_๐‘˜. That is to say two of the three (๐ณ_๐ข and ๐ณ_๐ฃ) shared the same label and a third vector ๐ณ_๐ค has a different label. In triplet learning literatures, they are termed anchor (z_i), positive (z_j), and negative (z_k), respectively. where ๐‘š again is a margin parameter that requires the delta distances between anchor-positive and anchor-negative to be larger than ๐‘š. A triplet may have the following three scenarios before any training.*

์ถœ์ฒ˜
์ˆ˜์ง‘์‹œ๊ฐ„
2021/08/14 08:29
์—ฐ๊ฒฐ์™„๋ฃŒ
1 more property
๊ทธ๋ฆฌ๊ณ  m ์˜ ์กด์žฌ๋ฅผ ์ดํ•ดํ•˜๊ธฐ ์œ„ํ•ด์„œ๋Š” ์•„๋ž˜ ๋‘ ์ƒํ™ฉ์„ ์ƒ๊ฐํ•ด๋ณด๋ฉด ํŽธํ•˜๋‹ค.
1.
m=0 ์ด๋ผ๊ณ  ์น˜๊ณ  label y_i ์™€ y_j ๊ฐ€ ๊ฐ™๊ณ , y_i ์™€ y_k ๊ฐ€ ๋ฉ€๋ฆฌ ๋–จ์–ด์ง„ ์ƒํ™ฉ
2.
m=0 ์ด๋ผ๊ณ  ์น˜๊ณ  label y_i ์™€ y_j ๊ฐ€ ๊ฐ™๊ณ , y_i ์™€ y_k ๋„ ๊ฐ™์€ ์ƒํ™ฉ
m ์ด ์—†๋‹ค๋ฉด ๋‘ ๊ฒฐ๊ณผ๋Š” ๋™์ผํ•˜๋‹ค. ํ•˜์ง€๋งŒ ํ™•์‹คํ•œ ๊ฒƒ์€ ์šฐ๋ฆฌ๊ฐ€ ๋ฐ”๋ผ๋Š” ์ƒํ™ฉ์ด 2๋ณด๋‹ค๋Š” 1์— ๊ฐ€๊น๋‹ค๋Š” ์‚ฌ์‹ค์ด๋‹ค.
*๋‚ด์šฉ์„ ๋ฐ”ํƒ•์œผ๋กœ ์ƒ๊ฐํ•ด๋ณด๋ฉด ์šฐ๋ฆฌ๋Š” ๋ฏธ๋ฆฌ ์•Œ๊ณ  ์žˆ์–ด์•ผ ํ•˜๋Š” ๊ฒƒ์ด ๋ฐ”๋กœ m ์ด๋‹ค. ์ด๊ฒƒ์„ ๋ฏธ๋ฆฌ ์•Œ์•„์•ผ, ์ ์ ˆํ•œ loss ๋ฅผ ์„ค๊ณ„ํ•  ์ˆ˜ ์žˆ๋Š” ๊ฒƒ์ด๋‹ค. ๋ฐ์ดํ„ฐ์…‹์˜ ํŠน์„ฑ์„ ํŒŒ์•…ํ•˜๋ฉด์„œ, ์ ์ ˆํ•œ m ์„ ์ฐพ์•„๋‚ด๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์€ ์ž‘์—…์„ Triplet mining ์ด๋ผ๊ณ  ํ•œ๋‹ค. easy: triplets with a loss of 0 because the negative is already more than a margin away from the anchor than the positive ์ธ ์ƒํ™ฉ์ด๋ผ๋ฉด ๋‹น์—ฐํžˆ ๋ณ€ํ™”ํ•˜๋Š” ๊ฒƒ์ด ์—†์„๊ฒƒ์ด๋‹ค. the FaceNet (Schroff et al. 2015) paper. Schroff et al. argued that triplet mining is crucial for model performance and convergence. They also found that the hardest triplets led to local minima early on in training, specifically resulted in collapsed models, whereas semi-hard triplets yields more stable results and faster convergence. ์ด๋ฏ€๋กœ hard: triplets where the negative is closer to the anchor than the positive ๋Š” ์ง€์–‘ํ•ด์•ผ ํ•œ๋‹ค๊ณ  ๋ฐํ˜€์ ธ ์žˆ๊ณ , semi-hard: triplets where the negative lies in the margin ์ธ ์ƒํ™ฉ์—์„œ ์‹œ์ž‘ํ•ด์•ผ ํ•œ๋‹ค๊ณ  ํ•œ๋‹ค.