Submitted by give_me_the_truth t3_yni223 in MachineLearning

Suppose if we are detecting and localizing 2 objects in an image, are there any ways where we can force network to localize object detection such that object1_coordinates < object2_coordinates? We can discard outputs if they dont adhere to the order but this will only throw away the outputs rather than the localize the objects constraining to the condition

2

Comments

You must log in or register to comment.

seiqooq t1_iv92syq wrote

What exactly is meant by “<“?

1

give_me_the_truth OP t1_iv930k9 wrote

it could mean predicted coordinates have condition: object1_x < object2_x and object2_y < object2_y i.e., both x and y coordinates of object1 < both x and y coordinates of object2

1

fnbr t1_iv9iag6 wrote

Why force the network to do this instead of just sorting the predictions afterward?

3

give_me_the_truth OP t1_iv9kyup wrote

It is like I know beforehand that object1 will always be on the left of object2. If network predicts object2 to left of object1 then I have to discard those predictions and I know it is incorrect. If I incorporate this constraint then I can get predictions that I am looking for.

3

Relevant-Number7428 t1_iv9mtl5 wrote

A possible solution would be to add a large penalty term to your loss function based on this constraint. While this does not guarantee that the predictions will satisfy the constraint over many training iteration fewer predictions will break it as the loss is minimized.

2

Mattesekiro t1_iv9zjkt wrote

I am still not sure why you don't solve it in post processing, but one alternative way would be to make two different predictions. The first gives the location of object 1, the second provides the distance/angle to object 2.

2

cmilkau t1_ivba811 wrote

History shows that it is usually better to keep learning as simple as possible and not force the NN to learn the way you think it would be best. If you want the NN to recognize two objects, better don't waste time training it to check their spatial relationship, or something else that isn't what you're looking for (even though related).

Just check whether object 1 is reported as object 1 and object 2 is reported as object 2. This can be two separate losses you add. Don't worry about whether the actually reported objects are left or right from each other, just check whether they are in the right place each for themselves.

0

give_me_the_truth OP t1_ivdfyec wrote

>History shows that it is usually better to keep learning as simple as possible and not force the NN to learn the way you think it would be best.

Got it. Any references you have off the top of your head?

1