When your neural network needs a grammar lesson
A 2015 ICCV winner gets a Keras facelift, but you'll need a C++ compiler and patience.

What it does
This is a Keras/TensorFlow reimplementation of CRF-RNN, a semantic segmentation method that stuffs a Conditional Random Field inside a recurrent neural network loop. Feed it an image; get back pixel-level class labels. The original Caffe version won Best Demo at ICCV 2015, and this port claims identical results.
The interesting bit
The CRF layer isn’t pure Python — it’s a custom TensorFlow op written in C++ that you compile with make. That means the “recurrent” part of RNN is actually hand-rolled C++ doing mean-field inference, not just stacked LSTM blocks. The repo also ships a live web demo and pre-trained weights, so you can skip training entirely.
Key highlights
- Claims bit-for-bit identical output to the original Caffe and newer PyTorch versions
- Only three core dependencies: TensorFlow, Keras, h5py (plus Pillow for the demo)
- Pre-trained model weights available as a release download — no training required to test
- GPU-accelerated CRF layer exists on a separate
gpu_supportbranch (CUDA 9 / TF 1.7 only, contributed externally)
Caveats
- Batch size is hardcoded to 1; no mini-batch training for you
- The custom C++ op build script is Linux/macOS only — Windows users are directed to a TensorFlow issues thread
- GPU support lives on an experimental branch with dated CUDA/TensorFlow requirements, not merged to main
Verdict
Worth a look if you’re reproducing older segmentation papers or need a CRF-RNN baseline in Keras. Skip it if you want modern batched training, Windows-native builds, or anything approaching state-of-the-art — this is a faithful 2015 port, not a refresh.