Emirinth commited on
Commit
cdce1fb
·
verified ·
1 Parent(s): 4a698f4

Publish the CTFast bleed detector

Browse files
README.md CHANGED
@@ -6,22 +6,24 @@ library_name: pytorch
6
 
7
  # CTFast bleed detector
8
 
9
- Slice classifiers that flag suspected brain bleeds on non-contrast head CT.
10
- Each folder holds one release: `model.pt` (PyTorch weights) and `settings.json`.
11
- A scan is flagged when its score reaches the release's operating threshold.
12
- From v4, a lower `review_threshold` in `settings.json` marks a possible bleed,
13
- which moves the scan up the reading queue without paging anyone.
 
14
 
15
- Student project for NTU BC3415. Not a medical device and not for clinical use.
 
 
16
 
17
- | Release | Model | Threshold | CQ500 AUC | CQ500 recall | CQ500 specificity |
18
  |---|---|---|---|---|---|
19
- | v1 | v1 · ResNet-18, Kaggle (43 patients) | 0.113 | 0.70 | 96% | 13% |
20
- | v2 | v2 · ResNet-18, RSNA (slice labels) | 0.360 | 0.95 | 90% | 87% |
21
- | v3 | v3 · EfficientNet-B0, RSNA, neighbouring slices | 0.309 | 0.96 | 91% | 88% |
22
- | v4 | v4 · EfficientNet-B0, all RSNA scans, two alert tiers | 0.329 | 0.97 | 91% | 91% |
 
 
23
 
24
- Training data: Brain CT Hemorrhage (Helwan et al., 2018, CC BY 3.0) for v1,
25
- and the RSNA Intracranial Hemorrhage Detection data (Flanders et al., 2020)
26
- for later releases.
27
- External test: CQ500 (Chilamkurthy et al., 2018, CC BY-NC-SA 4.0).
 
6
 
7
  # CTFast bleed detector
8
 
9
+ Flags suspected brain bleeds on non-contrast head CT, slice by slice.
10
+ EfficientNet-B0 (timm `efficientnet_b0.ra_in1k`) fine-tuned on the RSNA
11
+ Intracranial Hemorrhage Detection data. Each slice is shown in three CT windows
12
+ together with the slices above and below it, nine channels at 256 x 256 pixels.
13
+ Outputs: any bleed and five bleed types. A scan's score is the mean of its most
14
+ suspicious tenth of slices, and at least three.
15
 
16
+ Files: `model.pt` (PyTorch weights) and `settings.json` (thresholds).
17
+ Alert threshold 0.329 catches 95% of validation bleeds.
18
+ Possible-bleed threshold 0.052 catches 99%.
19
 
20
+ | Test set | Scans | AUC | Recall | Specificity | Recall, alert or possible |
21
  |---|---|---|---|---|---|
22
+ | cq500 | 471 | 0.969 | 91.3% | 90.9% | 99.0% |
23
+ | rsna_test | 2132 | 0.982 | 94.5% | 94.2% | 98.1% |
24
+ | kaggle | 43 | 0.934 | 100.0% | 38.5% | 100.0% |
25
+
26
+ Test sets: CQ500 (Chilamkurthy et al., 2018, CC BY-NC-SA 4.0), RSNA patients kept
27
+ out of training, and the Kaggle Brain CT Hemorrhage JPEGs (Helwan et al., 2018).
28
 
29
+ Student project for NTU BC3415. Not a medical device and not for clinical use.
 
 
 
v4/model.pt → model.pt RENAMED
File without changes
v4/settings.json → settings.json RENAMED
@@ -1,8 +1,6 @@
1
  {
2
- "version": "v4",
3
- "title": "v4 \u00b7 EfficientNet-B0, all RSNA scans, two alert tiers",
4
- "architecture": "efficientnet_b0",
5
- "windows": [
6
  "brain",
7
  "subdural",
8
  "stored_range"
@@ -51,12 +49,6 @@
51
  ],
52
  "average_precision": 0.986
53
  },
54
- "trained_at": "2026-11-08 22:59",
55
- "scan_scorer": "top_slice_average",
56
- "scorer_comparison": {
57
- "top_slice_average": 0.9468,
58
- "scan_reader": 0.9218
59
- },
60
  "review_threshold": 0.052187759429216385,
61
  "review_sensitivity": 0.99,
62
  "review_metrics": {
@@ -89,5 +81,6 @@
89
  0.9931
90
  ],
91
  "average_precision": 0.986
92
- }
 
93
  }
 
1
  {
2
+ "architecture": "efficientnet_b0.ra_in1k",
3
+ "input_windows": [
 
 
4
  "brain",
5
  "subdural",
6
  "stored_range"
 
49
  ],
50
  "average_precision": 0.986
51
  },
 
 
 
 
 
 
52
  "review_threshold": 0.052187759429216385,
53
  "review_sensitivity": 0.99,
54
  "review_metrics": {
 
81
  0.9931
82
  ],
83
  "average_precision": 0.986
84
+ },
85
+ "trained_at": "2026-11-08 22:59"
86
  }
v1/model.pt DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:f58dce617f09d0952528fd6d57871d1ac3a173450f53356e7200a2d9add931d3
3
- size 44781635
 
 
 
 
v1/settings.json DELETED
@@ -1,50 +0,0 @@
1
- {
2
- "version": "v1",
3
- "title": "v1 \u00b7 ResNet-18, Kaggle (43 patients)",
4
- "architecture": "resnet18",
5
- "windows": [
6
- "brain",
7
- "brain",
8
- "brain"
9
- ],
10
- "context_slices": 0,
11
- "image_size": 224,
12
- "outputs": [
13
- "any"
14
- ],
15
- "threshold": 0.11346063017845154,
16
- "threshold_source": "Kaggle out-of-fold scores, 3 x 5-fold by patient",
17
- "target_sensitivity": 0.95,
18
- "validation_metrics": {
19
- "threshold": 0.11346063017845154,
20
- "scans": 129,
21
- "bleeds": 51,
22
- "tp": 49,
23
- "fn": 2,
24
- "fp": 67,
25
- "tn": 11,
26
- "recall": 0.9608,
27
- "recall_ci": [
28
- 0.8678,
29
- 0.9892
30
- ],
31
- "specificity": 0.141,
32
- "specificity_ci": [
33
- 0.0806,
34
- 0.2351
35
- ],
36
- "precision": 0.4224,
37
- "npv": 0.8462,
38
- "accuracy": 0.4651,
39
- "balanced_accuracy": 0.5509,
40
- "f1": 0.5868,
41
- "mcc": 0.1654,
42
- "auc": 0.8348,
43
- "auc_ci": [
44
- 0.7477,
45
- 0.9167
46
- ],
47
- "average_precision": 0.8482
48
- },
49
- "trained_at": "2026-11-05 01:35"
50
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
v2/model.pt DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:f09bc63eeb19b6a656363a366b7c9bdbff3a02b10d2f60967e86baa5b1b1f96a
3
- size 44791875
 
 
 
 
v2/settings.json DELETED
@@ -1,55 +0,0 @@
1
- {
2
- "version": "v2",
3
- "title": "v2 \u00b7 ResNet-18, RSNA (slice labels)",
4
- "architecture": "resnet18",
5
- "windows": [
6
- "brain",
7
- "subdural",
8
- "stored_range"
9
- ],
10
- "context_slices": 0,
11
- "image_size": 256,
12
- "outputs": [
13
- "any",
14
- "epidural",
15
- "intraparenchymal",
16
- "intraventricular",
17
- "subarachnoid",
18
- "subdural"
19
- ],
20
- "threshold": 0.35978612303733826,
21
- "threshold_source": "RSNA validation patients",
22
- "target_sensitivity": 0.95,
23
- "validation_metrics": {
24
- "threshold": 0.35978612303733826,
25
- "scans": 1065,
26
- "bleeds": 426,
27
- "tp": 405,
28
- "fn": 21,
29
- "fp": 33,
30
- "tn": 606,
31
- "recall": 0.9507,
32
- "recall_ci": [
33
- 0.9258,
34
- 0.9675
35
- ],
36
- "specificity": 0.9484,
37
- "specificity_ci": [
38
- 0.9284,
39
- 0.963
40
- ],
41
- "precision": 0.9247,
42
- "npv": 0.9665,
43
- "accuracy": 0.9493,
44
- "balanced_accuracy": 0.9495,
45
- "f1": 0.9375,
46
- "mcc": 0.8951,
47
- "auc": 0.9865,
48
- "auc_ci": [
49
- 0.9791,
50
- 0.9924
51
- ],
52
- "average_precision": 0.9852
53
- },
54
- "trained_at": "2026-11-05 04:05"
55
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
v3/model.pt DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:2dc536f03f1733201a06df9df1641eb202fc2e5c433960391ff408a87750f1d9
3
- size 16345675
 
 
 
 
v3/settings.json DELETED
@@ -1,55 +0,0 @@
1
- {
2
- "version": "v3",
3
- "title": "v3 \u00b7 EfficientNet-B0, RSNA, neighbouring slices",
4
- "architecture": "efficientnet_b0",
5
- "windows": [
6
- "brain",
7
- "subdural",
8
- "stored_range"
9
- ],
10
- "context_slices": 1,
11
- "image_size": 256,
12
- "outputs": [
13
- "any",
14
- "epidural",
15
- "intraparenchymal",
16
- "intraventricular",
17
- "subarachnoid",
18
- "subdural"
19
- ],
20
- "threshold": 0.30898338556289673,
21
- "threshold_source": "RSNA validation patients",
22
- "target_sensitivity": 0.95,
23
- "validation_metrics": {
24
- "threshold": 0.30898338556289673,
25
- "scans": 1065,
26
- "bleeds": 426,
27
- "tp": 405,
28
- "fn": 21,
29
- "fp": 40,
30
- "tn": 599,
31
- "recall": 0.9507,
32
- "recall_ci": [
33
- 0.9258,
34
- 0.9675
35
- ],
36
- "specificity": 0.9374,
37
- "specificity_ci": [
38
- 0.9159,
39
- 0.9537
40
- ],
41
- "precision": 0.9101,
42
- "npv": 0.9661,
43
- "accuracy": 0.9427,
44
- "balanced_accuracy": 0.9441,
45
- "f1": 0.93,
46
- "mcc": 0.8822,
47
- "auc": 0.9858,
48
- "auc_ci": [
49
- 0.9787,
50
- 0.9917
51
- ],
52
- "average_precision": 0.9842
53
- },
54
- "trained_at": "2026-11-05 06:01"
55
- }