-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path18-02-self-supervised-learning.html
More file actions
1669 lines (1045 loc) · 41.9 KB
/
18-02-self-supervised-learning.html
File metadata and controls
1669 lines (1045 loc) · 41.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html>
<head>
<title>18.2 - Self-Supervised Learning [Andrei Bursuc]</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<link rel="stylesheet" href="./assets/katex.min.css">
<link rel="stylesheet" type="text/css" href="./assets/slides.css">
<link rel="stylesheet" type="text/css" href="./assets/grid.css">
</head>
<body>
<textarea id="source">
layout: true
<!-- .center.footer[Andrei BURSUC | Transfer learning and self-supervised learning | @abursuc] -->
.center.footer[Marc LELARGE and Andrei BURSUC | Deep Learning Do It Yourself | 18.2 Self-Supervised Learning]
---
class: center, middle, title-slide
count: false
## Transfer Learning and Self-Supervised Learning
# 18.2 Self-Supervised Learning
<br/>
<br/>
.bold[Andrei Bursuc ]
<br/>
url: https://dataflowr.github.io/website/
.citation[
With slides from A. Karpathy, F. Fleuret, G. Louppe, C. Ollion, O. Grisel, Y. Avrithis ...]
---
class: middle, center
# Self-supervised learning
---
class: middle, center
.center.big[Deep Learning + Supervised Learning is a really cool and strong combo.]
.hidden.center.big.italic[... when task and data permit it.]
---
count: false
class: middle
.center.big[Deep Learning + Supervised Learning is a really cool and strong combo.]
.center.big[... when task and data permit it.]
---
class: middle
.center.big[In addition to **data acquisition and annotation challenges**, <br/>the _representation learning perspective_ provides additional reasons <br/> to look for alternative or complementary solutions. ]
---
class: middle
## .center[The type of supervision signal can bias the network in unexpected ways]
.center.width-90[]
.caption[VGG-16 preditions on original and artificially texturised images.]
.citation[L.A. Gatys et al., Texture and art with deep neural networks, Neurobiology 2017]
---
class: middle
## .center[The type of supervision signal can bias the network in unexpected ways]
.center.width-85[]
.caption[Classification predictions of a ResNet-50 trained on ImageNet]
.citation[R. Geirhos et al., ImageNet-trained CNNs are biased towards texture; increasing shape bias improves accuracy and robustness, ICLR 2019]
---
class: middle, center
.big[Improving representation learning requires features that are *not specialized for solving a particular supervised task*, but rather *encapsulate richer statistics for various downstream tasks*.]
---
class: middle
## .center[The success of self-supervised methods in NLP, e.g. _word2vec_, is inspiring ]
.center.width-85[]
.caption[Missing word prediction task.]
.center.width-85[]
.caption[Next sentence prediction task.]
.citation[T. Mikolov et al., Efficient estimation of word representations in vector space, ArXiv 2013 <br/>T. Mikolov et al., Distributed representations of words and phrases and their compositionality, NeurIPS 2013<br/>J. Devlin, BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding, ArXiv 2018]
---
count: false
class: middle
# .center[What is self-supervision?]
<br/>
- .bigger[A form of unsupervised learning where the **data (not the human) provides the supervision signal**]
.hidden[
- .bigger[Usually, *define a pretext task* for which the network is forced to learn what we really care about]
]
.hidden[
- .bigger[For most pretext tasks, *a part of the data is withheld* and the network has to predict it]
]
.hidden[
- .bigger[The features/representations learned on the pretext task are subsequently used for a different *downstream task*, usually where some annotations are available.]
]
---
count: false
class: middle
# .center[What is self-supervision?]
<br/>
- .bigger[A form of unsupervised learning where the **data (not the human) provides the supervision signal**]
- .bigger[Usually, *define a pretext task* for which the network is forced to learn what we really care about]
.hidden[
- .bigger[For most pretext tasks, *a part of the data is withheld* and the network has to predict it]
]
.hidden[
- .bigger[The features/representations learned on the pretext task are subsequently used for a different *downstream task*, usually where some annotations are available.]
]
---
count: false
class: middle
# .center[What is self-supervision?]
<br/>
- .bigger[A form of unsupervised learning where the **data (not the human) provides the supervision signal**]
- .bigger[Usually, *define a pretext task* for which the network is forced to learn what we really care about]
- .bigger[For most pretext tasks, *a part of the data is withheld* and the network has to predict it]
.hidden[
- .bigger[The features/representations learned on the pretext task are subsequently used for a different *downstream task*, usually where some annotations are available.]
]
---
count: false
class: middle
# .center[What is self-supervision?]
<br/>
- .bigger[A form of unsupervised learning where the **data (not the human) provides the supervision signal**]
- .bigger[Usually, *define a pretext task* for which the network is forced to learn what we really care about]
- .bigger[For most pretext tasks, *a part of the data is withheld* and the network has to predict it]
- .bigger[The features/representations learned on the pretext task are subsequently used for a different *downstream task*, usually where some annotations are available.]
---
class: middle
## .center[Example: Rotation prediction]
.center.width-70[]
.center[Predict the orientation of the image]
.citation[S. Gidaris et al., Unsupervised Representation Learning by Predicting Image Rotations, ICLR 2018]
---
# Self-supervised learning pipeline
.center.bold.bigger[*Stage 1:* Train network on pretext task (without human labels)]
.center.width-90[]
---
count:false
# Self-supervised learning pipeline
.center.bold.bigger[*Stage 1:* Train network on pretext task (without human labels) ]
.center.width-90[]
.center.bold.bigger[*Stage 2:* Train classifier on learned features for new task with fewer labels]
.center.width-90[]
---
count:false
# Self-supervised learning pipeline
.center.bold.bigger[*Stage 1:* Train network on pretext task (without human labels)]
.center.width-90[]
.center.bold.bigger[*Stage 2:* Fine-tune network for new task with fewer labels]
.center.width-90[]
---
class: middle, black-slide
## .center[Karate Kid and Self-Supervised Learning]
.center.width-85[]
.caption[The Karate Kid (1984)]
---
class: middle, black-slide
## .center[Stage 1: Train .italic[muscle memory] on pretext tasks]
.grid[
.kol-4-12[
.center.width-100[]
]
.kol-4-12[
.center.width-100[]
]
.kol-4-12[
.center.width-100[]
]
]
.hidden[
.grid[
.kol-6-12[
$$\begin{aligned}
\text{Mr. Miyagi} &= \text{Deep Learning Practitioner} \\\\
\text{Daniel LaRusso} &= \text{ConvNet}\end{aligned}$$
]
.kol-6-12[
$$\begin{aligned}\text{daily chores} &= \text{pretext tasks} \\\\
\text{learning karate} &= \text{downstream task}\end{aligned}$$
]
]
]
---
class: middle, black-slide
## .center[Stage 1: Train .italic[muscle memory] on pretext tasks]
.grid[
.kol-4-12[
.center.width-100[]
]
.kol-4-12[
.center.width-100[]
]
.kol-4-12[
.center.width-100[]
]
]
.grid[
.kol-6-12[
$$\begin{aligned}
\text{Mr. Miyagi} &= \text{Deep Learning Practitioner} \\\\
\text{Daniel LaRusso} &= \text{ConvNet}\end{aligned}$$
]
.kol-6-12[
$$\begin{aligned}\text{daily chores} &= \text{pretext tasks} \\\\
\text{learning karate} &= \text{downstream task}\end{aligned}$$
]
]
---
class: middle, black-slide
## .center[Stage 2: Fine-tune skills rapidly]
.center.width-60[]
---
class: middle, black-slide
<!-- ## .center[Stage 2: Fine-tune skills rapidly]
-->
.center.width-60[]
<!-- .caption[Mr. Myiagi during Stage 1] -->
$$\text{Mr. Miyagi during Stage 1} = \text{catching up on ArXiv papers}$$
---
class: middle, center
.Q[.big[Is this actually useful in practice?]]
<!-- ---
class: middle
.grid[
.kol-6-12[
.center.width-100[]
.caption[ImageNet Top-1 accuracy of linear classifiers trained on representations learned with different self-supervised methods (pretrained on ImageNet). Gray cross indicates supervised ResNet-50.]
]
.kol-6-12[
<br/><br/><br/><br/><br/>
The performance on linear classifiers on ImageNet has accelerated strongly in the past year closing the gap w.r.t. supervised methods
]
]
.citation[T. Chen et al., A Simple Framework for Contrastive Learning of Visual Representations, ArXiv 2020 ]
-->
---
class: middle
## .center[Transfer learning - object detection]
.grid[
.kol-6-12[
.center.width-90[]
.caption[Object detection with Faster R-CNN fine-tuned on VOC $\texttt{trainval07+12}$ and evaluated on $\texttt{test07}$. Networks are pre-trained with self-supervision on ImageNet.]
]
.kol-6-12[
<br><br><br> <br>
- Self-supervised methods are starting to outperform supervised methods
- This is a __key milestone for self-supervised methods__ as they are finally showing their effectiveness to more complex downstream tasks.
]
]
.citation[S. Gidaris et al., Learning Representations by Predicting Bags of Visual Words, CVPR 2020]
---
class: middle
Loosely speaking, multiple old and new approaches could fit, at least partially, the definition of self-supervised learning:
- input reconstruction: .cites[[Hinton and Salakhutdinov (2006); Vincent et al. (2008)]]
- training with paired signals: .cites[[V. De Sa (1994); Arandjelovic and Zisserman (2017); C. Godard et al. (2017)]]
- hiding data from the networks: .cites[[Doersch et al. (2015); Zhang et el. (2017)]]
- instance discrimination: .cites[[Dosovitskiy et al. (2014); van der Ooord et al. (2018)]]
- etc.
<br/>
<br/>
.citation[G. Hinton and R. Salakhutdinov, Reducing the Dimensionality of Data with Neural Networks, Science 2006 <br/> P.Vincent et al.,Extracting and Composing Robust Features with Denoising Autoencoders, ICML 2008 <br/> V. De Sa, Learning classification from unlabelled data, NeurIPS 1994 <br/> R. Arandjelovic and A. Zisserman, Look, Listen and Learn, ICCV 2017 <br/> C. Godard et al., Unsupervised Monocular Depth Estimation with Left-Right Consistency, CVPR 2017 <br/> R. Zhang et al., Split-Brain Autoencoders: Unsupervised Learning by Cross-Channel Prediction, CVPR 2017 <br/> C. Doersch et al., Unsupervised Visual Representation Learning by Context Prediction, ICCV 2015 <br/> A. Dosovitskiy et al., Discriminative Unsupervised Feature Learning with Convolutional Neural Networks, NeurIPS 2015 <br/>A. van der Oord et al., Representation Learning with Contrastive Predictive Coding, ArXiv 2018 ]
---
class: middle
# .center[Scope]
.center.big[In this course, we **focus** on self-supervised methods that lead <br/> to *useful representations*, obtained through the invention of *a pretext task* and/or *by hiding a part of the original data* to the network.]
---
class: middle, center
## Self-supervised learning
# A tour of self-supervised methods
---
class: middle
.bigger[
Rough pretext task classification:
- Inferring structure
- Transformation prediction
- Reconstruction
- Exploiting time
- Multimodal
- Instance classification
]
---
count: false
class: middle
.bigger[
Rough pretext task classification:
- Inferring structure
.inactive[
- Transformation prediction
- Reconstruction
- Exploiting time
- Multimodal
- Instance classification
]
]
---
<!--
class: middle
## .center[Context prediction]
-->
# Context prediction
.center.bigger.blue[Can you guess the spatial configuration for the two pairs of patches?]
.hidden[.center.bigger.red[Much easier if you recognize the object!]]
.grid[
.kol-8-12[
.center.width-80[]
]
.kol-4-12[
]
]
.citation[C. Doersch et al., Unsupervised Visual Representation Learning by Context Prediction, ICCV 2015]
---
count: false
<!-- class: middle
## .center[Context prediction] -->
# Context prediction
.center.bigger.blue[Can you guess the spatial configuration for the two pairs of patches?]
.center.bigger.red[Much easier if you recognize the object!]
.grid[
.kol-8-12[
.center.width-80[]
]
.kol-4-12[
]
]
.citation[C. Doersch et al., Unsupervised Visual Representation Learning by Context Prediction, ICCV 2015]
---
count: false
<!-- class: middle
## .center[Context prediction] -->
# Context prediction
.center.bigger.blue[Can you guess the spatial configuration for the two pairs of patches?]
.center.bigger.red[Much easier if you recognize the object!]
.grid[
.kol-8-12[
.center.width-80[]
]
.kol-4-12[
<br/> <br/> <br/>
Intuition:
- The network should learn to recognize object parts and their spatial relations
]
]
.citation[C. Doersch et al., Unsupervised Visual Representation Learning by Context Prediction, ICCV 2015]
---
<!-- class: middle
## .center[Context prediction] -->
# Context prediction
.grid[
.kol-3-12[
.center.width-80[]
]
.kol-9-12[
.center.width-100[]
]
]
.center[Predict the location of one patch relative to the center patch]
.citation[C. Doersch et al., Unsupervised Visual Representation Learning by Context Prediction, ICCV 2015]
---
<!-- class: middle
## .center[Context prediction] -->
# Context prediction
.grid[
.kol-3-12[
.center.width-80[]
]
.kol-9-12[
.bigger.green[Pros]
- The first self-supervised method
- Intuitive task that should enable learning about object parts
.bigger.red[Cons]
- Assumes training images are photographed with canonical orientations (and canonical orientations exist)
- Networks can “cheat” so special care is needed
- Training on patches, but trying to learn image representations
- Not fine-grained enough due to no negatives from other images
- .italic[e.g.] no reason to distinguish a cat from dog
- Small output space - 8 cases (positions) to distinguish?
]
]
.citation[C. Doersch et al., Unsupervised Visual Representation Learning by Context Prediction, ICCV 2015]
---
# Jigsaw puzzles
.center.width-100[]
.citation[M. Noroozi and P. Favaro, Unsupervised Learning of Visual Representations by Solving Jigsaw Puzzles, ECCV 2016]
---
count: false
class: middle
.bigger[
Rough pretext task classification:
- Inferring structure
- Transformation prediction
.inactive[
- Reconstruction
- Exploiting time
- Multimodal
- Instance classification
]
]
---
# Rotation prediction
.center.bigger.blue[Can you guess how much rotated is applied? ]
.hidden[.center.bigger.red[Much easier if you recognize the object!]]
.center.width-80[]
.citation[S. Gidaris et al., Unsupervised representation learning by predicting image rotations, ICLR 2018]
---
count: false
# Rotation prediction
.center.bigger.blue[Can you guess how much rotated is applied? ]
.center.bigger.red[Much easier if you recognize the object!]
.center.width-80[]
.citation[S. Gidaris et al., Unsupervised representation learning by predicting image rotations, ICLR 2018]
---
count: false
# Rotation prediction
.center.width-55[]
.bigger.green[Pros]
- Very simple to implement and use, while being quite effective
.bigger.red[Cons]
- Assumes training images are photographed with canonical orientations (and canonical orientations exist)
- Train-eval gap: no rotated images at eval
- Not fine-grained enough due to no negatives from other images
- .italic[e.g.] no reason to distinguish a cat from dog
- Small output space - 4 cases (rotations) to distinguish
]
.citation[S. Gidaris et al., Unsupervised representation learning by predicting image rotations, ICLR 2018]
---
count: false
class: middle
.bigger[
Rough pretext task classification:
- Inferring structure
- Transformation prediction
- Reconstruction
.inactive[
- Exploiting time
- Multimodal
- Instance classification
]
]
---
# Context encoders
.center.bigger.blue[What goes in the middle? ]
.hidden[.center.bigger.red[Much easier if you recognize the objects!]]
.grid[
.kol-6-12[
.center.width-70[]
]
.kol-6-12[
.hidden[
.center.width-70[]
]
]
]
.citation[D. Pathak et al., Context Encoders: Feature Learning by Inpainting, CVPR 2016]
---
count: false
# Context encoders
.center.bigger.blue[What goes in the middle? ]
.center.bigger.red[Much easier if you recognize the objects!]
.grid[
.kol-6-12[
.center.width-70[]
]
.kol-6-12[
.center.width-70[]
]
]
.citation[D. Pathak et al., Context Encoders: Feature Learning by Inpainting, CVPR 2016]
---
class: middle
.center.width-60[]
.bigger.green[Pros]
- Requires preservation of fine-grained information
.bigger.red[Cons]
- Train-eval gap: no masking at eval
- Reconstruction is too hard and ambiguous
- Lots of effort spent on “useless” details: exact colour, good boundary, etc
]
.citation[D. Pathak, Context Encoders: Feature Learning by Inpainting, CVPR 2016]
---
# Context encoders
.center.width-70[]
.citation[D. Pathak, Context Encoders: Feature Learning by Inpainting, CVPR 2016]
---
# Colorization
.center.bigger.blue[What is the colour of every pixel?]
.hidden.center.bigger.red[Hard if you don’t recognize the object!]
.grid[
.kol-6-12[
.center.width-70[]
]
.hidden.kol-6-12[
.center.width-70[]
]
]
.citation[R. Zhang et al., Colorful image colorization, ECCV 2016]
---
count: false
# Colorization
.center.bigger.blue[What is the colour of every pixel?]
.center.bigger.red[Hard if you don’t recognize the object!]
.grid[
.kol-6-12[
.center.width-70[]
]
.kol-6-12[
.center.width-70[]
]
]
.citation[R. Zhang et al., Colorful image colorization, ECCV 2016]
---
class: middle
.center.width-70[]
.bigger.green[Pros]
- Requires preservation of fine-grained information
.bigger.red[Cons]
- Train-eval gap: no masking at eval
- Reconstruction is too hard and ambiguous
- Lots of effort spent on “useless” details: exact colour, good boundary, etc
- Forced to evaluate on greyscale images, losing information
.citation[R. Zhang et al., Colorful image colorization, ECCV 2016]
---
# Predicting bag-of-words
.center.width-80[]
.caption[Bag-of-words pipeline]
.citation[S. Gidaris et al., Learning Representations by Predicting Bags of Visual Words, CVPR 2020]
---
# Predicting bag-of-words
.center.width-100[]
.caption[Clusters of visual words]
.citation[S. Gidaris et al., Learning Representations by Predicting Bags of Visual Words, CVPR 2020]
---
# Predicting bag-of-words
.grid[
.kol-6-12[
.center.width-100[]
]
.kol-6-12[
.bigger.green[Pros]
- Representations are invariant to desired transformations
- Learn contextual reasoning skills
.bigger.red[Cons]
- Requires bootstrapping from another network
- (Partial) loss of spatial information
]
]
.citation[S. Gidaris et al., Learning Representations by Predicting Bags of Visual Words, CVPR 2020]
---
count: false
class: middle
.bigger[
Rough pretext task classification:
- Inferring structure
- Transformation prediction
- Reconstruction
- Instance classification
.inactive[
- Exploiting time
- Multimodal
]
]
---
# Exemplar networks
.center.bigger.blue[The image on the left is a distorted crop extracted from an image, which of these crops has the same source image?]
.hidden.center.bigger.red[Easy if robust to the desired transformations (geometry and colour) ]
.grid[
.kol-4-12[
<br/>
.center.width-25[]
]
.kol-8-12[
.center.width-100[]
]
]
.citation[A. Dosovitskiy et al., Discriminative Unsupervised Feature Learning with Exemplar Convolutional Neural Networks, PAMI 2015]
---
count: false
# Exemplar networks
.center.bigger.blue[The image on the left is a distorted crop extracted from an image, which of these crops has the same source image?]
.center.bigger.red[Easy if robust to the desired transformations (geometry and colour) ]
.grid[
.kol-4-12[
<br/>
.center.width-25[]
]
.kol-8-12[
.center.width-100[]
]
]
.citation[A. Dosovitskiy et al., Discriminative Unsupervised Feature Learning with Exemplar Convolutional Neural Networks, PAMI 2015]
---
# Exemplar networks
.grid[
.kol-4-12[
.center.width-70[]
]
.kol-8-12[
.bigger.green[Pros]
- Representations are invariant to desired transformations
- Requires preservation of fine-grained information
.bigger.red[Cons]
- Choosing the augmentations is important
- Exemplar based: images of the same class or instance are negatives
- Nothing prevents it from focusing on the background
- Original formulation is not scalable (number of “classes” = dataset size)
]
]
.citation[A. Dosovitskiy et al., Discriminative Unsupervised Feature Learning with Exemplar Convolutional Neural Networks, PAMI 2015]
---
# Exemplar networks
.grid[
.kol-3-12[
.center.width-90[]
]
.kol-9-12[
Exemplar ConvNets are not scalable (number of “classes” = number of training images)
- Using $w\_i$ as class prototype prevents explicit comparison between instances, i.e. individual samples
- We can use instead a _non-parametric_ variant that replaces $q^\top w\_j$ with $q^\top k\_i$
$$\mathcal{L}\_{\text{softmax}} (q, c(q)) = - \log\frac{\exp(q^\top w\_{c(q)})}{ \sum\_{c\in C}\exp(q^\top w\_{c})}$$
$$\downarrow$$
$$\mathcal{L}\_{\text{non-param-softmax}}(q) = - \log \frac{\exp(q^\top k\_q )}{ \sum\_{i \in N}\exp(q ^\top k\_{i})}$$
where:
- $N$ is the number of training samples
- $k\_q \in \\{ k\_i\\}$ is the key of a positive sample for $q$
]
]
.citation[A. Dosovitskiy et al., Discriminative Unsupervised Feature Learning with Exemplar Convolutional Neural Networks, PAMI 2015]
---
# Contrastive methods
.center.width-55[]
.caption[SimCLR]
.citation[T. Chen et al., A Simple Framework for Contrastive Learning of Visual Representations, ArXiv 2020 ]
---
count: false
class: middle
.bigger[
Rough pretext task classification:
- Inferring structure
- Transformation prediction