Questions tagged [ctc]

CTC or “connectionist temporal classification” is a machine learning technique for mapping dense input data to shorter output sequences in the same order.

85 questions
13
votes
2 answers

Using Tensorflow's Connectionist Temporal Classification (CTC) implementation

I'm trying to use the Tensorflow's CTC implementation under contrib package (tf.contrib.ctc.ctc_loss) without success. First of all, anyone know where can I read a good step-by-step tutorial? Tensorflow's documentation is very poor on this…
7
votes
1 answer

Understanding CTC loss for speech recognition in Keras

I am trying to understand how CTC loss is working for speech recognition and how it can be implemented in Keras. What i think i understood (please correct me if i'm wrong!) Grossly, the CTC loss is added on top of a classical network in order to…
5
votes
2 answers

How can I add the decode_batch_predictions() method into the Keras Captcha OCR model?

The current Keras Captcha OCR model returns a CTC encoded output, which requires decoding after inference. To decode this, one needs to run a decoding utility function after inference as a separate step. preds =…
leenremm
  • 1,083
  • 13
  • 19
5
votes
1 answer

Connectionist Temporal Classification (CTC) blank label

I am trying to use the CTC loss function in my network, but don't quite understand when to feed the 'blank' label as a label. I use it in gesture recognition as described byMolchanov, but what get's me confused that there is a 'no gesture' as…
Kilsen
  • 136
  • 2
  • 11
4
votes
2 answers

Tensorflow Callback as Custom Metric for CTC

In an attempt to yield more metrics during the training of my model (written in TensorFlow version 2.1.0), like the Character Error Rate (CER) and Word Error Rate (WER), I created a callback to pass to the fit function of my model. It is able to…
4
votes
2 answers

CTC: blank must be in label range

summary I'm adding alphabets to captcha recognition, but pytorch's CTC seems to not working properly when alphabets are added. What I've tried At first, I modified BLANK_LABEL to 62 since there are 62 labels(0-9, a-z, A-Z), but it gives me runtime…
ik1ne
  • 1,041
  • 15
  • 20
4
votes
1 answer

CTC: What is the difference between space and blank?

In the 2006 article about Connectionist Temporal Classification, Alex Graves & co. introduced a model of decoding speech with 27 labels: 26 for the alphabet letters and one for blank, meaning no label (which I understand to be silence). However, I…
3
votes
0 answers

What are the exact input parameters for tensorflow CTC-loss function (tf.nn.ctc_loss)?

class CTCLoss(keras.losses.Loss): def __init__(self, logits_time_major=False, blank_index=-1, reduction=keras.losses.Reduction.AUTO, name='ctc_loss'): super().__init__(reduction=reduction, name=name) self.logits_time_major…
3
votes
1 answer

Label alignment in RNN Transducer training

I am trying to understand how RNN Transducer is trained with ground truth labels. In case of CTC, I know that model is trained with loss function that sums up all scores of all possible alignments of the ground truth labels. But in RNN-T, the…
Surendra
  • 31
  • 1
  • 4
3
votes
2 answers

Is there a difference between "torch.nn.CTCLoss" supported by PYTORCH and "CTCLoss" supported by torch_baidu_ctc?

Is there a difference between "torch.nn.CTCLoss" supported by PYTORCH and "CTCLoss" supported by torch_baidu_ctc? i think, I didn't notice any difference when I compared the tutorial code. Does anyone know the true? Tutorial code is located…
서민석
  • 41
  • 2
  • 3
3
votes
0 answers

CTCBeamSearchDecoder thinks sequence_length of shape (2,) is not a vector

Trying to run a beam search in a Keras model, I get confusing (and conflicting?) error messages. My model has inputs such as inputs = Input(name='spectrograms', shape=(None, hparams["n_spectrogram"])) input_length =…
Anaphory
  • 6,045
  • 4
  • 37
  • 68
2
votes
0 answers

machine learning+deep learning+speech recognition

I run the code in my editor (VS Code) without any problems, but for next step and due to RAM and GPU limitation, I took it in colab, but got an error that seems to be due to mismatch of versions due to transfer from my editor to colab. how can i fix…
2
votes
0 answers

Shape change error in ctc_batch_cost function with TensorFlow 2.7.0

I have some code that generates a CTC layer which no longer works in TensorFlow 2.7.0 but works in 2.6.1. The code in question which is causing the problem is: class CTCLayer(layers.Layer): def __init__(self, name=None): …
pgov
  • 21
  • 3
2
votes
2 answers

How to correctly save and load a model with custom CTC layer (Keras example)

I am following this tutorial on Keras , but I don't know how to correctly save this model with custom layer after the training and load it. This problem has been mentioned in here and here but apparently non of those solutions work for this Keras…
2
votes
1 answer

Invalid argument:Not enough time for target transition sequence

i tried to run this HTR Model https://github.com/arthurflor23/handwritten-text-recognition but it gives me this error Invalid argument: Not enough time for target transition sequence. The problem, I think in ctc_batch_cost. My images dimensions Are…
1
2 3 4 5 6