This repository provides an implementation of a Task-Driven Dictionary Learning (TDDL) framework integrated with deep metric learning in a triplet architecture for high-resolution remote sensing scene classification.
The method combines:
- Superpixel-based region decomposition (SLIC),
- Region-level feature extraction,
- Graph-based representation learning (GCN + attention),
- Dictionary learning optimized for classification objectives,
- Metric learning through triplet loss to improve class separability.
High-resolution remote sensing images often contain complex spatial patterns and intra-class variability.
This project addresses these challenges by coupling dictionary learning with graph neural modeling and metric learning.
At a high level, the pipeline is:
- Segment each image into regions using SLIC superpixels.
- Extract local region descriptors.
- Construct graph-structured representations.
- Pretrain a graph model (GCN + attention).
- Train the full TDDL-based triplet framework for discriminative embedding learning.
- Perform scene classification from learned representations.
Update this section if your folder/file names differ.
train_tddl_gcn.py— demo training script for the 2-stage training process.models/— model definitions (GCN, attention modules, triplet architecture).data/— dataset loaders and preprocessing utilities.utils/— helper functions for training/evaluation.README.md— project documentation.
The implementation is designed for the following remote sensing scene datasets:
- UC Merced Land Use Dataset (UCMD)
http://weegee.vision.ucmerced.edu/datasets/landuse.html - Aerial Image Dataset (AID)
https://captain-whu.github.io/AID/ - PatternNet
https://drive.google.com/file/d/127lxXYqzO6Bd0yZhvEbgIfz95HaEnr9K/view
Please download datasets from their official sources and organize them according to your local data loading configuration.
As a preprocessing step, each image is partitioned into regions in an unsupervised way using the SLIC algorithm.
For each region:
- local descriptors are extracted,
- descriptors are used to build graph-structured inputs for the network.
If external MATLAB feature extraction scripts are required, ensure they are available and correctly referenced in your preprocessing pipeline.
A demo training entry point is provided in:
train_tddl_gcn.py
The current training procedure is configured as a two-stage process:
- Pretraining stage: train a base GCN + attention model.
- Task-driven stage: optimize the full dictionary learning + metric learning objective using triplet supervision.
To run training (example):
python train_tddl_gcn.pyAdjust command-line arguments or configuration values according to your dataset paths, hyperparameters, and environment.
Create and activate a Python environment, then install required packages.
pip install -r requirements.txtIf requirements.txt is not yet complete, include at least:
torchtorchvisionnumpyscikit-learnopencv-pythonscikit-imagenetworkx(if used by graph construction code)- additional dataset/preprocessing dependencies as needed
For reproducible experiments, consider fixing:
- random seeds,
- train/val/test split definitions,
- superpixel parameters,
- dictionary size and sparse coding settings,
- triplet mining strategy and margin values.
If you use this repository in your research, please cite:
@article{Regan2023TripletGCN,
title = {A triplet graph convolutional network with attention and similarity-driven dictionary learning for remote sensing image retrieval},
author = {Regan, Jacob and Khodayar, Mahdi},
journal = {Expert Systems with Applications},
volume = {232},
pages = {120579},
year = {2023},
issn = {0957-4174},
doi = {10.1016/j.eswa.2023.120579},
url = {https://www.sciencedirect.com/science/article/pii/S0957417423010813}
}This project builds on ideas from:
- task-driven dictionary learning,
- graph neural networks,
- deep metric learning for visual representation learning,
- publicly available remote sensing datasets and preprocessing tools.
This project is licensed under the MIT License - see the LICENSE file for details.