Hlex Helftd commited on
Upload trained artifacts for CheXVision-ResNet_best
Browse files- CheXVision-ResNet_best.pth +3 -0
- CheXVision-ResNet_history.json +218 -0
- README.md +50 -0
- training_config.json +102 -0
CheXVision-ResNet_best.pth
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b77d11ebf5766aa5de2cf708e75643002adf08f8b47109ff9a7f0c22c9afddaa
|
| 3 |
+
size 134352378
|
CheXVision-ResNet_history.json
ADDED
|
@@ -0,0 +1,218 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"train_combined_loss": [
|
| 3 |
+
1.8028105597394286,
|
| 4 |
+
1.6594285478736712,
|
| 5 |
+
1.6095932511506532,
|
| 6 |
+
1.5697966825291911,
|
| 7 |
+
1.5412424254916366,
|
| 8 |
+
1.5032177379887566,
|
| 9 |
+
1.4764412227692445,
|
| 10 |
+
1.4494492699975698,
|
| 11 |
+
1.4329791697117458,
|
| 12 |
+
1.4239830405779632,
|
| 13 |
+
1.393419378156979,
|
| 14 |
+
1.3809595914419235,
|
| 15 |
+
1.3721821074804714,
|
| 16 |
+
1.3491639165199336,
|
| 17 |
+
1.3301550439747327,
|
| 18 |
+
1.3298129981103177,
|
| 19 |
+
1.3220968897048204,
|
| 20 |
+
1.305642487721997,
|
| 21 |
+
1.2903609446291557,
|
| 22 |
+
1.2790042816198504,
|
| 23 |
+
1.2661940262216889,
|
| 24 |
+
1.2492031894064752,
|
| 25 |
+
1.2363540076015913,
|
| 26 |
+
1.222058405654079,
|
| 27 |
+
1.1951119540214148,
|
| 28 |
+
1.193141121966065,
|
| 29 |
+
1.173493552462312,
|
| 30 |
+
1.161446431938331,
|
| 31 |
+
1.1409827179726784,
|
| 32 |
+
1.1354267131514268,
|
| 33 |
+
1.1191549057543742,
|
| 34 |
+
1.101134967940921,
|
| 35 |
+
1.086944131490193,
|
| 36 |
+
1.0719895903869492
|
| 37 |
+
],
|
| 38 |
+
"val_multilabel_loss": [
|
| 39 |
+
1.380399280074817,
|
| 40 |
+
1.3632816949219846,
|
| 41 |
+
1.2692323502764773,
|
| 42 |
+
1.295367061869422,
|
| 43 |
+
1.2237563973932124,
|
| 44 |
+
1.2354203033358304,
|
| 45 |
+
1.2101998096748965,
|
| 46 |
+
1.2230405803047009,
|
| 47 |
+
1.2912428113284395,
|
| 48 |
+
1.1853153503208018,
|
| 49 |
+
1.2564876571631254,
|
| 50 |
+
1.1918568097388567,
|
| 51 |
+
1.1554152055351592,
|
| 52 |
+
1.1557411105552715,
|
| 53 |
+
1.1340461924894532,
|
| 54 |
+
1.2904444914033164,
|
| 55 |
+
1.2183967049775728,
|
| 56 |
+
1.3361681518492414,
|
| 57 |
+
1.3081900223867218,
|
| 58 |
+
1.2641262770143908,
|
| 59 |
+
1.2227575205155272,
|
| 60 |
+
1.3104938662319041,
|
| 61 |
+
1.2994564609296286,
|
| 62 |
+
1.2552621220586015,
|
| 63 |
+
1.3974817288455679,
|
| 64 |
+
1.4078792223512238,
|
| 65 |
+
1.5470995481556922,
|
| 66 |
+
1.6826615465332324,
|
| 67 |
+
1.6731281273289402,
|
| 68 |
+
1.7241769406888912,
|
| 69 |
+
1.815169675748295,
|
| 70 |
+
1.8399118531995744,
|
| 71 |
+
1.9671026995933767,
|
| 72 |
+
2.035841338670076
|
| 73 |
+
],
|
| 74 |
+
"auc_roc_macro": [
|
| 75 |
+
0.6046625111095786,
|
| 76 |
+
0.6561213467973186,
|
| 77 |
+
0.6813161981653256,
|
| 78 |
+
0.7027556323869566,
|
| 79 |
+
0.7224978279539095,
|
| 80 |
+
0.7343555590095864,
|
| 81 |
+
0.7436384168583265,
|
| 82 |
+
0.7549345219092586,
|
| 83 |
+
0.7591469094158342,
|
| 84 |
+
0.7615124400040545,
|
| 85 |
+
0.7618176344322659,
|
| 86 |
+
0.7742936313873724,
|
| 87 |
+
0.7764602244834701,
|
| 88 |
+
0.7771191574770734,
|
| 89 |
+
0.7787623906099066,
|
| 90 |
+
0.7770042763504428,
|
| 91 |
+
0.7852792258679061,
|
| 92 |
+
0.7819910484715589,
|
| 93 |
+
0.7840773831561441,
|
| 94 |
+
0.7879082979121297,
|
| 95 |
+
0.7901033962620295,
|
| 96 |
+
0.7908528614970541,
|
| 97 |
+
0.7928655079046033,
|
| 98 |
+
0.796671387734275,
|
| 99 |
+
0.789645163059305,
|
| 100 |
+
0.7905195777350826,
|
| 101 |
+
0.7904629781399033,
|
| 102 |
+
0.7892680000852913,
|
| 103 |
+
0.7903950977495257,
|
| 104 |
+
0.790345513432304,
|
| 105 |
+
0.7862247732788701,
|
| 106 |
+
0.7847271461840294,
|
| 107 |
+
0.7849398658926571,
|
| 108 |
+
0.7852439459285295
|
| 109 |
+
],
|
| 110 |
+
"binary_auc_roc": [
|
| 111 |
+
0.6317048790814317,
|
| 112 |
+
0.6687970777106798,
|
| 113 |
+
0.6778475914344482,
|
| 114 |
+
0.6997437208613247,
|
| 115 |
+
0.7095025785367216,
|
| 116 |
+
0.7220160293112016,
|
| 117 |
+
0.7286104949324677,
|
| 118 |
+
0.7288342355802431,
|
| 119 |
+
0.7339123301997315,
|
| 120 |
+
0.7357826910693581,
|
| 121 |
+
0.7370244432595285,
|
| 122 |
+
0.741706691195769,
|
| 123 |
+
0.7417575133263807,
|
| 124 |
+
0.743724783650134,
|
| 125 |
+
0.7434502208717468,
|
| 126 |
+
0.7431772270235222,
|
| 127 |
+
0.7472573139601838,
|
| 128 |
+
0.7423898482149721,
|
| 129 |
+
0.7486844240423756,
|
| 130 |
+
0.7486236560151999,
|
| 131 |
+
0.7491379849423048,
|
| 132 |
+
0.7514892509232594,
|
| 133 |
+
0.752473586500387,
|
| 134 |
+
0.7538169269185607,
|
| 135 |
+
0.7542700675693395,
|
| 136 |
+
0.7524202989080919,
|
| 137 |
+
0.7558643527636368,
|
| 138 |
+
0.7554111560796379,
|
| 139 |
+
0.7557845894748544,
|
| 140 |
+
0.7571077579337997,
|
| 141 |
+
0.7567228657450771,
|
| 142 |
+
0.7556190673427411,
|
| 143 |
+
0.7558345711071648,
|
| 144 |
+
0.7559177804389823
|
| 145 |
+
],
|
| 146 |
+
"binary_f1": [
|
| 147 |
+
0.295641187618446,
|
| 148 |
+
0.45902215969046783,
|
| 149 |
+
0.4941574936494496,
|
| 150 |
+
0.5436495430192247,
|
| 151 |
+
0.5700690713737528,
|
| 152 |
+
0.5353247189125693,
|
| 153 |
+
0.6157118547929665,
|
| 154 |
+
0.561547287329946,
|
| 155 |
+
0.532246879334258,
|
| 156 |
+
0.5891545553992812,
|
| 157 |
+
0.5991729208148262,
|
| 158 |
+
0.6030075187969924,
|
| 159 |
+
0.594847775175644,
|
| 160 |
+
0.603756157635468,
|
| 161 |
+
0.6077263704382349,
|
| 162 |
+
0.6114859799070326,
|
| 163 |
+
0.6062858027558445,
|
| 164 |
+
0.6019298514320723,
|
| 165 |
+
0.6206794682422452,
|
| 166 |
+
0.6164199192462988,
|
| 167 |
+
0.63709336713139,
|
| 168 |
+
0.6130790190735694,
|
| 169 |
+
0.6332859174964438,
|
| 170 |
+
0.6120941683335898,
|
| 171 |
+
0.6123138338707201,
|
| 172 |
+
0.6320686146242186,
|
| 173 |
+
0.6322073383808969,
|
| 174 |
+
0.6132264529058116,
|
| 175 |
+
0.6191055673866748,
|
| 176 |
+
0.6180481078596599,
|
| 177 |
+
0.6131857999077917,
|
| 178 |
+
0.6216502649507949,
|
| 179 |
+
0.6197523406825732,
|
| 180 |
+
0.6264308012486993
|
| 181 |
+
],
|
| 182 |
+
"learning_rate": [
|
| 183 |
+
0.0009990133642141358,
|
| 184 |
+
0.000996057350657239,
|
| 185 |
+
0.0009911436253643444,
|
| 186 |
+
0.0009842915805643156,
|
| 187 |
+
0.0009755282581475769,
|
| 188 |
+
0.0009648882429441258,
|
| 189 |
+
0.0009524135262330099,
|
| 190 |
+
0.0009381533400219318,
|
| 191 |
+
0.0009221639627510075,
|
| 192 |
+
0.0009045084971874736,
|
| 193 |
+
0.0008852566213878945,
|
| 194 |
+
0.0008644843137107056,
|
| 195 |
+
0.0008422735529643443,
|
| 196 |
+
0.0008187119948743448,
|
| 197 |
+
0.0007938926261462366,
|
| 198 |
+
0.0007679133974894982,
|
| 199 |
+
0.0007408768370508576,
|
| 200 |
+
0.0007128896457825362,
|
| 201 |
+
0.0006840622763423389,
|
| 202 |
+
0.0006545084971874735,
|
| 203 |
+
0.0006243449435824271,
|
| 204 |
+
0.0005936906572928622,
|
| 205 |
+
0.000562666616782152,
|
| 206 |
+
0.0005313952597646566,
|
| 207 |
+
0.0004999999999999998,
|
| 208 |
+
0.00046860474023534314,
|
| 209 |
+
0.00043733338321784774,
|
| 210 |
+
0.00040630934270713756,
|
| 211 |
+
0.00037565505641757246,
|
| 212 |
+
0.00034549150281252633,
|
| 213 |
+
0.00031593772365766105,
|
| 214 |
+
0.00028711035421746355,
|
| 215 |
+
0.0002591231629491422,
|
| 216 |
+
0.00023208660251050145
|
| 217 |
+
]
|
| 218 |
+
}
|
README.md
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
library_name: pytorch
|
| 6 |
+
pipeline_tag: image-classification
|
| 7 |
+
tags:
|
| 8 |
+
- chexvision
|
| 9 |
+
- medical-imaging
|
| 10 |
+
- chest-xray
|
| 11 |
+
- radiology
|
| 12 |
+
- pytorch
|
| 13 |
+
datasets:
|
| 14 |
+
- HlexNC/chest-xray-14
|
| 15 |
+
---
|
| 16 |
+
|
| 17 |
+
# CheXVision-ResNet
|
| 18 |
+
|
| 19 |
+
## Model Details
|
| 20 |
+
|
| 21 |
+
- Repository: `HlexNC/chexvision-scratch`
|
| 22 |
+
- Training platform: Kaggle GPU kernel
|
| 23 |
+
- Dataset: [HlexNC/chest-xray-14](https://huggingface.co/datasets/HlexNC/chest-xray-14)
|
| 24 |
+
- Dataset revision: `c4e9a86b38de3b1604afa6e9f514d156eb9d20bf`
|
| 25 |
+
- Architecture: Custom residual CNN trained from scratch with shared features and dual classification heads.
|
| 26 |
+
- Training epochs configured: `50`
|
| 27 |
+
- Batch size configured: `32`
|
| 28 |
+
|
| 29 |
+
## Training Metrics
|
| 30 |
+
|
| 31 |
+
- Best validation macro AUC-ROC: `0.7967`
|
| 32 |
+
- Best validation binary AUC-ROC: `0.7571`
|
| 33 |
+
- Best validation binary F1: `0.6371`
|
| 34 |
+
- Saved checkpoint epoch: `24`
|
| 35 |
+
|
| 36 |
+
## Intended Use
|
| 37 |
+
|
| 38 |
+
This model is intended for research and educational work on automated chest X-ray pathology detection.
|
| 39 |
+
It predicts both 14 pathology labels and a binary normal-vs-abnormal signal for the CheXVision project.
|
| 40 |
+
|
| 41 |
+
## Limitations
|
| 42 |
+
|
| 43 |
+
- This repository does not provide clinical-grade validation.
|
| 44 |
+
- Predictions must not be used as a substitute for professional medical judgement.
|
| 45 |
+
- Performance can degrade on populations, devices, or preprocessing pipelines that differ from the training data.
|
| 46 |
+
|
| 47 |
+
## Training Procedure
|
| 48 |
+
|
| 49 |
+
Training is orchestrated from the CheXVision repository and runs on Kaggle GPU kernels.
|
| 50 |
+
The training kernels download a pinned snapshot of the public Hugging Face dataset, save the best checkpoint, and upload the checkpoint plus metadata back to this public model repository.
|
training_config.json
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"seed": 42,
|
| 3 |
+
"data": {
|
| 4 |
+
"dataset_name": "HlexNC/chest-xray-14",
|
| 5 |
+
"image_size": 224,
|
| 6 |
+
"num_workers": 4,
|
| 7 |
+
"pin_memory": true,
|
| 8 |
+
"train_split": 0.7,
|
| 9 |
+
"val_split": 0.1,
|
| 10 |
+
"test_split": 0.2,
|
| 11 |
+
"augmentation": {
|
| 12 |
+
"horizontal_flip": true,
|
| 13 |
+
"rotation_degrees": 10,
|
| 14 |
+
"color_jitter": {
|
| 15 |
+
"brightness": 0.2,
|
| 16 |
+
"contrast": 0.2
|
| 17 |
+
}
|
| 18 |
+
},
|
| 19 |
+
"labels": [
|
| 20 |
+
"Atelectasis",
|
| 21 |
+
"Cardiomegaly",
|
| 22 |
+
"Effusion",
|
| 23 |
+
"Infiltration",
|
| 24 |
+
"Mass",
|
| 25 |
+
"Nodule",
|
| 26 |
+
"Pneumonia",
|
| 27 |
+
"Pneumothorax",
|
| 28 |
+
"Consolidation",
|
| 29 |
+
"Edema",
|
| 30 |
+
"Emphysema",
|
| 31 |
+
"Fibrosis",
|
| 32 |
+
"Pleural_Thickening",
|
| 33 |
+
"Hernia"
|
| 34 |
+
],
|
| 35 |
+
"data_dir": "/kaggle/working/data",
|
| 36 |
+
"hf_dataset_repo": "HlexNC/chest-xray-14",
|
| 37 |
+
"hf_dataset_revision": "c4e9a86b38de3b1604afa6e9f514d156eb9d20bf"
|
| 38 |
+
},
|
| 39 |
+
"training": {
|
| 40 |
+
"epochs": 50,
|
| 41 |
+
"batch_size": 32,
|
| 42 |
+
"learning_rate": 0.001,
|
| 43 |
+
"weight_decay": 0.0001,
|
| 44 |
+
"optimizer": "adamw",
|
| 45 |
+
"scheduler": "cosine",
|
| 46 |
+
"warmup_epochs": 5,
|
| 47 |
+
"early_stopping_patience": 10,
|
| 48 |
+
"gradient_clip_norm": 1.0,
|
| 49 |
+
"multilabel_weight": 1.0,
|
| 50 |
+
"binary_weight": 0.5
|
| 51 |
+
},
|
| 52 |
+
"evaluation": {
|
| 53 |
+
"primary_metric": "auc_roc_macro",
|
| 54 |
+
"threshold": 0.5
|
| 55 |
+
},
|
| 56 |
+
"logging": {
|
| 57 |
+
"log_dir": "logs/",
|
| 58 |
+
"checkpoint_dir": "/kaggle/working/checkpoints",
|
| 59 |
+
"save_every_n_epochs": 5,
|
| 60 |
+
"log_every_n_steps": 100
|
| 61 |
+
},
|
| 62 |
+
"huggingface": {
|
| 63 |
+
"dataset_repo": "HlexNC/chest-xray-14",
|
| 64 |
+
"scratch_model_repo": "HlexNC/chexvision-scratch",
|
| 65 |
+
"transfer_model_repo": "HlexNC/chexvision-densenet",
|
| 66 |
+
"space_repo": "HlexNC/chexvision-demo"
|
| 67 |
+
},
|
| 68 |
+
"model": {
|
| 69 |
+
"type": "scratch",
|
| 70 |
+
"name": "CheXVision-ResNet",
|
| 71 |
+
"architecture": {
|
| 72 |
+
"input_channels": 3,
|
| 73 |
+
"initial_filters": 64,
|
| 74 |
+
"block_config": [
|
| 75 |
+
2,
|
| 76 |
+
2,
|
| 77 |
+
2,
|
| 78 |
+
2
|
| 79 |
+
],
|
| 80 |
+
"filter_sizes": [
|
| 81 |
+
64,
|
| 82 |
+
128,
|
| 83 |
+
256,
|
| 84 |
+
512
|
| 85 |
+
],
|
| 86 |
+
"dropout": 0.5,
|
| 87 |
+
"activation": "relu",
|
| 88 |
+
"use_batch_norm": true,
|
| 89 |
+
"global_avg_pool": true
|
| 90 |
+
},
|
| 91 |
+
"heads": {
|
| 92 |
+
"multilabel": {
|
| 93 |
+
"num_classes": 14,
|
| 94 |
+
"activation": "sigmoid"
|
| 95 |
+
},
|
| 96 |
+
"binary": {
|
| 97 |
+
"num_classes": 1,
|
| 98 |
+
"activation": "sigmoid"
|
| 99 |
+
}
|
| 100 |
+
}
|
| 101 |
+
}
|
| 102 |
+
}
|