Downloads · 30 days
8
13% of all-time downloads
Wafik20/gemma-3-4b-minecraft-biomes-lora
gemma-3-4b-minecraft-biomes-lora is a image-text-to-text model from Wafik20. Use it for the image-text-to-text task on the model card, and read the license before you ship it in a product. It is set up for peft. The card lists the license as gemma.
A LoRA adapter over google/gemma-3-4b-it that classifies Minecraft screenshots into 13 broad biome categories.
Downloads · 30 days
8
13% of all-time downloads
All-time downloads
61
Public
Repo size
188 MB
Likes
0
Public
Click a slice to open those files.
.safetensors154 MB · 82%
From the Hugging Face model README
A LoRA adapter over google/gemma-3-4b-it that classifies Minecraft screenshots into 13 broad biome categories.
Given a single Minecraft screenshot, predict the biome as one word from:
desert, plains, forest, taiga, jungle, swamp, savanna,
tundra, ocean, mountain, beach, river, mesa
Target use: labeling or classifying Minecraft RGB frames from agents (MineRL) or gameplay captures. Not intended for non-Minecraft imagery — the model has only ever seen Minecraft screenshots during training.
Two honest numbers, different distributions:
| Evaluation set | N | Overall accuracy | Notes |
|---|---|---|---|
| MineRL RGBD (human audit, 374 samples) | 374 | 96.0% (95% CI: 93.5–97.6) | Target deployment distribution |
| MiDaS biome test set (v1 model, pre-ocean-fix) | 2762 | 60.6% | Different rendering pipeline |
| willowc/minecraft-biomes val split | 2231 | 92.2% | In-distribution (held-out from train) |
The MiDaS number is from v1 (before we added MineRL ocean examples). We did not re-run MiDaS after the v2 retrain. Expect similar out-of-distribution behavior — the model is optimized for the willowc
| Class | N | Accuracy | 95% CI |
|---|---|---|---|
| river | 42 | 81.0% | 66.7 – 90.0 |
| taiga | 40 | 97.5% | 87.1 – 99.6 |
| jungle | 30 | 100.0% | 88.6 – 100.0 |
| ocean | 30 | 96.7% | 83.3 – 99.4 |
| plains | 30 | 96.7% | 83.3 – 99.4 |
| desert | 30 | 100.0% | 88.6 – 100.0 |
| forest | 30 | 96.7% | 83.3 – 99.4 |
| beach | 30 | 96.7% | 83.3 – 99.4 |
| savanna | 30 | 100.0% | 88.6 – 100.0 |
| tundra | 29 | 100.0% | 88.3 – 100.0 |
| mountain | 29 | 93.1% | 78.0 – 98.1 |
| swamp | 24 | 100.0% | 86.2 – 100.0 |
River is the weakest class — visually ambiguous with swamp/ocean/beach at 640×360 screenshot resolution.
Training history (per-step train loss, epoch-mean train/val loss,
per-class accuracy) is in train_history.json; a loss curve plot is
at loss_curve.png.
Prerequisite: the base model google/gemma-3-4b-it is a gated
repository on HuggingFace. You must first accept the Gemma license on
the base model page and
log in with hf auth login before from_pretrained will succeed.
from transformers import AutoProcessor, AutoModelForImageTextToText
from peft import PeftModel
from PIL import Image
import torch
base = "google/gemma-3-4b-it"
adapter = "Wafik20/gemma-3-4b-minecraft-biomes-lora"
processor = AutoProcessor.from_pretrained(base)
model = AutoModelForImageTextToText.from_pretrained(
base, torch_dtype=torch.bfloat16, device_map="cuda:0",
)
model = PeftModel.from_pretrained(model, adapter)
BIOME_CHOICES = "desert, plains, forest, taiga, jungle, swamp, savanna, " \
"tundra, ocean, mountain, beach, river, mesa"
prompt = (
"Identify the Minecraft biome shown in this screenshot. "
f"Reply with exactly one word chosen from: {BIOME_CHOICES}."
)
image = Image.open("minecraft_screenshot.png").convert("RGB")
messages = [{"role": "user", "content": [
{"type": "image"},
{"type": "text", "text": prompt},
]}]
text = processor.apply_chat_template(messages, tokenize=False,
add_generation_prompt=True)
inputs = processor(text=[text], images=[image], return_tensors="pt").to(model.device)
out = model.generate(**inputs, max_new_tokens=5, do_sample=False)
generated = out[:, inputs["input_ids"].shape[1]:]
print(processor.batch_decode(generated, skip_special_tokens=True)[0].strip())
# -> "ocean" (for example)
Use the exact prompt above. Training-time prompt wording affects results — paraphrasing can reduce accuracy meaningfully.
A pseudo-labeled dataset of 1908 MineRL RGBD frames labeled by this model is available at Wafik20/minecraft-biomes.
This adapter is derived from Google's Gemma model and is therefore subject to the Gemma Terms of Use. Use of this adapter requires accepting those terms, including the prohibited-use policy.
@misc{gemma_minecraft_biome_lora,
author = {Wafik},
title = {Gemma-3-4B Minecraft Biome Classifier (LoRA)},
year = {2026},
url = {https://huggingface.co/Wafik20/gemma-3-4b-minecraft-biomes-lora},
}
adapter_model.safetensors — LoRA weights (~150 MB)adapter_config.json — PEFT config (rank, targets, base model ref)biome_labels.json — the 13-class label map and numeric biome ID maptokenizer.json, tokenizer_config.json, chat_template.jinja,
processor_config.json — processor bundletrain_history.json — per-step train loss, per-epoch val stats,
per-class val accuracyloss_curve.png — training loss visualization