SlideShare une entreprise Scribd logo
1  sur  30
Télécharger pour lire hors ligne
ML2023 Spring HW3 -CNN
ML TAs
mlta-2023-spring@googlegroups.com
Outline
● Task Introduction
● Dataset
● Evaluation Metrics
● Kaggle Submission
● Gradescope
● Code Submission
● Grading Policy
● Regulations
● Baseline Hints
● Useful links
Task Introduction -Image Classification
● Solve image classification with convolutional neural networks(CNN).
CNN
Cat
Dataset
● The images are collected from the food-11 dataset splitted into 11 classes.
● Training set: 10000 labeled images
● Validation set: 3643 labeled images
● Testing set: 3000 images without labeled
Evaluation Metrics
● Accuracy on testing set
Kaggle Submission (1 / 3) -Links
● Display name: <student ID>_<anything>
○ e.g. b10901666_MLmaster
○ For auditing, don’t put student ID in your display name.
● Kaggle links
● HW Deadline: 2023/3/31 23:59 (UTC+8)
Kaggle Submission (2 / 3) -Rules
● You may submit up to 5 results each day (UTC+8, AM 8:00)
● Up to 2 submissions will be considered for the private leaderboard
remember to select 2
results for your final
scores before the
competition ends!
Kaggle Submission (3 / 3) -Format
● The file should contain a header and have the following format:
● Id corresponds to the jpg file name in test.
● Follow the sample code if you have trouble with formatting.
Gradescope
● Gradescope links
● Submit with gradescope, no need to upload any files.
● We can only see your last submission.
● Gradescope deadline: 2023/3/31 23:59 (UTC+8)
Q1.Augmentation Implementation (2%)
Implement augmentation by finishing train_tfm in the code with image size
of your choice. Copy your train_tfm code and paste it onto the
GradeScope, and explain the effects of transformations you report.
● Your train_tfm must be capable of producing 5+ different results when
given an identical image multiple times.
● Your train_tfm in the report can be different from train_tfm in your
training code.
Train_tfm
X
O
Q2.Visual Representations Implementation (2%)
● Visualize the learned visual representations of the CNN model on the
validation set by implementing t-SNE (t-distributed Stochastic Neighbor
Embedding) on the output of both top & mid layers (You need to submit 2
images).
● Briefly explain your result of the t-SNE visualization.
TA Sample TA Sample
Q2.Visual Representations
Implementation (2%)
● Take the CNN architecture beside as
example.
● The layers contained within the red
box may be identified as the "Bottom
layers."
● The layers contained within the green
box may be identified as the "Mid
layers."
● The layers contained within the blue
box may be identified as the "Top
layers."
Code Submission
● Compress your code, then submit it to NTU COOL.
<student ID>_hw3.zip
e.g. b10901666_hw3.zip
● If your codes are complicated, please write a README file.
● We can only see your last submission.
● Do not submit your model or dataset.
● If your code is not reasonable, your final grade will be multiplied by 0.9!
● Submission deadline:
○ 2023/3/31 23:59 (UTC+8)
Grading Policy-Baseline (1 / 2)
Baseline Accuracy Hints Training Time (Reference)
Simple 0.637 Run Sample Code 0.5hr - 1hr on Colab
Medium 0.700 Do some Data Augmentation & Train
longer
1.5hr - 2hr on Colab
Strong 0.814 Use predefined CNN from torchvision
or TensorFlow
10hr - 12hr on Colab
(Suggest using Kaggle)
Boss 0.874 Cross Validation + Ensemble or any
other methods you know
40+hr on Kaggle
Grading Policy-HW Score (2 / 2)
● simple (public) +0.5 pts
● simple (private) +0.5 pts
● medium (public) +0.5 pts
● medium (private) +0.5 pts
● strong (public) +0.5 pts
● strong (private) +0.5 pts
● boss (public) +0.5 pts
● boss (private) +0.5 pts
● code submission +2 pts
● report +4 pts
Total : 10 pts
Regulations
● You should NOT plagiarize, if you use any other resource, you should cite
it in the reference. (*)
● You should NOT modify your prediction files manually.
● Do NOT share codes, checkpoints, and prediction files with any living
creatures.
● Do NOT use any approaches to submit your results more than 5
times per day.
● Do NOT use additional data (including finding the answers of testing
set) and any pre-trained model.
● Your assignment will not be graded and your final grade x 0.9 if you
violate any of the above rules.
● Prof. Lee & TAs preserve the rights to change the rules & grades.
Academic Ethics Guidelines for Researchers by the Ministry of Science and Technology
Hints for baseline
Data Augmentation
● Modify the image data so non-identical inputs are given to the model each
epoch, to prevent overfitting of the model
● Visit torchvision.transforms for a list of choices and their corresponding
effect. Diversity is encouraged! Usually, stacking multiple transformations
leads to better results.
● Coding : fill in train_tfm to gain this effect
Model Selection
● Visit torchvision.models for a list of model structures, or go to timm for
the latest model structures.
● Pretrained weights are not allowed.
○ Torchvision before 0.13 -> pretrained=False
○ After 0.13 -> weights=False
Pre-defined model
Test Time Augmentation
● The sample code tests images using a deterministic “test transformation”
● You may using the train transformation for a more diversified
representation of the images, and predict with multiple variants of the
test images.
● Coding : You need to fill in train_tfm, change the augmentation
method for test_dataset, and modify prediction code to gain this effect
train_tfm test_tfm
Pred Pred Pred Pred Pred Pred Pred
Pred
Ensemble
>
test_tfm
+
Test Time Augmentation
● Usually, test_tfm will produce images that are more identifiable, so you
can assign a larger weight to test_tfm results for better performance.
● Ex : Final Prediction = avg_train_tfm_pred * 0.2 + test_tfm_pred* 0.8
train_tfm
Pred Pred Pred Pred Pred test_tfm_pred
avg_train_tfm_pred
test_tfm
A sample procedure for beating the boss baseline
● The boss baseline might not be beaten with a single model trained on kaggle
for 12hrs
● Your procedure can be ensemble of multiple models with parallelization
Train : 12h
Train : 12h Train : 12h
Train : 12h Train : 12h
Prediction
Save checkpoint Ensemble Prediction
multiple random seeds
multiple train validation split
multiple model structures
Cross Validation
● Cross-validation is a resampling method that uses different portions of
the data to validate and train a model on different iterations. Ensembling
multiple results lead to better performance.
● Coding : You need to merge the current train and validation paths, and
resample form those to form new train and validation sets.
Train
Train Train
Train Train
Train
Validation
Validation
Validation
Validation
Ensemble
Ensemble
● Average of logits or probability : Need to save verbose output, less
ambiguous
● Voting : Easier to implement
● Coding : basic math operations with numpy or torch
Experimental Tips
● Augmentation is a must to prevent overfitting. A good augmentation can
carry on to the testing phase with Test Time Augmentation.
● If you build your own network structure and have implemented
augmentation, don’t be afraid to scale up your model. (Many predefined
models structure are huge and perform great)
● In TA’s experiment, model structures with subsampling (max pooling)
work better, simply choosing the best performing models on ImageNet
according to websites is not always a good idea because pretrained
weights are not allowed.
Other tricks……
● on Classification
○ Label Smoothing Cross Entropy Loss
● on Optimization
○ Dropout
○ BatchNorm
○ Gradient Accumulation
Useful Links
● Course Website
● NTU COOL
● Kaggle Competition
● Gradescope
● Sample Code (Colab)
● Sample Code (Kaggle)
● Video Links
○ Introduction to CNN
○ tSNE
● Pytorch Documentation
○ torchvision.models
○ torchvision.transforms
Deadline
● Kaggle Contest
○ 2023/3/31 23:59 (UTC+8)
● GradeScope
○ 2023/3/31 23:59 (UTC+8)
● Code Submission to NTU COOL
○ 2023/3/31 23:59 (UTC+8)
Common Questions
● About Submission
○ You should submit a code that produces one of your best results on Kaggle,.
○ You should compress the folder containing your codes into <student_id>_hw3.zip. If your
filename is wrong, there would be a penalty on your hw3 score.
● About Kaggle
○ You should rename your display name on Kaggle by changing "Team name".
● About GradeScope
○ You should answer the questions on GradeScope, and no file about answer have to be
submitted to NTU COOL.
● These would be updated on NTU COOL, please read the FAQ before you
ask questions.
If you have any questions,you can ask us via...
● Please see the FAQ before you ask questions!!!!!
● NTU COOL (recommended)
○ https://cool.ntu.edu.tw/courses/24108/discussion_topics/184307
● Email
○ mlta-2023-spring@googlegroups.com
○ The title should begin with “[hw3]”
● TA hour
○ meet.google.com/dzv-ppjx-qtq
■ Monday 19:00 - 20:00 (中文)
■ Monday 20:00 - 21:00 (English)
○ Friday 上課課餘時間

Contenu connexe

Similaire à HW03 (1).pdf

Team AAA Pitch - Deeptech AI Hackathon
Team AAA Pitch - Deeptech AI HackathonTeam AAA Pitch - Deeptech AI Hackathon
Team AAA Pitch - Deeptech AI HackathonMatthias Schedel
 
Production-Ready BIG ML Workflows - from zero to hero
Production-Ready BIG ML Workflows - from zero to heroProduction-Ready BIG ML Workflows - from zero to hero
Production-Ready BIG ML Workflows - from zero to heroDaniel Marcous
 
PR-330: How To Train Your ViT? Data, Augmentation, and Regularization in Visi...
PR-330: How To Train Your ViT? Data, Augmentation, and Regularization in Visi...PR-330: How To Train Your ViT? Data, Augmentation, and Regularization in Visi...
PR-330: How To Train Your ViT? Data, Augmentation, and Regularization in Visi...Jinwon Lee
 
Semantic Segmentation on Satellite Imagery
Semantic Segmentation on Satellite ImagerySemantic Segmentation on Satellite Imagery
Semantic Segmentation on Satellite ImageryRAHUL BHOJWANI
 
DA 592 - Term Project Presentation - Berker Kozan Can Koklu - Kaggle Contest
DA 592 - Term Project Presentation - Berker Kozan Can Koklu - Kaggle ContestDA 592 - Term Project Presentation - Berker Kozan Can Koklu - Kaggle Contest
DA 592 - Term Project Presentation - Berker Kozan Can Koklu - Kaggle ContestBerker Kozan
 
Supervised embedding techniques in search ranking system
Supervised embedding techniques in search ranking systemSupervised embedding techniques in search ranking system
Supervised embedding techniques in search ranking systemMarsan Ma
 
Tips for data science competitions
Tips for data science competitionsTips for data science competitions
Tips for data science competitionsOwen Zhang
 
BKK16-300 Benchmarking 102
BKK16-300 Benchmarking 102BKK16-300 Benchmarking 102
BKK16-300 Benchmarking 102Linaro
 
Universal job embedding in recommendation (public ver.)
Universal job embedding in recommendation (public ver.)Universal job embedding in recommendation (public ver.)
Universal job embedding in recommendation (public ver.)Marsan Ma
 
Production ready big ml workflows from zero to hero daniel marcous @ waze
Production ready big ml workflows from zero to hero daniel marcous @ wazeProduction ready big ml workflows from zero to hero daniel marcous @ waze
Production ready big ml workflows from zero to hero daniel marcous @ wazeIdo Shilon
 
Framework for Inter-Model Analysis of Cyber-Physical Systems
Framework for Inter-Model Analysis of Cyber-Physical SystemsFramework for Inter-Model Analysis of Cyber-Physical Systems
Framework for Inter-Model Analysis of Cyber-Physical SystemsIvan Ruchkin
 
Machine-Learning-Overview a statistical approach
Machine-Learning-Overview a statistical approachMachine-Learning-Overview a statistical approach
Machine-Learning-Overview a statistical approachAjit Ghodke
 
[PDF] ISTQB Test Manager (CTAL-TM) Exam
[PDF] ISTQB Test Manager (CTAL-TM) Exam[PDF] ISTQB Test Manager (CTAL-TM) Exam
[PDF] ISTQB Test Manager (CTAL-TM) ExamMeghna Arora
 
Important Concepts for Machine Learning
Important Concepts for Machine LearningImportant Concepts for Machine Learning
Important Concepts for Machine LearningSolivarLabs
 
End to end MLworkflows
End to end MLworkflowsEnd to end MLworkflows
End to end MLworkflowsAdam Gibson
 
Online advertising and large scale model fitting
Online advertising and large scale model fittingOnline advertising and large scale model fitting
Online advertising and large scale model fittingWush Wu
 
ECML PKDD 2021 ML meets IoT Tutorial Part III: Deep Optimizations of CNNs and...
ECML PKDD 2021 ML meets IoT Tutorial Part III: Deep Optimizations of CNNs and...ECML PKDD 2021 ML meets IoT Tutorial Part III: Deep Optimizations of CNNs and...
ECML PKDD 2021 ML meets IoT Tutorial Part III: Deep Optimizations of CNNs and...Bharath Sudharsan
 
Going a Step Beyond the Black and White Lists for URL Accesses in the Enterpr...
Going a Step Beyond the Black and White Lists for URL Accesses in the Enterpr...Going a Step Beyond the Black and White Lists for URL Accesses in the Enterpr...
Going a Step Beyond the Black and White Lists for URL Accesses in the Enterpr...Paloma De Las Cuevas
 
Model Selection Techniques
Model Selection TechniquesModel Selection Techniques
Model Selection TechniquesSwati .
 

Similaire à HW03 (1).pdf (20)

Team AAA Pitch - Deeptech AI Hackathon
Team AAA Pitch - Deeptech AI HackathonTeam AAA Pitch - Deeptech AI Hackathon
Team AAA Pitch - Deeptech AI Hackathon
 
Production-Ready BIG ML Workflows - from zero to hero
Production-Ready BIG ML Workflows - from zero to heroProduction-Ready BIG ML Workflows - from zero to hero
Production-Ready BIG ML Workflows - from zero to hero
 
PR-330: How To Train Your ViT? Data, Augmentation, and Regularization in Visi...
PR-330: How To Train Your ViT? Data, Augmentation, and Regularization in Visi...PR-330: How To Train Your ViT? Data, Augmentation, and Regularization in Visi...
PR-330: How To Train Your ViT? Data, Augmentation, and Regularization in Visi...
 
Semantic Segmentation on Satellite Imagery
Semantic Segmentation on Satellite ImagerySemantic Segmentation on Satellite Imagery
Semantic Segmentation on Satellite Imagery
 
DA 592 - Term Project Presentation - Berker Kozan Can Koklu - Kaggle Contest
DA 592 - Term Project Presentation - Berker Kozan Can Koklu - Kaggle ContestDA 592 - Term Project Presentation - Berker Kozan Can Koklu - Kaggle Contest
DA 592 - Term Project Presentation - Berker Kozan Can Koklu - Kaggle Contest
 
Supervised embedding techniques in search ranking system
Supervised embedding techniques in search ranking systemSupervised embedding techniques in search ranking system
Supervised embedding techniques in search ranking system
 
Tips for data science competitions
Tips for data science competitionsTips for data science competitions
Tips for data science competitions
 
BKK16-300 Benchmarking 102
BKK16-300 Benchmarking 102BKK16-300 Benchmarking 102
BKK16-300 Benchmarking 102
 
Universal job embedding in recommendation (public ver.)
Universal job embedding in recommendation (public ver.)Universal job embedding in recommendation (public ver.)
Universal job embedding in recommendation (public ver.)
 
Production ready big ml workflows from zero to hero daniel marcous @ waze
Production ready big ml workflows from zero to hero daniel marcous @ wazeProduction ready big ml workflows from zero to hero daniel marcous @ waze
Production ready big ml workflows from zero to hero daniel marcous @ waze
 
Framework for Inter-Model Analysis of Cyber-Physical Systems
Framework for Inter-Model Analysis of Cyber-Physical SystemsFramework for Inter-Model Analysis of Cyber-Physical Systems
Framework for Inter-Model Analysis of Cyber-Physical Systems
 
Machine-Learning-Overview a statistical approach
Machine-Learning-Overview a statistical approachMachine-Learning-Overview a statistical approach
Machine-Learning-Overview a statistical approach
 
[PDF] ISTQB Test Manager (CTAL-TM) Exam
[PDF] ISTQB Test Manager (CTAL-TM) Exam[PDF] ISTQB Test Manager (CTAL-TM) Exam
[PDF] ISTQB Test Manager (CTAL-TM) Exam
 
Important Concepts for Machine Learning
Important Concepts for Machine LearningImportant Concepts for Machine Learning
Important Concepts for Machine Learning
 
End to end MLworkflows
End to end MLworkflowsEnd to end MLworkflows
End to end MLworkflows
 
Online advertising and large scale model fitting
Online advertising and large scale model fittingOnline advertising and large scale model fitting
Online advertising and large scale model fitting
 
ECML PKDD 2021 ML meets IoT Tutorial Part III: Deep Optimizations of CNNs and...
ECML PKDD 2021 ML meets IoT Tutorial Part III: Deep Optimizations of CNNs and...ECML PKDD 2021 ML meets IoT Tutorial Part III: Deep Optimizations of CNNs and...
ECML PKDD 2021 ML meets IoT Tutorial Part III: Deep Optimizations of CNNs and...
 
C3 w3
C3 w3C3 w3
C3 w3
 
Going a Step Beyond the Black and White Lists for URL Accesses in the Enterpr...
Going a Step Beyond the Black and White Lists for URL Accesses in the Enterpr...Going a Step Beyond the Black and White Lists for URL Accesses in the Enterpr...
Going a Step Beyond the Black and White Lists for URL Accesses in the Enterpr...
 
Model Selection Techniques
Model Selection TechniquesModel Selection Techniques
Model Selection Techniques
 

Dernier

Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfMarket Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfRachmat Ramadhan H
 
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAl Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAroojKhan71
 
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptxBPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptxMohammedJunaid861692
 
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
Log Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptxLog Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptxJohnnyPlasten
 
Determinants of health, dimensions of health, positive health and spectrum of...
Determinants of health, dimensions of health, positive health and spectrum of...Determinants of health, dimensions of health, positive health and spectrum of...
Determinants of health, dimensions of health, positive health and spectrum of...shambhavirathore45
 
Discover Why Less is More in B2B Research
Discover Why Less is More in B2B ResearchDiscover Why Less is More in B2B Research
Discover Why Less is More in B2B Researchmichael115558
 
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...Delhi Call girls
 
Generative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusGenerative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusTimothy Spann
 
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...amitlee9823
 
April 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's AnalysisApril 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's Analysismanisha194592
 
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...amitlee9823
 
VidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxVidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxolyaivanovalion
 
Best VIP Call Girls Noida Sector 39 Call Me: 8448380779
Best VIP Call Girls Noida Sector 39 Call Me: 8448380779Best VIP Call Girls Noida Sector 39 Call Me: 8448380779
Best VIP Call Girls Noida Sector 39 Call Me: 8448380779Delhi Call girls
 
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...SUHANI PANDEY
 
Smarteg dropshipping via API with DroFx.pptx
Smarteg dropshipping via API with DroFx.pptxSmarteg dropshipping via API with DroFx.pptx
Smarteg dropshipping via API with DroFx.pptxolyaivanovalion
 
BabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxBabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxolyaivanovalion
 
Ravak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxRavak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxolyaivanovalion
 

Dernier (20)

Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfMarket Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
 
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAl Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
 
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptxBPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
 
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
Delhi 99530 vip 56974 Genuine Escort Service Call Girls in Kishangarh
Delhi 99530 vip 56974 Genuine Escort Service Call Girls in  KishangarhDelhi 99530 vip 56974 Genuine Escort Service Call Girls in  Kishangarh
Delhi 99530 vip 56974 Genuine Escort Service Call Girls in Kishangarh
 
Log Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptxLog Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptx
 
Determinants of health, dimensions of health, positive health and spectrum of...
Determinants of health, dimensions of health, positive health and spectrum of...Determinants of health, dimensions of health, positive health and spectrum of...
Determinants of health, dimensions of health, positive health and spectrum of...
 
Discover Why Less is More in B2B Research
Discover Why Less is More in B2B ResearchDiscover Why Less is More in B2B Research
Discover Why Less is More in B2B Research
 
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
 
Generative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusGenerative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and Milvus
 
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
 
April 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's AnalysisApril 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's Analysis
 
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
 
VidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxVidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptx
 
Best VIP Call Girls Noida Sector 39 Call Me: 8448380779
Best VIP Call Girls Noida Sector 39 Call Me: 8448380779Best VIP Call Girls Noida Sector 39 Call Me: 8448380779
Best VIP Call Girls Noida Sector 39 Call Me: 8448380779
 
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
 
Smarteg dropshipping via API with DroFx.pptx
Smarteg dropshipping via API with DroFx.pptxSmarteg dropshipping via API with DroFx.pptx
Smarteg dropshipping via API with DroFx.pptx
 
BabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxBabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptx
 
Ravak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxRavak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptx
 

HW03 (1).pdf

  • 1. ML2023 Spring HW3 -CNN ML TAs mlta-2023-spring@googlegroups.com
  • 2. Outline ● Task Introduction ● Dataset ● Evaluation Metrics ● Kaggle Submission ● Gradescope ● Code Submission ● Grading Policy ● Regulations ● Baseline Hints ● Useful links
  • 3. Task Introduction -Image Classification ● Solve image classification with convolutional neural networks(CNN). CNN Cat
  • 4. Dataset ● The images are collected from the food-11 dataset splitted into 11 classes. ● Training set: 10000 labeled images ● Validation set: 3643 labeled images ● Testing set: 3000 images without labeled
  • 6. Kaggle Submission (1 / 3) -Links ● Display name: <student ID>_<anything> ○ e.g. b10901666_MLmaster ○ For auditing, don’t put student ID in your display name. ● Kaggle links ● HW Deadline: 2023/3/31 23:59 (UTC+8)
  • 7. Kaggle Submission (2 / 3) -Rules ● You may submit up to 5 results each day (UTC+8, AM 8:00) ● Up to 2 submissions will be considered for the private leaderboard remember to select 2 results for your final scores before the competition ends!
  • 8. Kaggle Submission (3 / 3) -Format ● The file should contain a header and have the following format: ● Id corresponds to the jpg file name in test. ● Follow the sample code if you have trouble with formatting.
  • 9. Gradescope ● Gradescope links ● Submit with gradescope, no need to upload any files. ● We can only see your last submission. ● Gradescope deadline: 2023/3/31 23:59 (UTC+8)
  • 10. Q1.Augmentation Implementation (2%) Implement augmentation by finishing train_tfm in the code with image size of your choice. Copy your train_tfm code and paste it onto the GradeScope, and explain the effects of transformations you report. ● Your train_tfm must be capable of producing 5+ different results when given an identical image multiple times. ● Your train_tfm in the report can be different from train_tfm in your training code. Train_tfm X O
  • 11. Q2.Visual Representations Implementation (2%) ● Visualize the learned visual representations of the CNN model on the validation set by implementing t-SNE (t-distributed Stochastic Neighbor Embedding) on the output of both top & mid layers (You need to submit 2 images). ● Briefly explain your result of the t-SNE visualization. TA Sample TA Sample
  • 12. Q2.Visual Representations Implementation (2%) ● Take the CNN architecture beside as example. ● The layers contained within the red box may be identified as the "Bottom layers." ● The layers contained within the green box may be identified as the "Mid layers." ● The layers contained within the blue box may be identified as the "Top layers."
  • 13. Code Submission ● Compress your code, then submit it to NTU COOL. <student ID>_hw3.zip e.g. b10901666_hw3.zip ● If your codes are complicated, please write a README file. ● We can only see your last submission. ● Do not submit your model or dataset. ● If your code is not reasonable, your final grade will be multiplied by 0.9! ● Submission deadline: ○ 2023/3/31 23:59 (UTC+8)
  • 14. Grading Policy-Baseline (1 / 2) Baseline Accuracy Hints Training Time (Reference) Simple 0.637 Run Sample Code 0.5hr - 1hr on Colab Medium 0.700 Do some Data Augmentation & Train longer 1.5hr - 2hr on Colab Strong 0.814 Use predefined CNN from torchvision or TensorFlow 10hr - 12hr on Colab (Suggest using Kaggle) Boss 0.874 Cross Validation + Ensemble or any other methods you know 40+hr on Kaggle
  • 15. Grading Policy-HW Score (2 / 2) ● simple (public) +0.5 pts ● simple (private) +0.5 pts ● medium (public) +0.5 pts ● medium (private) +0.5 pts ● strong (public) +0.5 pts ● strong (private) +0.5 pts ● boss (public) +0.5 pts ● boss (private) +0.5 pts ● code submission +2 pts ● report +4 pts Total : 10 pts
  • 16. Regulations ● You should NOT plagiarize, if you use any other resource, you should cite it in the reference. (*) ● You should NOT modify your prediction files manually. ● Do NOT share codes, checkpoints, and prediction files with any living creatures. ● Do NOT use any approaches to submit your results more than 5 times per day. ● Do NOT use additional data (including finding the answers of testing set) and any pre-trained model. ● Your assignment will not be graded and your final grade x 0.9 if you violate any of the above rules. ● Prof. Lee & TAs preserve the rights to change the rules & grades. Academic Ethics Guidelines for Researchers by the Ministry of Science and Technology
  • 18. Data Augmentation ● Modify the image data so non-identical inputs are given to the model each epoch, to prevent overfitting of the model ● Visit torchvision.transforms for a list of choices and their corresponding effect. Diversity is encouraged! Usually, stacking multiple transformations leads to better results. ● Coding : fill in train_tfm to gain this effect
  • 19. Model Selection ● Visit torchvision.models for a list of model structures, or go to timm for the latest model structures. ● Pretrained weights are not allowed. ○ Torchvision before 0.13 -> pretrained=False ○ After 0.13 -> weights=False Pre-defined model
  • 20. Test Time Augmentation ● The sample code tests images using a deterministic “test transformation” ● You may using the train transformation for a more diversified representation of the images, and predict with multiple variants of the test images. ● Coding : You need to fill in train_tfm, change the augmentation method for test_dataset, and modify prediction code to gain this effect train_tfm test_tfm Pred Pred Pred Pred Pred Pred Pred Pred Ensemble > test_tfm +
  • 21. Test Time Augmentation ● Usually, test_tfm will produce images that are more identifiable, so you can assign a larger weight to test_tfm results for better performance. ● Ex : Final Prediction = avg_train_tfm_pred * 0.2 + test_tfm_pred* 0.8 train_tfm Pred Pred Pred Pred Pred test_tfm_pred avg_train_tfm_pred test_tfm
  • 22. A sample procedure for beating the boss baseline ● The boss baseline might not be beaten with a single model trained on kaggle for 12hrs ● Your procedure can be ensemble of multiple models with parallelization Train : 12h Train : 12h Train : 12h Train : 12h Train : 12h Prediction Save checkpoint Ensemble Prediction multiple random seeds multiple train validation split multiple model structures
  • 23. Cross Validation ● Cross-validation is a resampling method that uses different portions of the data to validate and train a model on different iterations. Ensembling multiple results lead to better performance. ● Coding : You need to merge the current train and validation paths, and resample form those to form new train and validation sets. Train Train Train Train Train Train Validation Validation Validation Validation Ensemble
  • 24. Ensemble ● Average of logits or probability : Need to save verbose output, less ambiguous ● Voting : Easier to implement ● Coding : basic math operations with numpy or torch
  • 25. Experimental Tips ● Augmentation is a must to prevent overfitting. A good augmentation can carry on to the testing phase with Test Time Augmentation. ● If you build your own network structure and have implemented augmentation, don’t be afraid to scale up your model. (Many predefined models structure are huge and perform great) ● In TA’s experiment, model structures with subsampling (max pooling) work better, simply choosing the best performing models on ImageNet according to websites is not always a good idea because pretrained weights are not allowed.
  • 26. Other tricks…… ● on Classification ○ Label Smoothing Cross Entropy Loss ● on Optimization ○ Dropout ○ BatchNorm ○ Gradient Accumulation
  • 27. Useful Links ● Course Website ● NTU COOL ● Kaggle Competition ● Gradescope ● Sample Code (Colab) ● Sample Code (Kaggle) ● Video Links ○ Introduction to CNN ○ tSNE ● Pytorch Documentation ○ torchvision.models ○ torchvision.transforms
  • 28. Deadline ● Kaggle Contest ○ 2023/3/31 23:59 (UTC+8) ● GradeScope ○ 2023/3/31 23:59 (UTC+8) ● Code Submission to NTU COOL ○ 2023/3/31 23:59 (UTC+8)
  • 29. Common Questions ● About Submission ○ You should submit a code that produces one of your best results on Kaggle,. ○ You should compress the folder containing your codes into <student_id>_hw3.zip. If your filename is wrong, there would be a penalty on your hw3 score. ● About Kaggle ○ You should rename your display name on Kaggle by changing "Team name". ● About GradeScope ○ You should answer the questions on GradeScope, and no file about answer have to be submitted to NTU COOL. ● These would be updated on NTU COOL, please read the FAQ before you ask questions.
  • 30. If you have any questions,you can ask us via... ● Please see the FAQ before you ask questions!!!!! ● NTU COOL (recommended) ○ https://cool.ntu.edu.tw/courses/24108/discussion_topics/184307 ● Email ○ mlta-2023-spring@googlegroups.com ○ The title should begin with “[hw3]” ● TA hour ○ meet.google.com/dzv-ppjx-qtq ■ Monday 19:00 - 20:00 (中文) ■ Monday 20:00 - 21:00 (English) ○ Friday 上課課餘時間