Abstract
Capitalizing on a vast amount of image-text data, large-scale vision-language pre-training has demonstrated remarkable zero-shot capabilities. However, models trained on general web-crawled data often exhibit sub-optimal performance for specialized domains like agriculture due to significant domain shift. Furthermore, agricultural tasks often require fine-grained feature learning to distinguish subtle visual cues, such as nutrient deficiencies or specific livestock breeds. To address these challenges, we present AgriCLIP, a vision-language foundational model dedicated to the agriculture and livestock domains. We introduce the ALive dataset, containing approximately 600,000 image-text pairs across crops, livestock, and fisheries, generated via a customized GPT-4 prompting strategy. Our training pipeline integrates contrastive and self-supervised learning to capture both global semantics and local fine-grained features. Experiments across 20 downstream tasks demonstrate that AgriCLIP achieves a 9.07% absolute gain in zero-shot classification accuracy over standard CLIP adaptation.
Introduction
General-purpose vision-language models (VLMs) like CLIP have revolutionized zero-shot classification for everyday objects. However, their performance often plummets when applied to specialized domains. Adapting these models for agriculture and livestock faces two major hurdles. First, there is a severe data scarcity; unlike the general web, agriculture lacks massive, naturally occurring image-text datasets. Most existing datasets are image-only with simple class labels. Second, there is a critical need for fine-grained features. Agricultural tasks often require identifying incredibly subtle visual differences—such as the specific color of a halo around a leaf lesion or the texture of a rusty patch. Standard contrastive learning, which focuses on global semantic alignment, often fails to capture these minute, localized details.
Methodology
To solve the data and feature-granularity problems, AgriCLIP utilizes a novel dataset creation strategy and a three-stage training pipeline designed to bridge the gap between high-level semantics and low-level visual details.
1. Customized Prompt Generation
The authors leveraged 25 existing image-only agricultural datasets and used GPT-4 to synthesize rich, descriptive text pairs based on image metadata and class labels. Instead of a generic "a photo of [class]," the prompts become contextually aware (e.g., "a photo of a leaf with boron deficiency characterized by yellow patches and curled edges").
2. Multi-Stage Feature Learning
- Semantic Feature Learning: The model first fine-tunes standard CLIP encoders on the new ALive dataset using standard contrastive loss. This aligns global domain-specific images with the newly generated text descriptions.
- Fine-Grained Feature Learning: To capture subtle visual details, a separate vision encoder is trained using DINO (a self-supervised, student-teacher framework). DINO excels at learning detailed, localized visual features without requiring explicit labels.
3. Cross-Model Alignment
A fine-grained vision encoder is only useful for zero-shot tasks if it is aligned with language. AgriCLIP applies a learnable linear aligner to map the output of the DINO vision encoder into the embedding space of the CLIP vision encoder. This implicitly aligns fine-grained visual features with CLIP's text encoder, unlocking enhanced zero-shot capabilities.
The ALive Dataset
The ALive (Agriculture and Livestock) dataset is a newly introduced pre-training resource containing approximately 600,000 image-text pairs. It is aggregated from 25 existing classification datasets covering crops, livestock, and fisheries across diverse environments, including drone, underwater, and indoor settings.
To test the impact of scaling, the authors also developed ALive++, an expanded version with roughly 900,000 images. For evaluation, 20 diverse downstream datasets containing ~300,000 images were used. Crucially, these evaluation sets are entirely disjoint from the ALive pre-training set to rigorously test out-of-distribution zero-shot generalization.
Key Results and Insights
AgriCLIP demonstrates the power of combining contrastive learning with self-supervised visual pre-training. Key findings include:
- Massive Zero-Shot Gains: AgriCLIP achieved an average zero-shot classification accuracy of 48.27% across 20 downstream datasets, representing a 22.44% absolute improvement over standard off-the-shelf CLIP (25.83%).
- Pipeline Validation: AgriCLIP showed a 9.07% absolute gain over a baseline CLIP model that was simply fine-tuned on the ALive dataset (39.20%). This confirms that the DINO-based fine-grained alignment stage is essential for domain performance.
- LLMs as Data Annotators: Using GPT-4 to synthesize rich captions from basic metadata is a highly effective way to bootstrap vision-language datasets in domains where expert text annotations are scarce.
- DINO Superiority: Ablation studies found that DINO vastly outperformed Masked Autoencoders (MAE) for learning the fine-grained features necessary for agricultural tasks (42.04% vs 22.11% average accuracy on a subset of tasks).
Conclusion
AgriCLIP successfully adapts vision-language models to the specialized needs of the agricultural sector. By combining LLM-driven data augmentation with a dual-stream learning architecture, it overcomes the limitations of general-purpose models. While current evaluation is limited to classification, future work will expand AgriCLIP to handle dense prediction tasks like pest detection, crop yield prediction, and plant disease segmentation, which are vital for real-world precision agriculture.
Summary updated