thewtex commited on
Commit
5ea26b1
·
verified ·
1 Parent(s): 1ae16b3

Add ultrasound foundation-model TorchScript exports (USF-MAE, SAMUS, URFM, UltraFedFM)

Browse files
LICENSE.md ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Licenses
2
+
3
+ There is no single license for `fideus-labs/impact-torchscript-models`: each model keeps the one
4
+ its authors chose. The full texts are reproduced here, one per model.
5
+
6
+ | Model | License | Text |
7
+ | --- | --- | --- |
8
+ | `US/USF-MAE` | MIT | [`LICENSES/USF-MAE-MIT.txt`](LICENSES/USF-MAE-MIT.txt) |
9
+ | `US/SAMUS` | MIT | [`LICENSES/SAMUS-MIT.txt`](LICENSES/SAMUS-MIT.txt) |
10
+ | `US/URFM` | MIT | [`LICENSES/URFM-MIT.txt`](LICENSES/URFM-MIT.txt) |
11
+ | `US/UltraFedFM` | Apache-2.0 | [`LICENSES/UltraFedFM-Apache-2.0.txt`](LICENSES/UltraFedFM-Apache-2.0.txt) |
12
+
13
+ These exports are derivative works: each wraps an encoder whose weights were
14
+ trained and published by the authors named in
15
+ [`NOTICE`](NOTICE), and the weights themselves are
16
+ unmodified. The wrapper code around them (intensity normalization, layer
17
+ selection, the IMPACT forward signature) is contributed to ImpactLoss under
18
+ that project's license: <https://github.com/vboussot/ImpactLoss>
LICENSES/SAMUS-MIT.txt ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ MIT License
2
+
3
+ Copyright (c) 2023 Xian Lin
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.
LICENSES/URFM-MIT.txt ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Provenance note (not part of the license text)
2
+ ==============================================
3
+ URFM's weights live in the Hugging Face repository QingboKang/URFM, which is
4
+ gated (`gated: auto`), so its LICENSE blob cannot be retrieved without a token
5
+ and is not reproduced verbatim here. The license *claim* is public: the model
6
+ card metadata carries `license: mit`, readable without authentication at
7
+ https://huggingface.co/api/models/QingboKang/URFM (verified 2026-09-05).
8
+
9
+ The standard MIT License text follows, with the copyright attributed to the
10
+ URFM authors. Treat the upstream repository as authoritative:
11
+ https://huggingface.co/QingboKang/URFM
12
+
13
+ URFM is *not* redistributed in this Hugging Face repository — its export is
14
+ built locally from the upstream checkpoint. This file records the license the
15
+ export would carry.
16
+ ==============================================
17
+
18
+ MIT License
19
+
20
+ Copyright (c) 2025 Qingbo Kang, Qicheng Lao, Jun Gao, Wuyongga Bao, Zhu He,
21
+ Chenlin Du, Qiang Lu, Kang Li (URFM authors)
22
+
23
+ Permission is hereby granted, free of charge, to any person obtaining a copy
24
+ of this software and associated documentation files (the "Software"), to deal
25
+ in the Software without restriction, including without limitation the rights
26
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
27
+ copies of the Software, and to permit persons to whom the Software is
28
+ furnished to do so, subject to the following conditions:
29
+
30
+ The above copyright notice and this permission notice shall be included in all
31
+ copies or substantial portions of the Software.
32
+
33
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
34
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
35
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
36
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
37
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
38
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
39
+ SOFTWARE.
LICENSES/USF-MAE-MIT.txt ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Youssef Megahed
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.
LICENSES/UltraFedFM-Apache-2.0.txt ADDED
@@ -0,0 +1,201 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
NOTICE ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ fideus-labs/impact-torchscript-models
2
+
3
+ TorchScript feature extractors for ultrasound, packaged for ITKIMPACT.
4
+
5
+ These exports are DERIVATIVE WORKS. Each wraps an encoder whose weights were
6
+ trained and published by the authors named below; the weights themselves are
7
+ unmodified. Each model keeps its upstream license, reproduced in
8
+ LICENSES/ (see README.md for the per-model mapping).
9
+
10
+ US/USF-MAE (MIT, redistributed here)
11
+ Original authors: Youssef Megahed, Robin Ducharme, Aylin Erman, Mark C. Walker, Steven Hawken, Adrian D. C. Chan
12
+ Source code: https://github.com/Yusufii9/USF-MAE
13
+ License text: LICENSES/USF-MAE-MIT.txt
14
+
15
+ US/SAMUS (MIT, redistributed here)
16
+ Original authors: Xian Lin, Yangyang Xiang, Li Yu, Zengqiang Yan
17
+ Source code: https://github.com/xianlin7/SAMUS
18
+ License text: LICENSES/SAMUS-MIT.txt
19
+
20
+ US/URFM (MIT, not redistributed here)
21
+ Original authors: Qingbo Kang, Qicheng Lao, Jun Gao, Wuyongga Bao, Zhu He, Chenlin Du, Qiang Lu, Kang Li
22
+ Source code: https://huggingface.co/QingboKang/URFM
23
+ License text: LICENSES/URFM-MIT.txt
24
+
25
+ US/UltraFedFM (Apache-2.0, not redistributed here)
26
+ Original authors: Yuncheng Jiang, Chun-Mei Feng, Jinke Ren, Jun Wei, Zixun Zhang, Yiwen Hu, Yunbi Liu, Rui Sun, Xuemei Tang, Juan Du, Xiang Wan, Yong Xu, Bo Du, Xin Gao, Guangyu Wang, Shaohua Zhou, Shuguang Cui, Zhen Li
27
+ Source code: https://github.com/yuncheng97/UltraFedFM
28
+ License text: LICENSES/UltraFedFM-Apache-2.0.txt
29
+
30
+ The wrapper code around these weights (intensity normalization, layer
31
+ selection, the IMPACT forward signature) is contributed to ImpactLoss under
32
+ that project's license: https://github.com/vboussot/ImpactLoss
README.md ADDED
@@ -0,0 +1,265 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: other
3
+ license_name: per-model
4
+ license_link: LICENSE.md
5
+ tags:
6
+ - ultrasound
7
+ - itkimpact
8
+ - torchscript
9
+ - feature-extractor
10
+ - image-registration
11
+ library_name: itk-impact
12
+ ---
13
+
14
+ # IMPACT TorchScript feature extractors for ultrasound
15
+
16
+ TorchScript **feature extractors** for 2D B-mode ultrasound, packaged for
17
+ [ITKIMPACT](https://github.com/InsightSoftwareConsortium/ITKIMPACT) and
18
+ [IMPACT](https://github.com/vboussot/ImpactLoss) — the registration metric that
19
+ compares learned features instead of intensities. The layout mirrors
20
+ [`VBoussot/impact-torchscript-models`](https://huggingface.co/VBoussot/impact-torchscript-models),
21
+ the upstream repository of 30 general-purpose models: one `<Family>/<Name>.pt`
22
+ per model plus a [`models.json`](models.json) describing it, so the
23
+ same tooling reads both repositories.
24
+
25
+ Each `.pt` wraps a published ultrasound foundation model's **encoder** in the
26
+ IMPACT feature-extractor contract:
27
+
28
+ ```python
29
+ forward(
30
+ x: torch.Tensor, # (1, C, H, W)
31
+ nb_layers: torch.Tensor, # how many feature maps to return
32
+ stats: torch.Tensor, # (min, max, mean, std) from IMPACT, or empty
33
+ direction: torch.Tensor, # unused by 2D models
34
+ ) -> list[torch.Tensor] # exactly nb_layers maps, deepest last
35
+ ```
36
+
37
+ IMPACT applies no intensity preprocessing, so each wrapper carries the model's
38
+ own normalization: a raw B-mode frame goes in unchanged, single- or
39
+ three-channel.
40
+
41
+ > [!IMPORTANT]
42
+ > These are **derivative works** — TorchScript exports of weights published by
43
+ > the authors cited below, whose licenses are reproduced in
44
+ > [`LICENSES/`](LICENSES/) and whose attribution is in
45
+ > [`NOTICE`](NOTICE). The weights are unmodified; the
46
+ > wrapper adds normalization, layer selection and the forward signature above.
47
+
48
+ ## Models
49
+
50
+ | Model | Architecture | Feature layers | Dim | Input channels | `ImpactPatchSize` | License | In this repository |
51
+ | --- | --- | --- | --- | --- | --- | --- | --- |
52
+ | `US/USF-MAE` | MAE ViT-B/16 encoder, blocks 2/5/8/11 tapped as stride-16 feature maps | 4 maps, 768 channels each, stride 16 — taps after transformer blocks 2, 5, 8, 11 | 2D | 3 | `0 0` (whole frame), or any multiple of 16 | [MIT](LICENSES/USF-MAE-MIT.txt) | [`US/USF-MAE.pt`](US/USF-MAE.pt) |
53
+ | `US/SAMUS` | SAM ViT-B image encoder at 256 px, patch size 8, global-attention blocks 2/5/8/11 plus the 256-channel neck | 5 maps on a 32x32 grid from the 256 px tile — 4 x 768-channel token maps after the global-attention blocks 2, 5, 8, 11 (the last after the `x + 0.5*cnnx` fusion) plus the 256-channel SAM neck | 2D | 1 | `256 256` **only** — the traced graph is valid at that size | [MIT](LICENSES/SAMUS-MIT.txt) | [`US/SAMUS.pt`](US/SAMUS.pt) |
54
+ | `US/URFM` | MAE ViT-B/16 encoder with a BiomedCLIP representation target, blocks 2/5/8/11 tapped as stride-16 feature maps | 4 maps, 768 channels each, stride 16 — taps after transformer blocks 2, 5, 8, 11 | 2D | 3 | `0 0` (whole frame), or any multiple of 16 | [MIT](LICENSES/URFM-MIT.txt) | build it yourself |
55
+ | `US/UltraFedFM` | Federated MAE ViT-B/16 encoder, blocks 2/5/8/11 tapped as stride-16 feature maps | 4 maps, 768 channels each, stride 16 — taps after transformer blocks 2, 5, 8, 11 | 2D | 3 | `0 0` (whole frame), or any multiple of 16 | [Apache-2.0](LICENSES/UltraFedFM-Apache-2.0.txt) | build it yourself |
56
+
57
+ ### Provenance
58
+
59
+ | Model | Source code | Original weights | Paper |
60
+ | --- | --- | --- | --- |
61
+ | `US/USF-MAE` | <https://github.com/Yusufii9/USF-MAE> | <https://drive.google.com/file/d/1ZPu_7KhMEuaq-XdLhVp2EEgMgLJ4dKhr/view> | <https://doi.org/10.1016/j.bspc.2026.110313> |
62
+ | `US/SAMUS` | <https://github.com/xianlin7/SAMUS> | <https://drive.google.com/file/d/1nQjMAvbPeolNpCxQyU_HTiOiB5704pkH/view> | <https://doi.org/10.48550/arXiv.2309.06824> |
63
+ | `US/URFM` | <https://huggingface.co/QingboKang/URFM> | <https://huggingface.co/QingboKang/URFM/blob/main/mae_vit_base_patch16_dec768d8b_all_biomedclip_1199.pth> | <https://doi.org/10.1016/j.isci.2025.112917> |
64
+ | `US/UltraFedFM` | <https://github.com/yuncheng97/UltraFedFM> | <https://drive.google.com/file/d/13cczqVFk84c_9QDP2OLURU1jWryCky5f/view> | <https://doi.org/10.1038/s41746-025-02085-0> |
65
+
66
+ ### Not redistributed here
67
+
68
+ Catalogued, licensed and buildable, but not shipped here: `US/URFM`, `US/UltraFedFM`.
69
+ Their upstream checkpoints sit behind a sign-in — a gated Hugging Face
70
+ repository, and cloud shares scoped to specific accounts — so nothing
71
+ here can fetch them for you. Build them yourself with the scripts in
72
+ `Data/Models/builds/US/` (see **Reproducing these exports** below); the
73
+ exports drop straight into the same `US/` layout.
74
+
75
+ ## Usage — Python
76
+
77
+ ```python
78
+ import itk
79
+ import torch
80
+ from huggingface_hub import hf_hub_download
81
+
82
+ model_path = hf_hub_download(
83
+ repo_id="fideus-labs/impact-torchscript-models",
84
+ filename="US/USF-MAE.pt",
85
+ local_dir="models",
86
+ )
87
+
88
+ frame = itk.imread("bmode.mha", itk.F) # a 2D itk.Image[itk.F, 2] B-mode frame
89
+
90
+ # Voxel size = the frame's own spacing, so IMPACT does not resample and the
91
+ # feature image lands pixel-for-pixel on the input grid.
92
+ config = itk.ModelConfiguration(
93
+ model_path, # TorchScript file
94
+ 2, # dimension (models.json)
95
+ 3, # numberofchannels (models.json)
96
+ [0, 0], # patch size; 0 0 = whole frame
97
+ [float(spacing) for spacing in frame.GetSpacing()],
98
+ 0, # patch overlap
99
+ [False, False, False, True], # layers mask: ask for 4, keep the deepest
100
+ False, # useMixedPrecision
101
+ )
102
+
103
+ interpolator = itk.BSplineInterpolateImageFunction[type(frame), itk.D, itk.F]
104
+ extractor = itk.ImageToFeaturesMap[type(frame), interpolator].New()
105
+ extractor.SetModelConfiguration(config)
106
+ extractor.SetDevice("cuda:0" if torch.cuda.is_available() else "cpu")
107
+ extractor.AddInput(frame)
108
+ extractor.Update()
109
+
110
+ features = extractor.GetOutput(0) # itk.VectorImage, 768 components per pixel
111
+ ```
112
+
113
+ The **layers mask does double duty**: its length is how many feature maps
114
+ IMPACT asks the model for, and each `1` keeps that map. `[0, 0, 0, 1]` on a
115
+ 4-layer model therefore means "compute all four, keep the deepest".
116
+
117
+ For `US/SAMUS`, pass `1` input channel, `[256, 256]` as the patch size, and a
118
+ **5**-element mask (`[0, 0, 0, 0, 1]` keeps the 256-channel SAM neck).
119
+
120
+ As a registration loss in PyTorch, with
121
+ [ImpactLoss](https://github.com/vboussot/ImpactLoss):
122
+
123
+ ```python
124
+ from IMPACT import IMPACTReg
125
+
126
+ loss = IMPACTReg(
127
+ "US/USF-MAE.pt",
128
+ shape=[0, 0],
129
+ in_channels=1,
130
+ weights=[0, 0, 0, 1],
131
+ repo_id="fideus-labs/impact-torchscript-models",
132
+ )
133
+ ```
134
+
135
+ ## Usage — Elastix
136
+
137
+ One resolution of `ParameterMaps/ParameterMap_US_2D_Static.txt`
138
+ (`ImpactVoxelSize` is the spacing the frame is resampled to; one token spans
139
+ 16 voxels, so this level extracts features at 4 mm per token — roughly the
140
+ native spacing of a curvilinear B-mode frame):
141
+
142
+ ```txt
143
+ (Metric "Impact")
144
+ (ImpactMode "Static")
145
+
146
+ (ImpactModelsPath0 "/Data/Models/US/USF-MAE.pt")
147
+ (ImpactDimension0 2)
148
+ (ImpactNumberOfChannels0 3)
149
+ (ImpactPatchSize0 0 0)
150
+ (ImpactVoxelSize0 0.25 0.25)
151
+ (ImpactLayersMask0 "0001")
152
+ (ImpactPCA0 0)
153
+ (ImpactSubsetFeatures0 64)
154
+ (ImpactDistance0 "L2")
155
+ (ImpactLayersWeight0 1)
156
+ ```
157
+
158
+ `ImpactModelsPath` is resolved inside the IMPACT model directory, so
159
+ `US/USF-MAE.pt` sits where `sh Data/Models/download_models.sh` puts it. The
160
+ mask is a string here and one bit long per feature layer: 4 bits for the MAE
161
+ models, 5 for `US/SAMUS`, which also needs `(ImpactPatchSize 256 256)` and
162
+ `(ImpactNumberOfChannels 1)`.
163
+
164
+ ## Reproducing these exports
165
+
166
+ Every model here is built from its upstream checkpoint by a standalone script
167
+ in `Data/Models/builds/US/` of
168
+ [ImpactLoss](https://github.com/vboussot/ImpactLoss) — download, wrap, check
169
+ the layer contract, `torch.jit` export. The scripts import only `torch`,
170
+ `gdown` and `huggingface_hub`, and write `./<Name>.pt` into the working
171
+ directory, so a rebuild is:
172
+
173
+ ```bash
174
+ cd Data/Models/builds/US
175
+ python USF-MAE.py # -> ./USF-MAE.pt
176
+ ```
177
+
178
+ The exports are reproducible in *behaviour*, not byte-for-byte: TorchScript
179
+ archives differ between runs, but a rebuilt model returns feature maps
180
+ identical to these (max absolute difference 0.0, checked across every layer
181
+ count, several input shapes and both normalization paths).
182
+
183
+ ## Licensing
184
+
185
+ There is no single license: each model keeps the one its authors chose.
186
+ The texts are in [`LICENSES/`](LICENSES/), one per model,
187
+ indexed by [`LICENSE.md`](LICENSE.md), and
188
+ [`NOTICE`](NOTICE) names the original authors. The
189
+ `license: other` / `license_name: per-model` front matter above says the same
190
+ thing in Hugging Face's vocabulary.
191
+
192
+ Models whose licenses did **not** permit redistribution — several published
193
+ ultrasound foundation models are CC BY-NC or carry no license at all — were
194
+ excluded rather than repackaged.
195
+
196
+ ## Integrity
197
+
198
+ [`SHA256SUMS`](SHA256SUMS) covers every other file:
199
+
200
+ ```bash
201
+ sha256sum -c SHA256SUMS
202
+ ```
203
+
204
+ ## Citation
205
+
206
+ Cite the original work, not this packaging:
207
+
208
+ ```bibtex
209
+ @article{megahed2026usfmae,
210
+ title = {USF-MAE: Ultrasound self-supervised foundation model with masked autoencoding},
211
+ author = {Megahed, Youssef and Ducharme, Robin and Erman, Aylin and
212
+ Walker, Mark C. and Hawken, Steven and Chan, Adrian D. C.},
213
+ journal = {Biomedical Signal Processing and Control},
214
+ volume = {122},
215
+ pages = {110313},
216
+ year = {2026},
217
+ doi = {10.1016/j.bspc.2026.110313}
218
+ }
219
+ ```
220
+
221
+ ```bibtex
222
+ @misc{lin2023samus,
223
+ title = {SAMUS: Adapting Segment Anything Model for Clinically-Friendly and
224
+ Generalizable Ultrasound Image Segmentation},
225
+ author = {Lin, Xian and Xiang, Yangyang and Yu, Li and Yan, Zengqiang},
226
+ year = {2023},
227
+ eprint = {2309.06824},
228
+ archivePrefix = {arXiv},
229
+ primaryClass = {cs.CV},
230
+ doi = {10.48550/arXiv.2309.06824},
231
+ note = {Later arXiv versions are titled "Beyond Adapting SAM: Towards
232
+ End-to-End Ultrasound Image Segmentation via Auto Prompting"}
233
+ }
234
+ ```
235
+
236
+ ```bibtex
237
+ @article{kang2025urfm,
238
+ title = {URFM: A general Ultrasound Representation Foundation Model for advancing
239
+ ultrasound image diagnosis},
240
+ author = {Kang, Qingbo and Lao, Qicheng and Gao, Jun and Bao, Wuyongga and He, Zhu and
241
+ Du, Chenlin and Lu, Qiang and Li, Kang},
242
+ journal = {iScience},
243
+ volume = {28},
244
+ number = {8},
245
+ pages = {112917},
246
+ year = {2025},
247
+ doi = {10.1016/j.isci.2025.112917}
248
+ }
249
+ ```
250
+
251
+ ```bibtex
252
+ @article{jiang2025ultrafedfm,
253
+ title = {From pretraining to privacy: federated ultrasound foundation model with
254
+ self-supervised learning},
255
+ author = {Jiang, Yuncheng and Feng, Chun-Mei and Ren, Jinke and Wei, Jun and
256
+ Zhang, Zixun and Hu, Yiwen and Liu, Yunbi and Sun, Rui and Tang, Xuemei and
257
+ Du, Juan and Wan, Xiang and Xu, Yong and Du, Bo and Gao, Xin and
258
+ Wang, Guangyu and Zhou, Shaohua and Cui, Shuguang and Li, Zhen},
259
+ journal = {npj Digital Medicine},
260
+ volume = {8},
261
+ number = {1},
262
+ year = {2025},
263
+ doi = {10.1038/s41746-025-02085-0}
264
+ }
265
+ ```
SHA256SUMS ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ 11335f24def485b29b270936ea7a1e34880f7360c0db24a63127e752347ec458 US/USF-MAE.pt
2
+ 5d0010dad0ba9512a03c2a127ae1acb9b11f57ce06b381c88c2c4bce7d29b2f1 US/SAMUS.pt
3
+ 8fe71fe20dec47a6473a402dd81e6c590276191f54c059684c64847022850455 models.json
4
+ a9db86fbbef06c3657bb95867eba091e3a179f108c0e0a6d9509bfbe4918a8d2 LICENSES/USF-MAE-MIT.txt
5
+ 88430d394e3a094b141f5968b9afdee3abb47460f6b67594838b80056b72439e LICENSES/SAMUS-MIT.txt
6
+ 1882cb94c8d99452dce5548334f25810eb85b24df0ef51760ab0851eacdcf958 LICENSES/URFM-MIT.txt
7
+ c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4 LICENSES/UltraFedFM-Apache-2.0.txt
8
+ 53008676704421836a8e8733f1fd053613f7e7e8f5fabf5f64db31b5d71397ee LICENSE.md
9
+ bd7cec35d20a4be5bfe264e7a1f58f3e663f3bf1ff89fdfce7eac2b41536b45f NOTICE
10
+ 01c1c6900e1705c9485f044593a44074bd63cb9210a6ebad7c462a1df360bb10 README.md
US/SAMUS.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5d0010dad0ba9512a03c2a127ae1acb9b11f57ce06b381c88c2c4bce7d29b2f1
3
+ size 517455255
US/USF-MAE.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:11335f24def485b29b270936ea7a1e34880f7360c0db24a63127e752347ec458
3
+ size 343275843
models.json ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "US/USF-MAE.pt": {
3
+ "fov": {
4
+ "formula": "Global(ViT-B/16, stride 16)"
5
+ },
6
+ "dimension": "2",
7
+ "numberofchannels": "3",
8
+ "layers": 4,
9
+ "license": "MIT",
10
+ "patch_size": null,
11
+ "size_multiple": 16,
12
+ "source": {
13
+ "name": "USF-MAE",
14
+ "code": "https://github.com/Yusufii9/USF-MAE",
15
+ "weights": "https://drive.google.com/file/d/1ZPu_7KhMEuaq-XdLhVp2EEgMgLJ4dKhr/view",
16
+ "paper": "https://doi.org/10.1016/j.bspc.2026.110313",
17
+ "architecture": "MAE ViT-B/16 encoder, blocks 2/5/8/11 tapped as stride-16 feature maps",
18
+ "checkpoint_sha256": "f815c629878c17136985af9f4fdc81c2cfa02a94e4d992c026699957f75ccb66"
19
+ }
20
+ },
21
+ "US/SAMUS.pt": {
22
+ "fov": {
23
+ "formula": "Global(256 px tile, stride 8)"
24
+ },
25
+ "dimension": "2",
26
+ "numberofchannels": "1",
27
+ "layers": 5,
28
+ "license": "MIT",
29
+ "patch_size": 256,
30
+ "size_multiple": null,
31
+ "source": {
32
+ "name": "SAMUS",
33
+ "code": "https://github.com/xianlin7/SAMUS",
34
+ "weights": "https://drive.google.com/file/d/1nQjMAvbPeolNpCxQyU_HTiOiB5704pkH/view",
35
+ "paper": "https://doi.org/10.48550/arXiv.2309.06824",
36
+ "architecture": "SAM ViT-B image encoder at 256 px, patch size 8, global-attention blocks 2/5/8/11 plus the 256-channel neck",
37
+ "checkpoint_sha256": "a95de25d7b9065a92e268d73b1e76b871d7b0e4e66ce872b1e298f5b6c446fc4"
38
+ }
39
+ }
40
+ }