Too many ML tools to choose from!

2 min readMar 10, 2025

🛒With so many ML models and algorithms floating in the market, the line gets blurry when it is time to decide which model or approach to leverage while solving a business problem and this is where Problem Decomposition really helps.

🧮Let us take a use case of a simple problem of counting objects in an image. Since, we are dealing with an output which can be continuous in a nature, instinct of a naive developer or ML engineer would be do interpret it as a regression problem, which can be solved by a CNN.

🕵️However, if one is aware of the nuances of the algorithm within CNN, it might save the developer some reputation and the project some valuable cost and time.

🔎Lets go deeper:
The CNN processes the image through layers (convolutional layers, pooling layers, fully connected layers) to extract features. However, Pooling layers (e.g., max pooling) reduce the spatial dimensions of feature maps to make the model computationally efficient and less prone to overfitting. This reduction discards precise positional information about objects, which is critical for counting tasks. For example, if two objects are close together, pooling might blur them into one, leading to an undercount.

🕵️So what do we deduce?
Traditional CNNs are optimized for tasks like image classification, where the goal is to identify “what” is in the image, not “how many.”

〽️Alternative approach:
A smart approach can be to use an object detection model (like YOLO (You Only Look Once), Faster R-CNN, or SSD) to identify and locate individual objects in the image (e.g., draw bounding boxes around them) and apply a deterministic algorithm (e.g., contour detection) to count the detected objects.

🗝️Key Difference:
Object detection models are designed to locate and identify objects, so they have an inductive bias toward preserving spatial information and thus generalizes better than CNN.

⚔️They say a warrior’s strength is not measured by his sword, but by his spirit. In my understanding, spirit is of no use if warrior does not know his sword!

--

--

Reeshabh Choudhary
Reeshabh Choudhary

Written by Reeshabh Choudhary

Software Architect and Developer | Author : Objects, Data & AI.

No responses yet