Downloads · 30 days
0
AnhadMahajan/AgriVision-BLIP2
AgriVision-BLIP2 is a image-to-text model from AnhadMahajan. Use it when you need a caption or text from an image. It is set up for transformers. The card lists the license as apache-2.0.
[](https://huggingface.co/spaces/AnhadMahajan/AgriVision-App)
Downloads · 30 days
0
Access
Public
Updated Jun 10, 2026
Repo size
63.2 MB
Likes
1
Public
Click a slice to open those files.
.safetensors62.9 MB · 94%
From the Hugging Face model README
AgriVision BLIP2 is a fine-tuned multimodal Vision-Language Model developed for intelligent crop disease diagnosis from plant leaf images.
Built on top of Salesforce BLIP2 OPT 2.7B and adapted using LoRA (Low-Rank Adaptation), the model generates structured agricultural diagnosis reports containing disease identification, symptom interpretation, pathogen categorization, and agronomic recommendations.
Unlike traditional image classification models that only predict disease labels, AgriVision BLIP2 is designed to provide explainable and human-readable diagnostic outputs.
The primary objective of this project is to transform a general-purpose Vision-Language Model into a domain-specialized agricultural assistant capable of understanding crop diseases and generating structured diagnostic reports.
The model performs multimodal reasoning by jointly analyzing visual leaf patterns and generating natural language agricultural explanations.
The model can generate:
Example output:
This is a diseased Maize leaf. Disease identified: Northern Leaf Blight. Visible symptoms include canoe-shaped lesions with gray-green margins that turn tan with dark fungal sporulation, starting on lower leaves and spreading upwards. Pathogen category: Fungal.
| Attribute | Value |
|---|---|
| Model Name | AgriVision BLIP2 |
| Base Model | Salesforce/blip2-opt-2.7b |
| Architecture | Vision-Language Model (VLM) |
| Fine-Tuning Method | LoRA |
| Framework | Transformers + PEFT + PyTorch |
| Domain | Agricultural Disease Diagnosis |
| Language | English |
| License | Apache 2.0 |
This model was fine-tuned using the LeafNet dataset.
Dataset:
https://huggingface.co/datasets/enalis/LeafNet
The dataset contains:
Training samples were converted into multiple instruction-style agricultural reasoning tasks.
The model was adapted using:
This approach enabled efficient domain adaptation while preserving the general multimodal capabilities of BLIP2.
The model was trained on multiple agricultural reasoning tasks:
Example:
Input: Plant leaf image
Output:
This is a Potato leaf affected by Early blight.
Example:
Input: Plant leaf image
Output:
Small, dark, papery flecks growing into brown-black circular lesions.
Example:
Input: Plant leaf image
Output:
This plant shows a Fungal condition.
Example:
Input: Plant leaf image
Output:
This is a diseased Coffee leaf. Disease identified: Phoma. Visible symptoms include dark-colored zoned patches starting at the edges with small black pycnidia on the lesions. Pathogen category: Fungal.
The model is intended for:
Potential downstream use cases include:
Users should be aware of the following limitations:
from PIL import Image
from transformers import Blip2Processor, Blip2ForConditionalGeneration
processor = Blip2Processor.from_pretrained("YOUR_USERNAME/AgriVision-BLIP2")
model = Blip2ForConditionalGeneration.from_pretrained("YOUR_USERNAME/AgriVision-BLIP2")
image = Image.open("leaf.jpg")
inputs = processor(
images=image,
text="Analyze this crop leaf comprehensively.",
return_tensors="pt"
)
outputs = model.generate(
**inputs,
max_new_tokens=80
)
print(
processor.tokenizer.decode(
outputs[0],
skip_special_tokens=True
)
)
Planned improvements include:
The complete AgriVision ecosystem includes:
This work builds upon:
Anhad Mahajan
Computer Science Engineering (Artificial Intelligence)
Interests:
GitHub: https://github.com/AnhadMahajan
LinkedIn: https://www.linkedin.com/in/anhadmahajan/
If you use this model in research or applications, please cite:
@misc{mahajan2026agrivision,
title={AgriVision BLIP2: Intelligent Crop Disease Diagnosis using Vision-Language Models},
author={Anhad Mahajan},
year={2026},
publisher={Hugging Face}
}