WUT-AI-AI4Mat commited on
Commit
53d2fae
·
verified ·
1 Parent(s): 7cccb57

Upload model card and dataset checkpoints

Browse files
CHECKSUMS.sha256 ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ cdb97adbc50608525962d6bf39803c9e13e6d87f5589296db53a86b3765219a2 checkpoints/Aachen-Heerlen/microsam_lora_decoder_best.pth
2
+ a9901554236cbde55fb7bba896e99347a4dd6a15e26e19df0f64fc1fd198f37d checkpoints/EBC/semantic_microsam_best.pth
3
+ acd96d5a026a3fd3288b191ee92692a22860a0d05b50458457ddf162239daa87 checkpoints/EMPS/microsam_lora_decoder_best.pth
4
+ 69f7e3ce2aa76e79bb87818483c33a18bd5a353990f86bcfe77c8e5b94ab3c23 checkpoints/Grain/microsam_lora_decoder_best.pth
5
+ 965f1d87cbbb644301595135e4d83726b2242277a68fcea80f433f0888c95193 checkpoints/MetalDAM/semantic_microsam_best.pth
6
+ c55d2f3df5534b56b49584f6de879c782a81a4096273ccca4409e16c6136c258 checkpoints/Super/semantic_microsam_best.pth
7
+ dc541c823ea9f55bc932c6c1beb5b58d7341f545dffb78ff0e2dc6d388fae4eb checkpoints/UHCS/semantic_microsam_best.pth
LICENSE ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ MIT License
2
+
3
+ Copyright (c) 2026 The Material Image Segmentation Benchmark Authors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
README.md ADDED
@@ -0,0 +1,104 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ library_name: pytorch
4
+ pipeline_tag: image-segmentation
5
+ tags:
6
+ - semantic-segmentation
7
+ - microstructure
8
+ - microscopy
9
+ - materials-science
10
+ - segment-anything
11
+ - lora
12
+ - micro-sam
13
+ ---
14
+
15
+ # MicroSAM Fine-Tuned Checkpoints for Microstructure Segmentation
16
+
17
+ ## Model Description
18
+
19
+ This repository contains dataset-specific fine-tuned parameter checkpoints for
20
+ the MicroSAM `vit_b_lm` model. The files contain fine-tuned parameters rather
21
+ than a complete base model. The matching scripts obtain the `vit_b_lm` base
22
+ model through `micro_sam.util.get_sam_model` and then load these parameters.
23
+
24
+ Source code:
25
+ https://github.com/WUT-AI-AI4Mat/microstructure-segmentation-benchmark
26
+
27
+ ## Fine-Tuning Routes and Checkpoints
28
+
29
+ | Dataset | Route | Classes | File |
30
+ | --- | --- | ---: | --- |
31
+ | Aachen-Heerlen | LoRA plus mask decoder | 2 | `checkpoints/Aachen-Heerlen/microsam_lora_decoder_best.pth` |
32
+ | EMPS | LoRA plus mask decoder | 2 | `checkpoints/EMPS/microsam_lora_decoder_best.pth` |
33
+ | Grain | LoRA plus mask decoder | 2 | `checkpoints/Grain/microsam_lora_decoder_best.pth` |
34
+ | EBC | LoRA, mask decoder, and class tokens | 3 | `checkpoints/EBC/semantic_microsam_best.pth` |
35
+ | Super | LoRA, mask decoder, and class tokens | 3 | `checkpoints/Super/semantic_microsam_best.pth` |
36
+ | MetalDAM | LoRA, mask decoder, and class tokens | 5 | `checkpoints/MetalDAM/semantic_microsam_best.pth` |
37
+ | UHCS | LoRA, mask decoder, and class tokens | 7 | `checkpoints/UHCS/semantic_microsam_best.pth` |
38
+
39
+ Class counts include background.
40
+
41
+ ## Base Model Requirement
42
+
43
+ Initialize the required base model with:
44
+
45
+ ```bash
46
+ python -c "from micro_sam.util import get_sam_model; get_sam_model(model_type='vit_b_lm')"
47
+ ```
48
+
49
+ The corresponding BioImage.IO checkpoint is available at:
50
+ https://uk1s3.embassy.ebi.ac.uk/public-datasets/bioimage.io/diplomatic-bug/1.2/files/vit_b.pt
51
+
52
+ ## Training Details
53
+
54
+ - Base architecture: MicroSAM ViT-B-LM
55
+ - SAM encoder input: longest side resized and padded to 1024 x 1024
56
+ - Training batch size: 1
57
+ - Epochs: 200
58
+ - Optimizer: AdamW
59
+ - Learning rate: 0.0001
60
+ - Weight decay: 0.0001
61
+ - Scheduler: CosineAnnealingLR with minimum learning rate 0.000001
62
+ - Early-stopping patience: 50
63
+ - LoRA rank: 8
64
+ - LoRA alpha: 16
65
+ - LoRA dropout: 0.05
66
+ - LoRA targets: `qkv` and `proj`
67
+ - Binary objective: BCE, Dice, and IoU MSE
68
+ - Multiclass objective: cross-entropy and Dice
69
+
70
+ ## Usage
71
+
72
+ Example for binary EMPS segmentation:
73
+
74
+ ```bash
75
+ hf download NAMESPACE/microstructure-micro-sam checkpoints/EMPS/microsam_lora_decoder_best.pth --local-dir weights/micro-sam
76
+ python microsam/test_lora_decoder.py \
77
+ --dataset-root /path/to/EMPS \
78
+ --finetuned-checkpoint weights/micro-sam/checkpoints/EMPS/microsam_lora_decoder_best.pth \
79
+ --output-dir results/micro_sam_emps
80
+ ```
81
+
82
+ For multiclass checkpoints, use `microsam/test_semantic_microsam.py` and pass
83
+ the class count from the table.
84
+
85
+ ## Inference Parameters
86
+
87
+ Automatic instance segmentation uses `min_size=10`,
88
+ `center_distance_threshold=0.5`, and `boundary_distance_threshold=0.5`.
89
+
90
+ ## Evaluation, Intended Use, and Limitations
91
+
92
+ Evaluation saves original-resolution masks and calculates the common benchmark
93
+ metrics through `Myutils/metrics.py`. These checkpoints require the matching
94
+ MicroSAM `vit_b_lm` base model and source environment. MicroSAM dependencies
95
+ such as `vigra` and `python-elf` are most reliably installed through the
96
+ official Conda environment on Linux. The checkpoints are intended for research
97
+ reproduction and are not validated for safety-critical or industrial
98
+ quality-control decisions.
99
+
100
+ ## License and Citation
101
+
102
+ The released experiment files are provided under the MIT license. MicroSAM and
103
+ its base model remain subject to upstream terms and the base checkpoint is not
104
+ redistributed here. A paper citation will be added after publication.
checkpoint_manifest.json ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "model": "MicroSAM ViT-B-LM",
3
+ "source_code": "https://github.com/WUT-AI-AI4Mat/microstructure-segmentation-benchmark",
4
+ "checkpoint_count": 7,
5
+ "checkpoints": [
6
+ {
7
+ "dataset": "Aachen-Heerlen",
8
+ "task": "binary_segmentation",
9
+ "num_classes": 2,
10
+ "fine_tuning_route": "lora_and_mask_decoder",
11
+ "path": "checkpoints/Aachen-Heerlen/microsam_lora_decoder_best.pth",
12
+ "size_bytes": 18113211,
13
+ "sha256": "cdb97adbc50608525962d6bf39803c9e13e6d87f5589296db53a86b3765219a2",
14
+ "requires_base_checkpoint": "vit_b_lm"
15
+ },
16
+ {
17
+ "dataset": "EBC",
18
+ "task": "multiclass_semantic_segmentation",
19
+ "num_classes": 3,
20
+ "fine_tuning_route": "lora_mask_decoder_and_class_tokens",
21
+ "path": "checkpoints/EBC/semantic_microsam_best.pth",
22
+ "size_bytes": 18117576,
23
+ "sha256": "a9901554236cbde55fb7bba896e99347a4dd6a15e26e19df0f64fc1fd198f37d",
24
+ "requires_base_checkpoint": "vit_b_lm"
25
+ },
26
+ {
27
+ "dataset": "EMPS",
28
+ "task": "binary_segmentation",
29
+ "num_classes": 2,
30
+ "fine_tuning_route": "lora_and_mask_decoder",
31
+ "path": "checkpoints/EMPS/microsam_lora_decoder_best.pth",
32
+ "size_bytes": 18113211,
33
+ "sha256": "acd96d5a026a3fd3288b191ee92692a22860a0d05b50458457ddf162239daa87",
34
+ "requires_base_checkpoint": "vit_b_lm"
35
+ },
36
+ {
37
+ "dataset": "Grain",
38
+ "task": "binary_segmentation",
39
+ "num_classes": 2,
40
+ "fine_tuning_route": "lora_and_mask_decoder",
41
+ "path": "checkpoints/Grain/microsam_lora_decoder_best.pth",
42
+ "size_bytes": 18113211,
43
+ "sha256": "69f7e3ce2aa76e79bb87818483c33a18bd5a353990f86bcfe77c8e5b94ab3c23",
44
+ "requires_base_checkpoint": "vit_b_lm"
45
+ },
46
+ {
47
+ "dataset": "MetalDAM",
48
+ "task": "multiclass_semantic_segmentation",
49
+ "num_classes": 5,
50
+ "fine_tuning_route": "lora_mask_decoder_and_class_tokens",
51
+ "path": "checkpoints/MetalDAM/semantic_microsam_best.pth",
52
+ "size_bytes": 18119624,
53
+ "sha256": "965f1d87cbbb644301595135e4d83726b2242277a68fcea80f433f0888c95193",
54
+ "requires_base_checkpoint": "vit_b_lm"
55
+ },
56
+ {
57
+ "dataset": "Super",
58
+ "task": "multiclass_semantic_segmentation",
59
+ "num_classes": 3,
60
+ "fine_tuning_route": "lora_mask_decoder_and_class_tokens",
61
+ "path": "checkpoints/Super/semantic_microsam_best.pth",
62
+ "size_bytes": 18117576,
63
+ "sha256": "c55d2f3df5534b56b49584f6de879c782a81a4096273ccca4409e16c6136c258",
64
+ "requires_base_checkpoint": "vit_b_lm"
65
+ },
66
+ {
67
+ "dataset": "UHCS",
68
+ "task": "multiclass_semantic_segmentation",
69
+ "num_classes": 7,
70
+ "fine_tuning_route": "lora_mask_decoder_and_class_tokens",
71
+ "path": "checkpoints/UHCS/semantic_microsam_best.pth",
72
+ "size_bytes": 18121672,
73
+ "sha256": "dc541c823ea9f55bc932c6c1beb5b58d7341f545dffb78ff0e2dc6d388fae4eb",
74
+ "requires_base_checkpoint": "vit_b_lm"
75
+ }
76
+ ]
77
+ }
checkpoints/Aachen-Heerlen/microsam_lora_decoder_best.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cdb97adbc50608525962d6bf39803c9e13e6d87f5589296db53a86b3765219a2
3
+ size 18113211
checkpoints/EBC/semantic_microsam_best.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a9901554236cbde55fb7bba896e99347a4dd6a15e26e19df0f64fc1fd198f37d
3
+ size 18117576
checkpoints/EMPS/microsam_lora_decoder_best.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:acd96d5a026a3fd3288b191ee92692a22860a0d05b50458457ddf162239daa87
3
+ size 18113211
checkpoints/Grain/microsam_lora_decoder_best.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:69f7e3ce2aa76e79bb87818483c33a18bd5a353990f86bcfe77c8e5b94ab3c23
3
+ size 18113211
checkpoints/MetalDAM/semantic_microsam_best.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:965f1d87cbbb644301595135e4d83726b2242277a68fcea80f433f0888c95193
3
+ size 18119624
checkpoints/Super/semantic_microsam_best.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c55d2f3df5534b56b49584f6de879c782a81a4096273ccca4409e16c6136c258
3
+ size 18117576
checkpoints/UHCS/semantic_microsam_best.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dc541c823ea9f55bc932c6c1beb5b58d7341f545dffb78ff0e2dc6d388fae4eb
3
+ size 18121672