shahab@internet:~/blog/classifier-first-multimodal-systems
backhome

Classifier First, Multimodal Model Second

If an image needs one label from a fixed list, a small classifier may be enough. Sending every image to a large multimodal model adds cost and latency that the task may not need.

A useful alternative is to classify first, then send uncertain cases to the larger model. The difficult part is deciding what counts as uncertain.

A high score isn't a guarantee

A classifier can be confidently wrong, especially on images unlike its training data. Test the routing threshold on a held-out set that resembles real uploads: poor lighting, unusual crops, screenshots, duplicates, and unsupported subjects.

Look at errors by class as well as overall accuracy. Two similar classes may need a different threshold from the rest. Keep near-duplicates together when splitting data; otherwise, the evaluation can look better than the model really is.

Choose the threshold around the cost of mistakes. An unnecessary fallback costs time and money. A wrong automatic acceptance may cost much more.

if image_quality_failed:
    request_another_image
elif confidence_and_margin_pass:
    accept_classifier_result
else:
    ask_multimodal_model

This is a routing sketch, not a complete policy. Unsupported inputs and unresolved results still need explicit handling.

Keep the fallback's job small

Give the larger model the allowed labels, relevant candidates, and the distinction it needs to resolve. Let it return “none of these” instead of forcing a label. Validate the response before it reaches the rest of the application.

An explanation can help a reviewer, but the field that drives automation should have a fixed schema. A new category invented in prose mustn't quietly become a valid output.

Measure the fallback separately. Does it correct classifier mistakes? Does it override correct predictions? Which class pairs remain difficult? Those questions are more useful than counting how often the two models agree.

Keep failures distinguishable

“The image is ambiguous” and “the provider timed out” require different next steps. Store them as different outcomes. Depending on the workflow, an unresolved image can wait for review, enter a retry queue, or prompt a replacement upload.

Record the image version, classifier version, scores, routing decision, and validated fallback result. That gives a reviewer a way to understand a label without rerunning the entire pipeline.

Check whether the extra stage pays off

Track accuracy, fallback rate, latency, and cost per completed decision together. A lower fallback rate is useful only if errors stay acceptable. Human review also has a cost that the inference bill won't show.

This approach fits a stable set of categories with enough traffic to justify a separate model. For an open-ended task or a small number of images, the extra training and routing machinery may be unnecessary. Start with the actual decision and workload, then choose the models.