aux_targets
birdnet_stm32.data.aux_targets
¶
Where and when each training recording was made, as targets for a training-only auxiliary head.
The head (birdnet_stm32.training.embedding_distillation) predicts, from the pooled embedding, the
recording's location as a unit vector on the sphere (x, y, z) and its day of year as (sin, cos). Learning
these pushes the embedding to encode the species composition of a place and season, which a single-label
classification loss does not ask for.
The table lives in a folder of memory-mapped arrays, so every loader worker shares one copy:
keys.npy uint64, sorted: an 8-byte BLAKE2b hash of each sample id (the audio file's stem)
targets.npy float16 [N, 5]: x, y, z, sin(day), cos(day)
valid.npy uint8 [N, 2]: location known, date known
meta.json counts and the build inputs
Build it from a dataset manifest (sample_id, latitude, longitude, event_date, source)
with python -m birdnet_stm32.data.aux_targets <manifest.csv> <out_dir> [--site_coords sites.json];
sites.json maps a source to [lat, lon] for collections recorded at one known site whose rows
carry no coordinates (e.g. a soundscape set).
AuxTargets
¶
Memory-mapped lookup of a recording's auxiliary targets by sample id.
Source code in birdnet_stm32/data/aux_targets.py
lookup(sample_id)
¶
(targets float32 [5], valid float32 [2]); zeros when the recording is not in the table.
Source code in birdnet_stm32/data/aux_targets.py
geo_unit(lat, lon)
¶
[N, 3] unit vectors for latitude / longitude in degrees.
Source code in birdnet_stm32/data/aux_targets.py
day_angle(day_of_year)
¶
[N, 2] (sin, cos) of the day of year on a 365.25-day circle.