vamshi257/fhe-bio-age-estimator
0
FHE-Based Biological Age and Aging Pace Estimator
This repository implements a privacy-preserving biological age and aging pace estimator using Zama's Concrete ML Fully Homomorphic Encryption (FHE) library.
- All computations on sensitive data are performed encrypted (FHE).
- Model is demonstrated on real methylation data (GSE40279).
- Client/server demo is ready for local use and Hugging Face Spaces deployment.
How It Works
- Model: A LinearRegression model is trained on real methylation data (5 CpGs) to predict biological age.
- FHE: The model is compiled for FHE inference using Concrete ML.
- Client/Server: Client encrypts input, server predicts on encrypted data, client decrypts result.
- Demo: Deployable to Hugging Face Spaces or can be run locally.
Usage
🚀 Try the Demo
- Enter 5 methylation values (between 0 and 1) in the input fields.
- Click Submit to get your encrypted biological age prediction.
- All data is processed using Fully Homomorphic Encryption (FHE) – your inputs remain private!
<details> <summary><b>Advanced: Local Training & Development</b></summary>
- Install dependencies:
pip install -r requirements.txtInstall ZAMA Concrete ML Library
Concrete ML can be installed via pip on Linux and macOS (Intel or Apple Silicon). Note: Windows users should use WSL or Docker (see Zama docs).
pip install concrete-mlIf you encounter installation issues (e.g., unsupported CPU or AVX2 limitations), refer to:
Docker Alternative
If you prefer Docker or are on Windows, you can use the official Docker image:
docker pull zamafhe/concrete-ml:latestSee official Docker instructions for more details.
For more help, see the Concrete ML documentation or Zama’s GitHub.```
- Train model:
python src/train.py- Run client/server demo:
python src/app/server.py
python src/app/client.pyTry sample input from data/bio_age_demo_data.csv(5 methylation values, 0–1 scale)
FHE Biological Age Estimation Report
1. Data Pipeline
- Source: GSE40279 (656 blood samples)
- CpGs: ELOVL2 (cg16867657), KLF14, TRIM59, FHL2, CCDC102B
- Age range: 62-89 years
2. Model Architecture
- Type: LinearRegression (FHE-compatible)
- Quantization: 8-bit weights/activations
- FHE Params: perror=0.03, globalp_error=0.01
3. Performance
All metrics measured on local machine (Intel CPU with AVX2 support) using Concrete-ML 1.9.0.
🚦 Performance Benchmarks
4. Security
- Key size: 128-bit
- Cryptographic parameters: TFHE shortint
5. Deployment
- Local demo: See Usage above.
- Hugging Face Spaces: [Instructions for it are "Coming soon"]
