lora-lateblight-v3 / README.md
jalonso24's picture
Update README.md
a62b8c7 verified
metadata
license: apache-2.0
language:
  - es
  - en
tags:
  - lora
  - openllama
  - agriculture
  - climate
  - potato
  - few-shot
  - classification
  - low-resource
  - causal-lm
datasets:
  - custom
base_model: openlm-research/open_llama_3b
model-index:
  - name: lora-lateblight-v5
    results: []

lora-lateblight-v5 🌱 — OpenLLaMA-3B Fine-Tuned for Potato Late Blight Risk Prediction in Huancavelica, Peru

Author: Jorge Luis Alonso (@jalonso24)
Model Base: openlm-research/open_llama_3b
Adapter Format: LoRA (PEFT)
Location: Huancavelica, Andes, Peru
Languages: Spanish, English
Task: Multi-class classification (Bajo, Moderado, Alto) of late blight disease risk using natural language prompts


🔍 What is this?

lora-lateblight-v5 is a lightweight, prompt-based classifier that predicts potato late blight risk levels using natural language inputs. It was fine-tuned with LoRA adapters on a curated dataset of expert-labelled and synthetic examples from Huancavelica, Peru.

It supports bilingual prompts, runs on low-cost hardware, and helps agronomists and rural farmers make better decisions using just weather and crop descriptions in plain language.


🧪 How was it trained?

  • Fine-Tuning Method: LoRA (Low-Rank Adaptation)
    • r=32, alpha=16, dropout=0.1
  • Training Framework: PEFT with transformers, Colab T4 GPU
  • Epochs: 5, using mixed precision with float32 stabilization
  • Data Sources:
    • Historical climate + crop risk data (SENAMHI, CIP)
    • Synthetic "Alto" risk cases for balancing
    • Distilled "Moderado" cases from GPT-4 + Gemini consensus
  • Prompt Style:
    • Few-shot (3 labeled examples: Bajo, Moderado, Alto)
    • Natural, bilingual inputs (e.g., Spanish + English)
    • Example format:
      La variedad es INIA-302 Amarilis, sembrada en noviembre.
      La precipitación fue 18.4 mm, la temperatura máxima 17.2°C,
      la mínima 6.1°C y la humedad promedio 84.12%.
      
      ¿Cuál es el riesgo de tizón tardío?
      
      Riesgo:
      

📊 Evaluation Summary

Metric Score
Accuracy 73%
Recall (Alto) 100%
F1-score (Alto) 0.78
F1-score (Mod.) 0.25
  • ✅ Model reliably detects all high-risk (Alto) cases
  • ⚠️ Struggles with moderate-risk (Moderado) due to timing subtleties
  • ⚖️ Prioritizes early warning over precision — suitable for advisory tools

📁 Files Included

  • adapter_model.safetensors — LoRA adapter weights
  • tokenizer/ — Tokenizer from OpenLLaMA 3B
  • README.md — This model card

🧠 Intended Use

  • Forecast potato late blight risk in high-altitude Andean regions
  • Run lightweight inference on devices like Beelink Mini PCs
  • Support local extension workers, agronomists, or AI-powered alert tools
  • Educate farmers using mobile-friendly prompts in Spanish or English

🚧 Known Limitations

  • Overpredicts Alto in ambiguous cases — intended as a safety trade-off
  • Struggles with unclear or borderline Moderado cases
  • Not designed for automated spraying systems or IoT-triggered actions
  • Needs expert validation before field-level decisions

🫷 Try It (Coming Soon)

We’re working on a Gradio demo where you’ll be able to enter:

  • Crop variety
  • Planting month
  • Weekly humidity, temperature, and rainfall

👉 and receive a natural-language Riesgo prediction.


📚 Citation

@misc{alonso2025lateblight,
  author = {Jorge Luis Alonso},
  title = {Predicting Potato Late Blight in Huancavelica, Peru, Using OpenLLaMA 3B + LoRA},
  year = {2025}, {\url{https://www.linkedin.com/pulse/improving-potato-late-blight-forecasting-huancavelica-alonso-5h1af}}
  note = {Fine-tuning based on expert-labelled and synthetic data with few-shot prompt classification},
  howpublished = {\url{https://huggingface.co/jalonso24/lora-lateblight-v5}}
}

Based on foundational studies by Gastelo et al. (2025), Giraldo et al. (2010), and Saffer et al. (2024).