A method and system for ancient Chinese character recognition in natural scenes based on deep learning

By constructing a natural scene ancient Chinese character detection and recognition data set, using DBNet and ResNet models combined with perspective transformation and approximate binary activation function, the difficulty of ancient Chinese character recognition in natural scenes is solved, and high-accuracy ancient Chinese character recognition is achieved to assist reading. and study ancient Chinese character documents.

CN114120333BActive Publication Date: 2024-08-23WUHAN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111432401.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-29
Publication Date
2024-08-23
Estimated Expiration
2041-11-29

AI Technical Summary

Technical Problem

Existing technology is difficult to accurately identify ancient Chinese characters in natural scenes. It lacks a complete ancient Chinese character data set and application value. Moreover, learning ancient Chinese characters is a time-consuming and laborious process, resulting in most people not having the ability to recognize ancient Chinese characters.

Method used

By constructing a natural scene ancient Chinese character detection data set and a recognition data set, using the DBNet text detection model and the ancient Chinese character recognition model of the ResNet network structure, combined with perspective transformation and approximate binary activation function, the ancient Chinese character outlines are extracted and recognized, and simplified characters are generated. Chinese character output.

Benefits of technology

It achieves high-accuracy detection and recognition of ancient Chinese characters in natural scene images, assists in reading ancient Chinese character documents, provides underlying technical support for ancient Chinese character-related applications, and helps people understand and learn ancient Chinese characters.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114120333B
    Figure CN114120333B
Patent Text Reader

Abstract

The present invention provides a method and system for recognizing ancient Chinese characters in natural scenes based on deep learning. The method steps are as follows: first, construct a natural scene ancient Chinese character detection and recognition data set, which is used to train the ancient Chinese character detection and recognition model, then detect the position of the ancient Chinese characters in the image, and recognize the character content after image correction. The system includes a user terminal and a cloud server, which are connected in communication; the user terminal is used to obtain the user's control instructions and call data from the cloud server according to the control instructions; the cloud server includes an ancient Chinese character detection and recognition module, an image correction module, a text query module, a result feedback module and a data storage module. The method and system can accurately recognize ancient Chinese characters in natural scene images, can assist in reading ancient Chinese character documents and realize the digitization of ancient Chinese character documents, and provide underlying technical support for applications related to ancient Chinese characters.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of ancient Chinese character recognition, and in particular to a method and system for recognizing ancient Chinese characters in natural scenes based on deep learning. Background Art

[0002] Writing is an important carrier of information. When Chinese characters were created thousands of years ago, they took on the responsibility of carrying Chinese culture. They have been accompanying Chinese culture and have jointly written an immortal chapter of Chinese civilization. At present, ancient Chinese characters still often appear in calligraphy and painting, seals, couplets, plaques and other scenes, but only a few experts or enthusiasts who have mastered the professional knowledge of ancient Chinese characters can accurately read these ancient Chinese characters.

[0003] Since ancient Chinese characters rarely appear in daily life, and learning ancient Chinese characters is a time-consuming and laborious training and memorization process, most people do not have the ability to recognize ancient Chinese characters. With the continuous development of machine learning and deep learning algorithms, the accuracy of computer recognition of simplified Chinese characters is getting higher and higher. However, the detection and recognition of ancient Chinese characters is much more difficult than simplified Chinese characters. At present, the research on ancient Chinese character recognition has just started, there is no complete ancient Chinese character data set, and the existing ancient Chinese character recognition applications can only recognize text from a single text image, which lacks application value. Allowing computers to detect and recognize all ancient Chinese characters in natural scene images can assist in reading ancient Chinese character documents and realize the digitization of ancient Chinese character documents, providing underlying technical support for applications related to ancient Chinese characters, and has broad application prospects and development space.

[0004] In view of this, this solution provides a method and system for ancient Chinese character recognition in natural scenes based on deep learning. Summary of the invention

[0005] To achieve the above objectives, the present invention is implemented through the following technical solutions:

[0006] A method for recognizing ancient Chinese characters in natural scenes based on deep learning, comprising the following steps:

[0007] S1: Construct a natural scene ancient Chinese character detection dataset and a natural scene ancient Chinese character recognition dataset;

[0008] S2: Use the natural scene ancient Chinese character detection dataset to train the DBNet text detection model, and use the natural scene ancient Chinese character recognition dataset to train the ancient Chinese character recognition model;

[0009] S3: Input the image to be detected into the trained ancient Chinese character detection model, output the probability map and the adaptive threshold map, subtract the two maps element by element, and the difference map is approximated by the differentiable binary activation function f(x)=1 / (1+e -kx) to obtain an approximate binary image, extract the target contour in the image, and approximate it with a rotated rectangle. Output the coordinates of the four points in the quadrilateral area of ​​all single ancient Chinese characters;

[0010] S4: According to the ancient Chinese character detection result, the ancient Chinese character image block is taken out from the original image, and corrected into a square using perspective transformation to obtain the image correction result. Specifically, the parameters of the perspective transformation matrix M are first calculated using the coordinates of the four points output in S3 and the four points of the square with a preset side length, and the formula is as follows:

[0011]

[0012] Then, based on the perspective transformation matrix, the shape of the ancient Chinese character image block is corrected to a square. The formula is as follows:

[0013]

[0014] S5: Input the corrected ancient Chinese character image block into the trained ancient Chinese character recognition model for recognition, output the character probability vector, normalize the text recognition results through the softmax function, select the one with the highest probability as the prediction result, and finally obtain the simplified Chinese character corresponding to the ancient Chinese character.

[0015] The natural scene ancient Chinese character detection dataset in S1 is obtained by field shooting and network acquisition, and the labels are the four point coordinates of the quadrilateral area of ​​all single ancient Chinese characters in the image. The natural scene ancient Chinese character recognition dataset includes a real scene image and a synthetic image obtained by an image synthesis method for the natural scene ancient Chinese character recognition dataset, and the image synthesis method includes the following steps:

[0016] S6: Acquire ancient Chinese character images;

[0017] S7: Acquire natural scene texture image;

[0018] S8: Randomly perform geometric and color transformations on the ancient Chinese character image, and randomly select the natural scene texture image as the background, and superimpose them to obtain a composite image, with the label being the corresponding simplified Chinese character.

[0019] The real scene images are obtained through field shooting and network acquisition.

[0020] The S2 ancient Chinese character recognition model is a ResNet network structure, and the loss function used in training is a cross entropy loss function. The loss function used in ancient Chinese character detection model training is a weighted sum of a cross entropy loss function and an L1 loss function.

[0021] The S6 ancient Chinese character image only contains a single ancient Chinese character, and the character is the ancient Chinese character corresponding to the character included in the GB / T 2312-1980 national standard, and the script forms include seal script, official script, cursive script, running script and regular script.

[0022] The system includes a user terminal and a cloud server, which are communicatively connected;

[0023] The user terminal is used to obtain a user's control instruction and call data from the cloud server according to the control instruction;

[0024] The cloud server includes

[0025] The ancient Chinese character detection and recognition module uses a natural scene ancient Chinese character recognition method based on deep learning, and obtains the coordinates of all single ancient Chinese character quadrilateral areas in the image and their corresponding simplified Chinese characters according to the image query information of the user terminal;

[0026] A text query module, used to obtain query information of a single simplified Chinese character of a user terminal, and retrieve detailed information of the single simplified Chinese character from the data storage module, wherein the detailed information includes pinyin, number of strokes, radical, five-stroke, detailed explanation, antonym, synonym, English translation, example sentence and corresponding ancient Chinese character style image, wherein the style image includes seal script, official script, cursive script, running script and regular script images;

[0027] A result feedback module is used to obtain improvement suggestions for the user terminal, including the user terminal display interface, user terminal function design and recognition result evaluation;

[0028] Data storage module: stores historical query records of user terminals, including user account, query date, query location, query content and query results; allows user terminals to query and delete historical query records; stores the results fed back by user terminals.

[0029] The user terminal is a mobile phone or a PC.

[0030] The user terminal can run the WeChat public account, WeChat applet and APP of the system.

[0031] According to the above technical solution, the beneficial effects of the present invention are:

[0032] (1) The natural scene ancient Chinese character recognition method based on deep learning designed by the present invention can detect and recognize all ancient Chinese characters in natural scene images, and provide underlying technical support for applications related to ancient Chinese characters. The recognition of ancient Chinese characters is much more difficult than that of simplified Chinese characters, and the construction of data sets requires the annotators to have a lot of ancient Chinese character professional knowledge. This solution solves the problem of lack of image data by synthesizing a large number of ancient Chinese character images by computer, and has a high recognition accuracy rate.

[0033] (2) The ancient Chinese character recognition system designed by the present invention can help people recognize ancient Chinese characters and learn relevant knowledge about ancient Chinese characters. More importantly, it can assist relevant professional enthusiasts and researchers in reading ancient Chinese character documents and realize the digitization of ancient Chinese character documents. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 This is a flow chart of the natural scene ancient Chinese character recognition method of the present invention.

[0035] Figure 2 This is a principle block diagram of the ancient Chinese character recognition system structure of the present invention. DETAILED DESCRIPTION

[0036] The specific implementation of the present invention is described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation described here is only used to illustrate and explain the present invention, and is not used to limit the present invention.

[0037] Figure 1 This is a flow chart of the natural scene ancient Chinese character recognition method of the present invention.

[0038] like Figure 1 As shown, the method of this embodiment includes the following steps:

[0039] Step 1: Build a natural scene ancient Chinese character detection dataset and a natural scene ancient Chinese character recognition dataset.

[0040] The natural scene ancient Chinese character detection dataset is obtained through field photography and the Internet. The labels are the coordinates of the four points of the quadrilateral area of ​​all single ancient Chinese characters in the image.

[0041] The natural scene ancient Chinese character recognition dataset contains real scene images and synthetic images. The labels required for training are the simplified Chinese characters corresponding to the ancient Chinese characters.

[0042] The method for synthesizing ancient Chinese character images comprises the following steps:

[0043] S6: Acquire an ancient Chinese character image, where the image contains only a single ancient Chinese character, and the character is the ancient Chinese character corresponding to the characters included in the national standard GB / T 2312-1980, and the script forms include seal script, official script, cursive script, running script and regular script;

[0044] S7: Acquire natural scene texture image;

[0045] S8: Randomly perform geometric and color transformations on the ancient Chinese character image, and randomly select the natural scene texture image as the background, and superimpose them to obtain a composite image, with the label being the corresponding simplified Chinese character.

[0046] Step 2: Use the natural scene ancient Chinese character detection dataset to train the ancient Chinese character detection model, and use the natural scene ancient Chinese character recognition dataset to train the ancient Chinese character recognition model.

[0047] The ancient Chinese character detection model uses the DBNet text detection model.

[0048] The ancient Chinese character recognition model adopts the ResNet network structure.

[0049] Step three: Use the trained ancient Chinese character detection model to detect ancient Chinese characters in the image and obtain the ancient Chinese character detection results.

[0050] The image to be detected is input into the trained ancient Chinese character detection model, and the probability map and the adaptive threshold map are output. The two maps are subtracted element by element, and the difference map is approximated by the differentiable binary activation function f(x)=1 / (1+e -kx ) to obtain an approximate binary image, in which the target contour is extracted and approximated by a rotated rectangle. Output the coordinates of the four points in the quadrilateral area of ​​all single ancient Chinese characters.

[0051] Step 4: Perform image correction using perspective transformation based on the ancient Chinese character detection result to obtain the image correction result.

[0052] According to the ancient Chinese character detection result, the ancient Chinese character image block is taken out from the original image, and corrected into a square using perspective transformation to obtain the image correction result. Specifically, the parameters of the perspective transformation matrix M are first calculated using the coordinates of the four points outputted in S3 and the four points of the square with a preset side length, and the formula is as follows:

[0053]

[0054] Then, based on the perspective transformation matrix, the shape of the ancient Chinese character image block is corrected to a square. The formula is as follows:

[0055]

[0056] Step 5: Use the trained ancient Chinese character recognition model to recognize the image correction result to obtain the simplified Chinese characters corresponding to the ancient Chinese characters in the natural scene.

[0057] The corrected ancient Chinese character image block is input into the trained ancient Chinese character recognition model for recognition, and the character probability vector is output. After the text recognition result is normalized by the softmax function, the one with the highest probability is selected as the prediction result, and finally the simplified Chinese character corresponding to the ancient Chinese character is obtained.

[0058] Figure 2 This is a principle block diagram of the ancient Chinese character recognition system structure of the present invention.

[0059] The system includes a user terminal and a cloud server, which are communicatively connected; the user terminal is used to obtain the user's control instructions and call data from the cloud server according to the control instructions; the cloud server includes an ancient Chinese character detection and recognition module, a text query module, a result feedback module and a data storage module.

[0060] The ancient Chinese character detection and recognition module uses the natural scene ancient Chinese character recognition method based on deep learning and obtains the coordinates of all single ancient Chinese character quadrilateral areas in the image and their corresponding simplified Chinese characters according to the image query information of the user terminal.

[0061] The text query module is used to obtain the query information of a single simplified Chinese character of the user terminal, and retrieve the detailed information of the single simplified Chinese character from the data storage module, wherein the detailed information includes pinyin, number of strokes, radical, five-stroke, detailed explanation, antonym, synonym, English translation, example sentence and corresponding ancient Chinese character style image, wherein the style image includes seal script, official script, cursive script, running script and regular script images.

[0062] The result feedback module is used to obtain improvement suggestions from the user terminal, including the user terminal display interface, user terminal function design and recognition result evaluation.

[0063] The functions of the data storage module include: storing the historical query records of the user terminal, which include the user account, query date, query location, query content and query results; allowing the user terminal to query and delete the historical query records; and storing the results fed back by the user terminal.

[0064] The user terminal is a mobile phone or PC.

[0065] The user terminal can run the system’s WeChat official account, WeChat mini-program and APP.

[0066] The components used in the present invention are all universal standard components or components known to those skilled in the art, and their structures and principles are well known to those skilled in the art.

[0067] The above description is only a preferred embodiment of the present disclosure and is not intended to limit the present disclosure. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present disclosure should be included in the protection scope of the present disclosure.

Claims

1. A method for recognizing ancient Chinese characters in natural scenes based on deep learning, characterized in that: The following steps are involved: S1: Construct a natural scene ancient Chinese character detection dataset and a natural scene ancient Chinese character recognition dataset; S2: Use the natural scene ancient Chinese character detection dataset to train the DBNet text detection model, and use the natural scene ancient Chinese character recognition dataset to train the ancient Chinese character recognition model; S3: Input the image to be detected into the trained ancient Chinese character detection model, output the probability map and the adaptive threshold map, subtract the two maps element by element, and the difference map is approximated by the differentiable binary activation function f(x)=1 / (1+e -kx ) to obtain an approximate binary image, extract the target contour in the image, and approximate it with a rotated rectangle; output the coordinates of the four points in the quadrilateral area of ​​all single ancient Chinese characters; S4: According to the ancient Chinese character detection result, the ancient Chinese character image block is taken out from the original image, and corrected into a square by perspective transformation to obtain the image correction result; specifically, the parameters of the perspective transformation matrix M are first calculated using the coordinates of the four points outputted in S3 and the four points of the square with a preset side length, and the formula is as follows: Then, based on the perspective transformation matrix, the shape of the ancient Chinese character image block is corrected to a square. The formula is as follows: S5: Input the corrected ancient Chinese character image block into the trained ancient Chinese character recognition model for recognition, output the character probability vector, normalize the text recognition results through the softmax function, select the one with the highest probability as the prediction result, and finally obtain the simplified Chinese character corresponding to the ancient Chinese character; The natural scene ancient Chinese character detection dataset in S1 is obtained through field photography and network acquisition, and the labels are the coordinates of four points in the quadrilateral area of ​​all single ancient Chinese characters in the image; The natural scene ancient Chinese character recognition dataset contains real scene images and synthetic images obtained by an image synthesis method for the natural scene ancient Chinese character recognition dataset. The image synthesis method includes the following steps: S6: Acquire ancient Chinese character images; S7: Acquire natural scene texture image; S8: randomly performing geometric and color transformations on the ancient Chinese character image, and randomly selecting the natural scene texture image as a background, superimposing them to obtain a composite image, with the label being the corresponding simplified Chinese character; The real scene images are obtained through field shooting and network acquisition.

2. The method for recognizing ancient Chinese characters in natural scenes based on deep learning according to claim 1, characterized in that: The S2 ancient Chinese character recognition model is a ResNet network structure, and the loss function used in training is a cross-entropy loss function; the loss function used in the ancient Chinese character detection model training is a weighted sum of the cross-entropy loss function and the L1 loss function.

3. The method for recognizing ancient Chinese characters in natural scenes based on deep learning according to claim 1, characterized in that: The S6 ancient Chinese character image only contains a single ancient Chinese character, and the character is the ancient Chinese character corresponding to the character included in the GB / T 2312-1980 national standard, and the script forms include seal script, official script, cursive script, running script and regular script.

4. A natural scene ancient Chinese character recognition system of the natural scene ancient Chinese character recognition method based on deep learning as claimed in claim 1, the system comprising a user terminal and a cloud server, the two being communicatively connected; The user terminal is used to obtain a user's control instruction and call data from the cloud server according to the control instruction; The cloud server includes The ancient Chinese character detection and recognition module uses a natural scene ancient Chinese character recognition method based on deep learning, and obtains the coordinates of all single ancient Chinese character quadrilateral areas in the image and their corresponding simplified Chinese characters according to the image query information of the user terminal; A text query module, used to obtain query information of a single simplified Chinese character of a user terminal, and retrieve detailed information of the single simplified Chinese character from the data storage module, wherein the detailed information includes pinyin, number of strokes, radical, five-stroke, detailed explanation, antonym, synonym, English translation, example sentence and corresponding ancient Chinese character style image, wherein the style image includes seal script, official script, cursive script, running script and regular script images; A result feedback module is used to obtain improvement suggestions for the user terminal, including the user terminal display interface, user terminal function design and recognition result evaluation; Data storage module: stores historical query records of user terminals, including user account, query date, query location, query content and query results; Provides user terminals with the ability to query and delete historical query records; stores the results of user terminal feedback.

5. The ancient Chinese character recognition system based on deep learning according to claim 4 is characterized in that: The user terminal is a mobile phone or a PC.

6. The ancient Chinese character recognition system based on deep learning according to claim 4 is characterized in that: The user terminal can run the WeChat public account, WeChat applet and APP of the system.