SlideShare a Scribd company logo
1 of 20
Download to read offline
Triplet Learning
Adwin Jahn
FaceNet
Task
1. Face Verification
• is this the same person
2. Face recognition
• who is this person
3. Clustering
• find similar people among these faces
Key idea
An embedding f(x), from an image x into a feature
space Rd, such that the squared distance between
all faces, independent of imaging conditions, of
the same identity is small, whereas the squared
distance be- tween a pair of face images from
different identities is large.
Key idea
The triplet loss tries to enforce a margin between
each pair of faces from one person to all other
faces. This allows the faces for one identity to live
on a manifold, while still enforcing the distance
and thus discriminability to other identities.
Abstract
Face Euclidean
embedding
(128-D)
Recognition
(k-NN)
Verification
(treshold)
Clustering
K-means
Calculate
distance
Using the embedding for each face to solve three tasks
Face Verification
• With threshold 1.1, if
the distance is lover
than threshold, we
verify both face are
the same ID
Triplet Loss
• Minimize the distance between same ID faces and maximize the distance with
different ID faces, with a margin alpha
Prepare data
• Correct triplet selection is crucial for fast convergence
• Triplet constraint: The distance of negative samples should have
larger distance with the anchor image (compared to positive
image)
• Triplet is formed by (anchor, positive, negative )
Hard data
• In order to ensure fast convgerence, it is crucial to
select triplets that violate the triplet constraint
• It is infeasible to compute the hard positive and
hard negative across the whole training set.
Visualize of hard data
Embedding location
of anchor
Embedding location
of anchor
Green area is the distribution of positive faces over embedding space.
Red is distribution of negative faces over the same space.
Hard positive means the furtherest sample (to the anchor location) in the
positive space, and hard negative is the closest sample (to the anchor
location) among the negative faces. Hard sample should help training
converges faster.
Triplet generation
• Generate triplets online.
• This can be done by select- ing the hard positive/negative exemplars from
within a mini-batch.
• Mini batch: few thousand exemplars
• 40 faces are selected per ID per mini batch, and randomly add negative
faces
• Only consider argmin and argmax within a mini-batch
• Mis labeled and poorly image might lead to poor training
Semi-hard sample
• Selecting the hardest negatives can win
practice lead to bad local minima early on
in training
• For negative data, this is semi-hard
because its lower bound positive data. In
other words, the negative data cannot
look more similar than all the positive
data.
• Compared with triplet constraint, this is
more hard because semi-hard cancel the
margin alpha
Setting
• Batch size: around 1800 samplers
• Optimize: SGD or AdaGrad
• Hardware: CPU cluster for 1000~2000 hours
• Train rate start: 0.05, will decrease
• Activation: Relu
• Data set: Labelled Faces in the Wild, YouTube Faces
• Training amount: 100M~200M with 8M different ID
Performance on different
CNN model
NNS2 is smallest model the paper test on. Capable to run on
the mobile phone, and the NNS2 performance is not too bad
Performance on different
CNN model
Size to represent a face
• Optimally, a face is presented as 128 dimension byte vector.
• Bigger dims not promises better performance
Tensor flow for face
embedding
Concern
• Sampling the sample might be hard
• Huge batch size
• Sensitive to mislabeled and bad image (need good
quality image data)
• Might need 100M data
• Need multiple experiment to decide embedding size
• Long time to train
Opportunity
• Possible to use train small CNN to achieve good
embedding
• Could be applied for other datasets
• One embedding can be used for multiple
different tasks

More Related Content

What's hot

face recognition based on PCA
face recognition based on PCAface recognition based on PCA
face recognition based on PCA@zenafaris91
 
End-to-End Object Detection with Transformers
End-to-End Object Detection with TransformersEnd-to-End Object Detection with Transformers
End-to-End Object Detection with TransformersSeunghyun Hwang
 
Autoencoder
AutoencoderAutoencoder
AutoencoderHARISH R
 
Training Deep Neural Nets
Training Deep Neural NetsTraining Deep Neural Nets
Training Deep Neural NetsCloudxLab
 
Generative Adversarial Network (GAN) for Image Synthesis
Generative Adversarial Network (GAN) for Image SynthesisGenerative Adversarial Network (GAN) for Image Synthesis
Generative Adversarial Network (GAN) for Image SynthesisRiwaz Mahat
 
Presentation on Neural Style Transfer
Presentation on Neural Style TransferPresentation on Neural Style Transfer
Presentation on Neural Style TransferSanjoy Datta
 
Viola-Jones Object Detection
Viola-Jones Object DetectionViola-Jones Object Detection
Viola-Jones Object DetectionVenugopal Boddu
 
PR-297: Training data-efficient image transformers & distillation through att...
PR-297: Training data-efficient image transformers & distillation through att...PR-297: Training data-efficient image transformers & distillation through att...
PR-297: Training data-efficient image transformers & distillation through att...Jinwon Lee
 
Convolutional neural network from VGG to DenseNet
Convolutional neural network from VGG to DenseNetConvolutional neural network from VGG to DenseNet
Convolutional neural network from VGG to DenseNetSungminYou
 
FixMatch:simplifying semi supervised learning with consistency and confidence
FixMatch:simplifying semi supervised learning with consistency and confidenceFixMatch:simplifying semi supervised learning with consistency and confidence
FixMatch:simplifying semi supervised learning with consistency and confidenceLEE HOSEONG
 
Data Visualization using matplotlib
Data Visualization using matplotlibData Visualization using matplotlib
Data Visualization using matplotlibBruno Gonçalves
 
Cross-validation Tutorial: What, how and which?
Cross-validation Tutorial: What, how and which?Cross-validation Tutorial: What, how and which?
Cross-validation Tutorial: What, how and which?Pradeep Redddy Raamana
 
Autoencoders in Deep Learning
Autoencoders in Deep LearningAutoencoders in Deep Learning
Autoencoders in Deep Learningmilad abbasi
 
Face recognition using artificial neural network
Face recognition using artificial neural networkFace recognition using artificial neural network
Face recognition using artificial neural networkSumeet Kakani
 
Introduction to Deep face detection and recognition
Introduction to Deep face detection and recognitionIntroduction to Deep face detection and recognition
Introduction to Deep face detection and recognitionApache MXNet
 
Visualizaing and understanding convolutional networks
Visualizaing and understanding convolutional networksVisualizaing and understanding convolutional networks
Visualizaing and understanding convolutional networksSungminYou
 
Image segmentation with deep learning
Image segmentation with deep learningImage segmentation with deep learning
Image segmentation with deep learningAntonio Rueda-Toicen
 

What's hot (20)

Amazon SageMaker
Amazon SageMakerAmazon SageMaker
Amazon SageMaker
 
face recognition based on PCA
face recognition based on PCAface recognition based on PCA
face recognition based on PCA
 
End-to-End Object Detection with Transformers
End-to-End Object Detection with TransformersEnd-to-End Object Detection with Transformers
End-to-End Object Detection with Transformers
 
Autoencoder
AutoencoderAutoencoder
Autoencoder
 
Training Deep Neural Nets
Training Deep Neural NetsTraining Deep Neural Nets
Training Deep Neural Nets
 
Generative Adversarial Network (GAN) for Image Synthesis
Generative Adversarial Network (GAN) for Image SynthesisGenerative Adversarial Network (GAN) for Image Synthesis
Generative Adversarial Network (GAN) for Image Synthesis
 
Presentation on Neural Style Transfer
Presentation on Neural Style TransferPresentation on Neural Style Transfer
Presentation on Neural Style Transfer
 
Viola-Jones Object Detection
Viola-Jones Object DetectionViola-Jones Object Detection
Viola-Jones Object Detection
 
PR-297: Training data-efficient image transformers & distillation through att...
PR-297: Training data-efficient image transformers & distillation through att...PR-297: Training data-efficient image transformers & distillation through att...
PR-297: Training data-efficient image transformers & distillation through att...
 
Convolutional neural network from VGG to DenseNet
Convolutional neural network from VGG to DenseNetConvolutional neural network from VGG to DenseNet
Convolutional neural network from VGG to DenseNet
 
FixMatch:simplifying semi supervised learning with consistency and confidence
FixMatch:simplifying semi supervised learning with consistency and confidenceFixMatch:simplifying semi supervised learning with consistency and confidence
FixMatch:simplifying semi supervised learning with consistency and confidence
 
Human Emotion Recognition
Human Emotion RecognitionHuman Emotion Recognition
Human Emotion Recognition
 
Transfer Learning
Transfer LearningTransfer Learning
Transfer Learning
 
Data Visualization using matplotlib
Data Visualization using matplotlibData Visualization using matplotlib
Data Visualization using matplotlib
 
Cross-validation Tutorial: What, how and which?
Cross-validation Tutorial: What, how and which?Cross-validation Tutorial: What, how and which?
Cross-validation Tutorial: What, how and which?
 
Autoencoders in Deep Learning
Autoencoders in Deep LearningAutoencoders in Deep Learning
Autoencoders in Deep Learning
 
Face recognition using artificial neural network
Face recognition using artificial neural networkFace recognition using artificial neural network
Face recognition using artificial neural network
 
Introduction to Deep face detection and recognition
Introduction to Deep face detection and recognitionIntroduction to Deep face detection and recognition
Introduction to Deep face detection and recognition
 
Visualizaing and understanding convolutional networks
Visualizaing and understanding convolutional networksVisualizaing and understanding convolutional networks
Visualizaing and understanding convolutional networks
 
Image segmentation with deep learning
Image segmentation with deep learningImage segmentation with deep learning
Image segmentation with deep learning
 

Viewers also liked

Multiple pregnancy – management
Multiple pregnancy – managementMultiple pregnancy – management
Multiple pregnancy – managementAparna P Anand
 
Multiple pregnancy: Aboubakr Elnashar
Multiple pregnancy: Aboubakr ElnasharMultiple pregnancy: Aboubakr Elnashar
Multiple pregnancy: Aboubakr ElnasharAboubakr Elnashar
 
Multiple pregnancy
Multiple pregnancyMultiple pregnancy
Multiple pregnancyFahad Zakwan
 
Multiple Pregnancy - Diagnosis ,Clinical Features & Complications
Multiple Pregnancy - Diagnosis ,Clinical Features & ComplicationsMultiple Pregnancy - Diagnosis ,Clinical Features & Complications
Multiple Pregnancy - Diagnosis ,Clinical Features & ComplicationsHari Dev
 
Multiple pregnancy
Multiple pregnancyMultiple pregnancy
Multiple pregnancyAbino David
 

Viewers also liked (7)

Multiple pregnancy
Multiple pregnancyMultiple pregnancy
Multiple pregnancy
 
Multiple pregnancy – management
Multiple pregnancy – managementMultiple pregnancy – management
Multiple pregnancy – management
 
Multiple pregnancy: Aboubakr Elnashar
Multiple pregnancy: Aboubakr ElnasharMultiple pregnancy: Aboubakr Elnashar
Multiple pregnancy: Aboubakr Elnashar
 
Multiple pregnancy
Multiple pregnancyMultiple pregnancy
Multiple pregnancy
 
Multiple Pregnancy - Diagnosis ,Clinical Features & Complications
Multiple Pregnancy - Diagnosis ,Clinical Features & ComplicationsMultiple Pregnancy - Diagnosis ,Clinical Features & Complications
Multiple Pregnancy - Diagnosis ,Clinical Features & Complications
 
Multiple pregnancy
Multiple pregnancyMultiple pregnancy
Multiple pregnancy
 
Multiple pregnancy
Multiple pregnancyMultiple pregnancy
Multiple pregnancy
 

Similar to Review of Triplet Learning

Face Detection.pptx
Face Detection.pptxFace Detection.pptx
Face Detection.pptxTorshaSett
 
InfoGAN and Generative Adversarial Networks
InfoGAN and Generative Adversarial NetworksInfoGAN and Generative Adversarial Networks
InfoGAN and Generative Adversarial NetworksZak Jost
 
Generative Adversarial Network (GAN)
Generative Adversarial Network (GAN)Generative Adversarial Network (GAN)
Generative Adversarial Network (GAN)Prakhar Rastogi
 
brief Introduction to Different Kinds of GANs
brief Introduction to Different Kinds of GANsbrief Introduction to Different Kinds of GANs
brief Introduction to Different Kinds of GANsParham Zilouchian
 
one shot15729752 Deep Learning for AI and DS
one shot15729752 Deep Learning for AI and DSone shot15729752 Deep Learning for AI and DS
one shot15729752 Deep Learning for AI and DSManiMaran230751
 
Maximizing the Representation Gap between In-domain & OOD examples
Maximizing the Representation Gap between In-domain & OOD examplesMaximizing the Representation Gap between In-domain & OOD examples
Maximizing the Representation Gap between In-domain & OOD examplesJay Nandy
 
09_dm1_knn_2022_23.pdf
09_dm1_knn_2022_23.pdf09_dm1_knn_2022_23.pdf
09_dm1_knn_2022_23.pdfArafathJazeeb1
 
Random forests-talk-nl-meetup
Random forests-talk-nl-meetupRandom forests-talk-nl-meetup
Random forests-talk-nl-meetupWillem Hendriks
 
Kaggle Gold Medal Case Study
Kaggle Gold Medal Case StudyKaggle Gold Medal Case Study
Kaggle Gold Medal Case StudyAlon Bochman, CFA
 
Computer Vision for Beginners
Computer Vision for BeginnersComputer Vision for Beginners
Computer Vision for BeginnersSanghamitra Deb
 
Tricking a DNN with adversarial examples
Tricking a DNN with adversarial examplesTricking a DNN with adversarial examples
Tricking a DNN with adversarial examplesOjasava Paras
 
Throttling Malware Families in 2D
Throttling Malware Families in 2DThrottling Malware Families in 2D
Throttling Malware Families in 2DMohamed Nassar
 

Similar to Review of Triplet Learning (20)

Face Detection.pptx
Face Detection.pptxFace Detection.pptx
Face Detection.pptx
 
InfoGAN and Generative Adversarial Networks
InfoGAN and Generative Adversarial NetworksInfoGAN and Generative Adversarial Networks
InfoGAN and Generative Adversarial Networks
 
07 learning
07 learning07 learning
07 learning
 
Generative Adversarial Network (GAN)
Generative Adversarial Network (GAN)Generative Adversarial Network (GAN)
Generative Adversarial Network (GAN)
 
brief Introduction to Different Kinds of GANs
brief Introduction to Different Kinds of GANsbrief Introduction to Different Kinds of GANs
brief Introduction to Different Kinds of GANs
 
Explainable AI
Explainable AIExplainable AI
Explainable AI
 
one shot15729752 Deep Learning for AI and DS
one shot15729752 Deep Learning for AI and DSone shot15729752 Deep Learning for AI and DS
one shot15729752 Deep Learning for AI and DS
 
Maximizing the Representation Gap between In-domain & OOD examples
Maximizing the Representation Gap between In-domain & OOD examplesMaximizing the Representation Gap between In-domain & OOD examples
Maximizing the Representation Gap between In-domain & OOD examples
 
09_dm1_knn_2022_23.pdf
09_dm1_knn_2022_23.pdf09_dm1_knn_2022_23.pdf
09_dm1_knn_2022_23.pdf
 
Random forests-talk-nl-meetup
Random forests-talk-nl-meetupRandom forests-talk-nl-meetup
Random forests-talk-nl-meetup
 
Kaggle Gold Medal Case Study
Kaggle Gold Medal Case StudyKaggle Gold Medal Case Study
Kaggle Gold Medal Case Study
 
gan.pdf
gan.pdfgan.pdf
gan.pdf
 
ML MODULE 4.pdf
ML MODULE 4.pdfML MODULE 4.pdf
ML MODULE 4.pdf
 
Computer Vision for Beginners
Computer Vision for BeginnersComputer Vision for Beginners
Computer Vision for Beginners
 
Tricking a DNN with adversarial examples
Tricking a DNN with adversarial examplesTricking a DNN with adversarial examples
Tricking a DNN with adversarial examples
 
Genetic Algorithms
Genetic AlgorithmsGenetic Algorithms
Genetic Algorithms
 
Deeplearning
Deeplearning Deeplearning
Deeplearning
 
cnn ppt.pptx
cnn ppt.pptxcnn ppt.pptx
cnn ppt.pptx
 
Throttling Malware Families in 2D
Throttling Malware Families in 2DThrottling Malware Families in 2D
Throttling Malware Families in 2D
 
AI Algorithms
AI AlgorithmsAI Algorithms
AI Algorithms
 

Recently uploaded

WSO2CON 2024 - How CSI Piemonte Is Apifying the Public Administration
WSO2CON 2024 - How CSI Piemonte Is Apifying the Public AdministrationWSO2CON 2024 - How CSI Piemonte Is Apifying the Public Administration
WSO2CON 2024 - How CSI Piemonte Is Apifying the Public AdministrationWSO2
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfonteinmasabamasaba
 
WSO2CON 2024 - Building a Digital Government in Uganda
WSO2CON 2024 - Building a Digital Government in UgandaWSO2CON 2024 - Building a Digital Government in Uganda
WSO2CON 2024 - Building a Digital Government in UgandaWSO2
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2
 
WSO2Con2024 - Low-Code Integration Tooling
WSO2Con2024 - Low-Code Integration ToolingWSO2Con2024 - Low-Code Integration Tooling
WSO2Con2024 - Low-Code Integration ToolingWSO2
 
WSO2CON 2024 Slides - Unlocking Value with AI
WSO2CON 2024 Slides - Unlocking Value with AIWSO2CON 2024 Slides - Unlocking Value with AI
WSO2CON 2024 Slides - Unlocking Value with AIWSO2
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2
 
WSO2Con2024 - Simplified Integration: Unveiling the Latest Features in WSO2 L...
WSO2Con2024 - Simplified Integration: Unveiling the Latest Features in WSO2 L...WSO2Con2024 - Simplified Integration: Unveiling the Latest Features in WSO2 L...
WSO2Con2024 - Simplified Integration: Unveiling the Latest Features in WSO2 L...WSO2
 
WSO2Con2024 - Software Delivery in Hybrid Environments
WSO2Con2024 - Software Delivery in Hybrid EnvironmentsWSO2Con2024 - Software Delivery in Hybrid Environments
WSO2Con2024 - Software Delivery in Hybrid EnvironmentsWSO2
 
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2
 
WSO2Con2024 - Organization Management: The Revolution in B2B CIAM
WSO2Con2024 - Organization Management: The Revolution in B2B CIAMWSO2Con2024 - Organization Management: The Revolution in B2B CIAM
WSO2Con2024 - Organization Management: The Revolution in B2B CIAMWSO2
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastPapp Krisztián
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2
 
WSO2CON 2024 - How CSI Piemonte Is Apifying the Public Administration
WSO2CON 2024 - How CSI Piemonte Is Apifying the Public AdministrationWSO2CON 2024 - How CSI Piemonte Is Apifying the Public Administration
WSO2CON 2024 - How CSI Piemonte Is Apifying the Public AdministrationWSO2
 
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...masabamasaba
 
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2
 
WSO2CON2024 - Why Should You Consider Ballerina for Your Next Integration
WSO2CON2024 - Why Should You Consider Ballerina for Your Next IntegrationWSO2CON2024 - Why Should You Consider Ballerina for Your Next Integration
WSO2CON2024 - Why Should You Consider Ballerina for Your Next IntegrationWSO2
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationJuha-Pekka Tolvanen
 

Recently uploaded (20)

WSO2CON 2024 - How CSI Piemonte Is Apifying the Public Administration
WSO2CON 2024 - How CSI Piemonte Is Apifying the Public AdministrationWSO2CON 2024 - How CSI Piemonte Is Apifying the Public Administration
WSO2CON 2024 - How CSI Piemonte Is Apifying the Public Administration
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
WSO2CON 2024 - Building a Digital Government in Uganda
WSO2CON 2024 - Building a Digital Government in UgandaWSO2CON 2024 - Building a Digital Government in Uganda
WSO2CON 2024 - Building a Digital Government in Uganda
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
WSO2Con2024 - Low-Code Integration Tooling
WSO2Con2024 - Low-Code Integration ToolingWSO2Con2024 - Low-Code Integration Tooling
WSO2Con2024 - Low-Code Integration Tooling
 
WSO2CON 2024 Slides - Unlocking Value with AI
WSO2CON 2024 Slides - Unlocking Value with AIWSO2CON 2024 Slides - Unlocking Value with AI
WSO2CON 2024 Slides - Unlocking Value with AI
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
 
WSO2Con2024 - Simplified Integration: Unveiling the Latest Features in WSO2 L...
WSO2Con2024 - Simplified Integration: Unveiling the Latest Features in WSO2 L...WSO2Con2024 - Simplified Integration: Unveiling the Latest Features in WSO2 L...
WSO2Con2024 - Simplified Integration: Unveiling the Latest Features in WSO2 L...
 
WSO2Con2024 - Software Delivery in Hybrid Environments
WSO2Con2024 - Software Delivery in Hybrid EnvironmentsWSO2Con2024 - Software Delivery in Hybrid Environments
WSO2Con2024 - Software Delivery in Hybrid Environments
 
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
 
WSO2Con2024 - Organization Management: The Revolution in B2B CIAM
WSO2Con2024 - Organization Management: The Revolution in B2B CIAMWSO2Con2024 - Organization Management: The Revolution in B2B CIAM
WSO2Con2024 - Organization Management: The Revolution in B2B CIAM
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
WSO2CON 2024 - How CSI Piemonte Is Apifying the Public Administration
WSO2CON 2024 - How CSI Piemonte Is Apifying the Public AdministrationWSO2CON 2024 - How CSI Piemonte Is Apifying the Public Administration
WSO2CON 2024 - How CSI Piemonte Is Apifying the Public Administration
 
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - Keynote
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
 
WSO2CON2024 - Why Should You Consider Ballerina for Your Next Integration
WSO2CON2024 - Why Should You Consider Ballerina for Your Next IntegrationWSO2CON2024 - Why Should You Consider Ballerina for Your Next Integration
WSO2CON2024 - Why Should You Consider Ballerina for Your Next Integration
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 

Review of Triplet Learning

  • 3. Task 1. Face Verification • is this the same person 2. Face recognition • who is this person 3. Clustering • find similar people among these faces
  • 4. Key idea An embedding f(x), from an image x into a feature space Rd, such that the squared distance between all faces, independent of imaging conditions, of the same identity is small, whereas the squared distance be- tween a pair of face images from different identities is large.
  • 5. Key idea The triplet loss tries to enforce a margin between each pair of faces from one person to all other faces. This allows the faces for one identity to live on a manifold, while still enforcing the distance and thus discriminability to other identities.
  • 7. Face Verification • With threshold 1.1, if the distance is lover than threshold, we verify both face are the same ID
  • 8. Triplet Loss • Minimize the distance between same ID faces and maximize the distance with different ID faces, with a margin alpha
  • 9. Prepare data • Correct triplet selection is crucial for fast convergence • Triplet constraint: The distance of negative samples should have larger distance with the anchor image (compared to positive image) • Triplet is formed by (anchor, positive, negative )
  • 10. Hard data • In order to ensure fast convgerence, it is crucial to select triplets that violate the triplet constraint • It is infeasible to compute the hard positive and hard negative across the whole training set.
  • 11. Visualize of hard data Embedding location of anchor Embedding location of anchor Green area is the distribution of positive faces over embedding space. Red is distribution of negative faces over the same space. Hard positive means the furtherest sample (to the anchor location) in the positive space, and hard negative is the closest sample (to the anchor location) among the negative faces. Hard sample should help training converges faster.
  • 12. Triplet generation • Generate triplets online. • This can be done by select- ing the hard positive/negative exemplars from within a mini-batch. • Mini batch: few thousand exemplars • 40 faces are selected per ID per mini batch, and randomly add negative faces • Only consider argmin and argmax within a mini-batch • Mis labeled and poorly image might lead to poor training
  • 13. Semi-hard sample • Selecting the hardest negatives can win practice lead to bad local minima early on in training • For negative data, this is semi-hard because its lower bound positive data. In other words, the negative data cannot look more similar than all the positive data. • Compared with triplet constraint, this is more hard because semi-hard cancel the margin alpha
  • 14. Setting • Batch size: around 1800 samplers • Optimize: SGD or AdaGrad • Hardware: CPU cluster for 1000~2000 hours • Train rate start: 0.05, will decrease • Activation: Relu • Data set: Labelled Faces in the Wild, YouTube Faces • Training amount: 100M~200M with 8M different ID
  • 15. Performance on different CNN model NNS2 is smallest model the paper test on. Capable to run on the mobile phone, and the NNS2 performance is not too bad
  • 17. Size to represent a face • Optimally, a face is presented as 128 dimension byte vector. • Bigger dims not promises better performance
  • 18. Tensor flow for face embedding
  • 19. Concern • Sampling the sample might be hard • Huge batch size • Sensitive to mislabeled and bad image (need good quality image data) • Might need 100M data • Need multiple experiment to decide embedding size • Long time to train
  • 20. Opportunity • Possible to use train small CNN to achieve good embedding • Could be applied for other datasets • One embedding can be used for multiple different tasks