Skip to main content

GHOST: Generalizable Hyperspectral Observation & Segmentation Toolkit

Project description

GHOST

Generalizable Hyperspectral Observation & Segmentation Toolkit

Inspired by nnU-Net's philosophy of out-of-the-box segmentation — applied to hyperspectral imagery.

pip install ghost-hsi
ghost demo

What is GHOST?

GHOST is a hyperspectral image segmentation framework. It takes any .mat hyperspectral dataset and produces a segmentation map — no code, no pipeline configuration, no PCA.

It is data-agnostic: band count, class count, and spatial dimensions are read from the file at runtime. The same binary has been tested on:

  • Indian Pines — 200 bands, 16 classes (remote sensing)
  • Salinas Valley — 204 bands, 16 classes (remote sensing)
  • Pavia University — 103 bands, 9 classes (remote sensing)
  • LUSC — 61 bands, 3 classes (lung cancer histopathology)
  • Mars CRISM — planetary remote sensing

Zero code changes between any of these. All results reported here were obtained on a laptop with an RTX 3050 (6 GB VRAM).

See results.md for full numbers with caveats.


Results Overview

Indian Pines

Config OA mIoU Kappa Time
32 base / 8 num filters 97.55% 0.8027 0.9721 77m

Full results including Salinas, Pavia, LUSC, and ablation studies are in results.md.


Architecture

.mat file (H, W, Bands)
    |
    v
Continuum Removal ---- physics-based normalisation, no PCA
    |
    v
Spectral 3D Conv ----- learns cross-band features, kernel (7,3,3)
    |
    v
SE Attention ---------- per-channel importance weighting
    |
    v
2D U-Net -------------- multi-scale spatial context
    |
    v
SPT ------------------- Spectral Partition Tree
    |                   each node: independent model ensemble
    v
Prediction Map (H, W)

See architecture.md for technical details.


Quick Start

# Install
pip install ghost-hsi

# See bundled dataset paths and example command
ghost demo

# Train with Spectral Partition Tree
ghost train_spt \
  --data data.mat --gt labels.mat \
  --loss dice \
  --base_filters 32 --num_filters 8 \
  --ensembles 5 --leaf_ensembles 3 \
  --epochs 400 --patience 50 --min_epochs 40 \
  --out-dir runs/my_experiment

# Predict
ghost predict \
  --data data.mat --gt labels.mat \
  --model runs/my_experiment/spt_models.pkl \
  --out-dir runs/my_experiment

# Visualize
ghost visualize \
  --data data.mat --gt labels.mat \
  --model runs/my_experiment/spt_models.pkl \
  --out-dir runs/my_experiment

A flat baseline (no SPT) is available via ghost train.


Data Format

GHOST accepts .mat files (MATLAB/HDF5 format):

  • Data file: 3D array (H, W, Bands) — the hyperspectral cube
  • Ground truth file: 2D array (H, W) — integer class labels, 0 = background

Keys inside the .mat file are auto-detected by array dimensionality.

Standard datasets (Indian Pines, Pavia University, Salinas Valley) are available from the GIC group at UPV/EHU.


Documentation

Document Description
Architecture Pipeline components, SPT, training details
API Reference All CLI commands and flags
Results Full results, per-class IoU, caveats
Limitations What doesn't work, honest assessment
TODO Planned features

License

Proprietary. All rights reserved. See LICENSE.


Citation

@software{ghost2026,
  title  = {GHOST: Generalizable Hyperspectral Observation \& Segmentation Toolkit},
  author = {IshuIsAwake},
  year   = {2026},
  url    = {https://pypi.org/project/ghost-hsi/}
}

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

ghost_hsi-0.1.5.tar.gz (1.9 MB view details)

Uploaded Source

Built Distributions

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

ghost_hsi-0.1.5-cp312-cp312-win_amd64.whl (823.4 kB view details)

Uploaded CPython 3.12Windows x86-64

ghost_hsi-0.1.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.9 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

ghost_hsi-0.1.5-cp312-cp312-macosx_11_0_arm64.whl (857.7 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

ghost_hsi-0.1.5-cp311-cp311-win_amd64.whl (841.1 kB view details)

Uploaded CPython 3.11Windows x86-64

ghost_hsi-0.1.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.6 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

ghost_hsi-0.1.5-cp311-cp311-macosx_11_0_arm64.whl (875.1 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

ghost_hsi-0.1.5-cp310-cp310-win_amd64.whl (844.4 kB view details)

Uploaded CPython 3.10Windows x86-64

ghost_hsi-0.1.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.3 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

ghost_hsi-0.1.5-cp310-cp310-macosx_11_0_arm64.whl (884.9 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

ghost_hsi-0.1.5-cp39-cp39-win_amd64.whl (848.1 kB view details)

Uploaded CPython 3.9Windows x86-64

ghost_hsi-0.1.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.3 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

ghost_hsi-0.1.5-cp39-cp39-macosx_11_0_arm64.whl (890.1 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

File details

Details for the file ghost_hsi-0.1.5.tar.gz.

File metadata

  • Download URL: ghost_hsi-0.1.5.tar.gz
  • Upload date:
  • Size: 1.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ghost_hsi-0.1.5.tar.gz
Algorithm Hash digest
SHA256 7c492af7db4613e12e4e6dd42c157be3ca062023886797e53e9a62aa2345e618
MD5 102cdd7f93411500845acbbf8f0e2dd2
BLAKE2b-256 fe491ea5adb2a57a66cdb1fb307011104c440f3d0238f8a409b8b2ae5d1d9609

See more details on using hashes here.

Provenance

The following attestation bundles were made for ghost_hsi-0.1.5.tar.gz:

Publisher: publish.yml on IshuIsAwake/GHOST

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ghost_hsi-0.1.5-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: ghost_hsi-0.1.5-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 823.4 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ghost_hsi-0.1.5-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 818b6242a4ff6770a7f3c37dd05cfcc9fa8c8e0f644d34fb3f9bd9f7c464a612
MD5 a6f7a25d473da5eb09efc0aa06d29d6b
BLAKE2b-256 89f83cfcd96f07db5760908b278ed12ceda3b129837a9ed8e421ffb1bfbc923a

See more details on using hashes here.

Provenance

The following attestation bundles were made for ghost_hsi-0.1.5-cp312-cp312-win_amd64.whl:

Publisher: publish.yml on IshuIsAwake/GHOST

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ghost_hsi-0.1.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ghost_hsi-0.1.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 da1c59bb93a3652b465c367fdb10a7980bd9376de1b4c52b2dee2170d74c5a66
MD5 93177901af09260c2fd96158a59cf666
BLAKE2b-256 a37ac6ae19d5e30c64504ec441e3aa8936b2fbd9ed9a644175b9a541ae96ad27

See more details on using hashes here.

Provenance

The following attestation bundles were made for ghost_hsi-0.1.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish.yml on IshuIsAwake/GHOST

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ghost_hsi-0.1.5-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ghost_hsi-0.1.5-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d3e3a75b5bb8747d1b25c90aafc9d8d29e19c8a4cf2111e9b097c1dead85930d
MD5 f09df78b12492fce4f95acbbfcc7c8b1
BLAKE2b-256 b23fcfb26f46b5f94a1732c7ea9d1aabd159e331fc221d7a5191c36c232f48a7

See more details on using hashes here.

Provenance

The following attestation bundles were made for ghost_hsi-0.1.5-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: publish.yml on IshuIsAwake/GHOST

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ghost_hsi-0.1.5-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: ghost_hsi-0.1.5-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 841.1 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ghost_hsi-0.1.5-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 97b85f9ad47981e249f556bcf407834d2cd12d841811b2dc20b29a1c2b2f7114
MD5 8522f49964e357db95ef745a6d9e5235
BLAKE2b-256 e6880119aa1408c2d5dee86510aa7dc9c99f02be3c18e78bb3e0d3d18a51616c

See more details on using hashes here.

Provenance

The following attestation bundles were made for ghost_hsi-0.1.5-cp311-cp311-win_amd64.whl:

Publisher: publish.yml on IshuIsAwake/GHOST

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ghost_hsi-0.1.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ghost_hsi-0.1.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f96f50ddc3d3853f1d4cdd44bcac740aa3c16958072fe668616f338f0e61b1f8
MD5 244530a4a670f41c641edad47b5014fa
BLAKE2b-256 20f65f0ce8fb6cb03ad426866cf64cb3b8130ea336bdb86d98af04550934c776

See more details on using hashes here.

Provenance

The following attestation bundles were made for ghost_hsi-0.1.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish.yml on IshuIsAwake/GHOST

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ghost_hsi-0.1.5-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ghost_hsi-0.1.5-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e93b9807b56837b5169a1ceadc3d46c718006ad0a2d16b8340a5eae2bbeb152b
MD5 6a5ba01313b4c8f0fa5eee4691c030f3
BLAKE2b-256 2db1b6f6490131892892ef61c9dc16fe1297e213580029fc95c4ec1df862ebc4

See more details on using hashes here.

Provenance

The following attestation bundles were made for ghost_hsi-0.1.5-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: publish.yml on IshuIsAwake/GHOST

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ghost_hsi-0.1.5-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: ghost_hsi-0.1.5-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 844.4 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ghost_hsi-0.1.5-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 cfb2b0a0a6f28f48e6e349143c6de466fd59faf454f0a95e23a23839dadea00a
MD5 8a44cbf1d49eb62f66d5dc6565c44974
BLAKE2b-256 192325af30b36857d23dac748144cc2fac65962f56a1abdd920bb6970cb0320c

See more details on using hashes here.

Provenance

The following attestation bundles were made for ghost_hsi-0.1.5-cp310-cp310-win_amd64.whl:

Publisher: publish.yml on IshuIsAwake/GHOST

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ghost_hsi-0.1.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ghost_hsi-0.1.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3ec09d3944a8264c0be1c8c9cf56758defc1ee6d4e27a04a90810c7d501618f7
MD5 8f5940306adbad8df9f9487c9f2995b7
BLAKE2b-256 2fe804b776ac092463f69dc40f28792d1c20d43bf7aa2cdb43aaad8e260bd721

See more details on using hashes here.

Provenance

The following attestation bundles were made for ghost_hsi-0.1.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish.yml on IshuIsAwake/GHOST

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ghost_hsi-0.1.5-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ghost_hsi-0.1.5-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 fedab560808363f1f21e2a31fce5f28ab3d8a14ce7b516cc7311b0b5cc34074a
MD5 002c1c9ed2b7b0dcb796072fbfbd45aa
BLAKE2b-256 25c52d3414039d9c09f8cae56f006667bd70fb514ead2627ffeef6facbcee605

See more details on using hashes here.

Provenance

The following attestation bundles were made for ghost_hsi-0.1.5-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: publish.yml on IshuIsAwake/GHOST

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ghost_hsi-0.1.5-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: ghost_hsi-0.1.5-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 848.1 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ghost_hsi-0.1.5-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 2a75f1055710f10ac88046bca783aadd48fe6b2919c2b4d9d28de066140da38d
MD5 7f84ddc64aa108d1a275039440dd36ac
BLAKE2b-256 d16ee8e298cf0cb3cde40c08fb17b4d21e2a99e24eb913d7ec2691646f2088c4

See more details on using hashes here.

Provenance

The following attestation bundles were made for ghost_hsi-0.1.5-cp39-cp39-win_amd64.whl:

Publisher: publish.yml on IshuIsAwake/GHOST

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ghost_hsi-0.1.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ghost_hsi-0.1.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 bbb82f53fcf107c507ba46cc1f81b0ddbfbaee00ed76e7cd5b3371ecf483c9af
MD5 264a4a6709792f46b4fae5df151b3bc0
BLAKE2b-256 a1212a1732916113c93a5c14614fff9c5ac1224c85a240b64ec09680c2699f15

See more details on using hashes here.

Provenance

The following attestation bundles were made for ghost_hsi-0.1.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish.yml on IshuIsAwake/GHOST

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ghost_hsi-0.1.5-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ghost_hsi-0.1.5-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 217cc10c697f46af65da0b37842c3530e88627748f0101058d79a2c97de34015
MD5 d3ff0d47088b783814e88ec531218a7c
BLAKE2b-256 f5552cad1434814ccbd340d450c7edf84a19be010b30b35dfd2e343c4992963e

See more details on using hashes here.

Provenance

The following attestation bundles were made for ghost_hsi-0.1.5-cp39-cp39-macosx_11_0_arm64.whl:

Publisher: publish.yml on IshuIsAwake/GHOST

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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