--- base_model: LiquidAI/LFM2.5-VL-450M library_name: peft pipeline_tag: image-text-to-text license: apache-2.0 tags: - lora - peft - sft - satellite-imagery - wildfire-detection - sentinel-2 - remote-sensing - liquid-ai - hackathon --- # FireEdge LoRA — Wildfire Detection from Sentinel-2 Imagery LoRA fine-tune of [LiquidAI/LFM2.5-VL-450M](https://huggingface.co/LiquidAI/LFM2.5-VL-450M) for binary wildfire detection from Sentinel-2 pseudo-color composites. Developed for the **Liquid AI × DPhi Space "AI in Space" Hackathon** (2026). Training code & full pipeline: [github.com/YujiYamaguchi/liquid-ai-space-hackathon](https://github.com/YujiYamaguchi/liquid-ai-space-hackathon) (apps/fireedge/) --- ## Task Given a Sentinel-2 pseudo-color image (R=SWIR22/B12, G=NIR/B8A, B=SWIR16/B11) of a 5km × 5km scene, predict whether an active wildfire is occurring. ```json {"fire_detected": true} // or false ``` --- ## Model Details | Item | Value | |---|---| | Base model | LiquidAI/LFM2.5-VL-450M (450M params) | | Adapter type | LoRA | | LoRA rank | 16 | | LoRA alpha | 32 | | LoRA dropout | 0.05 | | Target modules | q_proj, k_proj, v_proj, out_proj, in_proj, w1, w2, w3, linear_1, linear_2 | | Loss masking | Assistant-only (mask_asst) | | Epochs | 5 | | Learning rate | 2e-4 (cosine, warmup_ratio=0.05) | | Batch size (effective) | 8 (per_device=1 × grad_accum=8) | | Hardware | NVIDIA RTX 5090 (24GB VRAM) | --- ## Dataset | Split | POS (fire) | NEG (no-fire) | Total | |---|---|---|---| | Train | 70 | 140 | 210 | | Val | 15 | 30 | 45 | | Test | 15 | 30 | 45 | - **POS**: Active wildfire scenes sourced from NASA FIRMS VIIRS detections × Sentinel-2 via SimSat API - **NEG (FIRMS)**: Confirmed fire-free scenes near FIRMS detections (temporal offset) - **NEG (diverse)**: Geographically diverse non-fire scenes across multiple biomes - **GT source**: NASA FIRMS VIIRS NRT — real satellite fire detections, no synthetic data - **Image format**: 3-channel PNG (R=B12/SWIR22, G=B8A/NIR, B=B11/SWIR16), 224×224px --- ## Evaluation Results Tested on a held-out test set (45 samples, stratified split). | Metric | Base LFM2.5-VL | FireEdge LoRA | Δ | |---|---|---|---| | **Precision** | 0.333 | **1.000** | +0.667 | | **Recall** | 1.000 | **0.933** | −0.067 | | **F1** | 0.500 | **0.966** | +0.466 | | **FP Rate** | 1.000 | **0.000** | −1.000 | | Accuracy | 0.333 | **0.978** | +0.644 | | Latency mean (ms) | 163 | **150** | −13 | | JSON parse rate | 1.000 | 1.000 | — | **Confusion matrix (FireEdge LoRA):** ``` Predicted NO-FIRE FIRE True NO-FIRE 30 0 ← 0 false alarms True FIRE 1 14 ← 1 miss ``` The base model always predicts FIRE (FP Rate = 1.0). LoRA fine-tuning reduces FP Rate to 0.0 while maintaining Recall ≥ 0.85. --- ## Training Methodology ### Loss Masking Strategy We compared two SFT loss strategies: | Strategy | Description | Recall | FP Rate | |---|---|---|---| | `mask_asst` (this model) | Loss only on assistant tokens | **0.933** | **0.000** | | `full_seq` | Loss on all tokens | 0.000 | 0.000 | `full_seq` collapsed to always predicting `false` because the fixed system/user template tokens (~242 tokens) dominate the sequence, leaving the 10-token assistant response (~2.2% of total) with negligible gradient signal. ### Input Format ``` <|im_start|>system You are a satellite imagery analyst... <|im_end|> <|im_start|>user [196 image tokens] Analyze this Sentinel-2 image... <|im_end|> <|im_start|>assistant {"fire_detected": true/false} <|im_end|> ``` --- ## Usage ```python from peft import PeftModel from transformers import AutoProcessor from PIL import Image # Load base model + adapter base_model_id = "LiquidAI/LFM2.5-VL-450M" adapter_id = "YujiYamaguchi/lfm2-5-vl-450m-wildfire" # See training code for full inference pipeline: # apps/fireedge/fireedge/inference.py ``` Full inference code in the training repository. --- ## Citation ```bibtex @misc{yamaguchi2026fireedge, title = {FireEdge: Onboard Wildfire Detection via LoRA Fine-tuning of LFM2.5-VL}, author = {Yuji Yamaguchi}, year = {2026}, note = {Liquid AI × DPhi Space AI in Space Hackathon} } ```