YOLOv2 in Keras: swap the backbone, keep the raccoons
A configurable YOLOv2 implementation that lets you trade accuracy for speed by swapping in MobileNet, SqueezeNet, or other lightweight backends.

What it does This is a Keras/TensorFlow implementation of YOLOv2 with a twist: you can swap out the feature-extraction backbone. Train a custom object detector on your own dataset by pointing a JSON config file at four folders of images and VOC-format annotations. The code handles the rest—anchor generation, warmup training, and early stopping when validation loss plateaus.
The interesting bit The README is admirably honest about its limitations. The COCO evaluation shows 28.6 mAP versus 42.1 on released weights—a significant gap—yet the project ships with a browser-based raccoon demo running DeepLearn.js on MobileNet. It’s a teaching tool that happens to work in production, not the reverse.
Key highlights
- Supports Full YOLO, Tiny YOLO, MobileNet, SqueezeNet, InceptionV3, and ResNet50 backends
- One-class training made simple: set
labelsto["dog"]and ignore everything else in a multi-class dataset - Warmup training forces anchor box sizes to match for the first N epochs, an empirical trick the author claims improves precision
- Pretrained backend weights are mandatory—the code won’t run without them in the repo root
- Includes working examples: raccoons, kangaroos, red blood cells, hands, and self-driving car scenarios
Caveats
- No multi-GPU or multiscale training yet; both are on the unchecked todo list
- The browser demo “somehow breaks in Window” [sic]
- mAP evaluation code lives in a GitHub issue, not the repo itself
Verdict Good for researchers or hobbyists who want to understand YOLOv2 internals and need a lightweight detector fast. Skip it if you need state-of-the-art COCO performance out of the box.