Inspiration

Medicines can leave a manufacturer authentic and in perfect condition, yet still become unsafe or unreliable before reaching a patient.

During transportation and distribution, pharmaceutical products may experience cold-chain interruptions, incomplete custody records, duplicated QR codes, unauthorized transfers, or deliberate manipulation of their history. Traditional traceability systems usually show where a product has been, but they do not always determine whether that history is trustworthy or whether the distribution pattern represents a risk.

We created MedProof AI to answer three essential questions:

  1. Is the medicine’s distribution history authentic?
  2. Were its required transport conditions preserved?
  3. Is there any anomaly that requires investigation or quarantine?

What it does

MedProof AI is an intelligent medicine traceability platform that combines:

  • QR-based batch verification
  • Cryptographically linked custody records
  • Cold-chain monitoring
  • AI-powered anomaly detection
  • Explainable risk scoring
  • Public and auditor verification views

Each medicine batch receives a unique QR code. As the batch moves between manufacturers, logistics operators, distributors, hospitals, and pharmacies, every custody event records information such as location, timestamp, organization, and temperature.

Each event is cryptographically linked to the previous one using SHA-256 hashes. If a record is modified, deleted, or inserted incorrectly, MedProof AI detects that the history is no longer consistent.

The system also analyzes distribution behavior and detects situations such as:

  • Temperature excursions
  • Suspicious duplicate QR scans
  • Geographically impossible movements
  • Missing custody events
  • Unusual transportation times
  • Expired batches
  • Unauthorized operators
  • Tampered traceability records

MedProof AI produces an explainable risk score and recommends an operational action, such as continuing distribution, reviewing the batch, investigating a suspicious scan, or placing the product in quarantine.

How we built it

MedProof AI is being developed as a web-based prototype using Python and Flask.

The platform includes:

  • A batch registration module
  • QR code generation and verification
  • A pharmaceutical custody timeline
  • A SHA-256 hash-chain integrity engine
  • A rule-based critical alert system
  • An Isolation Forest anomaly detection model
  • A risk scoring and explanation engine
  • A dashboard for auditors and logistics operators
  • A simplified verification page for patients and pharmacies

Because real pharmaceutical logistics information is highly sensitive and difficult to obtain during a hackathon, we generate a documented synthetic dataset containing normal and anomalous distribution scenarios.

The synthetic data includes cold-chain interruptions, cloned QR scans, impossible travel patterns, altered records, expired batches, missing transfers, and unusual routes. This allows us to evaluate the prototype without exposing patient or commercial information.

AI and risk detection

MedProof AI uses a hybrid approach.

Deterministic rules detect critical events that should never depend exclusively on a machine-learning prediction, including:

  • Broken cryptographic integrity
  • Expired products
  • Severe temperature violations
  • Impossible location changes
  • Duplicate QR activity

Machine learning is used to identify less obvious patterns across variables such as transportation duration, distance, temperature behavior, scan frequency, number of transfers, route characteristics, and missing information.

The system explains the main factors contributing to every risk result instead of presenting an unexplained prediction.

Challenges

One of the main challenges is distinguishing between product authenticity and logistical integrity. A valid QR code alone does not prove that a medicine was transported correctly or that its history has not been manipulated.

Another challenge is designing an AI component without making unsupported medical claims. MedProof AI does not diagnose patients or determine whether a medicine should be consumed. It evaluates the integrity and risk indicators of the product’s recorded distribution history.

We are also working to balance strong traceability with a verification experience that remains simple enough for a patient, pharmacist, or hospital worker to understand in seconds.

What we learned

Building MedProof AI demonstrates that trustworthy medicine verification requires more than storing transactions.

An effective system must combine:

  • Data integrity
  • Supply-chain context
  • Anomaly detection
  • Explainable decisions
  • Clear operational recommendations
  • Privacy-conscious design

We also learned that machine learning should complement, rather than replace, deterministic safety and integrity controls.

What makes MedProof AI different

Most traceability platforms answer:

Where has this medicine been?

MedProof AI also asks:

Can we trust that history, were the required conditions preserved, and does the observed behavior indicate a risk?

This transforms traceability from a passive record into an active pharmaceutical risk detection system.

What's next

Future versions of MedProof AI could include:

  • Integration with real IoT temperature sensors
  • GS1 Digital Link compatibility
  • Manufacturer and regulator integrations
  • Role-based digital signatures
  • Privacy-preserving analytics
  • Mobile verification
  • Federated anomaly detection
  • Cross-border pharmaceutical traceability
  • Deployment on a permissioned distributed ledger

Our long-term vision is to help hospitals, pharmacies, distributors, regulators, and patients verify not only where a medicine came from, but whether its complete journey can be trusted.

Responsible use

MedProof AI is a hackathon prototype built with synthetic data.

It is not a medical diagnostic tool and does not provide treatment or consumption advice. Risk results are intended to support logistical review, auditing, and product quarantine decisions by authorized professionals.

Built With

Share this project:

Updates

Submission history