Skip to content

CdoxHype/CNN-Models-Comparison

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

EuroSAT Land Use Classification

A comparison of two deep learning approaches for satellite image classification: a custom CNN architecture vs ResNet50 transfer learning.

Overview

This project classifies satellite images from the EuroSAT RGB dataset into 10 land use categories using two different neural network architectures.

Models Compared

  1. Custom CNN - Built from scratch with 4 convolutional blocks
  2. ResNet50 - Pre-trained on ImageNet with custom classification head

Dataset

  • 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

Requirements

tensorflow
tensorflow-datasets
numpy
matplotlib
scikit-learn

Installation

pip install tensorflow tensorflow-datasets numpy matplotlib scikit-learn

Usage

Run the Jupyter notebook:

jupyter notebook model-complete.ipynb

The notebook will:

  1. Download the EuroSAT dataset
  2. Preprocess images for both models
  3. Train the custom CNN
  4. Train the ResNet50 model
  5. Evaluate both models
  6. Display comparison charts

Model Architectures

Custom CNN

  • 4 convolutional blocks (32, 64, 128, 256 filters)
  • Batch normalization and dropout
  • Global average pooling
  • Dense layers: 512 → 256 → 10

ResNet50

  • Pre-trained ResNet50 base (frozen)
  • Custom classification head
  • Dense layers: 512 → 256 → 10

Training Configuration

  • 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

Results

The notebook outputs:

  • Training and validation accuracy/loss curves
  • Test accuracy for both models
  • Performance comparison

File Structure

.
├── model-complete.ipynb    # Main notebook
├── custom_cnn_best.h5      # Saved custom CNN model
├── resnet50_best.h5        # Saved ResNet50 model
└── README.md               # This file

Notes

  • Models are saved automatically during training
  • Best weights are restored after training
  • Memory is cleared between models to optimize resource usage

About

This mini-project focused on comparing CNN models to identify the most effective architecture for satellite image classification.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors