Changelog¶
Unreleased¶
New classifier: 400 species¶
dinov3_400species_hierarchical_classifier(weights, DINOv3 License): the same tree-factorised DINOv3 ViT-L/16 classifier trained on 400 bark and ambrosia beetle species (the benchmark's 65 plus 335 from the Bark and Ambrosia Gallery). Its default operating pointstrictis set to avoid wrong names (unknown check: similarity to the nearest training embedding). Species list:docs/species_400.md.- Classifier novelty members
knn<k>now work for any k (previously onlyknn5).
Licences¶
- The README and model docs no longer add a non-commercial condition to the AGPL-3.0 weights, which the AGPL does not allow. Each set of weights is released under its stated licence; the training-data terms (CC BY-NC benchmark images, iNaturalist 2017, IP102) are given as information for commercial users to check.
Faster inference on GPUs¶
- GPU fast path, on by default with CUDA: JPEG decoding with nvJPEG, the Ultralytics letterbox and the classifier's
crops on the GPU, and crops of several images classified together (
create_pipeline(batch_size=...); the evaluator passes 16 images per call). The identification pipeline runs 4.3× faster on 12.6-megapixel photographs (7.8 → 33.5 images/s on an RTX PRO 6000). Detections are unchanged; benchmark numbers move by at most a few specimens.create_pipeline(fast=False)/detector.fast = Falsekeep the reference path. - Measured before this change (issue #84): the pipeline spent 45% of its time in the detector's CPU pre-processing and 31% decoding JPEGs; the classifier was 14%. A Modular MAX port of the ViT-L classifier was 2–4× slower than PyTorch at throughput batch sizes on Blackwell GPUs, so MAX is not adopted.
v0.3.0¶
A full update of the package around the Bark and Ambrosia Beetle Detection Benchmark v2.0.1. This release breaks compatibility with v0.2.
Data¶
ibbi.get_dataset(split)loads a split (train,iid_test,inat_test,semantic_ood) of IBBI-bio/bark-ambrosia-beetle-benchmark, pinned to the v2.0.1 revision; only the requested split is downloaded and downloads resume through Hub rate limits. Items keep theimage/objectslayout and addiscrowd, category ids and the lineage of every specimen.- New:
ibbi.download_benchmark(),ibbi.get_taxonomy(),ibbi.utils.data.taxonomic_distance_matrix(). - Deprecated datasets:
ibbi_test_data,ibbi_ood_data,ibbi_shap_dataset.get_ood_dataset()returnssemantic_oodwith aDeprecationWarning;get_shap_background_dataset()samples the benchmark'strainsplit.
Models¶
- All v0.2 models are removed. New models (weights in new IBBI-bio repositories):
- species detectors for 65 species:
yolov8x_,yolov9e_,yolov10x_,yolo11x_,yolo12x_,rtdetrx_species_detector; yolo11x_arthropod_detector, a universal single-class arthropod detector, andcodino_arthropod_detector, a larger and more accurate one (Co-DINO with an EVA-02-L backbone, run on plain PyTorch; CC BY-NC 4.0);dinov3_hierarchical_classifierandbioclip2_hierarchical_classifier: subfamily / tribe / genus / species with calibrated probabilities and per-level "known / unsure" decisions;- zero-shot detectors
grounding_dino_,owlv2_,yoloworld_,sam3_zero_shot_detector. - New
ibbi.create_pipeline(): arthropod detector + hierarchical classifier. - Every model implements
predict,predict_probaandextract_features.create_model()loads trained weights by default (pretrained=True). - Aliases:
arthropod_detector,species_detector,hierarchical_classifieradded;beetle_detector,species_classifier,feature_extractor,zero_shot_detectornow point to the new models. IBBI_MODELS_DIRloads weights from a local folder.
Evaluation and explainability¶
- Crowd-aware evaluation: the benchmark's reference evaluator is vendored (
ibbi.evaluate.benchmark).Evaluator.benchmark()runs and scores any model on the benchmark;Evaluator.hierarchical_classification()scores the classifiers on specimen crops (per-level accuracy, calibration, novelty AUROC, over-commit);Evaluator.embeddings()uses taxonomic distance for the Mantel test. Evaluator.object_classification()is deprecated (its evaluator ignored crowd regions).- LIME and SHAP work with every model through
predict_proba. - Benchmark results of every model:
docs/benchmark.md, scripts inbenchmarks/.
Dependencies¶
ultralytics>=8.3.139,<8.4(8.4 changes YOLOv10 and RT-DETR predictions),transformers>=5,timm>=1.0.20,open-clip-torch,pycocotools,safetensorsadded;datasets,ipywidgets,hf-xet,slicer,tabulatedropped.
Licences¶
- Package code stays MIT. Model weights carry their own licences (AGPL-3.0 for the Ultralytics-trained detectors, DINOv3 License for the DINOv3 classifier, MIT for the BioCLIP 2 classifier); see the README and model cards.