What Question Are You Asking the Image

Computer vision with AI · Lesson 1 / 22

A task exists once you have written down the input, the output and the action

The first mistake of a CV project happens before the first line of code: the task is accepted in the exact words the client used. "Control quality on the conveyor" is not a task about images. A task appears once three things are written down: what goes in (a 1920x1080 frame from a fixed camera, the part covers roughly a quarter of the area), what comes out (a "defect / good" label, or a list of boxes with coordinates, or a mask), and what action follows the output (stop the line, flag the part for rework, show it to the operator). If the third item is empty, you do not need a model - you need another conversation with the client.

Five formulations you normally choose from

  • Image classification. One label per frame. The cheapest annotation there is: one click per image. It works when a single object fills a noticeable share of the frame.
  • Object detection. A list of rectangles with a class and a confidence. It answers "how many and where". Annotation costs roughly an order of magnitude more.
  • Segmentation. A class for every pixel. You need it when someone measures area, length or shape, or when the object is fundamentally not a rectangle: a crack, a spill, a road, a stain.
  • Text reading. Localising text regions plus recognising characters. A separate class of tools, almost never trained from scratch.
  • Comparison. The model returns a vector and you compare vectors: "same product or a different one", "has this object passed here before". No fixed list of classes is needed up front - the decisive advantage wherever new classes appear every week.

Testing the formulation with three questions

1. What does the system return if there are two objects in the frame?
2. What does it return if the object is half outside the frame?
3. How does "found nothing" differ from "found it, wrong class"
   - and do the two cost the same?

Classification fails the first question: it returns one label and says nothing about the second object. Detection answers all three but demands an explicit rule for cropped objects: annotate or skip. The third question usually exposes the important thing: in quality control a missed defect costs tens of times more than a false alarm, in visitor counting the reverse holds, and this changes both the choice of task and the working confidence threshold.

The minimally sufficient formulation

Segmentation instead of detection is a classic way to overspend for nothing. Drawing one mask takes 2-5 minutes against 5-15 seconds for a box; a set of 2000 images turns from a week of work into two months. The rule: if the business answer is expressed as a count of objects or their position to within centimetres, boxes are enough. You need an exact boundary only when someone actually measures it: the area of damage, the length of a crack, the share of coverage.

Sometimes an image is not the best input

Before you mount a camera, check whether a cheaper signal exists. The presence of a part is caught by an optical sensor for pennies and needs no retraining. Thickness is measured by a laser micrometer more precisely than any segmentation. A camera earns its place when the feature is visual and varied: a scratch anywhere on the surface, an arbitrary human pose or product viewpoint. Take CV where a sensor would do and you pay in annotation and in quality degradation at every change of lighting.

Insight. Formulating the task is first of all a decision about the annotation budget, not the model. You can swap the model in a day, but you will not collect 5000 annotated images again.
Common mistake. Choosing segmentation for the sake of 'more accuracy'. Boundary precision is almost never the system bottleneck; the bottleneck turns out to be inconsistent annotation guidelines and capture conditions.
Pro tip. Write one sentence of the form 'the system receives X, returns Y, after which Z happens' and show it to the client before you collect data. Roughly half of all projects change their statement on that sentence.

Cheat sheet

  • The task is defined once you have the input, the output and the action that follows.
  • Classification gives a label, detection boxes, segmentation pixels, comparison a vector.
  • The price of a formulation is measured in annotation minutes per image.
  • Different costs for a miss and a false alarm shape both the statement and the threshold.
1. What turns a client's wish into a computer vision task?
2. When does the 'compare vectors' formulation beat classification?
3. Which signal says boxes are enough and segmentation is not needed?

🔒 Answer the question correctly to move on to the next lesson.

What Question Are You Asking the Image — Computer vision with AI — Skilvy