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.6.tar.gz (7.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.6-cp312-cp312-win_amd64.whl (6.8 MB view details)

Uploaded CPython 3.12Windows x86-64

ghost_hsi-0.1.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.9 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

ghost_hsi-0.1.6-cp312-cp312-macosx_11_0_arm64.whl (6.8 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

ghost_hsi-0.1.6-cp311-cp311-win_amd64.whl (6.8 MB view details)

Uploaded CPython 3.11Windows x86-64

ghost_hsi-0.1.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.6 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

ghost_hsi-0.1.6-cp311-cp311-macosx_11_0_arm64.whl (6.8 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

ghost_hsi-0.1.6-cp310-cp310-win_amd64.whl (6.8 MB view details)

Uploaded CPython 3.10Windows x86-64

ghost_hsi-0.1.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.3 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

ghost_hsi-0.1.6-cp310-cp310-macosx_11_0_arm64.whl (6.8 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

ghost_hsi-0.1.6-cp39-cp39-win_amd64.whl (6.8 MB view details)

Uploaded CPython 3.9Windows x86-64

ghost_hsi-0.1.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.3 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

ghost_hsi-0.1.6-cp39-cp39-macosx_11_0_arm64.whl (6.8 MB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: ghost_hsi-0.1.6.tar.gz
  • Upload date:
  • Size: 7.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.6.tar.gz
Algorithm Hash digest
SHA256 ea3c602f284dba4f2b69230bb6e1f681e238ecc7b6a6da16fd73a23fea281743
MD5 4cc9647e764cbf7f6702b06b5c66449d
BLAKE2b-256 d8a917a1067ca2bf26d0bc222a92c09fbc0984864f2e0bc136d2d8b54cc4422b

See more details on using hashes here.

Provenance

The following attestation bundles were made for ghost_hsi-0.1.6.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.6-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: ghost_hsi-0.1.6-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 6.8 MB
  • 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.6-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 d1e817d4eadbe2603db3cac97042a199465bc2e9797426a34e7b3027012d48e1
MD5 5d56fa990259667db3285d926694e26f
BLAKE2b-256 825bd5a53986b01752698ae3b9490cc60af99e39eeea8b8dde5ba90e74f7527c

See more details on using hashes here.

Provenance

The following attestation bundles were made for ghost_hsi-0.1.6-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.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ghost_hsi-0.1.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a1377102aacb6caec4958b7054c080b3670a1f123ae1d5a3fa36e76f48c8f33b
MD5 c102fffa652bec4d5051ce9a42265e96
BLAKE2b-256 9f032638441533650b3b81921b645fe7c5cfedbd4bc0edb5e7769ce1137d3152

See more details on using hashes here.

Provenance

The following attestation bundles were made for ghost_hsi-0.1.6-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.6-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ghost_hsi-0.1.6-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bc5613502fde40716039adc6733bbe4b7cbed55660f91be2d2eb164c9cce8df9
MD5 742c10f20b81e5d106a95cb458534d96
BLAKE2b-256 d8aa6b863724cbd66c792b118e370d28cf47fe3517bc97f25090a20a019e6d6a

See more details on using hashes here.

Provenance

The following attestation bundles were made for ghost_hsi-0.1.6-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.6-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: ghost_hsi-0.1.6-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 6.8 MB
  • 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.6-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 b26c61e013a6bbb7493bab64e61aabcf29b6f336050fafd59f44a18e9e224816
MD5 ba704ee3968818b084af2b531ea41dc5
BLAKE2b-256 8bdab85a392f9bd021e50dd30d52e68c85eca78e761efc98171e39227d8dea24

See more details on using hashes here.

Provenance

The following attestation bundles were made for ghost_hsi-0.1.6-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.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ghost_hsi-0.1.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 64f244e5e7d09d5b609ce1f1d371ba87f1a6bcbe1577c1bf96617bf98d886609
MD5 3801a9bf9b7c3edf42a4ecdd7d1abb93
BLAKE2b-256 59a69130e62179e86a8aaf3ea869b9194e2bbb7dad84e426ee77e39bd59faf62

See more details on using hashes here.

Provenance

The following attestation bundles were made for ghost_hsi-0.1.6-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.6-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ghost_hsi-0.1.6-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1c67bc688f49c47b0ee57306cfdbc1c7d3e8db1af252526446cbe8e0866ae527
MD5 656be71bc89603bfae96880b62d43198
BLAKE2b-256 e6ecaedbedc87ffea92862a24f69b74074db55873cc2439f8494f6922c63781f

See more details on using hashes here.

Provenance

The following attestation bundles were made for ghost_hsi-0.1.6-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.6-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: ghost_hsi-0.1.6-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 6.8 MB
  • 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.6-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 2db3a1158108f5da338ac8b1253c5c90ee8b4ed6cbe9d80dfeaff5a33ba9330b
MD5 30eedf8640d972dc0d1058006ba6ac8e
BLAKE2b-256 58aee0d901050b2f3c543f9d6feebf5fd176e686b3b0b1094285dd6ef8f8a3e7

See more details on using hashes here.

Provenance

The following attestation bundles were made for ghost_hsi-0.1.6-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.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ghost_hsi-0.1.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c43340f0f385f6c16b79b312b2324aac9f3a7c9c174f155e80f4b9826b7a6ead
MD5 0a4aeffeec68e36bedcdcdf3497976de
BLAKE2b-256 8ffed5aba32bfd69ede6e45dd6d99862b129c52f6de96a01e6229bf08fe1651e

See more details on using hashes here.

Provenance

The following attestation bundles were made for ghost_hsi-0.1.6-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.6-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ghost_hsi-0.1.6-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 70ec8500ba7ecc98085d4ae154bb670419d91002954eaefdf97918048824edc2
MD5 021523c005e86a8e4ee8093ba8018c3d
BLAKE2b-256 9a2641c3493bc7e991b73f5959ab3d3a8a9b2edd653286b2555004ced19893f1

See more details on using hashes here.

Provenance

The following attestation bundles were made for ghost_hsi-0.1.6-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.6-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: ghost_hsi-0.1.6-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 6.8 MB
  • 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.6-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 6d788a3c192837f52469d3dd5e9bef8c79a431988440f77e27bd52e2719563df
MD5 770726c57901f61f8b39931db0dcde50
BLAKE2b-256 62358769a47f14a46a3fe6c87b0e21668b79fb69d648b1a5d0fdee8a934bbe5e

See more details on using hashes here.

Provenance

The following attestation bundles were made for ghost_hsi-0.1.6-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.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ghost_hsi-0.1.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 662128dcc224db213a190a442fc684fe79383fd301fdb8f362e46fd2857ab0fa
MD5 64107531eaa836fd3f5814ee59ca826a
BLAKE2b-256 8d1cb6b6ecf948077a13c49935ccd45cf7a9999be3a07adc0cf328a7b9c71e2a

See more details on using hashes here.

Provenance

The following attestation bundles were made for ghost_hsi-0.1.6-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.6-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ghost_hsi-0.1.6-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 535134371a6d0ffd60b6cb5ccee3bae4f19534b20835e13e218e57fd89813c10
MD5 cab4fbc8421c9d840d010b2bb7ec4723
BLAKE2b-256 6aedfcdf3c591965b1b4b71dd892a24adaad19f459585154774c5f845c2e069a

See more details on using hashes here.

Provenance

The following attestation bundles were made for ghost_hsi-0.1.6-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