DevxSubh
I develop 3D visuals, user interfaces and web applications.
Loading...0%
Menu
Menu
Close
Close
Back to projects
TrueMeds — Counterfeit Medicine Detection (ResNet-18 + Microservices)

TrueMeds — Counterfeit Medicine Detection (ResNet-18 + Microservices)

TrueMeds implements a three-tier architecture: the browser uploads an image to an Express backend that authenticates the user (JWT, roles) and proxies to a FastAPI microservice running a fine-tuned ResNet-18 checkpoint (`best_cls_resnet18.pt`). Responses return label probabilities and confidence for pharmaceutical QC-style workflows. Training lives in `ml_service/main.ipynb` with dataset loaders, augmentation, and checkpointing. Docker Compose brings up client (3000), API (5000), and ML (8000) for one-command demos. Documentation covers API contracts (`/classify` on FastAPI, `/api/v1/ml/classify` on Express), environment configuration, troubleshooting, and dataset provenance (Roboflow Universe, CC BY 4.0).

Timeline

Course / multi-month

Role

Full-Stack & ML Engineer

Team

Course team

Status

Completed

Technology Stack

PyTorchResNet-18FastAPIPythonJupyter

Node.js

Express

MongoDB

MongooseJWT

React

ViteDockerDocker Compose

Key Features

Binary classification: authentic vs counterfeit with scored probabilities
Microservices separation: inference isolated for scaling and GPU placement
Secure upload path: auth middleware, validation, structured logging
Training pipeline notebook with expected accuracy bands on train/val/test splits
Health endpoints for orchestration and monitoring
Course deliverables: proposal, presentation, and research PDFs in repo

Key Learnings

  • Serving PyTorch models behind FastAPI with clear I/O schema
  • JWT RS256 patterns mirrored across ML proxy APIs
  • Vite + React integration with multipart uploads and token headers
  • Responsible framing of ML for safety-critical domains (assistive, not sole decision maker)

Key Challenges

  • Coordinating three runtimes and environment variables across dev and Docker
  • Managing binary size and security of uploaded images
  • Closing the loop between notebook-trained weights and production FastAPI load path
  • Dataset size and domain shift risks in real-world deployment

Impact & Results

Demonstrates full-stack ML product skeleton for supply-chain and consumer verification scenarios
Reproducible compose stack lowers onboarding for graders and collaborators
Checkpoint + API contract pattern reusable for other image classifiers

Future Enhancements

Model versioning, A/B tests, and drift monitoring in production
Cloud object storage for uploads and signed URLs
Explainability overlays (Grad-CAM) for analyst trust
Mobile capture app and edge-optimized models