Data Validation
Although the model performs well in a test environment, practice is the sole criterion for testing truth. In this section, we use our own model to compare and validate against test data from JD.com.
There are two components to measuring the quality of an OCR system: (1) whether it successfully boxes the text; (2) whether it successfully recognizes the boxed text. We adopt a scoring method to evaluate the recognition effect of each image. The scoring rules are as follows:
If the detected text area matches the box file of the detection sample provided by JD.com, 1 point is added. If the text is correctly recognized, an additional 1 point is added. Finally, the score for each image is the total points divided by the total number of characters.
According to this rule, the maximum score for each image is 2 points, and the minimum is 0 points. If the score exceeds 1, it indicates that the recognition effect is relatively good. After comparison with JD.com’s test data, our model achieved an average score of approximately 0.84, which is passable.
Model Summary
In this article, our goal was to establish a complete OCR system. After a series of efforts, we have basically achieved this goal.
When designing the algorithms, we closely integrated our basic assumptions, starting from the perspective of mimicking human visual recognition. We hoped to achieve the goal with the minimum number of steps; this philosophy is fully reflected in the feature extraction and text localization parts. Similarly, due to our preference for simplicity and manual simulation, we chose a Convolutional Neural Network (CNN) model for optical character recognition, which achieved a high accuracy rate. Finally, combined with a language model, we improved the results using a relatively simple approach via dynamic programming.
After testing, our system shows good results for the recognition of printed text and can serve as a text recognition tool for images on platforms such as e-commerce and WeChat. A notable feature is that our system can take an entire text image as input and achieve good results even when the resolution is not high.
Reflections on Results
Among the algorithms involved in this article, a major shortcoming is the presence of many "empirical parameters," such as the choice of the h parameter during clustering, the density threshold in the definition of low-density areas, the number of convolution kernels in the CNN, and the number of hidden layer nodes. Since there were not enough labeled samples for research, these parameters could only be derived based on experience and a small number of samples. We look forward to having more labeled data to obtain the optimal values for these parameters.
Furthermore, there is still much room for improvement in identifying text regions. Although we removed most non-text areas in just a few steps, these steps are still not intuitive enough and urgently need simplification. We believe that a good model should be able to achieve decent results based on simple assumptions and steps. Therefore, one of the efforts worth making is to simplify assumptions and reduce the workflow.
In addition, regarding text segmentation, there is actually no automatic segmentation algorithm that can handle all situations; thus, there is significant room for improvement in this step. According to relevant literature, single-line text can be recognized directly through a CNN+LSTM model, but this requires a large number of training samples and high-performance training machines, which is likely only achievable by large enterprises.
Clearly, there is still much work that requires more in-depth research.
When reprinting, please include the original address of this article: https://kexue.fm/archives/3854
For more detailed reprinting matters, please refer to: Scientific Space FAQ