Privacy-First Medical Document Processing via On-Device Vision-Language Models

Qualcomm × Nexa AI On-Device Bounty • Grand Champion • April 2026

Abstract

I present Health Passport, a privacy-first medical document scanner that processes prescriptions, lab reports, and medical records entirely on-device using six NPU-accelerated AI models running on Qualcomm Snapdragon 8 Elite via NexaSDK. Where 80% of health apps share data with third parties, Health Passport achieves true HIPAA-compliant data handling by eliminating cloud uploads entirely — no data leaves the device. The system implements a Smart Pipeline Router that automatically dispatches user input (text, camera, voice) to the appropriate model, with a time-to-first-token of 446ms and decode throughput of 19 tok/s on the Hexagon NPU. A conversational RAG interface lets users query their own Health Vault: "What are my current medications?" Phase 1 finalist and Grand Prize winner of the Nexa AI × Qualcomm On-Device Bounty (official winners page). Officially recognized for showcasing "the true potential of private, fast, on-device AI."

1. Introduction

Medical data privacy is broken in a way most patients don't see. A 2024 BMJ study found that 80% of health applications share user data with third-party advertising and analytics services. Healthcare data breaches cost $10.93M per incident — the highest of any industry (IBM, 2023). And yet the dominant paradigm for medical AI applications routes sensitive data through cloud APIs, creating attack surfaces at every hop.

I have personal experience with fragmented medical records across 7+ countries. Every time I switch doctors, I repeat my entire medical history because there is no portable, privacy-preserving way to carry structured health data. The problem isn't that medical AI doesn't exist — it's that existing solutions require you to trust corporations with your most sensitive data in exchange for using them.

The alternative is now technically feasible. The Qualcomm Snapdragon 8 Elite's Hexagon NPU runs 4B-parameter language models at 1,049 tok/s prefill throughput — faster than many cloud APIs. NexaSDK (ai.nexa:core:0.0.24) provides the inference runtime with NPU, CPU, and GPU backends. The missing piece was a well-designed application layer that turns raw model output into structured, portable health records — and routes between LLM, OCR, VLM, and ASR models automatically based on user input type.

2. System architecture

Design Principle

Zero Trust by Default: No network calls for inference. No cloud storage. No analytics. The device is the trust boundary. Data never leaves the user's hardware.

User Input ─┬─ Text → RAG Lookup → Qwen3-4B LLM → Response ├─ Camera → PaddleOCR → Save to Vault → LLM Analysis ├─ Camera → OmniNeural VLM → Vision Analysis └─ Voice → Parakeet ASR → RAG → LLM Response ↕ Health Vault (on-device markdown files) ├── 01_Body_Systems/ (eyes, cardio, allergies) ├── 02_Timeline/ (chronological events) ├── 03_Protocols/ (active medications) └── 04_System_Prompt/ (RAG instructions)
Table 1: Six NPU-accelerated models on Snapdragon 8 Elite
ModelTypeSizeSpeedRole
Qwen3-4B InstructLLM ⭐~4GB19 tok/s decodeBrain — medical Q&A, RAG, reasoning
PaddleOCROCR ⭐~100MB<1s/pageDocument text extraction
Parakeet ASRSpeech~600MBReal-timeVoice input transcription
OmniNeural-4BVLM~4GB~15 tok/sVision analysis (experimental)
EmbedGemmaEmbed~300MBInstantRAG embeddings / memory
Llama-3.2-3B TurboLLM~3GB~15 tok/sAlternate lighter LLM
Table 1b: Performance benchmarks (Snapdragon 8 Elite QRD8750)
MetricValue
Time to First Token446 ms
Prefill Throughput1,049 tok/s
Decode Throughput19 tok/s
Average Response~220 tokens
OCR Scan Time<1 second
APK Size299 MB
Concurrent NPU ModelsUp to 6

The Smart Pipeline Router automatically dispatches input to the correct model — text queries go through RAG lookup then LLM, camera input routes to OCR or VLM, and voice input is transcribed by ASR before RAG+LLM processing. First launch auto-downloads the three essential models (LLM + OCR + ASR). No model picker, no configuration — the app routes input to the right model automatically.

3. Medical extraction pipeline

The core innovation is a prompt-engineered pipeline that transforms unstructured medical images into machine-readable JSON with consistent field structure:

Table 2: Extracted fields
CategoryFieldsExample
Document TypeClassificationLab Report / Prescription / Receipt / X-Ray
MetadataDate, Facility, Doctor2026-02-15, St. Luke's, Dr. Santos
FindingsTest, Result, Reference, StatusWBC, 7.2, 4.5-11.0, NORMAL
MedicationsName, Dosage, Frequency, DurationAmoxicillin, 500mg, TID, 7 days
Action ItemsFollow-ups, RefillsRecheck CBC in 2 weeks

The extraction prompt explicitly requests JSON output with predefined keys. Medical abbreviations (bid, tid, qid) are expanded into plain language. Reference ranges are included alongside results for immediate clinical context. The output is deterministic enough to feed directly into structured health record systems.

4. Privacy analysis

Table 3: Privacy comparison — cloud vs. on-device
DimensionCloud API (GPT-4V, etc.)Health Passport (On-Device)
Data transmission✗ Sent to external servers✓ Never leaves device
HIPAA compliance✗ Requires BAA, audit trails✓ No PHI in transit
Network dependency✗ Required for every query✓ Fully offline capable
Cost per query✗ $0.01-0.10/image✓ $0.00 (device cost only)
Latency2-5s (network + inference)2-5s (inference only)
Breach risk✗ $10.93M average cost✓ No centralized target

5. Engineering challenges

Real-world on-device AI deployment surfaced engineering problems absent from cloud deployments. The project required 16 engineering iterations across bug fixes, UX improvements, and architectural pivots — documented in a structured iteration log:

Table 4: Key engineering challenges solved
ChallengeRoot CauseSolution
VLM outputs garbageOmniNeural-4B on NPU produces "Reactive Reactive..." infinite loopsGarbage detection: count consecutive identical tokens, auto-stop after 8 repeats
VLM only outputs <think> tagsNPU VLM config passed enable_thinking=true producing empty reasoning loopsDisabled thinking mode for vision models; regex-strip think tags from all output
Download interrupted by phone sleepMulti-GB model downloads (4GB+) interrupted when screen turns offAcquired PARTIAL_WAKE_LOCK during download; .complete marker for integrity
Screen flickers during streamingnotifyDataSetChanged() on every token → full RecyclerView redrawThrottled UI updates to ~12fps (80ms interval) + notifyItemChanged(pos)
NPE on model loadmodelFile() returns null for NPU baseUrl directory-based modelssafeModelPath fallback to modelDir().absolutePath across 6 crash sites

6. UI/UX — trust through design

Medical applications fail when users don't feel safe, regardless of the actual security architecture. Health Passport uses a custom Material Design 3 dark theme (#070707 background, #0D0D0D surface, #10B981 emerald accent) to create a calm, clinical environment. A persistent "🔒 On-Device" badge makes the privacy architecture visible and constant. The Health Vault browser organizes records by body system, timeline, and protocol — all as editable markdown files with no proprietary formats.

Users can interact through three modalities: type health questions, scan documents with the camera, or speak naturally. The app routes each input to the correct model automatically. Real-time token streaming shows responses building word-by-word, with throttled UI updates (80ms intervals) to eliminate visual jitter.

7. Recognition

Health Passport was personally invited to the Qualcomm × Nexa AI On-Device Bounty based on prior work on low-cost biosensor systems (Somach EMG interface, arXiv paper on Pareto-optimal model selection for EMG control). Phase 1 finalist and Grand Prize winner (official winners page). Officially recognized by Nexa AI and Qualcomm on LinkedIn for showcasing "the true potential of private, fast, on-device AI" through "creative and practical" deployment of Snapdragon hardware and the NexaSDK. The project was developed on the Qualcomm Device Cloud (QDC) using a Snapdragon 8 Elite QRD8750 virtual device with 1,000 free NPU compute minutes.

References

[1] IBM Security. (2023). "Cost of a Data Breach Report 2023." IBM. ibm.com/reports/data-breach
[2] Grundy, Q., et al. (2019). "Data Sharing Practices of Medicines Related Apps." BMJ, 364. doi.org/10.1136/bmj.l920
[3] Kho, C. (2026). "Pareto-Optimal Model Selection for Low-Cost EMG Control." arXiv:2601.06516. arxiv.org/abs/2601.06516
[4] Nexa AI. (2026). "NexaSDK: On-Device AI Inference." github.com/NexaAI/nexa-sdk
[5] Qualcomm. (2026). "Qualcomm Device Cloud for Edge AI Development." qdc.qualcomm.com

Privacy Analyzer

Paste a health app's privacy policy or terms
Analysis Result