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

Code for the Location Heatmaps paper. #47

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
26 changes: 23 additions & 3 deletions analytics/location_heatmaps/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,24 @@
# Location Heatmaps
# Towards Sparse Federated Analytics: Location Heatmaps under Distributed Differential Privacy with Secure Aggregation

This directory contains work-in-progress code to experiment with differential
privacy on location heatmaps.
This directory contains code to experiment with differential
privacy on location heatmaps and based on [this paper](https://arxiv.org/abs/2111.02356).
Here is the example of the algorithm running on NYC location map from
[NYTimes](https://www.nytimes.com/2018/12/14/reader-center/phone-data-location-investigation.html):

![Alt Text](animation.gif)

To experiment with the code there is a working [notebook](dp_location_heatmaps.ipynb)
with all the examples from the paper, please don't hesitate to contact the
[author](mailto:eugene@cs.cornell.edu) or raise an issue.

For citation:
```
@misc{bagdasaryan2021sparse,
title={Towards Sparse Federated Analytics: Location Heatmaps under Distributed Differential Privacy with Secure Aggregation},
author={Eugene Bagdasaryan and Peter Kairouz and Stefan Mellem and Adrià Gascón and Kallista Bonawitz and Deborah Estrin and Marco Gruteser},
year={2021},
eprint={2111.02356},
archivePrefix={arXiv},
primaryClass={cs.CR}
}
```
Binary file added analytics/location_heatmaps/animation.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 31 additions & 0 deletions analytics/location_heatmaps/config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
from dataclasses import dataclass
from typing import List, Any
import numpy as np
TOPK = 1000
TOTAL_SIZE = 1024


@dataclass
class Config:
dataset: List
image: Any
level_sample_size: int = 10000
secagg_round_size: int = 10000
split_threshold: float = 0
collapse_threshold: float = None
eps_func: Any = lambda x, y: 1
total_epsilon_budget: float = None
top_k: int = TOPK
partial:int = 100
max_levels: int = 10
split_threshold_func: Any = None
collapse_func: Any = None
total_size: int = TOTAL_SIZE
min_dp_size: int = None
dropout_rate: int = None
output_flag: int = True
quantize: bool = None
noise_class: Any = None
save_gif: bool = False
aux_data: bool = False
start_with_level: int = 0
17,376 changes: 17,376 additions & 0 deletions analytics/location_heatmaps/dp_location_heatmaps.ipynb

Large diffs are not rendered by default.

Loading