--- 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.