SlideShare a Scribd company logo
1 of 44
Download to read offline
hoseong.lee@cognex.com
Hoseong Lee (hoya012)
Cognex Research Engineer
Carrier of Tricks for
Image Classification
using PyTorch
• Paper Review & Related Works
• Additional Tricks
• Experiment & Implementation
• Result & Discussion
Contents
Paper Review &
Related Works
Paper Review
ImageNet 데이터셋 + ResNet-50에
다양한 Trick들을 적용해서
Top-1 accuracy를
무려 4% point를 끌어 올림!
Bag of Tricks for Image Classification with CNNs, 2019 CVPR
Paper Review
Batch size를 키워주면 그만큼
LR을 linear하게 키워주는 것이 좋음.
Init LR = 0.1 * b/256
Warmup + Cosine Annealing도
효과적!
1. Efficient Training – Learning Rate tuning for large batch training
Paper Review
ResNet과 같은 Residual Connection이
있는 경우, Batch Norm의 Gamma를
0으로 초기화하는 것이 좋다는 실험 결과
L2 weight decay를 bias와 Batch Norm의
parameter에는 적용하지 않는 것이
좋다는 실험 결과
2. Training Heuristic
Zero init
Paper Review
Mixed Precision Training을 통해 FP16으로
망을 안정적으로 학습시킬 수 있음.
GPU Memory 사용량이 줄어들어서 Batch
Size를 키울 수 있고, 연산이 빨라져서 학습
시간을 대폭 줄일 수 있음.
3. Low-precision Training
Paper Review
정확도도 높아지고 학습
속도도 빨라지는 효과!
1, 2, 3 의 실험 결과
Paper Review
4. Architecture Tweaks
이것 저것 바꿔보니
정확도가 좋아짐!
Paper Review
Label Smoothing, Knowledge
Distillation, Mixup 기법을
적용하여 실험!
5. Training Strategy
Paper Review
Label smoothing, Mixup이
대체로 효과적!
1, 2, 3, 4, 5 의 실험 결과
Paper Review
전체 방법들 총 정리
Learning Rate Tuning
Zero Gamma
Selective Weight Decay
Low Precision Training
ResNet-50 Tweaks
Label Smoothing
Knowledge Distillation
Mixup Augmentation
Paper Review
MXNet 기반 Gluon CV에 구현되어 있음.
하지만 Bag of Tricks를 쓰자고 기존
코드를 전부 MXNet으로 옮길 순 없지..
Bag of Tricks for Image Classification with CNNs, 2019 CVPR
Related Works
Bag of Tricks 저자들의
Object Detection 버전! (자매품)
YOLOv3은 무려 5% 포인트 증가!
Bag of Freebies for Training Object Detection Neural Networks, 2019 arXiv
Related Works
Clova Vision, Naver의 논문
각종 최신 방법론을 짬뽕하여
Assemble-ResNet-50 기준
82.8% Top-1 Acc 달성!
Compounding the Performance Improvements of Assembled Techniques in
a Convolutional Neural Network, 2020 arXiv
Related Works
YOLO도 질 수 없다!
각종 테크닉들을 적용하여
성능을 대폭 향상시킴!
YOLOv4: Optimal Speed and Accuracy of Object Detection, 2020 arXiv
Additional
Tricks
Additional Tricks
섞거나 (Mixup)
구멍 낼 거면 (Cutout)
둘 다 하면 안됨?? (CutMix)
CutMix: Regularization Strategy to Train Strong Classifiers with Localizable
Features, 2019 ICCV
Additional Tricks
Adam 모르면 간첩
경험 상 Fine-tuning 할 때는 작은
lr과 Adam을 쓰는게 좋은 결과를
보였음!
Adam: A Method for Stochastic Optimization, 2015 ICLR
Additional Tricks
Adam의 학습 극 초반 bad local
optima convergence를 개선하기 위해
adaptive learning rate의 variance를
줄여서 학습 안정성을 높인
RAdam Optimizer 제안
On the Variance of the Adaptive Learning Rate and Beyond, 2020 ICLR
Additional Tricks
말 그대로 batch 마다
Random하게
Augmentation 뽑아서
적용하자!
RandAugment: Practical automated data augmentation with a reduced search
space, 2020 CVPRW
Additional Tricks
Norm + Act를 한번에 고려함.
진화 알고리즘을 통해
특정 데이터셋에 대한
최적의 연산 조합을 찾자!
Evolving Normalization-Activation Layers, 2020 arXiv
Additional Tricks
MnasNet에서 width, height,
resolution을 동시에 키워주는
Compound Scaling 기법을
적용하여 성능을 높임!
EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks, 2019
ICML
Additional Tricks
NAS로 architecture를 찾지 말고
아예 design 하는 rule을 찾아서
확장성을 높이자!
Designing Network Design Spaces, 2020 CVPR
Experiment &
Implementation
Experiments
Dataset: Kaggle Intel Image Classification Dataset
25k images of size 150x150
6 categories
{'buildings' -> 0, 'forest' -> 1, 'glacier' -> 2,
'mountain' -> 3, 'sea' -> 4, 'street' -> 5 }
Experiments
- ImageNet pretrained ResNet-50 from torchvision.models
- 1080 Ti 1 GPU / Batch Size 64 / Epochs 120 / Initial Learning Rate 0.1
- Training Augmentation: Resize((256, 256)), RandomHorizontalFlip()
- SGD + Momentum(0.9) + learning rate step decay (x0.1 at 30, 60, 90 epoch)
→ Almost same with Bag-of-Tricks Paper
Baseline Training Setting
Experiments
Model Selection
Deep Double Descent: Where Bigger Models and More Data Hurt
Experiments
Model Selection
- Train 80%, Validation 20%, Last Model 로 Test
- Train 80%, Validation 20%, Best Model (Val Acc가 가장 높았던 epoch) 로 Test
- Train 100%, Last Model 로 Test
K-fold CV, 반복 실험까지 했으면 더 좋았을 텐데.. 크흠..
Experiments
Model Selection
Validation set을 그냥 학습에 쓸
때가 성능이 제일 좋았음!
주의! 항상 이런 경향을 보이진
않음!
Experiments
- Learning Rate Warmup
- Cosine Learning Rate Annealing
- Label Smoothing
- MixUp Augmentation
Bring 4 tricks from original paper
Experiments
Bring 7 tricks from my research note..!
CutMix
Adam Optimizer
RAdam Optimizer
RandAugment
EvoNorm
EfficientNet
RegNet
Experiments
대가 분들의
Open source를
기반으로 실험용
PyTorch Codebase 제작!
https://github.com/hoya012/carrier-of-tricks-for-classification-pytorch
Experiments
Code Reference (Thank You!)
Result &
Discussion
Experiments
Experimental Results
B : Baseline / A : Adam Optimizer / W : Warm up / C : Cosine
Annealing S : Label Smoothing / M : MixUp Augmentation
ImageNet Pretraining이 역시 효과적!
Adam이 fine-tuning에 역시 효과적!
Warm up이 좋은 결과를 보임!
나머지 기법들은 무난한 결과..
Experiments
Experimental Results
CM: CutMix / R: RAdam / RA: RandAugment / E: EvoNorm
대부분의 기법이 재미를 못 봄..
이유는 Hyper-parameter를 search
하지 않았기 때문..!
최적 셋팅을 찾으면 성능 향상이 될
것이라고 믿습니다!
Experiments
Experimental Results
ResNet-50 → EfficientNet-B2
ResNet-50과 모델 크기가 비슷한
EfficientNet-B2 로 실험!
대체로 좋은 결과를 얻을 수 있었음!
Experiments
Experimental Results
ResNet-50 → RegNetY-1.6GF
ResNet-50과 모델 크기가 비슷한
RegNetY-1.6GF 로 실험!
3개의 model 중에 가장 우수한 성능!
Experiments
Summary
• 재미 본 방법론
• 역시 Adam이 좋구만
• Learning Rate Warmup은 요새는 거의 기본으로 쓰이는 이유가 있음
• Cosine, Label Smoothing, MixUp, CutMix 는 좋긴 한데 드라마틱하진 않음!
• EfficientNet, RegNet도 역시 ResNet보다 대체로 좋은 경향!
• 재미 못 본 방법론
• EvoNorm, RandAugment 는 쓰나 안 쓰나 비슷한 성능!
모든 방법론들이 ImageNet에서만 검증된 기법이라
성능 향상이 극적이진 않은 건 공통점
Experiments
아쉬웠던 점 & Further Works
• 반복 실험을 해서 randomness로 인한 편차를 줄였으면 더 좋았을 것 같음!
• Data 전 처리나 Augmentation 등에 시간을 거의 쓰지 않음! → 더 높은 성능 달성할 수 있을 듯?
• Dataset 자체가 쉬워서 그런지 성능 향상이 미미했음.
• ImageNet에 특화된 기법들이 많아서 데이터 셋이 바뀌면 그에 따라 hyper-parameter 등을 tuning
해줘야 하는데 이 과정을 대부분 생략함.
• 다양한 technique 들을 추가하고 실험해볼 예정!
Experiments
Try!
실험을 똑같이 돌릴 수 있는
script들을 올려 두었으니
여러분도 해보세요!
Thank you for watching.
Q & A

More Related Content

What's hot

PR-313 Training BatchNorm and Only BatchNorm: On the Expressive Power of Rand...
PR-313 Training BatchNorm and Only BatchNorm: On the Expressive Power of Rand...PR-313 Training BatchNorm and Only BatchNorm: On the Expressive Power of Rand...
PR-313 Training BatchNorm and Only BatchNorm: On the Expressive Power of Rand...Sunghoon Joo
 
"Learning transferable architectures for scalable image recognition" Paper Re...
"Learning transferable architectures for scalable image recognition" Paper Re..."Learning transferable architectures for scalable image recognition" Paper Re...
"Learning transferable architectures for scalable image recognition" Paper Re...LEE HOSEONG
 
PR-203: Class-Balanced Loss Based on Effective Number of Samples
PR-203: Class-Balanced Loss Based on Effective Number of SamplesPR-203: Class-Balanced Loss Based on Effective Number of Samples
PR-203: Class-Balanced Loss Based on Effective Number of SamplesSunghoon Joo
 
PR-339: Maintaining discrimination and fairness in class incremental learning
PR-339: Maintaining discrimination and fairness in class incremental learningPR-339: Maintaining discrimination and fairness in class incremental learning
PR-339: Maintaining discrimination and fairness in class incremental learningSunghoon Joo
 
"Searching for Activation Functions" Paper Review
"Searching for Activation Functions" Paper Review"Searching for Activation Functions" Paper Review
"Searching for Activation Functions" Paper ReviewLEE HOSEONG
 
Deep neural networks for You-Tube recommendations
Deep neural networks for You-Tube recommendationsDeep neural networks for You-Tube recommendations
Deep neural networks for You-Tube recommendationsseungwoo kim
 
딥러닝 논문읽기 efficient netv2 논문리뷰
딥러닝 논문읽기 efficient netv2  논문리뷰딥러닝 논문읽기 efficient netv2  논문리뷰
딥러닝 논문읽기 efficient netv2 논문리뷰taeseon ryu
 
[한국어] Neural Architecture Search with Reinforcement Learning
[한국어] Neural Architecture Search with Reinforcement Learning[한국어] Neural Architecture Search with Reinforcement Learning
[한국어] Neural Architecture Search with Reinforcement LearningKiho Suh
 
PR-218: MFAS: Multimodal Fusion Architecture Search
PR-218: MFAS: Multimodal Fusion Architecture SearchPR-218: MFAS: Multimodal Fusion Architecture Search
PR-218: MFAS: Multimodal Fusion Architecture SearchSunghoon Joo
 
네트워크 경량화 이모저모 @ 2020 DLD
네트워크 경량화 이모저모 @ 2020 DLD네트워크 경량화 이모저모 @ 2020 DLD
네트워크 경량화 이모저모 @ 2020 DLDKim Junghoon
 
Encoding in Style: a Style Encoder for Image-to-Image Translation
Encoding in Style: a Style Encoder for Image-to-Image TranslationEncoding in Style: a Style Encoder for Image-to-Image Translation
Encoding in Style: a Style Encoder for Image-to-Image Translationtaeseon ryu
 
(Nlp)fine tuning 대회_참여기
(Nlp)fine tuning 대회_참여기(Nlp)fine tuning 대회_참여기
(Nlp)fine tuning 대회_참여기OverDeep
 
스마트폰 위의 딥러닝
스마트폰 위의 딥러닝스마트폰 위의 딥러닝
스마트폰 위의 딥러닝NAVER Engineering
 
Enliple korquad challenge
Enliple korquad challengeEnliple korquad challenge
Enliple korquad challengeSanghyun Cho
 
Bert3q KorQuAD Finetuning NLP Challenge
Bert3q KorQuAD Finetuning NLP ChallengeBert3q KorQuAD Finetuning NLP Challenge
Bert3q KorQuAD Finetuning NLP ChallengeOverDeep
 
Designing more efficient convolution neural network
Designing more efficient convolution neural networkDesigning more efficient convolution neural network
Designing more efficient convolution neural networkDongyi Kim
 
Enliple BERT-Small을 이용한 KorQuAD 모델
Enliple BERT-Small을 이용한 KorQuAD 모델Enliple BERT-Small을 이용한 KorQuAD 모델
Enliple BERT-Small을 이용한 KorQuAD 모델KwangHyeonPark
 
Face recognition
Face recognitionFace recognition
Face recognitionsoul8085
 

What's hot (20)

PR-313 Training BatchNorm and Only BatchNorm: On the Expressive Power of Rand...
PR-313 Training BatchNorm and Only BatchNorm: On the Expressive Power of Rand...PR-313 Training BatchNorm and Only BatchNorm: On the Expressive Power of Rand...
PR-313 Training BatchNorm and Only BatchNorm: On the Expressive Power of Rand...
 
"Learning transferable architectures for scalable image recognition" Paper Re...
"Learning transferable architectures for scalable image recognition" Paper Re..."Learning transferable architectures for scalable image recognition" Paper Re...
"Learning transferable architectures for scalable image recognition" Paper Re...
 
PR-203: Class-Balanced Loss Based on Effective Number of Samples
PR-203: Class-Balanced Loss Based on Effective Number of SamplesPR-203: Class-Balanced Loss Based on Effective Number of Samples
PR-203: Class-Balanced Loss Based on Effective Number of Samples
 
PR-339: Maintaining discrimination and fairness in class incremental learning
PR-339: Maintaining discrimination and fairness in class incremental learningPR-339: Maintaining discrimination and fairness in class incremental learning
PR-339: Maintaining discrimination and fairness in class incremental learning
 
"Searching for Activation Functions" Paper Review
"Searching for Activation Functions" Paper Review"Searching for Activation Functions" Paper Review
"Searching for Activation Functions" Paper Review
 
Deep neural networks for You-Tube recommendations
Deep neural networks for You-Tube recommendationsDeep neural networks for You-Tube recommendations
Deep neural networks for You-Tube recommendations
 
딥러닝 논문읽기 efficient netv2 논문리뷰
딥러닝 논문읽기 efficient netv2  논문리뷰딥러닝 논문읽기 efficient netv2  논문리뷰
딥러닝 논문읽기 efficient netv2 논문리뷰
 
[한국어] Neural Architecture Search with Reinforcement Learning
[한국어] Neural Architecture Search with Reinforcement Learning[한국어] Neural Architecture Search with Reinforcement Learning
[한국어] Neural Architecture Search with Reinforcement Learning
 
Ai nlp challenge
Ai nlp challengeAi nlp challenge
Ai nlp challenge
 
PR-218: MFAS: Multimodal Fusion Architecture Search
PR-218: MFAS: Multimodal Fusion Architecture SearchPR-218: MFAS: Multimodal Fusion Architecture Search
PR-218: MFAS: Multimodal Fusion Architecture Search
 
네트워크 경량화 이모저모 @ 2020 DLD
네트워크 경량화 이모저모 @ 2020 DLD네트워크 경량화 이모저모 @ 2020 DLD
네트워크 경량화 이모저모 @ 2020 DLD
 
Encoding in Style: a Style Encoder for Image-to-Image Translation
Encoding in Style: a Style Encoder for Image-to-Image TranslationEncoding in Style: a Style Encoder for Image-to-Image Translation
Encoding in Style: a Style Encoder for Image-to-Image Translation
 
(Nlp)fine tuning 대회_참여기
(Nlp)fine tuning 대회_참여기(Nlp)fine tuning 대회_참여기
(Nlp)fine tuning 대회_참여기
 
스마트폰 위의 딥러닝
스마트폰 위의 딥러닝스마트폰 위의 딥러닝
스마트폰 위의 딥러닝
 
Enliple korquad challenge
Enliple korquad challengeEnliple korquad challenge
Enliple korquad challenge
 
Bert3q KorQuAD Finetuning NLP Challenge
Bert3q KorQuAD Finetuning NLP ChallengeBert3q KorQuAD Finetuning NLP Challenge
Bert3q KorQuAD Finetuning NLP Challenge
 
Designing more efficient convolution neural network
Designing more efficient convolution neural networkDesigning more efficient convolution neural network
Designing more efficient convolution neural network
 
Enliple BERT-Small을 이용한 KorQuAD 모델
Enliple BERT-Small을 이용한 KorQuAD 모델Enliple BERT-Small을 이용한 KorQuAD 모델
Enliple BERT-Small을 이용한 KorQuAD 모델
 
Face recognition
Face recognitionFace recognition
Face recognition
 
Detecting fake jpeg images
Detecting fake jpeg imagesDetecting fake jpeg images
Detecting fake jpeg images
 

Similar to carrier of_tricks_for_image_classification

Bag of Tricks for Image Classification with Convolutional Neural Networks (C...
Bag of Tricks for Image Classification  with Convolutional Neural Networks (C...Bag of Tricks for Image Classification  with Convolutional Neural Networks (C...
Bag of Tricks for Image Classification with Convolutional Neural Networks (C...gohyunwoong
 
Chapter 11 Practical Methodology
Chapter 11 Practical MethodologyChapter 11 Practical Methodology
Chapter 11 Practical MethodologyKyeongUkJang
 
Ml for 정형데이터
Ml for 정형데이터Ml for 정형데이터
Ml for 정형데이터JEEHYUN PAIK
 
PR-383: Solving ImageNet: a Unified Scheme for Training any Backbone to Top R...
PR-383: Solving ImageNet: a Unified Scheme for Training any Backbone to Top R...PR-383: Solving ImageNet: a Unified Scheme for Training any Backbone to Top R...
PR-383: Solving ImageNet: a Unified Scheme for Training any Backbone to Top R...Sunghoon Joo
 
Image data augmentatiion
Image data augmentatiionImage data augmentatiion
Image data augmentatiionSubin An
 
Nationality recognition
Nationality recognitionNationality recognition
Nationality recognition준영 박
 
AWS 클라우드 비용 최적화를 위한 모범 사례-AWS Summit Seoul 2017
AWS 클라우드 비용 최적화를 위한 모범 사례-AWS Summit Seoul 2017AWS 클라우드 비용 최적화를 위한 모범 사례-AWS Summit Seoul 2017
AWS 클라우드 비용 최적화를 위한 모범 사례-AWS Summit Seoul 2017Amazon Web Services Korea
 
Dense sparse-dense training for dnn and Other Models
Dense sparse-dense training for dnn and Other ModelsDense sparse-dense training for dnn and Other Models
Dense sparse-dense training for dnn and Other ModelsDong Heon Cho
 
파이썬으로 익히는 딥러닝 기본 (18년)
파이썬으로 익히는 딥러닝 기본 (18년)파이썬으로 익히는 딥러닝 기본 (18년)
파이썬으로 익히는 딥러닝 기본 (18년)SK(주) C&C - 강병호
 
Image net classification with deep convolutional neural networks
Image net classification with deep convolutional neural networks Image net classification with deep convolutional neural networks
Image net classification with deep convolutional neural networks Korea, Sejong University.
 
[Paper] EDA : easy data augmentation techniques for boosting performance on t...
[Paper] EDA : easy data augmentation techniques for boosting performance on t...[Paper] EDA : easy data augmentation techniques for boosting performance on t...
[Paper] EDA : easy data augmentation techniques for boosting performance on t...Susang Kim
 
2021-11-16 모두콘 딥러닝 경량화 발표
2021-11-16 모두콘 딥러닝 경량화 발표2021-11-16 모두콘 딥러닝 경량화 발표
2021-11-16 모두콘 딥러닝 경량화 발표JongkukLim
 
Image Deep Learning 실무적용
Image Deep Learning 실무적용Image Deep Learning 실무적용
Image Deep Learning 실무적용Youngjae Kim
 
A.I.S팀_산학프로젝트챌린지 (2).pptx
A.I.S팀_산학프로젝트챌린지 (2).pptxA.I.S팀_산학프로젝트챌린지 (2).pptx
A.I.S팀_산학프로젝트챌린지 (2).pptxssuser0e717a
 
Automated program corrector for programming assignments using Deep Learning
Automated program corrector for programming assignments using Deep LearningAutomated program corrector for programming assignments using Deep Learning
Automated program corrector for programming assignments using Deep LearningSoo Kim
 
위성관측 데이터 활용 강수량 산출 AI 경진대회 1위 수상작
위성관측 데이터 활용 강수량 산출 AI 경진대회 1위 수상작위성관측 데이터 활용 강수량 산출 AI 경진대회 1위 수상작
위성관측 데이터 활용 강수량 산출 AI 경진대회 1위 수상작DACON AI 데이콘
 

Similar to carrier of_tricks_for_image_classification (20)

Bag of Tricks for Image Classification with Convolutional Neural Networks (C...
Bag of Tricks for Image Classification  with Convolutional Neural Networks (C...Bag of Tricks for Image Classification  with Convolutional Neural Networks (C...
Bag of Tricks for Image Classification with Convolutional Neural Networks (C...
 
Chapter 11 Practical Methodology
Chapter 11 Practical MethodologyChapter 11 Practical Methodology
Chapter 11 Practical Methodology
 
Ml for 정형데이터
Ml for 정형데이터Ml for 정형데이터
Ml for 정형데이터
 
PR-383: Solving ImageNet: a Unified Scheme for Training any Backbone to Top R...
PR-383: Solving ImageNet: a Unified Scheme for Training any Backbone to Top R...PR-383: Solving ImageNet: a Unified Scheme for Training any Backbone to Top R...
PR-383: Solving ImageNet: a Unified Scheme for Training any Backbone to Top R...
 
World model
World modelWorld model
World model
 
Image data augmentatiion
Image data augmentatiionImage data augmentatiion
Image data augmentatiion
 
Nationality recognition
Nationality recognitionNationality recognition
Nationality recognition
 
AWS 클라우드 비용 최적화를 위한 모범 사례-AWS Summit Seoul 2017
AWS 클라우드 비용 최적화를 위한 모범 사례-AWS Summit Seoul 2017AWS 클라우드 비용 최적화를 위한 모범 사례-AWS Summit Seoul 2017
AWS 클라우드 비용 최적화를 위한 모범 사례-AWS Summit Seoul 2017
 
Dense sparse-dense training for dnn and Other Models
Dense sparse-dense training for dnn and Other ModelsDense sparse-dense training for dnn and Other Models
Dense sparse-dense training for dnn and Other Models
 
파이썬으로 익히는 딥러닝 기본 (18년)
파이썬으로 익히는 딥러닝 기본 (18년)파이썬으로 익히는 딥러닝 기본 (18년)
파이썬으로 익히는 딥러닝 기본 (18년)
 
Image net classification with deep convolutional neural networks
Image net classification with deep convolutional neural networks Image net classification with deep convolutional neural networks
Image net classification with deep convolutional neural networks
 
Openface
OpenfaceOpenface
Openface
 
[Paper] EDA : easy data augmentation techniques for boosting performance on t...
[Paper] EDA : easy data augmentation techniques for boosting performance on t...[Paper] EDA : easy data augmentation techniques for boosting performance on t...
[Paper] EDA : easy data augmentation techniques for boosting performance on t...
 
2021-11-16 모두콘 딥러닝 경량화 발표
2021-11-16 모두콘 딥러닝 경량화 발표2021-11-16 모두콘 딥러닝 경량화 발표
2021-11-16 모두콘 딥러닝 경량화 발표
 
Image Deep Learning 실무적용
Image Deep Learning 실무적용Image Deep Learning 실무적용
Image Deep Learning 실무적용
 
AUTOML
AUTOMLAUTOML
AUTOML
 
Automl
AutomlAutoml
Automl
 
A.I.S팀_산학프로젝트챌린지 (2).pptx
A.I.S팀_산학프로젝트챌린지 (2).pptxA.I.S팀_산학프로젝트챌린지 (2).pptx
A.I.S팀_산학프로젝트챌린지 (2).pptx
 
Automated program corrector for programming assignments using Deep Learning
Automated program corrector for programming assignments using Deep LearningAutomated program corrector for programming assignments using Deep Learning
Automated program corrector for programming assignments using Deep Learning
 
위성관측 데이터 활용 강수량 산출 AI 경진대회 1위 수상작
위성관측 데이터 활용 강수량 산출 AI 경진대회 1위 수상작위성관측 데이터 활용 강수량 산출 AI 경진대회 1위 수상작
위성관측 데이터 활용 강수량 산출 AI 경진대회 1위 수상작
 

More from LEE HOSEONG

Unsupervised anomaly detection using style distillation
Unsupervised anomaly detection using style distillationUnsupervised anomaly detection using style distillation
Unsupervised anomaly detection using style distillationLEE HOSEONG
 
do adversarially robust image net models transfer better
do adversarially robust image net models transfer betterdo adversarially robust image net models transfer better
do adversarially robust image net models transfer betterLEE HOSEONG
 
"The Many Faces of Robustness: A Critical Analysis of Out-of-Distribution Gen...
"The Many Faces of Robustness: A Critical Analysis of Out-of-Distribution Gen..."The Many Faces of Robustness: A Critical Analysis of Out-of-Distribution Gen...
"The Many Faces of Robustness: A Critical Analysis of Out-of-Distribution Gen...LEE HOSEONG
 
Mixed Precision Training Review
Mixed Precision Training ReviewMixed Precision Training Review
Mixed Precision Training ReviewLEE HOSEONG
 
MVTec AD: A Comprehensive Real-World Dataset for Unsupervised Anomaly Detection
MVTec AD: A Comprehensive Real-World Dataset for Unsupervised Anomaly DetectionMVTec AD: A Comprehensive Real-World Dataset for Unsupervised Anomaly Detection
MVTec AD: A Comprehensive Real-World Dataset for Unsupervised Anomaly DetectionLEE HOSEONG
 
YOLOv4: optimal speed and accuracy of object detection review
YOLOv4: optimal speed and accuracy of object detection reviewYOLOv4: optimal speed and accuracy of object detection review
YOLOv4: optimal speed and accuracy of object detection reviewLEE HOSEONG
 
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
 
"Revisiting self supervised visual representation learning" Paper Review
"Revisiting self supervised visual representation learning" Paper Review"Revisiting self supervised visual representation learning" Paper Review
"Revisiting self supervised visual representation learning" Paper ReviewLEE HOSEONG
 
Unsupervised visual representation learning overview: Toward Self-Supervision
Unsupervised visual representation learning overview: Toward Self-SupervisionUnsupervised visual representation learning overview: Toward Self-Supervision
Unsupervised visual representation learning overview: Toward Self-SupervisionLEE HOSEONG
 
Human uncertainty makes classification more robust, ICCV 2019 Review
Human uncertainty makes classification more robust, ICCV 2019 ReviewHuman uncertainty makes classification more robust, ICCV 2019 Review
Human uncertainty makes classification more robust, ICCV 2019 ReviewLEE HOSEONG
 
Single Image Super Resolution Overview
Single Image Super Resolution OverviewSingle Image Super Resolution Overview
Single Image Super Resolution OverviewLEE HOSEONG
 
2019 ICLR Best Paper Review
2019 ICLR Best Paper Review2019 ICLR Best Paper Review
2019 ICLR Best Paper ReviewLEE HOSEONG
 
2019 cvpr paper_overview
2019 cvpr paper_overview2019 cvpr paper_overview
2019 cvpr paper_overviewLEE HOSEONG
 
Pelee: a real time object detection system on mobile devices Paper Review
Pelee: a real time object detection system on mobile devices Paper ReviewPelee: a real time object detection system on mobile devices Paper Review
Pelee: a real time object detection system on mobile devices Paper ReviewLEE HOSEONG
 

More from LEE HOSEONG (14)

Unsupervised anomaly detection using style distillation
Unsupervised anomaly detection using style distillationUnsupervised anomaly detection using style distillation
Unsupervised anomaly detection using style distillation
 
do adversarially robust image net models transfer better
do adversarially robust image net models transfer betterdo adversarially robust image net models transfer better
do adversarially robust image net models transfer better
 
"The Many Faces of Robustness: A Critical Analysis of Out-of-Distribution Gen...
"The Many Faces of Robustness: A Critical Analysis of Out-of-Distribution Gen..."The Many Faces of Robustness: A Critical Analysis of Out-of-Distribution Gen...
"The Many Faces of Robustness: A Critical Analysis of Out-of-Distribution Gen...
 
Mixed Precision Training Review
Mixed Precision Training ReviewMixed Precision Training Review
Mixed Precision Training Review
 
MVTec AD: A Comprehensive Real-World Dataset for Unsupervised Anomaly Detection
MVTec AD: A Comprehensive Real-World Dataset for Unsupervised Anomaly DetectionMVTec AD: A Comprehensive Real-World Dataset for Unsupervised Anomaly Detection
MVTec AD: A Comprehensive Real-World Dataset for Unsupervised Anomaly Detection
 
YOLOv4: optimal speed and accuracy of object detection review
YOLOv4: optimal speed and accuracy of object detection reviewYOLOv4: optimal speed and accuracy of object detection review
YOLOv4: optimal speed and accuracy of object detection review
 
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
 
"Revisiting self supervised visual representation learning" Paper Review
"Revisiting self supervised visual representation learning" Paper Review"Revisiting self supervised visual representation learning" Paper Review
"Revisiting self supervised visual representation learning" Paper Review
 
Unsupervised visual representation learning overview: Toward Self-Supervision
Unsupervised visual representation learning overview: Toward Self-SupervisionUnsupervised visual representation learning overview: Toward Self-Supervision
Unsupervised visual representation learning overview: Toward Self-Supervision
 
Human uncertainty makes classification more robust, ICCV 2019 Review
Human uncertainty makes classification more robust, ICCV 2019 ReviewHuman uncertainty makes classification more robust, ICCV 2019 Review
Human uncertainty makes classification more robust, ICCV 2019 Review
 
Single Image Super Resolution Overview
Single Image Super Resolution OverviewSingle Image Super Resolution Overview
Single Image Super Resolution Overview
 
2019 ICLR Best Paper Review
2019 ICLR Best Paper Review2019 ICLR Best Paper Review
2019 ICLR Best Paper Review
 
2019 cvpr paper_overview
2019 cvpr paper_overview2019 cvpr paper_overview
2019 cvpr paper_overview
 
Pelee: a real time object detection system on mobile devices Paper Review
Pelee: a real time object detection system on mobile devices Paper ReviewPelee: a real time object detection system on mobile devices Paper Review
Pelee: a real time object detection system on mobile devices Paper Review
 

carrier of_tricks_for_image_classification

  • 1. hoseong.lee@cognex.com Hoseong Lee (hoya012) Cognex Research Engineer Carrier of Tricks for Image Classification using PyTorch
  • 2. • Paper Review & Related Works • Additional Tricks • Experiment & Implementation • Result & Discussion Contents
  • 4. Paper Review ImageNet 데이터셋 + ResNet-50에 다양한 Trick들을 적용해서 Top-1 accuracy를 무려 4% point를 끌어 올림! Bag of Tricks for Image Classification with CNNs, 2019 CVPR
  • 5. Paper Review Batch size를 키워주면 그만큼 LR을 linear하게 키워주는 것이 좋음. Init LR = 0.1 * b/256 Warmup + Cosine Annealing도 효과적! 1. Efficient Training – Learning Rate tuning for large batch training
  • 6. Paper Review ResNet과 같은 Residual Connection이 있는 경우, Batch Norm의 Gamma를 0으로 초기화하는 것이 좋다는 실험 결과 L2 weight decay를 bias와 Batch Norm의 parameter에는 적용하지 않는 것이 좋다는 실험 결과 2. Training Heuristic Zero init
  • 7. Paper Review Mixed Precision Training을 통해 FP16으로 망을 안정적으로 학습시킬 수 있음. GPU Memory 사용량이 줄어들어서 Batch Size를 키울 수 있고, 연산이 빨라져서 학습 시간을 대폭 줄일 수 있음. 3. Low-precision Training
  • 8. Paper Review 정확도도 높아지고 학습 속도도 빨라지는 효과! 1, 2, 3 의 실험 결과
  • 9. Paper Review 4. Architecture Tweaks 이것 저것 바꿔보니 정확도가 좋아짐!
  • 10. Paper Review Label Smoothing, Knowledge Distillation, Mixup 기법을 적용하여 실험! 5. Training Strategy
  • 11. Paper Review Label smoothing, Mixup이 대체로 효과적! 1, 2, 3, 4, 5 의 실험 결과
  • 12. Paper Review 전체 방법들 총 정리 Learning Rate Tuning Zero Gamma Selective Weight Decay Low Precision Training ResNet-50 Tweaks Label Smoothing Knowledge Distillation Mixup Augmentation
  • 13. Paper Review MXNet 기반 Gluon CV에 구현되어 있음. 하지만 Bag of Tricks를 쓰자고 기존 코드를 전부 MXNet으로 옮길 순 없지.. Bag of Tricks for Image Classification with CNNs, 2019 CVPR
  • 14. Related Works Bag of Tricks 저자들의 Object Detection 버전! (자매품) YOLOv3은 무려 5% 포인트 증가! Bag of Freebies for Training Object Detection Neural Networks, 2019 arXiv
  • 15. Related Works Clova Vision, Naver의 논문 각종 최신 방법론을 짬뽕하여 Assemble-ResNet-50 기준 82.8% Top-1 Acc 달성! Compounding the Performance Improvements of Assembled Techniques in a Convolutional Neural Network, 2020 arXiv
  • 16. Related Works YOLO도 질 수 없다! 각종 테크닉들을 적용하여 성능을 대폭 향상시킴! YOLOv4: Optimal Speed and Accuracy of Object Detection, 2020 arXiv
  • 18. Additional Tricks 섞거나 (Mixup) 구멍 낼 거면 (Cutout) 둘 다 하면 안됨?? (CutMix) CutMix: Regularization Strategy to Train Strong Classifiers with Localizable Features, 2019 ICCV
  • 19. Additional Tricks Adam 모르면 간첩 경험 상 Fine-tuning 할 때는 작은 lr과 Adam을 쓰는게 좋은 결과를 보였음! Adam: A Method for Stochastic Optimization, 2015 ICLR
  • 20. Additional Tricks Adam의 학습 극 초반 bad local optima convergence를 개선하기 위해 adaptive learning rate의 variance를 줄여서 학습 안정성을 높인 RAdam Optimizer 제안 On the Variance of the Adaptive Learning Rate and Beyond, 2020 ICLR
  • 21. Additional Tricks 말 그대로 batch 마다 Random하게 Augmentation 뽑아서 적용하자! RandAugment: Practical automated data augmentation with a reduced search space, 2020 CVPRW
  • 22. Additional Tricks Norm + Act를 한번에 고려함. 진화 알고리즘을 통해 특정 데이터셋에 대한 최적의 연산 조합을 찾자! Evolving Normalization-Activation Layers, 2020 arXiv
  • 23. Additional Tricks MnasNet에서 width, height, resolution을 동시에 키워주는 Compound Scaling 기법을 적용하여 성능을 높임! EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks, 2019 ICML
  • 24. Additional Tricks NAS로 architecture를 찾지 말고 아예 design 하는 rule을 찾아서 확장성을 높이자! Designing Network Design Spaces, 2020 CVPR
  • 26. Experiments Dataset: Kaggle Intel Image Classification Dataset 25k images of size 150x150 6 categories {'buildings' -> 0, 'forest' -> 1, 'glacier' -> 2, 'mountain' -> 3, 'sea' -> 4, 'street' -> 5 }
  • 27. Experiments - ImageNet pretrained ResNet-50 from torchvision.models - 1080 Ti 1 GPU / Batch Size 64 / Epochs 120 / Initial Learning Rate 0.1 - Training Augmentation: Resize((256, 256)), RandomHorizontalFlip() - SGD + Momentum(0.9) + learning rate step decay (x0.1 at 30, 60, 90 epoch) → Almost same with Bag-of-Tricks Paper Baseline Training Setting
  • 28. Experiments Model Selection Deep Double Descent: Where Bigger Models and More Data Hurt
  • 29. Experiments Model Selection - Train 80%, Validation 20%, Last Model 로 Test - Train 80%, Validation 20%, Best Model (Val Acc가 가장 높았던 epoch) 로 Test - Train 100%, Last Model 로 Test K-fold CV, 반복 실험까지 했으면 더 좋았을 텐데.. 크흠..
  • 30. Experiments Model Selection Validation set을 그냥 학습에 쓸 때가 성능이 제일 좋았음! 주의! 항상 이런 경향을 보이진 않음!
  • 31. Experiments - Learning Rate Warmup - Cosine Learning Rate Annealing - Label Smoothing - MixUp Augmentation Bring 4 tricks from original paper
  • 32. Experiments Bring 7 tricks from my research note..! CutMix Adam Optimizer RAdam Optimizer RandAugment EvoNorm EfficientNet RegNet
  • 33. Experiments 대가 분들의 Open source를 기반으로 실험용 PyTorch Codebase 제작! https://github.com/hoya012/carrier-of-tricks-for-classification-pytorch
  • 36. Experiments Experimental Results B : Baseline / A : Adam Optimizer / W : Warm up / C : Cosine Annealing S : Label Smoothing / M : MixUp Augmentation ImageNet Pretraining이 역시 효과적! Adam이 fine-tuning에 역시 효과적! Warm up이 좋은 결과를 보임! 나머지 기법들은 무난한 결과..
  • 37. Experiments Experimental Results CM: CutMix / R: RAdam / RA: RandAugment / E: EvoNorm 대부분의 기법이 재미를 못 봄.. 이유는 Hyper-parameter를 search 하지 않았기 때문..! 최적 셋팅을 찾으면 성능 향상이 될 것이라고 믿습니다!
  • 38. Experiments Experimental Results ResNet-50 → EfficientNet-B2 ResNet-50과 모델 크기가 비슷한 EfficientNet-B2 로 실험! 대체로 좋은 결과를 얻을 수 있었음!
  • 39. Experiments Experimental Results ResNet-50 → RegNetY-1.6GF ResNet-50과 모델 크기가 비슷한 RegNetY-1.6GF 로 실험! 3개의 model 중에 가장 우수한 성능!
  • 40. Experiments Summary • 재미 본 방법론 • 역시 Adam이 좋구만 • Learning Rate Warmup은 요새는 거의 기본으로 쓰이는 이유가 있음 • Cosine, Label Smoothing, MixUp, CutMix 는 좋긴 한데 드라마틱하진 않음! • EfficientNet, RegNet도 역시 ResNet보다 대체로 좋은 경향! • 재미 못 본 방법론 • EvoNorm, RandAugment 는 쓰나 안 쓰나 비슷한 성능! 모든 방법론들이 ImageNet에서만 검증된 기법이라 성능 향상이 극적이진 않은 건 공통점
  • 41. Experiments 아쉬웠던 점 & Further Works • 반복 실험을 해서 randomness로 인한 편차를 줄였으면 더 좋았을 것 같음! • Data 전 처리나 Augmentation 등에 시간을 거의 쓰지 않음! → 더 높은 성능 달성할 수 있을 듯? • Dataset 자체가 쉬워서 그런지 성능 향상이 미미했음. • ImageNet에 특화된 기법들이 많아서 데이터 셋이 바뀌면 그에 따라 hyper-parameter 등을 tuning 해줘야 하는데 이 과정을 대부분 생략함. • 다양한 technique 들을 추가하고 실험해볼 예정!
  • 42. Experiments Try! 실험을 똑같이 돌릴 수 있는 script들을 올려 두었으니 여러분도 해보세요!
  • 43. Thank you for watching.
  • 44. Q & A