Blog - Image recognition — from pixels to a decision
How image classification and detection work: features, CNNs, softmax, and decision thresholds in production.
- Author
- 2code
- Published
- Tags
- CV
- AI
- image recognition
Image recognition is not “magic AI” — it is a pipeline: representation → features → model → decision. Here is what actually happens under the hood.
From image to vector
An RGB image is a tensor . A CNN builds feature maps . A classifier then outputs logits for classes.
Probabilities come from softmax:
The naive decision is , but production systems usually apply a threshold : accept only if .
Pipeline
…
Detection vs classification
- Classification — one image → one label.
- Detection — object localization (bbox + class), e.g. YOLO / DETR.
- Segmentation — pixel masks (semantic or instance).
For detection, mAP depends on an IoU threshold such as :
Common pitfalls
- Domain shift — studio-trained models fail on factory floors.
- Calibration — high is not true confidence; measure ECE.
- Error cost — false positives ≠ false negatives; tune for the business, not for accuracy alone.
Takeaway
Good image recognition is mostly a data-quality + decision-threshold contract, and only then a network architecture.