jimnoneill commited on
Commit
a39bc9e
·
verified ·
1 Parent(s): 689732f

Upload ENVISION eye imaging classifier v1.0

Browse files
1_Pooling/config.json CHANGED
@@ -1,7 +1,7 @@
1
  {
2
- "word_embedding_dimension": 1024,
3
- "pooling_mode_cls_token": true,
4
- "pooling_mode_mean_tokens": false,
5
  "pooling_mode_max_tokens": false,
6
  "pooling_mode_mean_sqrt_len_tokens": false,
7
  "pooling_mode_weightedmean_tokens": false,
 
1
  {
2
+ "word_embedding_dimension": 768,
3
+ "pooling_mode_cls_token": false,
4
+ "pooling_mode_mean_tokens": true,
5
  "pooling_mode_max_tokens": false,
6
  "pooling_mode_mean_sqrt_len_tokens": false,
7
  "pooling_mode_weightedmean_tokens": false,
README.md CHANGED
@@ -19,7 +19,7 @@ SetFit few-shot classifier for identifying eye imaging datasets from scientific
19
 
20
  ## Model Description
21
 
22
- Uses `Alibaba-NLP/gte-large-en-v1.5` as backbone with 4-class classification:
23
 
24
  - **EYE_IMAGING (3)**: Actual ophthalmic imaging datasets (fundus, OCT, OCTA, cornea)
25
  - **EYE_SOFTWARE (2)**: Code, tools, models for eye imaging
@@ -32,18 +32,18 @@ Tested on 515 Zenodo datasets (filtered to `resource_type=dataset` only):
32
 
33
  | Class | Count |
34
  |-------|-------|
35
- | EYE_IMAGING | 120 |
36
- | EYE_SOFTWARE | 66 |
37
- | EDGE_CASE | 3 |
38
- | NEGATIVE | 325 |
39
 
40
  ### Confidence Distribution (EYE_IMAGING)
41
 
42
  | Confidence | Count | % |
43
  |------------|-------|---|
44
- | High (0.95) | 117 | 97.5% |
45
- | Medium (0.80-0.95) | 2 | 1.7% |
46
- | Lower (<0.80) | 1 | 0.8% |
47
 
48
  ### Data Pipeline
49
 
@@ -53,17 +53,43 @@ Tested on 515 Zenodo datasets (filtered to `resource_type=dataset` only):
53
 
54
  ## Training
55
 
56
- - **Examples**: 452 (99 positive, 30 software, 90 edge case, 233 negative)
 
57
  - **Epochs**: 2
58
  - **Batch Size**: 16
59
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
  ## Usage
61
 
62
  ```python
63
  from sentence_transformers import SentenceTransformer
64
  import joblib
65
 
66
- model = SentenceTransformer("jimnoneill/envision-eye-imaging-classifier", trust_remote_code=True)
67
  head = joblib.load("model_head.pkl")
68
 
69
  embeddings = model.encode(["Retinal OCT dataset for diabetic retinopathy"])
@@ -74,9 +100,8 @@ predictions = head.predict(embeddings)
74
 
75
  - EyeACT Envision project
76
  - FAIR Data Innovations Hub (fairdataihub.org)
77
- - Alibaba-NLP/gte-large-en-v1.5
78
 
79
  ## Contact
80
 
81
  EyeACT team: [eyeactstudy.org](https://eyeactstudy.org)
82
-
 
19
 
20
  ## Model Description
21
 
22
+ Uses `sentence-transformers/all-mpnet-base-v2` as backbone with 4-class classification:
23
 
24
  - **EYE_IMAGING (3)**: Actual ophthalmic imaging datasets (fundus, OCT, OCTA, cornea)
25
  - **EYE_SOFTWARE (2)**: Code, tools, models for eye imaging
 
32
 
33
  | Class | Count |
34
  |-------|-------|
35
+ | EYE_IMAGING | 127 |
36
+ | EYE_SOFTWARE | 24 |
37
+ | EDGE_CASE | 32 |
38
+ | NEGATIVE | 331 |
39
 
40
  ### Confidence Distribution (EYE_IMAGING)
41
 
42
  | Confidence | Count | % |
43
  |------------|-------|---|
44
+ | High (>=0.95) | 49 | 38.6% |
45
+ | Medium (0.80-0.95) | 70 | 55.1% |
46
+ | Lower (<0.80) | 8 | 6.3% |
47
 
48
  ### Data Pipeline
49
 
 
53
 
54
  ## Training
55
 
56
+ - **Base Model**: `sentence-transformers/all-mpnet-base-v2` (768-dimensional embeddings)
57
+ - **Examples**: 474 (77 EYE_IMAGING, 48 EYE_SOFTWARE, 79 EDGE_CASE, 270 NEGATIVE)
58
  - **Epochs**: 2
59
  - **Batch Size**: 16
60
 
61
+ ## Validation
62
+
63
+ ### Held-out Test Set
64
+
65
+ | Metric | Value |
66
+ |--------|-------|
67
+ | Accuracy | 0.937 |
68
+ | Macro F1 | 0.902 |
69
+
70
+ ### Spot-Check Validation (33 records)
71
+
72
+ | Metric | Value |
73
+ |--------|-------|
74
+ | Accuracy | 29/33 (87.9%) |
75
+ | Macro F1 | 0.828 |
76
+
77
+ #### Per-Class F1 (Spot-Check)
78
+
79
+ | Class | F1 |
80
+ |-------|-----|
81
+ | EYE_IMAGING | 0.947 |
82
+ | EDGE_CASE | 0.889 |
83
+ | NEGATIVE | 0.903 |
84
+ | EYE_SOFTWARE | 0.571 |
85
+
86
  ## Usage
87
 
88
  ```python
89
  from sentence_transformers import SentenceTransformer
90
  import joblib
91
 
92
+ model = SentenceTransformer("fairdataihub/envision-eye-imaging-classifier")
93
  head = joblib.load("model_head.pkl")
94
 
95
  embeddings = model.encode(["Retinal OCT dataset for diabetic retinopathy"])
 
100
 
101
  - EyeACT Envision project
102
  - FAIR Data Innovations Hub (fairdataihub.org)
103
+ - sentence-transformers/all-mpnet-base-v2
104
 
105
  ## Contact
106
 
107
  EyeACT team: [eyeactstudy.org](https://eyeactstudy.org)
 
config.json CHANGED
@@ -1,43 +1,23 @@
1
  {
2
  "architectures": [
3
- "NewModel"
4
  ],
5
- "attention_probs_dropout_prob": 0.0,
6
- "auto_map": {
7
- "AutoConfig": "configuration.NewConfig",
8
- "AutoModel": "modeling.NewModel",
9
- "AutoModelForMaskedLM": "Alibaba-NLP/new-impl--modeling.NewForMaskedLM",
10
- "AutoModelForMultipleChoice": "Alibaba-NLP/new-impl--modeling.NewForMultipleChoice",
11
- "AutoModelForQuestionAnswering": "Alibaba-NLP/new-impl--modeling.NewForQuestionAnswering",
12
- "AutoModelForSequenceClassification": "Alibaba-NLP/new-impl--modeling.NewForSequenceClassification",
13
- "AutoModelForTokenClassification": "Alibaba-NLP/new-impl--modeling.NewForTokenClassification"
14
- },
15
- "classifier_dropout": null,
16
  "dtype": "float32",
 
17
  "hidden_act": "gelu",
18
  "hidden_dropout_prob": 0.1,
19
- "hidden_size": 1024,
20
  "initializer_range": 0.02,
21
- "intermediate_size": 4096,
22
- "layer_norm_eps": 1e-12,
23
- "layer_norm_type": "layer_norm",
24
- "logn_attention_clip1": false,
25
- "logn_attention_scale": false,
26
- "max_position_embeddings": 8192,
27
- "model_type": "new",
28
- "num_attention_heads": 16,
29
- "num_hidden_layers": 24,
30
- "pack_qkv": true,
31
- "pad_token_id": 0,
32
- "position_embedding_type": "rope",
33
- "rope_scaling": {
34
- "factor": 2.0,
35
- "type": "ntk"
36
- },
37
- "rope_theta": 160000,
38
  "transformers_version": "4.57.1",
39
- "type_vocab_size": 2,
40
- "unpad_inputs": false,
41
- "use_memory_efficient_attention": false,
42
- "vocab_size": 30528
43
  }
 
1
  {
2
  "architectures": [
3
+ "MPNetModel"
4
  ],
5
+ "attention_probs_dropout_prob": 0.1,
6
+ "bos_token_id": 0,
 
 
 
 
 
 
 
 
 
7
  "dtype": "float32",
8
+ "eos_token_id": 2,
9
  "hidden_act": "gelu",
10
  "hidden_dropout_prob": 0.1,
11
+ "hidden_size": 768,
12
  "initializer_range": 0.02,
13
+ "intermediate_size": 3072,
14
+ "layer_norm_eps": 1e-05,
15
+ "max_position_embeddings": 514,
16
+ "model_type": "mpnet",
17
+ "num_attention_heads": 12,
18
+ "num_hidden_layers": 12,
19
+ "pad_token_id": 1,
20
+ "relative_attention_num_buckets": 32,
 
 
 
 
 
 
 
 
 
21
  "transformers_version": "4.57.1",
22
+ "vocab_size": 30527
 
 
 
23
  }
model.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:8926bf7bdf17bf066a4365684d38d9fd0a0fcefff070d1cbb2b5147082fb42f8
3
- size 1736585680
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0b0538e5a8c2eb88301ca85f98f4e049d0ccb3e5269f9d63fb853449d5f60ad5
3
+ size 437967672
model_head.pkl CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:ead33c08eab190ebc8ab22952cc33fe8c100b3615f0306134cc41ee83a190c22
3
- size 33671
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4cd66021541f6dc6f6da7ff44f660b2c1abdc762837c30bfc7ae7652cc812e5c
3
+ size 25479
modules.json CHANGED
@@ -10,5 +10,11 @@
10
  "name": "1",
11
  "path": "1_Pooling",
12
  "type": "sentence_transformers.models.Pooling"
 
 
 
 
 
 
13
  }
14
  ]
 
10
  "name": "1",
11
  "path": "1_Pooling",
12
  "type": "sentence_transformers.models.Pooling"
13
+ },
14
+ {
15
+ "idx": 2,
16
+ "name": "2",
17
+ "path": "2_Normalize",
18
+ "type": "sentence_transformers.models.Normalize"
19
  }
20
  ]
sentence_bert_config.json CHANGED
@@ -1,4 +1,4 @@
1
  {
2
- "max_seq_length": 8192,
3
  "do_lower_case": false
4
  }
 
1
  {
2
+ "max_seq_length": 384,
3
  "do_lower_case": false
4
  }
special_tokens_map.json CHANGED
@@ -1,27 +1,41 @@
1
  {
 
 
 
 
 
 
 
2
  "cls_token": {
3
- "content": "[CLS]",
4
  "lstrip": false,
5
  "normalized": false,
6
  "rstrip": false,
7
  "single_word": false
8
  },
9
- "mask_token": {
10
- "content": "[MASK]",
11
  "lstrip": false,
12
  "normalized": false,
13
  "rstrip": false,
14
  "single_word": false
15
  },
 
 
 
 
 
 
 
16
  "pad_token": {
17
- "content": "[PAD]",
18
  "lstrip": false,
19
  "normalized": false,
20
  "rstrip": false,
21
  "single_word": false
22
  },
23
  "sep_token": {
24
- "content": "[SEP]",
25
  "lstrip": false,
26
  "normalized": false,
27
  "rstrip": false,
 
1
  {
2
+ "bos_token": {
3
+ "content": "<s>",
4
+ "lstrip": false,
5
+ "normalized": false,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
  "cls_token": {
10
+ "content": "<s>",
11
  "lstrip": false,
12
  "normalized": false,
13
  "rstrip": false,
14
  "single_word": false
15
  },
16
+ "eos_token": {
17
+ "content": "</s>",
18
  "lstrip": false,
19
  "normalized": false,
20
  "rstrip": false,
21
  "single_word": false
22
  },
23
+ "mask_token": {
24
+ "content": "<mask>",
25
+ "lstrip": true,
26
+ "normalized": false,
27
+ "rstrip": false,
28
+ "single_word": false
29
+ },
30
  "pad_token": {
31
+ "content": "<pad>",
32
  "lstrip": false,
33
  "normalized": false,
34
  "rstrip": false,
35
  "single_word": false
36
  },
37
  "sep_token": {
38
+ "content": "</s>",
39
  "lstrip": false,
40
  "normalized": false,
41
  "rstrip": false,
tokenizer.json CHANGED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json CHANGED
@@ -1,62 +1,72 @@
1
  {
2
  "added_tokens_decoder": {
3
  "0": {
4
- "content": "[PAD]",
5
  "lstrip": false,
6
  "normalized": false,
7
  "rstrip": false,
8
  "single_word": false,
9
  "special": true
10
  },
11
- "100": {
12
- "content": "[UNK]",
13
  "lstrip": false,
14
  "normalized": false,
15
  "rstrip": false,
16
  "single_word": false,
17
  "special": true
18
  },
19
- "101": {
20
- "content": "[CLS]",
21
  "lstrip": false,
22
  "normalized": false,
23
  "rstrip": false,
24
  "single_word": false,
25
  "special": true
26
  },
27
- "102": {
28
- "content": "[SEP]",
29
  "lstrip": false,
30
- "normalized": false,
31
  "rstrip": false,
32
  "single_word": false,
33
  "special": true
34
  },
35
- "103": {
36
- "content": "[MASK]",
37
  "lstrip": false,
38
  "normalized": false,
39
  "rstrip": false,
40
  "single_word": false,
41
  "special": true
 
 
 
 
 
 
 
 
42
  }
43
  },
44
- "clean_up_tokenization_spaces": true,
45
- "cls_token": "[CLS]",
 
46
  "do_lower_case": true,
 
47
  "extra_special_tokens": {},
48
- "mask_token": "[MASK]",
49
- "max_length": 8000,
50
- "model_max_length": 8192,
51
  "pad_to_multiple_of": null,
52
- "pad_token": "[PAD]",
53
  "pad_token_type_id": 0,
54
  "padding_side": "right",
55
- "sep_token": "[SEP]",
56
  "stride": 0,
57
  "strip_accents": null,
58
  "tokenize_chinese_chars": true,
59
- "tokenizer_class": "BertTokenizer",
60
  "truncation_side": "right",
61
  "truncation_strategy": "longest_first",
62
  "unk_token": "[UNK]"
 
1
  {
2
  "added_tokens_decoder": {
3
  "0": {
4
+ "content": "<s>",
5
  "lstrip": false,
6
  "normalized": false,
7
  "rstrip": false,
8
  "single_word": false,
9
  "special": true
10
  },
11
+ "1": {
12
+ "content": "<pad>",
13
  "lstrip": false,
14
  "normalized": false,
15
  "rstrip": false,
16
  "single_word": false,
17
  "special": true
18
  },
19
+ "2": {
20
+ "content": "</s>",
21
  "lstrip": false,
22
  "normalized": false,
23
  "rstrip": false,
24
  "single_word": false,
25
  "special": true
26
  },
27
+ "3": {
28
+ "content": "<unk>",
29
  "lstrip": false,
30
+ "normalized": true,
31
  "rstrip": false,
32
  "single_word": false,
33
  "special": true
34
  },
35
+ "104": {
36
+ "content": "[UNK]",
37
  "lstrip": false,
38
  "normalized": false,
39
  "rstrip": false,
40
  "single_word": false,
41
  "special": true
42
+ },
43
+ "30526": {
44
+ "content": "<mask>",
45
+ "lstrip": true,
46
+ "normalized": false,
47
+ "rstrip": false,
48
+ "single_word": false,
49
+ "special": true
50
  }
51
  },
52
+ "bos_token": "<s>",
53
+ "clean_up_tokenization_spaces": false,
54
+ "cls_token": "<s>",
55
  "do_lower_case": true,
56
+ "eos_token": "</s>",
57
  "extra_special_tokens": {},
58
+ "mask_token": "<mask>",
59
+ "max_length": 128,
60
+ "model_max_length": 384,
61
  "pad_to_multiple_of": null,
62
+ "pad_token": "<pad>",
63
  "pad_token_type_id": 0,
64
  "padding_side": "right",
65
+ "sep_token": "</s>",
66
  "stride": 0,
67
  "strip_accents": null,
68
  "tokenize_chinese_chars": true,
69
+ "tokenizer_class": "MPNetTokenizer",
70
  "truncation_side": "right",
71
  "truncation_strategy": "longest_first",
72
  "unk_token": "[UNK]"
vocab.txt CHANGED
@@ -1,3 +1,7 @@
 
 
 
 
1
  [PAD]
2
  [unused0]
3
  [unused1]
@@ -30520,3 +30524,4 @@ necessitated
30520
  ##:
30521
  ##?
30522
  ##~
 
 
1
+ <s>
2
+ <pad>
3
+ </s>
4
+ <unk>
5
  [PAD]
6
  [unused0]
7
  [unused1]
 
30524
  ##:
30525
  ##?
30526
  ##~
30527
+ <mask>