# Setting "missing" distance values to zero when training a neural network

Not sure if missing values is the right name to use here. I want to train a DNN on data given by a sensor. The sensor gives the (x,y) coordinates of the founded objects. The sensor can keep track of up to 32 objects at once. If the sensor can't find 32 objects (which is always the case) it sets the x and y coordinates of the objects not found to zero. Could there be a problem training a neural network on this kind of data? The sensor is set on a car, the objects are other cars and the networks job is to predict the next move.

Another problem is that when the sensor finds a new object, already existing/found object might change id. Any tips on that? I am thinking about making randomly permute the indices of the object since that should not make any difference?

Are there any standard solutions to these kind of problems? Especially Setting the distance of non existing objects to zero.

• Is distance the only feature you have? Or for each object, there are other features like cardinal direction?
– Mo-
Mar 19, 2018 at 12:40
• @moh Each object will have both x and y coordinates which together would give the exact relative position. Not only the distance. Mar 19, 2018 at 13:21
• So, these zeros are not missing values. They're basically useful information. A missing is when there is an object but your sensor is not able to find its position or distance and you will try to estimate it. I think there is no problem to use them during the training phase.
– Mo-
Mar 19, 2018 at 13:40

The short answer is "it depends"

Is zero better than one or infinity? It depends on the range of x-y coordinates that you use. It also depends on your output. If you go from (x,y) to something like z = x^2, then you're placing your "null" at a local minimum. So, if it's a car, I'm assuming you're using a forward-facing camera. Do you really want your algorithm to see a bunch of "cars" bunched up at the origin? By the way, where is your origin? Upper left (like most image indexing)? Lower left (like a cartesian plane)? Center (if so, what direction is positive x and y?)

As for re indexing, what you can do is look at the previous frame (or frames) where your 32 objects are indexed, along with their position and velocity. Then, look at the current frame and compare each object's position to the positions in the previous frame. Assign the objects in the current frame the same id as the object nearest it in the previous frame. You can break ties with velocity.