1

New to NN's. A CNN can be trained to detect a single object in an image. However, what if any image in a dataset could contain any n # of objects. Does this not pose a problem to CNNs as the output dense layer has to be a fixed size? How would you solve this problem?

For example: Let's say I randomly sampled 2 images from this set. Image 1 has 2 objects and image 2 has 5 objects. The y label for img1 would contain the bounding box coordinates for 2 objects; the y label for img2 would contain coordinates for 5 objects -- much larger y vector than img1.

A possible solution? :

I would need to find the image with the largest # of objects (designate this value as M). Let's also say an object has 4 coordinates. If M = 5, I would need a y vector of 20. If an image has 1 object, the y vector would contain 4 non-zero values AND 16 zero values. The 4 non-zero values would represent the coordinates and the 16 zero values would represent the coordinates of the other non-existent objects.

1 Answer 1

1

The basic way of doing multiple object classification is using segmentation. This is done by segmenting the input image to several sub-areas and feed each area to the neural network.

However, this is a very basic method and there are now many advanced algorithms that do segmentation automatically.

Generally, multiple object classification is tackled in two steps: First a region proposal algorithm to guess which parts of the image contains the object.

The second is an algorithm to classify the proposed regions.

enter image description here

img source

Sign up to request clarification or add additional context in comments.

1 Comment

Something like the Faster R-CNN performs segmentation by using RPN to extract features it deems relevant? Is my understanding of this correct? Furthermore, what would the y vector look like given that there are variable prediction labels for images.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.