This repository demonstrates a simple example of securing a machine learning model using homomorphic encryption.
- The example involves training a basic machine learning model for predicting outcomes, and then integrating homomorphic encryption to make predictions on encrypted data.
-
Run the Training Script:
- Navigate to the
src
directory. - Execute
python train_ml_model.py
to train a simple machine learning model.
- Navigate to the
-
Load the Trained Model:
- Load your own trained machine learning model.
- Modify
encrypt_predict.py
accordingly, replacing the placeholdermodel = None
with your loaded model.
-
Run the Homomorphic Encryption Script:
- Execute
python encrypt_predict.py
to make predictions on encrypted data using homomorphic encryption.
- Execute
Adjust the code as needed for your specific model and data. The folder structure and dependencies are provided for easy setup.
homomorphic_ml_example/
|-- src/
| |-- train_ml_model.py
| |-- encrypt_predict.py
|-- requirements.txt