Instructions to use ntuhophai/ERM-AI with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- timm
How to use ntuhophai/ERM-AI with timm:
import timm model = timm.create_model("hf-hub:ntuhophai/ERM-AI", pretrained=True) - Notebooks
- Google Colab
- Kaggle
Publish public model models/single_color_full/fold_4
Browse files
models/single_color_full/fold_4/README.md
CHANGED
|
@@ -1,4 +1,8 @@
|
|
| 1 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
tags:
|
| 3 |
- pytorch
|
| 4 |
- timm
|
|
@@ -7,43 +11,47 @@ tags:
|
|
| 7 |
- research
|
| 8 |
---
|
| 9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
# Multistream model artifact
|
| 11 |
|
| 12 |
This is a research artifact. This export does not establish whether training used real or synthetic data, independent validation, or clinical readiness.
|
| 13 |
|
| 14 |
Architecture: resnet50; hidden dimension: 2048.
|
| 15 |
|
| 16 |
-
Ordered streams: ["color_full"]
|
| 17 |
|
| 18 |
-
Class mapping: {"bad": 0, "good": 1}
|
| 19 |
|
| 20 |
Class names are labels only; do not infer healthy/diseased semantics without the study definition.
|
| 21 |
|
| 22 |
The source is a legacy model. Architecture and tensor keys/shapes were checked strictly, but the historical stream order, label meaning and preprocessing cannot be proved from weights. These settings were supplied by the operator. Earlier experiments used case-level random folds with identified patient-overlap concerns and selected epochs on validation accuracy. Their scores must not be presented as independent patient-grouped cross-validation results. Converted format does not correct those experiments.
|
| 23 |
|
|
|
|
| 24 |
|
| 25 |
-
Public code: https://github.com/chou141253/ERM-AI/tree/7687fab91d129f51db32c663ea0122b9b69b75b9/new
|
| 26 |
## Loading this condition and fold
|
| 27 |
|
| 28 |
-
Install the code repository requirements and run from its new/ directory. The shared loader and requirements live at the collection root, not in this model directory.
|
| 29 |
|
| 30 |
```bash
|
| 31 |
python tools/infer_published.py --repo ntuhophai/ERM-AI --condition single_color_full --fold 4 --root /path/to/cases --output predictions/single_color_full_fold4
|
| 32 |
```
|
| 33 |
|
| 34 |
-
Before the model PR is merged, append --revision refs/pr/<number>; after merge the default main revision can be used.
|
| 35 |
|
| 36 |
Only the selected weights/config are downloaded. Provide one image for each ordered stream. The local tool uses its trusted model definition and saves class probabilities.
|
| 37 |
|
| 38 |
## Preprocessing and verification
|
| 39 |
|
| 40 |
-
config.json records the RGB resize backend, bilinear interpolation, center crop and normalization. For raw legacy exports, verify these operator-supplied settings against the original experiment. Export verification checks every tensor key and shape and rejects nonfinite floating-point weights; it does not run inference or validate performance.
|
| 41 |
|
| 42 |
## License
|
| 43 |
|
| 44 |
No model license was inferred by the exporter. Supply the authorized model license and complete the study-specific model card before treating this as a documented release.
|
| 45 |
|
| 46 |
-
Collection condition: single_color_full; zero-based fold: 4.
|
| 47 |
|
| 48 |
Declared preprocessing:
|
| 49 |
|
|
@@ -70,4 +78,142 @@ Declared preprocessing:
|
|
| 70 |
|
| 71 |
Profile note: Single-stream environment records use torchvision 0.17.1; exact per-fold environment snapshots were not retained.
|
| 72 |
|
| 73 |
-
[Complete download, inference and output instructions](https://github.com/chou141253/ERM-AI/blob/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
- zh
|
| 5 |
+
- ja
|
| 6 |
tags:
|
| 7 |
- pytorch
|
| 8 |
- timm
|
|
|
|
| 11 |
- research
|
| 12 |
---
|
| 13 |
|
| 14 |
+
[English](#english) | [繁體中文](#traditional-chinese) | [日本語](#japanese)
|
| 15 |
+
|
| 16 |
+
<a id="english"></a>
|
| 17 |
+
|
| 18 |
# Multistream model artifact
|
| 19 |
|
| 20 |
This is a research artifact. This export does not establish whether training used real or synthetic data, independent validation, or clinical readiness.
|
| 21 |
|
| 22 |
Architecture: resnet50; hidden dimension: 2048.
|
| 23 |
|
| 24 |
+
Ordered streams: `["color_full"]`
|
| 25 |
|
| 26 |
+
Class mapping: `{"bad": 0, "good": 1}`
|
| 27 |
|
| 28 |
Class names are labels only; do not infer healthy/diseased semantics without the study definition.
|
| 29 |
|
| 30 |
The source is a legacy model. Architecture and tensor keys/shapes were checked strictly, but the historical stream order, label meaning and preprocessing cannot be proved from weights. These settings were supplied by the operator. Earlier experiments used case-level random folds with identified patient-overlap concerns and selected epochs on validation accuracy. Their scores must not be presented as independent patient-grouped cross-validation results. Converted format does not correct those experiments.
|
| 31 |
|
| 32 |
+
Public code: [GitHub](https://github.com/chou141253/ERM-AI/tree/23309f88b6213e0910138ea56d15e6666b2ecf47/new)
|
| 33 |
|
|
|
|
| 34 |
## Loading this condition and fold
|
| 35 |
|
| 36 |
+
Install the code repository requirements and run from its `new/` directory. The shared loader and requirements live at the collection root, not in this model directory.
|
| 37 |
|
| 38 |
```bash
|
| 39 |
python tools/infer_published.py --repo ntuhophai/ERM-AI --condition single_color_full --fold 4 --root /path/to/cases --output predictions/single_color_full_fold4
|
| 40 |
```
|
| 41 |
|
| 42 |
+
Before the model PR is merged, append `--revision refs/pr/<number>`; after merge the default `main` revision can be used.
|
| 43 |
|
| 44 |
Only the selected weights/config are downloaded. Provide one image for each ordered stream. The local tool uses its trusted model definition and saves class probabilities.
|
| 45 |
|
| 46 |
## Preprocessing and verification
|
| 47 |
|
| 48 |
+
`config.json` records the RGB resize backend, bilinear interpolation, center crop and normalization. For raw legacy exports, verify these operator-supplied settings against the original experiment. Export verification checks every tensor key and shape and rejects nonfinite floating-point weights; it does not run inference or validate performance.
|
| 49 |
|
| 50 |
## License
|
| 51 |
|
| 52 |
No model license was inferred by the exporter. Supply the authorized model license and complete the study-specific model card before treating this as a documented release.
|
| 53 |
|
| 54 |
+
Collection condition: `single_color_full`; zero-based fold: `4`.
|
| 55 |
|
| 56 |
Declared preprocessing:
|
| 57 |
|
|
|
|
| 78 |
|
| 79 |
Profile note: Single-stream environment records use torchvision 0.17.1; exact per-fold environment snapshots were not retained.
|
| 80 |
|
| 81 |
+
[Complete download, inference and output instructions](https://github.com/chou141253/ERM-AI/blob/23309f88b6213e0910138ea56d15e6666b2ecf47/new/INFERENCE.md)
|
| 82 |
+
|
| 83 |
+
---
|
| 84 |
+
|
| 85 |
+
<a id="traditional-chinese"></a>
|
| 86 |
+
|
| 87 |
+
# 多流模型產物
|
| 88 |
+
|
| 89 |
+
這是研究用產物。本次匯出無法證實訓練採用真實或合成資料、是否經過獨立驗證,或是否已具備臨床應用條件。
|
| 90 |
+
|
| 91 |
+
模型架構:resnet50;隱藏維度:2048。
|
| 92 |
+
|
| 93 |
+
輸入流順序:`["color_full"]`
|
| 94 |
+
|
| 95 |
+
類別對應:`{"bad": 0, "good": 1}`
|
| 96 |
+
|
| 97 |
+
類別名稱僅為標籤;未取得研究定義前,不得將其直接解讀為健康/患病。
|
| 98 |
+
|
| 99 |
+
來源為歷史模型。已嚴格核對架構、張量鍵與形狀,但無法僅憑權重證實歷史輸入流順序、標籤意義及前處理方式;這些設定由操作者提供。早期實驗採用病例層級的隨機 fold,已發現跨 fold 病人重疊的疑慮,並依驗證準確率選取 epoch。不得將其分數稱為以病人分組且彼此獨立的交叉驗證結果。格式轉換不會修正原實驗的這些問題。
|
| 100 |
+
|
| 101 |
+
公開程式碼:[GitHub](https://github.com/chou141253/ERM-AI/tree/23309f88b6213e0910138ea56d15e6666b2ecf47/new)
|
| 102 |
+
|
| 103 |
+
## 載入此條件與 fold
|
| 104 |
+
|
| 105 |
+
請安裝程式碼儲存庫列出的相依套件,並從其中的 `new/` 目錄執行。共用載入器與相依套件清單位於模型集合根目錄,此模型子目錄內不含這些檔案。
|
| 106 |
+
|
| 107 |
+
```bash
|
| 108 |
+
python tools/infer_published.py --repo ntuhophai/ERM-AI --condition single_color_full --fold 4 --root /path/to/cases --output predictions/single_color_full_fold4
|
| 109 |
+
```
|
| 110 |
+
|
| 111 |
+
模型 PR 合併前,請加上 `--revision refs/pr/<number>`;合併後可使用預設的 `main` 版本。
|
| 112 |
+
|
| 113 |
+
僅下載所選模型的權重與設定。請依輸入流順序提供各流對應的一張影像。本機工具使用其受信任的模型定義,並保存各類別機率。
|
| 114 |
+
|
| 115 |
+
## 前處理與核對
|
| 116 |
+
|
| 117 |
+
`config.json` 記錄 RGB 影像縮放後端、雙線性插值、中心裁切與正規化方式。若匯出原始歷史權重,須依原始實驗核對操作者提供的設定。匯出核對會檢查每個張量鍵與形狀,並拒絕含非有限浮點數的權重;不會執行推論或驗證效能。
|
| 118 |
+
|
| 119 |
+
## 授權
|
| 120 |
+
|
| 121 |
+
匯出器未推定或擅自指定模型授權。將本產物視為具完整文件的發布版本前,須提供經授權的模型授權條款,並完成該研究的模型卡。
|
| 122 |
+
|
| 123 |
+
集合條件:`single_color_full`;從 0 開始編號的 fold:`4`。
|
| 124 |
+
|
| 125 |
+
宣告的前處理設定:
|
| 126 |
+
|
| 127 |
+
```json
|
| 128 |
+
{
|
| 129 |
+
"image_size": 448,
|
| 130 |
+
"resize_size": 448,
|
| 131 |
+
"mean": [
|
| 132 |
+
0.485,
|
| 133 |
+
0.456,
|
| 134 |
+
0.406
|
| 135 |
+
],
|
| 136 |
+
"std": [
|
| 137 |
+
0.229,
|
| 138 |
+
0.224,
|
| 139 |
+
0.225
|
| 140 |
+
],
|
| 141 |
+
"resize_backend": "tensor",
|
| 142 |
+
"interpolation": "bilinear",
|
| 143 |
+
"antialias": true,
|
| 144 |
+
"crop": "center"
|
| 145 |
+
}
|
| 146 |
+
```
|
| 147 |
+
|
| 148 |
+
設定註記:單流環境紀錄使用 torchvision 0.17.1;未保留各 fold 的完整環境快照。
|
| 149 |
+
|
| 150 |
+
[完整下載、推論與輸出說明](https://github.com/chou141253/ERM-AI/blob/23309f88b6213e0910138ea56d15e6666b2ecf47/new/INFERENCE.md)
|
| 151 |
+
|
| 152 |
+
---
|
| 153 |
+
|
| 154 |
+
<a id="japanese"></a>
|
| 155 |
+
|
| 156 |
+
# マルチストリームモデルの成果物
|
| 157 |
+
|
| 158 |
+
これは研究用の成果物です。このエクスポートによって、学習データが実データか合成データか、独立した検証が行われたか、臨床利用の準備が整っているかを確認することはできません。
|
| 159 |
+
|
| 160 |
+
モデル構造:resnet50。隠れ次元数:2048。
|
| 161 |
+
|
| 162 |
+
ストリームの順序:`["color_full"]`
|
| 163 |
+
|
| 164 |
+
クラスの対応関係:`{"bad": 0, "good": 1}`
|
| 165 |
+
|
| 166 |
+
クラス名はラベルです。研究上の定義を確認せずに、健康/疾患を意味すると解釈しないでください。
|
| 167 |
+
|
| 168 |
+
変換元は過去のモデルです。モデル構造、テンソルのキーと形状を厳密に確認していますが、過去のストリーム順序、ラベルの意味、前処理は重みだけでは証明できません。これらの設定は操作者が提供したものです。初期の実験では症例単位のランダムな fold 分割を用い、fold 間で患者が重複する懸念が確認されており、検証正解率に基づいて epoch を選択していました。これらのスコアを、患者単位で分割された独立した交差検証の結果と表記しないでください。形式を変換しても、元の実験の問題は修正されません。
|
| 169 |
+
|
| 170 |
+
公開コード:[GitHub](https://github.com/chou141253/ERM-AI/tree/23309f88b6213e0910138ea56d15e6666b2ecf47/new)
|
| 171 |
+
|
| 172 |
+
## この条件と fold の読み込み
|
| 173 |
+
|
| 174 |
+
コードリポジトリに記載された依存パッケージをインストールし、`new/` ディレクトリから実行してください。共通ローダーと依存パッケージの一覧はコレクションのルートにあり、このモデルのサブディレクトリには含まれていません。
|
| 175 |
+
|
| 176 |
+
```bash
|
| 177 |
+
python tools/infer_published.py --repo ntuhophai/ERM-AI --condition single_color_full --fold 4 --root /path/to/cases --output predictions/single_color_full_fold4
|
| 178 |
+
```
|
| 179 |
+
|
| 180 |
+
モデルの PR がマージされる前は、`--revision refs/pr/<number>` を追加してください。マージ後は既定の `main` リビジョンを使用できます。
|
| 181 |
+
|
| 182 |
+
選択したモデルの重みと設定のみをダウンロードします。ストリームの順序に従い、各ストリームに対応する画像を 1 枚ずつ用意してください。ローカルツールは信頼済みのモデル定義を使用し、各クラスの確率を保存します。
|
| 183 |
+
|
| 184 |
+
## 前処理と確認
|
| 185 |
+
|
| 186 |
+
`config.json` に RGB 画像のリサイズ処理、双線形補間、中央クロップ、正規化を記録しています。旧形式の重みをエクスポートする場合は、操作者が提供した設定を元の実験と照合してください。エクスポート時の確認では、すべてのテンソルのキーと形状を検査し、非有限の浮動小数点値を含む重みを拒否します。推論や性能検証は実施しません。
|
| 187 |
+
|
| 188 |
+
## ライセンス
|
| 189 |
+
|
| 190 |
+
エクスポーターはモデルのライセンスを推測に基づいて指定していません。文書を整備した公開版として扱う前に、正当に許諾されたモデルのライセンスを提示し、本研究固有のモデルカードを完成させてください。
|
| 191 |
+
|
| 192 |
+
コレクションの条件:`single_color_full`。0 始まりの fold:`4`。
|
| 193 |
+
|
| 194 |
+
宣言された前処理設定:
|
| 195 |
+
|
| 196 |
+
```json
|
| 197 |
+
{
|
| 198 |
+
"image_size": 448,
|
| 199 |
+
"resize_size": 448,
|
| 200 |
+
"mean": [
|
| 201 |
+
0.485,
|
| 202 |
+
0.456,
|
| 203 |
+
0.406
|
| 204 |
+
],
|
| 205 |
+
"std": [
|
| 206 |
+
0.229,
|
| 207 |
+
0.224,
|
| 208 |
+
0.225
|
| 209 |
+
],
|
| 210 |
+
"resize_backend": "tensor",
|
| 211 |
+
"interpolation": "bilinear",
|
| 212 |
+
"antialias": true,
|
| 213 |
+
"crop": "center"
|
| 214 |
+
}
|
| 215 |
+
```
|
| 216 |
+
|
| 217 |
+
設定の注記:単一ストリームの環境記録では torchvision 0.17.1 を使用しています。fold ごとの正確な環境スナップショットは保存されていません。
|
| 218 |
+
|
| 219 |
+
[ダウンロード、推論、出力の完全な手順](https://github.com/chou141253/ERM-AI/blob/23309f88b6213e0910138ea56d15e6666b2ecf47/new/INFERENCE.md)
|