Skip to main content

Pipeline for segmentation of arbitrary features in remote sensing imagery using deep learning

Project description

Segmentation of arbitrary features in very high resolution remote sensing imagery

This is the code repository for my M.Sc. thesis at Imperial College London, "Segmentation of arbitrary features in very high resolution remote sensing imagery".

The initial code version at time of publication on arXiv is tagged v1.0. The codebase may evolve in the future with new features, bugfixes, etc.

Abstract

Click to expand

Very high resolution (VHR) mapping through remote sensing (RS) imagery presents a new opportunity to inform decision-making and sustainable practices in countless domains. Efficient processing of big VHR data requires automated tools applicable to numerous geographic regions and features. Contemporary RS studies address this challenge by employing deep learning (DL) models for specific datasets or features, which limits their applicability across contexts.

The present research aims to overcome this limitation by introducing EcoMapper, a scalable solution to segment arbitrary features in VHR RS imagery. EcoMapper fully automates processing of geospatial data, DL model training, and inference. Models trained with EcoMapper successfully segmented two distinct features in a real-world UAV dataset, achieving scores competitive with prior studies which employed context-specific models.

To evaluate EcoMapper, many additional models were trained on permutations of principal field survey characteristics (FSCs). A relationship was discovered allowing derivation of optimal ground sampling distance from feature size, termed Cording Index (CI). A comprehensive methodology for field surveys was developed to ensure DL methods can be applied effectively to collected data.

EcoMapper Architecture

Installation

Click to expand

First, check if conda is already installed by running:

conda --version
# Should print: conda <some version>

If an error is reported, install miniconda from https://docs.conda.io/en/latest/miniconda.html or use miniforge, which provides mamba as a faster alternative: https://github.com/conda-forge/miniforge

Next, update conda:

conda update -n base -c conda-forge conda -y

Create an environment and activate it. Be sure to use Python 3.10 as shown.

conda create -n ecomapper python=3.10 GDAL=3.7.2 -y
conda activate ecomapper

Update pip and install the project dependencies:

pip install --upgrade pip
pip install -r requirements.txt

Install MMCV (be sure to use mim instead of pip!)

mim install "mmcv==2.0.0"

Install MMSegmentation and MMDetection

pip install git+https://github.com/open-mmlab/mmsegmentation@30a3f94f3e2916e27fa38c67cc3b8c69c1893fe8
pip install git+https://github.com/open-mmlab/mmdetection@ecac3a77becc63f23d9f6980b2a36f86acd00a8a

Usage

Please refer to the quickstart guide.

Development

Generating documentation

Build modules (only if any modules were changed):

sphinx-apidoc -M -f -o docs/ ./ecomapper

Generate documentation:

python -m sphinx -b html docs/ docs/_build/

After building, you can open the HTML documentation from docs/_build/index.html.

Running tests

Please note that some tests in tests/functional are computationally expensive and may take longer to complete on CPU-only systems. Using a dedicated GPU is recommended.

To run tests:

pytest

Linting with flake8

python -m flake8

Type checking with Pytype

python -m pytype

Regenerating requirements.txt

uv pip compile --universal --output-file=requirements.txt requirements.in

Afterwards, sync the requirements:

uv pip sync requirements.txt

mim install "mmcv==2.0.0"
pip install git+https://github.com/open-mmlab/mmsegmentation@30a3f94f3e2916e27fa38c67cc3b8c69c1893fe8
pip install git+https://github.com/open-mmlab/mmdetection@ecac3a77becc63f23d9f6980b2a36f86acd00a8a
mamba install GDAL==3.7.2 -y

License

The repository uses the GPL v3 license. If this is significantly constricting you, please reach out to me!

License

Citation

If you find this work useful, please cite:

DOI: https://doi.org/10.48550/arXiv.2412.16046

Bibtex:

@misc{cording2024segmentationarbitraryfeatureshigh,
      title={Segmentation of arbitrary features in very high resolution remote sensing imagery}, 
      author={Henry Cording and Yves Plancherel and Pablo Brito-Parada},
      year={2024},
      eprint={2412.16046},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2412.16046}, 
}

To-do list

  • Include additional models from MMSegmentation for training
  • Mute MMSegmentation output and write to log file instead
  • Working verbosity; use logging for all messages
  • Template generator that can be used to fill out a task and submit it (useful for headless HPC environments)
  • Wider test coverage
  • Improved documentation, publish docs on readthedocs

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ecomapper-1.0.0.tar.gz (6.4 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ecomapper-1.0.0-py3-none-any.whl (82.1 kB view details)

Uploaded Python 3

File details

Details for the file ecomapper-1.0.0.tar.gz.

File metadata

  • Download URL: ecomapper-1.0.0.tar.gz
  • Upload date:
  • Size: 6.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.16

File hashes

Hashes for ecomapper-1.0.0.tar.gz
Algorithm Hash digest
SHA256 9c908b310d3d740f521ad98d44fba0ee591a82d0cedb6d58efd407cc10348698
MD5 761a60543e126303eeeb0f46af745e45
BLAKE2b-256 0037f10b53ff65c2c3f995ee1ea811c6cfe88f963ca381975fc4359109927d36

See more details on using hashes here.

File details

Details for the file ecomapper-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: ecomapper-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 82.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.16

File hashes

Hashes for ecomapper-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 44349b3f4ee23ce47a46db8fae562de240023382b6fe131fd698b1a01a10d434
MD5 fb5c680d41593fb79f53ddb7b8c520c8
BLAKE2b-256 0f4ae8388ffaf1e303a42fe856d26fbbd299348898cf03e0fb120396645fead9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page