10 19 hours ago

Gemma 4 E2B fine-tuned for microscopy ID — rich 4-section scientific descriptions (genus + morphology + habitat + ID cues). Same 3.4 GB as v2, runs offline on laptop / phone. Apache 2.0. Research model — not a medical device.

vision tools thinking audio
ollama run brinzaengineeringai/microlens-v3

Applications

Claude Code
Claude Code ollama launch claude --model brinzaengineeringai/microlens-v3
OpenClaw
OpenClaw ollama launch openclaw --model brinzaengineeringai/microlens-v3
Hermes Agent
Hermes Agent ollama launch hermes --model brinzaengineeringai/microlens-v3
Codex
Codex ollama launch codex --model brinzaengineeringai/microlens-v3
OpenCode
OpenCode ollama launch opencode --model brinzaengineeringai/microlens-v3

Models

View all →

Readme

MicroLens v3

Research model · Apache 2.0 · Not a medical device · Not a certified instrument · Use at your own risk. Outputs are statistical pattern matches against training data, presented through learned scientific phrasing — not analytical measurements. See full disclaimer below.

Same model as v2, retrained for one extra epoch on a knowledge-base-augmented dataset. The outputs are longer and structured — morphology, habitat, identification cues. Same 3.4 GB GGUF, same hardware, same speed budget.

ollama run brinzaengineeringai/microlens-v3

What v3 produces

A four-section scientific description, generated end-to-end by the model:

This is a diatom of the genus Surirella, specifically Surirella brebissonii.

Morphology: Asymmetric isopolar pennate diatom with characteristic dorsiventral outline. Frustule ovate to elliptical, 30-80 µm long, with prominent transverse fibulae and a broad pseudoraphe.

Habitat: Cosmopolitan in standing and slow-flowing freshwaters, especially shallow lakes and littoral zones. Tolerant of moderately eutrophic conditions; widely used as a water-quality bioindicator.

Identification cues: Prominent fibulae as parallel striae at the valve margin, asymmetric isopolar outline, heart-shaped silhouette in apical view.

About 600 characters per response. Same model size as v2.

How v3 was made — and why it isn’t a runtime template

v3’s longer output comes from the model weights. There is no runtime knowledge-base lookup, no retrieval-augmented prompt, no external API call at inference time. The structured content is baked into the LoRA adapter through supervised fine-tuning.

The training pipeline:

  1. Hand-curated knowledge base for the top 30 most-common genera, plus per-category templates for the long tail. File: training/genus_kb.json. Every entry attributes its sources (AlgaeBase, WoRMS, ITIS, Round 1990, Krammer-Lange-Bertalot 1986-1991) and the wording is original.
  2. Used the KB to rewrite every answer in the 99,215-row training set into the four-section structure. Script: 09_augment_dataset.py.
  3. Resumed from v2’s best LoRA checkpoint (checkpoint-18351) for one additional epoch on the rich-format dataset at lr 5e-5. Script: 05_train_v3.py.
  4. Merged the LoRA into the base, exported to GGUF Q4_K_M. That’s the file in this repo.

To check this isn’t a runtime trick: unplug your network and run ollama run brinzaengineeringai/microlens-v3. Paste any microscopy image. The output is the same.

The whole pipeline reproduces with one command:

git clone https://github.com/SergheiBrinza/microlens
cd microlens/training
python scripts/05_train_v3.py

Accuracy

The same numbers as v2. The rich-format epoch was deliberately gentle (low learning rate, single epoch) so the classifier doesn’t drift.

Category Genus Category
Diatoms ~50% 100%
Freshwater zooplankton ~45% 97%
Marine zooplankton ~45% 100%
Fungal spores ~50% 100%
Fish larvae n/a 100%

Random guess across 145+ genera is around 0.7%.

v2 or v3, which one

Use case Pick
Automated pipelines that parse output with grep / jq v2
Human-readable reports, citizen science, classroom v3
Embedded with strict latency budget v2 (about 0.5 s)
Browser demos, screencasts, judge-facing UIs v3

Intended use and full disclaimer

MicroLens v3 is a research and educational artefact published under Apache 2.0. It is a fine-tuned neural network, not a regulated instrument.

Designed for:

  • Citizen-science screening
  • Taxonomy teaching, student labs, online microscopy courses
  • ML research, dataset benchmarking, model comparison
  • Pre-classification stages of professional pipelines, where every result is verified by a qualified person before any decision is made

This model is NOT, and must not be treated as:

  • A medical device, in-vitro diagnostic (IVD), or clinical decision-support tool
  • A regulatory-compliant water-quality measurement instrument (no ISO 17025, EPA, EU WFD, or equivalent certification)
  • A substitute for a trained taxonomist or accredited laboratory analysis
  • A calibrated, validated, or peer-reviewed analytical method

The model’s output is a probabilistic pattern match against the training data distribution, rendered through learned scientific phrasing — not a physical or analytical measurement, not a peer-reviewed identification. The model can be confidently wrong, particularly on:

  • specimens not represented in training (145+ genera ≠ all microscopic life)
  • damaged, atypical, or out-of-focus images
  • subjects from kingdoms or phyla outside the training categories

No warranty. This software is provided “AS IS”, without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and non-infringement. In no event shall the author or contributors be liable for any claim, damages or other liability, whether in an action of contract, tort, or otherwise, arising from, out of, or in connection with the model or the use or other dealings in the model.

You assume all risk when downloading, deploying, modifying, or using this model on your own hardware. Always have qualified personnel verify any result that informs a regulatory, environmental, clinical, or health-related decision.

Limitations

Genus accuracy is the same as v2 (around 45%). v3 changes the output format, not the classifier. To improve accuracy we need more and better training data — that’s planned for a future v4.

For the pseudo-genus category Fish, the dataset has no species-level annotation. v3 falls back to a category-level templated description for this class.

About 100 of the 145+ genera are long-tail (fewer than 100 training samples each) and get category-generic morphology rather than something specific to the genus. The 30 most-common genera have entries hand-curated from standard references.

No verbatim copyrighted text was used in training. The KB phrasing is original; scientific facts are paraphrased from public taxonomic references. Full attribution sits in the _meta block of genus_kb.json.

Built with

  • UnslothFastVisionModel with 4-bit QLoRA. Two-times faster training, half the VRAM. Both v2 and v3 trained on a single RTX 3090 Ti.
  • llama.cpp + mtmd — multimodal inference at the edge. The same GGUF runs from llama-server on a desktop and from JNI on Android.
  • Gemma 4 E2B-it — Google DeepMind multimodal foundation model. Apache 2.0.

Links

Apache 2.0. Built for the Kaggle Gemma 4 Good Hackathon 2026, Health & Sciences track.

Serghei Brinza · Vienna, Austria · 2026