🚀 植物葉片病害細粒度視覺分類
本項目基於多模態基礎模型,針對植物葉片病害檢測與解釋進行了優化,能夠精準識別病害並給出可驗證的症狀描述,為植物健康監測提供有力支持。
🚀 快速開始
本模型是基於 [LLaVA - 1.5 - 7B - hf](https://huggingface.co/llava - hf/llava - 1.5 - 7b - hf) 微調的多模態基礎模型,使用植物病害數據集進行優化,用於檢測和解釋植物葉片病害。
項目頁面:SelfSynthX。
arXiv 論文:Enhancing Cognition and Explainability of Multimodal Foundation Models with Self - Synthesized Data
✨ 主要特性
屬性 |
詳情 |
基礎模型 |
LLaVA - 1.5 - 7B |
訓練數據 |
多種植物物種的健康和患病葉片 |
創新點 |
1. 自合成數據:使用信息瓶頸原理提取和描述特定病害的視覺症狀。 2. 迭代微調:使用無獎勵模型的拒絕採樣來提高分類準確性和解釋質量。 |
預期用途 |
識別植物葉片病害並提供可由人類驗證的症狀描述 |
💻 使用示例
基礎用法
import requests
from PIL import Image
import torch
from transformers import AutoProcessor, LlavaForConditionalGeneration
model_id = "YuchengShi/LLaVA-v1.5-7B-Plant-Leaf-Diseases-Detection"
model = LlavaForConditionalGeneration.from_pretrained(
model_id,
torch_dtype=torch.float16,
low_cpu_mem_usage=True,
).to("cuda")
processor = AutoProcessor.from_pretrained(model_id)
conversation = [
{
"role": "user",
"content": [
{"type": "text", "text": "What disease does this leaf have?"},
{"type": "image"},
],
},
]
prompt = processor.apply_chat_template(conversation, add_generation_prompt=True)
image_file = "plant-disease/test1.png"
raw_image = Image.open(requests.get(image_file, stream=True).raw)
inputs = processor(images=raw_image, text=prompt, return_tensors='pt').to("cuda", torch.float16)
output = model.generate(**inputs, max_new_tokens=200, do_sample=False)
print(processor.decode(output[0][2:], skip_special_tokens=True))
🔧 技術細節
- 訓練:使用 LoRA 在 PlantVillage 上進行微調,並採用迭代拒絕採樣。
- 評估:與基線模型相比,該模型表現出更高的準確性,並且能夠提供可靠且可解釋的解釋。
📄 許可證
文檔中未提及許可證相關信息。
📚 引用
如果您使用此模型,請引用:
@inproceedings{
shi2025enhancing,
title={Enhancing Cognition and Explainability of Multimodal Foundation Models with Self-Synthesized Data},
author={Yucheng Shi and Quanzheng Li and Jin Sun and Xiang Li and Ninghao Liu},
booktitle={The Thirteenth International Conference on Learning Representations},
year={2025},
url={https://openreview.net/forum?id=lHbLpwbEyt}
}