File size: 1,898 Bytes
3c38093
f6ab35f
 
 
 
3c38093
f6ab35f
2dbe7eb
3c38093
 
f6ab35f
 
 
 
 
 
 
 
3c38093
 
f6ab35f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
title: Brain MRI Ensemble Classifier
emoji: 🧠
colorFrom: indigo
colorTo: blue
sdk: gradio
sdk_version: 5.49.1
python_version: "3.10"
app_file: app.py
pinned: false
short_description: Weighted-soft EfficientNet/MobileNet MRI ensemble demo
suggested_hardware: cpu-upgrade
tags:
  - medical-imaging
  - mri
  - image-classification
  - gradio
  - pytorch
---

# Brain MRI Ensemble Classifier

This Hugging Face Space deploys the selected ensemble from the MRI backbone/ensemble research notebooks.

## Selected deployment ensemble

**Pool:** `lightweight_effnet_mobilenet`  
**Fusion:** `optimized_val_ce_weighted_soft`  
**Classes:** `glioma`, `meningioma`, `notumor`, `pituitary`

Only non-zero-weight members are deployed:

| Member | Weight | Checkpoint required in `models/` |
|---|---:|---|
| EfficientNet-B0 seed 123 | `0.49513684` | `best_efficientnet_b0_seed123.pt` |
| EfficientNet-B0 seed 2026 | `0.35077890` | `best_efficientnet_b0_seed2026.pt` |
| MobileNetV3-Small seed 42 | `0.15408426` | `best_mobilenet_v3_small_seed42.pt` |

Zero-weight members from the optimization result are intentionally omitted because they do not change weighted-soft inference.

## Reported research metrics

| Metric | Value |
|---|---:|
| Validation Macro-F1 | `0.994487` |
| Test accuracy | `0.990637` |
| Test Macro-F1 | `0.990633` |
| Test balanced accuracy | `0.990640` |
| Test macro AUC OVR | `0.999339` |
| Test ECE | `0.008194` |

## Checkpoint placement

Put all required checkpoint files in:

```text
models/
β”œβ”€β”€ best_efficientnet_b0_seed123.pt
β”œβ”€β”€ best_efficientnet_b0_seed2026.pt
└── best_mobilenet_v3_small_seed42.pt
```

The app intentionally looks in `models/` only, so deployment remains simple and reproducible.

## Medical disclaimer

This Space is a research prototype and is not a medical device. It must not be used for diagnosis, treatment, or patient triage.