Slowlanterns
Categories
Artificial Intelligence

Read Confidence on a Classifier That Confuses Two Keys

Use photographs of two nearly identical household keys to see whether a model's scores support the decisions you would make with them.

Two metal keys resting on a pale marbled surface
In this article

Two spare keys look almost identical on a kitchen counter. One has a small shoulder on the stem and the other does not. In the strongest light the difference is clear, but in a photograph from across the room one of the keys appears to have no teeth at all. A classifier calls that blurry object Key B with a score of 0.96. You can see both the prediction and the digits. The digits by themselves do not tell you how often guesses like that are right.

The practical question is how much trust to place in the score before you act on it. A prediction can be right while its score encourages too much or too little confidence. You can explore the distinction with a small collection of pictures of ordinary objects you own, an existing classifier or recognition tool, and a notebook. An exercise with two keys is useful precisely because you can check what you actually photographed while making the visual problem harder in a controlled way. Use plain objects if you'd prefer not to record working keys. Two similar metal washers or two kinds of bottle cap work too.

Identify what counts as true before taking the pictures

Choose two objects that the tool is able to distinguish under favorable conditions. For instance, use two distinct kinds of visibly similar hardware, or two named objects supported by a personal image tool you have already set up. An ordinary general-purpose classifier may label both household keys simply as a key. Treat that as a category limitation, rather than concluding it failed to identify your two chosen instances. Check the labels the interface actually offers before spending time taking final photographs.

Keep your own labels separate from what the model says. Label a paper tray for A and B and take the objects out of the tray for the scored photographs. Write a short note linking each file to the item you used, or place physical objects in separate containers until you have recorded the results. The name of the file can be convenient for a human, but avoid passing it to a system that might use that text as a clue. The score should reflect what is present in the image input.

Pick an unambiguous rule for photographs containing no usable view of either object. A photo of two overlapping keys may not have one correct label. A half object at the frame edge may be identifiable to you only because you know which photo you were taking. You can include both kinds as separate review cases. Keep them out of the ordinary accuracy tally unless you have defined a supported reject category. That way you can tell the difference between failing to name a visible object and confidently guessing when the input wasn't sufficient.

Vary one visible condition at a time

Take examples in even light and straight on, then try a view with rotation or partial shadow. Try the same surface for both objects and take at least some pictures at a second location. If A always lies on light paper and B always lies on a dark cloth, a successful result could come from recognizing the cloth. One useful check is to swap the backgrounds while keeping the type of lighting similar. An apparent drop tied to the swap gives you a place to look for an unintended clue.

Take some pictures from a distance at which you can still see the distinguishing mark, and some from just beyond that distance. A closer image may show the mark and a farther one may show only a typical silhouette. Keep both examples even if the first output seems obvious. The point is to observe how the score changes with the visibility of the necessary detail. A tool can report high values for a familiar outline while losing the thing a person would use to distinguish A from B.

Use sparse variations rather than making every test photograph deliberately difficult. Include ordinary pictures you might reasonably take one-handed on a desk. Those examples tell you what happens in the anticipated use. Keep unusual shadows, cropped views, or severe blur as a small additional set. Reporting the two sets separately helps avoid exaggerating either the tool’s everyday success or the prevalence of extreme inputs.

Write down the scores as the tool reports them

For each clear A or B photo, record the expected label, the returned label, and the top score, if the tool exposes one. Do not calculate a missing confidence value from the rank of the labels. If the only information is that one label appears first, your evidence is about ranking and accuracy for those images. If a tool reports a margin between two outcomes, that margin can be useful for setting a review rule, but it is still a different quantity from the frequency with which the prediction turns out right.

Ask which score the app displays. One interface may show a value for the top label. Another may give several scores that are not meant to add up to one. An interface may also hide the numerical output altogether. Calibration concerns how confidence values relate to observed correctness, as described in the paper by Chuan Guo and colleagues. Before grouping estimates into confidence bands, verify that the values you are grouping even claim to describe comparable outcomes.

Do not turn a single 0.96 result into a claim that one of twenty-five pictures like it should fail. If a model's scores are calibrated for the relevant situation, many predictions with similar reported confidence should have a corresponding average correctness. One result cannot demonstrate that relationship. A number can have three decimal places and still be weak evidence when the image or the conditions differ from the situations the model was built to handle.

Compare the groups carefully

An illustrative result helps make the calculation concrete. Suppose you have ten clear test examples whose returned top scores lie between 0.90 and 1.00. If eight are correct, the group's observed correctness is eight out of ten. If the average reported score is 0.95, the group shows a gap between the average confidence and what happened in your sample. The count alone does not tell you whether the same gap would remain in a larger set. Keep the two wrong images visible and look at what they have in common.

A score band below that one might contain four photos. If three are correct, that is three out of four. It is not enough evidence to draw a smooth conclusion about a whole model. Wider score groups or more independently collected images make a comparison easier to interpret. A simple list bearing both scores and error counts is a better record than a decorative graph with very little data in each bar.

Look separately at cases where the model refuses or where you choose to ask a human. If a threshold sends every hard picture to review, the automatic decisions can look highly accurate while the coverage becomes tiny. Record how many decisions the system makes and how many it leaves open. A gate that gets seven accepted decisions right and routes the remaining shots for a second look behaves differently from a model that guesses on every image, even though the same classifier might sit behind both arrangements.

Decide what a score should cause next

For two spare keys, the cost of review is low. You can take another photograph, check the shoulder directly, or verify the label by looking at the object. A suitable workflow might automatically show a suggestion and wait for confirmation because it takes only a moment to verify. If you are tempted to move files or inventory records automatically, test that narrower action with expendable examples first. A number becomes operationally important only when it changes what the system does.

Try a provisional review rule with a separate batch. If you used the first photographs to choose a cutoff, capture fresh images before describing how that cutoff performs. Otherwise you only know how well it fits the pictures you used to tune it. Include both lights and backgrounds again if the tool will see them. Report accepted decisions, accepted mistakes, and cases referred for review together. Those numbers tell a reader how much manual work the rule leaves and where the possible mistakes land.

If the tool changes predictions when you submit exactly the same photograph again, record that separately. Repeating one image can expose variation in the interface, but it does not create a new observation about different pictures. Revisit the decision rule when the variation is large enough to alter which cases a person sees.

Keep the collection and the plain language description of the intended decision. A useful note could say, “Use the score to order suggestions. Confirm from the visible mark whenever the object is partly hidden.” That puts the strongest observed result where it matters. If a new phone or an updated model changes the output, reuse the same representative conditions and add some fresh photographs. The aim of the experiment is to learn when a number earns practical trust, rather than to decide once and for all that every confidently named object is what the model says it is.

Related articles