Direct Graphical Models (DGM) C++ library, a simple-to-use Conditional Random Fields library, which is optimized for parallel computing and includes modules for feature extraction, classification and visualization.
C++ CMake Batchfile Shell GLSL
Clone or download
Latest commit a8ec9bf Jul 12, 2018

Direct Graphical Models C++ library

License Version Build status

DGM is a cross-platform C++ library implementing various tasks in probabilistic graphical models with pairwise dependencies. The library aims to be used for the Markov and Conditional Random Fields (MRF / CRF), Markov Chains, Bayesian Networks, etc. Specifically, it includes a variety of methods for the following tasks:

  • Learning: Training of unary and pairwise potentials
  • Inference / Decoding: Computing the conditional probabilities and the most likely configuration
  • Parameter Estimation: Computing maximum likelihood (or MAP) estimates of the parameters
  • Evaluation / Visualization: Evaluation and visualization of the classification results
  • Data Analysis: Extraction, analysis and visualization of valuable knowlage from training data
  • Feature Engineering: Extraction of various descriptors from images, which are useful for classification

These tasks are optimized for speed, i.e. high-efficient calculations. The code is written in optimized C++14, compiled with Microsoft Visual Studio and can take advantage of multi-core processing as well as GPU computing. DGM is released under a BSD license and hence it is free for both academic and commercial use.

Check out the project site for all the details like

Please join the DGM-user Q&A forum to ask questions and talk about methods and models. Framework development discussions and thorough bug reports are collected on Issues.


  • DGM - the main library
  • FEX - feature extraction module
  • VIS - visualization module

License and Citation

DGM is released under the BSD 3-Clause license. The Project-X reference models are released for unrestricted use.

Please cite DGM in your publications if it helps your research:

	author = {Kosov, Sergey},
	title = {Direct Graphical Models C++ library},
	year = {2013},