/ Модель

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

Контекст
131 072 токена
Параметры
318 млн
Лицензия
MIT
Архитектура
paddleocr_vl · dense
Базовая модель
PaddleOCR-VL
Библиотека
transformers
Опубликована
20 дек 2025

medocr-vision

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

Модель на базе PaddleOCR-VL для распознавания текста в медицинских рецептах, лабораторных отчётах и формах, а также в общих деловых документах.

40скачиваний за 30 дней4лайкавеса обновлены21 дек 2025

Бенчмарки

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

Тесты пользователейпока нет

Никто ещё не опубликовал тест этой модели. Соберите бенчмарк из своих задач — результат появится здесь.

  1. Добавьте модель в бенчмарк

    Вместе с другими моделями категории «Текст» — сравнение идёт внутри одной категории.

  2. Опишите свои задачи

    Напишите запросы, при необходимости приложите файлы и эталонные ответы.

  3. Запустите и опубликуйте

    Модели ответят на каждую задачу, судья оценит ответы. Опубликованный результат появится на этой странице.

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

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

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

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

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

MedOCR-Vision — модель компьютерного зрения для распознавания текста и структуры медицинских документов, разработанная как работа для ERNIE AI Developer Challenge. Она дообучена методом LoRA на базе unsloth/PaddleOCR-VL и ориентирована на рецепты, лабораторные отчёты и медицинские формы; также подходит для счетов, чеков и других деловых документов. В метаданных указаны архитектура PaddleOCR-VL, 318,2 млн параметров, контекст 131072 токена, библиотека Transformers и формат safetensors. README описывает обучение на наборе из 2462 медицинских и общих документов и сообщает о смешанной точности BF16/FP16.

Модель принимает изображения и выдаёт распознанный текст. По описанию, обучение улучшило извлечение медицинских сведений, включая заголовки, результаты анализов и референсные диапазоны. Основной язык документов — английский. Модель предназначена для оцифровки документов, а не для постановки диагнозов; качество может снижаться на низкокачественных изображениях, сложном почерке и типах документов, отличающихся от обучающих. Лицензия — MIT.

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

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

Ограничения

Качество может снижаться на изображениях низкого качества, при очень неразборчивом почерке и на типах документов, не похожих на обучающие. Модель распознаёт документы, но не предназначена для медицинской диагностики; критически важные результаты требуют проверки человеком.

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

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

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

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

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

Открыть на Hugging Face

MedOCR-Vision: Medical Document OCR with PaddleOCR-VL

ERNIE AI Developer Challenge Submission

A fine-tuned PaddleOCR-VL model specialized for medical document OCR, achieving high accuracy on medical prescriptions, lab reports, and forms while maintaining general OCR capabilities.

Model Description

MedOCR-Vision is a vision-language model fine-tuned specifically for optical character recognition (OCR) of medical documents. The model is based on PaddleOCR-VL (1B parameters) and has been fine-tuned using LoRA (Low-Rank Adaptation) on a carefully curated dataset of 2,462 medical and general documents.

Key Features

  • Specialized for Medical Documents: Optimized for prescriptions, lab reports, and medical forms
  • Domain-Balanced Training: Maintains general OCR capabilities (invoices, receipts, business documents)
  • Production-Ready: Full merged model in float16 precision
  • Efficient Fine-tuning: LoRA-based training for optimal performance with minimal parameters
  • High Accuracy: Validation loss of 0.578 after 3 epochs of training

Model Architecture

  • Base Model: unsloth/PaddleOCR-VL (1B parameters)
  • Fine-tuning Method: LoRA (Low-Rank Adaptation)
  • LoRA Rank: 64
  • LoRA Alpha: 64
  • Target Modules: q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj, out_proj, fc1, fc2, linear_1, linear_2
  • Precision: Mixed (BF16/FP16)

Performance Highlights

Model Improvements Over Base Model

Our fine-tuned model demonstrates significant improvements across multiple metrics:

  • ✅ Enhanced Information Extraction: Captures more complete medical information including headers, test values, and reference ranges
  • ✅ Better Document Understanding: Improved coverage of document structure and context
  • ✅ Medical Domain Specialization: Superior performance on medical terminology and clinical data
  • ✅ Comprehensive Coverage: Extracts significantly more relevant content from medical documents

Intended Uses

Primary Use Cases

  • Medical Prescription Digitization: Extract text from handwritten and printed prescriptions
  • Lab Report Processing: Extract data from medical laboratory reports
  • Medical Form OCR: Process various medical forms and documents
  • Healthcare Document Management: Digitize medical records and documentation
  • General Document OCR: Invoices, receipts, and business documents

Out-of-Scope Uses

  • Real-time medical diagnosis (this is an OCR tool, not a diagnostic system)
  • Legal document verification (requires domain-specific training)
  • Privacy-sensitive applications without proper data handling protocols

Training Data

Dataset Composition

The model was trained on naazimsnh02/medocr-vision-dataset, a curated dataset of 2,462 samples with the following composition:

DatasetSamplesDomainType
Medical Prescriptions1,000MedicalHandwritten
OMR Scanned Documents36MedicalScanned Forms
Medical Lab Reports426MedicalPrinted Reports
Invoices & Receipts1,000GeneralBusiness Docs
Total2,462--

Dataset Statistics

  • Training: 1,969 samples (80%)
  • Validation: 246 samples (10%)
  • Test: 247 samples (10%)
  • Domain Balance: 59.4% Medical / 40.6% General

Data Sources

  1. Medical Prescriptions
  2. OMR Scanned Documents
  3. Medical Lab Reports
  4. Invoices & Receipts

Training Procedure

Training Hyperparameters

# Training Duration
num_train_epochs: 3
total_steps: 741

# Batch Configuration
per_device_train_batch_size: 4
gradient_accumulation_steps: 2
effective_batch_size: 8

# Learning Rate
learning_rate: 5e-5
warmup_steps: 50
lr_scheduler_type: linear

# Optimization
optimizer: adamw_8bit
weight_decay: 0.001

# LoRA Configuration
lora_r: 64
lora_alpha: 64
lora_dropout: 0

# Checkpointing
save_steps: 100
eval_steps: 100
save_total_limit: 5
load_best_model_at_end: true

Training Results

StepTraining LossValidation Loss
1001.70260.7900
2001.30050.6821
3001.00040.6402
4000.81760.6036
5000.73870.5806
6000.74060.5819
7000.88010.5787

Final Metrics:

  • Final Validation Loss: 0.5787
  • Training Time: 38.36 minutes (2,301.80 seconds)
  • Peak GPU Memory: 15.84 GB
  • GPU Utilization: 71.89%

Training Environment

  • GPU: NVIDIA L4 (24GB VRAM)
  • Framework: Unsloth + HuggingFace Transformers
  • Precision: Mixed (BF16/FP16)
  • Memory Usage: ~14 GB for training

Training Strategy

  1. Domain-Balanced Approach: 60/40 split between medical and general documents to prevent catastrophic forgetting
  2. LoRA Fine-tuning: Efficient parameter-efficient fine-tuning targeting key attention and MLP layers
  3. Checkpoint Selection: Best model selected based on lowest validation loss
  4. Evaluation: Regular evaluation every 100 steps to monitor convergence

How to Use

Installation

pip install transformers unsloth einops torch pillow

Basic Usage

from unsloth import FastVisionModel
from transformers import AutoProcessor
from PIL import Image

# Load model and processor
model, tokenizer = FastVisionModel.from_pretrained(
    "naazimsnh02/medocr-vision"
)
processor = AutoProcessor.from_pretrained(
    "naazimsnh02/medocr-vision",
    trust_remote_code=True
)

# Enable inference mode
FastVisionModel.for_inference(model)

# Load image
image = Image.open("medical_document.jpg")

# Prepare input
instruction = "Extract all text from this medical document:"
messages = [{
    "role": "user",
    "content": [
        {"type": "image"},
        {"type": "text", "text": instruction}
    ]
}]

# Generate
text_prompt = processor.tokenizer.apply_chat_template(
    messages,
    tokenize=False,
    add_generation_prompt=True
)

inputs = processor(
    image,
    text_prompt,
    add_special_tokens=False,
    return_tensors="pt",
).to("cuda")

output = model.generate(
    **inputs,
    max_new_tokens=256,
    use_cache=False,
    temperature=1.5,
    min_p=0.1
)

# Decode output
text = tokenizer.decode(output[0], skip_special_tokens=True)
print(text)

Advanced Usage with Streaming

from transformers import TextStreamer

# Create text streamer
text_streamer = TextStreamer(tokenizer, skip_prompt=True)

# Generate with streaming
_ = model.generate(
    **inputs,
    streamer=text_streamer,
    max_new_tokens=256,
    use_cache=False,
    temperature=1.5,
    min_p=0.1
)

Limitations and Biases

Limitations

  1. Image Quality: Performance may degrade with very low-quality or heavily degraded images
  2. Handwriting Variability: Extremely poor handwriting may not be accurately recognized
  3. Language: Primarily trained on English medical documents
  4. Document Types: Optimized for the specific document types in the training set
  5. Context Understanding: This is an OCR model, not a medical understanding model

Potential Biases

  1. Dataset Bias: Training data is primarily from specific medical document sources
  2. Domain Bias: Better performance on medical documents similar to training data
  3. Language Bias: Primarily English-language documents
  4. Format Bias: May perform better on document formats similar to training data

Recommendations

  • Validate outputs in critical medical applications
  • Use as part of a larger system with human oversight
  • Test on your specific use case before production deployment
  • Consider fine-tuning on domain-specific data for specialized applications

Ethical Considerations

Privacy and Security

  • Medical Data: This model processes medical documents which may contain sensitive patient information
  • HIPAA Compliance: Users must ensure compliance with relevant healthcare data protection regulations
  • Data Handling: Implement appropriate data security measures when using this model
  • Audit Trail: Maintain logs of OCR processing for accountability

Responsible Use

  • This model should be used as an assistive tool, not a replacement for human review
  • Medical professionals should verify all extracted information
  • Implement appropriate error handling and validation
  • Consider the implications of automated medical document processing

Citation

@misc{medocr-vision-2025,
  title={MedOCR-Vision: Medical Document OCR with PaddleOCR-VL},
  author={Syed Naazim Hussain},
  year={2025},
  publisher={HuggingFace},
  howpublished={\url{https://huggingface.co/naazimsnh02/medocr-vision}}
}

Additional Resources

License

This model is released under the MIT License. Please refer to individual dataset licenses for usage terms of the training data.

Acknowledgments

  • Base Model: unsloth/PaddleOCR-VL
  • Framework: Unsloth for efficient training
  • Dataset Sources: chinmays18, saurabh1896, dikshaasinghhh, mychen76
  • LLM Providers: Nebius and Novita for data processing
  • PaddleOCR Team: For the excellent OCR framework

Model Version: 1.0
Release Date: December 2025
Challenge: ERNIE AI Developer Challenge

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

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

GPU в ailist

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

Можно запустить

Подбираем GPU…

Класс архитектуры
PaddleOCRVLForConditionalGeneration
Ревизия весов
753b262

0 моделей