Satellite Image Retrieval for Earth Observation

Content-Based Image Retrieval (CBIR) on EuroSAT

Course: Information Retrieval Topic: Satellite Image Retrieval for Earth Observation Submitted to: Prof. Antonio Maria Rinaldi, Prof. Domenico Benfenati Student: Rohan Baidya, D03000192 Dataset link: https://madm.dfki.de/files/sentinel/EuroSAT.zip Site link: https://unina.cc/ir


Abstract


End-to-end Process Flow

flowchart TD A["1. Download EuroSAT
27k patches, 10 classes"] --> B["2. Build
dataset index"] B --> C["3. Extract features
HSV 96-d + ResNet18 512-d
L2-normalised"] C --> D["4. FAISS
IndexFlatIP (cosine)"] D --> E["5. Evaluate
P@k, Recall@k, mAP@50"] Q["Query image"] --> R["Encode
ResNet18 vector"] R --> D D --> S["6. Ranked results
+ k-NN class vote"]

Code Components

Library Reference

Library Version Purpose
torch >= 2.2 Model inference
torchvision >= 0.20 EuroSAT download, ResNet18 weights, image transforms
faiss-cpu >= 1.8 Nearest-neighbour index (IndexFlatIP)
numpy >= 1.24 Arrays, histograms, L2 normalisation
Pillow >= 10.0 Image loading and RGB to HSV conversion
matplotlib >= 3.7 Sample grid and retrieval montage plots
tqdm >= 4.66 Progress bars during feature extraction

Notebook Cells

Cell Stage What it does Key call
1 Setup and download OpenMP env var, torch before faiss, fix params, download EuroSAT if missing `EuroSAT(root,
download=True)`
2 Dataset index Scan class folders into paths, labels, classes, optional sampling load_index(DATA_FOLDER)
3 Feature extraction One image per class, then 96-d HSV and 512-d ResNet18 descriptors extract_color_histograms,
extract_deep_features
4 FAISS index Cosine index per descriptor faiss.IndexFlatIP(dim)
5 Evaluation Leave-one-out P@k, Recall@k, mAP@50 cbir_evaluate(feats, labels)
6 Results and demo Save results.json, top-5 montage, per-class P@10 chart deep_index.search(...)
7 Custom query Retrieve for a query by path, index, or class name deep_index.search(q_feat, k)

1. Introduction

Problem. Given a query image and N labelled patches, rank the patches so that those of the same land-cover class as the query come first.

Objectives. - Implement a classical and a deep descriptor. - Index both with FAISS for fast search. - Evaluate with Precision@k, Recall@k, mAP@50. - Compare the two and explain the gap.


2. Data and Preprocessing

2.1 EuroSAT

Class Description
AnnualCrop Seasonal cultivation
Forest Dense tree cover
HerbaceousVegetation Grassland
Highway Major roads
Industrial Factories and warehouses
Pasture Open grazing land
PermanentCrop Orchards and vineyards
Residential Urban housing
River Rivers
SeaLake Large open water

2.2 Source

2.3 Preprocessing


3. Retrieval Methods

3.1 HSV Colour Histogram

3.2 ResNet18

3.3 Similarity and Indexing


4. Implementation and Evaluation

4.1 Feature Extraction

4.2 Evaluation Protocol

4.3 Results

Method P@1 P@5 P@10 P@20 Recall@10 mAP@50
HSV histogram 0.699 0.620 0.570 0.514 0.019 0.316
ResNet18 0.857 0.826 0.806 0.780 0.027 0.648

4.4 Image Query as Classification (k-NN)

4.5 Relevance Feedback


5. Conclusions

Main limitations: - ResNet18 was trained on normal photos, not satellite data. - RGB input drops Sentinel-2's extra bands (NIR, SWIR). - Exact FAISS search checks every image, so it would be slow on very large sets.