lfm2.5-vl-450m-wildfire

A wildfire risk classification model finetuned from LiquidAI/LFM2-VL-450M on satellite imagery. Given an RGB satellite image, returns a structured JSON risk assessment.

Model Details

Base model LiquidAI/LFM2-VL-450M
Architecture Lfm2VlForConditionalGeneration (hybrid conv/attention + SigLIP2 vision encoder)
Parameters ~450M
Finetuning method LoRA (r=8, alpha=16) via TRL SFTTrainer
Training compute Modal H100
Epochs 3
Dataset Paulescu/wildfire-prevention

Output Format

The model returns a raw JSON object (no markdown, no explanation):

{
  "risk_level": "low | moderate | high | critical",
  "dry_vegetation_present": true,
  "steep_terrain": false,
  "urban_interface": true,
  "water_body_present": false,
  "image_quality_limited": false
}

Usage

With transformers

from transformers import AutoModelForImageTextToText, AutoProcessor
from PIL import Image

model = AutoModelForImageTextToText.from_pretrained("badluma/lfm2.5-vl-450m-wildfire")
processor = AutoProcessor.from_pretrained("badluma/lfm2.5-vl-450m-wildfire")

image = Image.open("satellite.png")

messages = [
    {
        "role": "system",
        "content": "You are a wildfire risk analyst. Examine the satellite image and assess wildfire risk based strictly on what is visible. Respond with ONLY a raw JSON object β€” no markdown, no explanation, no code fences. Fields: risk_level (string: low/moderate/high/critical), dry_vegetation_present (boolean), steep_terrain (boolean), urban_interface (boolean), water_body_present (boolean), image_quality_limited (boolean)."
    },
    {
        "role": "user",
        "content": [
            {"type": "image", "image": image},
            {"type": "text", "text": "Analyze this satellite image. Return only the JSON."}
        ]
    }
]

inputs = processor.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt")
output = model.generate(**inputs, max_new_tokens=128, temperature=0.0, do_sample=False)
print(processor.decode(output[0], skip_special_tokens=True))

With llama-server (GGUF)

Download the quantized GGUF files from this repo:

  • lfm2.5-vl-450m-wildfire-Q8_0.gguf β€” main model weights (Q8_0)
  • mmproj-LFM2.5-VL-450m-Q8_0.gguf β€” multimodal projector
llama-server \
  -m lfm2.5-vl-450m-wildfire-Q8_0.gguf \
  --mmproj mmproj-LFM2.5-VL-450m-Q8_0.gguf \
  --port 8190 --host 127.0.0.1 -c 2048

Then POST to http://127.0.0.1:8190/v1/chat/completions with standard OpenAI-compatible format.

Finetuning Code

The full training pipeline is included in the finetune/ directory of this repo:

finetune/
β”œβ”€β”€ configs/finetune_lfm_450M.yaml   # Training hyperparameters
β”œβ”€β”€ src/wildfire_prevention/          # Training source code
β”‚   β”œβ”€β”€ fine_tune.py                  # Main training script (Modal)
β”‚   β”œβ”€β”€ data_preparation.py           # Dataset formatting
β”‚   β”œβ”€β”€ loaders.py                    # Model + dataset loading
β”‚   └── config.py                     # Config schema
β”œβ”€β”€ scripts/
β”‚   β”œβ”€β”€ merge_lora.py                 # Merge LoRA adapter into base
β”‚   └── export_gguf.sh                # Convert to GGUF via llama.cpp
β”œβ”€β”€ Makefile                          # make train / make download-checkpoint
└── pyproject.toml                    # Dependencies (uv)

Requirements: Python 3.12+, uv, Modal account, W&B account, HF token.

cd finetune
uv sync
make train          # Runs on Modal H100
make download-checkpoint
bash scripts/export_gguf.sh
Downloads last month
139
Safetensors
Model size
0.5B params
Tensor type
F16
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for badluma/lfm2.5-vl-450m-wildfire

Quantized
(15)
this model

Dataset used to train badluma/lfm2.5-vl-450m-wildfire