CRNN<T>

Models & Types · AiDotNet.ComputerVision.OCR.Recognition

CRNN (Convolutional Recurrent Neural Network) for text recognition.

Inheritance: ModelBase<T, Tensor<T>, Tensor<T>> → VisionTaskModelBase<T> → OCRBase<T> → CRNN<T>

Implements: IGeneratedParameterRegistrar<T>

For Beginners

CRNN combines CNNs for visual feature extraction with RNNs (specifically LSTM) for sequence modeling. It’s trained with CTC loss to handle variable-length text without requiring character-level alignment.

How It Works

Key features:

  • CNN backbone for visual features
  • Bidirectional LSTM for sequence modeling
  • CTC (Connectionist Temporal Classification) decoding
  • Handles variable-length text naturally

Reference: Shi et al., “An End-to-End Trainable Neural Network for Image-based Sequence Recognition and Its Application to Scene Text Recognition”, TPAMI 2017

Constructors

Constructor Summary
CRNN(OCROptions<T> options) Creates a new CRNN text recognizer.

Properties

Property Summary
string Name { get; }

Methods

Method Summary
OCRResult<T> Recognize(Tensor<T> image)
Task LoadWeightsAsync(string pathOrUrl, CancellationToken cancellationToken)
long GetParameterCount()
void SaveWeights(string path)
void SetTrainingMode(bool training)
void Train(Tensor<T> input, Tensor<T> expectedOutput) Runs one training step with the CTC loss.