Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MVP Matching Algorithm (individual reporting) #24

Closed
ainsleys opened this issue Mar 27, 2020 · 11 comments
Closed

MVP Matching Algorithm (individual reporting) #24

ainsleys opened this issue Mar 27, 2020 · 11 comments
Assignees

Comments

@ainsleys
Copy link
Contributor

ainsleys commented Mar 27, 2020

Drawing on this issue: #17

The MVP matching algorithm is Rust code that runs inside the enclave, takes inputs of userID, infectionStatus, latitude, longitude, time, and duration.

The code compares latitude and longitude between submitted user data and all user data which has been submitted and has a positive test result to find matches within 4m and 24hours (subject to change).

For each match in time and proximity with an individual who has tested positive, the algorithm returns latitude, longitude, date, and duration (duration from both submitting user and positive match users user "matched" with).

Other elements mentioned in #17 are out of scope for the MVP

@ainsleys ainsleys assigned ainsleys and lacabra and unassigned ainsleys Mar 27, 2020
@ainsleys
Copy link
Contributor Author

@lacabra when you have a moment can you make sure these requirements are in line with what you've been anticipating / add any additional detail that could be useful? This is for an MVP and does not have all features included that we've discussed previously.

@FishmanL
Copy link

Why return the lat,long of a match rather than just the existence?

@ainsleys
Copy link
Contributor Author

@FishmanL that way the front end can query google to find a likely placename. The thinking was people can then know where they were exposed and assess the risk (i.e., oh, that was a grocery store vs. oh, that was a park). It does expose additional data.

@cankisagun cankisagun changed the title MVP Matching Algorithm MVP Matching Algorithm (individual reporting) Mar 30, 2020
@cankisagun
Copy link
Contributor

@lacabra @ainsleys from the epidemiology feedback issue, we can potentially change the match criteria to 2 meters and location overlap of any period of time.

We can also leave this out of MVP scope. I detailed this further in issue #33

@ainsleys
Copy link
Contributor Author

ainsleys commented Apr 1, 2020

Amazing effort from @lacabra and we now have this working within the enclave. Documentation coming soon!

via @lacabra:

curl -H "Content-Type: application/json" -d '{"jsonrpc": "2.0", "id":1, "method":"getEnclaveReport", "params": {}}' https://safetrace.enigma.co
and you will get the report in response

@FishmanL
Copy link

FishmanL commented Apr 1, 2020

All you need to make this initial-DP is to change line 252 of data.rs to subtract 2*abs(lap(0.87)), using (https://docs.rs/GSL/0.4.25/rgsl/randist/laplace/fn.laplace.html), it's a simple change that has real privacy benefits

@lacabra
Copy link
Contributor

lacabra commented Apr 1, 2020

Thanks @FishmanL. Can you please document the reasoning behind the 2 constants: 2 and 0.87?

@FishmanL
Copy link

FishmanL commented Apr 1, 2020

Sure -- 0.87 is based on finding the 80% sensitivity of adding an additional random person with covid to the minimum across all people (assuming people are distributed uniformly with at least 10 people with covid per 10000 meters and the max distance we care about is 100 meters, using the order statistics formulae for the uniform to get that 0.87), and the 2 is because, to avoid false negatives, i'm using the absolute value of the laplace instead of the laplace (I'm not sure you need it to actually be twice as far on the tail bounds, but this is overly conservative anyway, so)

@FishmanL
Copy link

FishmanL commented Apr 1, 2020

(the relevant math is 2/(M+1)*(1-x/N)^(M+1) is the tail bound on x, where N is the max distance we care about and M is person density)

@cankisagun
Copy link
Contributor

cankisagun commented Apr 2, 2020

@FishmanL I invite you to open a PR and propose this code in Rust. We can review and merge it. At this point we do not have the bandwidth to add DP to the MVP matching algorithm

@cankisagun
Copy link
Contributor

cankisagun commented Apr 9, 2020

Closing the issue as it's finished
For @FishmanL Differential privacy PR see #43

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants