Views
No views yet
nn.Identity()TemporalSpatialEncoder projects species tensor to backbone token spaceTemporalSpatialDecoder reconstructs species predictions| Metric | Finetuned | Paper Reference |
|---|---|---|
| F1 (Eq.20) | 0.8950 | 0.9964 |
| Mean Species MAE (norm) | 0.0216 | 0.0836 |
1import torch
2from bfm_model.bfm.model import BFM
3from bfm_finetune.bfm_mod import BFMRaw
4
5# 1. Build base model
6base_model = BFM(
7 embed_dim=512, depth=10, patch_size=8,
8 swin_backbone_size="large", perceiver_latents=16100,
9 # ... (see finetune_large_geolifeclef.py for full config)
10)
11
12# 2. Load pretrained weights
13from safetensors.torch import load_file
14state = load_file("bfm-pretrain-large.safetensors", device="cpu")
15base_model.load_state_dict(state, strict=False)
16
17# 3. Wrap with BFMRaw and load finetuned weights
18model = BFMRaw(base_model=base_model, n_species=500, mode="eval")
19ckpt = torch.load("best_checkpoint.pth", map_location="cpu")
20model.load_state_dict(ckpt["model_state_dict"], strict=False)
21model.eval()best_checkpoint.pth - Finetuned model checkpoint (epoch 100)bfm_finetuned_eval_large_results.json - Full evaluation resultsfinetune_large_geolifeclef.py - Finetuning scripteval_finetuned_large.py - Evaluation script1@article{foerster2025bfm,
2 title={A Foundation Model for Forecasting Biodiversity Dynamics},
3 author={Foerster et al.},
4 journal={arXiv preprint arXiv:2507.09080v2},
5 year={2025}
6}