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 +5 bonus points) Models are ranked by performance across all tasks. Lower total rank = better score. Ties are broken by earlier submission.

* ๐Ÿฅ‡ 1st place โ†’ +5 pts * ๐Ÿฅˆ 2nd โ†’ +4 pts * ๐Ÿฅ‰ 3rd โ†’ +3 pts * ๐Ÿ… Top 10 โ†’ +2 pts * ๐ŸŽ–๏ธ Top 20 โ†’ +1 pt

Maximum total = 15 points


๐Ÿ“ฆ Submission

Submit a ZIP file containing:

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

๐Ÿšซ 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.


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

courses/b3b33urob/tutorials/hw3.txt ยท Last modified: 2025/10/28 14:27 by hlavsja3