2 days ago
- This chapter focuses on applying a convolutional neural network (CNN) to real-world handwritten character recognition, highlighting the difficulty compared to idealized datasets.
- Training uses a tool (tensor-convo-par.cc) with options like Adam optimizer, dropout, weight decay, and data augmentation, and saves progress to a state file.
- The real-world test image revealed that the MNIST dataset does not cover all handwriting styles, like the European 'h', causing poor recognition initially.
- Preprocessing of real images includes converting to grayscale, correcting white balance, segmenting text lines using intensity graphs, and boxing individual characters.
- For network input, characters are resized from varying dimensions to a 24x24 pixel area centered in a 28x28 grid, matching MNIST's empty outer pixels.
- The network is loaded with dropout disabled for inference, and the expected value is set to 'a' (0) as a placeholder during prediction.
- The final OCR program achieves recognition with some errors (e.g., 'L' misread as 'C'), but demonstrates functional end-to-end OCR in about 1800 lines of code.
- Key lessons include the importance of training data coverage, extensive preprocessing, and the efficiency of neural networks for OCR tasks.