Commit 46cbfba8 authored by Davis King's avatar Davis King

Added a reference to a useful book

parent b2547b62
// The contents of this file are in the public domain. See LICENSE_FOR_EXAMPLE_PROGRAMS.txt // The contents of this file are in the public domain. See LICENSE_FOR_EXAMPLE_PROGRAMS.txt
/* /*
This is an example illustrating the use of the graph_labeler and This is an example illustrating the use of the graph_labeler and
structural_graph_labeling_trainer objects. structural_graph_labeling_trainer objects.
Suppose you have a bunch of objects and you need to label each of them as Suppose you have a bunch of objects and you need to label each of them as true or
true or false. Suppose further that knowing the labels of some of these false. Suppose further that knowing the labels of some of these objects tells you
objects tells you something about the likely label of the others. This something about the likely label of the others. This is common in a number of domains.
is common in a number of domains. For example, in image segmentation For example, in image segmentation problems you need to label each pixel, and knowing
problems you need to label each pixel, and knowing the labels of neighboring the labels of neighboring pixels gives you information about the likely label since
pixels gives you information about the likely label since neighboring pixels neighboring pixels will often have the same label.
will often have the same label.
We can generalize this problem by saying that we have a graph and our task We can generalize this problem by saying that we have a graph and our task is to label
is to label each node in the graph as true or false. Additionally, the each node in the graph as true or false. Additionally, the edges in the graph connect
edges in the graph connect nodes which are likely to share the same label. nodes which are likely to share the same label. In this example program, each node
In this example program, each node will have a feature vector which contains will have a feature vector which contains information which helps tell if the node
information which helps tell if the node should be labeled as true or false. should be labeled as true or false. The edges also contain feature vectors which give
The edges also contain feature vectors which give information indicating how information indicating how strong the edge's labeling consistency constraint should be.
strong the edge's labeling consistency constraint should be. This is useful This is useful since some nodes will have uninformative feature vectors and the only
since some nodes will have uninformative feature vectors and the only way to way to tell how they should be labeled is by looking at their neighbor's labels.
tell how they should be labeled is by looking at their neighbor's labels.
Therefore, this program will show you how to learn two things using machine learning.
Therefore, this program will show you how to learn two things using machine The first is a linear classifier which operates on each node and predicts if it should
learning. The first is a linear classifier which operates on each node and be labeled as true or false. The second thing is a linear function of the edge
predicts if it should be labeled as true or false. The second thing is a vectors. This function outputs a penalty for giving two nodes connected by an edge
linear function of the edge vectors. This function outputs a penalty differing labels. The graph_labeler object puts these two things together and uses
for giving two nodes connected by an edge differing labels. The graph_labeler them to compute a labeling which takes both into account. In what follows, we will use
object puts these two things together and uses them to compute a labeling a structural SVM method to find the parameters of these linear functions which minimize
which takes both into account. In what follows, we will use a structural
SVM method to find the parameters of these linear functions which minimize
the number of mistakes made by a graph_labeler. the number of mistakes made by a graph_labeler.
Finally, you might also consider reading the book Structured Prediction and Learning in
Computer Vision by Sebastian Nowozin and Christoph H. Lampert since it contains a good
introduction to machine learning methods such as the algorithm implemented by the
structural_graph_labeling_trainer.
*/ */
#include "dlib/svm_threaded.h" #include "dlib/svm_threaded.h"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment