Publish complete OCT stream/fold model collection

#1
This view is limited to 50 files because it contains too many changes. See the raw diff here.
Files changed (50) hide show
  1. README.md +79 -7
  2. catalog.json +0 -0
  3. historical/image-classification-2-stream-1/README.md +9 -0
  4. historical/image-classification-2-stream-1/config.json +12 -0
  5. historical/image-classification-2-stream-1/model.safetensors +3 -0
  6. historical/image-classification-2/README.md +9 -0
  7. historical/image-classification-2/config.json +12 -0
  8. historical/image-classification-2/model.safetensors +3 -0
  9. historical/image-classification-3/README.md +9 -0
  10. historical/image-classification-3/config.json +12 -0
  11. historical/image-classification-3/model.safetensors +3 -0
  12. historical/image-classification-4/README.md +9 -0
  13. historical/image-classification-4/config.json +12 -0
  14. historical/image-classification-4/model.safetensors +3 -0
  15. historical/image-classification-6/README.md +9 -0
  16. historical/image-classification-6/config.json +12 -0
  17. historical/image-classification-6/model.safetensors +3 -0
  18. historical/image-classification-ms-2/README.md +9 -0
  19. historical/image-classification-ms-2/config.json +12 -0
  20. historical/image-classification-ms-2/model.safetensors +3 -0
  21. historical/image-classification/README.md +9 -0
  22. historical/image-classification/config.json +12 -0
  23. historical/image-classification/model.safetensors +3 -0
  24. modeling_multistream.py +167 -0
  25. models/fusion_2_color/fold_0/README.md +73 -0
  26. models/fusion_2_color/fold_0/config.json +40 -0
  27. models/fusion_2_color/fold_0/model.safetensors +3 -0
  28. models/fusion_2_color/fold_1/README.md +73 -0
  29. models/fusion_2_color/fold_1/config.json +40 -0
  30. models/fusion_2_color/fold_1/model.safetensors +3 -0
  31. models/fusion_2_color/fold_2/README.md +73 -0
  32. models/fusion_2_color/fold_2/config.json +40 -0
  33. models/fusion_2_color/fold_2/model.safetensors +3 -0
  34. models/fusion_2_color/fold_3/README.md +73 -0
  35. models/fusion_2_color/fold_3/config.json +40 -0
  36. models/fusion_2_color/fold_3/model.safetensors +3 -0
  37. models/fusion_2_color/fold_4/README.md +73 -0
  38. models/fusion_2_color/fold_4/config.json +40 -0
  39. models/fusion_2_color/fold_4/model.safetensors +3 -0
  40. models/fusion_2_color/fold_5/README.md +73 -0
  41. models/fusion_2_color/fold_5/config.json +40 -0
  42. models/fusion_2_color/fold_5/model.safetensors +3 -0
  43. models/fusion_2_color/fold_6/README.md +73 -0
  44. models/fusion_2_color/fold_6/config.json +40 -0
  45. models/fusion_2_color/fold_6/model.safetensors +3 -0
  46. models/fusion_2_color/fold_7/README.md +73 -0
  47. models/fusion_2_color/fold_7/config.json +40 -0
  48. models/fusion_2_color/fold_7/model.safetensors +3 -0
  49. models/fusion_2_color/fold_8/README.md +73 -0
  50. models/fusion_2_color/fold_8/config.json +40 -0
README.md CHANGED
@@ -1,7 +1,79 @@
1
- # ERM-AI
2
-
3
- Model weights are being prepared for release.
4
-
5
- ## Code
6
- Training and inference code:
7
- https://github.com/ntuhophai/ERM-AI
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - pytorch
4
+ - timm
5
+ - multistream
6
+ - research
7
+ ---
8
+
9
+ # ERM-AI complete research model collection
10
+
11
+ This collection preserves 167 model files: 160 loadable model/fold entries and 7 historical tensor archives.
12
+ A loadable entry means that its tensors match the declared architecture; it does not establish clinical validity or independent test performance.
13
+
14
+ ## Layout
15
+
16
+ ```text
17
+ catalog.json
18
+ modeling_multistream.py
19
+ README.md
20
+ requirements.txt
21
+ models/<condition>/fold_<0-9>/{model.safetensors,config.json,README.md}
22
+ historical/<project>/{model.safetensors,config.json,README.md}
23
+ ```
24
+
25
+ ## Conditions and ordered streams
26
+
27
+ | Condition | Ordered streams | Tensor resize antialias | Profile evidence / limits |
28
+ |---|---|---|---|
29
+ | single_vertical | _vertical | True | Single-stream environment records use torchvision 0.17.1; exact per-fold environment snapshots were not retained. |
30
+ | single_horizontal | _horizontal | True | Single-stream environment records use torchvision 0.17.1; exact per-fold environment snapshots were not retained. |
31
+ | single_color_full | color_full | True | Single-stream environment records use torchvision 0.17.1; exact per-fold environment snapshots were not retained. |
32
+ | single_color_inner | color_inner | True | Single-stream environment records use torchvision 0.17.1; exact per-fold environment snapshots were not retained. |
33
+ | single_color_outer | color_outer | True | Single-stream environment records use torchvision 0.17.1; exact per-fold environment snapshots were not retained. |
34
+ | single_gray_full | gray_full | True | Single-stream environment records use torchvision 0.17.1; exact per-fold environment snapshots were not retained. |
35
+ | single_gray_inner | gray_inner | True | Single-stream environment records use torchvision 0.17.1; exact per-fold environment snapshots were not retained. |
36
+ | single_gray_outer | gray_outer | True | Single-stream environment records use torchvision 0.17.1; exact per-fold environment snapshots were not retained. |
37
+ | 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. |
38
+ | fusion_2_color | color_inner, color_outer | True | Order follows saved config2.yaml; two-stream runtime records use torchvision 0.17.1. |
39
+ | fusion_2_gray | gray_inner, gray_outer | True | Order follows saved config3.yaml; two-stream runtime records use torchvision 0.17.1. |
40
+ | fusion_3_color | color_inner, color_outer, color_full | True | Order follows saved config4.yaml; three-stream runtime records use torchvision 0.17.1. |
41
+ | fusion_3_gray | gray_inner, gray_outer, gray_full | True | Order follows saved config5.yaml; three-stream runtime records use torchvision 0.17.1. |
42
+ | 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. |
43
+ | 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. |
44
+ | 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. |
45
+
46
+ Each condition contains the zero-based folds declared in catalog.json. Each stream has its own ResNet50 backbone; fusion concatenates pooled features and applies an MLP classifier. Single-stream models classify the pooled feature directly.
47
+
48
+ ## Architecture and preprocessing
49
+
50
+ 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).
51
+ Input tensors have shape [batch, streams, 3, 448, 448]. Class mapping: {"bad": 0, "good": 1}. Softmax converts logits into class probabilities.
52
+ 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.
53
+
54
+ ## Inference
55
+
56
+ Clone the code repository and run from its new/ directory:
57
+
58
+ ```bash
59
+ python -m pip install -r requirements.txt
60
+ python tools/infer_published.py --repo ntuhophai/ERM-AI --list
61
+ 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
62
+ python tools/infer_published.py --repo ntuhophai/ERM-AI --condition fusion_8 --all-folds --root /path/to/cases --output predictions/fusion_8
63
+ ```
64
+
65
+ Before the model PR is merged, add --revision refs/pr/<number> to every Hub command above. After merge, the default main revision can be used. Wait for all models and catalog.json to finish uploading before inference.
66
+ Only selected fold weights/configurations are downloaded. Pin --revision to a model repository commit for reproducible downloads. Predictions include per-class probabilities in the saved class index order.
67
+ Case folders must provide one matching image per required stream. Both class/case/image folders and unlabeled case/image folders are supported.
68
+ 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.
69
+
70
+ Historical entries are tensor-only because their original fold/stream settings were not saved. They are included for completeness but are not automatically inferable.
71
+
72
+ ## Provenance and limits
73
+
74
+ 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.
75
+ Class names bad/good are recorded labels; do not infer healthy/diseased meanings without the study definition.
76
+ 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.
77
+ No model license was guessed. Complete the study-specific model documentation/license before treating this as a clinical release.
78
+
79
+ Public code snapshot: [code and complete usage instructions](https://github.com/chou141253/ERM-AI/tree/7687fab91d129f51db32c663ea0122b9b69b75b9/new). See INFERENCE.md and MODEL_CATALOG.md in that snapshot.
catalog.json ADDED
The diff for this file is too large to render. See raw diff
 
historical/image-classification-2-stream-1/README.md ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ # Historical tensor archive
2
+
3
+ Condition: historical_image-classification-2-stream-1
4
+
5
+ These original tensors are preserved for research provenance. No fold, stream order, label mapping or preprocessing is asserted.
6
+
7
+ Original fold/stream/preprocessing metadata is unavailable; archive tensors without guessing a deployment configuration.
8
+
9
+ The collection inference tool rejects this entry. Recover the original experiment settings before constructing an inference model. No patient/sample metadata is included.
historical/image-classification-2-stream-1/config.json ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "historical_format_version": 1,
3
+ "condition": "historical_image-classification-2-stream-1",
4
+ "inference_ready": false,
5
+ "streams": null,
6
+ "class_to_idx": null,
7
+ "model_config": null,
8
+ "preprocessing": null,
9
+ "source_format": "legacy_raw_state_dict",
10
+ "private_training_metadata_omitted": true,
11
+ "reason": "Original fold/stream/preprocessing metadata is unavailable; archive tensors without guessing a deployment configuration."
12
+ }
historical/image-classification-2-stream-1/model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:93d4866aa6c60a3dc6da4b080cc6bbbed599ba804a78e3f78c8029d2614c3b5e
3
+ size 373165368
historical/image-classification-2/README.md ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ # Historical tensor archive
2
+
3
+ Condition: historical_image-classification-2
4
+
5
+ These original tensors are preserved for research provenance. No fold, stream order, label mapping or preprocessing is asserted.
6
+
7
+ Original fold/stream/preprocessing metadata is unavailable; archive tensors without guessing a deployment configuration.
8
+
9
+ The collection inference tool rejects this entry. Recover the original experiment settings before constructing an inference model. No patient/sample metadata is included.
historical/image-classification-2/config.json ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "historical_format_version": 1,
3
+ "condition": "historical_image-classification-2",
4
+ "inference_ready": false,
5
+ "streams": null,
6
+ "class_to_idx": null,
7
+ "model_config": null,
8
+ "preprocessing": null,
9
+ "source_format": "legacy_raw_state_dict",
10
+ "private_training_metadata_omitted": true,
11
+ "reason": "Original fold/stream/preprocessing metadata is unavailable; archive tensors without guessing a deployment configuration."
12
+ }
historical/image-classification-2/model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b367b315f22967cb5b006a18fd55c19572deac905f931a4d5e7c55a4a90766e8
3
+ size 94289936
historical/image-classification-3/README.md ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ # Historical tensor archive
2
+
3
+ Condition: historical_image-classification-3
4
+
5
+ These original tensors are preserved for research provenance. No fold, stream order, label mapping or preprocessing is asserted.
6
+
7
+ Original fold/stream/preprocessing metadata is unavailable; archive tensors without guessing a deployment configuration.
8
+
9
+ The collection inference tool rejects this entry. Recover the original experiment settings before constructing an inference model. No patient/sample metadata is included.
historical/image-classification-3/config.json ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "historical_format_version": 1,
3
+ "condition": "historical_image-classification-3",
4
+ "inference_ready": false,
5
+ "streams": null,
6
+ "class_to_idx": null,
7
+ "model_config": null,
8
+ "preprocessing": null,
9
+ "source_format": "legacy_raw_state_dict",
10
+ "private_training_metadata_omitted": true,
11
+ "reason": "Original fold/stream/preprocessing metadata is unavailable; archive tensors without guessing a deployment configuration."
12
+ }
historical/image-classification-3/model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:46f7fa718638ebe2ce9c54277378503a2993d961ca8a4ed7a99e647acca994d4
3
+ size 94289936
historical/image-classification-4/README.md ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ # Historical tensor archive
2
+
3
+ Condition: historical_image-classification-4
4
+
5
+ These original tensors are preserved for research provenance. No fold, stream order, label mapping or preprocessing is asserted.
6
+
7
+ Original fold/stream/preprocessing metadata is unavailable; archive tensors without guessing a deployment configuration.
8
+
9
+ The collection inference tool rejects this entry. Recover the original experiment settings before constructing an inference model. No patient/sample metadata is included.
historical/image-classification-4/config.json ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "historical_format_version": 1,
3
+ "condition": "historical_image-classification-4",
4
+ "inference_ready": false,
5
+ "streams": null,
6
+ "class_to_idx": null,
7
+ "model_config": null,
8
+ "preprocessing": null,
9
+ "source_format": "legacy_raw_state_dict",
10
+ "private_training_metadata_omitted": true,
11
+ "reason": "Original fold/stream/preprocessing metadata is unavailable; archive tensors without guessing a deployment configuration."
12
+ }
historical/image-classification-4/model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7ded7842f68615ac1dd1c2a91d3f8ced0e916a3bdecd27b6815b18cbccea60c5
3
+ size 94289936
historical/image-classification-6/README.md ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ # Historical tensor archive
2
+
3
+ Condition: historical_image-classification-6
4
+
5
+ These original tensors are preserved for research provenance. No fold, stream order, label mapping or preprocessing is asserted.
6
+
7
+ Original fold/stream/preprocessing metadata is unavailable; archive tensors without guessing a deployment configuration.
8
+
9
+ The collection inference tool rejects this entry. Recover the original experiment settings before constructing an inference model. No patient/sample metadata is included.
historical/image-classification-6/config.json ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "historical_format_version": 1,
3
+ "condition": "historical_image-classification-6",
4
+ "inference_ready": false,
5
+ "streams": null,
6
+ "class_to_idx": null,
7
+ "model_config": null,
8
+ "preprocessing": null,
9
+ "source_format": "legacy_raw_state_dict",
10
+ "private_training_metadata_omitted": true,
11
+ "reason": "Original fold/stream/preprocessing metadata is unavailable; archive tensors without guessing a deployment configuration."
12
+ }
historical/image-classification-6/model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d8959ed8ad547b07a871bd939b020f4397f1099173d5641db7522eeee695beca
3
+ size 94289936
historical/image-classification-ms-2/README.md ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ # Historical tensor archive
2
+
3
+ Condition: historical_image-classification-ms-2
4
+
5
+ These original tensors are preserved for research provenance. No fold, stream order, label mapping or preprocessing is asserted.
6
+
7
+ Original fold/stream/preprocessing metadata is unavailable; archive tensors without guessing a deployment configuration.
8
+
9
+ The collection inference tool rejects this entry. Recover the original experiment settings before constructing an inference model. No patient/sample metadata is included.
historical/image-classification-ms-2/config.json ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "historical_format_version": 1,
3
+ "condition": "historical_image-classification-ms-2",
4
+ "inference_ready": false,
5
+ "streams": null,
6
+ "class_to_idx": null,
7
+ "model_config": null,
8
+ "preprocessing": null,
9
+ "source_format": "legacy_raw_state_dict",
10
+ "private_training_metadata_omitted": true,
11
+ "reason": "Original fold/stream/preprocessing metadata is unavailable; archive tensors without guessing a deployment configuration."
12
+ }
historical/image-classification-ms-2/model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0033ff48916aae69b083184b6fc9fc56325be1e205ffec35a81adb969d88aadb
3
+ size 349967064
historical/image-classification/README.md ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ # Historical tensor archive
2
+
3
+ Condition: historical_image-classification
4
+
5
+ These original tensors are preserved for research provenance. No fold, stream order, label mapping or preprocessing is asserted.
6
+
7
+ Original fold/stream/preprocessing metadata is unavailable; archive tensors without guessing a deployment configuration.
8
+
9
+ The collection inference tool rejects this entry. Recover the original experiment settings before constructing an inference model. No patient/sample metadata is included.
historical/image-classification/config.json ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "historical_format_version": 1,
3
+ "condition": "historical_image-classification",
4
+ "inference_ready": false,
5
+ "streams": null,
6
+ "class_to_idx": null,
7
+ "model_config": null,
8
+ "preprocessing": null,
9
+ "source_format": "legacy_raw_state_dict",
10
+ "private_training_metadata_omitted": true,
11
+ "reason": "Original fold/stream/preprocessing metadata is unavailable; archive tensors without guessing a deployment configuration."
12
+ }
historical/image-classification/model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:398dec021dbce2f77a4a66f1a2aeb0949ec3719c1a7c7d35d6d8b67927d865d8
3
+ size 94289936
modeling_multistream.py ADDED
@@ -0,0 +1,167 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Load public multistream weights without private training metadata."""
2
+ from pathlib import Path
3
+ import json
4
+
5
+ import timm
6
+ import torch
7
+ from torch import nn
8
+ from safetensors.torch import load_file
9
+
10
+
11
+ def _strict_load(model, state):
12
+ expected = model.state_dict()
13
+ if set(expected) != set(state):
14
+ missing, extra = set(expected) - set(state), set(state) - set(expected)
15
+ raise ValueError("Weight keys differ: missing=%s, extra=%s" %
16
+ (sorted(missing), sorted(extra)))
17
+ for key, value in state.items():
18
+ if tuple(value.shape) != tuple(expected[key].shape):
19
+ raise ValueError("Weight shape differs for " + key)
20
+ model.load_state_dict(state, strict=True)
21
+
22
+
23
+ class SingleStreamClassifier(nn.Module):
24
+ def __init__(self, name, streams, num_classes, freeze_backbones=False):
25
+ super().__init__()
26
+ self.streams = tuple(streams)
27
+ self.network = timm.create_model(name, pretrained=False, num_classes=num_classes)
28
+ self.freeze_backbones = freeze_backbones
29
+ if freeze_backbones:
30
+ for parameter in self.network.parameters():
31
+ parameter.requires_grad_(False)
32
+ for parameter in self.network.get_classifier().parameters():
33
+ parameter.requires_grad_(True)
34
+ self.train(self.training)
35
+
36
+ def forward(self, images):
37
+ _check_images(images, len(self.streams))
38
+ return self.network(images[:, 0])
39
+
40
+ def train(self, mode=True):
41
+ super().train(mode)
42
+ if getattr(self, "freeze_backbones", False):
43
+ self.network.eval()
44
+ self.network.get_classifier().train(mode)
45
+ return self
46
+
47
+ def state_dict(self, *args, **kwargs):
48
+ return self.network.state_dict(*args, **kwargs)
49
+
50
+ def load_state_dict(self, state, strict=True, **kwargs):
51
+ if not strict:
52
+ raise ValueError("Partial weight loading is disabled")
53
+ return self.network.load_state_dict(state, strict=True, **kwargs)
54
+
55
+
56
+ class MultiStreamClassifier(nn.Module):
57
+ def __init__(self, name, streams, num_classes, hidden_dim=2048,
58
+ freeze_backbones=False):
59
+ super().__init__()
60
+ self.streams = tuple(streams)
61
+ self.backbones = nn.ModuleList([
62
+ timm.create_model(name, pretrained=False, num_classes=0, global_pool="avg")
63
+ for _ in streams
64
+ ])
65
+ features = sum(int(backbone.num_features) for backbone in self.backbones)
66
+ self.fusion = nn.Sequential(
67
+ nn.Linear(features, hidden_dim), nn.ReLU(),
68
+ nn.Linear(hidden_dim, hidden_dim),
69
+ )
70
+ self.classifier = nn.Linear(hidden_dim, num_classes)
71
+ self.freeze_backbones = freeze_backbones
72
+ if freeze_backbones:
73
+ for parameter in self.backbones.parameters():
74
+ parameter.requires_grad_(False)
75
+ self.train(self.training)
76
+
77
+ def forward(self, images):
78
+ _check_images(images, len(self.streams))
79
+ features = [backbone(images[:, index])
80
+ for index, backbone in enumerate(self.backbones)]
81
+ return self.classifier(self.fusion(torch.cat(features, dim=1)))
82
+
83
+ def train(self, mode=True):
84
+ super().train(mode)
85
+ if getattr(self, "freeze_backbones", False):
86
+ self.backbones.eval()
87
+ return self
88
+
89
+
90
+ def _check_images(images, streams):
91
+ if not isinstance(images, torch.Tensor) or images.ndim != 5:
92
+ raise ValueError("Expected images shaped [B, S, 3, H, W]")
93
+ if images.shape[0] < 1 or images.shape[1] != streams or images.shape[2] != 3:
94
+ raise ValueError("Batch, stream count or RGB channels do not match")
95
+
96
+
97
+ def build_model(model_config, streams, num_classes, initialize=False):
98
+ if initialize:
99
+ raise ValueError("Public loading does not perform pretrained initialization")
100
+ if not isinstance(streams, (list, tuple)) or not 1 <= len(streams) <= 8:
101
+ raise ValueError("Expected 1 to 8 explicitly ordered streams")
102
+ if any(not isinstance(stream, str) or not stream for stream in streams):
103
+ raise ValueError("Stream names must be nonempty strings")
104
+ if len(set(streams)) != len(streams):
105
+ raise ValueError("Stream names must be unique")
106
+ if type(num_classes) is not int or num_classes < 2:
107
+ raise ValueError("Expected at least two classes")
108
+ name = model_config["name"]
109
+ if not isinstance(name, str) or not timm.is_model(name):
110
+ raise ValueError("Architecture must be registered locally in timm")
111
+ hidden = model_config.get("hidden_dim", 2048)
112
+ if type(hidden) is not int or hidden < 1:
113
+ raise ValueError("hidden_dim must be a positive integer")
114
+ frozen = model_config.get("freeze_backbones", False)
115
+ if type(frozen) is not bool:
116
+ raise ValueError("freeze_backbones must be a boolean")
117
+ if len(streams) == 1:
118
+ return SingleStreamClassifier(name, streams, num_classes, frozen)
119
+ return MultiStreamClassifier(name, streams, num_classes, hidden, frozen)
120
+
121
+
122
+ def load_public_model(directory, device="cpu"):
123
+ directory = Path(directory)
124
+ config = json.loads((directory / "config.json").read_text(encoding="utf-8"))
125
+ if config.get("public_format_version") != 1:
126
+ raise ValueError("Unsupported public export version")
127
+ classes = config["class_to_idx"]
128
+ if (not isinstance(classes, dict) or len(classes) < 2
129
+ or any(not isinstance(name, str) or type(index) is not int
130
+ for name, index in classes.items())
131
+ or sorted(classes.values()) != list(range(len(classes)))):
132
+ raise ValueError("Invalid public class mapping")
133
+ model = build_model(config["model_config"], config["streams"], len(classes))
134
+ _strict_load(model, load_file(str(directory / "model.safetensors"), device="cpu"))
135
+ model.public_config = config
136
+ model.class_to_idx = classes
137
+ model.preprocessing = config["preprocessing"]
138
+ return model.to(device).eval()
139
+
140
+
141
+ def preprocess_streams(paths, preprocessing):
142
+ """Return [1, S, 3, H, W] in the supplied path order."""
143
+ from PIL import Image
144
+ from torchvision.transforms import functional as F
145
+ from torchvision.transforms import InterpolationMode
146
+ tensors = []
147
+ backend = preprocessing.get("resize_backend", "pil")
148
+ for path in paths:
149
+ with Image.open(path) as opened:
150
+ image = opened.convert("RGB")
151
+ if backend == "tensor":
152
+ tensor = F.resize(
153
+ F.to_tensor(image), preprocessing["resize_size"],
154
+ interpolation=InterpolationMode.BILINEAR,
155
+ antialias=preprocessing["antialias"],
156
+ )
157
+ elif backend == "pil":
158
+ image = F.resize(image, preprocessing["resize_size"],
159
+ interpolation=InterpolationMode.BILINEAR)
160
+ tensor = F.to_tensor(image)
161
+ else:
162
+ raise ValueError("Unsupported resize backend")
163
+ tensor = F.center_crop(tensor, [preprocessing["image_size"]] * 2)
164
+ tensors.append(F.normalize(tensor, preprocessing["mean"], preprocessing["std"]))
165
+ if not tensors:
166
+ raise ValueError("Supply one image path per declared stream")
167
+ return torch.stack(tensors).unsqueeze(0)
models/fusion_2_color/fold_0/README.md ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - pytorch
4
+ - timm
5
+ - multistream
6
+ - image-classification
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_inner", "color_outer"]
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 fusion_2_color --fold 0 --root /path/to/cases --output predictions/fusion_2_color_fold0
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: fusion_2_color; zero-based fold: 0.
47
+
48
+ Declared preprocessing:
49
+
50
+ ```json
51
+ {
52
+ "image_size": 448,
53
+ "resize_size": 448,
54
+ "mean": [
55
+ 0.485,
56
+ 0.456,
57
+ 0.406
58
+ ],
59
+ "std": [
60
+ 0.229,
61
+ 0.224,
62
+ 0.225
63
+ ],
64
+ "resize_backend": "tensor",
65
+ "interpolation": "bilinear",
66
+ "antialias": true,
67
+ "crop": "center"
68
+ }
69
+ ```
70
+
71
+ Profile note: Order follows saved config2.yaml; two-stream runtime records use torchvision 0.17.1.
72
+
73
+ [Complete download, inference and output instructions](https://github.com/chou141253/ERM-AI/blob/7687fab91d129f51db32c663ea0122b9b69b75b9/new/INFERENCE.md)
models/fusion_2_color/fold_0/config.json ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "public_format_version": 1,
3
+ "model_config": {
4
+ "name": "resnet50",
5
+ "hidden_dim": 2048,
6
+ "freeze_backbones": false,
7
+ "pretrained": false
8
+ },
9
+ "streams": [
10
+ "color_inner",
11
+ "color_outer"
12
+ ],
13
+ "class_to_idx": {
14
+ "bad": 0,
15
+ "good": 1
16
+ },
17
+ "preprocessing": {
18
+ "image_size": 448,
19
+ "resize_size": 448,
20
+ "mean": [
21
+ 0.485,
22
+ 0.456,
23
+ 0.406
24
+ ],
25
+ "std": [
26
+ 0.229,
27
+ 0.224,
28
+ 0.225
29
+ ],
30
+ "resize_backend": "tensor",
31
+ "interpolation": "bilinear",
32
+ "antialias": true,
33
+ "crop": "center"
34
+ },
35
+ "artifact_kind": "research",
36
+ "source_format": "legacy_state_dict",
37
+ "settings_provenance": "operator_supplied",
38
+ "private_training_metadata_omitted": true,
39
+ "legacy_no_split_metadata": true
40
+ }
models/fusion_2_color/fold_0/model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5e17fd77fb1e62ac349154c20ec21bfc5a65fcebb08047ac7e0d8387eab1de4f
3
+ size 238920160
models/fusion_2_color/fold_1/README.md ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - pytorch
4
+ - timm
5
+ - multistream
6
+ - image-classification
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_inner", "color_outer"]
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 fusion_2_color --fold 1 --root /path/to/cases --output predictions/fusion_2_color_fold1
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: fusion_2_color; zero-based fold: 1.
47
+
48
+ Declared preprocessing:
49
+
50
+ ```json
51
+ {
52
+ "image_size": 448,
53
+ "resize_size": 448,
54
+ "mean": [
55
+ 0.485,
56
+ 0.456,
57
+ 0.406
58
+ ],
59
+ "std": [
60
+ 0.229,
61
+ 0.224,
62
+ 0.225
63
+ ],
64
+ "resize_backend": "tensor",
65
+ "interpolation": "bilinear",
66
+ "antialias": true,
67
+ "crop": "center"
68
+ }
69
+ ```
70
+
71
+ Profile note: Order follows saved config2.yaml; two-stream runtime records use torchvision 0.17.1.
72
+
73
+ [Complete download, inference and output instructions](https://github.com/chou141253/ERM-AI/blob/7687fab91d129f51db32c663ea0122b9b69b75b9/new/INFERENCE.md)
models/fusion_2_color/fold_1/config.json ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "public_format_version": 1,
3
+ "model_config": {
4
+ "name": "resnet50",
5
+ "hidden_dim": 2048,
6
+ "freeze_backbones": false,
7
+ "pretrained": false
8
+ },
9
+ "streams": [
10
+ "color_inner",
11
+ "color_outer"
12
+ ],
13
+ "class_to_idx": {
14
+ "bad": 0,
15
+ "good": 1
16
+ },
17
+ "preprocessing": {
18
+ "image_size": 448,
19
+ "resize_size": 448,
20
+ "mean": [
21
+ 0.485,
22
+ 0.456,
23
+ 0.406
24
+ ],
25
+ "std": [
26
+ 0.229,
27
+ 0.224,
28
+ 0.225
29
+ ],
30
+ "resize_backend": "tensor",
31
+ "interpolation": "bilinear",
32
+ "antialias": true,
33
+ "crop": "center"
34
+ },
35
+ "artifact_kind": "research",
36
+ "source_format": "legacy_state_dict",
37
+ "settings_provenance": "operator_supplied",
38
+ "private_training_metadata_omitted": true,
39
+ "legacy_no_split_metadata": true
40
+ }
models/fusion_2_color/fold_1/model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d5bb25d53a41cabbcfecc0f56c3e8ab5c092ecfa108ef482a9ab3ce07c4110c9
3
+ size 238920160
models/fusion_2_color/fold_2/README.md ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - pytorch
4
+ - timm
5
+ - multistream
6
+ - image-classification
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_inner", "color_outer"]
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 fusion_2_color --fold 2 --root /path/to/cases --output predictions/fusion_2_color_fold2
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: fusion_2_color; zero-based fold: 2.
47
+
48
+ Declared preprocessing:
49
+
50
+ ```json
51
+ {
52
+ "image_size": 448,
53
+ "resize_size": 448,
54
+ "mean": [
55
+ 0.485,
56
+ 0.456,
57
+ 0.406
58
+ ],
59
+ "std": [
60
+ 0.229,
61
+ 0.224,
62
+ 0.225
63
+ ],
64
+ "resize_backend": "tensor",
65
+ "interpolation": "bilinear",
66
+ "antialias": true,
67
+ "crop": "center"
68
+ }
69
+ ```
70
+
71
+ Profile note: Order follows saved config2.yaml; two-stream runtime records use torchvision 0.17.1.
72
+
73
+ [Complete download, inference and output instructions](https://github.com/chou141253/ERM-AI/blob/7687fab91d129f51db32c663ea0122b9b69b75b9/new/INFERENCE.md)
models/fusion_2_color/fold_2/config.json ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "public_format_version": 1,
3
+ "model_config": {
4
+ "name": "resnet50",
5
+ "hidden_dim": 2048,
6
+ "freeze_backbones": false,
7
+ "pretrained": false
8
+ },
9
+ "streams": [
10
+ "color_inner",
11
+ "color_outer"
12
+ ],
13
+ "class_to_idx": {
14
+ "bad": 0,
15
+ "good": 1
16
+ },
17
+ "preprocessing": {
18
+ "image_size": 448,
19
+ "resize_size": 448,
20
+ "mean": [
21
+ 0.485,
22
+ 0.456,
23
+ 0.406
24
+ ],
25
+ "std": [
26
+ 0.229,
27
+ 0.224,
28
+ 0.225
29
+ ],
30
+ "resize_backend": "tensor",
31
+ "interpolation": "bilinear",
32
+ "antialias": true,
33
+ "crop": "center"
34
+ },
35
+ "artifact_kind": "research",
36
+ "source_format": "legacy_state_dict",
37
+ "settings_provenance": "operator_supplied",
38
+ "private_training_metadata_omitted": true,
39
+ "legacy_no_split_metadata": true
40
+ }
models/fusion_2_color/fold_2/model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f8998e4bb84095f5631314ff7e12dcc668d1e3d270bdeccf36a04c6aa92fd33b
3
+ size 238920160
models/fusion_2_color/fold_3/README.md ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - pytorch
4
+ - timm
5
+ - multistream
6
+ - image-classification
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_inner", "color_outer"]
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 fusion_2_color --fold 3 --root /path/to/cases --output predictions/fusion_2_color_fold3
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: fusion_2_color; zero-based fold: 3.
47
+
48
+ Declared preprocessing:
49
+
50
+ ```json
51
+ {
52
+ "image_size": 448,
53
+ "resize_size": 448,
54
+ "mean": [
55
+ 0.485,
56
+ 0.456,
57
+ 0.406
58
+ ],
59
+ "std": [
60
+ 0.229,
61
+ 0.224,
62
+ 0.225
63
+ ],
64
+ "resize_backend": "tensor",
65
+ "interpolation": "bilinear",
66
+ "antialias": true,
67
+ "crop": "center"
68
+ }
69
+ ```
70
+
71
+ Profile note: Order follows saved config2.yaml; two-stream runtime records use torchvision 0.17.1.
72
+
73
+ [Complete download, inference and output instructions](https://github.com/chou141253/ERM-AI/blob/7687fab91d129f51db32c663ea0122b9b69b75b9/new/INFERENCE.md)
models/fusion_2_color/fold_3/config.json ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "public_format_version": 1,
3
+ "model_config": {
4
+ "name": "resnet50",
5
+ "hidden_dim": 2048,
6
+ "freeze_backbones": false,
7
+ "pretrained": false
8
+ },
9
+ "streams": [
10
+ "color_inner",
11
+ "color_outer"
12
+ ],
13
+ "class_to_idx": {
14
+ "bad": 0,
15
+ "good": 1
16
+ },
17
+ "preprocessing": {
18
+ "image_size": 448,
19
+ "resize_size": 448,
20
+ "mean": [
21
+ 0.485,
22
+ 0.456,
23
+ 0.406
24
+ ],
25
+ "std": [
26
+ 0.229,
27
+ 0.224,
28
+ 0.225
29
+ ],
30
+ "resize_backend": "tensor",
31
+ "interpolation": "bilinear",
32
+ "antialias": true,
33
+ "crop": "center"
34
+ },
35
+ "artifact_kind": "research",
36
+ "source_format": "legacy_state_dict",
37
+ "settings_provenance": "operator_supplied",
38
+ "private_training_metadata_omitted": true,
39
+ "legacy_no_split_metadata": true
40
+ }
models/fusion_2_color/fold_3/model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bb29c2493159e3e96c64ce967c23f860798ae7a1a86f91357bc3696441df2083
3
+ size 238920160
models/fusion_2_color/fold_4/README.md ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - pytorch
4
+ - timm
5
+ - multistream
6
+ - image-classification
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_inner", "color_outer"]
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 fusion_2_color --fold 4 --root /path/to/cases --output predictions/fusion_2_color_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: fusion_2_color; zero-based fold: 4.
47
+
48
+ Declared preprocessing:
49
+
50
+ ```json
51
+ {
52
+ "image_size": 448,
53
+ "resize_size": 448,
54
+ "mean": [
55
+ 0.485,
56
+ 0.456,
57
+ 0.406
58
+ ],
59
+ "std": [
60
+ 0.229,
61
+ 0.224,
62
+ 0.225
63
+ ],
64
+ "resize_backend": "tensor",
65
+ "interpolation": "bilinear",
66
+ "antialias": true,
67
+ "crop": "center"
68
+ }
69
+ ```
70
+
71
+ Profile note: Order follows saved config2.yaml; two-stream runtime records use torchvision 0.17.1.
72
+
73
+ [Complete download, inference and output instructions](https://github.com/chou141253/ERM-AI/blob/7687fab91d129f51db32c663ea0122b9b69b75b9/new/INFERENCE.md)
models/fusion_2_color/fold_4/config.json ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "public_format_version": 1,
3
+ "model_config": {
4
+ "name": "resnet50",
5
+ "hidden_dim": 2048,
6
+ "freeze_backbones": false,
7
+ "pretrained": false
8
+ },
9
+ "streams": [
10
+ "color_inner",
11
+ "color_outer"
12
+ ],
13
+ "class_to_idx": {
14
+ "bad": 0,
15
+ "good": 1
16
+ },
17
+ "preprocessing": {
18
+ "image_size": 448,
19
+ "resize_size": 448,
20
+ "mean": [
21
+ 0.485,
22
+ 0.456,
23
+ 0.406
24
+ ],
25
+ "std": [
26
+ 0.229,
27
+ 0.224,
28
+ 0.225
29
+ ],
30
+ "resize_backend": "tensor",
31
+ "interpolation": "bilinear",
32
+ "antialias": true,
33
+ "crop": "center"
34
+ },
35
+ "artifact_kind": "research",
36
+ "source_format": "legacy_state_dict",
37
+ "settings_provenance": "operator_supplied",
38
+ "private_training_metadata_omitted": true,
39
+ "legacy_no_split_metadata": true
40
+ }
models/fusion_2_color/fold_4/model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:90f3e059a0ee7fe8a81188815eb48d5d4a4a1d2dc692daba1c38fcd2d847cbc2
3
+ size 238920160
models/fusion_2_color/fold_5/README.md ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - pytorch
4
+ - timm
5
+ - multistream
6
+ - image-classification
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_inner", "color_outer"]
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 fusion_2_color --fold 5 --root /path/to/cases --output predictions/fusion_2_color_fold5
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: fusion_2_color; zero-based fold: 5.
47
+
48
+ Declared preprocessing:
49
+
50
+ ```json
51
+ {
52
+ "image_size": 448,
53
+ "resize_size": 448,
54
+ "mean": [
55
+ 0.485,
56
+ 0.456,
57
+ 0.406
58
+ ],
59
+ "std": [
60
+ 0.229,
61
+ 0.224,
62
+ 0.225
63
+ ],
64
+ "resize_backend": "tensor",
65
+ "interpolation": "bilinear",
66
+ "antialias": true,
67
+ "crop": "center"
68
+ }
69
+ ```
70
+
71
+ Profile note: Order follows saved config2.yaml; two-stream runtime records use torchvision 0.17.1.
72
+
73
+ [Complete download, inference and output instructions](https://github.com/chou141253/ERM-AI/blob/7687fab91d129f51db32c663ea0122b9b69b75b9/new/INFERENCE.md)
models/fusion_2_color/fold_5/config.json ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "public_format_version": 1,
3
+ "model_config": {
4
+ "name": "resnet50",
5
+ "hidden_dim": 2048,
6
+ "freeze_backbones": false,
7
+ "pretrained": false
8
+ },
9
+ "streams": [
10
+ "color_inner",
11
+ "color_outer"
12
+ ],
13
+ "class_to_idx": {
14
+ "bad": 0,
15
+ "good": 1
16
+ },
17
+ "preprocessing": {
18
+ "image_size": 448,
19
+ "resize_size": 448,
20
+ "mean": [
21
+ 0.485,
22
+ 0.456,
23
+ 0.406
24
+ ],
25
+ "std": [
26
+ 0.229,
27
+ 0.224,
28
+ 0.225
29
+ ],
30
+ "resize_backend": "tensor",
31
+ "interpolation": "bilinear",
32
+ "antialias": true,
33
+ "crop": "center"
34
+ },
35
+ "artifact_kind": "research",
36
+ "source_format": "legacy_state_dict",
37
+ "settings_provenance": "operator_supplied",
38
+ "private_training_metadata_omitted": true,
39
+ "legacy_no_split_metadata": true
40
+ }
models/fusion_2_color/fold_5/model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:06b6877a9975a5fa57d00c7515208b83ddb4e937989c20877de778cbbe80a159
3
+ size 238920160
models/fusion_2_color/fold_6/README.md ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - pytorch
4
+ - timm
5
+ - multistream
6
+ - image-classification
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_inner", "color_outer"]
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 fusion_2_color --fold 6 --root /path/to/cases --output predictions/fusion_2_color_fold6
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: fusion_2_color; zero-based fold: 6.
47
+
48
+ Declared preprocessing:
49
+
50
+ ```json
51
+ {
52
+ "image_size": 448,
53
+ "resize_size": 448,
54
+ "mean": [
55
+ 0.485,
56
+ 0.456,
57
+ 0.406
58
+ ],
59
+ "std": [
60
+ 0.229,
61
+ 0.224,
62
+ 0.225
63
+ ],
64
+ "resize_backend": "tensor",
65
+ "interpolation": "bilinear",
66
+ "antialias": true,
67
+ "crop": "center"
68
+ }
69
+ ```
70
+
71
+ Profile note: Order follows saved config2.yaml; two-stream runtime records use torchvision 0.17.1.
72
+
73
+ [Complete download, inference and output instructions](https://github.com/chou141253/ERM-AI/blob/7687fab91d129f51db32c663ea0122b9b69b75b9/new/INFERENCE.md)
models/fusion_2_color/fold_6/config.json ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "public_format_version": 1,
3
+ "model_config": {
4
+ "name": "resnet50",
5
+ "hidden_dim": 2048,
6
+ "freeze_backbones": false,
7
+ "pretrained": false
8
+ },
9
+ "streams": [
10
+ "color_inner",
11
+ "color_outer"
12
+ ],
13
+ "class_to_idx": {
14
+ "bad": 0,
15
+ "good": 1
16
+ },
17
+ "preprocessing": {
18
+ "image_size": 448,
19
+ "resize_size": 448,
20
+ "mean": [
21
+ 0.485,
22
+ 0.456,
23
+ 0.406
24
+ ],
25
+ "std": [
26
+ 0.229,
27
+ 0.224,
28
+ 0.225
29
+ ],
30
+ "resize_backend": "tensor",
31
+ "interpolation": "bilinear",
32
+ "antialias": true,
33
+ "crop": "center"
34
+ },
35
+ "artifact_kind": "research",
36
+ "source_format": "legacy_state_dict",
37
+ "settings_provenance": "operator_supplied",
38
+ "private_training_metadata_omitted": true,
39
+ "legacy_no_split_metadata": true
40
+ }
models/fusion_2_color/fold_6/model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d8c6b042ad84def9382d227c6643af6e7508abdedbe2033acb9e665744afbc52
3
+ size 238920160
models/fusion_2_color/fold_7/README.md ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - pytorch
4
+ - timm
5
+ - multistream
6
+ - image-classification
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_inner", "color_outer"]
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 fusion_2_color --fold 7 --root /path/to/cases --output predictions/fusion_2_color_fold7
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: fusion_2_color; zero-based fold: 7.
47
+
48
+ Declared preprocessing:
49
+
50
+ ```json
51
+ {
52
+ "image_size": 448,
53
+ "resize_size": 448,
54
+ "mean": [
55
+ 0.485,
56
+ 0.456,
57
+ 0.406
58
+ ],
59
+ "std": [
60
+ 0.229,
61
+ 0.224,
62
+ 0.225
63
+ ],
64
+ "resize_backend": "tensor",
65
+ "interpolation": "bilinear",
66
+ "antialias": true,
67
+ "crop": "center"
68
+ }
69
+ ```
70
+
71
+ Profile note: Order follows saved config2.yaml; two-stream runtime records use torchvision 0.17.1.
72
+
73
+ [Complete download, inference and output instructions](https://github.com/chou141253/ERM-AI/blob/7687fab91d129f51db32c663ea0122b9b69b75b9/new/INFERENCE.md)
models/fusion_2_color/fold_7/config.json ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "public_format_version": 1,
3
+ "model_config": {
4
+ "name": "resnet50",
5
+ "hidden_dim": 2048,
6
+ "freeze_backbones": false,
7
+ "pretrained": false
8
+ },
9
+ "streams": [
10
+ "color_inner",
11
+ "color_outer"
12
+ ],
13
+ "class_to_idx": {
14
+ "bad": 0,
15
+ "good": 1
16
+ },
17
+ "preprocessing": {
18
+ "image_size": 448,
19
+ "resize_size": 448,
20
+ "mean": [
21
+ 0.485,
22
+ 0.456,
23
+ 0.406
24
+ ],
25
+ "std": [
26
+ 0.229,
27
+ 0.224,
28
+ 0.225
29
+ ],
30
+ "resize_backend": "tensor",
31
+ "interpolation": "bilinear",
32
+ "antialias": true,
33
+ "crop": "center"
34
+ },
35
+ "artifact_kind": "research",
36
+ "source_format": "legacy_state_dict",
37
+ "settings_provenance": "operator_supplied",
38
+ "private_training_metadata_omitted": true,
39
+ "legacy_no_split_metadata": true
40
+ }
models/fusion_2_color/fold_7/model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:87ba2883726aa7a6885f5bd4bc3166c4f7dc6d770d23410f3ab0a6acf2400983
3
+ size 238920160
models/fusion_2_color/fold_8/README.md ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - pytorch
4
+ - timm
5
+ - multistream
6
+ - image-classification
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_inner", "color_outer"]
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 fusion_2_color --fold 8 --root /path/to/cases --output predictions/fusion_2_color_fold8
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: fusion_2_color; zero-based fold: 8.
47
+
48
+ Declared preprocessing:
49
+
50
+ ```json
51
+ {
52
+ "image_size": 448,
53
+ "resize_size": 448,
54
+ "mean": [
55
+ 0.485,
56
+ 0.456,
57
+ 0.406
58
+ ],
59
+ "std": [
60
+ 0.229,
61
+ 0.224,
62
+ 0.225
63
+ ],
64
+ "resize_backend": "tensor",
65
+ "interpolation": "bilinear",
66
+ "antialias": true,
67
+ "crop": "center"
68
+ }
69
+ ```
70
+
71
+ Profile note: Order follows saved config2.yaml; two-stream runtime records use torchvision 0.17.1.
72
+
73
+ [Complete download, inference and output instructions](https://github.com/chou141253/ERM-AI/blob/7687fab91d129f51db32c663ea0122b9b69b75b9/new/INFERENCE.md)
models/fusion_2_color/fold_8/config.json ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "public_format_version": 1,
3
+ "model_config": {
4
+ "name": "resnet50",
5
+ "hidden_dim": 2048,
6
+ "freeze_backbones": false,
7
+ "pretrained": false
8
+ },
9
+ "streams": [
10
+ "color_inner",
11
+ "color_outer"
12
+ ],
13
+ "class_to_idx": {
14
+ "bad": 0,
15
+ "good": 1
16
+ },
17
+ "preprocessing": {
18
+ "image_size": 448,
19
+ "resize_size": 448,
20
+ "mean": [
21
+ 0.485,
22
+ 0.456,
23
+ 0.406
24
+ ],
25
+ "std": [
26
+ 0.229,
27
+ 0.224,
28
+ 0.225
29
+ ],
30
+ "resize_backend": "tensor",
31
+ "interpolation": "bilinear",
32
+ "antialias": true,
33
+ "crop": "center"
34
+ },
35
+ "artifact_kind": "research",
36
+ "source_format": "legacy_state_dict",
37
+ "settings_provenance": "operator_supplied",
38
+ "private_training_metadata_omitted": true,
39
+ "legacy_no_split_metadata": true
40
+ }