All 6 errors are adjacent-class confusions — no wild misclassifications. The HIGH/CRITICAL boundary is the weakest point (3 of 6 errors).
1from transformers import AutoProcessor, AutoModelForImageTextToText
2from PIL import Image
3import torch
4
5model_id = "debrajsingha/algaeguard-lfm2-5-vl-450m"
6
7processor = AutoProcessor.from_pretrained(model_id)
8model = AutoModelForImageTextToText.from_pretrained(
9 model_id,
10 torch_dtype=torch.bfloat16,
11 device_map="auto",
12)
13
14# Load your Sentinel-2 NDCI colormap image
15image = Image.open("ndci_colormap.png").convert("RGB")
16
17messages = [
18 {
19 "role": "system",
20 "content": "You are AlgaeGuard, an autonomous on-board satellite AI for Harmful Algal Bloom (HAB) early-warning using Sentinel-2 NDCI imagery. You analyze NDCI colormap images and produce structured bloom assessments for water utility operators. Your assessments guide 6–12 hour treatment protocol decisions — be precise, actionable, and structured."
21 },
22 {
23 "role": "user",
24 "content": [
25 {"type": "image", "image": image},
26 {"type": "text", "text": "Location: Chesapeake Bay\nDate: 2024-07-15\nNDCI Mean: 0.12 | NDCI Max: 0.41\nBloom Coverage: 18.5%\n\nClassification thresholds (bloom coverage):\n CLEAR <1% | LOW 1–8% | MEDIUM 8–25% | HIGH >25% | CRITICAL if severe coverage >15%\nNote: Bloom Coverage <1% = CLEAR regardless of NDCI max spikes.\n\nAnalyze this Sentinel-2 NDCI colormap and issue an AlgaeGuard bloom assessment report for the water utility operator."}
27 ]
28 }
29]
30
31text = processor.apply_chat_template(messages, add_generation_prompt=True, tokenize=False)
32inputs = processor(text=text, images=[image], return_tensors="pt").to(model.device)
33
34with torch.no_grad():
35 output = model.generate(**inputs, max_new_tokens=256)
36
37response = processor.decode(output[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True)
38print(response)
Data: 350 training samples from
debrajsingha/algaeguard-hab-ndci —
180 real Sentinel-2 observations via SimSat API + 170 Perlin-noise synthetic bloom images
annotated with Claude API.
1@model{algaeguard_lfm2_2026,
2 title = {AlgaeGuard: Fine-tuned LFM2.5-VL-450M for Harmful Algal Bloom Detection},
3 author = {Singha, Debraj},
4 year = {2026},
5 publisher = {Hugging Face},
6 url = {https://huggingface.co/debrajsingha/algaeguard-lfm2-5-vl-450m},
7 base_model = {LiquidAI/LFM2.5-VL-450M},
8 license = {CC-BY-4.0}
9}
Based on
LiquidAI/LFM2.5-VL-450M.
Training data includes ESA Sentinel-2 imagery (Copernicus Open Access) and Claude API annotations (Anthropic).