Skip to content

Code for "Revisiting Locally Differentially Private Protocols: Towards Better Trade-offs in Privacy, Utility, and Attack Resistance"

License

Notifications You must be signed in to change notification settings

hharcolezi/LDP_protocols_refined

Repository files navigation

Revisiting and Re-Optimizing LDP Protocols

This repository contains the implementation of the experiments and methodologies presented in the paper "Revisiting Locally Differentially Private Protocols: Towards Better Trade-offs in Privacy, Utility, and Attack Resistance".

The key contributions of this work include:

  • Multi-Objective Optimization Framework: A novel approach for refining LDP frequency estimation protocols.
  • Two-Objective Instantiation: Optimizing Attacker Success Rate (ASR) and Mean Squared Error (MSE) simultaneously.
  • Refined and Adaptive Protocols: Introducing four optimized variants—ASS, AUE, ALH, and ATHE.
  • Extensive Evaluation: Analytical and empirical comparisons of LDP protocols under different settings.

Repository Contents:

  • Full Version of the Paper: Access here or via Arxiv.
  • Codebase: All necessary scripts to reproduce the experiments and results from the paper.

Repository Structure

├── ldp_protocols/     # Custom implementations of LDP protocols
│   ├── alh.py         # Our Adaptive LH (ALH) 
│   ├── ass.py         # Our Adaptive SS (ASS)
│   ├── athe.py        # Our Adaptive THE (ATHE)
│   ├── aue.py         # Our Adaptive UE (AUE)
│   ├── grr.py         # Generalized Randomized Response (GRR)
│   ├── he.py          # Histogram Encoding (HE) protocols
│   ├── lh.py          # Local Hashing (LH) protocols
│   ├── ss.py          # Subset Selection (SS)
│   ├── ue.py          # Unary Encoding (UE) protocols
├── results/           # Output from our experiments
├── config_experiments.py		   # Pre-defined settings for experiments
├── LDP_MSE_ASR.ipynb  # Jupyter Notebook to reproduce experiments in the paper
├── requirements.txt   # Required Python libraries
├── LICENSE            # License for the repository
└── README.md          # This file

Installation

To run the code in this repository, ensure you have Python installed (version >= 3.8). Install the necessary dependencies by running:

pip install -r requirements.txt

Usage

1 - Explore the Experiments:

  • Navigate to the Jupyter notebook LDP_MSE_ASR.ipynb to review and execute the experiments. Figures used in the paper can be generated by running the notebook. Results will be saved in the results folder.

  • The config_experiments.py file contains pre-defined settings for experiments, including domain sizes, privacy regimes, and detailed scenarios for analysis (e.g., high-privacy small domains vs. low-privacy large domains).

2 - Run Custom Protocols: The ldp_protocols folder contains modular implementations of the LDP protocols. Import them into your Python scripts or Jupyter notebooks as needed. For example:

from ldp_protocols.aue import AdaptiveUnaryEncoding

k = 10  # Domain size
epsilon = 4  # Privacy budget
input_data = 3  # User's true value

# Test Adaptive Unary Encoding
aue = AdaptiveUnaryEncoding(k, epsilon, w_asr=0.5, w_variance=0.5)
print("AUE Obfuscate:", aue.obfuscate(input_data))
print("AUE ASR:", aue.get_asr())
print("AUE Variance:", aue.get_variance(), "\n")

Contact

For any question, please contact Héber H. Arcolezi: heber.hwang-arcolezi [at] inria.fr

License

This repository is licensed under the MIT License. See LICENSE for details.

About

Code for "Revisiting Locally Differentially Private Protocols: Towards Better Trade-offs in Privacy, Utility, and Attack Resistance"

Resources

License

Stars

Watchers

Forks

Languages