🚀 植物葉病害の細粒度な視覚分類
このプロジェクトは、植物葉の病害を検出し説明するために最適化されたマルチモーダル基礎モデルに関するものです。Self-Synthesized Dataを用いて、植物葉病害の認識と説明能力を向上させます。
プロジェクトページ: SelfSynthX
arXivの論文: Enhancing Cognition and Explainability of Multimodal Foundation Models with Self-Synthesized Data
このモデルは、[LLaVA - 1.5 - 7B - hf](https://huggingface.co/llava - hf/llava - 1.5 - 7b - hf)をベースにファインチューニングされたマルチモーダル基礎モデルで、植物病害データセットを使用して植物葉の病害を検出し説明するために最適化されています。
✨ 主な機能
主要な詳細
- ベースモデル: LLaVA - 1.5 - 7B
- データセット: 複数の植物種の健康な葉と病気の葉
- 革新点:
- Self - Synthesized Data: Information Bottleneck原理を用いて、病害特有の視覚的症状を抽出し説明します。
- 反復的なファインチューニング: 報酬モデルを使用しない棄却サンプリングを用いて、分類精度と説明品質を向上させます。
- 想定用途: 人間が検証可能な症状説明を伴う植物葉病害の識別
📦 インストール
このセクションでは、モデルを使用するためのインストール手順について説明します。必要なライブラリをインストールしてください。
pip install requests pillow torch transformers
💻 使用例
基本的な使用法
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))
🔧 技術詳細
学習と評価
- 学習: PlantVillageデータセットを使用してLoRAを用いて反復的な棄却サンプリングでファインチューニングされました。
- 評価: ベースラインモデルと比較して、優れた精度と堅牢で解釈可能な説明を示しています。
📄 ライセンス
このモデルを使用する場合は、以下の文献を引用してください。
@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}
}