← Shahid Usman EuroSAT · Lahore LULC

Deep learning · Remote sensing · Explainable AI

Accuracy vs. efficiency in land-cover classification, from EuroSAT to Lahore

A custom CNN and a transfer-learned ResNet50 were trained on 27,000 Sentinel-2 images, profiled for computational cost, explained with Grad-CAM, and deployed over the Lahore district of Pakistan.

+16.0 pts

Transfer learning wins on accuracy. ResNet50 reaches 97.41% test accuracy against 81.38% for the CNN trained from scratch, and macro F1 rises from 0.805 to 0.973.

25.7×

…at a real compute cost. 4.13 vs. 0.16 GMACs per image, 5.1× the parameters, and 8.3× the latency (14.9 vs. 1.8 ms on a Quadro P2000).

0.59 → 0.99

Hard classes become easy. Highway was the CNN's weakest class (F1 0.59). ResNet50 scores it at 0.99, and every one of its classes is at or above 0.957.

4,289

District-scale deployment. Both models mapped every 640 m tile of Lahore. The maps show the dense urban core, but the models' disagreement reveals domain shift.

01

Study area & methodology

The benchmark is EuroSAT, 64 × 64 px Sentinel-2 tiles from 34 European countries. The deployment target is Lahore district, Punjab, Pakistan, a rapidly urbanising semi-arid region.

Study area. Lahore district boundary over elevation, with its location in Pakistan inset.

At a glance

Benchmark
EuroSAT RGB · 27,000 images · 10 classes
Split
70 / 15 / 15 → 18,900 / 4,050 / 4,050 (seed 42)
Deployment
Lahore district, ≈ 1,760 km²
Imagery
Sentinel-2 L2A median composite, B4-B3-B2, 10 m
Period
Jan – Mar 2026, < 10% cloud, QA60 masked
Raster
5,405 × 6,221 px → 84 × 97 tiles of 64 px
Platform
Google Earth Engine · PyTorch · Quadro P2000 (4 GB)
Methodology. End-to-end pipeline: dataset preparation → parallel model training → evaluation, efficiency and explainability → Lahore district deployment.
02

Results summary

Both models evaluated on the same 4,050-image held-out test split.

Training dynamics

ImageNet pre-training gets ResNet50 to 97% validation accuracy after one epoch. The CNN is still improving when its 10-epoch budget ends.
03

Classification performance

Row-normalised confusion matrices on the test split. The CNN confuses visually similar vegetation classes and roads. ResNet50 resolves almost all of these confusions.

Custom CNN: 81.38% accuracy. Main errors are HerbVeg → PermanentCrop (0.22) and River → Highway (0.21).
ResNet50: 97.41% accuracy. The largest remaining error is Industrial → Residential (0.06).

Per-class precision, recall & F1

Efficiency profile. Parameters vs. median latency (log–log). Bubble area is proportional to GMACs.

Computational cost

Measured with thop and CUDA-synchronised timing at batch size 1 on an NVIDIA Quadro P2000.

04

Explainability with Grad-CAM

Heatmaps show which regions drive ResNet50's decision. They follow road edges for Highway, river channels for River, and repeated building texture for Residential.

Grad-CAM heatmaps (ResNet50)

Grad-CAM on layer4[-1] for 20 EuroSAT images with true and predicted labels.
05

Case study: Lahore district

The trained models were applied to every 64 × 64 px tile (640 m × 640 m) of the Sentinel-2 composite.

Model comparison. Sentinel-2 RGB (left), custom CNN (centre) and ResNet50 (right). ResNet50 picks out the dense residential core and the main road network, while the CNN labels most of the district as cropland.

Maps & statistics

ResNet50 vs. RGB
Custom CNN vs. RGB
Interpreting the Lahore results EuroSAT was collected in Europe, so Lahore is out-of-distribution for both models. The two models agree on - of tiles, and there is no labelled ground truth for the district yet. The maps are a qualitative baseline. Validating against ESA WorldCover is the planned next step.
Extra

Try the model yourself

Both trained models run directly in your browser through ONNX Runtime Web. Pick a test image or upload your own satellite tile. Nothing is uploaded to a server.

Drop an image or click to upload
Center-cropped and resized to a 64 × 64 px tile (≈ 640 m at 10 m/px)
Test-set samples
Ground truth
-

Select an image to run the models.

06

Limitations & next steps

Limitations

  • RGB only. The other 10 Sentinel-2 spectral bands are not used.
  • The CNN trained for only 10 epochs and was still improving, so part of the gap is training budget.
  • Lahore has no ground truth yet, and 640 m tiles mix several land-cover types.
  • European training scenes vs. a South Asian winter composite introduce domain shift.

Next steps

  • Validate the Lahore maps against ESA WorldCover and Dynamic World.
  • Fine-tune on a small set of labelled Lahore tiles to close the domain gap.
  • Add multispectral input (13 bands) and lighter backbones such as MobileNet and EfficientNet.
  • Multi-year composites for land-cover change detection.