hf_mirrors/crnn
Model Introduction
Files & versions
Analysis

CRNN Model Card

An End-to-End Trainable Neural Network for Image-based Sequence Recognition and Its Application to Scene Text Recognition

Introduction

Convolutional Recurrent Neural Network (CRNN) integrates CNN feature extraction and RNN sequence modeling as well as transcription into a unified framework.

As shown in the architecture graph (Figure 1), CRNN firstly extracts a feature sequence from the input image via Convolutional Layers. After that, the image is represented by a squence extracted features, where each vector is associated with a receptive field on the input image. For futher process the feature, CRNN adopts Recurrent Layers to predict a label distribution for each frame. To map the distribution to text field, CRNN adds a Transcription Layer to translate the per-frame predictions into the final label sequence. [1]

Figure 1. Architecture of CRNN [1]

Results

Training Perf.

According to our experiments, the training (following the steps in Model Training) performance and evaluation (following the steps in Model Evaluation) accuracy are as follows:

ModelContextBackboneTrain DatasetModel ParamsBatch size per cardGraph train 8P (s/epoch)Graph train 8P (ms/step)Graph train 8P (FPS)Avg Eval AccuracyDownload
CRNND910x8-MS1.8-GVGG7MJ+ST8.72 M162488.8222.065802.7182.03%ckpt
CRNND910x8-MS1.8-GResNet34_vdMJ+ST24.48 M642157.1876.486694.8484.45%ckpt
  • Detailed accuracy results for each benchmark dataset (IC03, IC13, IC15, IIIT, SVT, SVTP, CUTE):

    ModelBackboneIC03_860IC03_867IC13_857IC13_1015IC15_1811IC15_2077IIIT5k_3000SVTSVTPCUTE80Average
    CRNNVGG794.53%94.00%92.18%90.74%71.95%66.06%84.10%83.93%73.33%69.44%82.03%
    CRNNResNet34_vd94.42%94.23%93.35%92.02%75.92%70.15%87.73%86.40%76.28%73.96%84.45%

Inference Perf.

The inference performance is tested on Mindspore Lite, please take a look at Mindpore Lite Inference for more details.

DeviceEnvModelBackboneParamsTest DatasetBatch sizeGraph infer 1P (FPS)
Ascend310PLite2.0CRNNResNet34_vd24.48 MIC151361.09
Ascend310PLite2.0CRNNResNet34_vd24.48 MSVT1274.67

Notes:

  • Context: Training context denoted as {device}x{pieces}-{MS mode}, where mindspore mode can be G-graph mode or F-pynative mode with ms function. For example, D910x8-MS1.8-G is for training on 8 pieces of Ascend 910 NPU using graph mode based on Minspore version 1.8.
  • To reproduce the result on other contexts, please ensure the global batch size is the same.
  • The characters supported by model are lowercase English characters from a to z and numbers from 0 to 9. More explanation on dictionary, please refer to 4. Character Dictionary.
  • The models are trained from scratch without any pre-training. For more dataset details of training and evaluation, please refer to Dataset Download & Dataset Usage section.
  • The input Shapes of MindIR of CRNN_VGG7 and CRNN_ResNet34_vd are both (1, 3, 32, 100).

How to Get Started with the Model

For information on how to train and infer with the model, please have a look at MindOCR GitHub Repository.

References

[1] Baoguang Shi, Xiang Bai, Cong Yao. An End-to-End Trainable Neural Network for Image-based Sequence Recognition and Its Application to Scene Text Recognition. arXiv preprint arXiv:1507.05717, 2015.