File size: 5,983 Bytes
ed863e8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
{
  "model_name": "PRIMER",
  "full_name": "Pretrained RadImageNet for Mammography Embedding Representations",
  "version": "1.0.0",
  "release_date": "2024-10-17",

  "model_details": {
    "organization": "Lab-Rasool",
    "architecture": "ResNet-50",
    "base_model": "RadImageNet ResNet-50",
    "training_method": "SimCLR Contrastive Learning",
    "model_type": "Feature Extraction / Embedding Model",
    "modality": "Medical Imaging - Mammography",
    "parameters": "23.5M",
    "model_size_mb": 283,
    "license": "Apache-2.0"
  },

  "intended_use": {
    "primary_uses": [
      "Feature extraction for mammography images",
      "Similarity search and retrieval",
      "Clustering and grouping mammograms",
      "Transfer learning backbone for downstream tasks",
      "Content-based image retrieval systems",
      "Quality control and anomaly detection"
    ],
    "out_of_scope": [
      "Direct clinical diagnosis",
      "Standalone diagnostic tool",
      "Non-mammography medical images",
      "Real-time processing without optimization"
    ]
  },

  "training_data": {
    "dataset": "CMMD (Chinese Mammography Mass Database)",
    "dataset_url": "https://doi.org/10.7937/tcia.eqde-3b16",
    "num_training_samples": 13000,
    "data_splits": {
      "train": 0.7,
      "validation": 0.15,
      "test": 0.15
    },
    "image_format": "DICOM",
    "views": ["CC (craniocaudal)", "MLO (mediolateral oblique)"],
    "population": "Chinese population"
  },

  "training_procedure": {
    "method": "Self-supervised contrastive learning (SimCLR)",
    "loss_function": "NT-Xent (Normalized Temperature-scaled Cross Entropy)",
    "epochs": 50,
    "batch_size": 128,
    "optimizer": "AdamW",
    "learning_rate": 0.0001,
    "scheduler": "Cosine annealing with warmup",
    "temperature": 0.07,
    "mixed_precision": true,
    "hardware": "NVIDIA RTX 3090 (24GB VRAM)"
  },

  "performance_metrics": {
    "embedding_quality": {
      "silhouette_score": {
        "radimagenet_baseline": 0.127,
        "primer_finetuned": 0.289,
        "improvement_percent": 127
      },
      "davies_bouldin_score": {
        "radimagenet_baseline": 2.847,
        "primer_finetuned": 1.653,
        "improvement_percent": -42,
        "note": "Lower is better"
      },
      "calinski_harabasz_score": {
        "radimagenet_baseline": 1834,
        "primer_finetuned": 3621,
        "improvement_percent": 97
      },
      "embedding_variance": {
        "radimagenet_baseline": 0.012,
        "primer_finetuned": 0.024,
        "improvement_percent": 100
      }
    }
  },

  "input_output": {
    "input": {
      "format": "DICOM or preprocessed image tensor",
      "shape": [3, 224, 224],
      "dtype": "float32",
      "color_space": "RGB",
      "normalization": "ImageNet (mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])"
    },
    "output": {
      "format": "Embedding vector",
      "shape": [2048],
      "dtype": "float32",
      "normalization": "L2 normalization recommended"
    }
  },

  "preprocessing_requirements": {
    "critical_steps": [
      "Photometric interpretation correction (MONOCHROME1 inversion)",
      "Percentile-based intensity clipping (2nd-98th percentile)",
      "Min-max normalization to [0, 255]",
      "CLAHE enhancement (clipLimit=2.0, tileGridSize=8x8)",
      "Grayscale to RGB conversion",
      "Resize to 224x224",
      "ImageNet normalization"
    ],
    "dependencies": [
      "pydicom>=2.4.4",
      "opencv-python>=4.8.1.78",
      "numpy>=1.26.0"
    ]
  },

  "limitations": {
    "domain_specificity": "Trained on CMMD dataset (Chinese population); performance may vary on other populations",
    "dicom_dependency": "Requires proper DICOM preprocessing for optimal results",
    "resolution_loss": "High-resolution details may be lost at 224x224 input size",
    "self_supervised": "No direct classification output; requires downstream task integration",
    "photometric_interpretation": "Critical to handle MONOCHROME1/MONOCHROME2 correctly"
  },

  "ethical_considerations": {
    "bias": "Model trained on Chinese population data; may not generalize equally to all demographics",
    "clinical_use": "Not FDA approved; requires clinical validation before medical use",
    "privacy": "DICOM files may contain PHI; ensure proper de-identification",
    "interpretability": "Embeddings are learned representations; clinical interpretation required"
  },

  "citations": {
    "primer": {
      "title": "PRIMER: Pretrained RadImageNet for Mammography Embedding Representations",
      "authors": "Lab-Rasool",
      "year": 2024,
      "url": "https://huggingface.co/Lab-Rasool/PRIMER"
    },
    "radimagenet": {
      "title": "RadImageNet: An Open Radiologic Deep Learning Research Dataset for Effective Transfer Learning",
      "authors": "Mei et al.",
      "journal": "Radiology: Artificial Intelligence",
      "year": 2022,
      "doi": "10.1148/ryai.210315"
    },
    "simclr": {
      "title": "A Simple Framework for Contrastive Learning of Visual Representations",
      "authors": "Chen et al.",
      "conference": "ICML",
      "year": 2020,
      "arxiv": "2002.05709"
    },
    "cmmd": {
      "title": "Chinese Mammography Database (CMMD)",
      "source": "The Cancer Imaging Archive",
      "doi": "10.7937/tcia.eqde-3b16"
    }
  },

  "contact": {
    "organization": "Lab-Rasool",
    "huggingface": "https://huggingface.co/Lab-Rasool",
    "model_repository": "https://huggingface.co/Lab-Rasool/PRIMER",
    "issues": "https://huggingface.co/Lab-Rasool/PRIMER/discussions"
  },

  "technical_specifications": {
    "framework": "PyTorch 2.1+",
    "required_libraries": [
      "torch>=2.1.0",
      "torchvision>=0.16.0",
      "timm>=0.9.12",
      "pydicom>=2.4.4",
      "opencv-python>=4.8.1.78",
      "albumentations>=1.3.1"
    ],
    "gpu_requirements": "12GB+ VRAM recommended for inference",
    "inference_speed": "~50ms per image on RTX 3090"
  }
}