7-Segment Display Recognition
A neural network that reads digits from 7-segment displays, reaching 99.79% test accuracy.
Machine LearningKerasPythonComputer Vision

7-Segment Display Recognition
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%.