SlideShare una empresa de Scribd logo
1 de 23
FaceNet:
A Unified Embedding for
Face Recognition and Clustering
서치솔루션 김현준
Goal of FaceNet
• 다음을 만족하는 임베딩 함수를 찾는다
• Invariant
• 표정, 조명, 얼굴 포즈 …
• 같은 사람의 얼굴 임베딩은 가깝다
• 다른 사람의 얼굴 임베딩은 멀다
Goal of FaceNet
• 다음을 만족하는 임베딩 함수를 찾는다
• Invariant
• 표정, 조명, 얼굴 포즈 …
• 같은 사람의 얼굴 임베딩은 가깝다
• 다른 사람의 얼굴 임베딩은 멀다
• 이미 잘 되는 분야 아닌가?
Previous Works
• 얼굴 인식용 네트워크
• bottleneck layer의 벡터 사용
• 간접적
• Loss function은 분류에 대해 정의됨
• 벡터가 우리가 원하는 특성을 갖는다는 보장이 없다
• 비효율적
• 모르는 얼굴에 대해서도 잘 동작할까?
• 큰 사이즈 (1000s of dimension)
• 기타 노력들
• PCA로 벡터 축소
• 3D alignment
• Classification & Verification loss 혼합
FaceNet의 특징
• 작은 벡터
• 128D
• 원하는 임베딩 벡터의 특징을 바로 학습
• Triplet loss
• 같으면 가까워지고 다르면 멀어져라
• 복잡한 alignment가 필요 없다
• Scale, translation만 적용
• 많은 데이터로 invariance 특징을 학습함
• Data-driven
• End-to-end
적용 분야
• Face verification
• 두 장의 사진이 같은/다른 사람이냐
• Face classification
• 가장 가까운 얼굴로 분류
• Nearest Neighbor
• Face clustering
• 임베딩이 Euclidean distance에 존재
• 기존 클러스터링 그대로 적용 가능
Triplet Loss
• 세 개의 데이터
• Anchor (𝑥 𝑎): 기준 얼굴
• Positive (𝑥 𝑝
): 기준과 같은 인물의 얼굴
• Negative (𝑥 𝑛): 기준과 다른 인물의 얼굴
• 같으면 가까워지고 다르면 멀어져라
Triplet Loss (Cont’)
• 우리의 바램
• Anchor와 Negative의 거리가
• Anchor와 Positive의 거리보다
• 최소한 𝛼만큼 멀리 있으면 좋겠다
Triplet Loss (Cont’)
• 우리의 바램
• Anchor와 Negative의 거리가
• Anchor와 Positive의 거리보다
• 최소한 𝛼만큼 멀리 있으면 좋겠다
• 수식
Triplet Loss (Cont’)
• Loss
• Hinge Loss: [𝑥]+= max(0, 𝑥)
• Margin 최대화
• Constraint:
• Euclidean space
• d-dimensional hypersphere
• 𝛼=0.2로 고정
Triplet Selection
• 두 명의 사람이 각각 10장의 사진을 가질 때
가능한 triplet 의 수
• #사람 X #Anchor X #Positive #Negative
• 2 X 10 X 9 X 10 = 1800
• 대량의 학습데이터에서는
• 너무 많은 triplet의 수
• 전부 학습에 도움이 되는 건 아니다
Triplet Selection (Cont’)
• 학습에 도움이 되는 triplet을 골라보자
• 어려운 문제를 풀수록 배우는게 많겠지?
• Hard positive: 가장 멀리 있는 positive
• Hard negative: 가장 가까이 있는 negative
• Mini-batch에서 골라보자
• 사이즈: 1,800
• 매 step마다 모든 데이터를 뒤질 수는 없지
• 잘못 레이블 된 데이터를 피할 수 있다
• 모든 데이터를 뒤질 경우 찾는 것:
• Hard positive: 다른 사람인데 같은 이름이 붙은 사진
• Hard negative: 같은 사람인데 다른 이름이 붙은 사진
Triplet Selection (Cont’)
• 학습 디테일
• Mini-batch에 약 40개의 identity
• Hard-positive 안씀
• 모든 positive 사용
• 안정적인 학습
• 초반에 약간 빠른 수렴
• 학습 초반에 Hard-negative는 너무 어렵다
• Local minima에 빠짐
• 좀 더 쉬운 Semi-hard 사용
• Anchor와 positive를 정한 뒤 positive보다 먼 negative 선택
• Positive와 거리가 비슷해서 hard라고 말할 수 있다
Models
• Category 1
• Zeiler&Fergus 기반 모델
• 1x1 convolution 추가
• NN1
• Category 2
• GoogleNet 기반 모델
• NN1과 비교
• 약 20배 적은 파라미터
• 최대 5배까지 적은 계산 량
• NN2~4
• 입력 크기: 220x220, 160x160, 96x96
• NNS1~4
• 모바일을 위한 작은 모델들
NN2 architecture
NN2 architecture
𝐿2 Pooling
왜 𝐿2 Pooling 일까? 왜 저 자리일까? 아무 언급 없음
Experiments
• Train dataset: Unknown
• Test datasets: 자체 DB
• Hold-out test set
• Personal photos
• Evaluation
• Cross validation
• Test dataset로 부터 Same/Diff의 threshold d 학습
• Validation rate: VAL(d)
• 같은 사람을 같다고 예측한 비율
• False accept rate: FAR(d)
• 다른 사람을 같다고 예측한 비율
FLOPS vs. Accuracy trade-off
Evaluated on Personal Photos dataset
And the others
Image quality
(NN1, hold-out DB)
Embedding
Dimensionality
(NN1, hold-out DB)
Training
data size
(NN2 변형)
Experiments (Cont’)
• Test datasets
• LFW
• YouTube Faces Database
• Evaluation
• Cross validation
• Test dataset로 부터 Same/Diff의 threshold d 학습
• Train/validation set은 DB에서 지정
Experiments (Cont’)
• LFW
• 고정된 영역 crop: 98.87%±0.15
• Detect & align: 99.63%±0.09
13 pair중 5개는
잘못된 레이블
Experiments (Cont’)
• YouTube Faces Database
• 95.12%±0.39
• 처음 1000개의 프레임만 사용
• 95.18%
Thank you!

Más contenido relacionado

La actualidad más candente

Intuitive & Scalable Hyperparameter Tuning with Apache Spark + Fugue
Intuitive & Scalable Hyperparameter Tuning with Apache Spark + FugueIntuitive & Scalable Hyperparameter Tuning with Apache Spark + Fugue
Intuitive & Scalable Hyperparameter Tuning with Apache Spark + Fugue
Databricks
 
3D Point Cloud analysis using Deep Learning
3D Point Cloud analysis using Deep Learning3D Point Cloud analysis using Deep Learning
3D Point Cloud analysis using Deep Learning
Data Science Milan
 
PR-284: End-to-End Object Detection with Transformers(DETR)
PR-284: End-to-End Object Detection with Transformers(DETR)PR-284: End-to-End Object Detection with Transformers(DETR)
PR-284: End-to-End Object Detection with Transformers(DETR)
Jinwon Lee
 

La actualidad más candente (20)

StyleCLIP: Text-Driven Manipulation of StyleGAN Imagery
StyleCLIP: Text-Driven Manipulation of StyleGAN Imagery StyleCLIP: Text-Driven Manipulation of StyleGAN Imagery
StyleCLIP: Text-Driven Manipulation of StyleGAN Imagery
 
Deep Learning for Computer Vision: Data Augmentation (UPC 2016)
Deep Learning for Computer Vision: Data Augmentation (UPC 2016)Deep Learning for Computer Vision: Data Augmentation (UPC 2016)
Deep Learning for Computer Vision: Data Augmentation (UPC 2016)
 
Intuitive & Scalable Hyperparameter Tuning with Apache Spark + Fugue
Intuitive & Scalable Hyperparameter Tuning with Apache Spark + FugueIntuitive & Scalable Hyperparameter Tuning with Apache Spark + Fugue
Intuitive & Scalable Hyperparameter Tuning with Apache Spark + Fugue
 
3D Point Cloud analysis using Deep Learning
3D Point Cloud analysis using Deep Learning3D Point Cloud analysis using Deep Learning
3D Point Cloud analysis using Deep Learning
 
Face Detection.pptx
Face Detection.pptxFace Detection.pptx
Face Detection.pptx
 
CNN
CNNCNN
CNN
 
Object Detection Methods using Deep Learning
Object Detection Methods using Deep LearningObject Detection Methods using Deep Learning
Object Detection Methods using Deep Learning
 
DeepWalk: Online Learning of Social Representations
DeepWalk: Online Learning of Social RepresentationsDeepWalk: Online Learning of Social Representations
DeepWalk: Online Learning of Social Representations
 
Focal loss의 응용(Detection & Classification)
Focal loss의 응용(Detection & Classification)Focal loss의 응용(Detection & Classification)
Focal loss의 응용(Detection & Classification)
 
Generative adversarial text to image synthesis
Generative adversarial text to image synthesisGenerative adversarial text to image synthesis
Generative adversarial text to image synthesis
 
Human Pose Estimation by Deep Learning
Human Pose Estimation by Deep LearningHuman Pose Estimation by Deep Learning
Human Pose Estimation by Deep Learning
 
Super resolution
Super resolutionSuper resolution
Super resolution
 
Mask R-CNN
Mask R-CNNMask R-CNN
Mask R-CNN
 
Deep learning for_extreme_multi-label_text_classification
Deep learning for_extreme_multi-label_text_classificationDeep learning for_extreme_multi-label_text_classification
Deep learning for_extreme_multi-label_text_classification
 
Semi-Supervised Classification with Graph Convolutional Networks @ICLR2017読み会
Semi-Supervised Classification with Graph Convolutional Networks @ICLR2017読み会Semi-Supervised Classification with Graph Convolutional Networks @ICLR2017読み会
Semi-Supervised Classification with Graph Convolutional Networks @ICLR2017読み会
 
Face recognition technology
Face recognition technologyFace recognition technology
Face recognition technology
 
Self Supervised Learning 세미나.pptx
Self Supervised Learning 세미나.pptxSelf Supervised Learning 세미나.pptx
Self Supervised Learning 세미나.pptx
 
PR-284: End-to-End Object Detection with Transformers(DETR)
PR-284: End-to-End Object Detection with Transformers(DETR)PR-284: End-to-End Object Detection with Transformers(DETR)
PR-284: End-to-End Object Detection with Transformers(DETR)
 
Face Detection
Face DetectionFace Detection
Face Detection
 
Facenet - Paper Review
Facenet - Paper ReviewFacenet - Paper Review
Facenet - Paper Review
 

Similar a FaceNet: A Unified Embedding for Face Recognition and Clustering

247 deview 2013 이미지 분석 - 민재식
247 deview 2013 이미지 분석 - 민재식247 deview 2013 이미지 분석 - 민재식
247 deview 2013 이미지 분석 - 민재식
NAVER D2
 

Similar a FaceNet: A Unified Embedding for Face Recognition and Clustering (11)

From maching learning to deep learning
From maching learning to deep learningFrom maching learning to deep learning
From maching learning to deep learning
 
Anomaly detection practive_using_deep_learning
Anomaly detection practive_using_deep_learningAnomaly detection practive_using_deep_learning
Anomaly detection practive_using_deep_learning
 
Crash Course on Graphical models
Crash Course on Graphical modelsCrash Course on Graphical models
Crash Course on Graphical models
 
코드와 실습으로 이해하는 인공지능
코드와 실습으로 이해하는 인공지능코드와 실습으로 이해하는 인공지능
코드와 실습으로 이해하는 인공지능
 
Deep neural networks cnn rnn_ae_some practical techniques
Deep neural networks cnn rnn_ae_some practical techniquesDeep neural networks cnn rnn_ae_some practical techniques
Deep neural networks cnn rnn_ae_some practical techniques
 
From maching learning to deep learning episode2
From maching learning to deep learning episode2 From maching learning to deep learning episode2
From maching learning to deep learning episode2
 
위성이미지 객체 검출 대회 - 1등
위성이미지 객체 검출 대회 - 1등위성이미지 객체 검출 대회 - 1등
위성이미지 객체 검출 대회 - 1등
 
알아두면 쓸데있는 신비한 딥러닝 이야기
알아두면 쓸데있는 신비한 딥러닝 이야기알아두면 쓸데있는 신비한 딥러닝 이야기
알아두면 쓸데있는 신비한 딥러닝 이야기
 
NDC 2016 김정주 - 기계학습을 활용한 게임어뷰징 검출
NDC 2016 김정주 - 기계학습을 활용한 게임어뷰징 검출 NDC 2016 김정주 - 기계학습을 활용한 게임어뷰징 검출
NDC 2016 김정주 - 기계학습을 활용한 게임어뷰징 검출
 
Naive ML Overview
Naive ML OverviewNaive ML Overview
Naive ML Overview
 
247 deview 2013 이미지 분석 - 민재식
247 deview 2013 이미지 분석 - 민재식247 deview 2013 이미지 분석 - 민재식
247 deview 2013 이미지 분석 - 민재식
 

FaceNet: A Unified Embedding for Face Recognition and Clustering

  • 1. FaceNet: A Unified Embedding for Face Recognition and Clustering 서치솔루션 김현준
  • 2. Goal of FaceNet • 다음을 만족하는 임베딩 함수를 찾는다 • Invariant • 표정, 조명, 얼굴 포즈 … • 같은 사람의 얼굴 임베딩은 가깝다 • 다른 사람의 얼굴 임베딩은 멀다
  • 3. Goal of FaceNet • 다음을 만족하는 임베딩 함수를 찾는다 • Invariant • 표정, 조명, 얼굴 포즈 … • 같은 사람의 얼굴 임베딩은 가깝다 • 다른 사람의 얼굴 임베딩은 멀다 • 이미 잘 되는 분야 아닌가?
  • 4. Previous Works • 얼굴 인식용 네트워크 • bottleneck layer의 벡터 사용 • 간접적 • Loss function은 분류에 대해 정의됨 • 벡터가 우리가 원하는 특성을 갖는다는 보장이 없다 • 비효율적 • 모르는 얼굴에 대해서도 잘 동작할까? • 큰 사이즈 (1000s of dimension) • 기타 노력들 • PCA로 벡터 축소 • 3D alignment • Classification & Verification loss 혼합
  • 5. FaceNet의 특징 • 작은 벡터 • 128D • 원하는 임베딩 벡터의 특징을 바로 학습 • Triplet loss • 같으면 가까워지고 다르면 멀어져라 • 복잡한 alignment가 필요 없다 • Scale, translation만 적용 • 많은 데이터로 invariance 특징을 학습함 • Data-driven • End-to-end
  • 6. 적용 분야 • Face verification • 두 장의 사진이 같은/다른 사람이냐 • Face classification • 가장 가까운 얼굴로 분류 • Nearest Neighbor • Face clustering • 임베딩이 Euclidean distance에 존재 • 기존 클러스터링 그대로 적용 가능
  • 7. Triplet Loss • 세 개의 데이터 • Anchor (𝑥 𝑎): 기준 얼굴 • Positive (𝑥 𝑝 ): 기준과 같은 인물의 얼굴 • Negative (𝑥 𝑛): 기준과 다른 인물의 얼굴 • 같으면 가까워지고 다르면 멀어져라
  • 8. Triplet Loss (Cont’) • 우리의 바램 • Anchor와 Negative의 거리가 • Anchor와 Positive의 거리보다 • 최소한 𝛼만큼 멀리 있으면 좋겠다
  • 9. Triplet Loss (Cont’) • 우리의 바램 • Anchor와 Negative의 거리가 • Anchor와 Positive의 거리보다 • 최소한 𝛼만큼 멀리 있으면 좋겠다 • 수식
  • 10. Triplet Loss (Cont’) • Loss • Hinge Loss: [𝑥]+= max(0, 𝑥) • Margin 최대화 • Constraint: • Euclidean space • d-dimensional hypersphere • 𝛼=0.2로 고정
  • 11. Triplet Selection • 두 명의 사람이 각각 10장의 사진을 가질 때 가능한 triplet 의 수 • #사람 X #Anchor X #Positive #Negative • 2 X 10 X 9 X 10 = 1800 • 대량의 학습데이터에서는 • 너무 많은 triplet의 수 • 전부 학습에 도움이 되는 건 아니다
  • 12. Triplet Selection (Cont’) • 학습에 도움이 되는 triplet을 골라보자 • 어려운 문제를 풀수록 배우는게 많겠지? • Hard positive: 가장 멀리 있는 positive • Hard negative: 가장 가까이 있는 negative • Mini-batch에서 골라보자 • 사이즈: 1,800 • 매 step마다 모든 데이터를 뒤질 수는 없지 • 잘못 레이블 된 데이터를 피할 수 있다 • 모든 데이터를 뒤질 경우 찾는 것: • Hard positive: 다른 사람인데 같은 이름이 붙은 사진 • Hard negative: 같은 사람인데 다른 이름이 붙은 사진
  • 13. Triplet Selection (Cont’) • 학습 디테일 • Mini-batch에 약 40개의 identity • Hard-positive 안씀 • 모든 positive 사용 • 안정적인 학습 • 초반에 약간 빠른 수렴 • 학습 초반에 Hard-negative는 너무 어렵다 • Local minima에 빠짐 • 좀 더 쉬운 Semi-hard 사용 • Anchor와 positive를 정한 뒤 positive보다 먼 negative 선택 • Positive와 거리가 비슷해서 hard라고 말할 수 있다
  • 14. Models • Category 1 • Zeiler&Fergus 기반 모델 • 1x1 convolution 추가 • NN1 • Category 2 • GoogleNet 기반 모델 • NN1과 비교 • 약 20배 적은 파라미터 • 최대 5배까지 적은 계산 량 • NN2~4 • 입력 크기: 220x220, 160x160, 96x96 • NNS1~4 • 모바일을 위한 작은 모델들
  • 16. NN2 architecture 𝐿2 Pooling 왜 𝐿2 Pooling 일까? 왜 저 자리일까? 아무 언급 없음
  • 17. Experiments • Train dataset: Unknown • Test datasets: 자체 DB • Hold-out test set • Personal photos • Evaluation • Cross validation • Test dataset로 부터 Same/Diff의 threshold d 학습 • Validation rate: VAL(d) • 같은 사람을 같다고 예측한 비율 • False accept rate: FAR(d) • 다른 사람을 같다고 예측한 비율
  • 18. FLOPS vs. Accuracy trade-off Evaluated on Personal Photos dataset
  • 19. And the others Image quality (NN1, hold-out DB) Embedding Dimensionality (NN1, hold-out DB) Training data size (NN2 변형)
  • 20. Experiments (Cont’) • Test datasets • LFW • YouTube Faces Database • Evaluation • Cross validation • Test dataset로 부터 Same/Diff의 threshold d 학습 • Train/validation set은 DB에서 지정
  • 21. Experiments (Cont’) • LFW • 고정된 영역 crop: 98.87%±0.15 • Detect & align: 99.63%±0.09 13 pair중 5개는 잘못된 레이블
  • 22. Experiments (Cont’) • YouTube Faces Database • 95.12%±0.39 • 처음 1000개의 프레임만 사용 • 95.18%