Convolutional recurrent network with CTC

Recurrent · pattern · Image, Audio → Text

Convolutions turn an image line or waveform into a sequence of frames; a sequence model labels each frame; CTC collapses them into text.

Also called CRNN, CTC model, Conv + sequence + CTC

Figure 1. The Convolutional recurrent network with CTC as a schematic: the parts it is built from and how data flows between them. Select a part to read about it.

What it does

Reading a word or transcribing speech means producing a short string from a long input without knowing where each character starts. A CRNN first uses convolutions to turn a text-line image into a sequence of column features (or raw audio into frames), then a bidirectional LSTM or a transformer encoder gives each frame context from its neighbors. A dense layer outputs, for every frame, a distribution over the characters plus a special blank. Connectionist temporal classification (CTC) decoding takes the best label per frame, merges repeats and removes blanks, so “hh-e-ll-ll-o” becomes “hello”. Training sums over every frame alignment that spells the target.

Formula

f1..T = reshape(CNN(x))pt = softmax(W · BiLSTM(f)t + b) over characters ∪ {blank}text = removeblanks(mergerepeats(argmaxt pt))

Shapes and parameters

Shapes
Text line [N, 1, 32, 100] → features [N, 256, 1, 25] → frames [25, N, 256] → per-frame scores [25, N, 37].
Parameters
Convolutions plus the sequence model plus a frames × classes head. The example sequence model alone is a 1,052,672-parameter bidirectional LSTM.
Used for
CRNN English text recognition and Wav2Vec2 speech transcription in the catalog (Wav2Vec2 uses a transformer encoder over convolutional audio frames).

Figure 2. A real convolutional recurrent network with ctc in WeightSpace: Read text in an image, drawn from the file the app runs. Open a module to see the parts inside.

In WeightSpace

Both catalog models are edited at the per-character output bias, including the CTC blank: lowering the blank lets more characters through, and raising one letter makes it win close frames, within ±8.