TL;DR
Training multi-species neural networks on community-science data is tricky because observers rarely record where species are absent, and sampling is heavily geographically biased. This paper introduces a flexible, weighted loss function that balances random and target-group pseudo-absences while correcting for severe species class imbalance. Evaluated on an independent presence-absence benchmark across six regions, this approach lets a single neural network match the performance of hundreds of specialized, single-species models.
What Problem Does This Paper Address?
Species Distribution Models (SDMs) map where species live based on environmental factors like climate and soil characteristics. While community-science platforms (e.g., iNaturalist, eBird) have accumulated hundreds of millions of wildlife records, this data presents three major machine learning challenges:
- Presence-Only (PO) Data: Observers log when they see a species, but almost never report verified absences. Neural networks require negative examples to avoid predicting that a species is present everywhere.
- Sampling Bias: People record sightings near roads, towns, and scenic spots. "Target-group background points" (locations where other species were observed) help control for this observer bias, while "random background points" ensure the entire geographic territory is sampled. Deciding how to mix these two types of pseudo-absences has historically lacked a principled framework for neural networks.
- Severe Class Imbalance: Sighting frequencies follow a steep long-tailed distribution—a handful of common species dominate the dataset, while hundreds of rare species have few records.
Methods
The authors build on the "full assume negative" loss of Cole et al. (2023) and introduce the full weighted loss function:
$$\mathcal{L}_{\text{full-weighted}}(\mathbf{y}, \hat{\mathbf{y}}) = -\frac{1}{S} \sum_{s=1}^S \left[ \mathbf{1}_{[y_s=1]} \lambda_1 w_s \log(\hat{y}_s) + \mathbf{1}_{[y_s=0]} \frac{\lambda_2}{1 - \frac{1}{w_s}} \log(1 - \hat{y}_s) + (1 - \lambda_2) \log(1 - \hat{y}'_s) \right]$$
Key algorithmic elements include:
- Species Weighting ($w_s$): Uses inverse sighting frequency ($w_s = 1 / \text{freq}(s)$) to equalize the loss contribution of rare and common species for both presence terms and target-group pseudo-absences.
- Pseudo-Absence Blending ($\lambda_2 \in [0, 1]$): Controls the balance between target-group background points ($\lambda_2$) and uniform random background points ($1 - \lambda_2$).
- Presence Weight ($\lambda_1$): Regulates the importance of positive observations relative to pseudo-absences (experiments show $\lambda_1 = 1$ is sufficient once $w_s$ is applied).
- Hyperparameter Selection via Spatial Block Cross-Validation: To tune $\lambda_2$ without data leakage from spatially autocorrelated samples, the authors partition training areas into $5 \times 5$ geospatial blocks across 5 folds, selecting the parameter configuration that maximizes validation AUC on target-group pseudo-absences.
- Model Architecture: A 4-layer Multi-Layer Perceptron (MLP) with 512 units per layer, residual connections, batch normalization, ReLU activations, and a final sigmoid output trained via AdamW.
Datasets
The authors evaluated their framework on the standard SDM benchmark from Elith et al. (2020):
- Regions: Six distinct geographic areas spanning varied spatial scales and biomes: Australian Wet Tropics (AWT), Canada (CAN), New South Wales (NSW), New Zealand (NZ), South America (SA), and Switzerland (SWI).
- Species & Features: Occurrence data for 226 anonymized species paired with 10 to 13 bioclimatic and pedological covariates per region.
- Evaluation Benchmark: While training strictly used opportunistically collected presence-only data, the test sets consisted of gold-standard, systematically surveyed presence-absence (PA) field data.
Key Insights and Ideas
- Equalizing species frequency fixes the need to artificially boost presence weight: Prior methods adjusted global coefficients ($\lambda$) or downsampled common species to tackle imbalance. Explicitly weighting by inverse frequency ($w_s$) provides dramatic performance gains for rare species without degrading performance on common species.
- Target-group vs. random background points is not either/or: Target-group points cancel out human observer bias (e.g., roadside bias), but can blind the model in under-sampled wilderness areas. Combining them (typically around $\lambda_2 = 0.8$) strikes the best balance.
- The optimal pseudo-absence mix reflects regional and ecological bias:
- Regions with strong sampling bias (such as Canada and Switzerland) benefited significantly from higher target-group weighting ($\lambda_2 \to 1.0$).
- Broadly distributed generalist species gained substantially from target-group points, whereas narrow habitat specialists suffered when compared against species with similar distribution patterns.
- Spatial validation reliably mirrors independent presence-absence testing: Spatial block cross-validation on presence-only data successfully identified optimal $\lambda_2$ values that transferred directly to performance gains on the independent presence-absence ground truth.
Key Results
- Outperforming Prior Multi-Species Losses: Across the six regions, the proposed weighted loss achieved a mean AUC of 0.755 (with cross-validated $\lambda_2$), outperforming the standard unweighted full loss (0.748), target-group-only loss (0.752), and random-only loss (0.706).
- Substantial Regional Gains: In heavily biased regions like Canada, fine-tuning $\lambda_2$ boosted AUC from 0.673 (full loss) and 0.542 (random-only) to 0.714.
- Alternative Metrics: Consistent improvements were observed in Area Under the Precision-Recall Gain Curve (AUPRG: 0.360 vs. 0.337) and Pearson correlation (0.240 vs. 0.232).
- Competitive with Single-Species Ensembles: A single multi-species neural network per region performed comparably to 226 individually tuned single-species models like Maxent (mean AUC 0.760) and Boosted Regression Trees (0.757), drastically simplifying model management and deployment.
Limitations and Future Work
- Tabular Data Plateau: Deep learning models achieved performance on par with—but did not decisively outperform—traditional tree-based models (BRT) and Maxent on purely tabular environmental data. The authors note that neural networks will likely provide clearer advantages when incorporating multimodal rasters, satellite imagery, and temporal data (e.g., GeoLifeCLEF).
- Global vs. Species-Specific $\lambda_2$: Although $\lambda_2$ was tuned per region, the optimal pseudo-absence ratio varies widely between ecological generalists and specialists within the same region. Developing per-species dynamic weighting represents a key next step.
- Fixed Neighborhoods: The method currently handles individual coordinate records without aggregating geographically proximate presences, which could be integrated with spatial clustering techniques in future iterations.
Summary updated