Skip to content
PharmaGuard

PharmaGuard

Personalized Precision Medicine

Created on 2nd March 2026

•

PharmaGuard

PharmaGuard

Personalized Precision Medicine

The problem PharmaGuard solves

PharmaGuard 💊🛡️

AI-Powered Medicine Safety & Counterfeit Detection System

🚀 Overview

PharmaGuard is an intelligent healthcare safety platform designed to detect counterfeit, expired, or unsafe medicines using computer vision and AI. It helps consumers, pharmacies, and healthcare providers verify drug authenticity and safety in real time.

Built during RIFT 2026 Hackathon, PharmaGuard aims to reduce risks associated with fake or expired medications and promote safer pharmaceutical practices.

🎯 Problem Statement

Counterfeit and expired medicines pose serious health risks, especially in regions with limited verification systems. Consumers often lack tools to verify:

Drug authenticity

Expiry validity

Packaging inconsistencies

Safety alerts & recalls

PharmaGuard provides an automated, AI-driven solution.

✨ Features
🔍 Medicine Verification

Detect counterfeit packaging using image analysis

Identify brand inconsistencies and anomalies

⏳ Expiry Detection

OCR-based extraction of expiry/manufacturing dates

Alerts for expired or near-expiry medicines

🧠 AI-Powered Analysis

Computer vision for label recognition

Pattern matching for authenticity checks

🌐 API Integration

FastAPI backend for deployment

Easily integrable with websites & mobile apps

📊 Safety Alerts

Flags unsafe medicines

Provides user-friendly warnings

🏗️ Tech Stack

Backend

FastAPI

Python

OpenCV

OCR (Tesseract/EasyOCR)

AI & ML

Computer Vision models

Image preprocessing & pattern detection

Deployment

Render / Hugging Face Spaces

REST API endpoints

Challenges I ran into

1️⃣ Real-World Medicine Packaging Variability

Medicine packaging varies across manufacturers, regions, and batches. Training the system to recognize authenticity despite differences in fonts, colors, layouts, and print quality was a major challenge.

2️⃣ OCR Accuracy on Blister Packs & Curved Surfaces

Extracting expiry dates from reflective strips and curved blister packs caused OCR failures due to glare, distortion, and low contrast.

Solution: Applied image preprocessing (grayscale, thresholding, noise reduction) to improve text readability.

3️⃣ Detecting Counterfeits Without a Large Dataset

There is no publicly available, well-labeled dataset for counterfeit medicines.

Solution:

Simulated anomalies

Used rule-based validation + visual inconsistency detection

4️⃣ FastAPI Deployment & Integration Issues

Making the model accessible via an API required handling:

File uploads

Async processing

CORS for web integration

Deployment constraints on Render/Hugging Face

5️⃣ Performance vs Accuracy Trade-offs

High-accuracy image processing slowed response times, which affected real-time usability.

Solution: Optimized preprocessing pipeline and reduced model overhead.

6️⃣ Handling Poor Image Quality from Users

Users may upload blurred, low-light, or tilted images, causing unreliable results.

Solution: Added validation checks and user prompts for better image capture.

7️⃣ Limited Hackathon Time Constraints

Building a full pipeline — computer vision, OCR, API, and deployment — within hackathon time required prioritizing core functionality over advanced features.

Discussion

Builders also viewed

See more projects on Devfolio