File size: 2,001 Bytes
380cd86
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c05a9bc
380cd86
 
d221b94
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
380cd86
a6c4b6a
 
d221b94
 
 
 
7b91fba
 
 
d221b94
 
 
 
7b91fba
 
a6c4b6a
7b91fba
 
 
 
 
 
 
 
 
a6c4b6a
380cd86
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
69
70
71
72
73
74
---
language: en
tags:
  - image-classification
  - computer-vision
  - pytorch
  - intel-image-classification
  - resnet18
license: mit
datasets:
  - puneet6060/intel-image-classification
model-index:
  - name: ResNet18 Intel Image Classifier
    results: []
---

# 🏞️ ResNet18 Intel Image Classifier

📌 A ResNet18-based image classification model trained on the [Intel Image Classification dataset](https://www.kaggle.com/datasets/puneet6060/intel-image-classification), capable of recognizing six types of natural scenes. The model was fine-tuned using PyTorch, optimized for reproducibility and deployment in educational and practical scenarios.

## 🏷️ Classes

- Buildings  
- Forest  
- Glacier  
- Mountain  
- Sea  
- Street

## 🧰 Training Procedure

1. Loaded a pretrained ResNet18 model from `torchvision.models`.
2. Replaced the final classification layer with a 6-unit fully connected layer.
3. Resized all input images to 224x224 and applied ImageNet normalization.
4. Used `ImageFolder` and `random_split()` to divide the dataset:
   - 70% Training
   - 15% Validation
   - 15% Testing
5. Training setup:
   - Optimizer: Adam
   - Loss Function: CrossEntropyLoss
   - Batch size: 32
   - Learning rate: 0.001
   - Epochs: 5
6. Saved the final model as `pytorch_model.bin`.

## 📊 Performance

| Metric               | Value     |
|----------------------|-----------|
| Final Train Accuracy | 90.08%    |
| Final Val Accuracy   | 88.74%    |

## ⚙️ Framework & Environment

- Python: 3.10.12  
- PyTorch: 2.0.1+cu118  
- Torchvision: 0.15.2+cu118  
- Platform: Google Colab (GPU enabled, CUDA support)

## 🧪 Hyperparameters

| Parameter       | Value        |
|-----------------|--------------|
| Epochs          | 5            |
| Batch Size      | 32           |
| Optimizer       | Adam         |
| Learning Rate   | 0.001        |
| Loss Function   | CrossEntropy |
| Image Size      | 224x224      |
| Data Split      | 70% Train / 15% Val / 15% Test |

---