AgriCLIP: Adapting CLIP for Agriculture and Livestock via Domain-Specialized Cross-Model Alignment

Umair Nawaz, Muhammad Awais, Hanan Gani, Muzammal Naseer, Fahad Shahbaz Khan, Salman Khan, Rao Muhammad Anwer

Abstract

Capitalizing on 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 domain shift. Further, this domain requires fine-grained feature learning to identify subtle visual cues, such as nutrient deficiencies or specific livestock breeds. We present AgriCLIP, a vision-language foundational model dedicated to agriculture and livestock. We introduce the ALive dataset, containing 600,000 image-text pairs generated via a customized GPT-4 prompting strategy to overcome expert annotation scarcity. Our training pipeline integrates contrastive and self-supervised learning to capture both global semantic and local fine-grained features. Experiments across 20 downstream tasks show that AgriCLIP achieves a 48.27% average zero-shot accuracy, a significant 7.8% absolute gain over standard CLIP adaptation.

The Challenge of Agricultural Domain Shift

While general-purpose vision-language models like CLIP have revolutionized zero-shot image classification, they often struggle in specialized sectors. In agriculture, the visual differences between a healthy leaf and one with a specific nutrient deficiency can be minute. A model trained on generic internet data lacks the specialized "vocabulary" and visual sensitivity required for these tasks.

The researchers identify two primary hurdles:

  1. Data Scarcity: Agriculture lacks the massive, descriptive image-text datasets found in fields like healthcare. Most existing agricultural data consists of narrow classification sets with simple labels rather than rich descriptions.
  2. Fine-Grained Requirements: Agricultural tasks often depend on spotting local nuances—such as the specific shape of a lesion—which global contrastive learning often overlooks.

The AgriCLIP Framework

To address these challenges, AgriCLIP employs a multi-stage training pipeline that bridges the gap between general semantics and domain-specific details.

Overview of the AgriCLIP architecture and training pipeline.

Methodology

  • Customized Prompt Generation: To enrich the dataset, the authors used GPT-4 to transform simple class labels into descriptive prompts. For example, "a photo of a citrus leaf with [cls] disease" becomes a detailed description: "a photo of a citrus leaf with [cls] disease, showing brown lesions and yellow halos."
  • Semantic Feature Learning: A standard CLIP model is further pre-trained on the ALive dataset to capture global domain-specific semantics.
  • Fine-grained Feature Learning: A separate vision encoder is trained using DINO (a self-supervised method) to learn local, detailed visual features without relying on text labels.
  • Cross-Model Alignment: A "Linear Aligner" maps the high-detail features from the DINO encoder into the CLIP text-embedding space, allowing the model to leverage fine-grained visual knowledge during zero-shot inference.

The ALive Dataset

The ALive (Agriculture and Livestock) dataset is a cornerstone of this work, featuring approximately 600,000 image-text pairs. It was curated from 25 existing datasets covering crops, livestock, and fisheries. For ablation studies, an expanded version called ALive++ reached nearly 900,000 images by incorporating segmentation and detection data. Evaluation was conducted on 20 disjoint datasets to ensure the model's ability to generalize to unseen agricultural scenarios.

Performance and Evaluation

AgriCLIP demonstrates substantial improvements over both the base CLIP model and standard domain-specific fine-tuning.

Zero-shot classification results across 20 downstream tasks.

As shown in the results, AgriCLIP achieved an average zero-shot accuracy of 48.27% across 20 tasks, compared to just 25.83% for the original CLIP. Notably, on the "Supermarket Fish" dataset, accuracy soared from 1.66% to 41.38%. Even compared to a CLIP model pre-trained on the same ALive data (39.20%), AgriCLIP’s hybrid alignment strategy provided a nearly 9% absolute boost, proving that capturing local features is essential for this domain.

Conclusion

AgriCLIP demonstrates that we do not necessarily need to build foundational models from scratch for every niche domain. Instead, by combining domain-specific data augmentation (via LLMs) with a hybrid training pipeline that aligns global semantics with local fine-grained details, we can effectively adapt existing vision-language models for highly specialized tasks. Future work will explore expanding AgriCLIP to dense prediction tasks like object detection and semantic segmentation.

Summary updated

BibTeX
@inproceedings{nawaz2025agriclip,
  author = {Umair Nawaz and Muhammad Awais and Hanan Gani and Muzammal Naseer and Fahad Shahbaz Khan and Salman Khan and Rao Muhammad Anwer},
  title = {{AgriCLIP: Adapting CLIP for Agriculture and Livestock via Domain-Specialized Cross-Model Alignment}},
  booktitle = {International Conference on Computational Linguistics},
  year = {2025},
  url = {https://openreview.net/forum?id=6XKxitV5Ak},
}
Figure