File size: 1,572 Bytes
aef0a7e
5ae9510
 
 
 
 
 
 
 
aef0a7e
 
5ae9510
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
language: en
tags:
  - crowd-counting
  - density-estimation
  - computer-vision
  - pytorch
  - csrnet
  - indian-metro
license: mit
---

# CSRNet Fine-tuned — Indian Metro Crowd Density Estimation

Fine-tuned CSRNet for real-time crowd density estimation on Indian metro platforms.

**MAE = 12.36** on held-out Indian metro test set.
95.6% more accurate than YOLOv8 on the same data.

## Model Details
- Architecture: CSRNet (VGG-16 frontend + dilated conv backend, dilation rate r=2)
- Training data: ShanghaiTech Part A + B (700 images) + Custom Indian Metro (88 images)
- Custom dataset: 5,030 head-point annotations across 111 images from Delhi Metro
  (Rajiv Chowk), Hyderabad Metro (Ameerpet), and Mumbai Central
- Best epoch: 14 | MAE: 11.30 | MSE: 13.99
- Inference: < 0.5 seconds on CPU

## Results

| Approach | MAE | Density Map | Verdict |
|---|---|---|---|
| CNN Classifier (ResNet-18) | ~55 | No | Failed |
| YOLOv8 (pretrained COCO) | 283.23 | No | Failed |
| CSRNet Pretrained | ~50 | Yes | Baseline |
| **CSRNet Fine-tuned (this)** | **12.36** | Yes | Best |

## Usage

```python
import torch
from huggingface_hub import hf_hub_download
from model import CSRNet

weights_path = hf_hub_download(
    repo_id  = "YOUR_HF_USERNAME/csrnet-indian-metro-crowd-density",
    filename = "csrnet_v3_best.pth"
)

model = CSRNet()
model.load_state_dict(torch.load(weights_path, map_location="cpu"))
model.eval()
```

## Author
Abdur Rahman Qasim — B.Tech CSE 2025–26  
Methodist College of Engineering and Technology, Hyderabad  
Guide: Dr. Shivani Yadao