egaebel / lgtm

The code for my thesis project, Looks Good to Me (LGTM), Authentication for Augmented Reality. This is a full implementation of LGTM that localizes a wireless transmitter, and searches for a specific face at that location to authenticate two users trying to establish secure point to point communication.
57 stars 58 forks source link

The problem about likelihood #1

Closed snowyy2019 closed 8 years ago

snowyy2019 commented 8 years ago

@egaebel I found the likelihood is negative by using your code. i don't know the reason. Besides, Why you use SVM to train the likelihood weights. Can you explain the two problem in detail? Thank you!

egaebel commented 8 years ago

If you look at the likelihood you'll see that the weighted aoa variance, weighed tof variance, and weighed tof mean are all subtracted from the weighed number of points in each cluster. So the likelihood can easily become negative.

I used an SVM because it's a quick way to learn weights from labeled data. It's unclear how the spotfi authors determined the weights. There's probably better ways to do it, but an SVM was the quickest and it worked well enough.

snowyy2019 commented 8 years ago

@egaebel Thank you! I have another problem, when i use the file '1m-0-degrees--laptop-1--test-1.dat', i will get aoa by using aoa_tof_music, but the result is not 0 degrees, and have very big difference, I have tried serval files,contains '1m-20-degrees--laptop-2--test-10.dat' , and it will get the similar result. I hope you can answer my doubts.Thank you in advance.

egaebel commented 8 years ago

First, it's important to realize that my implementation of SpotFi here is limited. It is only running from a single access point, not 3-5 like in the SpotFi paper. So accuracy will be significantly diminished. On top of this, perfect accuracy is not guaranteed in SpotFi to begin with. That is why there are so may .dat files, so that I could identify my accuracy rate. Within 1m the best results I got were around a 60% accuracy rate. It gets worse as you go out further. I achieved this by only taking 10 packets sampled uniformly from the full packet stream, which is just over 1000 packets total.

If you would like to adapt my code to implement the full version of SpotFi that would be great. To do so you would only need to run my code on 3+ access points and then fuse the results together using the optimization technique presented in the SpotFi paper.

snowyy2019 commented 8 years ago

@egaebel the optimization technique is objective function? I think the aoa is irrelevant to the number of AP, and i think the spotfi use 3-5 AP in order to get the accuracy position ,not aoa, the aoa from many APs mainly used in objective function for localization.

egaebel commented 8 years ago

obj-9-spotfi

This is the objective function used by R access points. As you can see, it includes RSSI and AoA.

I do not utilize this objective function in my code because my application required me to use only 1 access point, which would not make this function very useful.

I suggest you re-read the SpotFi paper. It must have taken me a dozen readings to fully understand everything.

snowyy2019 commented 8 years ago

@egaebel Thank you very much! i know the objective function use R APs, but i think it should be bulit on the correct aoa, i will re-read spotfi paper, Thank you again!

I have some problems about spotfi. First, I know you use a linear SVM to calculate the likelihood weigths. According to paper, the weight of tof variance should be positive, but the result in your code is negative, can you explain it? Second, how you get the trained data in learn_localization_weights function? what are the 'prep_Y' represent? Third, I found a passage from the spotfi paper, it be showed in the following picture. can you explain the passage? I think it is relate to the weigths. Four,I want know how to define aoa, how to express aoa by using the coordinate of ap and target?

Thank you! image

egaebel commented 8 years ago

@shaozhuchuang

  1. The weighted values of tof variance, tof mean, and aoa variance are all subtracted from the weighted number of points in the cluster. So they end up being negative because of the subtraction.
  2. I collected the data from a transmitter placed at various positions in a room and measured the true value. Then I looked at the clusters and figured out which cluster should be chosen. 'prep_Y' is pairs of correct values for ToF and AoA, in that order.
  3. The aoa variance, tof variance, tof mean, and number of points per cluster are not numbers that lie close to one another. ToF variance is at the nanosecond scale, number of points is obviously from 1->some large integer, tof mean is also at the nanosecond scale, and angle of arrival is an integer as well. That's what that passage means.
  4. What do you mean you don't know how to define aoa? AoA stands for angle of arrival. It is the angle at which the signal arrives at the antenna array. The angle the sender is at relative to the antenna array. Angle of arrival techniques are very popular localization techniques, I would recommend you do a lot more reading to understand how they work.

This is a good starting place: https://en.wikipedia.org/wiki/MUSIC_(algorithm)

snowyy2019 commented 8 years ago

@egaebel Thank you very much! I have read some materials about music, i can understand the music algorithm. but i can't get accuracy aoa by using your code and the data i collect. i want know if you can get accuracy aoa? Thank you!

egaebel commented 8 years ago

You need more access points to get full SpotFi accuracy. That is all. Like I said, I get 60% accuracy. I may be able to get it even better with more tuning, but it is not going to be perfect under such hardware constraints.

snowyy2019 commented 8 years ago

@egaebel Thank you!