Aller au contenu
ModelPrésentéExterne
Télécharger

Medical Models

This repository contains two complementary medical imaging AI model collections:

TypeOtherVersionRevision cd4f7a8CClasse

Source du modèle

Type
Other
Taille du fichier
24,2–747 MB
Version
vRevision cd4f7a8
Mis à jour
17 sept. 2026
Téléchargements
0
Source
Hugging Face

Description de la source

Medical Imaging Models

This repository contains two complementary medical imaging AI model collections:

  1. BiomedCLIP Router - Routes medical images to the correct imaging modality
  2. Disease-Specific Models - Classification and segmentation models for various medical imaging domains

Model 1: BiomedCLIP Router

Description

A modality classification model that routes medical images to one of 7 imaging categories. Built on Microsoft's BiomedCLIP backbone, this router enables automatic sorting of medical images to the appropriate downstream model.

Supported Modalities

ClassModality
0Endoscopy
1Dermatology
2X-Ray
3Ultrasound
4Mammography
5Fundus / Retinography
6Microscopy

Performance

MetricTest Score
Accuracy100%
Macro F1100%
Macro Precision100%
Macro Recall100%

Training Details

  • Base Model: microsoft/BiomedCLIP-PubMedBERT_256-vit_base_patch16_224
  • Training Images: 14,000 (2,000 per class)
  • Validation Images: 1,750 (250 per class)
  • Test Images: 1,750 (250 per class)
  • Best Epoch: 1
  • Validation Macro F1: 99.94%

Files

biomedclip_router_20260423_194004/
├── best_biomedclip_router.pt    # Trained model weights (748MB)
├── metrics.json                  # Training metrics and history
├── train.log                     # Training logs
├── session_name.txt              # Session identifier
└── unseen_holdout_300/          # Holdout test data info

Model 2: Disease-Specific Models

A collection of specialized models for disease classification and segmentation across 8 medical imaging domains.


2.1 Breast Ultrasound

Classification Model

Task: Classify breast ultrasound images as benign, malignant, or normal

MetricTest Score
Accuracy92.31%
Macro F190.75%
Macro Precision89.79%
Macro Recall91.85%
Best Epoch23

Classes: benign, malignant, normal

Segmentation Model

Task: Segment lesions in breast ultrasound images

MetricTest Score
Dice83.80%
IoU76.17%
Best Epoch20
ArchitectureSMP UNet++

Files:

breast_ultrasound/
├── classification/
│   ├── best_classifier.pt
│   ├── metrics.json
│   └── plots/
└── segmentation/
    ├── best_segmentor.pt
    ├── metrics.json
    └── plots/

2.2 Chest X-Ray

Classification Model

Task: 4-class chest X-ray classification (COVID-19 Radiography Database)

MetricTest Score
Accuracy96.17%
Macro F196.08%
Macro Precision96.40%
Macro Recall95.79%
Best Epoch11

Classes: covid, lung_opacity, normal, viral_pneumonia

  • Architecture: DenseNet121 (torchvision IMAGENET1K_V1, the CheXNet chest-X-ray backbone) + fresh 4-class head (replaces the previous 15-class BiomedCLIP multi-label model that scored ~21% exact-match accuracy)
  • Dataset: COVID-19 Radiography Database (Kaggle tawsifurrahman/covid19-radiography-database); also mirrored at dataset repo umairinayat/fyp-dataset
  • Deduplication: near-duplicates removed via MD5 + perceptual pHash (mirror-aware) -> 19,133 unique images
  • Split: stratified 70/15/15 (train 13,393 / val 2,870 / test 2,870), deduplicated globally before splitting (no train/test leakage)
  • Input: 224x224, ImageNet normalization
  • Training: 15 epochs, AdamW + OneCycleLR (max_lr 2e-4, weight_decay 0.03), tempered class-weighted CrossEntropy (label smoothing 0.1), mixed precision; augmentation = RandomResizedCrop + TrivialAugmentWide + flip + RandomErasing (train only); no test-time augmentation

Images per class (after dedup; total unique = 19,133):

ClassTrainValTestTotal
covid2,2254774773,179
lung_opacity4,0888768765,840
normal6,1521,3181,3198,789
viral_pneumonia9281991981,325
Total13,3932,8702,87019,133

Segmentation Model

Task: Binary lung-region segmentation (using the dataset's masks/)

MetricTest Score
Dice98.71%
IoU97.50%
Best Epoch15
ArchitectureSMP UNet (EfficientNet-B0 ImageNet encoder)
  • Loss: BCEWithLogits + Dice; same leakage-free split as classification; image & mask resized to 256x256; train augmentation = flip + rot90

Files:

chest_xray/
├── classification/
│   ├── best_classifier.pt
│   ├── metrics.json
│   ├── training_history.json
│   └── plots/
└── segmentation/
    ├── best_segmenter.pt
    ├── metrics.json
    ├── training_history.json
    └── plots/

2.3 Dermatology

Classification Model

Task: Classify skin lesions as malignant or non-malignant (2-class)

MetricTest Score
Accuracy92.25%
Macro F190.47%
Macro Precision89.50%
Macro Recall91.63%
Best Epoch8

Classes: malignant, non_malignant

  • Architecture: ConvNeXt-Small (torchvision IMAGENET1K_V1) + 2-class head (replaces the previous BiomedCLIP model at 88.74%)
  • Dataset: combined 2 sources for variety - HAM10000 (Kaggle surajghuwalewala/ham1000-segmentation-and-classification, 7->2 class) + fanconic/skin-cancer-malignant-vs-benign
  • Leakage-free split: HAM10000 has multiple images per lesion, so it is split by lesion_id (all images of a lesion stay in one split); fanconic uses its own official train/test holdout -> train 9,667 / val 1,489 / test 2,156
  • Training: 12 epochs @ 224px, AdamW + OneCycleLR, tempered class-weighted CE (label smoothing 0.1), mixed precision; augmentation = RandomResizedCrop + TrivialAugmentWide + flip + RandomErasing

Images per class:

ClassTrainValTestTotal
malignant2,5593075853,451
non_malignant7,1081,1821,5719,861
Total9,6671,4892,15613,312

Segmentation Model

Task: Binary lesion segmentation (HAM10000 lesion masks)

MetricTest Score
Dice95.25%
IoU91.52%
Best Epoch18
ArchitectureSegFormer-B3 (transformer)
  • Architecture: SegFormer-B3 (nvidia/segformer-b3-finetuned-ade-512-512, ADE20K-pretrained) with a 1-label binary head
  • Dataset: HAM10000 lesion masks (Kaggle surajghuwalewala/ham1000-segmentation-and-classification), 10,015 image+mask pairs
  • Split: lesion-level (by lesion_id) so the same lesion never appears in both train and test -> train 6,987 / val 1,478 / test 1,550 (no leakage)
  • Training: 18 epochs @ 256px, AdamW + OneCycleLR (max_lr 6e-5), BCEWithLogits + Dice, mixed precision; augmentation = hflip + rot90

Files:

dermatology/
├── classification/
│   ├── best_classifier.pt
│   ├── metrics.json
│   └── plots/
└── segmentation/
    ├── best_segmenter.pt
    ├── metrics.json
    └── plots/

2.4 Endoscopy

Classification Model

Task: Classify GI endoscopy images into 5 classes (healthy added vs. previous 4-class model)

MetricTest Score
Accuracy94.73%
Macro F180.35%
Macro Precision81.96%
Macro Recall79.66%
Best Epoch20

Classes: barretts, esophagitis, polyp, ulcerative_colitis, healthy

  • Architecture: ConvNeXt-Small (torchvision IMAGENET1K_V1) + fresh 5-class head (replaces the previous 4-class BiomedCLIP model)
  • Dataset: HyperKvasir labeled images (23 source classes mapped to 5 targets); barretts<-{barretts,barretts-short-segment}, esophagitis<-{esophagitis-a,esophagitis-b-d}, polyp<-{polyps}, ulcerative_colitis<-{ulcerative-colitis-grade-*}, healthy<-{cecum,pylorus,z-line,retroflex-rectum,retroflex-stomach,ileum}
  • Deduplication: near-duplicates removed via MD5 + perceptual pHash (mirror-aware) -> 6,695 unique images
  • Split: stratified 70/15/15 (train 4,686 / val 1,004 / test 1,005), deduplicated globally before splitting (no train/test leakage)
  • Input: 384x384, ImageNet normalization
  • Training: 22 epochs, AdamW + OneCycleLR (max_lr 2e-4, weight_decay 0.05), tempered class-weighted CrossEntropy (label smoothing 0.1), mixed precision; augmentation = RandomResizedCrop + TrivialAugmentWide + flip + RandomErasing (train only)
  • Eval: no test-time augmentation (single center-crop)
  • Note: barretts has only 94 images in all of HyperKvasir (66 train / 14 test), so it remains the hardest class and caps macro-F1; the other 4 classes score F1 0.84-0.99

Images per class (after dedup; total unique = 6,695):

ClassTrainValTestTotal
barretts66141494
esophagitis46310099662
polyp7131521531,018
ulcerative_colitis587126126839
healthy2,8576126134,082
Total4,6861,0041,0056,695

Segmentation Model

Task: Segment regions of interest in endoscopy images

MetricTest Score
Dice88.52%
IoU82.18%
Best Epoch38
ArchitectureSMP UNet++

Files:

endoscopy/
├── classification/
│   ├── best_classifier.pt
│   ├── metrics.json
│   └── plots/
└── segmentation/
    ├── best_segmentor.pt
    ├── metrics.json
    └── plots/

2.5 Mammography

Classification Model

Task: Classify mammogram patches as benign, malignant, or normal (3-class)

MetricTest Score
Accuracy99.63%
Macro F199.72%
Macro Precision99.71%
Macro Recall99.72%
Best Epoch12

Classes: benign, malignant, normal

  • Architecture: ResNet50 (torchvision IMAGENET1K_V2 pretrained weights) + fresh 3-class linear head
  • Dataset: INbreast + MIAS + DDSM (CLAHE preprocessed) - 26,602 raw images
  • Deduplication: 10,472 duplicate / near-duplicate images removed via MD5 + perceptual pHash (LSH banding, mirror-aware, Hamming <= 5) -> 16,130 unique images
  • Split: stratified 70/15/15 (train 11,291 / val 2,419 / test 2,420), deduplicated globally before splitting, so the held-out test set contains no image (or near-duplicate) seen in train/val - no leakage
  • Input: 224x224, grayscale replicated to 3 channels, ImageNet normalization
  • Training: 15 epochs, AdamW + OneCycleLR (max_lr 3e-4), class-weighted CrossEntropy, mixed precision
  • Augmentation (train only): RandomResizedCrop, RandomHorizontalFlip, RandomRotation(15), RandomAffine, ColorJitter, RandomErasing

Images per class (after dedup; total unique = 16,130):

ClassTrainValTestTotal
benign4,5059659666,436
malignant5,4281,1631,1637,754
normal1,3582912911,940
Total11,2912,4192,42016,130

Replaces the previous 2-class (BENIGN/MALIGNANT) BiomedCLIP mammography classifier (was 66% accuracy). The new model is a ResNet50 - load it with torchvision.models.resnet50 (see Usage below), not the BiomedCLIP loader.

Test confusion matrix (rows = true, cols = predicted benign, malignant, normal):

benign:    [963,    3,    0]
malignant: [  6, 1157,    0]
normal:    [  0,    0,  291]

Segmentation Model

Task: Binary mass segmentation in mammography (CBIS-DDSM)

|...

Sources

1 source
Hugging FacePrincipalVersion cd4f7a8f95369aadff52e33718e6e2dcbc733461
huggingface.co/umairinayat/medical-models/tree/cd4f7a8f95369aadff52e33718e6e2dcbc733461

Vérifié 2 sept.

Artefacts du modèle

15 artefacts

biomedclip_router_20260423_194004/best_biomedclip_router.pt

pt · 747 MB · SHA-256 8d84236cf687…4cab · Hugging Face

Télécharger

disease_models/breast_ultrasound/classification/best_classifier.pt

pt · 747 MB · SHA-256 89c45824012f…6a1e · Hugging Face

Télécharger

disease_models/breast_ultrasound/segmentation/best_segmenter.pt

pt · 52,6 MB · SHA-256 4fe5808fefac…08e2 · Hugging Face

Télécharger

disease_models/chest_xray/classification/best_classifier.pt

pt · 27,1 MB · SHA-256 0d18c2a0efdc…e4ca · Hugging Face

Télécharger

disease_models/chest_xray/segmentation/best_segmenter.pt

pt · 24,2 MB · SHA-256 988848e81b12…63f7 · Hugging Face

Télécharger

disease_models/dermatology/classification/best_classifier.pt

pt · 189 MB · SHA-256 4c235bab1963…8823 · Hugging Face

Télécharger

disease_models/dermatology/segmentation/best_segmenter.pt

pt · 180 MB · SHA-256 640e9cb505d4…30a1 · Hugging Face

Télécharger

disease_models/endoscopy/classification/best_classifier.pt

pt · 189 MB · SHA-256 b0033a169489…e883 · Hugging Face

Télécharger

disease_models/endoscopy/segmentation/best_segmenter.pt

pt · 52,6 MB · SHA-256 629ec6cde788…bc89 · Hugging Face

Télécharger

disease_models/fundus_retinography/classification/best_classifier.pt

pt · 747 MB · SHA-256 ebb6666ff72e…609f · Hugging Face

Télécharger

disease_models/mammography/classification/best_classifier.pt

pt · 90,0 MB · SHA-256 9e5d4f6be6d9…db2b · Hugging Face

Télécharger

disease_models/mammography/segmentation/best_segmenter.pt

pt · 180 MB · SHA-256 6add4353bd16…0cc5 · Hugging Face

Télécharger

disease_models/microscopy/classification/best_classifier.pt

pt · 747 MB · SHA-256 4367a209122f…afa7 · Hugging Face

Télécharger

disease_models/thyroid_ultrasound/classification/best_classifier.pt

pt · 747 MB · SHA-256 ae71a083430a…e947 · Hugging Face

Télécharger

disease_models/thyroid_ultrasound/segmentation/best_segmenter.pt

pt · 52,6 MB · SHA-256 10e3ee11c701…ba86 · Hugging Face

Télécharger

Extraits de sources

2 extraits

--- license: mit tags: - medical-imaging - biomedclip - resnet50 - mammography - image-classification - image-segmentation - multi-modal - healthcare - medical-ai language: - en library_name: pytorch --- # Medical Imaging Models This repository contains two complementary medical imaging AI model collections: 1. **BiomedCLIP Router** - Routes medical images to the correct imaging modality 2. **Disease-Specific Models** - Classification and segmentation models for various medical imaging domains --- ## Model 1: BiomedCLIP Router ### Description A modality classification model that routes medical images to one of 7 imaging categories. Built on Microsoft's BiomedCLIP backbone, this router enables automatic sorting of medical images to the appropriate downstream model. ### Supported Modalities | Class | Modality | |-------|----------| | 0 | Endoscopy | | 1 | Dermatology | | 2 | X-Ray | | 3 | Ultrasound | | 4 | Mammography | | 5 | Fundus / Retinography | | 6 | Microscopy | ### Performance | Metric | Test Score | |--------|------------| | Accuracy | **100%** | | Macro F1 | **100%** | | Macro Precision | **100%** | | Macro Recall | **100%** | ### Training Details - **Base Model**: `microsoft/BiomedCLIP-PubMedBERT_256-vit_base_patch16_224` - **Training Images**: 14,000 (2,000 per class) - **Validation Images**: 1,750 (250 per class) - **Test Images**: 1,750 (250 per class) - **Best Epoch**: 1 - **Validation Macro F1**: 99.94% ### Files ``` biomedclip_router_20260423_194004/ ├── best_biomedclip_router.pt # Trained model weights (748MB) ├── metrics.json # Training metrics and history ├── train.log # Training logs ├── session_name.txt # Session identifier └── unseen_holdout_300/ # Holdout test data info ``` --- ## Model 2: Disease-Specific Models A collection of specialized models for disease classification and segmentation across 8 medical imaging domains. --- ### 2.1 Breast Ultrasound #### Classification Model **Task**: Classify breast ultrasound images as benign, malignant, or normal | Metric | Test Score | |--------|------------| | Accuracy | **92.31%** | | Macro F1 | **90.75%** | | Macro Precision | **89.79%** | | Macro Recall | **91.85%** | | Best Epoch | 23 | **Classes**: `benign`, `malignant`, `normal` #### Segmentation Model **Task**: Segment lesions in breast ultrasound images | Metric | Test Score | |--------|------------| | Dice | **83...

Source context: 0 downloads · 0 likes · Pipeline image-classification · Library pytorch · Repo umairinayat/medical-models