Convolutional neural network (iv) recognition and conversion style

Face Recognition

1, One-shot learning (a learning):

Face recognition only be done by a picture that can only be learned through a sample.

similarity function:

d(img1,img2) = degree of difference between images

Recognition tasks (verification):

if d(img1,img2) ≤ τ:“same”;

else: “different”

 

2, Siamese network:

The image converted through the neural network 128 convolutional coding, referred to as "encoding of X (I) ", referred to as F (X (I) ).

 d(x(1),x(2)) = || f(x(1)) - f(x(2)) ||2.

 

3, Triplet loss (loss triplets):

(1) Background:

Each set of data is three images, the results are compared to "Positive" and "Negative"

Desired result: || F (A) - F (P) || 2 ≤ || F (A) - F (N) || 2  i.e. d (A, P) ≤ d (A, N),

即 || f(A) - f(P) ||2 - || f(A) - f(N) ||2 ≤ 0. 

Avoid f (A) = where f (P) = f (N), it is necessary to improve the formula:

 || f(A) - f(P) ||2 - || f(A) - f(N) ||2 + α ≤ 0,

即 || f(A) - f(P) ||2 + α ≤  || f(A) - f(N) ||2.

Wherein α is called interval (margin).

 

(2) loss function:

Given 3 images A,P,N;

L(A,P,N) = max{|| f(A) - f(P) ||2 - || f(A) - f(N) ||+ α, 0}

= [Sigma L J (A (i) , P (i) , N (i) ), where i runs from 1 to m.

Training set of 1,000 individual photographs of 10,000 (an average of one person 10).

 

(3) selecting triples:

If the randomly selected triplet, d (A, P) + α ≤ conditions d (A, N) can easily be satisfied, the training effect can not be achieved, it is necessary to satisfy the selection of d (A, P) ≈ d (A, N) triad.

 

4, facial verification and dichotomous:

When y = 1, it is determined to be the same person; when 0 y =, is determined not to be the same person.

 

Migration style

1. What is the style Migration (style transfer)?

 

2, the cost function:

J(G) = α*Jcontent(C,G) + β*Jstyle(S,G)

内容代价函数 Jcontent[l](C,G) = 1/2 * || a[l][C] - a[l][G] ||2  

风格损失函数 Jstyle(S,G):

  style matrix风格矩阵,用于计算两个每一对激活项之间的相关系数:

  

   

   

   Jstyle(S,G) = ∑ λ[l] * Jstyle[l](S,G)

Guess you like

Origin www.cnblogs.com/orangecyh/p/11885553.html