Some thoughts on training LeNet

Since my last blog post Training LeNet on Armenian script, I have made some significant improvement to the training process. Model simplification The model takes as input a mean and standard deviation for normalizing pixel intensities. These values are calibrated on the training set before initiating the gradient descent loop for adjusting the weights and biases. To make things simpler, I hardcoded those parameters. This way the dependency between model and training set only happens in the gradient descent loop....

December 30, 2023 · 4 min · 694 words · v4nn4

Training LeNet-5 on Armenian script

Following Tinkering with Tesseract, I wanted to gain a better understanding of how OCR systems work. So, I decided to start with building my own character recognition engine using PyTorch. The code is available at v4nn4/hynet. Generating a dataset First, we visualize the alphabet in our target font, Mk_Parz_U-Italic : from PIL import Image, ImageDraw, ImageFont import matplotlib.pyplot as plt caps = range(0x531, 0x557) smalls = range(0x561, 0x588) letters = [f"{chr(a)}{chr(b)}" for (a, b) in zip(caps, smalls)] letters = [" "....

October 16, 2023 · 8 min · 1666 words · v4nn4