File size: 3,209 Bytes
40d108c
 
 
 
 
 
 
 
 
 
d0abc67
 
 
40d108c
 
 
 
 
 
 
 
 
 
f87ca59
 
 
 
 
 
40d108c
 
d0abc67
40d108c
 
 
 
 
 
 
 
 
 
 
d0abc67
 
 
 
 
40d108c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d0abc67
40d108c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
---
title: MicroLens
emoji: 🔬
colorFrom: blue
colorTo: green
sdk: gradio
sdk_version: 5.7.1
app_file: app.py
pinned: false
license: apache-2.0
short_description: Gemma 4 E2B + LoRA · diatoms & fungal spores · 95 genera
models:
  - Laborator/microlens-final
tags:
  - microscopy
  - biology
  - vision-language
  - gemma
  - gemma-4
  - unsloth
  - qlora
---

## Demo video

[Watch the 90-second walkthrough on YouTube](https://youtu.be/r1GIi4EukVg)



# 🔬 MicroLens — Microscopy AI Demo

Live demo of **MicroLens**: a fine-tuned **Gemma 4 E2B** vision-language model that identifies microscopic subjects across **2 categories** (diatoms and fungal spores) and **95 genera**.

Built by **Serghei Brinza** (Vienna, Austria) for the **Kaggle Gemma 4 Good Hackathon** (May 2026).

---

## 🚀 How to use

1. Upload a microscopy image (or pick one from the examples gallery).
2. Optionally add a question, for example: "What is shown here?", "Describe the morphology", "What category does this belong to?"
3. Click **AI Analyze**.

You get three side-by-side answers:

- **UNTRAINED BASELINE** — stock Gemma 4 E2B with no microscopy training.
- **MICROLENS · BRIEF** — same base + `Laborator/microlens-final` LoRA, prompted for a single-sentence genus answer.
- **MICROLENS · RICH** — same base + same LoRA, prompted for the full schema (genus + morphology + habitat + identification cues).

---

## 🔒 Privacy

- Images are processed in-memory on this Space and **not stored** server-side.
- **No analytics, no tracking, no third-party sharing.**
- For fully offline operation, see the desktop release linked below.

---

## ⚠️ Disclaimer

MicroLens is a **research and educational tool**. It is **not a medical device** and must not be used for clinical diagnosis, food-safety decisions, forensic identification, or any purpose where an incorrect answer could harm a person.

- Predictions are probabilistic and may be wrong, especially on out-of-distribution samples.
- Always verify critical findings with a qualified microscopist or laboratory.

For any vertical that requires regulatory clearance (medicine, veterinary, forensics, food safety), see the [4-stage gated rollout](https://github.com/SergheiBrinza/microlens/blob/main/ROADMAP.md) in the project roadmap.

---

## 🔗 Links

- **Model:** [Laborator/microlens-final](https://huggingface.co/Laborator/microlens-final)
- **Source code:** [SergheiBrinza/microlens](https://github.com/SergheiBrinza/microlens)
- **Hackathon writeup:** [KAGGLE_WRITEUP.md](https://github.com/SergheiBrinza/microlens/blob/main/KAGGLE_WRITEUP.md)
- **Roadmap:** [ROADMAP.md](https://github.com/SergheiBrinza/microlens/blob/main/ROADMAP.md)

---

## 📜 License and citation

- **Code:** Apache 2.0
- **Documentation:** CC-BY 4.0

```bibtex
@software{brinza_microlens_2026,
  title        = {MicroLens: a microscopy vision-language interface built on Gemma 4 E2B},
  author       = {Brinza, Serghei},
  year         = {2026},
  month        = may,
  publisher    = {Hugging Face},
  note         = {Submission to the Gemma 4 Good Hackathon (Kaggle, May 2026)}
}
```

---

Built with **Unsloth**, **llama.cpp**, and **Gradio** in Vienna, Austria.