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 MobileNetV3Small pretrained model on the NIH malaria dataset using the standard 1 * 224 * 224 * 3 image 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-uploader Rust crate to ensure the Decentralized AI approach is achieved.
  • Used the Candle Rust crate which supports webAssembly and no_std compatible with the ICP Blockchain to load the model weights and Config.json files for inference.
  • Implemented the FedAvg algorithm 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 memory which ensures data isn't persistently stored.
  • New model weights storage is enabled by using the stable memory in 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

  1. Uploading the safetensors model weights to the backend ICP smart contract was challenging due to storage constraints and chunked upload requirements.

  2. 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.

  3. 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

  1. 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.

  2. Model compression to below 3mb ensuring easy implementation on resource constrained edge devices.

  3. Successfully compiled and deployed AI model weights on ICP canisters, enabling on-chain inference

  4. Successfully managed to upload and store trained model weights on the ICP canister, overcoming memory and upload limitations challenges common with Blockchain.

  5. Implemented the FedAvg algorithm to support decentralized training — allowing clients to contribute to model improvement without exposing private patient data.

  6. Deployed the AI model on-chain, enabling real-time inference through decentralized smart contract interfaces.

  7. Integrated ICP Wallet and Internet Identity for automated incentive payouts, rewarding contributors to the federated learning process.

  8. Achieved a cumulative model inference latency of under 4 seconds, showing the feasibility of low-latency AI on decentralized infrastructure.

  9. Offline model capabilities because models are hosted on the canisters which are tamper proof.

What we learned

  1. Learned how powerful federated learning can be when it comes to protecting user data(especially patient data) while still improving AI models.

  2. Learned how to deploy AI models so they can make predictions right from our backend, using Rust and JavaScript.

  3. Most importantly, I saw how combining AI with blockchain can open up new ways of building secure and trustworthy applications.

  4. 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

Share this project:

Updates