# Which model should I use to find (only) the object location (in terms of coordinates) in an image?

I am generating images that consist of points, where the object's location is where the most overlap of points occurs.

In this example, the object location is $$(25, 51)$$.

I am trying to train a model to just finds the location, so I don't care about the classification of the object. Additionally, the shape of the overlapping points where the object is located never changes and will always be that shape.

What is a good model for this objective?

Many of the potential models I've been looking at (CNN, YOLO, and R-CNN) are more concerned with classification than location. Should I search the image for the overlapping dots, create a bound box around them, then retrieve the boxes' coordinates?

• Is this related to Numenta's work in any way? I've already seen such picture in that context.
– nbro
Feb 20, 2019 at 18:22
• @nbro yes, this is based off their grid cells work Feb 21, 2019 at 20:13

What is a good model for this objective?

I will try to give another perspective: Solve it without machine learning model

Your problem is try to find the most overlapping point. If the image above is image that you used in your case, you can solve it directly by applying some computer vision algorithms.

1. Try to create some binary image based on the color of the dots. if you are not sure with the available colors on your image, you can list of pixel colors that not black and white uniquely at first. So if there are four colors you need to generate four different binary image. Create a simple condition or a complex one, for example:

if pixel[i,j]=red then
pixel[i,j]=white
else
pixel[i,j]=black

2. Get its location by searching "the white" over your image or use blob detection method (it'll be a little bit tricky if the actual image always have different axis scale). You can save it as a list of coordinate of each color.

3. What happen if you can't see the dot fully because it's overlapping with another dot? Find the pattern. In your image, dots appear with certain pattern. If you can find two consecutive dots horizontally and vertically, you can predict the position of all your dots.
4. Find the most overlapping position from your list.

Pros

• The result may more accurate than using machine learning model
• Faster, you don't need to train it first

Cons

• Finding dot's location in image with different axis will be difficult, but it's still solvable
• It'll be difficult to predict the pattern if many dots are missing because overlapped by other dots

Neural networks are not only used for classification but also for regression. It seems that a CNN would be a good solution for this problem with 2 output neurons each of them providing a number within the range of your frame.