--- license: apache-2.0 base_model: - timm/eva02_large_patch14_448.mim_m38m_ft_in22k_in1k library_name: fastai tags: - Coleoptera - Taxonomy - Biology - Cicindelidae --- # Model Card for Model ID This model was trained on all specimens of *Cicindela* tiger beetles from the Field Museum. It is a multilabel model able to identify species and subspecies. See the model config file for all labels included and the publication for metrics. ## Model Details This model is based on the pre-trained [eva02_large_patch14_448](https://huggingface.co/timm/eva02_large_patch14_448.mim_m38m_ft_in22k_in1k) from the timm library. The training included several tricks to allow multilabel training with an imbalanced dataset, see the publication for details. ### Model Description - **Developed by:** [XXXX] - **Model type:** Image classification - **License:** Apache 2.0 - **Finetuned from model [optional]:** [eva02_large_patch14_448](https://huggingface.co/timm/eva02_large_patch14_448.mim_m38m_ft_in22k_in1k) ### Model Sources [optional] - **Paper [optional]:** [More Information Needed] ## Uses ### Direct Use Identification of pinned *Cicindela* specimens. ### Out-of-Scope Use This model will fail to make predictions on species not present in the FMNH collection. It is also unlikely to perform well for specimens that are not pinned. ## Bias, Risks, and Limitations The model is only expected to perform well for images of pinned tiger beetles. ## Training Details ### Training Data Data generated by [XXXX] using DrawerDissect on Field Museum specimens, see the publication for details. ### Training Procedure #### Training Hyperparameters - **Training regime:** fp16 mixed precision ## Evaluation ### Testing Data, Factors & Metrics #### Testing Data A subset of the specimens was held as a test set. See publication for details #### Metrics Metrics in the test set: Dataset Overview: - Total taxa analyzed: 193 - Species: 115 (59.6%) - Subspecies: 78 (40.4%) Performance Summary: Species: - Specimen-weighted precision: 96.8% - Specimen-weighted recall: 80.9% - Specimen-weighted precision: 97.0% - Specimen-weighted recall: 96.4% Subspecies: - Specimen-weighted precision: 89.0% - Specimen-weighted recall: 66.5% - Specimen-weighted precision: 85.0% - Specimen-weighted recall: 89.0% ## Usage The learner can be loaded to fastai with: ```{python} from huggingface_hub import from_pretrained_fastai learn = from_pretrained_fastai("brunoasm/eva02_large_patch14_448.Cicindela_ID_FMNH") ``` To avoid loading a pickle file and loading the model weights only, you can use: ```{python} import requests import io from fastai.vision.all import * def load_model_from_url(learn, url): try: print("Downloading model...") response = requests.get(url, stream=True) response.raise_for_status() buffer = io.BytesIO(response.content) learn.load(buffer, with_opt=False) print("Model loaded successfully!") except Exception as e: print(f"Error loading model: {e}") url = 'https://huggingface.co/brunoasm/eva02_large_patch14_448.Cicindela_ID_FMNH/resolve/main/pytorch_model.bin' learn = vision_learner(dls, "eva02_large_patch14_448.mim_m38m_ft_in22k_in1k") response = requests.get(url, stream=True) response.raise_for_status() buffer = io.BytesIO(response.content) learn.load(buffer, with_opt=False) ``` where `dls` is a previously created dataloader. ## Citation [XXXX]. DrawerDissect: Whole-drawer insect imaging, segmentation, and transcription using AI. **BibTeX:** [More Information Needed] **APA:** [More Information Needed] ## Model Card Authors [XXXX].