Semantic Image Segmentation With CRFs

Semantic Image Segmentation With CRFs

Image Segmentation is performed on the MSRC-21 dataset. To use this, you’ll need to download and extract the MSRC dataset from here into the data/generated directory. This dataset contains the MSRC-21 labelled images, the extracted super-pixels using SLIC and its features.

The problem is formulated as CRF parameter learning. We use simple histogram features for the data term (unaries) and pairwise transitions. The maximization oracle performs loss-augmented decoding on a second-order factor graph using Loopy Belief Propagation through Factorie.

In order to run the example, you’ll need to execute the following command, from within the dissolve-struct-examples directory.

spark-1.X/bin/spark-submit \
  --class "ch.ethz.dalab.dissolve.examples.imageseg.ImageSegRunner" \
  --master local \
  --driver-memory 2G \
  <examples-jar-path>

This should take about 5-6 hours to obtain satisfactory results.

Alternatively, this can be run either on a subset of the original dataset, like so:

spark-1.X/bin/spark-submit \
  --class "ch.ethz.dalab.dissolve.examples.imageseg.ImageSegRunner" \
  --master local \
  --driver-memory 2G \
  <examples-jar-path> \
  --kwargs train=Train-small.txt,validation=Validation-small.txt

or by using only the unary features:

spark-1.X/bin/spark-submit \
  --class "ch.ethz.dalab.dissolve.examples.imageseg.ImageSegRunner" \
  --master local \
  --driver-memory 2G \
  <examples-jar-path> \
  --kwargs unaries=true

Both of these should finish execution in under 5 minutes.


Updated