Add compact teacher inference weights and updated BRFound overview
Browse files- .gitattributes +1 -0
- Model_Overview.png +3 -0
- README.md +46 -6
- inference_config.json +13 -0
- slide_encoder_inference.pth +3 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
Model_Overview.png filter=lfs diff=lfs merge=lfs -text
|
Model_Overview.png
ADDED
|
Git LFS Details
|
README.md
CHANGED
|
@@ -1,6 +1,46 @@
|
|
| 1 |
-
---
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
--
|
| 5 |
-
|
| 6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
tags:
|
| 4 |
+
- computational-pathology
|
| 5 |
+
- breast-cancer
|
| 6 |
+
- feature-extraction
|
| 7 |
+
---
|
| 8 |
+
|
| 9 |
+
# BRFound
|
| 10 |
+
|
| 11 |
+
A breast-specific slide-level foundation model for computational pathology.
|
| 12 |
+
Implementation and preprocessing examples:
|
| 13 |
+
[wyh196646/BRFound](https://github.com/wyh196646/BRFound).
|
| 14 |
+
|
| 15 |
+

|
| 16 |
+
|
| 17 |
+
## Weights
|
| 18 |
+
|
| 19 |
+
| File | Contents |
|
| 20 |
+
| --- | --- |
|
| 21 |
+
| `patch_encoder.pth` | Released BRFound patch encoder |
|
| 22 |
+
| `slide_encoder.pth` | Original epoch-161 slide training checkpoint |
|
| 23 |
+
| `slide_encoder_inference.pth` | Plain state dictionary of the same teacher backbone |
|
| 24 |
+
| `inference_config.json` | Epoch, dimensions and checkpoint checksums |
|
| 25 |
+
|
| 26 |
+
The October 2026 update adds a compact inference export and the current overview.
|
| 27 |
+
The numerical model parameters are unchanged. The existing patch and training weights
|
| 28 |
+
are retained for compatibility.
|
| 29 |
+
|
| 30 |
+
## Slide embedding
|
| 31 |
+
|
| 32 |
+
Use the repository's `inference.py` with `slide_encoder_inference.pth`. Input is an HDF5
|
| 33 |
+
file containing BRFound patch `features` of shape `[N, 768]` and matching `coords` of
|
| 34 |
+
shape `[N, 2]` on the training pipeline's 256-pixel coordinate grid.
|
| 35 |
+
|
| 36 |
+
```bash
|
| 37 |
+
python inference.py --features features.h5 --weights slide_encoder_inference.pth --output slide_embedding.npy --device cpu
|
| 38 |
+
```
|
| 39 |
+
|
| 40 |
+
The output has shape `[1, 768]`. The default sampler uses eight clusters, a 25% ratio,
|
| 41 |
+
a 4,000-token cap and seed 42. Full usage and preprocessing instructions are in the
|
| 42 |
+
[code repository](https://github.com/wyh196646/BRFound).
|
| 43 |
+
|
| 44 |
+
These are research representations; downstream clinical use requires task-specific
|
| 45 |
+
validation. The release checks cover CPU inference and equivalence of the compact
|
| 46 |
+
weights and positional encoding to the original implementation.
|
inference_config.json
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"release_date": "2026-10-08",
|
| 3 |
+
"architecture": "ViT-Base slide encoder",
|
| 4 |
+
"input_feature_dimension": 768,
|
| 5 |
+
"output_embedding_dimension": 768,
|
| 6 |
+
"checkpoint_epoch": 161,
|
| 7 |
+
"weight_source": "teacher.backbone",
|
| 8 |
+
"training_checkpoint_sha256": "f43db5677111ad2db73ad21df6a0dba0e2bdcaa00419d0c0d76b2f21f041fb23",
|
| 9 |
+
"inference_weights_sha256": "53c3ec1a9b0be69860ab1d3fbe1a78395de5f5001db75dddc36a26aa76f80370",
|
| 10 |
+
"inference_weights_bytes": 342637765,
|
| 11 |
+
"parameters_changed": false,
|
| 12 |
+
"note": "Inference-only export of the released epoch-161 teacher; no retraining."
|
| 13 |
+
}
|
slide_encoder_inference.pth
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:53c3ec1a9b0be69860ab1d3fbe1a78395de5f5001db75dddc36a26aa76f80370
|
| 3 |
+
size 342637765
|