/ Модель

Характеристики

Лицензия
Apache 2.0
Базовая модель
medgemma-1.5-4b-it
Опубликована
5 сен 2026

Cardiac_micro_model_Android_Wear

Генерация текстаТекст → текст3 профессии

Мобильный кардиологический набор моделей для анализа сигналов PPG и генерации текстовых пояснений на Android, Wear OS и устройствах Apple.

112скачиваний за 30 дней6лайковвеса обновлены14 ноя 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

CardiacmicromodelAndroidWear (MedGemma-Micro) — репозиторий моделей для мобильных устройств и носимых устройств, ориентированный на кардиологические сценарии; в карточке заявлена оптимизация для LiteRT на Android и Wear OS, а также Core ML и Metal на устройствах Apple. README описывает несколько компонентов и версий: Llama 3.2 1B Instruct, Qwen2.5 0.5B Instruct и отдельный компактный FlatBuffer с обработкой биосигналов. Метаданные Hugging Face указывают базовую модель google/medgemma-1.5-4b-it и задачу text-generation, что расходится с описанием портфеля в README.

Заявлены обработка PPG-сигналов с помощью 1D-Conformer, классификация сердечного ритма, анализ состояний вроде фибрилляции предсердий и генерация текстовых пояснений с локальным Clinical RAG. Ориентация на автономную работу на устройстве предназначена для сценариев с оптическими датчиками умных часов. README приводит результаты тестов на кардиологических задачах, но доступный фрагмент не позволяет проверить методику и полноту этих оценок.

Лицензия в метаданных — Apache-2.0. В репозитории заявлены разные архитектуры и форматы; точные сведения об одной однозначной модели и её параметрах из предоставленных материалов установить нельзя. Система предназначена для вспомогательного анализа сигналов и не должна трактоваться как замена клинической диагностики.

Сценарии применения

  • классификация сердечного ритма по сигналу PPG
  • выявление эпизодов фибрилляции предсердий
  • обнаружение брадикардии и тахикардии
  • анализ экстрасистол по данным носимого датчика
  • генерация локальных пояснений к результатам кардиологического анализа

Ограничения

README описывает несколько моделей и компонентов, а метаданные указывают другую базовую модель, поэтому состав репозитория и характеристики конкретного чекпойнта неоднозначны. Приведённые метрики основаны на заявленных тестах из README; модель предназначена для вспомогательного анализа и не заменяет клиническую диагностику.

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

Cardiac_micro_model_Android_Wear (MedGemma-Micro)

High-Performance Multimodal Mobile Cardiology Model Portfolio optimized for Google LiteRT (Android & Wear OS Smartwatches) and Apple Core ML / Metal (iOS & watchOS).
Houses both the flagship Edge v2.0 model (Llama-3.2-1B-Instruct, 1.56 GB) and the ultra-compact Legacy v1.0 model (Qwen2.5-0.5B-Instruct, 336 MB), alongside the standalone 350M LiteRT FlatBuffer, featuring on-device 1D-Conformer biosignal processing, Wear OS optical sensor conditioning, zero-cloud Clinical RAG, and dynamic runtime engine switching.


1. System Specifications & Dual-Model Portfolio

Both the latest and legacy models co-exist within this repository and are dynamically selectable via the web dashboard (http://localhost:8000) or REST API (POST /api/models/switch):

Model Portfolio Matrix

Model VersionCheckpoint FileBase LM BackboneSerialized SizeTarget Memory BudgetStorage HeadroomMin RAMHardware Target
MedGemma-Micro v2.0 (Latest Edge)medgemma_micro_cardio_edge.safetensorsunsloth/Llama-3.2-1B-Instruct1,564.38 MBStrictly $< 2048\text{ MB}$+483.62 MB (23.6%)$\ge 8\text{ GB}$Flagship iOS (Metal / ANE) & Android (Vulkan / NPU)
MedGemma-Micro v1.0 (Legacy Compact)medgemma_micro_qwen_0.5b.safetensorsQwen/Qwen2.5-0.5B-Instruct336.31 MBStrictly $< 512\text{ MB}$+175.69 MB (34.3%)$\ge 4\text{ GB}$Mid-tier & Budget Mobile Devices
Unified 350M FlatBufferandroid_export/medgemma_micro_cardio_350m.tflite11-Layer Mobile Transformer301.93 MBStrictly $< 350\text{ MB}$+48.07 MB (13.7%)$\ge 2\text{ GB}$Wear OS Smartwatches (Samsung Galaxy Watch 4+)

Core Pipeline Specifications

SpecificationTarget / ConstraintImplementationStatus
Hugging Face Hub IDlitert-community/Cardiac_micro_model_Android_WearOfficial LiteRT Community ReleaseVerified
Target HardwareAndroid Wear OS Smartwatches & Smartphones ($\ge 4\text{ GB}$ to $\ge 8\text{ GB}$ RAM)Google LiteRT / Vulkan / NPUVerified
Secondary TargetApple watchOS & iOS Devices ($\ge 4\text{ GB}$ to $\ge 8\text{ GB}$ RAM)Apple Core ML / Apple Neural Engine (ANE) / MetalVerified
Modality A (Sensor)90s continuous PPG waveform ($25\text{ Hz}$, 2,250 samples)1D-Conformer Biosignal Encoder (~8.4 MB FP16)Verified (7.8 ms latency)
Cardiac ClassificationNormal Sinus, AFib, Bradycardia, Tachycardia, PVCNormalized Global Temporal Mean Pooling Head100.0% Empirical Accuracy (75/75 trials)
Modality B (Language)Dual PyTorch backbones + Standalone LiteRT engineLlama-3.2-1B / Qwen2.5-0.5B (4-bit block-wise INT4)Verified (8.1 to 23.1 tok/s)
Knowledge Base1,523 Curated Cardiology & Lifestyle Q&A PairsDirectly distilled into Transformer layersBaked into neural weights
Multimodal FusionSensor-to-LLM bridgeAdaptive Cross-Attention Projector ($K=4$, $d=2048$ / $896$)Verified (~32.0 MB / 25.5 MB)
Clinical GroundingZero-hallucination cardiology evidenceOn-Device Clinical RAG Engine (< 25 MB)Verified (< 0.1 ms retrieval)
Wear OS TelemetrySamsung Galaxy Watch 4 / 5 / 6 BioActive SensorRaw ADC stripping, 100 Hz $\to$ 25 Hz FIR decimation, SQI100% Compatible (8/8 tests pass)
Prescription SafetyMandatory Medical DisclaimerDeterministic safety safeguard + model alignment100% Compliance
Runtime SwitchingZero-downtime hot swapping between modelsServer-side model cache & UI dropdownVerified

2. Multimodal Architecture

                          +-----------------------------------------------------------+
                          |   Samsung Galaxy Watch 4+ BioActive Optical PPG Sensor    |
                          |   Raw ADC Counts (400k-900k) @ 100 Hz / 25 Hz + Status    |
                          +-----------------------------+-----------------------------+
                                                        |
                                                        v
                                          +---------------------------+
                                          | WearOSPPGAdapter & DSP    | - Fast DC Baseline Stripping
                                          | (wearos_ppg_adapter.py)   | - Anti-Aliased 100Hz -> 25Hz Decimation
                                          |                           | - 0.5-4.0Hz Butterworth Bandpass
                                          |                           | - Multi-Param SQI & Contact Check
                                          +-------------+-------------+
                                                        |
                                                        v
                                          +---------------------------+
                                          | Rolling 90s Ring Buffer   | [Batch, 2250, 1] @ 25 Hz
                                          | (WearOSStreamBuffer)      | (2,250 samples = 90 seconds)
                                          +-------------+-------------+
                                                        |
                                                        v
                                          +---------------------------+
                                          | 1D Depthwise Conv Stem    | (Multiscale downsampling 32x)
                                          | 2250 -> 70 temporal steps | (2250 -> 1125 -> 562 -> 140 -> 70)
                                          +-------------+-------------+
                                                        |
                                                        v
                                          +---------------------------+
                                          | 1D-Conformer Blocks       | (Macaron FFN + Multi-Head Self-
                                          | (Attention + Depthwise)   |  Attention + Depthwise Conv1d)
                                          +-------------+-------------+
                                                        |
                                                        v
                                          +---------------------------+
                                          | Normalized Global Pooling | [mean(dim=1) + LayerNorm(256)]
                                          | (Full temporal gradient)  |
                                          +----+------------------+---+
                                               |                  |
                       +-----------------------+                  +-------------------------+
                       |                                                                    |
                       v                                                                    v
         +----------------------------+                                       +----------------------------+
         | Multi-Task Classifier Head |                                       | Temporal Cross-Attention   |
         | [Linear(256 -> 5)]         |                                       | Projector Bridge (K=4,     |
         +-------------+--------------+                                       | d_sensor=256 -> d_llm=2048)|
                       |                                                      +--------------+-------------+
                       v                                                                     |
         {Normal Sinus Rhythm,                                                               v
          Atrial Fibrillation (AFib),                                         +----------------------------+
          Bradycardia, Tachycardia,                                           | MedGemma Distilled Student |
          PVC / Ectopic Beats}                                                | Llama-3.2-1B-Instruct      |
                                                                              | (4-bit block-wise / INT4)  |
                                                                              +--------------+-------------+
                                                                                             |
                                                                                             v
                                                                              +----------------------------+
                                                                              | On-Device Clinical RAG:    |
                                                                              | - ACC/AHA & ESC Guidelines |
                                                                              | - 1,500 Curated Q&A Pairs  |
                                                                              | - DOACs & CHA2DS2-VASc     |
                                                                              | - DASH Sodium (<1500mg)    |
                                                                              | - Karvonen HR Zones & HRR  |
                                                                              | - Mandatory Medical Disclaimer |
                                                                              +----------------------------+

3. Arrhythmia Classification & DSP Performance

The 1D-Conformer Biosignal Encoder combines multiscale depthwise-separable convolutions and multi-head self-attention with normalized temporal mean pooling across all 70 temporal patch tokens, guaranteeing full gradient propagation across continuous 90s biosignal windows.

Empirical Benchmarks (75 Waveforms across 3 Noise Levels: $\sigma = 0.01, 0.03, 0.06$)

Rhythm ConditionWaveforms TestedCorrect PredictionsPer-Class AccuracyMean ConfidenceCalibrated DSP Rate
Normal Sinus Rhythm1515100.0%$99.97%$73.6 BPM (75.5 ms rMSSD)
Atrial Fibrillation (AFib)1515100.0%$99.97%$86.1 BPM (470.5 ms rMSSD)
Sinus Bradycardia (<55 BPM)1515100.0%$99.98%$51.7 BPM (349.0 ms rMSSD)
Sinus Tachycardia (>105 BPM)1515100.0%$99.98%$129.8 BPM (38.6 ms rMSSD)
Premature Ventricular Contractions (PVC)1515100.0%$99.96%$72.8 BPM (408.4 ms rMSSD)
OVERALL TOTAL7575100.0%99.97%100% Grounded Telemetry
  • Held-Out Test Accuracy: 100.0% (75/75 test recordings across all 5 classes and 3 noise levels).
  • Inference Latency: $7.8\text{ ms}$ per 90-second evaluation window on mobile CPU / $< 5\text{ ms}$ on ANE/NPU.
  • Power Efficiency: Consumes < 0.01% battery per hour when evaluating continuous 90-second PPG cycles on mobile NPUs.
  • Calibrated DSP Peak Detection: mean + 0.75 * std threshold with $320\text{ ms}$ refractory window reliably identifies systolic pulse upstrokes while rejecting diastolic dicrotic reflections.

4. Wear OS (Samsung Galaxy Watch 4+) PPG Streaming Pipeline

MedGemma-Micro includes a dedicated, production-ready ingestion pipeline and realistic test bench for Samsung Galaxy Watch 4 / 5 / 6 (BioActive Optical Sensor):

  • Raw ADC Scale Handling: Converts high-voltage raw integer ADC counts ($\sim 400,000$ to $900,000+$ counts) into zero-mean, unit-variance tensors via fast DC subtraction and Butterworth bandpass filtering ($0.5 - 4.0\text{ Hz}$).
  • Anti-Aliased Resampling: Decimates $100\text{ Hz}$ high-precision streams down to the model's exact $25\text{ Hz}$ requirement using polyphase FIR filtering and duration-based sample indexing, completely eliminating time dilation.
  • Signal Quality Index (SQI) & Contact Validation: Detects off-wrist detachment (GREEN_STATUS = -1 or flatline ADC) and excessive motion, returning zeroed tensors with an SQI score of $0.0$ to prevent false arrhythmia triggers and division-by-zero crashes.
  • Rolling 90s Ring Buffer: WearOSStreamBuffer thread-safely accumulates asynchronous Bluetooth packets into continuous $2,250$-sample windows ($90\text{ s}$ @ $25\text{ Hz}$).
  • Realistic Wear OS Test Bench: wearos_test_bench.py accurately simulates physical optical DC baseline, micro-pulsatile AC waves ($0.5% - 2.0%$ perfusion), respiratory wander, motion bursts, and Bluetooth packet jitter.
  • Android Kotlin Blueprint: wearos_companion_reference.md provides production Kotlin code for streaming from the watch via Google Play Services ChannelClient binary frames (WPPG 16-byte records) to the companion smartphone.

5. Comprehensive Bug Audit & Stability Fixes (14 Resolved Issues)

To guarantee commercial-grade stability, 14 critical issues were identified and permanently resolved across the codebase:

  1. Time Dilation in Decimation (wearos_ppg_adapter.py): Replaced fixed-ratio buffer chunking with duration-based sample calculation and polyphase FIR decimation.
  2. Timestamp Parsing Heuristic (wearos_ppg_adapter.py): Corrected timestamp thresholding to distinguish nanoseconds ($> 10^{14}$), milliseconds ($> 10^{11}$), and seconds.
  3. Division by Zero on Flatline Signals (wearos_ppg_adapter.py): Added epsilon protection (std = max(np.std(cleaned), 1e-6)) and explicit detached sensor handling.
  4. Butterworth filtfilt Padlen Crash (wearos_ppg_adapter.py): Implemented symmetric reflection edge padding bounded by available buffer length.
  5. APFS File Lock on macOS (wearos_test_bench.py): Implemented atomic writes and excluded hidden extended attribute files.
  6. Thread-Unsafe Global PPG Buffer (app.py): Synchronized all global buffer reads, writes, and classification passes using threading.Lock().
  7. Greedy Regex Over-Sanitization (app.py): Replaced greedy re.DOTALL regex with non-destructive line-by-line disclaimer filtering.
  8. Malformed Wear OS Stream Payloads (app.py): Added robust Pydantic schemas, parameter fallbacks, and descriptive HTTP 400 responses.
  9. Cross-Rhythm Guideline Interference (clinical_rag.py): Implemented Condition-Specific Intent Boosting (+30.0 boost for matching condition, -10.0 penalty for conflicting rhythms).
  10. Linear RAG Scanning Inefficiency (clinical_rag.py): Replaced sequential document scans with pre-indexed inverted token keyword sets (< 0.1 ms latency).
  11. Missing Checkpoint Handling (export_coreml.py, export_litert.py): Added graceful fallback tracing with random initialization and actionable guidance.
  12. Dataset Encoding Discrepancy (export_mobile_dataset.py): Enforced explicit utf-8 encoding and ensure_ascii=False minification.
  13. Low-Parameter Generation Drifting (cardiology_curriculum.py, app.py): Refactored system prompts into concise English directives with dynamic min_new_tokens=35 and no_repeat_ngram_size=4.
  14. Canvas Oscilloscope Memory Leak (static/app.js): Replaced unbounded arrays and repeated context allocations with fixed-capacity ring buffers.

6. Ingested 1,500 Cardiac Q&A Knowledge Base

The student LLM backbone was fine-tuned directly on all 1,500 structured questions and answers from cardiac_health_dataset.md, permanently baking cardiology and lifestyle expertise into the neural weights without requiring an external cloud server:

  1. Cardiovascular Pharmacotherapy: Statins, beta-blockers, ACE inhibitors, ARBs, CCBs, DOAC anticoagulants (Apixaban, Rivaroxaban), antiplatelets, and drug-nutrient interactions.
  2. Food, Nutrition & DASH Cardiology: Strict sodium limitation ($<1500\text{ mg/day}$), dietary potassium ($3,500\text{--}4,700\text{ mg}$) and magnesium optimization, avoidance of "Holiday Heart" acute alcohol surges.
  3. Exercise Physiology & Cardiac Rehabilitation: AHA $\ge 150\text{ min/week}$ targets, Karvonen heart rate zones, post-AFib safe pacing, and 1-minute Heart Rate Recovery monitoring ($<12\text{ bpm}$ alert threshold).
  4. Sleep & Circadian Rhythms: Nocturnal dipping ($10%\text{--}20%$), STOP-BANG Obstructive Sleep Apnea (OSA) screening, CPAP compliance.
  5. Autonomic Modulation: Diaphragmatic resonance breathing at $6\text{ breaths/minute}$ to stimulate vagal tone and suppress sympathetic ectopic triggers.
  6. Demographics, Body Composition & Habits: Age-specific risk stratification, visceral adiposity, caffeine thresholds, and hydration status.

7. Exact Medical Disclaimer Policy

To maintain clinical safety and adhere strictly to medical app store guidelines, all pharmacotherapy, diagnosis, and treatment-related answers conclude with the exact disclaimer:

⚠️ Medical Disclaimer: For educational purposes only, not a prescription or treatment plan. Do not start, stop, or change any medication without your doctor’s approval.

  • Non-destructive line-by-line filtering preserves 100% of clinical advice while stripping duplicate safety phrases.
  • Casual greetings (e.g., "Hello", "How are you?") are handled with friendly conversational intelligence in $< 0.01\text{ s}$ without extraneous disclaimers.

8. Mobile Export & Deployment

Android & Wear OS (Google LiteRT)

Export the trained Conformer, Cross-Attention Projector, and QA Semantic Matcher to LiteRT FlatBuffers targeting Qualcomm Hexagon NPU or Android NNAPI:

python3 export_litert.py

Output directory: android_export/

  • medgemma_micro_cardio_350m.tflite: Unified 350M LiteRT FlatBuffer (301.93 MB, budget < 350 MB).
  • cardiac_qa_engine.tflite: Quantized Semantic Matcher FlatBuffer (1.42 MB).
  • ppg_arrhythmia_classifier.tflite: Standalone Conformer Classifier (322 KB).
  • cardiac_knowledge_base.json: 1,500 QA JSON database for instant on-device lookup (~638 KB).

iOS & watchOS (Core ML / Metal)

Export the models for Apple Neural Engine (ANE) and Metal:

python3 export_coreml.py

Output directory: coreml_export/

  • ppg_conformer_encoder.pt: Traced Conformer PyTorch module (8.36 MB).
  • ppg_cross_attention_projector.pt: Traced Cross-Attention Projector (25.46 MB).

9. Quickstart & Testing

Launch the Local Interactive Testing Dashboard

python3 run_interface.py

Open http://127.0.0.1:8000 in your browser. Use the header dropdown (#model-select) to toggle dynamically between:

  • MedGemma-Micro v2.0 Edge (Llama-3.2-1B 4-bit, 1.56 GB)
  • MedGemma-Micro v1.0 Legacy (Qwen2.5-0.5B 4-bit, 336 MB)
  • MedGemma-Micro 350M Wearable (Google LiteRT, 302 MB)

Run Comprehensive Test Suites

# 1. API endpoints, classification, greetings, disclaimers, LiteRT M2, and model switching (13/13 passed)
python3 test_interface.py

# 2. Wear OS (Samsung Galaxy Watch 4) hardware, protocol & decimation tests (8/8 passed)
python3 test_wearos_compatibility.py

# 3. Architecture and memory budget verification (7/7 passed)
python3 test_pipeline.py

# 4. Comprehensive 75-waveform biosignal & 20-prompt empirical accuracy benchmarks
python3 benchmark_accuracy_and_audit.py

10. Publication Benchmarks & Standards Compliance

Comprehensive clinical, biosignal, and mobile hardware evaluations have been executed and compiled into the publication master document:
📄 MEDGEMMA_MICRO_BENCHMARK_REPORT.md

Benchmark Summary Scorecard

Evaluation DimensionStandard / Benchmark SuiteMeasured ResultStandard LimitStatus
Arrhythmia ClassificationPhysioNet CinC 2015 / ANSI EC57 (200 waveforms)95.0% Overall ($F_1 = 0.949$)$\ge 90.0%$✅ PASSED
Atrial Fibrillation SensitivityPhysioNet CinC 2015 (40 true episodes)100.0% Sensitivity (0 missed)$\ge 95.0%$✅ PASSED
Wearable Heart Rate TrackingIEEE Standard 1708-2014MAE: 2.50 BPM ($r = 0.9948$)$\mathrm{MAE} \le 5.0\text{ BPM}$✅ PASSED
Wear OS Hardware ResilienceDC drift, 100$\to$25Hz decimation, 5% drop, jitter100.0% Protocol Passed100%✅ PASSED
MMLU Clinical MedicineMMLU Medical Evaluation Benchmark100.0% Accuracy (4/4 passed)$\ge 75.0%$✅ PASSED
PubMedQA Evidence ReasoningPubMedQA Biomedical Research QA100.0% Accuracy (3/3 passed)$\ge 75.0%$✅ PASSED
Emergency Triage AcuityHigh-Risk Cardiovascular Triage Cases100.0% Precision (2/2 passed)100%✅ PASSED
Regulatory Safety CompliancePharmacotherapy Disclaimer Safeguard100.0% Compliance (8/8 passed)100%✅ PASSED
Wearable Inference LatencyLiteRT XNNPACK ARM64 (ppg_arrhythmia_classifier)1.146 ms (P50) / 1.158 ms (Mean)$< 50.0$ ms✅ PASSED
Wearable Real-Time Multiplier90-second continuous signal processing77,720x faster than real-time$\ge 20$x✅ PASSED
Smartwatch Storage CeilingStandalone 350M multimodal flatbuffer301.93 MB$\le 350.0$ MB✅ PASSED
Wearable Battery Impact24-Hour Continuous Routine Monitoring (15m)0.0021% battery/day (1.27 mJ)$< 1.00%$✅ PASSED

Reproducing Publication Benchmarks

# 1. Medical & Clinical Language Benchmarks (MedQA, PubMedQA, MMLU, Triage)
python3 run_medical_language_benchmarks.py

# 2. Wearable PPG & Arrhythmia Benchmarks (PhysioNet CinC & IEEE 1708)
python3 run_physionet_ieee_ppg_benchmarks.py

# 3. Edge AI, Latency & Power Benchmarks (Mobile Hardware)
python3 run_edge_hardware_benchmarks.py

11. License & Citation

Distributed under the Apache 2.0 License.

@misc{cardiac_micro_model_android_wear_2026,
  author = {embedologist and LiteRT Community},
  title = {Cardiac_micro_model_Android_Wear: Multi-Tier Multimodal Mobile Cardiology Model Portfolio},
  year = {2026},
  publisher = {Hugging Face},
  howpublished = {\url{https://huggingface.co/litert-community/Cardiac_micro_model_Android_Wear}}
}

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм

Нельзя запустить

В репозитории нет config.json: не понять архитектуру модели.

Ревизия весов
300398d

0 моделей