All Projects β†’ mc2-project β†’ secure-xgboost

mc2-project / secure-xgboost

Licence: Apache-2.0 license
Secure collaborative training and inference for XGBoost.

Programming Languages

C++
36643 projects - #6 most used programming language
c
50402 projects - #5 most used programming language
python
139335 projects - #7 most used programming language
Cuda
1817 projects
CMake
9771 projects
java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to secure-xgboost

AutoTabular
Automatic machine learning for tabular data. ⚑πŸ”₯⚑
Stars: ✭ 51 (-36.25%)
Mutual labels:  xgboost
Quora question pairs NLP Kaggle
Quora Kaggle Competition : Natural Language Processing using word2vec embeddings, scikit-learn and xgboost for training
Stars: ✭ 17 (-78.75%)
Mutual labels:  xgboost
Automatic-Stock-Trading
Trading Algorithm by XGBoost
Stars: ✭ 58 (-27.5%)
Mutual labels:  xgboost
data-science-popular-algorithms
Data Science algorithms and topics that you must know. (Newly Designed) Recommender Systems, Decision Trees, K-Means, LDA, RFM-Segmentation, XGBoost in Python, R, and Scala.
Stars: ✭ 65 (-18.75%)
Mutual labels:  xgboost
handson-ml
λ„μ„œ "ν•Έμ¦ˆμ˜¨ λ¨Έμ‹ λŸ¬λ‹"의 μ˜ˆμ œμ™€ μ—°μŠ΅λ¬Έμ œλ₯Ό 담은 μ£Όν”Όν„° λ…ΈνŠΈλΆμž…λ‹ˆλ‹€.
Stars: ✭ 285 (+256.25%)
Mutual labels:  xgboost
stock-market-prediction-via-google-trends
Attempt to predict future stock prices based on Google Trends data.
Stars: ✭ 45 (-43.75%)
Mutual labels:  xgboost
MSDS696-Masters-Final-Project
Earthquake Prediction Challenge with LightGBM and XGBoost
Stars: ✭ 58 (-27.5%)
Mutual labels:  xgboost
aws-machine-learning-university-dte
Machine Learning University: Decision Trees and Ensemble Methods
Stars: ✭ 119 (+48.75%)
Mutual labels:  xgboost
datascienv
datascienv is package that helps you to setup your environment in single line of code with all dependency and it is also include pyforest that provide single line of import all required ml libraries
Stars: ✭ 53 (-33.75%)
Mutual labels:  xgboost
Awesome-SGX-Open-Source
A curated list of open-source projects that help exploit Intel SGX technology
Stars: ✭ 169 (+111.25%)
Mutual labels:  enclave
RobustTrees
[ICML 2019, 20 min long talk] Robust Decision Trees Against Adversarial Examples
Stars: ✭ 62 (-22.5%)
Mutual labels:  xgboost
inclavare-containers
A novel container runtime, aka confidential container, for cloud-native confidential computing and enclave runtime ecosystem.
Stars: ✭ 510 (+537.5%)
Mutual labels:  enclave
sgx-tutorial-space18
Tutorial: Uncovering and mitigating side-channel leakage in Intel SGX enclaves
Stars: ✭ 44 (-45%)
Mutual labels:  enclave
rust-xgboost
Rust bindings for XGBoost.
Stars: ✭ 77 (-3.75%)
Mutual labels:  xgboost
kserve
Serverless Inferencing on Kubernetes
Stars: ✭ 1,621 (+1926.25%)
Mutual labels:  xgboost
Kaggle
Kaggle Kernels (Python, R, Jupyter Notebooks)
Stars: ✭ 26 (-67.5%)
Mutual labels:  xgboost
kaspersky hackathon
https://events.kaspersky.com/hackathon/
Stars: ✭ 25 (-68.75%)
Mutual labels:  xgboost
recsys2019
The complete code and notebooks used for the ACM Recommender Systems Challenge 2019
Stars: ✭ 26 (-67.5%)
Mutual labels:  xgboost
Apartment-Interest-Prediction
Predict people interest in renting specific NYC apartments. The challenge combines structured data, geolocalization, time data, free text and images.
Stars: ✭ 17 (-78.75%)
Mutual labels:  xgboost
mloperator
Machine Learning Operator & Controller for Kubernetes
Stars: ✭ 85 (+6.25%)
Mutual labels:  xgboost

Secure XGBoost

Build Status Documentation Status Contributions welcome License Contributor Covenant

Secure XGBoost is a library that leverages secure enclaves and data-oblivious algorithms to enable the collaborative training of and inference using XGBoost models on encrypted data.

Data owners can use Secure XGBoost to train a model on a remote server, e.g., the cloud, without revealing the underlying data to the remote server. Collaborating data owners can use the library to jointly train a model on their collective data without exposing their individual data to each other. Alt Text

This project is currently under development as part of the broader MC2 effort (i.e., Multiparty Collaboration and Coopetition) by the UC Berkeley RISE Lab.

NOTE: The Secure XGBoost library is a research prototype, and has not yet received independent code review.

Table of Contents

Installation

The following instructions will create an environment from scratch. Note that Secure XGBoost has only been tested on Ubuntu 18.04, so we recommend that you install everything on Ubuntu 18.04.

Alternatively, you can use the provided Docker image if you want to run everything in simulation mode locally. If you use Docker, you'll need to clone Secure XGBoost locally and mount it to the container's /root/secure-xgboost/ directory using the -v flag when starting the container.

  1. Install the Open Enclave SDK (0.17.1) and the Intel SGX DCAP driver by following these instructions. In Step 3 of the instructions, install Open Enclave version 0.17.1 by specifying the version:

    sudo apt -y install clang-8 libssl-dev gdb libsgx-enclave-common libsgx-quote-ex libprotobuf10 libsgx-dcap-ql libsgx-dcap-ql-dev az-dcap-client open-enclave=0.17.1
    
  2. Configure the required environment variables.

    source /opt/openenclave/share/openenclave/openenclaverc
  3. Install CMake and other Secure XGBoost dependencies.

    wget https://github.com/Kitware/CMake/releases/download/v3.15.6/cmake-3.15.6-Linux-x86_64.sh
    sudo bash cmake-3.15.6-Linux-x86_64.sh --skip-license --prefix=/usr/local
    
    sudo apt-get install -y libmbedtls-dev python3-pip
    pip3 install numpy pandas sklearn numproto grpcio grpcio-tools requests
  4. Clone Secure XGBoost.

    git clone https://github.com/mc2-project/secure-xgboost.git
  5. Before building, you may choose to configure the build parameters in CMakeLists.txt, e.g., whether to perform training and inference obliviously. In particular, if running Secure XGBoost on a machine without enclave support, you'll have to set the SIMULATE parameter to ON.

  6. Build Secure XGBoost and install the Python package.

    cd secure-xgboost
    mkdir build
    
    cd build
    cmake ..
    make -j4
    
    cd ../python-package
    sudo python3 setup.py install

Usage

To use Secure XGBoost, replace the XGBoost import.

# import xgboost as xgb
import securexgboost as xgb

For ease of use, the Secure XGBoost API mirrors that of XGBoost as much as possible. While the below block demonstrates usage on a single machine, Secure XGBoost is meant for the client-server model of computation. More information can be found here.

Note: If running Secure XGBoost in simulation mode, pass in verify=False to the attest() function.

# Generate a key and use it to encrypt data
KEY_FILE = "key.txt"
xgb.generate_client_key(KEY_FILE)
xgb.encrypt_file("demo/data/agaricus.txt.train", "demo/data/train.enc", KEY_FILE)
xgb.encrypt_file("demo/data/agaricus.txt.test", "demo/data/test.enc", KEY_FILE)

# Initialize client and connect to enclave
xgb.init_client(user_name="user1",
				sym_key_file="key.txt",
				priv_key_file="config/user1.pem",
				cert_file="config/user1.crt")
xgb.init_server(enclave_image="build/enclave/xgboost_enclave.signed", client_list=["user1"])

# Remote attestation to authenticate enclave
# If running in simulation mode, pass in `verify=False` below
xgb.attest(verify=True)

# Load the encrypted data and associate it with your user
dtrain = xgb.DMatrix({"user1": "demo/data/train.enc"})
dtest = xgb.DMatrix({"user1": "demo/data/test.enc"})

params = {
	"objective": "binary:logistic",
	"gamma": "0.1",
	"max_depth": "3"
}

# Train a model 
num_rounds = 5
booster = xgb.train(params, dtrain, num_rounds)

# Get encrypted predictions and decrypt them
predictions, num_preds = booster.predict(dtest)

Documentation

For more background on enclaves and data-obliviousness, additional tutorials, and more details on build parameters and usage, please refer to the documentation.

Additional Resources

Getting Involved

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].