Huelse / SEAL-Python

Microsoft SEAL 4.X For Python
MIT License
308 stars 66 forks source link

Logistic Regression over Encrypted Data with BFV Scheme #119

Open huyvu1404 opened 1 month ago

huyvu1404 commented 1 month ago

I am building a Logistic Regression model based on this paper using BFV scheme : https://eprint.iacr.org/2018/462.pdf However, I could not complete it, because of its floating point number in approximate sigmoid function and learning rate. I've read suggestion of author to use bscale function that is combined in bootstrap and scale. I hope you help me to explain explicit this function. I honestly thanks for your help. image

Huelse commented 4 weeks ago

Sorry for reply late, you can approximate the sigmoid function with a polynomial within a limited range. Here is an example.

huyvu1404 commented 4 weeks ago

Sorry for reply late, you can approximate the sigmoid function with a polynomial within a limited range. Here is an example.

I've referred that example. However, the author only used CKKS. One solution I read about is to scale the real numbers into integers by multiply them with scale factor p and then scale them back down to the original values, but I am having difficulty with the scaling down part

Huelse commented 4 weeks ago

You may need re-encrypt it, there is no bootstrapping in the SEAL.

huyvu1404 commented 4 weeks ago

You may need re-encrypt it, there is no bootstrapping in the SEAL.

Thannks for your help.

huyvu1404 commented 4 weeks ago

You may need re-encrypt it, there is no bootstrapping in the SEAL.

If there is no bootstrapping, Is there a way to refresh noise? I have tried mod switch but it is not very feasible

Huelse commented 4 weeks ago
  1. enlarge the poly modulus degree
  2. decrypt in a safe client and re-encrypt to continue evaluate