7-Segment Display Recognition

A neural network that reads digits from 7-segment displays, reaching 99.79% test accuracy.

Machine LearningKerasPythonComputer Vision
A digital multimeter displaying bright 7-segment digits

A multilayer perceptron that classifies digits (0–9) from images of 7-segment displays. After systematically testing 27 training runs across image sizes, hidden-layer widths, and preprocessing methods, the best configuration reached 99.79% test accuracy.

Best model

  • Preprocessing: Sauvola thresholding combined with HOG (Histogram of Oriented Gradients) on 128Γ—128 images
  • Architecture: single hidden layer of 128 ReLU units, 10-way softmax output
  • Training: Adam optimizer, categorical cross-entropy, 50 epochs, batch size 250
  • Result: test accuracy 0.9979, test loss 0.0308

What the experiments showed

  • Sauvola + HOG preprocessing at 128Γ—128 dominated the leaderboard; the top nine runs all used it.
  • Larger input resolution helped: 128Γ—128 consistently beat 32Γ—32 and 64Γ—64.
  • Raw grayscale without preprocessing topped out around 98%, while Sauvola-only at 128Γ—128 was the weakest at 77.5%.