Skip to content

Repository files navigation

Task-Driven Dictionary Learning with Deep Metric Learning for Remote Sensing Scene Classification

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.

Overview

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:

  1. Segment each image into regions using SLIC superpixels.
  2. Extract local region descriptors.
  3. Construct graph-structured representations.
  4. Pretrain a graph model (GCN + attention).
  5. Train the full TDDL-based triplet framework for discriminative embedding learning.
  6. Perform scene classification from learned representations.

Repository Structure

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.

Datasets

The implementation is designed for the following remote sensing scene datasets:

Please download datasets from their official sources and organize them according to your local data loading configuration.


Preprocessing

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.


Training

A demo training entry point is provided in:

  • train_tddl_gcn.py

The current training procedure is configured as a two-stage process:

  1. Pretraining stage: train a base GCN + attention model.
  2. Task-driven stage: optimize the full dictionary learning + metric learning objective using triplet supervision.

To run training (example):

python train_tddl_gcn.py

Adjust command-line arguments or configuration values according to your dataset paths, hyperparameters, and environment.


Requirements

Create and activate a Python environment, then install required packages.

pip install -r requirements.txt

If requirements.txt is not yet complete, include at least:

  • torch
  • torchvision
  • numpy
  • scikit-learn
  • opencv-python
  • scikit-image
  • networkx (if used by graph construction code)
  • additional dataset/preprocessing dependencies as needed

Reproducibility Notes

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.

Citation

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}
}

Acknowledgements

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.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages