{"id":13570699,"url":"https://github.com/cvjena/libmaxdiv","last_synced_at":"2026-01-28T12:41:52.754Z","repository":{"id":143048818,"uuid":"75816916","full_name":"cvjena/libmaxdiv","owner":"cvjena","description":"Implementation of the Maximally Divergent Intervals algorithm for Anomaly Detection in multivariate spatio-temporal time-series.","archived":false,"fork":false,"pushed_at":"2021-05-25T10:13:55.000Z","size":44269,"stargazers_count":63,"open_issues_count":0,"forks_count":13,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-09-10T07:39:39.064Z","etag":null,"topics":["anomalydetection","anomalydiscovery","data-analysis","data-mining","datamining","machine-learning","machine-learning-library","machinelearning","time-series","timeseries"],"latest_commit_sha":null,"homepage":null,"language":"C++","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/cvjena.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-12-07T08:46:22.000Z","updated_at":"2025-06-14T13:36:18.000Z","dependencies_parsed_at":"2023-04-13T09:21:32.595Z","dependency_job_id":null,"html_url":"https://github.com/cvjena/libmaxdiv","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/cvjena/libmaxdiv","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cvjena%2Flibmaxdiv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cvjena%2Flibmaxdiv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cvjena%2Flibmaxdiv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cvjena%2Flibmaxdiv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cvjena","download_url":"https://codeload.github.com/cvjena/libmaxdiv/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cvjena%2Flibmaxdiv/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28845282,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T12:37:07.070Z","status":"ssl_error","status_checked_at":"2026-01-28T12:37:06.657Z","response_time":57,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["anomalydetection","anomalydiscovery","data-analysis","data-mining","datamining","machine-learning","machine-learning-library","machinelearning","time-series","timeseries"],"created_at":"2024-08-01T14:00:54.330Z","updated_at":"2026-01-28T12:41:52.732Z","avatar_url":"https://github.com/cvjena.png","language":"C++","funding_links":[],"categories":["📦 Packages"],"sub_categories":["Python"],"readme":"Maximally Divergent Intervals for Anomaly Detection\n===================================================\n\nThe **Maximally Divergent Intervals (MDI) Algorithm** can be used to detect anomalous *intervals* (as opposed to\nanomalous points) in multi-variate spatio-temporal time-series. A description of the algorithm along with a variety\nof application examples can be found in the following article:\n\n\u003e [**Detecting Regions of Maximal Divergence for Spatio-Temporal Anomaly Detection.**][paper]  \n\u003e Björn Barz, Erik Rodner, Yanira Guanche Garcia, Joachim Denzler.  \n\u003e *IEEE Transactions on Pattern Analysis and Machine Intelligence, 2018*.\n\nAn efficient C++ implementation called `libmaxdiv` is provided in `maxdiv/libmaxdiv` and may be used stand-alone. If it has been\nbuilt in `maxdiv/libmaxdiv/bin`, it will be used automatically by the GUI and the `maxdiv` function in the `maxdiv.maxdiv` Python\npackage. See [`maxdiv/libmaxdiv/README.md`](maxdiv/libmaxdiv/README.md) for build instructions.  \nOtherwise, the pure Python implementation of the MDI algorithm will be used, which is not recommended, since it is extremely slow\nand lacks some features such as support for spatial data.\n\nThe directories `experiments` and `tools` contain some benchmarks, experiments and scripts we've been using for development and\nevaluation of the algorithm; for example, detecting severe North Sea storms like the Hamburg-Flut shown below.\nYou don't need those directories if you just want to use `libmaxdiv`.\n\n![Hamburg-Flut](https://cvjena.github.io/libmaxdiv/coastdat_det_aggregated_00%20(Hamburg-Flut).gif)\n\nMore examples of what can be done with the MDI algorithm can be found on the [project page](https://cvjena.github.io/libmaxdiv/)\nand in the article mentioned above.\n\n\nGUI\n---\n\n![GUI](https://user-images.githubusercontent.com/7915048/38293859-49f3eeb4-37e9-11e8-9b67-00c0f487ec01.png)\n\n\nDependencies of the Python implementation and the GUI\n-----------------------------------------------------\n\n- Python \u003e= 2.7 or Python 3\n- `numpy`\n- `matplotlib`\n- `scipy`\n- `scikit-learn \u003c= 0.19`\n- `PIL`/`Pillow`\n\n`libmaxdiv` has its own dependencies in addition. Please refer to [`maxdiv/libmaxdiv/README.md`](maxdiv/libmaxdiv/README.md) for build instructions.\n\n\nGetting started\n---------------\n\nAfter having installed the dependencies mentioned above and built `libmaxdiv` according to the instructions in `maxdiv/libmaxdiv/README.md`,\njust run `python launch-gui.py` to start the interactive interface.  \nIf you are using Windows, pre-built binaries of the `libmaxdiv` library are available, so that it can be used out of the box.\nHowever, the default `launch-gui.py` script will always search for self-built libraries only. To use the pre-built ones, launch the GUI by\nrunning `python win32\\launch-gui.py` instead.\n\nA comprehensive installation guide and user manual for the GUI can be found in [`libmaxdiv user guide.pdf`](libmaxdiv%20user%20guide.pdf).\n\nYou may also use the maxdiv algorithm programmatically via the [`maxdiv`](maxdiv/maxdiv.py#L733) function in the [`maxdiv.maxdiv`](maxdiv/maxdiv.py)\npackage or by using the `libmaxdiv` library directly from your application. It provides a C-style procedural interface defined in\n[`libmaxdiv.h`](maxdiv/libmaxdiv/libmaxdiv.h) for maximum inter-operability.\n\nNote that not all functions of `libmaxdiv` are made available through the high-level interface `maxdiv` python function in the `maxdiv.maxdiv` package.\nIn particular, it can only process temporal, but not spatio-temporal data.\nHowever, you can still use python to interact with `libmaxdiv` by calling the C-style functions defined in [`libmaxdiv.h`](maxdiv/libmaxdiv/libmaxdiv.h)\nfrom python using the wrapper provided in [`maxdiv.libmaxdiv_wrapper`](maxdiv/libmaxdiv_wrapper.py).\n\n### A simple step-by-step example for using the GUI\n\nIn this simple example, we will use the graphical user interface (GUI) for detecting hurricanes in a non-spatial time-series comprising measurements\nof significant wave height (Hs), sea level pressure (SLP), and wind speed (W). The measurements have been taken in 2012 at a location near the\nBahamas and are provided by [NOAA](http://www.ndbc.noaa.gov/).\n\nThe hurricane season was particularly active in that year and 3 major hurricanes passed the Bahamas: Isaac (August 22-25), Rafael (October 12-18),\nand Sandy (October 22-29).\n\nWe have already converted the data to the correct format for the libmaxdiv GUI and provide it in the file\n[`experiments/HPW_2012_41046_standardized.csv`](experiments/HPW_2012_41046_standardized.csv).\n\nFirst, we launch the user interface loading that file directly on start-up by running the following command on the command line:\n\n    python launch-gui.py experiments/HPW_2012_41046_standardized.csv\n\nYou may also omit the argument and will then be prompted to select the file using a dialog window.\n\nSince the measured variables have very different scales, it is a bit difficult to see anything in the plot of the time-series.\nThus, we first check the box labeled \"Plot pre-processed instead of original data\", which will show a normalized version of the time-series,\nwhich is also used by `libmaxdiv`.\n\nSince hurricanes usually last at least 12 hours and are considered two independent storms if they last longer than 3 days, we set the \"minimum\ninterval length\" to 12 and the \"maximum interval length\" to 72.\nIn order to keep the visualization clean and the analysis easy, we set the \"number of detections\" to 5.\n\nAfter hitting the \"Detect Anomalous Intervals\" button, the time-series will be overlayed with the top 5 detections, shown as red regions.\nThe first three detections should correspond to the three hurricanes mentioned above.\n\nYou can use the buttons next to the visualization for zooming and panning or navigating between the individual detections.\n\n\n[paper]: https://ieeexplore.ieee.org/document/8352745/","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcvjena%2Flibmaxdiv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcvjena%2Flibmaxdiv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcvjena%2Flibmaxdiv/lists"}