{"id":20219917,"url":"https://github.com/cgre-aachen/bayseg","last_synced_at":"2025-04-10T16:03:02.623Z","repository":{"id":49433071,"uuid":"110952925","full_name":"cgre-aachen/bayseg","owner":"cgre-aachen","description":"An unsupervised machine learning algorithm for the segmentation of spatial data sets.","archived":false,"fork":false,"pushed_at":"2021-06-17T16:33:43.000Z","size":68629,"stargazers_count":63,"open_issues_count":8,"forks_count":15,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-03-24T13:44:29.539Z","etag":null,"topics":["bayesian-methods","gaussian-mixture-models","geophysics","gibbs-energy","gibbs-sampling","hidden-markov-models","machine-learning","markov-chain","mixture-model","python3","segmentation"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cgre-aachen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-16T09:44:00.000Z","updated_at":"2025-03-15T10:24:24.000Z","dependencies_parsed_at":"2022-08-29T09:20:12.868Z","dependency_job_id":null,"html_url":"https://github.com/cgre-aachen/bayseg","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cgre-aachen%2Fbayseg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cgre-aachen%2Fbayseg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cgre-aachen%2Fbayseg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cgre-aachen%2Fbayseg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cgre-aachen","download_url":"https://codeload.github.com/cgre-aachen/bayseg/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248249288,"owners_count":21072334,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bayesian-methods","gaussian-mixture-models","geophysics","gibbs-energy","gibbs-sampling","hidden-markov-models","machine-learning","markov-chain","mixture-model","python3","segmentation"],"created_at":"2024-11-14T06:44:15.041Z","updated_at":"2025-04-10T16:03:02.591Z","avatar_url":"https://github.com/cgre-aachen.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BaySeg\n\n\u003e Easy-to-use unsupervised spatial segmentation in Python.\n\n[![License: LGPL v3](https://img.shields.io/badge/License-LGPL%20v3-blue.svg)]()\n[![Python 3.6.x](https://img.shields.io/badge/Python-3.6.x-blue.svg)]()\n[![Build Status](https://travis-ci.org/cgre-aachen/bayseg.svg?branch=master)](https://travis-ci.org/cgre-aachen/bayseg)\n\n## Contents\n\n+ [Introduction](#introduction)\n+ [Examples](#examples)\n  - [1D: Segmentation of geophysical well log data](#1d-segmentation-of-geophysical-well-log-data)\n  - [2D: Combined segmentation of geophysical and remote sensing data](#2d-combined-segmentation-of-geophysical-and-remote-sensing-data)\n+ [Installation](#installation)\n  - [Dependencies](#dependencies)\n  - [Cloning directly from GitHub](#cloning-directly-from-github)\n+ [Getting Started](#getting-started)\n+ [References](#references)\n+ [Contact](#contact)\n\n## Introduction\n\nA Python library for unsupervised clustering of n-dimensional datasets, designed for the segmentation of one-, two- \nand three-dimensional data in the field of geological modeling and geophysics. The library is based on the algorithm \ndeveloped by [Wang et al., 2017](https://link.springer.com/article/10.1007/s11004-016-9663-9) and combines Hidden Markov\nRandom Fields with Gaussian Mixture Models in a Bayesian inference framework. It currently supports up to two physical \ndimension and is in an early development stage.\n \n## Examples\n\n\n\n### 1D: Segmentation of geophysical well log data\n\n![alt text](data/figures/front_gif.gif)\n\n(Above well log data used from machine learning contest of [Hall, 2016](https://library.seg.org/doi/abs/10.1190/tle35100906.1))\n\n### 2D: Combined segmentation of geophysical and remote sensing data\n\nYou can try out how BaySeg segments 2D data sets by using an interactive Jupyter Notebook in your own web browser, enabled by Binder:\n\n[![Binder](https://mybinder.org/badge.svg)](https://mybinder.org/v2/gh/cgre-aachen/bayseg/master?filepath=notebooks%2Ftr32_presentation_example.ipynb)\n\n\n## Installation\n\nAs the library is still in early development, the current way to install it is to clone this repository\nand then import it manually to your projects. We plan to provide convenient installation using PyPi in the future.\n\n#### Dependencies\n\nBaySeg depends on several genius components of the Python eco-system:\n\n* `numpy` for efficient numerical implementation\n* `scikit-learn` for mixture models\n* `scipy` for its statistical functionality\n* `matplotlib` for plotting\n* `tqdm` provides convenient progress meters\n\n#### Cloning directly from GitHub\n\nFirst clone the repository using the command (or by manually downloading the zip file from the GitHub page)\n\n    git clone https://github.com/cgre-aachen/bayseg.git\n\nthen append the path to the repository:\n    \n    import sys\n    sys.path.append(\"path/to/cloned/repository/bayseg\")\n    \nto import the module:\n\n    import bayseg\n\n## Getting Started\n\nInstantiate the classifier with the n-dimensional array storing the data and the number of labels:\n\n    clf = bayseg.BaySeg(data_ndarray, n_labels)\n    \nThen use the _fit()_ method to classify your data with your desired number of iterations:\n\n    clf.fit(n_iter)\n\n## References\n\n* Wang, H., Wellmann, J. F., Li, Z., Wang, X., \u0026 Liang, R. Y. (2017). A Segmentation Approach for Stochastic Geological Modeling Using Hidden Markov Random Fields. Mathematical Geosciences, 49(2), 145-177.\n* Wang, H., Wellmann, F., Zhang, T., Schaaf, A., Kanig, R. M., Verweij, E., ... \u0026 van der Kruk, J. (2019). Pattern Extraction of Topsoil and Subsoil Heterogeneity and Soil‐Crop Interaction Using Unsupervised Bayesian Machine Learning: An Application to Satellite‐Derived NDVI Time Series and Electromagnetic Induction Measurements. Journal of Geophysical Research: Biogeosciences.\n* Wang, H. (2020). Finding patterns in subsurface using Bayesian machine learning approach. Underground Space, 5(1), 84-92.\n* Herbert, C., Camps, A., Wellmann, F., \u0026 Vall‐llossera, M. (2021). Bayesian unsupervised machine learning approach to segment Arctic sea ice using SMOS data. Geophysical Research Letters, 48(6).\n* Hall, B. (2016). Facies classification using machine learning. The Leading Edge, 35(10), 906-909.\n\n## Contact\n\nThe library is based on research [Hui Wang](https://www.researchgate.net/profile/Hui_Wang122) and [Florian Wellmann](http://www.cgre.rwth-aachen.de/go/id/qpan/lidx/1/gguid/0x5440F5A53D654C41874F09C577FE4005) for a research project in the German Collaborative Research Center [SFB TR32](http://www.tr32db.uni-koeln.de/site/index.php). It was rewritten in Python from a Matlab code by [Alexander Schaaf](https://www.researchgate.net/profile/Alexander_Schaaf4).\n\nBayseg is currently being developed by the LuF Computational Geoscience and Reservoir \nEngineering (CGRE) and the Aachen Institute for Advanced Study in Computational Engineering Science (AICES) at RWTH Aachen University, Germany.\n\nFor more information and contacts, please see: http://www.cgre.rwth-aachen.de/\n\n![CGRE RWTH Aachen](data/figures/rwth_geoscience_rgb.jpg)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcgre-aachen%2Fbayseg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcgre-aachen%2Fbayseg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcgre-aachen%2Fbayseg/lists"}