Downloads · 30 days
0
Shad0wKillar/resnet18-crnn-ocr
resnet18-crnn-ocr is a image-to-text model from Shad0wKillar. Use it when you need a caption or text from an image. The card lists the license as mit.
This repository hosts a lightweight, high-performance Convolutional Recurrent Neural Network (CRNN) using a ResNet18 backbone for sequence-based handwritten text recognition (OCR). The model is optimized for processin…
Downloads · 30 days
0
Access
Public
Updated Jun 17, 2026
Repo size
59.1 MB
Likes
0
Public
Click a slice to open those files.
.pth58.6 MB · 99%
From the Hugging Face model README
This repository hosts a lightweight, high-performance Convolutional Recurrent Neural Network (CRNN) using a ResNet18 backbone for sequence-based handwritten text recognition (OCR). The model is optimized for processing line-level handwriting imagery and maps visual patterns directly to text strings using Connectionist Temporal Classification (CTC) decoding.
The model leverages a custom CNN-RNN hybrid architecture designed for sequence extraction:
layer3 and layer4 was modified (strides adjusted to (2, 1) and (1, 1)).conv1, bn1, layer1, and layer2 were frozen during training to retain low-level feature extraction capabilities.SeqToMap linear projection compresses the feature maps to 256 dimensions.The model was trained utilizing a highly optimized pipeline:
0.0006, utilizing a CosineAnnealingLR scheduler decaying to a minimum of 0.000003.CTCLoss (zero_infinity=True).96px.To ensure robust generalization against varying handwriting styles and scan qualities, the following augmentations were applied during training:
The model shows robust generalization and steep error reduction over the 40-epoch training horizon.
| Metric | Final Value |
|---|---|
| Train Loss | 0.2461 |
| Test Loss | 0.4371 |
| Train Character Error Rate (CER) | 6.67% |
| Test Character Error Rate (CER) | 11.48% |


The following visual samples display the original target text lines along with their respective ground truth labels, predicted text, and calculated Character Error Rates (CER).



