Inspiration
Malaria remains a leading cause of fatalities in Africa, often contributed to by limited healthcare access in remote regions and a shortage of trained medical personnel. This reality inspired me to develop a federated learning system powered by blockchain — ensuring patient data privacy while enabling AI-driven malaria detection on low resource edge devices for timely diagnosis and intervention.
What it does
The MalCare project allows medical personnel to upload a blood smear images to the platform, where a trained machine learning model analyzes the image and predicts whether the sample indicates malaria infection or not. Additionally, the new model weights generated from unseen data are aggregated and securely stored in a central repository, ensuring integrity and protection against manipulation.
Who it's for
MalCare is designed for medical personnel and malaria researchers seeking better ways to reduce malaria fatalities. Healthcare workers can use it for early malaria detection and to speed up diagnosis in understaffed hospitals, improving patient care where resources are limited.
How it works
Users upload blood cell images, and the AI model analyzes them to predict the presence of malaria parasites — providing a result along with a confidence score.
Why it matters
With no widely available vaccine, malaria remains deadly without timely detection. MalCare helps tackle this by enabling early, AI-assisted diagnosis while ensuring patient data privacy through federated learning.
How we built it
MalCare combines Federated Learning with blockchain-backed aggregation on the Internet Computer (ICP).
- We trained a malaria image classification model using TensorFlow, leveraging pre-trained architectures fine-tuned on the NIH malaria dataset.
- For the federated setup, client devices perform local inference or training, with model updates aggregated via an ICP canister.
- The heap memory is used for runtime operations, ensuring no sensitive data is persistently stored.
- The stable memory in ICP securely holds aggregated model weights, acting as a tamper-proof ledger for global model updates.
- The frontend was built with React, interacting directly with the canister backend over HTTP using DFINITY’s AgentJS library.
This setup ensures both data privacy and model integrity, powered by blockchain transparency.
Challenges we ran into
Uploading Model Weights to Smart Contracts: Uploading the .safetensors model files to ICP canisters was challenging due to storage constraints and chunked upload requirements. I had to leverage use of a custom rust library to upload the chunked model ensuring memory management to make it work reliably.
Finding Rust Crates Compatible with ICP: The Rust ecosystem for the Internet Computer has strict constraints—especially around no_std requirement and Wasm compatibility. I had to thoroughly research, test, and sometimes modify existing crates through dependencies to integrate machine learning inference with ICP smart contracts.
Data sourcing Accessing well-labeled open-source datasets that capture the different life stages of malaria parasites is challenging. Such datasets are crucial for training models that not only detect malaria but also classify the specific life stage of the parasite — a feature that could enhance diagnosis and treatment planning.
Accomplishments that we're proud of
Seamless Model Upload to the canister: Successfully managed to upload and store trained model weights on the ICP smart contract, overcoming memory and upload limitations challenges common with Blockchain.
Implementation of Federated Averaging (FedAvg): Successfully implementation of the FedAvg algorithm to power decentralized model training — enabling users to contribute to model improvement without sharing sensitive data. This ensures continuous learning while preserving user privacy, a critical step toward responsible AI deployment.
On-Chain Model Deployment and Inference: Successfully Deployed our AI model directly on-chain, enabling real-time inference through smart contract interfaces. This bridges AI with blockchain in a way that supports trustless, decentralized intelligence — making advanced AI accessible even on low-resource devices, without relying on external servers.
What we learned
Learned how powerful federated learning can be when it comes to protecting user data(especially patient data) while still improving AI models.
Learned how to deploy AI models so they can make predictions right from our backend, using Rust and JavaScript.
Most importantly, I saw how combining AI with blockchain can open up new ways of building secure and trustworthy applications.
What's next for MalCare
Reward System — We plan to introduce a reward system for users who help improve the model by contributing data through the platform.
Federated Learning Chatbot — We want to build a chatbot that explains how federated learning works and why it matters for data privacy.
Malaria Stage Tracking Model — In the future, we aim to train a model that can track the stages of malaria infection, not just detect it, and deploy it alongside our current detection system.
Log in or sign up for Devpost to join the conversation.