project screenshot 1
project screenshot 2
project screenshot 3

MediGuard

MediGuard Protocol revolutionizes healthcare by enabling privacy-preserving AI predictions on encrypted medical data using on-chain computation. Powered by Fhenix’s Fully Homomorphic Encryption (FHE), it ensures data security without revealing sensitive information

MediGuard

Created At

ETHOnline 2024

Project Description

The MediGuard Protocol is a privacy-preserving AI prediction platform designed to revolutionize how medical data is processed in machine learning models. The goal is to securely handle sensitive medical data while enabling institutions to perform predictions without revealing or compromising patient privacy.

Medical institutions rely on machine learning for predictive insights into patient outcomes, but traditionally, running models on large datasets poses a serious privacy risk. Patients' medical records contain highly sensitive data, and disclosing them—especially to cloud-based machine learning systems—introduces the risk of data breaches or misuse. MediGuard Protocol addresses this issue by keeping the data encrypted at every stage of processing and providing AI predictions on-chain via a smart contract.

In essence, the protocol allows medical institutions to:

Run AI models on encrypted data: The institution's data is encrypted at the source (within the user’s browser), preventing exposure of any raw medical data. Receive predictions securely: The prediction itself is also encrypted and returned to the institution, which can decrypt it with its own private key. Leverage on-chain computation: Using FHE (Fully Homomorphic Encryption) through Fhenix’s smart contracts, we are able to compute on encrypted data directly without ever needing to decrypt it. Key Features:

End-to-end encryption: From data input, encryption, on-chain computation, to prediction output, the data remains private. Account abstraction: Simplifies the login process for non-technical medical staff, making it easy for institutions to interact with the platform. Smart contract computation: The encrypted data is sent to a smart contract that runs an AI model (for example, a regression model to predict diabetes) and returns the encrypted prediction. The example i developed focuses on predicting diabetes risk using patient inputs like age, BMI, and glucose level. These inputs are encrypted locally using the public address of the medical institution and sent to the Fhenix Helium Testnet network where the prediction happens securely using a regression model deployed as a smart contract. The result is sent back in an encrypted format, and only the medical institution can decrypt it.

The MediGuard Protocol is not just limited to diabetes predictions—it can be expanded to accommodate other models and predictions, creating a new paradigm for privacy-preserving healthcare AI.

How it's Made

MediGuard Protocol is built using React for the frontend and ethers.js. The main focus is on ensuring the privacy of medical data while performing computations on-chain. The protocol is deployed on the Fhenix Helium Testnet, using the smart contract fhe.sol to enable fully homomorphic encryption (FHE) for secure and privacy-preserving on-chain predictions.

In the frontend, React handles the user interface where medical institutions can easily input data. When medical data, such as age, weight, or glucose levels, is entered, it is encrypted locally using the user's private key. This ensures that the data remains secure and is never exposed in plaintext, either during transit or on the blockchain.

The encrypted data is then sent to the smart contract, which is responsible for performing the machine learning model computations. For this project, we used a logistic regression model as a sample use case for predicting diabetes risk. The encrypted parameters are passed to the smart contract, which computes the prediction on-chain using FHE and returns the result in encrypted form.

The system is designed to work with any machine learning model in the future, allowing flexibility for different types of medical predictions. The Diabetes Prediction use case is just an example, and the protocol will be extended to support more complex models and computations as we continue development.

This approach shows how privacy-preserving machine learning computations can be done securely on-chain using homomorphic encryption, solving the problem of sharing sensitive medical data while leveraging blockchain technology.

background image mobile

Join the mailing list

Get the latest news and updates