Checklist HAIO 2024 Summer National Final · CV-2 task
Smart Farmer John
English title: Intelligens János Gazda
Adapt a pretrained EfficientNet-B2 with a given classifier head and weights to count the animals of each species in a set of photographs.
The task
Farmer John the Smart has illicitly downloaded the profile pictures of a neighbouring farmer's animals and wants to know the composition of the livestock. The contestant classifies every image into one of 10 classes (butterfly, cat, cow, dog, elephant, hen, horse, sheep, spider, squirrel) and totals the number of animals per class.
Task 1 (8 points): load torchvision EfficientNet-B2 with EfficientNet_B2_Weights.DEFAULT, freeze its weights and replace the classifier head with the head shown in the attached figure (its input size equals the in_features of the original head). Task 2 (1 point): load the weights from jános_modell.pth. Task 3 (4 points): implement a PyTorch Dataset that supports transforms. Task 4 (2 points): resize the images to 224×224 and normalise with mean [0.485, 0.456, 0.406] and std [0.229, 0.224, 0.225]. Task 5 (10 points): run inference on all images and print the count per animal in the form "animal_1 = x".
Abridged by SOTA from the official materials. The official statement has the exact rules, and it wins wherever this summary differs.
At a glance
- You get
- A folder of animal images (originally á
llatok.zip) and fine-tuned model weights (jános_modell.pth), both downloaded with gdown. - You submit
- The completed notebook printing the number of animals per class.
- Scoring
- 25 points in total (8 + 1 + 4 + 2 + 10); graded by the organisers.
- Rules
- Keras and TensorFlow are not allowed; any PyTorch-based tool may be used.
- Format
- Summer National Final (Nyári Országos Döntő), held on site at the ELTE Faculty of Informatics, Budapest, on 30 May 2024. Solved in Google Colab; the completed notebook is downloaded as .ipynb and uploaded, zipped together with the other solutions, to the CMS.