◉GEMINI LABJP
●2.5 ROUTE — From today, 12/1, calls to gemini-2.5-pro and 2.5-flash are rerouted to newer models automatically●CLI 0.71.1 — Gemini CLI stable is still v0.71.1, with a 0.73 nightly published on 11/30●INTRO END — Introductory pricing for 3.8, 3.7 and 3.6 Flash ends on 12/31. 30 days left●VERTEX — Developers are asking how to run Gemini CLI with Vertex AI credentials●NEON — Gemini 4 Neon became generally available on 11/18 (paid tier only)●IMAGE TEXT — A new test shows text inside an image can sway Gemini's answer●2.5 ROUTE — From today, 12/1, calls to gemini-2.5-pro and 2.5-flash are rerouted to newer models automatically●CLI 0.71.1 — Gemini CLI stable is still v0.71.1, with a 0.73 nightly published on 11/30●INTRO END — Introductory pricing for 3.8, 3.7 and 3.6 Flash ends on 12/31. 30 days left●VERTEX — Developers are asking how to run Gemini CLI with Vertex AI credentials●NEON — Gemini 4 Neon became generally available on 11/18 (paid tier only)●IMAGE TEXT — A new test shows text inside an image can sway Gemini's answer
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 API256Image 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-10-31
When Computer Use Ends After a Few Steps — Finding the Reason Among Five Exits
When Gemini API Computer Use ends after a few steps with no error, sort the cause into five exits that follow the official loop: no function_call, turn_limit, a declined confirmation, a blocked action, or a malformed function_result. Includes a loop skeleton that logs the exit reason in one line, coordinate scaling, and the safety policy list (checked against the official docs, November 2026).
⬡ 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.