nailarais1 commited on
Commit
df8e564
·
verified ·
1 Parent(s): c4e8330

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +70 -3
README.md CHANGED
@@ -1,3 +1,70 @@
1
- ---
2
- license: mit
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ language:
4
+ - en
5
+ base_model:
6
+ - google/efficientnet-b0
7
+ ---
8
+
9
+ EfficientNet-B0 Model for Image Classification
10
+
11
+ This repository contains an EfficientNet-B0 model trained on a custom dataset for image classification tasks.
12
+
13
+ Model Details
14
+
15
+ - Architecture: EfficientNet-B0
16
+ - Input Size: 224x224 RGB images
17
+ - Number of Classes: 10
18
+ - Dataset: Custom dataset with 10 categories
19
+ - Optimizer: AdamW
20
+ - Loss Function: CrossEntropyLoss
21
+ - Validation Accuracy: 85.3%
22
+ - Device Used for Training: CUDA (GPU)
23
+
24
+ Usage
25
+
26
+ Load the Model
27
+ To load the model, use the following code:
28
+
29
+ ```
30
+ import torch
31
+
32
+ Load model and metadata
33
+ model = torch.load("efficientnet-results-and-model.pth", map_location="cpu")
34
+
35
+ Access class-to-index mapping
36
+
37
+ class_to_idx = model['class_to_idx']
38
+
39
+ Load the state dictionary
40
+ state_dict = model['model_state_dict']
41
+
42
+ Reconstruct EfficientNet-B0
43
+ from torchvision.models import efficientnet_b0
44
+ model = efficientnet_b0(weights=None)
45
+ model.classifier[1] = torch.nn.Linear(model.classifier[1].in_features, len(class_to_idx))
46
+ model.load_state_dict(state_dict)
47
+ model.eval()
48
+
49
+ print("Model successfully loaded!")
50
+
51
+ Training Details
52
+ Learning Rate: 0.001
53
+ Batch Size: 32
54
+ Epochs: 3
55
+ Augmentations:
56
+ Random Resized Crop
57
+ Horizontal Flip
58
+ Color Jitter
59
+ Normalization (mean: [0.485, 0.456, 0.406], std: [0.229, 0.224, 0.225])
60
+
61
+ Files in this Repository
62
+ best_model.pth: Trained model weights
63
+ efficientnet.json: Model configuration file
64
+ README.md: Documentation for this model
65
+ efficientnet.txt: Training Results
66
+
67
+ Acknowledgments
68
+ Framework: PyTorch
69
+ Pretrained Weights: TorchVision
70
+ Training: Mixed precision using torch.cuda.amp for efficient training on GPU.