Inspiration
Malaria is a common and life-threatening disease in many tropical regions, especially in Africa. Malaria deaths in Africa account for more than 94% of total deaths worldwide. Traditionally, it is diagnosed by trained medical professionals who examine blood samples under a microscope to look for signs of the malaria parasite. However, in many rural and remote areas, there is limited access to healthcare and skilled professionals. As a result, malaria often goes undiagnosed and untreated, leading to preventable deaths. Recent cases have also shown new malaria variants resistant to drugs. If these genetic changes can be captured earlier using ML models, it can be beneficial in eradicating malaria. Early detection and identifying the stage & type of the malaria infection are critical to saving lives.
What it does
PlasmoVision is a working prototype of a decentralized AI system designed to bring malaria detection closer to people in low-resource settings. It uses edge AI and distributed computing to help run malaria diagnosis on devices with limited power or internet access.
The goal is to automate the analysis of blood smear images — a process that is usually done by hand — to make early malaria detection faster and easier.
Healthcare workers simply upload a blood smear image (in PNG format) to the platform. A trained AI model then checks the image for signs of malaria. If the model finds a high chance of malaria (above 50%), a second model steps in to identify the stage of the malaria parasite. It can detect one of four life stages: ring, trophozoite, gametocyte, or schizont.
As new data from the field comes in, the system improves itself by using a method called federated averaging, which allows the model to learn from new cases without sharing personal data. The updated model is then stored safely in one place, protected from tampering.
How we built it
- Trained a malaria image classification model using TensorFlow by tuning a
MobileNetV3Smallpretrained model on the NIH malaria dataset using the standard1 * 224 * 224 * 3image dimensions resolution reduction *Trained a malaria life stage classification model using the above similar approach on the IML benchmark dataset. - Uploaded the saved safetensors model weights to the backend smart contract using the
ic-file-uploaderRust crate to ensure the Decentralized AI approach is achieved. - Used the
CandleRust crate which supports webAssembly and no_std compatible with the ICP Blockchain to load the model weights andConfig.jsonfiles for inference. - Implemented the
FedAvgalgorithm to allow client devices perform local inference or training using the initial model, which generates new model weights which are aggregated and stored. - Local Data privacy is enhanced through using the
heap memorywhich ensures data isn't persistently stored. - New model weights storage is enabled by using the
stable memoryin ICP which securely holds aggregated model weights, acting as a tamper-proof ledger for global model updates.
The frontend was built with React and plain CSS interacting directly with the canister backend over HTTP using DFINITY’s AgentJS library which imports the backend functions to the frontend. This setup ensures both data privacy and model integrity, powered by blockchain transparency.
Challenges we ran into
Uploading the
safetensors model weightsto the backend ICP smart contract was challenging due to storage constraints and chunked upload requirements.The Rust ecosystem for the ICP Blockchain has strict constraints—especially around no_std requirement and Wasm compatibility. Through research and modification of existing Rust crates ensured successful backend compilation.
Limited access to open-source datasets that capture the malaria parasites life stages. 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
Achieved over 95% accuracy on the two malaria deep learning models — one for malaria detection and another for life stage classification — using transfer learning, while minimizing false negatives and overfitting.
Model compression to below 3mb ensuring easy implementation on resource constrained edge devices.
Successfully compiled and deployed AI model weights on ICP canisters, enabling on-chain inference
Successfully managed to upload and store trained model weights on the ICP canister, overcoming memory and upload limitations challenges common with Blockchain.
Implemented the FedAvg algorithm to support decentralized training — allowing clients to contribute to model improvement without exposing private patient data.
Deployed the AI model on-chain, enabling real-time inference through decentralized smart contract interfaces.
Integrated ICP Wallet and Internet Identity for automated incentive payouts, rewarding contributors to the federated learning process.
Achieved a cumulative model inference latency of under 4 seconds, showing the feasibility of low-latency AI on decentralized infrastructure.
Offline model capabilities because models are hosted on the canisters which are tamper proof.
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.
Blockchain wallet and identity integration using the ICP Blockchain.
What's next for PlasmoVision
Introduce an automatic payout system for users & clients who help improve the model through usage of real field images.
Implement a fake image detector to flag non-real blood smear images so as not to corrupt model weights.
Chatbot integration that explains federated learning concepts and why it matters for data privacy.
Train and deploy a model that can predict the type of malaria infection alongside the malaria life stages.
Built With
- blockchain
- decentralized-ai
- federated-learning
- generative-ai
- icp-blockchain
- machine-learning
- mobilenet
- object-classification
- object-detection
- python
- react
- rust
- tensorflow
- transfer-learning
- web-assembly
Log in or sign up for Devpost to join the conversation.