hyperspectral_image_generator
Hyperspectral image generator with augmentation for Keras
Science Score: 67.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 2 DOI reference(s) in README -
✓Academic publication links
Links to: arxiv.org, zenodo.org -
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (13.7%) to scientific vocabulary
Repository
Hyperspectral image generator with augmentation for Keras
Basic Info
- Host: GitHub
- Owner: mabdelhack
- License: mit
- Language: Python
- Default Branch: master
- Size: 4.24 MB
Statistics
- Stars: 42
- Watchers: 4
- Forks: 5
- Open Issues: 1
- Releases: 2
Metadata Files
README.md
Hyperspectral Image Generator
This is a tool that creates an image generator for Keras that is useful for hyperspectral images. It implements data augmentation. This tool is developed originally from CNN Sentinel repository and uses main functions as is from the original repository. Example implementation in this paper.
Features
It allows an image generator to make the following transformations on images: - Horizontal/Vertical flip - Rotation - Shear - Translation - Zooming - Addition of speckle noise
UPDATE: It now supports cropping from larger tiles.
It uses the edge pixels to pad the pixels that become missing due to the transformations.
Without augmentation:

With augmentation:

Requirements
These are the requirements for running this whole simulation. The generator itself only uses scikit-image and numpy libraries. - Keras - Tensorflow - Numpy - Pandas - Scikit-image
For tile cropping: - Geopandas - Rasterio - Fiona - Shapely
How to use (basic mode)
The tool itself is located in hyperspectralimagegenerator.py. It depends on some preprocessing functions that loads image mean and std and the files.
A use case is imported from the original repository for CNN-Sentinel classification. You should refer to the documentation there for more details on how to obtain the data.
First, download the data and write the data path into splitdatatotrainand_validation.py then run it to generate training and test datasets.
Then run trainhyperspectralvgg19.py to train a VGG19 network using image augmentation.
You can test the function to visualize the output using augmentation_test.py.
How to use tile cropping
I used data from the park location in the city of St. Louis, Missouri, USA released by the
St. Louis government website with Google maps satellite imagery for background.
A demo of the generator is included in slicingtest.py. Note that you need to download the data and include them in the folder ```imagesfor_notebook``` (Data is quite large). The shape file with labels
Centroids are included in the repo (shape files) but it is just a processed version of the original file, I do not possess any rights to the data it comprises.
Future plans
- Allow different modes of noise other than speckle noise.
Owner
- Name: mabdelhack
- Login: mabdelhack
- Kind: user
- Location: Toronto
- Company: Krembil Centre for Neuroinformatics
- Website: https://mabdelhack.github.io/
- Twitter: mabdelhack
- Repositories: 47
- Profile: https://github.com/mabdelhack
Citation (CITATION.cff)
cff-version: 1.1.0
message: "If you use this software, please cite it as below."
authors:
- family-names: Abdelhack
given-names: Mohamed
orcid: https://orcid.org/0000-0002-6753-3237
title: mabdelhack/hyperspectral_image_generator: v1
version: v1
date-released: 2022-10-09
GitHub Events
Total
- Fork event: 1
Last Year
- Fork event: 1
Dependencies
- Keras ==2.3.1
- Keras-Applications ==1.0.8
- Keras-Preprocessing ==1.1.0
- fiona ==1.7.10
- geopandas ==0.5.1
- numpy ==1.22.0
- pandas ==1.0.1
- rasterio ==1.0.26
- scikit-image ==0.16.2
- shapely ==1.6.4.post2
- tensorflow-gpu ==2.7.2