◉GEMINI LABJP
●ARGON — gemini-4-argon is generally available as of 10/13, aimed at complex coding, agents, math and science●DEEP RES — deep-research-pro-preview-12-2025 shuts down 10/23, 7 days left. Move to deep-research-preview-04-2026●NANO — gemini-nano-banana-2.1 is GA (10/06). gemini-3.1-flash-image is deprecated with no shutdown date yet●MCP — One write-up cut an 85,000-token tool result to 310 tokens by wrapping it in an ADK FunctionTool●FLASH — gemini-3.7-flash and 3.5-flash now route automatically to newer Flash models (10/08)●NEW — Stop Re-Reading Every Crash Report: Gre…●ARGON — gemini-4-argon is generally available as of 10/13, aimed at complex coding, agents, math and science●DEEP RES — deep-research-pro-preview-12-2025 shuts down 10/23, 7 days left. Move to deep-research-preview-04-2026●NANO — gemini-nano-banana-2.1 is GA (10/06). gemini-3.1-flash-image is deprecated with no shutdown date yet●MCP — One write-up cut an 85,000-token tool result to 310 tokens by wrapping it in an ADK FunctionTool●FLASH — gemini-3.7-flash and 3.5-flash now route automatically to newer Flash models (10/08)●NEW — Stop Re-Reading Every Crash Report: Gre…
Articles/Advanced
⬡ Advanced/2026-07-10Advanced

The Day We Went From 30 Categories to 34 — Reclassifying 1,180 Assets Instead of 8,142

Adding categories to a taxonomy does not require reclassifying everything. Here is how embeddings and confidence margins narrowed a backfill from 8,142 assets to 1,180, with the numbers.

Gemini API249Image Classification5gemini-embedding-27TaxonomyCost Optimization13Indie Development16

✦ Premium Article

When I expanded my wallpaper app's taxonomy from 30 categories to 34, the first thought was not about naming or UI. It was: what happens to the 8,142 images that are already classified?

A new category always steals from existing ones. Add "Night Cityscape" and some images currently filed under "Landscape" or "Urban" genuinely belong somewhere else now. But sending all 8,142 images back through Gemini felt wasteful in both money and wall-clock time.

Every time I face this trade-off as an indie developer, I am reminded that the design work is deciding where correctness and cost meet. Here is where I drew that line, using two signals: embeddings and confidence margins.

First, Put a Number on the Full Rerun

Before deciding anything, I priced out the naive approach. Each image goes to a Flash-tier model at roughly 768px along with the label definitions, and the model returns its top two labels as structured output.

MetricFull reclassification
Assets8,142
Input tokens per image (image + prompt)~1,120
Output tokens per image~45
Estimated cost~¥3,900
Wall-clock time (concurrency 8)4h 12m
Assets whose label actually changed1,046 (12.8%)

That last row is the whole story. We sent 8,142 images and 1,046 of them changed. Which means 87% of the calls confirmed an answer we already had. Skip those 87% and the cost and the waiting shrink with them.

To be clear about provenance: I did run the full pass once, purely to have ground truth for evaluating the selective method. In day-to-day operation, that full pass is exactly what we are trying to avoid.

Only Two Kinds of Assets Need a Second Look

A new "Night Cityscape" category can only steal from labels that are semantically adjacent to it. Images filed under "Cats" or "Geometric" are not going to migrate there.

So I defined the reclassification set as the union of two groups:

  1. Impacted-label assets — those carrying an existing label that sits close to a new category in embedding space.
  2. Boundary assets — those whose original classification had a small confidence margin, meaning the model was already torn.

The first group covers "the answer may change because of the new category." The second covers "the answer was shaky regardless." Without the second group, an ambiguous frame that could read as either landscape or night cityscape slips through the impacted-label net entirely.

✦

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
✦The selection rule that shrank a full backfill (8,142 assets, ~¥3,900, 4h12m) to 1,180 assets (~¥570, 38m), with measured results
✦Using gemini-embedding-2 to find which existing labels a new category will steal from, before sending a single image
✦A classification ledger with taxonomy_version and confidence margin — plus an analysis of the one boundary asset the method missed
Secure payment via Stripe · Cancel anytime
✦

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Gemini Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • ✦Copy-paste ready implementation code
  • ✦New advanced guides published daily
  • ✦$5/mo or $10 for lifetime access
View Membership →

Related Articles

⬡ Advanced2026-09-24
I Stopped Asking Gemini 'Is This Right?' and Started Hiding My Answer Instead
Ask Gemini to confirm a label you already chose and it tends to agree. Here is why I compared three ways of asking, chose blind re-classification, how my answer still leaked in, and the routing code that sends only disagreements to a human.
⬡ Advanced2026-09-14
When BLOCK_NONE Changes Nothing: Telling Adjustable Gemini Blocks from the Ones You Can't Move
Some safety blocks go away when you loosen a threshold. Others never will. Here is how to read the response and decide which kind you are looking at before you touch a single setting.
⬡ Advanced2026-09-05
Two Kinds of Video Questions: Why I Send "Find It" and "Prove It Isn't There" Down Separate Paths
Agentic video understanding lets the model decide which parts of a video to watch. That works beautifully for finding things, and it quietly breaks when you need to prove something never appears. Here is how I split my questions, and the coverage check I now run first.