Open-source pathology foundation model: a 1.1B-parameter ViT-G/14 trained on 12k public TCGA slides in 320 H100 GPU-hours, with code and weights.
No providers recorded yet. Browse all providers
OpenMidnight is a self-supervised vision foundation model for histopathology, built by the open research community MedARC and the medical AI company Sophont with volunteer contributors at several universities and MD Anderson Cancer Center. It is an independent, fully open replication and refinement of kaiko.ai's Midnight recipe, which showed that a pathology encoder trained on roughly 12,000 public whole-slide images from The Cancer Genome Atlas (TCGA) could compete with models trained on orders of magnitude more slides. Midnight's training code was never published; OpenMidnight releases the training code, preprocessing pipeline, tile corpus and weights.
The project has two releases under one name. OpenMidnight (1.0) appeared in November 2025 as a Sophont technical report and blog post, trained in about 3.5 days on a single node of eight H100 GPUs at an estimated cost of $1,600. OpenMidnight 1.1, described in an October 2026 arXiv preprint led by Ratna Sagari Grandhi and Paul S. Scotti, corrects an inverted sign in the KDE regularizer of the original implementation, shortens the training schedule, adds antialiased positional-embedding interpolation, and averages several teacher checkpoints into the released model. It is a separately trained checkpoint, not a fine-tune of Midnight's weights.
The technique is DINOv2-style self-distillation adapted to stained tissue: a student sees local and global crops of a tile and learns to match a slowly updated teacher, while a masked-patch objective makes it infer hidden tissue from context. No labels are involved.
timm, and returns a 1,536-dimensional CLS-token embedding per 224 x 224 tile.OpenMidnight 1.1 is a ViT-G/14 vision transformer with four register tokens and 1.13 billion parameters, initialized from Meta's pretrained DINOv2 ViT-G/14 checkpoint with its positional embeddings resized from a 37 x 37 to a 16 x 16 grid. Pretraining combines the DINO class-token loss, the iBOT masked-patch loss (each head scoring 131,072 prototypes) and the KDE regularizer at weight 0.05. The corpus is about 12,000 TCGA H&E slides from 31 projects spanning 24 primary sites; tiles pass a Midnight-style HSV tissue filter requiring more than 60% tissue-colored pixels. Training uses AdamW at a global batch of 384, a peak learning rate of about 1.84 x 10^-4, eight 98-pixel local crops and two 224-pixel global crops per tile, and stochastic depth of 0.4. The released weights average five teacher checkpoints from steps 87,500 to 137,500.
On THUNDER, with the encoder frozen across 16 classification and four segmentation datasets, OpenMidnight 1.1 reaches a mean linear-probing F1 of 85.2, KNN F1 of 80.8, 16-shot F1 of 74.0 and the highest mean segmentation Dice of any model tested, 69.7. It ranks fourth of 14 models by summed rank, behind UNI2-h, GenBio-PathFM and Virchow2, and ahead of Midnight; its calibration error (5.8) is among the weakest in the comparison. The original 1.0 checkpoint ranks well below 1.1 on the same benchmark, mainly from a 16-shot F1 of 43.6. Ablations show DINOv2 initialization outperforming random initialization throughout training, only a 0.008 drop in mean EVA score when pretraining on 25% of slides, and a decline on breast tasks when breast slides are excluded.
OpenMidnight serves as a frozen tile-level feature extractor for computational pathology: tumor and tissue-type classification, cancer subtyping, Gleason pattern mapping, nuclei and tissue segmentation, and spatial gene-expression regression from H&E tiles. Slide-level predictions require a downstream aggregation model. Because the training pipeline and data are public, it is equally useful as a baseline for methods research, letting groups test changes to initialization, data composition or objectives without assembling a proprietary slide archive. The authors describe it as a research model that needs independent validation before any clinical use.
OpenMidnight makes the low-data pathology foundation model argument reproducible: an outside group reran Midnight's result from public code and data on a single eight-GPU node, then improved on it. Its ablations give other groups measured starting points for their own training recipes. All reported results are retrospective benchmarks on public datasets rather than prospective clinical studies.
Much of this page is generated or calculated automatically. Flag anything that looks off and we will re-run it.