cicindelidFMNH commited on
Commit
3d562ea
·
verified ·
1 Parent(s): ee56469

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +175 -3
README.md CHANGED
@@ -1,3 +1,175 @@
1
- ---
2
- license: apache-2.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ base_model:
4
+ - timm/eva02_large_patch14_448.mim_m38m_ft_in22k_in1k
5
+ library_name: fastai
6
+ tags:
7
+ - Coleoptera
8
+ - Taxonomy
9
+ - Biology
10
+ - Cicindelidae
11
+ ---
12
+
13
+ # Model Card for Model ID
14
+
15
+ <!-- Provide a quick summary of what the model is/does. -->
16
+
17
+ 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.
18
+
19
+ ## Model Details
20
+
21
+ 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.
22
+
23
+ The training included several tricks to allow multilabel training with an imbalanced dataset, see the publication for details.
24
+
25
+
26
+ ### Model Description
27
+
28
+ <!-- Provide a longer summary of what this model is. -->
29
+
30
+
31
+
32
+ - **Developed by:** [XXXX]
33
+ - **Model type:** Image classification
34
+ - **License:** Apache 2.0
35
+ - **Finetuned from model [optional]:** [eva02_large_patch14_448](https://huggingface.co/timm/eva02_large_patch14_448.mim_m38m_ft_in22k_in1k)
36
+
37
+ ### Model Sources [optional]
38
+
39
+ <!-- Provide the basic links for the model. -->
40
+
41
+ - **Paper [optional]:** [More Information Needed]
42
+
43
+ ## Uses
44
+
45
+ <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
46
+
47
+ ### Direct Use
48
+
49
+ <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
50
+ Identification of pinned *Cicindela* specimens.
51
+
52
+
53
+
54
+ ### Out-of-Scope Use
55
+
56
+ <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
57
+
58
+ 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.
59
+
60
+ ## Bias, Risks, and Limitations
61
+
62
+ <!-- This section is meant to convey both technical and sociotechnical limitations. -->
63
+
64
+ The model is only expected to perform well for images of pinned tiger beetles.
65
+
66
+
67
+ ## Training Details
68
+
69
+ ### Training Data
70
+
71
+ <!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
72
+
73
+ Data generated by [XXXX] using DrawerDissect on Field Museum specimens, see the publication for details.
74
+
75
+ ### Training Procedure
76
+
77
+ <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
78
+
79
+
80
+ #### Training Hyperparameters
81
+
82
+ - **Training regime:** fp16 mixed precision
83
+
84
+ ## Evaluation
85
+
86
+ <!-- This section describes the evaluation protocols and provides the results. -->
87
+
88
+ ### Testing Data, Factors & Metrics
89
+
90
+ #### Testing Data
91
+
92
+ A subset of the specimens was held as a test set. See publication for details
93
+
94
+
95
+ #### Metrics
96
+
97
+ Metrics in the test set:
98
+
99
+ Dataset Overview:
100
+ - Total taxa analyzed: 193
101
+ - Species: 115 (59.6%)
102
+ - Subspecies: 78 (40.4%)
103
+
104
+ Performance Summary:
105
+
106
+ Species:
107
+ - Specimen-weighted precision: 96.8%
108
+ - Specimen-weighted recall: 80.9%
109
+ - Specimen-weighted precision: 97.0%
110
+ - Specimen-weighted recall: 96.4%
111
+
112
+ Subspecies:
113
+ - Specimen-weighted precision: 89.0%
114
+ - Specimen-weighted recall: 66.5%
115
+ - Specimen-weighted precision: 85.0%
116
+ - Specimen-weighted recall: 89.0%
117
+
118
+ ## Usage
119
+
120
+ The learner can be loaded to fastai with:
121
+
122
+ ```{python}
123
+ from huggingface_hub import from_pretrained_fastai
124
+ learn = from_pretrained_fastai("brunoasm/eva02_large_patch14_448.Cicindela_ID_FMNH")
125
+ ```
126
+
127
+ To avoid loading a pickle file and loading the model weights only, you can use:
128
+ ```{python}
129
+ import requests
130
+ import io
131
+ from fastai.vision.all import *
132
+
133
+ def load_model_from_url(learn, url):
134
+ try:
135
+ print("Downloading model...")
136
+ response = requests.get(url, stream=True)
137
+ response.raise_for_status()
138
+
139
+ buffer = io.BytesIO(response.content)
140
+ learn.load(buffer, with_opt=False)
141
+ print("Model loaded successfully!")
142
+
143
+ except Exception as e:
144
+ print(f"Error loading model: {e}")
145
+
146
+ url = 'https://huggingface.co/brunoasm/eva02_large_patch14_448.Cicindela_ID_FMNH/resolve/main/pytorch_model.bin'
147
+ learn = vision_learner(dls, "eva02_large_patch14_448.mim_m38m_ft_in22k_in1k")
148
+
149
+ response = requests.get(url, stream=True)
150
+ response.raise_for_status()
151
+ buffer = io.BytesIO(response.content)
152
+ learn.load(buffer, with_opt=False)
153
+
154
+ ```
155
+ where `dls` is a previously created dataloader.
156
+
157
+
158
+ ## Citation
159
+
160
+ <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
161
+
162
+ [XXXX]. DrawerDissect: Whole-drawer insect imaging, segmentation, and transcription using AI.
163
+
164
+ **BibTeX:**
165
+
166
+ [More Information Needed]
167
+
168
+ **APA:**
169
+
170
+ [More Information Needed]
171
+
172
+
173
+ ## Model Card Authors
174
+
175
+ [XXXX].