HW 3 - CNNs

All information regarding the third homework assignment can be found here: UROB HW3 โ€“ Fruit Image Analysis Repository


๐ŸŽ Overview

This homework focuses on training a Convolutional Neural Network (CNN) to:

  • ๐Ÿท๏ธ Classify images of fruits into 30 categories
  • ๐ŸŽจ Segment fruits using pixel-level masks
  • ๐Ÿ” Learn meaningful image embeddings

The goal is to design, train, and evaluate a model capable of performing all three tasks efficiently.

โœ… Tasks

  • Implement your CNN model in `model.py` as class `MyModel`
  • The `forward()` method must return:
    1. Class logits `[batch_size, 30]`
    2. Segmentation mask `[batch_size, 1, 64, 64]`
    3. Image embeddings `[batch_size, embedding_dim]`
  • Implement `get_embedding()` returning embeddings only
  • Complete the training loop in `train.py`
  • Tune hyperparameters in `confs/config.yml`

๐Ÿ“Š Evaluation

Basic Evaluation (10 points)

Task Metric Threshold Points
โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€“
๐ŸŠ Classification Accuracy 80% โ†’ 1 pt 85% โ†’ 2 pts
๐ŸŽจ Segmentation Mean IoU 75% โ†’ 1 pt 80% โ†’ 2 pts 85% โ†’ 3 pts
๐Ÿ“ˆ Embeddings (ROC) AUC 0.80 โ†’ 1 pt 0.85 โ†’ 2 pts
๐ŸŽฏ Embeddings (TPR) TPR @ 5% FPR 0.75 โ†’ 1 pt 0.80 โ†’ 2 pts 0.85 โ†’ 3 pts

Tournament Evaluation (up to +3 bonus points) Models are ranked by performance across all tasks. Lower total rank = better score. Ties are broken by earlier submission.

* ๐Ÿฅ‡ 1st-3rd place โ†’ +3 pts

* ๐Ÿฅˆ 4th-6th place โ†’ +2 pts

* ๐Ÿฅ‰ 7th-9th place โ†’ +1 pts

Maximum total = 13 points


๐Ÿ“ฆ Submission

Submit a ZIP file containing:

  • `model.py` โ€“ your model
  • `train.py` โ€“ your training script
  • `weights.pth` โ€“ trained model weights

The size limit for a .zip file is 500 MB.

๐Ÿšซ Important Policies

Pretrained Models Policy โŒ No pretrained models or transfer learning allowed. โœ… Train from scratch using only the provided dataset.

Plagiarism Policy โœ… You may discuss ideas with classmates. โŒ Direct code copying = 0 points.


Hints

Keep the data loader similar to lab06. The images for the evaluation will be loaded and preprocessed in the same way.

Feel free to add data augmentation for better results.

Do not create giant networks for two reasons:

*It is not needed for this task :)

*The upload system allows you to upload a .zip file up to 500 MB. If your weights are larger than 500 MB, they cannot be evaluated.

Don't be shy using the compute. The cluster is for you; use it as much as possible to test your ideas.

Common Architectures for reference

Classification

AlexNet VGGNet ResNet

Segmentation

FCN U-Net Mask-RCNN

Good luck! ๐Ÿ€ For questions, contact: jan.skvrna@cvut.cz

courses/becm33dpl/tutorials/hw3.txt ยท Last modified: 2025/11/07 15:55 by skvrnjan