A comparison of two deep learning approaches for satellite image classification: a custom CNN architecture vs ResNet50 transfer learning.
This project classifies satellite images from the EuroSAT RGB dataset into 10 land use categories using two different neural network architectures.
- Custom CNN - Built from scratch with 4 convolutional blocks
- ResNet50 - Pre-trained on ImageNet with custom classification head
- Name: EuroSAT RGB
- Images: 27,000 satellite images (64×64 pixels, upscaled to 224×224)
- Classes: 10 land use types
- Annual Crop
- Forest
- Herbaceous Vegetation
- Highway
- Industrial
- Pasture
- Permanent Crop
- Residential
- River
- Sea/Lake
- Source: Sentinel-2 satellite imagery
tensorflow
tensorflow-datasets
numpy
matplotlib
scikit-learnpip install tensorflow tensorflow-datasets numpy matplotlib scikit-learnRun the Jupyter notebook:
jupyter notebook model-complete.ipynbThe notebook will:
- Download the EuroSAT dataset
- Preprocess images for both models
- Train the custom CNN
- Train the ResNet50 model
- Evaluate both models
- Display comparison charts
- 4 convolutional blocks (32, 64, 128, 256 filters)
- Batch normalization and dropout
- Global average pooling
- Dense layers: 512 → 256 → 10
- Pre-trained ResNet50 base (frozen)
- Custom classification head
- Dense layers: 512 → 256 → 10
- Batch size: 32
- Image size: 224×224
- Split: 70% train, 15% validation, 15% test
- Optimizer: Adam (lr=0.001)
- Callbacks: Early stopping, learning rate reduction, model checkpointing
The notebook outputs:
- Training and validation accuracy/loss curves
- Test accuracy for both models
- Performance comparison
.
├── model-complete.ipynb # Main notebook
├── custom_cnn_best.h5 # Saved custom CNN model
├── resnet50_best.h5 # Saved ResNet50 model
└── README.md # This file
- Models are saved automatically during training
- Best weights are restored after training
- Memory is cleared between models to optimize resource usage