KimDahye / deeplearning_study

0 stars 0 forks source link

Lecture 13: Face recognition #13

Open kingheadcat opened 2 years ago

kingheadcat commented 2 years ago

Face recognition


Face verification vs. face recognition

Verification (Binary Classification)


Multi Class Classification vs Multi Label Classification

강의에서는 데이터들 간의 유사도 함수를 학습하는 형태의 방법론을 보였다.


One-shot learning: Meta Learning

Meta refers to a level above. 목표과제(labeled data)와는 간접적일 수 있는 목표함수(meta)를 학습하는 방법론 (한국웹에서는 보통 학습/해결 방법을 학습하는 방법 이라고 소개한다.) 일반적인 ML에서는 모델의 결과와, 데이터의 레이블에 기반한 loss(cost) function을 만들어 최소화 시키는 방법으로 학습하는데 $$ f_{loss}(y, \hat{y}) $$ Meta leaning 에서는 보통 문제를 해결하기 위한 다른 함수(e.g. 유사도)를 정의하고 해당 함수의 기능을 최대화하는 방식으로 학습한 후 해당 함수를 이용하며 문제를 해결한다.


One-shot learning: refs


Triplets loss: intro


Triplets loss: code

def batch_all_triplet_loss(labels, embeddings, margin, squared=False):
    """Build the triplet loss over a batch of embeddings.

    We generate all the valid triplets and average the loss over the positive ones.

    Args:
        labels: labels of the batch, of size (batch_size,)
        embeddings: tensor of shape (batch_size, embed_dim)
        margin: margin for triplet loss
        squared: Boolean. If true, output is the pairwise squared euclidean distance matrix.
                 If false, output is the pairwise euclidean distance matrix.

    Returns:
        triplet_loss: scalar tensor containing the triplet loss
    """
    # Get the pairwise distance matrix
    pairwise_dist = _pairwise_distances(embeddings, squared=squared)

    anchor_positive_dist = tf.expand_dims(pairwise_dist, 2)
    anchor_negative_dist = tf.expand_dims(pairwise_dist, 1)

    # Compute a 3D tensor of size (batch_size, batch_size, batch_size)
    # triplet_loss[i, j, k] will contain the triplet loss of anchor=i, positive=j, negative=k
    # Uses broadcasting where the 1st argument has shape (batch_size, batch_size, 1)
    # and the 2nd (batch_size, 1, batch_size)
    triplet_loss = anchor_positive_dist - anchor_negative_dist + margin

Face Verification in the lecture


Face Verification in the lecture


Neural Style Transfer


Visualize CNN: layer 1

각 layer에서 unit의 최대로 activate 되게 하는 fetch를 보인 것 입니다.


Visualize CNN: layer 2


Visualize CNN: layer 3


Visualize CNN: layer 4


Visualize CNN: layer 5


Visualize CNN: other method


Neural Style Transfer: cost function


Neural Style Transfer: generate

$$ J(S, C, G) $$ 에서 S,C 를 고정하고, gradient descent로 G를 업데이트


Neural Style Transfer: content cost function


Neural Style Transfer: style cost function


Activation들의 조합/곱은(k, k`)


1D and 3D Generalizations

Conv 1d


Conv 3d


Conv 3d: rels

kingheadcat commented 2 years ago

face_rec.pdf c.pdf

kingheadcat commented 2 years ago

클린봇 데뷰 발표자료 https://deview.kr/data/deview/session/attach/1600_T2_%EC%B5%9C%EA%B2%BD%ED%98%B8_%EC%A1%B0%EA%B8%88%20%EB%8D%94%20%EC%95%84%EB%A6%84%EB%8B%A4%EC%9A%B4%20%EB%8C%93%EA%B8%80%20%EA%B2%BD%ED%97%98%EC%9D%84%20%EC%9C%84%ED%95%B4%EC%84%9C%20Task%20%EC%A0%95%EC%9D%98%20%EB%B6%80%ED%84%B0%20%EC%84%9C%EB%B9%84%EC%8A%A4%EA%B9%8C%EC%A7%80%20Cleanbot%202%20%EA%B0%9C%EB%B0%9C%EA%B8%B0.pdf