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_gray_outer/fold_5
Browse files
models/single_gray_outer/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: ["gray_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 single_gray_outer --fold 5 --root /path/to/cases --output predictions/single_gray_outer_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: single_gray_outer; 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: 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/7687fab91d129f51db32c663ea0122b9b69b75b9/new/INFERENCE.md)
|
models/single_gray_outer/fold_5/config.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
+
"gray_outer"
|
| 11 |
+
],
|
| 12 |
+
"class_to_idx": {
|
| 13 |
+
"bad": 0,
|
| 14 |
+
"good": 1
|
| 15 |
+
},
|
| 16 |
+
"preprocessing": {
|
| 17 |
+
"image_size": 448,
|
| 18 |
+
"resize_size": 448,
|
| 19 |
+
"mean": [
|
| 20 |
+
0.485,
|
| 21 |
+
0.456,
|
| 22 |
+
0.406
|
| 23 |
+
],
|
| 24 |
+
"std": [
|
| 25 |
+
0.229,
|
| 26 |
+
0.224,
|
| 27 |
+
0.225
|
| 28 |
+
],
|
| 29 |
+
"resize_backend": "tensor",
|
| 30 |
+
"interpolation": "bilinear",
|
| 31 |
+
"antialias": true,
|
| 32 |
+
"crop": "center"
|
| 33 |
+
},
|
| 34 |
+
"artifact_kind": "research",
|
| 35 |
+
"source_format": "legacy_state_dict",
|
| 36 |
+
"settings_provenance": "operator_supplied",
|
| 37 |
+
"private_training_metadata_omitted": true,
|
| 38 |
+
"legacy_no_split_metadata": true
|
| 39 |
+
}
|
models/single_gray_outer/fold_5/model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:38d5e293c42b089fd1103f4678cf6a5731c63fa5abae9a84e932f7f46f713750
|
| 3 |
+
size 94289936
|