Git Product home page Git Product logo

chicks4freeid's Introduction

๐Ÿ” Chicks4FreeID

The very first publicly available chicken re-identification dataset is available on ๐Ÿค— Hugging Face: huggingface.co/datasets/dariakern/Chicks4FreeID

๐Ÿค— Usage

pip install datasets

Load the data:

from datasets import load_dataset
train_ds = load_dataset("dariakern/Chicks4FreeID", split="train")
train_ds[0]

Output:

{'crop': <PIL.PngImagePlugin.PngImageFile image mode=RGB size=2630x2630 at 0x7AA95E7D1720>,
'identity': 43}

Tip

Find more information on how to work with ๐Ÿค— huggingface.co/docs/datasets

๐Ÿ“Š Baseline

To establish a baseline on the dataset, we explore 3 approaches

  1. We evaluate the SotA model in animal re-identification: MegaDescriptor-L-384, a feature extractor, pre-trained on many species and identities.

    timm.create_model("hf-hub:BVRA/MegaDescriptor-L-384", pretrained=True)

  2. We train MegaDescriptor-L-384's underlying architecture; a Swin-Transformer, in the same way it has been used to build the MegaDescriptor-L-384, but now on our own dataset.

    timm.create_model('swin_large_patch4_window12_384')

  3. We train a Vision Transformer (ViT-B/16) as a fully supervised baseline, and focus on embeddings by replacing the classifier head with a linear layer.

    from torchvision.models import vit_b_16

Evaluation settings are based on:

Metrics are from torchmetrics

  • mAP: MulticlassAveragePrecision(average="macro")
  • top1: MulticlassAccuracy(top_k=1)
  • top5: MulticlassAccuracy(top_k=5)

Below are the metrics for the test set. Standard deviations are based on 3 runs:

Setting Evaluation mAP top-1 top-5
MegaDescriptor-L-384 (frozen) k-NN 0.649 ยฑ 0.044 0.709 ยฑ 0.026 0.924 ยฑ 0.027
MegaDescriptor-L-384 (frozen) Linear 0.935 ยฑ 0.005 0.883 ยฑ 0.009 0.985 ยฑ 0.003
Swin-L-384 k-NN 0.837 ยฑ 0.062 0.881 ยฑ 0.041 0.983 ยฑ 0.010
Swin-L-384 Linear 0.963 ยฑ 0.022 0.922 ยฑ 0.042 0.987 ยฑ 0.012
ViT-B/16 k-NN 0.893 ยฑ 0.010 0.923 ยฑ 0.005 0.985 ยฑ 0.019
ViT-B/16 Linear 0.976 ยฑ 0.007 0.928 ยฑ 0.002 0.990 ยฑ 0.012

The most interesting observation in this table is that, even though the MegaDescriptor-L-384 feature extractor has never seen our dataset, its embeddings are still relatively helpful in identifiying the chickens, even when compared to the fully supervised approaches.

๐Ÿง‘โ€๐Ÿ’ป Replicate the baseline

git clone https://github.com/DariaKern/Chicks4FreeID
cd Chicks4FreeID
pip install requirements.txt
python run_baseline.py

You can pass different options, depending on your hardware configuration

python run_baseline.py --devices=4 --batch-size-per-device=128 

For a full list of arguments type

python run_baseline.py --help

In a sepearte shell, open tensorboard to view progress and results

tensorboard --logdir baseline_logs

Note

Differnt low-level accelerator implementations (TPU, MPS, CUDA) yield different results. The original hardware config for the reported results is based on the MPS implementation accessible on a 64GB Apple M3 Max chip (2023) ๐Ÿ’ป - it is recommened to run the baseline script with at least 64GB of VRAM / Shared RAM. On this device, one run takes around 9:30h

โณ Timeline

๐Ÿ“ Papers and systems citing the Chicks4FreeID dataset

coming soon ...

๐Ÿ–‹๏ธ Citation

@misc{kern2024Chicks4FreeID,
      title={Chicks4freeID: A Benchmark Dataset for Chicken Re-Identification}, 
      author={Daria Kern and Tobias Schiele and Ulrich Klauck and Winfred Ingabire},
      year={2024},
      doi={https://doi.org/10.57967/hf/2345},
      note={in preparation for NeurIPS 2024 Datasets and Benchmarks Track}
}

chicks4freeid's People

Contributors

dariakern avatar thetoby9944 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.