biobench.inat21
Trains a simple ridge regression classifier on visual representations for the iNat21 challenge. In the challenge, there are 10K different species (classes). We use the mini training set with 50 images per species, and test on the validation set, which has 10 images per species.
This task is a benchmark: it should help you understand how general a vision backbone's representations are. This is not a true, real-world task.
If you use this task, be sure to cite the original iNat21 dataset paper:
@misc{inat2021,
author={Van Horn, Grant and Mac Aodha, Oisin},
title={iNat Challenge 2021 - FGVC8},
publisher={Kaggle},
year={2021},
url={https://kaggle.com/competitions/inaturalist-2021}
}
Dataset
¶
Bases: ImageFolder
Subclasses ImageFolder so that __getitem__ includes the path, which we use as the ID.
__getitem__(index)
¶
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
index
|
int
|
Index |
required |
Returns:
| Name | Type | Description |
|---|---|---|
tuple |
tuple[str, object, object]
|
(path, sample, target) where target is class_index of the target class. |
Source code in src/biobench/inat21/__init__.py
benchmark(cfg)
¶
Steps: 1. Get features for all images. 2. Select lambda using validation data. 3. Report score on test data.