English | 繁體中文 | 日本語

ERM-AI complete research model collection

Official code: ntuhophai/ERM-AI · Inference guide: new/INFERENCE.md · License: Apache 2.0

This collection preserves 167 model weight files: 160 loadable model/fold entries and 7 historical tensor archives. A loadable entry means that its tensors match the declared architecture; it does not establish clinical validity or independent test performance.

Layout

catalog.json
LICENSE
modeling_multistream.py
README.md
requirements.txt
models/<condition>/fold_<0-9>/{model.safetensors,config.json,README.md}
historical/<project>/{model.safetensors,config.json,README.md}

Conditions and ordered streams

Condition Ordered streams Tensor resize antialias Profile evidence / limits
single_vertical _vertical True Single-stream environment records use torchvision 0.17.1; exact per-fold environment snapshots were not retained.
single_horizontal _horizontal True Single-stream environment records use torchvision 0.17.1; exact per-fold environment snapshots were not retained.
single_color_full color_full True Single-stream environment records use torchvision 0.17.1; exact per-fold environment snapshots were not retained.
single_color_inner color_inner True Single-stream environment records use torchvision 0.17.1; exact per-fold environment snapshots were not retained.
single_color_outer color_outer True Single-stream environment records use torchvision 0.17.1; exact per-fold environment snapshots were not retained.
single_gray_full gray_full True Single-stream environment records use torchvision 0.17.1; exact per-fold environment snapshots were not retained.
single_gray_inner gray_inner True Single-stream environment records use torchvision 0.17.1; exact per-fold environment snapshots were not retained.
single_gray_outer gray_outer True Single-stream environment records use torchvision 0.17.1; exact per-fold environment snapshots were not retained.
fusion_2_cross _vertical, _horizontal True Order follows historical inference directory naming; original YAML is missing. Two-stream runtime records use torchvision 0.17.1.
fusion_2_color color_inner, color_outer True Order follows saved config2.yaml; two-stream runtime records use torchvision 0.17.1.
fusion_2_gray gray_inner, gray_outer True Order follows saved config3.yaml; two-stream runtime records use torchvision 0.17.1.
fusion_3_color color_inner, color_outer, color_full True Order follows saved config4.yaml; three-stream runtime records use torchvision 0.17.1.
fusion_3_gray gray_inner, gray_outer, gray_full True Order follows saved config5.yaml; three-stream runtime records use torchvision 0.17.1.
fusion_4 _vertical, _horizontal, color_full, gray_full True Order follows historical inference directory naming. Original runtime version is unrecorded; antialias true is an explicit operator choice to verify.
fusion_6 color_inner, color_outer, color_full, gray_inner, gray_outer, gray_full True Order follows historical inference directory naming. Original runtime version is unrecorded; antialias true is an explicit operator choice to verify.
fusion_8 _vertical, _horizontal, color_full, color_inner, color_outer, gray_full, gray_inner, gray_outer False Order follows saved config.yaml; saved eight-stream environment uses torchvision 0.16.2, whose Tensor Resize default was not antialiased.

Each condition contains the zero-based folds declared in catalog.json. Each stream has its own backbone; fusion concatenates pooled features and applies an MLP classifier. Single-stream models classify the pooled feature directly.

Architecture and preprocessing

Single-stream ResNet50 maps a global pooled 2048-dimensional feature to two classes. Fusion models concatenate one feature per stream and use Linear(N*2048, 2048), ReLU, Linear(2048, 2048), and Linear(2048, 2). Input tensors have shape [batch, streams, 3, 448, 448]. Class mapping: {"bad": 0, "good": 1}. Softmax converts logits into class probabilities. RGB resize backend: tensor; resize size: 448; bilinear interpolation and center crop. Normalization mean: [0.485, 0.456, 0.406]; std: [0.229, 0.224, 0.225]. Condition-specific antialias is listed above and saved in config.json.

Inference

Clone the official code repository and run from its new/ directory:

git clone https://github.com/ntuhophai/ERM-AI.git
cd ERM-AI/new
python -m pip install -r requirements.txt
python tools/infer_published.py --repo ntuhophai/ERM-AI --list
python tools/infer_published.py --repo ntuhophai/ERM-AI --condition single_gray_inner --fold 0 --root /path/to/cases --output predictions/single_gray_inner_fold0
python tools/infer_published.py --repo ntuhophai/ERM-AI --condition fusion_8 --all-folds --root /path/to/cases --output predictions/fusion_8

The default main revision is the published release. Only selected fold weights/configurations are downloaded. For reproducible downloads, add --revision 13bf2c5a640dd37d9b908456136095d4c27b31ee (or another commit from this repository's history) to every Hub command. Predictions include per-class probabilities in the saved class index order. Case folders must provide one matching image per required stream. Both class/case/image folders and unlabeled case/image folders are supported. Use --ensemble only when you explicitly want a mean of the selected models' probabilities. This is prediction on one cohort, not out-of-fold validation.

Archive entries under historical/ are tensor-only because their original fold/stream settings were not saved. They are included for completeness but are not automatically inferable.

Provenance and limits

These are legacy research weights. Earlier experiments used case-level random folds, with identified patient-overlap concerns, and selected checkpoints using validation scores. Do not label those scores as patient-independent cross-validation results. Class names bad/good are recorded labels; do not infer healthy/diseased meanings without the study definition. Profiles are explicit declarations; tensor keys/shapes cannot prove historical stream semantics or preprocessing. In particular, four-/six-stream runtime versions were not retained; their antialias choice must be checked against original records.

Export snapshot: the release files were generated from this pinned code snapshot, kept for provenance. For current code, INFERENCE.md and MODEL_CATALOG.md, use the official repository.

License

The model weights and files in this repository are released under the Apache License 2.0, the same license as the official code repository. This license does not make these weights a validated clinical tool.


ERM-AI 完整研究模型集合

官方程式碼: ntuhophai/ERM-AI · 推論說明: new/INFERENCE.md · 授權: Apache 2.0

本集合保存 167 個模型權重檔案,包含 160 個可載入的模型/fold 項目,以及 7 個歷史張量封存項目。 「可載入」僅表示張量符合宣告的模型架構,不代表已證實臨床有效性或獨立測試效能。

目錄結構

catalog.json
LICENSE
modeling_multistream.py
README.md
requirements.txt
models/<condition>/fold_<0-9>/{model.safetensors,config.json,README.md}
historical/<project>/{model.safetensors,config.json,README.md}

實驗條件與輸入流順序

條件 輸入流順序 張量縮放抗鋸齒 設定依據/限制
single_vertical _vertical True 單流環境紀錄使用 torchvision 0.17.1;未保留各 fold 的完整環境快照。
single_horizontal _horizontal True 單流環境紀錄使用 torchvision 0.17.1;未保留各 fold 的完整環境快照。
single_color_full color_full True 單流環境紀錄使用 torchvision 0.17.1;未保留各 fold 的完整環境快照。
single_color_inner color_inner True 單流環境紀錄使用 torchvision 0.17.1;未保留各 fold 的完整環境快照。
single_color_outer color_outer True 單流環境紀錄使用 torchvision 0.17.1;未保留各 fold 的完整環境快照。
single_gray_full gray_full True 單流環境紀錄使用 torchvision 0.17.1;未保留各 fold 的完整環境快照。
single_gray_inner gray_inner True 單流環境紀錄使用 torchvision 0.17.1;未保留各 fold 的完整環境快照。
single_gray_outer gray_outer True 單流環境紀錄使用 torchvision 0.17.1;未保留各 fold 的完整環境快照。
fusion_2_cross _vertical, _horizontal True 順序依歷史推論目錄名稱判定;原始 YAML 已缺失。雙流執行環境紀錄使用 torchvision 0.17.1。
fusion_2_color color_inner, color_outer True 順序依保存的 config2.yaml;雙流執行環境紀錄使用 torchvision 0.17.1。
fusion_2_gray gray_inner, gray_outer True 順序依保存的 config3.yaml;雙流執行環境紀錄使用 torchvision 0.17.1。
fusion_3_color color_inner, color_outer, color_full True 順序依保存的 config4.yaml;三流執行環境紀錄使用 torchvision 0.17.1。
fusion_3_gray gray_inner, gray_outer, gray_full True 順序依保存的 config5.yaml;三流執行環境紀錄使用 torchvision 0.17.1。
fusion_4 _vertical, _horizontal, color_full, gray_full True 順序依歷史推論目錄名稱判定。原始執行環境版本未記錄;antialias=true 是操作者明確指定、仍須核對的設定。
fusion_6 color_inner, color_outer, color_full, gray_inner, gray_outer, gray_full True 順序依歷史推論目錄名稱判定。原始執行環境版本未記錄;antialias=true 是操作者明確指定、仍須核對的設定。
fusion_8 _vertical, _horizontal, color_full, color_inner, color_outer, gray_full, gray_inner, gray_outer False 順序依保存的 config.yaml;保存的八流環境使用 torchvision 0.16.2,其張量 Resize 預設不啟用抗鋸齒。

各條件包含 catalog.json 宣告的 fold,編號從 0 開始。各輸入流使用獨立的骨幹網路;融合模型串接池化後的特徵,再以多層感知器(MLP)分類。單流模型則直接以池化後的特徵分類。

模型架構與前處理

單流 ResNet50 將全域池化後的 2048 維特徵映射至兩個類別。融合模型串接各輸入流的特徵,再依序使用 Linear(N*2048, 2048)、ReLU、Linear(2048, 2048) 與 Linear(2048, 2)。 輸入張量形狀為 [batch, streams, 3, 448, 448]。類別對應:{"bad": 0, "good": 1}。使用 softmax 將 logits 轉為各類別機率。 RGB 影像縮放後端:tensor;縮放尺寸:448;使用雙線性插值與中心裁切。正規化平均值:[0.485, 0.456, 0.406];標準差:[0.229, 0.224, 0.225]。各條件的抗鋸齒設定列於上表,並保存在 config.json。

推論

複製官方程式碼儲存庫後,在其中的 new/ 目錄執行:

git clone https://github.com/ntuhophai/ERM-AI.git
cd ERM-AI/new
python -m pip install -r requirements.txt
python tools/infer_published.py --repo ntuhophai/ERM-AI --list
python tools/infer_published.py --repo ntuhophai/ERM-AI --condition single_gray_inner --fold 0 --root /path/to/cases --output predictions/single_gray_inner_fold0
python tools/infer_published.py --repo ntuhophai/ERM-AI --condition fusion_8 --all-folds --root /path/to/cases --output predictions/fusion_8

預設的 main 版本即為正式發布版本。僅下載所選 fold 的權重與設定。為確保下載結果可重現,請在每個存取 Hub 的指令加上 --revision 13bf2c5a640dd37d9b908456136095d4c27b31ee(或本儲存庫歷史紀錄中的其他 commit)。預測結果依保存的類別索引順序包含各類別機率。 每個病例目錄須為各必要輸入流提供一張對應影像。同時支援 class/case/image 與不含類別標籤的 case/image 目錄結構。 若要平均所選模型的預測機率,再使用 --ensemble。這是在同一群體上進行預測,並非 out-of-fold 驗證。

historical/ 下的封存項目因未保存原始 fold/輸入流設定,因此僅封存張量,以保留完整紀錄;無法自動用於推論。

來源與限制

這些權重來自歷史研究實驗。早期實驗採用病例層級的隨機 fold,已發現跨 fold 病人重疊的疑慮,並依驗證分數選取 checkpoint。不得將這些分數稱為病人互斥的交叉驗證結果。 bad/good 是原始紀錄中的類別標籤;未取得研究定義前,不得將其直接解讀為健康/患病。 Profile 是明確宣告的設定;張量的鍵與形狀無法證實歷史輸入流語意或前處理方式。尤其四流/六流實驗未保留執行環境版本,其抗鋸齒選擇須依原始紀錄核對。

匯出快照:本次發布的檔案由此固定版本的程式碼快照產生,保留作為來源紀錄。最新程式碼、INFERENCE.md 與 MODEL_CATALOG.md 請見官方儲存庫。

授權

本儲存庫的模型權重與檔案依 Apache License 2.0 授權釋出,與官方程式碼儲存庫相同。此授權不代表這些權重已通過臨床驗證。


ERM-AI 研究モデルの完全コレクション

公式コード: ntuhophai/ERM-AI · 推論ガイド: new/INFERENCE.md · ライセンス: Apache 2.0

本コレクションには 167 個のモデル重みファイルを保存しています。内訳は、読み込み可能なモデル/fold が 160 件、過去のテンソルアーカイブが 7 件です。 「読み込み可能」とは、テンソルが宣言されたモデル構造に適合することを意味します。臨床的妥当性や独立したテストでの性能が確認されたことを意味するものではありません。

ディレクトリ構成

catalog.json
LICENSE
modeling_multistream.py
README.md
requirements.txt
models/<condition>/fold_<0-9>/{model.safetensors,config.json,README.md}
historical/<project>/{model.safetensors,config.json,README.md}

実験条件とストリームの順序

条件 ストリームの順序 テンソルのリサイズ時のアンチエイリアス 設定の根拠/制約
single_vertical _vertical True 単一ストリームの環境記録では torchvision 0.17.1 を使用しています。fold ごとの正確な環境スナップショットは保存されていません。
single_horizontal _horizontal True 単一ストリームの環境記録では torchvision 0.17.1 を使用しています。fold ごとの正確な環境スナップショットは保存されていません。
single_color_full color_full True 単一ストリームの環境記録では torchvision 0.17.1 を使用しています。fold ごとの正確な環境スナップショットは保存されていません。
single_color_inner color_inner True 単一ストリームの環境記録では torchvision 0.17.1 を使用しています。fold ごとの正確な環境スナップショットは保存されていません。
single_color_outer color_outer True 単一ストリームの環境記録では torchvision 0.17.1 を使用しています。fold ごとの正確な環境スナップショットは保存されていません。
single_gray_full gray_full True 単一ストリームの環境記録では torchvision 0.17.1 を使用しています。fold ごとの正確な環境スナップショットは保存されていません。
single_gray_inner gray_inner True 単一ストリームの環境記録では torchvision 0.17.1 を使用しています。fold ごとの正確な環境スナップショットは保存されていません。
single_gray_outer gray_outer True 単一ストリームの環境記録では torchvision 0.17.1 を使用しています。fold ごとの正確な環境スナップショットは保存されていません。
fusion_2_cross _vertical, _horizontal True 順序は過去の推論ディレクトリ名に基づきます。元の YAML は残っていません。2 ストリームの実行環境記録では torchvision 0.17.1 を使用しています。
fusion_2_color color_inner, color_outer True 順序は保存された config2.yaml に基づきます。2 ストリームの実行環境記録では torchvision 0.17.1 を使用しています。
fusion_2_gray gray_inner, gray_outer True 順序は保存された config3.yaml に基づきます。2 ストリームの実行環境記録では torchvision 0.17.1 を使用しています。
fusion_3_color color_inner, color_outer, color_full True 順序は保存された config4.yaml に基づきます。3 ストリームの実行環境記録では torchvision 0.17.1 を使用しています。
fusion_3_gray gray_inner, gray_outer, gray_full True 順序は保存された config5.yaml に基づきます。3 ストリームの実行環境記録では torchvision 0.17.1 を使用しています。
fusion_4 _vertical, _horizontal, color_full, gray_full True 順序は過去の推論ディレクトリ名に基づきます。元の実行環境のバージョンは記録されていません。antialias=true は操作者が明示的に選択した設定であり、照合が必要です。
fusion_6 color_inner, color_outer, color_full, gray_inner, gray_outer, gray_full True 順序は過去の推論ディレクトリ名に基づきます。元の実行環境のバージョンは記録されていません。antialias=true は操作者が明示的に選択した設定であり、照合が必要です。
fusion_8 _vertical, _horizontal, color_full, color_inner, color_outer, gray_full, gray_inner, gray_outer False 順序は保存された config.yaml に基づきます。保存された 8 ストリーム環境では torchvision 0.16.2 を使用しており、テンソルの Resize は既定でアンチエイリアスを適用しません。

各条件には、catalog.json に宣言された 0 始まりの fold が含まれます。各ストリームは独立したバックボーンを持ち、融合モデルはプーリング後の特徴を連結して多層パーセプトロン(MLP)で分類します。単一ストリームモデルはプーリング後の特徴を直接分類します。

モデル構造と前処理

単一ストリームの ResNet50 は、グローバルプーリング後の 2048 次元特徴を 2 クラスに写像します。融合モデルは各ストリームの特徴を連結し、Linear(N*2048, 2048)、ReLU、Linear(2048, 2048)、Linear(2048, 2) を順に適用します。 入力テンソルの形状は [batch, streams, 3, 448, 448] です。クラスの対応関係:{"bad": 0, "good": 1}。softmax で logits を各クラスの確率に変換します。 RGB 画像のリサイズ処理:tensor。リサイズサイズ:448。双線形補間と中央クロップを使用します。正規化の平均値:[0.485, 0.456, 0.406]。標準偏差:[0.229, 0.224, 0.225]。条件ごとのアンチエイリアス設定は上表と config.json に記録されています。

推論

公式コードリポジトリをクローンし、new/ ディレクトリで実行してください。

git clone https://github.com/ntuhophai/ERM-AI.git
cd ERM-AI/new
python -m pip install -r requirements.txt
python tools/infer_published.py --repo ntuhophai/ERM-AI --list
python tools/infer_published.py --repo ntuhophai/ERM-AI --condition single_gray_inner --fold 0 --root /path/to/cases --output predictions/single_gray_inner_fold0
python tools/infer_published.py --repo ntuhophai/ERM-AI --condition fusion_8 --all-folds --root /path/to/cases --output predictions/fusion_8

既定の main リビジョンが正式な公開版です。選択した fold の重みと設定のみをダウンロードします。再現可能なダウンロードのため、Hub にアクセスする各コマンドに --revision 13bf2c5a640dd37d9b908456136095d4c27b31ee(または本リポジトリの履歴にある別のコミット)を追加してください。予測結果には、保存されたクラスインデックス順の各クラスの確率が含まれます。 各症例フォルダーには、必要なストリームごとに対応する画像を 1 枚用意してください。class/case/image 構成と、クラスラベルのない case/image 構成の両方に対応しています。 選択したモデルの予測確率を平均する場合に --ensemble を使用してください。同一コホートに対する予測であり、out-of-fold 検証ではありません。

historical/ 配下のアーカイブ項目は、元の fold/ストリーム設定が保存されていないため、テンソルのみを収録しています。記録の完全性を保つためのものであり、自動推論には対応していません。

来歴と制約

これらは過去の研究で得られた重みです。初期の実験では症例単位のランダムな fold 分割を用い、fold 間で患者が重複する懸念が確認されており、検証スコアに基づいてチェックポイントを選択していました。これらのスコアを、患者単位で独立した交差検証の結果と表記しないでください。 bad/good は記録されたクラスラベルです。研究上の定義を確認せずに、健康/疾患を意味すると解釈しないでください。 プロファイルは明示的に宣言された設定です。テンソルのキーや形状から、過去のストリームの意味や前処理を証明することはできません。特に 4/6 ストリーム実験では実行環境のバージョンが保存されていないため、アンチエイリアスの選択を元の記録と照合する必要があります。

エクスポート時のスナップショット:本リリースのファイルはこの固定されたコードスナップショットから生成されたもので、来歴の記録として残しています。最新のコード、INFERENCE.md、MODEL_CATALOG.md は公式リポジトリを参照してください。

ライセンス

本リポジトリのモデル重みとファイルは、公式コードリポジトリと同じ Apache License 2.0 で公開しています。このライセンスは、これらの重みが臨床的に検証済みであることを意味するものではありません。

Downloads last month
-
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support