
# Model Card for Model ID

![image/png](https://cdn-uploads.huggingface.co/production/uploads/624d888b0ce29222ad64c3d6/X7cXpayiKgUCUycIen22S.png)


### Model Description


This model was finetuned for the "Feather in Focus!" Kaggle competition of the Information Studies Master's Applied Machine Learning course at the University of Amsterdam.
The goal of the competition was to apply novel approaches to achieve the highest possible accuracy on a bird classification task with 200 classes.
We were given a labeled dataset of 3926 images and an unlabeled dataset of 4000 test images.
Out of 32 groups and 1083 submissions, we achieved the #1 accuracy on the test set with a score of 0.87950.

### Training Details
The model we are finetuning, microsoft/swin-large-patch4-window12-384-in22k, was pre-trained on imagenet-21k, see https://huggingface.co/microsoft/swin-large-patch4-window12-384-in22k.

#### Preprocessing

Data augmentation was applied to the training data in a custom Torch dataset class. Because of the size of the dataset, images were not replaced but were duplicated and augmented.
The only augmentations applied were HorizontalFlips and Rotations (10 degrees) to align with the relatively homogeneous dataset.

# Finetuning
Finetuning was done on some 50 different models including different VTs and CNNs. All models were trained for 10 epochs with the best model, based on the evaluation acccuracy,
saved every epoch.
### Finetuning Data

The finetuning data is a subset  of the cub-200-2011 dataset, http://www.vision.caltech.edu/datasets/cub_200_2011/.
We finetuned the model on 3533 samples of the labeled dataset we were given, stratified on the label (7066 including augmented images).


#### Finetuning Hyperparameters

| Hyperparameter        | Value                      |
|-----------------------|----------------------------|
| Optimizer             | AdamW                     |
| Learning Rate         | 1e-4                     |
| Batch Size            | 32                        |
| Epochs                | 2                        |
| Weight Decay          | *                      |
| Class Weight          | *                      |
| Label Smoothing          | *                      |
| Scheduler             | *         |
| Mixed Precision       | Torch AMP                      |


*parameters were intentionally not set because of poor results

### Evaluation Data
The evaluation data is a subset of the cub-200-2011 dataset, http://www.vision.caltech.edu/datasets/cub_200_2011/.
We evaluated the model on 393 samples of the labeled dataset we were given, stratified on the label.

#### Testing Data

The testing data is a subset of an unlabeled subset of the cub-200-2011 dataset, http://www.vision.caltech.edu/datasets/cub_200_2011/ of 4000 images. After model finetuning
the best model, based on the evaluation data, would be loaded. This model would then be used to predict the labels of the unlabeled test set.
These predicted labels were submitted to the Kaggle competition via CSV which returned the test accuracy.

### Poster

![image/png](https://cdn-uploads.huggingface.co/production/uploads/624d888b0ce29222ad64c3d6/XbH4M6aL8iE4Hy75xfaHc.png)

*novel approaches were not applied when finetuning the final model as they did not improve accuracy.
black_footed_albatross laysan_albatross sooty_albatross groove_billed_ani crested_auklet least_auklet parakeet_auklet rhinoceros_auklet brewer_blackbird red_winged_blackbird rusty_blackbird yellow_headed_blackbird bobolink indigo_bunting lazuli_bunting painted_bunting cardinal spotted_catbird gray_catbird yellow_breasted_chat eastern_towhee chuck_will_widow brandt_cormorant red_faced_cormorant pelagic_cormorant bronzed_cowbird shiny_cowbird brown_creeper american_crow fish_crow black_billed_cuckoo mangrove_cuckoo yellow_billed_cuckoo gray_crowned_rosy_finch purple_finch northern_flicker acadian_flycatcher great_crested_flycatcher least_flycatcher olive_sided_flycatcher scissor_tailed_flycatcher vermilion_flycatcher yellow_bellied_flycatcher frigatebird northern_fulmar gadwall american_goldfinch european_goldfinch boat_tailed_grackle eared_grebe horned_grebe pied_billed_grebe western_grebe blue_grosbeak evening_grosbeak pine_grosbeak rose_breasted_grosbeak pigeon_guillemot california_gull glaucous_winged_gull heermann_gull herring_gull ivory_gull ring_billed_gull slaty_backed_gull western_gull anna_hummingbird ruby_throated_hummingbird rufous_hummingbird green_violetear long_tailed_jaeger pomarine_jaeger blue_jay florida_jay green_jay dark_eyed_junco tropical_kingbird gray_kingbird belted_kingfisher green_kingfisher pied_kingfisher ringed_kingfisher white_breasted_kingfisher red_legged_kittiwake horned_lark pacific_loon mallard western_meadowlark hooded_merganser red_breasted_merganser mockingbird nighthawk clark_nutcracker white_breasted_nuthatch baltimore_oriole hooded_oriole orchard_oriole scott_oriole ovenbird brown_pelican white_pelican western_wood_pewee sayornis american_pipit whip_poor_will horned_puffin common_raven white_necked_raven american_redstart geococcyx loggerhead_shrike great_grey_shrike baird_sparrow black_throated_sparrow brewer_sparrow chipping_sparrow clay_colored_sparrow house_sparrow field_sparrow fox_sparrow grasshopper_sparrow harris_sparrow henslow_sparrow le_conte_sparrow lincoln_sparrow nelson_sharp_tailed_sparrow savannah_sparrow seaside_sparrow song_sparrow tree_sparrow vesper_sparrow white_crowned_sparrow white_throated_sparrow cape_glossy_starling bank_swallow barn_swallow cliff_swallow tree_swallow scarlet_tanager summer_tanager artic_tern black_tern caspian_tern common_tern elegant_tern forsters_tern least_tern green_tailed_towhee brown_thrasher sage_thrasher black_capped_vireo blue_headed_vireo philadelphia_vireo red_eyed_vireo warbling_vireo white_eyed_vireo yellow_throated_vireo bay_breasted_warbler black_and_white_warbler black_throated_blue_warbler blue_winged_warbler canada_warbler cape_may_warbler cerulean_warbler chestnut_sided_warbler golden_winged_warbler hooded_warbler kentucky_warbler magnolia_warbler mourning_warbler myrtle_warbler nashville_warbler orange_crowned_warbler palm_warbler pine_warbler prairie_warbler prothonotary_warbler swainson_warbler tennessee_warbler wilson_warbler worm_eating_warbler yellow_warbler northern_waterthrush louisiana_waterthrush bohemian_waxwing cedar_waxwing american_three_toed_woodpecker pileated_woodpecker red_bellied_woodpecker red_cockaded_woodpecker red_headed_woodpecker downy_woodpecker bewick_wren cactus_wren carolina_wren house_wren marsh_wren rock_wren winter_wren common_yellowthroat