Giter Site home page Giter Site logo

dynaslum / satsense Goto Github PK

View Code? Open in Web Editor NEW
23.0 6.0 11.0 25.96 MB

Satsense is a Python library for land use/cover classification using satellite imagery

Home Page: https://satsense.readthedocs.io

License: Apache License 2.0

Jupyter Notebook 87.97% Python 12.03%
satellite-images classification machine-learning machine-learning-algorithms land-use land-cover earth-observation

satsense's Introduction

Satsense

Build Status Codacy Badge Maintainability Test Coverage Documentation Status DOI

Satsense is an open source Python library for patch based land-use and land-cover classification, initially developed for a project on deprived neighborhood detection. However, many of the algorithms made available through Satsense can be applied in other domains, such as ecology and climate science.

Satsense is based on readily available open source libraries, such as opencv for machine learning and the rasterio/gdal and netcdf libraries for data access. It has a modular design that makes it easy to add your own hand-crafted feature or use deep learning instead.

Detection of deprived neighborhoods is a land-use classification problem that is traditionally solved using hand crafted features like HoG, Lacunarity, NDXI, Pantex, Texton, and SIFT, computed from very high resolution satellite images. One of the goals of Satsense is to facilitate assessing the performance of these features on practical applications. To achieve this Satsense provides an easy to use open source reference implementation for these and other features, as well as facilities to distribute feature computation over multiple cpu’s. In the future the library will also provide easy access to metrics for assessing algorithm performance.

  • satsense - library for analysing satellite images, performance evaluation, etc.
  • notebooks - IPython notebooks for illustrating and testing the usage of Satsense

We are using python 3.6/3.7 and jupyter notebook for our code.

Documentation

Can be found on readthedocs.

Installation

Please see the installation guide on readthedocs.

Contributing

Contributions are very welcome! Please see CONTRIBUTING.md for our contribution guidelines.

Citing Satsense

If you use Satsense for scientific research, please cite it. You can download citation files from research-software.nl.

References

The collection of algorithms made available trough this package is inspired by

  1. Graesser, A. Cheriyadat, R. R. Vatsavai, V. Chandola,

J. Long and E. Bright, "Image Based Characterization of Formal and Informal Neighborhoods in an Urban Landscape", in IEEE Journal of Selected Topics in Applied Earth Observations and Remote Sensing, vol. 5, no. 4, pp. 1164-1176, Aug. 2012. doi: 10.1109/JSTARS.2012.2190383

Jordan Graesser himself also maintains a library with many of these algorithms.

Test Data

The test data has been extracted from the Copernicus Sentinel data 2018.

satsense's People

Contributors

bouweandela avatar bpmweel avatar codacy-badger avatar derkbarten avatar elboyran avatar jarocamphuijsen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

satsense's Issues

QGIS plugin

As a Remote sensing QGIS user
I would like to Use the feature extraction capabilities of satsense from QGIS
because I would like to use these features, but do not have experience in programming python.

Check if it is feasible to make it possible to use satsense as a QGIS plugin and do so if the resulting installation procedure is not too complicated.

Update scipy

The function scipy.misc.imread has been removed from scipy since version 1.3, but we use it in the function satsense.util.mask.load_mask_from_file.

Handle masked image pixels correctly

We need a strategy to handle masked image pixels values in the feature computations. This is probably different per feature if you want to do something meaningful with masked image data. The simplest and safest strategy is probably to return a masked or fill value instead of the feature value(s) if the input image contains any masked value.

Machine Learning Algorithm Training

As a Remote sensing expert
I want to Train a machine learning algorithm using the calculated features
because I can then apply the algorithm to detect slums.

Estimate: 3

Update Texton, Sift and features

As a Remote sensing expert
I want to Calculate the texton and sift features on a large satellite image on a computer with limited memory
because I do not have access to a computer with enough memory

Estimate: 5

Improve memory behaviour and simplify design

Work on this is done in #14

  • Prevent copying a large numpy arrays between processes
  • Use python slices instead of windows
  • Check speed of rasterio windows against loading the image in bands (-> this was too slow to use for window generation)

SIFT no longer available in opencv > 3.4.2

From travis:

cv2.error: OpenCV(3.4.3) /io/opencv_contrib/modules/xfeatures2d/src/sift.cpp:1207: error: (-213:The function/feature is not implemented) This algorithm is patented and is excluded in this configuration; Set OPENCV_ENABLE_NONFREE CMake option and rebuild the library in function 'create'

Add windows CI build

As a Satsense developer
I would like to add a windows build to the automated build system
so that I can be sure that satsense works correctly on windows systems

Windows on appveyor (Boatswain has appeveyor config as an example)

Calculate features

As a remote sensing expert
I want to Calculate the features in satsense on a satellite image.
because This allows me to use them to detect slums

Estimate: 2

Add unit tests of feature computation

List of features that need tests:

  • hog
  • lacunarity
  • ndxi
  • pantex
  • rid (do we believe this feature is worth the effort?)
  • sift
  • texton

The minimum test that should be available is a regression test. More is better, but maybe not feasible in the limited amount of time we have.

We may also consider comparing with the features as computed by spfeas.

Clean up notebooks

As a Remote sensing expert user of satsense
I would like to Have an example notebook showing how to use satsense
because I can use this as a starting point for my own research.

Most notebooks are outdated. Update or remove once we have a more stable API.

This notebook is most informative and relatively up to date:
satsense/notebooks/demo_notebooks/Classification/Simple Example.ipynb

User Documentation

As a remote sensing user of satsense
I would like to be able to look up how to use the relevant parts of satsense in the documentation
because without documentation using satsense will be very hard

  • Check public interface for docstrings
  • Example Jupyter Notebooks #17
  • Write User Guide
  • Readthedocs documentation (sphinx)

Estimate: 8 (timeboxed to 5)

Use satsense for Sentinel 2 tif

As a user,
I want to run satsense over a few sentinel-2 tiles, and osm shapefile as my ground label
because I want to do landcover classification.

Apply ML algorithm

As a Remote sensing expert
I want to Apply the trained machine learning algorithm on a satellite image to detect slums
because I can then give this result as a validation set to the model builder

NEEDS REFINEMENT

Loading extracted features with masks, mask is not loaded

When loading computed features at a later time, the mask is not properly loaded...
This cost me quite some time to figure out what was going on with my features (all my statistics were messed up, +infinity for the means, etc)

I was loading features from .tif files.
I did look at the feature loading/saving code but it seemed like there is code for handling the mask...

This is the temporary fix I used (which assumes the mask fill_value = 1e+20):

x_test_mask = np.ma.masked_values(x_test, 1e+20)
mask = x_test_mask.mask

vector_mask = np.any(mask, axis=1)

index_vector = ~vector_mask
x_test = x_test[index_vector]
y_test = y_test[index_vector]

Add mac build to travis

As a Satsense developer
I would like to add a mac build to the automated build system
so that I can be sure that satsense works correctly on mac systems

Improve save/load of FeatureVector

As a Remote sensing user
I would like to be able to restore a saved FeatureVector instance from file (netcdf or geotif) for Texton and Sift features.
because then I do not have to recalculate the initialization of these features to calculate them.

Improve FeatureSet

The satsense.features.FeatureSet class should provide a convenient way for users to combine satsense.image.FeatureVector or satsense.features.Feature objects into an array that can be used for machine learning tasks.

The set should allow;

  • easy addition and removal of features or feature vectors
  • automatic reshaping from a number of feature vectors of shape (width, height, window_number, feature_length) into (n_samples, combined_feature_size)
  • support computing and loading from disk or mix of these operations
  • train/test/validation split

Enable doctests?

As a user
I want to read examples in the documentation that work
because I will have trouble using satsense if they don't

We should probably enable doctests, this can be done by adding --doctest-modules under addopts in setup.cfg.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.