I have an electromagnetic sensor and electromagnetic field emitter. The sensor will read power from the emitter. I want to predict the position of the sensor using the reading.
Let me simplify the problem, suppose the sensor and the emitter are in 1 dimension world where there are only position X (not X,Y,Z) and the emitter emits power as a function of distance squared.
From the painted image below, you will see that the emitter is drawn as a circle and the sensor is drawn as a cross.
E.g. if the sensor is 5 meter away from the emitter, the reading you get on the sensor will be 5^2 = 25. So the correct position will be either 0 or 10, because the emitter is at position 5.
So, with one emitter, I cannot know the exact position of the sensor. I only know that there are 50% chance it's at 0, and 50% chance it's at 10.
So if I have two emitters like the following image:
I will get two readings. And I can know exactly where the sensor is. If the reading is 25 and 16, I know the sensor is at 10.
So from this fact, I want to use 2 emitters to locate the sensor.
Now that I've explained you the situation, my problems are like this:
- The emitter has a more complicated function of the distance. It's not just distance squared. And it also have noise. so I'm trying to model it using machine learning.
Some of the areas, the emitter don't work so well. E.g. if you are between 3 to 4 meters away, the emitter will always give you a fixed reading of 9 instead of going from 9 to 16.
When I train the machine learning model with 2 inputs, the prediction is very accurate. E.g. if the input is 25,36 and the output will be position 0. But it means that after training, I cannot move the emitters at all. If I move one of the emitters to be further apart, the prediction will be broken immediately because the reading will be something like 25,49 when the right emitter moves to the right 1 meter. And the prediction can be anything because the model has not seen this input pair before. And I cannot afford to train the model on all possible distance of the 2 emitters.
The emitters can be slightly not identical. The difference will be on the scale. E.g. one of the emitters can be giving 10% bigger reading. But you can ignore this problem for now.
My question is How do I make the model work when the emitters are allowed to move? Give me some ideas.
Some of my ideas:
- I think that I have to figure out the position of both emitters relative to each other dynamically. But after knowing the position of both emitters, how do I tell that to the model?
- I have tried training each emitter separately instead of pairing them as input. But that means there are many positions that cause conflict like when you get reading=25, the model will predict the average of 0 and 10 because both are valid position of reading=25. You might suggest training to predict distance instead of position, that's possible if there is no problem number 2. But because there is problem number 2, the prediction between 3 to 4 meters away will be wrong. The model will get input as 9, and the output will be the average distance 3.5 meters or somewhere between 3 to 4 meters.
- Use the model to predict position probability density function instead of predicting the position. E.g. when the reading is 9, the model should predict a uniform density function from 3 to 4 meters. And then you can combine the 2 density functions from the 2 readings somehow. But I think it's not going to be that accurate compared to modeling 2 emitters together because the density function can be quite complicated. We cannot assume normal distribution or even uniform distribution.
- Use some kind of optimizer to predict the position separately for each emitter based on the assumption that both predictions must be the same. If the predictions are not the same, the optimizer must try to move the predictions so that they are exactly at the same point. Maybe reinforcement learning where the actions are "move left", "move right", etc.
I told you my ideas so that it might evoke some ideas in you. Because this is already my best but it's not solving the issue elegantly yet.
So ideally, I would want the end-to-end model that are fed 2 readings, and give me position even when the emitters are moved. How would I go about that?
PS. The emitters are only allowed to move before usage. During usage or prediction, the model can assume that the emitter will not be moved anymore. This allows you to have time to run emitters position calibration algorithm before usage. Maybe this will be a helpful thing for you to know.