Anomaly Detection for Hybrid Butterfly Subspecies via Probability Filtering

Bo-Kai Ruan, Yi-Zeng Fang, Hong-Han Shuai, Juinn-Dar HuangarXiv 2025 · DOI

Abstract

Identifying hybrid subspecies in the wild is a complex task requiring significant taxonomic expertise. This paper presents a novel anomaly detection framework designed to identify hybrid butterflies by leveraging BioCLIP, a foundation model pre-trained on biological taxonomy. By conceptualizing hybridization as a "confusion" between parent subspecies and employing a custom Probability Filtering mechanism, the proposed model successfully identifies hybrids even in species not seen during training, provided they exhibit mimicry of the training set's visual patterns. The approach secured a top-tier ranking in the NSF-HDR Challenge, demonstrating robust generalization across mimicry species.

Introduction

In evolutionary biology, geographic isolation often leads to the divergence of butterfly subspecies, resulting in distinct wing patterns. However, in regions where these populations overlap, interbreeding occurs, producing hybrids with intermediate visual traits. Accurately identifying these hybrids is labor-intensive and requires deep domain knowledge.

The challenge addressed in this work is twofold: first, differentiating between "pure" subspecies and hybrids within a single species; and second, ensuring the model generalizes to mimic species. For instance, can a model trained on Species A generalize to Species B, which has evolved to mimic Species A as a defensive strategy? This research, developed for the NSF-HDR Challenge, focuses on an algorithm that understands the underlying visual relationships signaling hybridization rather than merely memorizing specific species.

Methodology

The framework is built upon three primary components: a specialized biological backbone, a novel classification strategy, and an anomaly scoring mechanism.

BioCLIP Backbone

Unlike general-purpose vision models trained on ImageNet, this approach utilizes BioCLIP, a foundation model pre-trained on the "Tree of Life." This ensures the model's feature space is inherently organized according to biological taxonomy. The backbone is fine-tuned with a low learning rate ($3 \times 10^{-6}$) to adapt to specific wing patterns while preserving its foundational biological knowledge.

Probability Filtering

The core innovation is the Probability Filtering mechanism. Instead of a standard binary classifier, the authors employ a three-layer classifier trained to recognize specific subspecies with a unique target distribution:

  • Non-hybrids: The target is a 1.0 probability for the specific subspecies.
  • Hybrids: The target is a 0.5/0.5 split between the two parent subspecies.
The proposed architecture utilizing BioCLIP and the Probability Filtering mechanism for hybrid detection.

Anomaly Scoring and Data Augmentation

During inference, an anomaly score is calculated based on a threshold $t$ (set to 0.75). If the model's confidence in a single subspecies exceeds $t$, the anomaly score is low ($1 - p$). If the model is uncertain ($p \leq t$), the anomaly score is the sum of the two highest probabilities, effectively flagging "confused" predictions as hybrids. To improve robustness, the authors used color jittering to simulate mimicry variations and weighted sampling to handle the class imbalance between hybrids (91 images) and non-hybrids (2,001 images).

Results

The proposed method was evaluated on datasets provided by Imageomics for the NSF HDR Challenge, including a private evaluation set containing an unseen mimic species (Species B).

The model achieved an Area Under the Curve (AUC) of 0.99 for both hybrid and non-hybrid detection in Species A. Crucially, it demonstrated strong zero-shot generalization to Species B, achieving an AUC of 0.81 for hybrid detection without having seen the species during training. This confirms that biological mimicry can be exploited to transfer learned hybridization "rules" across species.

Performance comparison of the proposed method against other participants in the NSF-HDR Challenge.

Ablation studies further validated the approach. Removing the probability filtering strategy or color jittering led to significant performance drops, with scores falling from 0.44 to as low as 0.26, highlighting the importance of the custom classification head.

Discussion and Conclusion

The success of this framework highlights that domain-specific foundation models like BioCLIP provide a superior starting point for specialized scientific tasks compared to general-purpose models like DINOv2. Furthermore, leveraging "model confusion" as a feature rather than a flaw allows for a more nuanced detection of intermediate biological states.

Future work could address current limitations, such as the assumption of a fixed number of parent subspecies and the sensitivity to the anomaly threshold $t$. Integrating geographic or environmental metadata could also help distinguish between visually identical mimics and true hybrids in more complex ecological scenarios.

Summary updated

BibTeX
@misc{ruan2025anomaly,
  author = {Bo-Kai Ruan and Yi-Zeng Fang and Hong-Han Shuai and Juinn-Dar Huang},
  title = {{Anomaly Detection for Hybrid Butterfly Subspecies via Probability Filtering}},
  year = {2025},
  eprint = {2504.01671},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2504.01671},
}
Figure