TL;DR
Standard contrastive learning models like CLIP struggle with hierarchical taxonomies because they treat all non-matching labels as equal negatives, leading to logically inconsistent predictions (e.g., classifying an animal into the correct species but the wrong family). This paper introduces level-restricted contrastive learning, which constrains text-image comparisons to the same taxonomic level and applies a group-balanced loss. The resulting model dramatically improves both classification accuracy and hierarchical consistency across multiple challenging biodiversity benchmarks.
What Problem Does This Paper Address?
Multimodal contrastive learning (like CLIP or BioCLIP) has revolutionized zero-shot visual classification by mapping images and text captions into a shared embedding space. However, these models rely on a flat-label assumption: during training, any text label that doesn't exactly match the image is treated as an equal negative sample.
When applied to hierarchical structures—such as biological taxonomies (Kingdom $\rightarrow$ Phylum $\rightarrow$ Class $\rightarrow$ Order $\rightarrow$ Family $\rightarrow$ Genus $\rightarrow$ Species)—this assumption breaks down. For example, a lion (Panthera leo) and a wolf (Canis lupus) are entirely distinct species, but they share a common ancestor at the Order level (Carnivora). Standard contrastive learning forces the model to treat the "wolf" label as a strict negative for a lion image, creating conflicting supervision signals across different taxonomic ranks.
As a result, deployed models frequently exhibit hierarchical inconsistency: they might correctly identify a highly specific species but simultaneously predict a completely contradictory parent genus or family, leading to severe ambiguity in real-world applications.
Methods
To eliminate cross-level false negatives, the authors propose a simple yet elegant training framework that decomposes hierarchical training into independent, level-wise comparisons:
- Level-Restricted Contrastive Loss: Instead of evaluating all text labels globally, the taxonomy is split into $L$ distinct levels. The contrastive loss is calculated independently for each level. This means species-level text prompts are only compared against other species-level prompts, family against family, and so on.
- Group-Balanced Supervision: Within a standard mini-batch, multiple distinct species might share a coarse-level label (e.g., a fox and a wolf are both in the Canidae family). To prevent the model from treating the same family label as both a positive and a negative target, the authors aggregate identical labels within a mini-batch. All image-text pairs sharing that label are treated as positives.
The total training objective assigns equal weight to each taxonomic level's loss, preventing high-confidence, coarse-grained signals (like distinguishing a plant from an animal) from dominating the optimization of fine-grained features.
The authors implement this recipe using both standard Euclidean space and Hyperbolic space (specifically the Lorentz/hyperboloid model), which possesses an exponential volume growth that naturally mirrors tree-like hierarchical structures.
Datasets
The authors fine-tuned BioCLIP (built on a ViT-B/16 architecture) using the TreeOfLife-10M dataset. They evaluated their approach across three distinct hierarchical benchmarks:
- iNaturalist 2021 (iNat21): A massive dataset providing broad taxonomic coverage across 7 levels.
- Rare Species: A benchmark specifically focusing on rare and long-tailed species absent from the TreeOfLife-10M training set to evaluate zero-shot generalization.
- CrypticBio: A dataset intentionally curated to emphasize visually ambiguous, highly confusing species.
Key Insights and Ideas
- Fixing the Loss, Not the Architecture: Rather than inventing complex new neural network architectures or adding heavy geometric penalties to force hierarchical compliance, simply restructuring the contrastive loss allows clean hierarchical relationships to emerge naturally in the embedding space.
- Visualizing the Hierarchy: As shown via t-SNE visualizations, restricting contrastive comparisons prevents cross-level mixing. Embeddings from nearby taxonomic levels form highly coherent, structured clusters with clear separations between sibling categories compared to standard BioCLIP.
- Space Complementarity: The authors observed a fascinating split between embedding geometries. Euclidean space performs slightly better on broad, well-represented datasets (iNat21), while Hyperbolic space excels at deeper taxonomic levels and on rare or visually ambiguous datasets due to its superior capacity for representing strict tree structures.
Key Results
- Massive Accuracy Gains: On the iNat21 benchmark, the proposed method achieved an average top-1 accuracy across all levels of 78.96% (Euclidean), a massive 30.47% absolute improvement over the baseline BioCLIP model (48.49%).
- Superior Hierarchical Consistency: The authors evaluated the models using a strict top-down constrained inference protocol (where an error at a higher level restricts candidate labels and penalizes all subsequent lower-level predictions). Under this setting, the Hyperbolic variant achieved a normalized Lowest Common Ancestor (nLCA) score of 0.71, vastly outperforming the state-of-the-art RCME method (0.43) and baseline BioCLIP (0.32).
- Robustness to the Long-Tail: On the RareSpecies and CrypticBio datasets, the level-restricted models consistently outperformed all baselines, proving that group-balanced, level-restricted supervision preserves fine-grained discrimination even when data is scarce or visually ambiguous.
Limitations and Future Work
- Top-Down Error Cascades: Although the model significantly mitigates errors, under strict top-down inference, a mistake at a very coarse level (e.g., misclassifying Phylum) still completely derails fine-grained species predictions.
- Fixed Hyperbolic Curvature: The hyperbolic experiments utilized a fixed curvature ($c=1$). Dynamically learning or tuning the curvature parameter for specific taxonomic depths could yield further performance gains.
- Domain Scope: The method was exclusively validated on biological/biodiversity data. Its efficacy on non-biological hierarchies (such as e-commerce product catalogs or general scene graphs) remains an open question for future research.
Summary updated