yusufards commited on
Commit
ee0d774
·
verified ·
1 Parent(s): c9a635f

Upload folder using huggingface_hub

Browse files
Files changed (3) hide show
  1. README.md +40 -0
  2. config.json +28 -0
  3. pytorch_model.pth +3 -0
README.md ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - image-classification
4
+ - pytorch
5
+ - resnet50
6
+ - medical-imaging
7
+ - brain-tumor
8
+ license: mit
9
+ ---
10
+
11
+ # 🧠 Brain Tumor Classification - ResNet50
12
+
13
+ Model ResNet50 yang di-fine-tune untuk mendeteksi **tumor otak** dari gambar MRI.
14
+
15
+ ## Performa
16
+ - **Validation Accuracy**: 0.9933 (99.33%)
17
+
18
+ ## Kelas
19
+ - `no` → Tidak ada tumor
20
+ - `yes` → Ada tumor
21
+
22
+ ## Cara Penggunaan
23
+ ```python
24
+ import torch, json
25
+ from torchvision import models, transforms
26
+ import torch.nn as nn
27
+ from PIL import Image
28
+
29
+ with open("config.json") as f:
30
+ cfg = json.load(f)
31
+
32
+ model = models.resnet50(weights=None)
33
+ model.fc = nn.Sequential(
34
+ nn.Dropout(0.5), nn.Linear(model.fc.in_features, 256),
35
+ nn.ReLU(), nn.Dropout(0.3), nn.Linear(256, cfg['num_classes'])
36
+ )
37
+ ckpt = torch.load("pytorch_model.pth", map_location="cpu")
38
+ model.load_state_dict(ckpt['model_state_dict'])
39
+ model.eval()
40
+ ```
config.json ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "model_type": "resnet50",
3
+ "num_classes": 2,
4
+ "class_names": [
5
+ "no",
6
+ "yes"
7
+ ],
8
+ "task": "image-classification",
9
+ "dataset": "Brain Tumor Detection (yes/no)",
10
+ "input_size": [
11
+ 3,
12
+ 224,
13
+ 224
14
+ ],
15
+ "normalization": {
16
+ "mean": [
17
+ 0.485,
18
+ 0.456,
19
+ 0.406
20
+ ],
21
+ "std": [
22
+ 0.229,
23
+ 0.224,
24
+ 0.225
25
+ ]
26
+ },
27
+ "test_accuracy": 0.9933333333333333
28
+ }
pytorch_model.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:33f435324d8f236dc84f73aa5e3f592725c991a04d5fbbb85856931401823a3b
3
+ size 220397069