/ Модель

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

Контекст
64 токена
Лицензия
AGPL 3.0
Архитектура
siglip · dense
Базовая модель
medsiglip-448
Библиотека
transformers
Опубликована
29 сен 2025

medsiglip-diagnosis

Классификация изображенийИзображение → label3 профессии
174скачиваний за 30 дней1лайквеса обновлены20 ноя 2026

Описание модели

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

Модель Dawa Health на основе MedSigLIP классифицирует кольпоскопические изображения шейки матки по пяти категориям для поддержки скрининга и оценки клиницистом.

CerviTriage AI — модель классификации кольпоскопических изображений шейки матки, разработанная командой Dawa Health Research and Innovation Team. Она присваивает изображению один из пяти классов: Normal, CIN1, CIN2, CIN3 или Cancer, и предназначена для поддержки скрининга в условиях, где нет кольпоскописта. В конвейере Dawa Health модель получает изображение после отдельной модели-фильтра, а результат передаётся клиницисту для проверки.

Модель построена на замороженном энкодере изображений Google MedSigLIP-448 и обученной голове из трёх линейных слоёв примерно с 725 тысячами обучаемых параметров. Полная модель доступна в форматах ONNX, SafeTensors и TFLite. Предусмотрен автономный запуск на периферийном устройстве; в описанной конфигурации Arduino Uno Q обработка одного изображения занимает около минуты.

Заявленные результаты тестирования могут быть завышены: набор содержит аугментированные копии, а разделение на обучающую и тестовую выборки выполнялось по изображениям, а не по исходным случаям. В тестовых ошибках два изображения с раком были классифицированы как нормальные. Метки основаны на визуальной оценке специалистов, а не на гистопатологии; независимая многоцентровая проверка и переносимость на другие устройства, клиники и популяции не подтверждены. Это не медицинское устройство; авторы указывают исследовательское и внутреннее валидационное применение. Работа Dawa Health распространяется по AGPL-3.0; базовая модель также подпадает под условия Health AI Developer Foundations.

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

  • Классификация кольпоскопических изображений по категориям Normal, CIN1, CIN2, CIN3 и Cancer
  • Предварительная оценка изображений шейки матки на периферийном устройстве без подключения к интернету
  • Поддержка клинициста при скрининге рака шейки матки в условиях нехватки кольпоскопистов

Ограничения

Тестовая оценка может быть завышена из-за аугментированных копий и разделения выборки по изображениям; независимая многоцентровая проверка отсутствует, а метки не подтверждены гистопатологией. В тесте два изображения с раком были ошибочно классифицированы как нормальные; скорость на указанном периферийном устройстве составляет около минуты на изображение.

Публичные бенчмарки

Результаты из открытых лидербордов в сравнении с лидерами каталога

Публичных оценок пока нет

В подключённых источниках результатов этой модели не нашлось. Отсутствие оценки не значит, что модель хуже: её могли просто не проверять.

Источники: Hugging Face Leaderboards, Hugging Face Eval Results, Open LLM v2, MTEB, timm, Open ASR, EvalPlus, LLM Stats

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

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

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

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

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

Открыть на Hugging Face

CerviTriage AI — MedSigLIP Diagnosis Model

Dawa Health Research and Innovation Team

Licence: Dawa Health's work is offered under AGPL-3.0. The model is built on Google's MedSigLIP and is also subject to the Health AI Developer Foundations Terms of Use. Not a medical device. Research and internal validation use only. See Licence and Terms below.


Overview

CerviTriage AI classifies colposcopy images of the cervix into five categories: Normal, CIN1, CIN2, CIN3 and Cancer. It is built for cervical cancer screening at the point of care in settings where no colposcopist is available, and is designed to run offline on an edge device.

The model is a small classifier head trained on top of a frozen MedSigLIP image encoder from Google.

In the CerviTriage pipeline it runs after a gatekeeper model, which rejects images that are not colposcopy images:

colposcope → Dawa Clinician app → edge device
    → gatekeeper (is this a colposcopy image?)
    → this model (five-class result)
    → result returned to the app for review by the clinician

Classes

ClassDataset folderClinical meaning
NormalNegativeNo abnormality detected
CIN1CIN1Mild dysplasia, low risk
CIN2CIN2Moderate dysplasia, mid risk
CIN3CIN3Severe dysplasia, high risk
CancerPositiveInvasive cancer

[TO CONFIRM: the output index of each class, from app.py.]


Model Details

ItemValue
TaskImage classification, five classes
BackboneMedSigLIP image encoder (google/medsiglip-448), fully frozen
Classifier headThree linear layers, about 725,000 trainable parameters
Total parametersAbout 400 million
FrameworkHugging Face Transformers / PyTorch; ONNX for deployment
InputRGB colposcopy image. [TO CONFIRM: input resolution; the base model takes 448 × 448.]
Developed byKhanyi Tapiwa Magagula, Dawa Health

Classifier head:

Input (1152-dim MedSigLIP pooled image features)
    → Linear(1152 → 512) → BatchNorm → ReLU → Dropout(0.4)
    → Linear(512 → 256)  → BatchNorm → ReLU → Dropout(0.3)
    → Linear(256 → 5)

MedSigLIP was chosen over general-purpose ImageNet models because it was pre-trained on medical images. The backbone was kept frozen so that a model of this size would not overfit a small dataset.


Files

FileSizeDescription
model.safetensors3.51 GBMedSigLIP backbone weights
classifier_best.pt2.91 MBTrained classifier head (PyTorch)
medsiglip_direct.onnx1.64 GBFull model, backbone and head, float32, as deployed
gatekeeper_best.pt96.5 MBGatekeeper model, earlier version (PyTorch)
gatekeeper_direct.onnx91.6 MBGatekeeper model, as deployed
app.pyReference inference script

The current gatekeeper is published separately at dawahealth/best_gatekeeper_v2.


Usage

app.py in this repository is the reference inference script. The sketch below shows how the two parts fit together.

import torch
import torch.nn as nn
from PIL import Image
from transformers import AutoModel, AutoProcessor
from huggingface_hub import hf_hub_download

REPO_ID  = "dawahealth/medsiglip-diagnosis"
BACKBONE = "google/medsiglip-448"   # requires accepting Google's terms
DEVICE   = torch.device("cuda" if torch.cuda.is_available() else "cpu")

# Frozen MedSigLIP backbone
processor = AutoProcessor.from_pretrained(BACKBONE)
backbone  = AutoModel.from_pretrained(BACKBONE).to(DEVICE).eval()

# Trained classifier head
head = nn.Sequential(
    nn.Linear(1152, 512), nn.BatchNorm1d(512), nn.ReLU(), nn.Dropout(0.4),
    nn.Linear(512, 256),  nn.BatchNorm1d(256), nn.ReLU(), nn.Dropout(0.3),
    nn.Linear(256, 5)
).to(DEVICE)
head.load_state_dict(
    torch.load(hf_hub_download(REPO_ID, "classifier_best.pt"),
               map_location=DEVICE, weights_only=True)
)
head.eval()

image  = Image.open("path/to/colposcopy_image.jpg").convert("RGB")
inputs = processor(images=image, return_tensors="pt").to(DEVICE)

with torch.no_grad():
    features = backbone.vision_model(**inputs).pooler_output
    probs    = torch.softmax(head(features), dim=1)[0]

print(probs)   # map indices to classes using the order in app.py

[TO CONFIRM: this sketch against app.py, in particular the class order and the layout of classifier_best.pt. It has not been tested against the repository.]


Training Data

ItemValue
SourceKaggle dataset kudzie7/medsig-cervical-cancer
Total images5,543
LabellingExpert colposcopic visual assessment by qualified clinicians
SplitStratified 70% / 15% / 15%, seed 42
Train / validation / test3,881 / 830 / 832 images
ClassImages
Normal1,445
CIN1954
CIN2980
CIN3992
Cancer1,172

A later inspection of the dataset (October 2026) found two images in CIN2 that were exact duplicates of two others. They were present in the data this model was trained on. A cleaned set of 5,541 images has been prepared for future training.

[TO CONFIRM: the original source of the images, the consent and ethics approval under which they were collected, and the licence of the dataset.]


Training Procedure

Image features were extracted once from the frozen backbone and cached. Only the classifier head was trained on them.

SettingValue
OptimiserAdam, learning rate 1e-3, weight decay 1e-4
LossCross-entropy with class-balanced weights
SamplingWeighted random sampler, balanced across the five classes
Learning-rate scheduleReduceLROnPlateau, patience 3, factor 0.5
Early stoppingPatience 15 epochs, maximum 100 epochs
Batch size256
Gradient clippingMaximum norm 1.0
Training augmentationRandom flips, rotation up to 15°, colour jitter
HardwareNVIDIA T4 / P100 GPU on Kaggle

Evaluation

Read this first. The figures below are probably higher than the model's real-world performance. The dataset contains many augmented copies (flipped, noisy, rotated) of a smaller set of original images, and the split was made image by image, not by original case. Copies of the same original are therefore likely to appear in both the training and the test set. These results have not been confirmed on a test set grouped by case, or on data from another site.

Results on the held-out test set of 832 images:

MetricScore
Accuracy99.52% (95% CI 98.77% – 99.81%)
Macro AUC1.0000
Macro sensitivity99.6%
Macro specificity99.8%
Weighted F199.52%
ClassPrecisionRecallF1AUC
Normal99.08%99.08%99.08%0.9999
CIN1100%100%100%1.0000
CIN2100%100%100%1.0000
CIN3100%100%100%1.0000
Cancer98.86%98.86%98.86%0.9999

Accuracy was 99.95% on the training set and 100.00% on the validation set.

Errors. Four of the 832 test images were misclassified: two Normal images were classed as Cancer, and two Cancer images were classed as Normal. There were no errors between neighbouring grades.

Comparison with other backbones. The same classifier head, splits and settings were used with five general-purpose models:

BackbonePre-trainingTest accuracyMacro F1
MedSigLIP (this model)Biomedical images99.52%99.59%
ViT-Base/16ImageNet97.24%97.60%
EfficientNet-B0ImageNet96.75%97.10%
DINOv2 ViT-S/14LVD-142M96.39%96.68%
ResNet50ImageNet93.03%93.59%
YOLOv8s-clsImageNet91.59%92.03%

Deployment

The model is exported directly from PyTorch to ONNX at full float32 precision and runs offline on an Arduino Uno Q (quad-core Arm Cortex-A53, 4 GB RAM) with ONNX Runtime on CPU. Inference takes about one minute per image.

When exporting or converting this model, check the raw output scores across several images before using the result. An earlier conversion to TFLite silently dropped the classifier head and returned the same class for every image.


Unit Tests and Code Coverage

The deployed ONNX model (medsiglip_direct.onnx) is covered by an automated inference test suite using pytest and pytest-cov. Tests load the actual model file and run real inference on CPU.

Coverage Tests License

ModuleTestsCoverage
conftest.py—100%
test_cervitriage_onnx.py19100%
Total19/19 passed100%

Run the tests:

pip install pytest pytest-cov onnxruntime pillow numpy
pytest tests/ --cov=. --cov-report=term-missing -v

Test results (November 2026):

  • ✅ 19/19 tests passed
  • ✅ 0 failures, 0 errors
  • ✅ 100% code coverage

Tests cover: model loading, input/output shape validation (1×3×448×448 → 1×5), finite output check, black/white edge-case inference, 5-class softmax postprocessing, label prediction, confidence scoring, and CPU determinism.


Limitations

  • Test results likely overstated. See the note under Evaluation.
  • Labels are not confirmed by histopathology. They come from visual assessment by clinicians. Histopathology is the reference standard for these diagnoses.
  • Cancer can be read as Normal. Two of the four test errors were Cancer images classed as Normal, which is the most harmful error a screening tool can make.
  • Single data collection. Performance across other clinical sites, devices and patient populations has not been validated.
  • No external validation. The results have not been reproduced on an independent, multi-site dataset.
  • Gatekeeper not yet on the device. The gatekeeper is trained but not yet integrated on the edge device, so the classifier will give a result for any image it is shown.
  • Speed. About one minute per image on the edge device.

Licence and Terms

Copyright (C) 2026 Dawa Health.

This model has two layers of terms, and both apply.

1. Dawa Health's work. Dawa Health's contributions (the classifier head, its training, and the code in this repository) are offered under the GNU Affero General Public License, version 3 (AGPL-3.0-only), as published by the Free Software Foundation, to the extent Dawa Health holds the rights to do so. The full text is in the LICENSE file and at https://www.gnu.org/licenses/agpl-3.0.html.

2. The base model. This repository includes the MedSigLIP backbone weights, which Google provides under the Health AI Developer Foundations (HAI-DEF) Terms of Use. Those terms, and the HAI-DEF Prohibited Use Policy, continue to apply to the backbone, to the combined model, and to anything built from them:

The notice those terms require is in the Notice file in this repository. Where the two sets of terms differ, you must comply with the HAI-DEF terms.

What this means for you

You want toYou mayYou must
Run or study the modelYesAccept the HAI-DEF terms and keep all notices
Share the model unchangedYesInclude the LICENSE and Notice files and pass on the HAI-DEF terms
Modify or retrain itYesRelease your modified version, including weights and source, under the same terms
Build it into a product or service, including one accessed over a networkYesMake the complete corresponding source of that work available to its users, and follow the HAI-DEF terms and Prohibited Use Policy
Keep your product closed-sourceNot under this licenceContact Dawa Health about a separate licence (see below)

Training-data notice

The licences above do not change the terms of the dataset the model was trained on. See Training Data.


Contributions

Dawa Health maintains the official version of this model and decides what is included in it.

  • Contact Dawa Health before starting work on a contribution: developers@dawa-health.com.
  • Contributions are accepted only from contributors who have signed the Dawa Health Contributor Licence Agreement.
  • Pull requests opened without prior agreement may be closed without review.
  • Anyone may modify their own copy within the terms above. Modified versions must be clearly marked as changed and must not be presented as the official release.

For the full contributing guide including PR workflow, CI/CD pipeline, and testing standards, see CONTRIBUTING.md.


Other licensing

Organisations that cannot meet the AGPL-3.0 obligations can ask Dawa Health about a separate licence for Dawa Health's work: developers@dawa-health.com. Dawa Health cannot waive the HAI-DEF terms, which are Google's.


Names and marks

"CerviTriage" and "Dawa Health" are names of Dawa Health. The licence does not grant permission to use them to name, endorse or promote a modified version or a derived product, other than to state accurately that the work is based on this model. "MedSigLIP" is a name of Google and is used here only to identify the base model. This model is not produced or endorsed by Google.


Medical disclaimer

This model is a research prototype. The project is registered with the National Health Research Authority (NHRA) of Zambia; approval as a diagnostic device is pending. It is not an approved medical device and must not be used on its own to diagnose, treat or make decisions about the care of any person. Every result must be reviewed by a trained clinician. Its output is not a substitute for colposcopy by a trained clinician, for cytology or HPV testing, or for histological diagnosis.

No warranty. This model is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.


Citation

@misc{cervitriage_medsiglip_diagnosis,
  title  = {CerviTriage AI: MedSigLIP Diagnosis Model},
  author = {{Dawa Health Research and Innovation Team}},
  year   = {2026},
  url    = {https://huggingface.co/dawahealth/medsiglip-diagnosis}
}

Acknowledgements

  • Khanyisile Tapiwa Magagula — model development
  • Dawa Health Research and Innovation Team
  • Google Research Team (HAI-DEF programme) — technical support
  • University Teaching Hospital (UTH), Zambia — clinical partnership
  • National Health Research Authority (NHRA), Zambia
  • UNICEF Femtech Ventures
  • Grand Challenges Canada
  • TogetHER for Health (Panorama Global)

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

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

GPU в ailist

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

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

Подбираем GPU…

Класс архитектуры
SiglipModel
Ревизия весов
8b9a921

0 моделей