HugoMarkoff commited on
Commit
41136bd
·
verified ·
1 Parent(s): 672e28f

Update README with correct paths and usage examples

Browse files
Files changed (1) hide show
  1. README.md +139 -217
README.md CHANGED
@@ -28,96 +28,37 @@ size_categories:
28
  source_datasets:
29
  - AI-EcoNet/HUGO-Bench
30
  configs:
31
- - config_name: cluster_count_prediction
32
- data_files:
33
- - split: train
34
- path: 06_cluster_count_prediction/*.json
 
 
 
35
  - config_name: clustering_supervised
36
- data_files:
37
- - split: train
38
- path: 04_clustering_supervised/*.json
39
  - config_name: clustering_unsupervised
40
- data_files:
41
- - split: train
42
- path: 05_clustering_unsupervised/*.json
43
- - config_name: dimensionality_reduction
44
- data_files:
45
- - split: train
46
- path: 03_dimensionality_reduction/*.json
47
  - config_name: intra_species_variation
48
- data_files:
49
- - split: train
50
- path: intra_species_variation/train-*
51
- - config_name: model_comparison
52
- data_files:
53
- - split: train
54
- path: 02_model_comparison/*.json
55
- - config_name: primary_benchmarking
56
- data_files:
57
- - split: train
58
- path: 01_primary_benchmarking/*.csv
59
- default: true
60
  - config_name: scaling_tests
61
- data_files:
62
- - split: train
63
- path: scaling_tests/train-*
64
- - config_name: subsample_definitions
65
- data_files:
66
- - split: train
67
- path: subsample_definitions/train-*
68
  - config_name: uneven_distribution
69
- data_files:
70
- - split: train
71
- path: uneven_distribution/train-*
72
- dataset_info:
73
- - config_name: intra_species_variation
74
- features:
75
- - name: filename
76
- dtype: string
77
- - name: content
78
- dtype: string
79
- splits:
80
- - name: train
81
- num_bytes: 64315
82
- num_examples: 11
83
- download_size: 11487
84
- dataset_size: 64315
85
- - config_name: scaling_tests
86
- features:
87
- - name: filename
88
- dtype: string
89
- - name: content
90
- dtype: string
91
- splits:
92
- - name: train
93
- num_bytes: 5754770
94
- num_examples: 1205
95
- download_size: 1304695
96
- dataset_size: 5754770
97
  - config_name: subsample_definitions
98
- features:
99
- - name: filename
100
- dtype: string
101
- - name: content
102
- dtype: string
103
- splits:
104
- - name: train
105
- num_bytes: 3038864
106
- num_examples: 10
107
- download_size: 643403
108
- dataset_size: 3038864
109
- - config_name: uneven_distribution
110
- features:
111
- - name: filename
112
- dtype: string
113
- - name: content
114
- dtype: string
115
- splits:
116
- - name: train
117
- num_bytes: 1914245
118
- num_examples: 410
119
- download_size: 374649
120
- dataset_size: 1914245
121
  ---
122
 
123
  # HUGO-Bench Paper Reproducibility
@@ -125,187 +66,168 @@ dataset_info:
125
  **Supplementary data and reproducibility materials for the paper:**
126
 
127
  > **Vision Transformers for Zero-Shot Clustering of Animal Images: A Comparative Benchmarking Study**
128
- >
129
  > Hugo Markoff, Stefan Hein Bengtson, Michael Ørsted
130
- >
131
  > Aalborg University, Denmark
132
 
133
  ## Dataset Description
134
 
135
- This repository contains complete experimental results, pre-computed embeddings, and execution logs from our comprehensive benchmarking study evaluating Vision Transformer models for zero-shot species-level clustering of camera trap images.
136
 
137
- ### Relationship to HUGO-Bench
138
 
139
- This dataset is derived from [HUGO-Bench](https://huggingface.co/datasets/AI-EcoNet/HUGO-Bench), which provides the source images and species annotations. While HUGO-Bench contains the **validated image crops** (139,111 images across 60 species), this repository provides:
 
140
 
141
- - **Clustering results** from all 27,600 experimental configurations
142
- - **Pre-computed embeddings** enabling reproduction without image access
143
- - **Execution logs** for full experimental traceability
144
 
145
- | Dataset | Content | Purpose |
146
- |---------|---------|---------|
147
- | [HUGO-Bench](https://huggingface.co/datasets/AI-EcoNet/HUGO-Bench) | 139,111 validated camera trap images | Source images for experiments |
148
- | **This repository** | Results, embeddings, logs | Paper reproducibility |
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
149
 
150
- ## Repository Structure
 
 
 
 
 
151
 
 
 
 
152
  ```
153
- ├── 01_primary_benchmarking/ # Full 27,600 configuration results
154
- │ ├── clustering_analysis_complete.csv
155
- │ ├── clustering_analysis_with_ami.csv
156
- │ ├── comprehensive_vmeasure_by_class.json
157
- │ └── images_run_*.json # Subsample definitions (10 runs)
158
-
159
- ├── 02_model_comparison/ # 5 ViT model comparison
160
- │ ├── dinov3_all_combinations_results.json
161
- │ ├── dinov3_bioclip_siglip_all_methods_results.json
162
- │ └── dinov3_comparison_results.json
163
-
164
- ├── 03_dimensionality_reduction/ # t-SNE, UMAP, PCA, Isomap, KPCA
165
- │ └── dimensionality_comparison.json
166
-
167
- ├── 04_clustering_supervised/ # K-variation experiments (K=15,30,45,90,180)
168
- │ ├── k30_metrics_by_class.json
169
- │ └── k_variation_by_dimred_class.json
170
-
171
- ├── 05_clustering_unsupervised/ # HDBSCAN vs DBSCAN
172
- │ └── unsupervised_metrics_by_class.json
173
-
174
- ├── 06_cluster_count_prediction/ # Progressive species testing (1,200 runs)
175
- │ ├── progressive_species_testing_results.json
176
- │ └── progressive_species_testing_results_expanded.json
177
-
178
- ├── 07_intra_species_variation/ # Age, sex, pelage detection
179
- │ ├── wolf_dbscan_clusters/
180
- │ └── intra_cluster/
181
-
182
- ├── 08_uneven_distribution/ # Long-tailed distribution tests
183
- │ ├── extreme_20_max_test/
184
- │ ├── original_config_extreme_uneven_test/
185
- │ └── even_distribution_results.json
186
-
187
- ├── 09_scaling_tests/ # 5-60 species scaling behavior
188
- │ ├── scaling_test_results/
189
- │ └── different_n_test/
190
-
191
- ├── 10_embeddings/ # Pre-computed embeddings
192
- │ ├── embeddings/ # Standard benchmarking embeddings
193
- │ ├── extreme_uneven_embeddings/
194
- │ └── extreme_uneven_image_lists/
195
-
196
- └── execution_logs/ # Complete execution logs
197
- ├── clustering_dimred_log.txt
198
- ├── clustering_complete_log.txt
199
- └── ...
200
  ```
201
 
202
- ## Key Results Summary
203
 
204
- Our benchmarking evaluated **27,600 configurations** across:
205
- - **5 ViT Models**: DINOv3, DINOv2, BioCLIP 2, CLIP, SigLIP
206
- - **5 Dimensionality Reduction**: t-SNE, UMAP, PCA, Isomap, Kernel PCA
207
- - **4 Clustering Algorithms**: Hierarchical, GMM, HDBSCAN, DBSCAN
208
- - **60 Species**: 30 mammals + 30 birds from camera trap imagery
209
 
210
- ### Top Performing Configuration
 
211
 
212
- | Component | Best Choice | V-Measure |
213
- |-----------|-------------|-----------|
214
- | Model | DINOv3 | 0.958 |
215
- | Dim. Reduction | t-SNE | +26-38pp vs others |
216
- | Clustering (supervised) | Hierarchical K=30 | 0.958 |
217
- | Clustering (unsupervised) | HDBSCAN | 0.943 |
218
 
219
- ## Usage
220
 
221
- ### Loading Results with Python
222
 
223
  ```python
224
- import pandas as pd
225
  import json
226
 
227
- # Load primary benchmarking results
228
- results = pd.read_csv("01_primary_benchmarking/clustering_analysis_complete.csv")
 
 
 
 
229
 
230
- # Filter for best model
231
- dinov3_results = results[results['model'] == 'dinov3']
232
 
233
- # Load JSON metrics
234
- with open("05_clustering_unsupervised/unsupervised_metrics_by_class.json") as f:
235
- unsupervised = json.load(f)
236
  ```
237
 
238
- ### Using Pre-computed Embeddings
239
 
240
- The `10_embeddings/` folder contains pre-computed embeddings that allow running clustering experiments **without needing the original images**:
241
 
242
  ```python
243
- import numpy as np
244
- import json
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
245
 
246
- # Load embeddings
247
- embeddings = np.load("10_embeddings/embeddings/dinov3_embeddings.npy")
248
 
249
- # Load corresponding image list
250
- with open("01_primary_benchmarking/images_run_1.json") as f:
251
- image_list = json.load(f)
252
- ```
253
 
254
- ### Reproducing Paper Tables
 
 
 
 
 
 
255
 
256
- Each folder corresponds to specific paper sections:
257
 
258
- | Paper Section | Data Folder |
259
- |--------------|-------------|
260
- | Table 3 (V-measure by model) | `01_primary_benchmarking/` |
261
- | Table 4 (Dim. reduction comparison) | `03_dimensionality_reduction/` |
262
- | Table 5 (Supervised K variation) | `04_clustering_supervised/` |
263
- | Table 6 (Unsupervised comparison) | `05_clustering_unsupervised/` |
264
- | Figure 5 (Cluster count prediction) | `06_cluster_count_prediction/` |
265
- | Table 7 (Intra-species traits) | `07_intra_species_variation/` |
266
- | Table 8 (Uneven distribution) | `08_uneven_distribution/` |
267
- | Figure 8 (Scaling behavior) | `09_scaling_tests/` |
268
 
269
- ## File Formats
270
 
271
- | Extension | Description | How to Load |
272
- |-----------|-------------|-------------|
273
- | `.csv` | Tabular results | `pandas.read_csv()` |
274
- | `.json` | Structured metrics | `json.load()` |
275
- | `.npy` | NumPy embeddings | `numpy.load()` |
276
- | `.txt`/`.log` | Execution logs | Plain text |
277
 
278
  ## Citation
279
 
280
- If you use this data, please cite both the paper and HUGO-Bench:
281
 
282
  ```bibtex
283
- @article{markoff2025vit_clustering,
284
  title={Vision Transformers for Zero-Shot Clustering of Animal Images: A Comparative Benchmarking Study},
285
- author={Markoff, Hugo and Bengtson, Stefan Hein and {\O}rsted, Michael},
286
- journal={TBD},
287
- year={2025}
288
- }
289
-
290
- @dataset{hugo_bench,
291
- title={HUGO-Bench: A Benchmark Dataset for Camera Trap Species Clustering},
292
- author={AI-EcoNet},
293
- year={2025},
294
- url={https://huggingface.co/datasets/AI-EcoNet/HUGO-Bench}
295
  }
296
  ```
297
 
298
  ## License
299
 
300
- This dataset is released under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/).
301
 
302
  ## Contact
303
 
304
- - **Hugo Markoff** - khbm@bio.aau.dk
305
- - Department of Chemistry and Bioscience, Aalborg University
306
-
307
- ## Related Resources
308
-
309
- - 📊 [HUGO-Bench Dataset](https://huggingface.co/datasets/AI-EcoNet/HUGO-Bench) - Source images (139,111 validated crops)
310
- - 💻 [GitHub Repository](https://github.com/HugoMarkoff/animal_visual_transformer) - Code and scripts
311
- - 🌐 [Interactive Visualization](https://hugomarkoff.github.io/animal_visual_transformer/) - Explore clustering results
 
28
  source_datasets:
29
  - AI-EcoNet/HUGO-Bench
30
  configs:
31
+ - config_name: primary_benchmarking
32
+ data_files: primary_benchmarking/train-*.parquet
33
+ default: true
34
+ - config_name: model_comparison
35
+ data_files: model_comparison/train-*.parquet
36
+ - config_name: dimensionality_reduction
37
+ data_files: dimensionality_reduction/train-*.parquet
38
  - config_name: clustering_supervised
39
+ data_files: clustering_supervised/train-*.parquet
 
 
40
  - config_name: clustering_unsupervised
41
+ data_files: clustering_unsupervised/train-*.parquet
42
+ - config_name: cluster_count_prediction
43
+ data_files: cluster_count_prediction/train-*.parquet
 
 
 
 
44
  - config_name: intra_species_variation
45
+ data_files: intra_species_variation/train-*.parquet
 
 
 
 
 
 
 
 
 
 
 
46
  - config_name: scaling_tests
47
+ data_files: scaling_tests/train-*.parquet
 
 
 
 
 
 
48
  - config_name: uneven_distribution
49
+ data_files: uneven_distribution/train-*.parquet
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50
  - config_name: subsample_definitions
51
+ data_files: subsample_definitions/train-*.parquet
52
+ - config_name: embeddings_dinov3_vith16plus
53
+ data_files: embeddings_dinov3_vith16plus/train-*.parquet
54
+ - config_name: embeddings_dinov2_vitg14
55
+ data_files: embeddings_dinov2_vitg14/train-*.parquet
56
+ - config_name: embeddings_bioclip2_vitl14
57
+ data_files: embeddings_bioclip2_vitl14/train-*.parquet
58
+ - config_name: embeddings_clip_vitl14
59
+ data_files: embeddings_clip_vitl14/train-*.parquet
60
+ - config_name: embeddings_siglip_vitb16
61
+ data_files: embeddings_siglip_vitb16/train-*.parquet
 
 
 
 
 
 
 
 
 
 
 
 
62
  ---
63
 
64
  # HUGO-Bench Paper Reproducibility
 
66
  **Supplementary data and reproducibility materials for the paper:**
67
 
68
  > **Vision Transformers for Zero-Shot Clustering of Animal Images: A Comparative Benchmarking Study**
69
+ >
70
  > Hugo Markoff, Stefan Hein Bengtson, Michael Ørsted
71
+ >
72
  > Aalborg University, Denmark
73
 
74
  ## Dataset Description
75
 
76
+ This repository contains complete experimental results, pre-computed embeddings, and execution logs from our comprehensive benchmarking study evaluating Vision Transformer models for zero-shot clustering of wildlife camera trap images.
77
 
78
+ ### Related Resources
79
 
80
+ - **Source Images**: [AI-EcoNet/HUGO-Bench](https://huggingface.co/datasets/AI-EcoNet/HUGO-Bench) - 139,111 wildlife images
81
+ - **Code Repository**: Coming soon
82
 
83
+ ## Repository Structure
 
 
84
 
85
+ ```
86
+ ├── primary_benchmarking/ # Main benchmark results (27,600 configurations)
87
+ ├── model_comparison/ # Cross-model comparisons
88
+ ├── dimensionality_reduction/ # UMAP/t-SNE/PCA analysis
89
+ ├── clustering_supervised/ # Supervised clustering metrics
90
+ ├── clustering_unsupervised/ # Unsupervised clustering results
91
+ ├── cluster_count_prediction/ # Optimal cluster count analysis
92
+ ├── intra_species_variation/ # Within-species cluster analysis
93
+ │ ├── train-*.parquet # Analysis results
94
+ │ └── cluster_image_mappings.json # Image-to-cluster assignments
95
+ ├── scaling_tests/ # Sample size scaling experiments
96
+ ├── uneven_distribution/ # Class imbalance experiments
97
+ ├── subsample_definitions/ # Reproducible subsample definitions
98
+ ├── embeddings_*/ # Pre-computed embeddings (5 models)
99
+ │ ├── embeddings_dinov3_vith16plus/ # 120K embeddings, 1280-dim
100
+ │ ├── embeddings_dinov2_vitg14/ # 120K embeddings, 1536-dim
101
+ │ ├── embeddings_bioclip2_vitl14/ # 120K embeddings, 768-dim
102
+ │ ├── embeddings_clip_vitl14/ # 120K embeddings, 768-dim
103
+ │ └── embeddings_siglip_vitb16/ # 120K embeddings, 768-dim
104
+ ├── extreme_uneven_embeddings/ # Full dataset embeddings (PKL)
105
+ │ ├── aves_full_dinov3_embeddings.pkl # 74,396 embeddings
106
+ │ └── mammalia_full_dinov3_embeddings.pkl # 65,484 embeddings
107
+ └── execution_logs/ # Experiment execution logs
108
+ ```
109
 
110
+ ## Quick Start
111
+
112
+ ### Load Primary Benchmark Results
113
+
114
+ ```python
115
+ from datasets import load_dataset
116
 
117
+ # Load main benchmark results (27,600 configurations)
118
+ ds = load_dataset("AI-EcoNet/HUGO-Bench-Paper-Reproducibility", "primary_benchmarking")
119
+ print(f"Configurations: {len(ds['train'])}")
120
  ```
121
+
122
+ ### Load Pre-computed Embeddings
123
+
124
+ ```python
125
+ # Load DINOv3 embeddings (120,000 images)
126
+ embeddings = load_dataset(
127
+ "AI-EcoNet/HUGO-Bench-Paper-Reproducibility",
128
+ "embeddings_dinov3_vith16plus"
129
+ )
130
+ print(f"Embeddings shape: {len(embeddings['train'])} x {len(embeddings['train'][0]['embedding'])}")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
131
  ```
132
 
133
+ ### Load Specific Analysis Results
134
 
135
+ ```python
136
+ # Model comparison results
137
+ model_comp = load_dataset("AI-EcoNet/HUGO-Bench-Paper-Reproducibility", "model_comparison")
 
 
138
 
139
+ # Scaling test results
140
+ scaling = load_dataset("AI-EcoNet/HUGO-Bench-Paper-Reproducibility", "scaling_tests")
141
 
142
+ # Intra-species variation analysis
143
+ intra = load_dataset("AI-EcoNet/HUGO-Bench-Paper-Reproducibility", "intra_species_variation")
144
+ ```
 
 
 
145
 
146
+ ### Load Cluster Image Mappings
147
 
148
+ The intra-species analysis includes a mapping file showing which images belong to which clusters:
149
 
150
  ```python
151
+ from huggingface_hub import hf_hub_download
152
  import json
153
 
154
+ # Download mapping file
155
+ mapping_file = hf_hub_download(
156
+ "AI-EcoNet/HUGO-Bench-Paper-Reproducibility",
157
+ "intra_species_variation/cluster_image_mappings.json",
158
+ repo_type="dataset"
159
+ )
160
 
161
+ with open(mapping_file) as f:
162
+ mappings = json.load(f)
163
 
164
+ # Structure: {species: {run: {cluster: [image_names]}}}
165
+ print(f"Species analyzed: {list(mappings.keys())}")
 
166
  ```
167
 
168
+ ### Load Full Dataset Embeddings
169
 
170
+ For the extreme uneven distribution experiments, we provide full dataset embeddings:
171
 
172
  ```python
173
+ from huggingface_hub import hf_hub_download
174
+ import pickle
175
+
176
+ # Download Aves embeddings (74,396 images)
177
+ pkl_file = hf_hub_download(
178
+ "AI-EcoNet/HUGO-Bench-Paper-Reproducibility",
179
+ "extreme_uneven_embeddings/aves_full_dinov3_embeddings.pkl",
180
+ repo_type="dataset"
181
+ )
182
+
183
+ with open(pkl_file, 'rb') as f:
184
+ data = pickle.load(f)
185
+
186
+ print(f"Embeddings: {data['embeddings'].shape}") # (74396, 1280)
187
+ print(f"Labels: {len(data['labels'])}")
188
+ print(f"Paths: {len(data['paths'])}")
189
+ ```
190
 
191
+ ## Experimental Setup
 
192
 
193
+ ### Models Evaluated
 
 
 
194
 
195
+ | Model | Architecture | Embedding Dim | Pre-training |
196
+ |-------|-------------|---------------|--------------|
197
+ | DINOv3 | ViT-H/16+ | 1280 | Self-supervised |
198
+ | DINOv2 | ViT-G/14 | 1536 | Self-supervised |
199
+ | BioCLIP 2 | ViT-L/14 | 768 | Biology domain |
200
+ | CLIP | ViT-L/14 | 768 | Contrastive |
201
+ | SigLIP | ViT-B/16 | 768 | Sigmoid loss |
202
 
203
+ ### Clustering Methods
204
 
205
+ - K-Means, DBSCAN, HDBSCAN, Agglomerative, Spectral
206
+ - GMM (Gaussian Mixture Models)
207
+ - With and without dimensionality reduction (UMAP, t-SNE, PCA)
 
 
 
 
 
 
 
208
 
209
+ ### Evaluation Metrics
210
 
211
+ - **Supervised**: Adjusted Rand Index (ARI), Normalized Mutual Information (NMI), Accuracy, F1
212
+ - **Unsupervised**: Silhouette Score, Calinski-Harabasz Index, Davies-Bouldin Index
 
 
 
 
213
 
214
  ## Citation
215
 
216
+ If you use this dataset, please cite:
217
 
218
  ```bibtex
219
+ @article{markoff2026vision,
220
  title={Vision Transformers for Zero-Shot Clustering of Animal Images: A Comparative Benchmarking Study},
221
+ author={Markoff, Hugo and Bengtson, Stefan Hein and Ørsted, Michael},
222
+ journal={[Journal/Conference]},
223
+ year={2026}
 
 
 
 
 
 
 
224
  }
225
  ```
226
 
227
  ## License
228
 
229
+ This dataset is released under the [CC-BY-4.0 License](https://creativecommons.org/licenses/by/4.0/).
230
 
231
  ## Contact
232
 
233
+ For questions or issues, please open an issue in this repository or contact the authors.