House Number Detection and Classification
Overview
For my final project in CS6476 (Computer Vision) at Georgia Tech, I built a two-stage pipeline to locate and read house numbers in real-world street photos. Reading digits in the wild is much messier than MNIST: lighting varies widely, shadows cut across numbers, and brickwork or siding creates many false edges.
I split the problem into two pieces: classical computer vision for finding candidate digit regions, and a convolutional neural network trained on the Street View House Numbers (SVHN) dataset (over 600,000 labeled digits) to classify those crops and reject non-digit noise.
Approach
Step 1: Region detection (MSER + filtering)
I used OpenCV's Maximally Stable Extremal Regions (MSER) detector tuned to pick out individual characters rather than full words. Before detection, images are normalized with CLAHE so that uneven lighting and harsh shadows do not break region boundaries.
Because MSER detects a lot of background clutter, I filtered candidate bounding boxes in three passes:
- Aspect ratio: drop anything with an aspect ratio below
1or above3.5. - Edge density: drop regions where Canny edges cover 10% or less of the pixels.
- Cleanup: run non-maximum suppression (NMS), pad the surviving boxes into squares, and sort them left-to-right by their top-left
xcoordinate.
Step 2: Digit classification (SVHN CNN)
I trained the classifier on the full SVHN dataset—589,736 training images, 14,652 validation images, and 26,032 test images—on a single Nvidia RTX 3090 Ti. Each candidate crop from Step 1 is passed through the network, which outputs raw logits for digits 0–9. Taking the argmax gives the predicted digit, and any region whose max logit is <= 5.5 gets rejected as background noise. The remaining digits are concatenated left-to-right into the final house number.
Results and Analysis
The classifier itself worked well, while the classical region detector was brittle.
- Detection: Bold, high-contrast digits on clean backgrounds worked well, and CLAHE normalization noticeably helped on shadowed tiles (like the
"1"in Figure 1b split straight down the middle by shade). Thin fonts, blurry digits, and busy textures still caused MSER to miss digits, and strict geometric filters occasionally dropped real digits. - Model comparison: Fine-tuning a pretrained ResNet18 for 24 epochs outperformed VGG16 on both accuracy and speed: VGG16 took roughly six times longer per epoch and reached lower accuracy. Upscaling the original 32×32 SVHN crops to 224×224 outperformed native 32×32 color and grayscale models, and data augmentation improved generalization clearly (Figure 2).
All models used cross-entropy loss with a step scheduler that divided the learning rate by 10 every 7 epochs, starting at 3e-4 for Adam and 1e-2 for SGD.
On the SVHN test split, the final ResNet18 reached 98.421% accuracy. Every digit scored 98% or better except "5" at 97.9% (Figure 3).
Takeaways
Almost every end-to-end failure happened in Step 1, not Step 2. With the classifier already above 98.4%, squeezing another fraction of a percent out of SVHN would not improve end-to-end results nearly as much as replacing MSER with a learned text detector like EAST or CRAFT.
