Skip to content

Fighting Nigeria’s Silent Epidemic with AI: Building a Fake Drug Detector App Using Amazon Nova

💊 Introduction: The Silent Epidemic Killing Millions

Counterfeit pharmaceuticals are not just a market problem—they are a public health emergency. Across sub-Saharan Africa, over 500,000 deaths annually are linked to fake drugs. In Nigeria alone:

  • 267,000 deaths yearly from substandard malaria medication
  • 169,000 child deaths from fake antibiotics used for pneumonia
  • A crisis so severe that regulators report it rivals casualties from war

This is not just data—it’s real lives lost.

That’s why I built the Fake Detector App—an AI-powered mobile solution designed to empower everyday Nigerians to verify medications instantly.

🧠 The Vision: AI as a Public Health Guardian

The goal is simple but powerful:

Put a drug verification system in every citizen’s pocket

By combining cutting-edge AI with real-time regulatory data, this project aims to:

  • Detect counterfeit drugs instantly
  • Reduce preventable deaths
  • Build trust in healthcare systems
  • Enable informed decisions at the point of purchase

⚙️ How I Built It: A Multi-AI Hybrid System Powered by Amazon Nova Ai

This project leverages a resilient, multi-provider AI architecture, with Amazon Bedrock and Amazon Nova playing a critical role.

🔹 Core Architecture

  • Frontend & Mobile: Next.js 14 + Capacitor (Android-ready)
  • Backend: Node.js + Prisma + PostgreSQL
  • Deployment: Vercel + Firebase integrations

🔹 The AI Brain: Multi-Provider Fallback System

To ensure reliability, I designed a custom AI Fallback Manager that orchestrates:

  • Google Gemini 2.5 Flash
  • Anthropic Claude 3.5
  • Amazon Nova (via Bedrock)

👉 If one AI fails (quota, latency, OCR issue), another automatically takes over.

This ensures:

  • ⚡ Faster response times
  • 🛡️ Zero single-point failure
  • 🔁 Continuous availability in critical scenarios

🔍 Intelligent Drug Verification System

1. 📷 Smart Scanning with OCR + Vision AI (Amazon Nova AI)

Users scan drug packaging using their phone camera. The system:

  • Enhances image quality (lighting, sharpness)
  • Extracts batch numbers, manufacturer info
  • Uses AI vision models for better accuracy on curved/metallic surfaces

2. 🧬 Semantic Matching with Transformers

Using Transformers.js (all-MiniLM-L6-v2):

  • Extracted text is compared against thousands of official drug alerts
  • Detects matches even with:
    • Misspellings
    • Formatting inconsistencies
    • Partial data

3. 🔄 Real-Time Regulatory Sync

A custom engine continuously monitors:

  • NAFDAC recall lists
  • Public safety alerts

This ensures the app always has an up-to-date “Watchlist” of dangerous drugs.

⚡ Why Amazon Nova Matters in This Project

The Amazon Nova models (via Bedrock) provide:

  • 🧠 Advanced reasoning for ambiguous drug labels
  • 🖼️ Vision capabilities for complex packaging
  • ⚡ Low-latency inference for real-time scanning
  • 🔒 Enterprise-grade reliability

Impact:
Amazon Nova acts as a critical fallback intelligence layer, ensuring that even in poor network or high-load conditions, users still receive accurate results.

🚧 Challenges & Solutions

❗ OCR Limitations on Medicine Packaging

  • Problem: Curved bottles + reflective surfaces
  • Solution: Built a custom image preprocessing pipeline

❗ Serverless AI Scaling

  • Problem: Heavy ML models in serverless environments
  • Solution: Optimized ONNX runtime + Webpack configs

❗ Critical System Failures (JSON.parse Error)

  • Problem: Tesseract crashes breaking user flow
  • Solution:
    • Bypassed local OCR
    • Prioritized cloud-based AI (Amazon Nova, Gemini, Claude)

📚 What I Learned

1. 🛡️ Resilience is Everything

A health-tech system must never fail silently. Always have:

  • Backup AI
  • Fallback logic
  • Redundant pipelines

2. ⚖️ Speed vs Accuracy Tradeoff

In life-critical apps:

Accuracy must NEVER be sacrificed for speed.

3. 🤝 Trust is a Feature

Users must feel:

  • Safe
  • Confident
  • Informed

Clear UI/UX and transparent results are essential.

🌍 Real-World Impact: Saving Lives at Scale

This project has the potential to:

  • Reduce counterfeit drug circulation
  • Save hundreds of thousands of lives annually
  • Support healthcare workers and pharmacists
  • Strengthen regulatory enforcement

🚀 Driving Adoption in Nigeria & Beyond

To ensure real-world usage:

  • 📱 Mobile-first design (Android focus)
  • 🌐 Lightweight + offline-tolerant architecture
  • 🤝 Partnerships with pharmacies & NGOs
  • 📢 Awareness campaigns on drug safety

Future plans include:

  • SMS-based verification for low-end devices
  • Integration with national health systems
  • Expansion across Africa

🛠️ Tech Stack

  • Next.js, React, TypeScript
  • Node.js, Prisma, PostgreSQL
  • Transformers.js
  • Firebase, Vercel
  • Amazon Bedrock (Nova AI)
  • Google Gemini, Anthropic Claude

🔗 Try the App

💡 Final Thoughts

The Fake Detector App proves that AI is not just about innovation—it’s about impact.

By leveraging Amazon Nova and a resilient multi-AI architecture, this project transforms smartphones into life-saving tools.

In a world where fake drugs can kill, verification should be instant, accessible, and reliable.

Leave a Reply

Your email address will not be published. Required fields are marked *