Ancient book character recognition method, device, computer equipment and storage medium

By mechanical learning and training on the object detection model and text recognition model of ancient books, the problem of inefficient ancient books sorting in the existing technology is solved, and efficient text recognition and organization of ancient books is achieved.

CN113989484BActive Publication Date: 2025-04-29GULIAN (BEIJING) DIGITAL MEDIA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111286038.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-02
Publication Date
2025-04-29
Estimated Expiration
2041-11-02

AI Technical Summary

Technical Problem

The existing technology is difficult to efficiently identify and organize ancient books and documents, and has high requirements for manual entry and labeling, resulting in inefficiency.

Method used

By generating a training picture set, mechanical learning and training of the object detection model and text recognition model can be achieved to locate and recognize the text in ancient books and documents, and reduce manual intervention.

Benefits of technology

It improves the efficiency of ancient book sorting, reduces the cost of manual entry, and realizes accurate identification and organization of ancient book documents without manual intervention.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113989484B_ABST
    Figure CN113989484B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, device, computer equipment and storage medium for character recognition of ancient books, the method comprising: obtaining an image of an ancient book to be recognized and preprocessing it; inputting the image of the ancient book into a target detection model to obtain one or more positioning frames contained in the image of the ancient book; the positioning frames are used to represent Chinese character regions that are arranged vertically continuously and have the same font form; inputting the regional image determined by each positioning frame into a text recognition model to obtain the characters contained in the regional image; and determining the character recognition result of the ancient book image based on the characters contained in all the regional images. The present invention realizes the positioning and recognition of characters in images of ancient books and documents without human intervention, and converts the characters in the images into digital text, thereby improving the efficiency of ancient book entry and speeding up the work of ancient book sorting.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of text recognition, and in particular to a method, device, computer equipment and storage medium for text recognition in ancient books. Background Art

[0002] The Chinese culture has a long history, and a large number of ancient books have been produced during the long historical period. Ancient books and documents are a common way for modern people to understand and study ancient culture. In order to facilitate more modern people to read and understand, professionals will organize ancient books and documents (including but not limited to providing relevant annotations). As an important means of giving regenerative protection to ancient books, the digitization of ancient books (making ancient books and documents into digital texts, i.e. databases, etc.) is an especially important part of the arrangement of ancient books. However, my country has a long history and a huge number of ancient books preserved. Manual entry of ancient books is time-consuming and laborious; similarly, manual annotation of data requires a lot of manual effort, and has high requirements for the literary literacy and entry quality of the people involved in the entry of ancient books.

[0003] In the prior art, with the development and popularization of OCR (Optical Character Recognition) technology, text can be extracted from images in different scenarios. The Chinese invention patent with application number 202110735014.8 discloses a text recognition method, device, computer equipment and computer-readable storage medium based on probability calibration. By obtaining an initial recognition image, and inputting the initial recognition image into a preset DARTS model, performing text recognition on the initial recognition image, and obtaining calibration parameters of the text contained in the initial recognition image, the initial recognition image is input into a preset OCR model, and text recognition is performed on the initial recognition image to obtain the text recognition Logits probabilistic vector corresponding to the text contained in the initial recognition image. According to the calibration parameters, the text recognition Logits probabilistic vector is probability calibrated and normalized to obtain the text recognition result of the text contained in the initial recognition image. By increasing the calibration of the text recognition probability, the calibration problem of the recognition error rate can be solved, and the accuracy of character prediction in text recognition can be improved.

[0004] Although the above-mentioned text recognition method based on probability calibration can improve the recognition accuracy of text in different scenarios, it does not meet the needs of digital recognition of ancient books, nor can it learn from the annotated images of ancient books and documents without human intervention, which is not conducive to the electronic output and preservation of ancient books and documents.

[0005] Therefore, in response to the problems existing in the existing technology, there is an urgent need to provide a technology that can reduce manual effort and effectively improve the efficiency of ancient book sorting. It is particularly important to rely on AI algorithms to identify the text content in ancient book bibliographies. Summary of the invention

[0006] In view of this, the purpose of the present invention is to provide a method for character recognition of ancient books, which can reduce manual effort and effectively improve the efficiency of ancient book sorting. Furthermore, the present invention can rely on AI algorithms to identify text content in ancient book bibliographies. Another purpose of the present invention is to provide a device for character recognition of ancient books. Another purpose of the present invention is to provide a computing device and a computer-readable storage medium. The following technical solutions are used to achieve the above purposes.

[0007] According to one aspect of the present invention, a method for character recognition of ancient books is provided, comprising the following steps:

[0008] Obtain the ancient book image to be identified and perform preprocessing;

[0009] Inputting the ancient book image into the target detection model to obtain one or more positioning frames contained in the ancient book image; the positioning frames are used to represent the Chinese character areas that are continuously arranged vertically and have the same font form;

[0010] Inputting the area image defined by each positioning frame into a text recognition model to obtain the text contained in the area image;

[0011] The text recognition result of the ancient book image is determined according to the text contained in all the regional images.

[0012] According to the ancient book text recognition method of the present invention, preferably, the step of obtaining the ancient book image to be recognized and performing preprocessing includes:

[0013] Converting the ancient book image into a black and white image;

[0014] The black-and-white image is subjected to tilt correction.

[0015] According to the ancient book text recognition method of the present invention, preferably, the step of inputting the ancient book image into the target detection model to obtain one or more positioning frames contained in the ancient book image includes:

[0016] Input the ancient book image into the target detection model to obtain one or more sets of vertex coordinate sets; wherein each set of vertex coordinate sets includes four pairs of position coordinates, and each pair of position coordinates is used to represent the position of a vertex in the positioning frame in the ancient book image;

[0017] The one or more positioning boxes are generated according to the one or more sets of vertex coordinates.

[0018] According to the ancient book text recognition method of the present invention, preferably, after the step of inputting the ancient book image into the target detection model to obtain one or more positioning frames contained in the ancient book image, the method further comprises:

[0019] Determine the regional image contained in each positioning frame;

[0020] The regional images are stored in a memory mapping database in a preset order; wherein the preset order is determined according to the vertex positions of the positioning frame.

[0021] According to the ancient book text recognition method of the present invention, preferably, the step of inputting the regional image determined by each positioning frame into a text recognition model to obtain the text contained in the regional image comprises:

[0022] Acquire the region image from the memory mapping database according to the preset order;

[0023] Inputting the region image into a deep residual network model to output corresponding extracted text region features;

[0024] The extracted text region features are input into the LSTM model to output the corresponding sequence relationship information;

[0025] The sequence relationship information is input into a CTC model or an attention model to output text contained in the region image.

[0026] According to the ancient book text recognition method of the present invention, preferably, the step of inputting the sequence relationship information into a CTC model or an attention model to output the text contained in the regional image includes:

[0027] Determining the number of characters contained in the regional image;

[0028] When the number of characters is greater than a first threshold, the selected features are input into the CTC model; otherwise, the selected features are input into the attention model.

[0029] Preferably, the training step of the target detection model includes:

[0030] Constructing a training picture set, wherein the training pictures contain a mixture of single-column Chinese characters and / or double-column Chinese characters in different font forms composed of traditional Chinese characters;

[0031] Annotating the training image with one or more corresponding positioning training frames, wherein the positioning training frames are used to represent Chinese character regions that are arranged vertically continuously and have the same font form;

[0032] The training picture is used as input data, and one or more sets of vertex coordinate training sets corresponding to the one or more positioning training frames are used as output data to train a DBNet model or a CRAFT model; wherein each set of vertex coordinate training sets contains four pairs of position training coordinates, and each pair of position training coordinates is used to represent the position of a vertex in the positioning training frame in the training picture;

[0033] When the error function is less than the preset second threshold, the training ends.

[0034] According to another aspect of the present invention, there is provided an ancient book character recognition device, comprising:

[0035] An image acquisition module, adapted to acquire an image of an ancient book to be identified;

[0036] The target detection module is adapted to input the ancient book image into a target detection model to obtain one or more positioning frames contained in the ancient book image; the positioning frames are used to represent a region of Chinese characters arranged vertically continuously and having the same font form;

[0037] A text recognition module, adapted to input the area image determined by each positioning frame into a text recognition model to obtain the text contained in the area image;

[0038] The integration module is adapted to determine the text recognition result of the ancient book image according to the text contained in all the regional images.

[0039] According to another aspect of the present invention, there is provided a computing device, including a memory, a processor, and computer instructions stored in the memory and executable on the processor, wherein when the processor executes the instructions, the steps of the method for converting traditional and simplified Chinese characters in ancient books are implemented.

[0040] According to another aspect of the present invention, a computer-readable storage medium is provided, which stores computer instructions, and when the instructions are executed by a processor, the steps of the above method for converting traditional and simplified Chinese characters are implemented.

[0041] The present invention performs machine learning training on the constructed text positioning model and text recognition model by generating a training picture set, thereby realizing the positioning and recognition of text in pictures of ancient books and documents without human intervention, converting the text in the pictures into digital text, improving the efficiency of ancient book input, and speeding up the work of ancient book sorting. According to the preferred technical solution of the present invention, no manpower is required to annotate the training picture set, which greatly saves the manpower input cost. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] The present invention may be better understood by describing exemplary embodiments disclosed in the present invention in conjunction with the accompanying drawings, in which:

[0043] Figure 1 is a schematic structural block diagram of a computing device according to an embodiment disclosed in the present invention;

[0044] Figure 2 is a schematic flow chart of a method for character recognition of ancient books according to an embodiment disclosed in the present invention;

[0045] Figure 3 A schematic diagram of an ancient book image according to an embodiment disclosed in the present invention;

[0046] Figure 4 A schematic diagram of a positioning frame for target detection on an ancient book image according to an embodiment of the present invention;

[0047] Figure 5 A schematic diagram of a regional image according to an embodiment disclosed in the present invention;

[0048] Figure 6 is a text recognition result of a regional image according to an embodiment disclosed in the present invention;

[0049] Figure 7 The text recognition result of the ancient book image according to the disclosed embodiment of the present invention;

[0050] Figure 8 A schematic diagram of a training process of a target detection model according to an embodiment disclosed in the present invention;

[0051] Fig. 9 Schematic diagram of a text recognition device for ancient books according to an embodiment disclosed in the present invention. DETAILED DESCRIPTION

[0052] The specific embodiments of the present invention will be described below. It should be noted that in the specific description of these embodiments, in order to be concise and clear, this specification cannot provide a detailed description of all the features of the actual embodiments. It should be understood that in the actual implementation of any embodiment, just as in the process of any engineering project or design project, in order to achieve the specific goals of the developer and to meet system-related or business-related restrictions, various specific decisions are often made, and this will also change from one embodiment to another. In addition, it can also be understood that although the efforts made in this development process may be complex and lengthy, for ordinary technicians in the field related to the content disclosed by the present invention, some changes such as design, manufacturing or production based on the technical content disclosed by the present invention are just conventional technical means, and should not be understood as the content of the present invention is insufficient.

[0053] Unless otherwise defined, the technical or scientific terms used in the claims and the specification shall have the usual meaning understood by persons with ordinary skills in the technical field to which the invention belongs. The words "first", "second" and similar words used in the patent application specification and the claims of the present invention do not indicate any order, quantity or importance, but are only used to distinguish different components. "One" or "one" and other similar words do not indicate a quantitative limitation, but indicate the existence of at least one. "Include" or "comprises" and other similar words mean that the elements or objects appearing before "include" or "comprises" include the elements or objects listed after "include" or "comprises" and their equivalent elements, and do not exclude other elements or objects. "Connected" or "connected" and other similar words are not limited to physical or mechanical connections, nor are they limited to direct or indirect connections.

[0054] Figure 1 The structure block diagram of a computing device 100 according to an embodiment of the present specification is shown. The components of the computing device 100 include but are not limited to a memory 110 and a processor 120. The processor 120 is connected to the memory 110 via a bus 130, and the database 150 is used to store data.

[0055] The computing device 100 also includes an access device 140 that enables the computing device 100 to communicate via one or more networks 160. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 140 may include one or more of any type of network interface (e.g., a network interface card (NIC)) whether wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a World Wide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like.

[0056] In one embodiment of the present specification, the above components of the computing device 100 and Figure 1 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Figure 1 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.

[0057] The computing device 100 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or PC. The computing device 100 may also be a mobile or stationary server.

[0058] The processor 120 may execute Figure 2 Steps in the method shown.

[0059] Figure 2 A schematic flow chart of a method for character recognition of ancient books according to an embodiment of the present application is shown, including steps S1 to S4.

[0060] S1: Obtain the ancient book image to be identified and perform preprocessing.

[0061] Ancient book images include engravings, Siku handwritings, stele inscriptions, and lead-type images with ancient book content, such as Figure 3 The process of preprocessing the ancient book image includes but is not limited to binarizing the ancient book image to convert it into a black and white image, and performing tilt correction on the black and white image. The "tilt correction" here refers to rotating and adjusting the image with a tilted plane shooting angle so that its page edge is in a horizontal or vertical state.

[0062] S2: Inputting the ancient book image into the target detection model to obtain one or more positioning frames contained in the ancient book image; the positioning frames are used to represent the Chinese character areas that are arranged vertically continuously and have the same font form.

[0063] The purpose of object detection on ancient book images is to locate the divided areas of ancient book images, so as to facilitate further text recognition based on each area in the subsequent process. The object detection model can be trained using any existing relevant machine learning model, aiming to obtain image information in different areas by classifying ancient book images. In this embodiment, the divided areas are displayed by positioning boxes. Figure 4 The schematic diagram of the positioning frame in the ancient book image is shown. Those skilled in the art will understand that ancient books are usually arranged in vertical format, so the positioning frame in this embodiment detects the text area in each column to obtain the text areas with the same font style that are arranged continuously. The font style may include any one of the font format, font size, and font color. Figure 4 For example, it can be seen that the first column outputs three positioning boxes after the target detection model, corresponding to areas with different numbers of columns and different font sizes.

[0064] In one example, the output of the object detection model may be one or more sets of vertex coordinate sets; wherein each set of vertex coordinate sets includes four pairs of position coordinates, and each pair of position coordinates is used to characterize the position of a vertex in the positioning frame in the ancient book image. For example, the positioning frame ABCD includes four vertices, namely A, B, C and D. The position coordinates of each vertex are respectively (X A , Y A )、(X B , Y B )、(X C , Y C ) and (X D , Y D ). Then, the vertex coordinate set corresponding to the positioning box can be (X A , Y A , X B , Y B , X C , Y C , X D , Y D ). It can be understood that, based on the vertex coordinate set, the corresponding positioning frame can be directly generated.

[0065] In this embodiment, the image defined inside each positioning frame is called a regional image. It can be understood that an ancient book image contains multiple regional images, and accordingly, the regional images contained in multiple ancient book images will increase exponentially. In order to speed up the reading speed of the regional images, this embodiment stores the above-mentioned regional images in a memory-mapped database (LMDB, Lightning Memory-Mapped Database) in a preset order. The preset order is determined according to the vertex position of the positioning frame. For example, based on the reading habits of ancient books, the vertex positions of the positioning frame can be arranged and stored in sequence from top to bottom and from right to left.

[0066] S3: Inputting the area image determined by each positioning frame into a text recognition model to obtain the text contained in the area image.

[0067] The text recognition model can be trained using any existing feature extraction network model to recognize text in each regional image. In order to increase the accuracy of text recognition, the text recognition model in this embodiment can include multiple feature extraction models to specifically extract text features in the regional image. Figure 5 and Figure 6 A region image and a recognized text result according to the first embodiment of the present invention are respectively shown.

[0068] In one example, the number of characters in the regional image is greater than a first threshold, such as 32. At this time, step S3 may include: obtaining the regional image from the memory mapping database according to the preset order; inputting the regional image into the deep residual network model to output the corresponding extracted text region features; inputting the extracted text region features into the LSTM model to output the corresponding sequence relationship information; inputting the sequence relationship information into the CTC model to output the characters contained in the regional image. Among them, the deep residual network model ResNet expresses the output text region features as a linear superposition of the input and a nonlinear transformation of the input, the LSTM model can solve the problem of long-term dependence in the text sequence, and the CTC model is a time series classification based on a neural network, which is suitable for long rows or columns with a long number of characters.

[0069] In another example, the number of characters in the regional image is less than or equal to a first threshold, such as 32. At this time, step S3 may include: obtaining the regional image from the memory mapping database according to the preset order; inputting the regional image into the deep residual network model to output the corresponding extracted text region features; inputting the extracted text region features into the LSTM model to output the corresponding sequence relationship information; inputting the sequence relationship information into the attention model to output the characters contained in the regional image. In this example, the attention model is used instead of the CTC model to solve the bottleneck of information loss caused by the conversion of long sequences to fixed-length vectors, which is more suitable for text recognition in short rows or short columns.

[0070] S4: Determine the text recognition result of the ancient book image according to the text contained in all the regional images.

[0071] It can be understood that, when the ancient book image contains multiple regional images, the recognition results of each regional image are arranged in sequence according to the preset order above, and then the recognition result of the entire ancient book image can be obtained, such as Figure 7 shown.

[0072] Through the above steps, this embodiment can quickly and accurately convert the text in the picture into digital text, thereby saving the cost of manpower input. Further, this can improve the efficiency of ancient book input and speed up the work of ancient book sorting.

[0073] Figure 8 FIG. 1 is a schematic diagram of the training process of the target detection model of the first embodiment of the present invention. Figure 8 As shown in the figure, the target detection model is trained through the following steps:

[0074] S810: Construct a training picture set, wherein the training pictures contain a mixture of single-column Chinese characters and / or double-column Chinese characters in different font forms composed of traditional Chinese characters.

[0075] The font model in the training image can be obtained through the Zhonghua Book Company Song font migration training, and the font model can have different font formats and typesetting formats. Among them, the font format can include options such as font style, font size, and font width-to-width ratio, and the typesetting format can include options such as font spacing, column spacing, and single / double column settings.

[0076] After entering the text file to be generated in the page model and determining the page generation parameters, the page model will automatically combine the text into single and double parallel mixed columns according to the single and double column settings, and combine each mixed column into a training picture. A training picture set is formed by a number of training pictures. Each training picture is associated with the corresponding original text position information for model verification. Among them, the original text position information includes coordinate information and text content information. In the coordinate information, the coordinate system of the X-axis and the Y-axis can be used to represent the specific position in the training picture, and the position of the original rectangular block of text formed by each character column in the training picture is determined by determining the coordinates of the four corner points of the rectangle.

[0077] S820: Annotate the training image with one or more corresponding positioning training frames, where the positioning training frames are used to represent Chinese character areas that are arranged vertically continuously and have the same font form.

[0078] By segmenting and positioning the training image, the training image is segmented into several columns, namely several positioning training frames, and the position information of each positioning training frame is identified, including the coordinates of the four corner points of each positioning training frame.

[0079] S830: Use the training image as input data and one or more groups of vertex coordinate training sets corresponding to the one or more positioning training frames as output data to train a DBNet model or a CRAFT model; wherein each group of vertex coordinate training sets contains four pairs of position training coordinates, and each pair of position training coordinates is used to characterize the position of a vertex in the positioning training frame in the training image.

[0080] The text positioning model is trained by comparing and judging the identified positioning training frame (including the coordinates of its four corner points and the relative coordinates of each character) with the corresponding original text position information (including the coordinates of the four corner points of the original rectangular block of the text and the relative coordinates of each character). Through continuous and repeated training and learning, the text positioning model can automatically adjust and improve the specific parameters in the positioning module to achieve the effect of autonomous learning of artificial intelligence.

[0081] S840: When the error function is less than the preset second threshold, the training ends.

[0082] The architecture of the text positioning model in this embodiment may include a DB (Differentiable Binarization) network model and a CRAFT (Computerized Relationship Facilities Technique) model, which are used to segment and locate images and output segmented blocks and positioning coordinates. Among them, the CRAFT model directly uses a pre-trained model; it overcomes the weakness of being easily affected by the shape of the text, and uses a Gaussian heat map to represent the location information of each text and the link relationship between the text. The DB network model needs to be trained based on the training picture set and the corresponding text location information to determine the specific parameters.

[0083] This embodiment automatically synthesizes a training picture set through a page model, which can effectively solve the problem of excessive effort required for manual annotation of real data, improve the efficiency of model training, and effectively save labor costs.

[0084] Corresponding to the above method, this specification also provides an embodiment of a text recognition device for ancient books, Fig. 9 FIG. 9 is a schematic diagram of an ancient book character recognition device 90 according to an embodiment of the present invention. Fig. 9 As shown, the ancient book text recognition device 90 includes: an image acquisition module, a target detection module, a text recognition module and an integration module.

[0085] An image acquisition module 91 is adapted to acquire an image of an ancient book to be identified;

[0086] The object detection module 92 is adapted to input the ancient book image into an object detection model to obtain one or more positioning frames contained in the ancient book image; the positioning frames are used to represent the Chinese character regions that are arranged vertically continuously and have the same font form;

[0087] A text recognition module 93, adapted to input the area image determined by each positioning frame into a text recognition model to obtain the text contained in the area image;

[0088] The integration module 94 is adapted to determine the text recognition result of the ancient book image according to the text contained in all the regional images.

[0089] An embodiment of the present application further provides a computer-readable storage medium storing computer instructions, which, when executed by a processor, implement the steps of the ancient book OCR recognition method as described above.

[0090] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the above-mentioned ancient book OCR recognition method belong to the same concept, and the details not described in detail in the technical scheme of the storage medium can be referred to the description of the technical scheme of the above-mentioned ancient book OCR recognition method.

[0091] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0092] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0093] To summarize, according to the exemplary embodiment, by generating a training picture set to perform machine learning training on the constructed text positioning model and text recognition model respectively, it is possible to locate and recognize the text in the pictures of ancient books and documents without human intervention, and convert the text in the pictures into digital text, thereby improving the efficiency of ancient book entry and speeding up the work of ancient book sorting; and there is no need for manpower to annotate the training atlas, which greatly saves the manpower entry cost.

[0094] It should be noted that, in the apparatus and method disclosed in the present invention, it is obvious that each component or each step can be decomposed and / or recombined. These decompositions and / or recombinations should be regarded as equivalent schemes disclosed in the present invention. In addition, the steps of performing the above series of processes can naturally be performed in chronological order according to the order of description, but do not necessarily need to be performed in chronological order. Some steps can be performed in parallel or independently of each other.

[0095] The above specific implementations do not constitute a limitation on the scope of protection disclosed by the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle disclosed by the present invention shall be included in the scope of protection disclosed by the present invention.

Claims

1. A method for character recognition in ancient books, characterized in that: The following steps are involved: S1: Obtain the ancient book image to be identified and perform preprocessing; The steps of obtaining the ancient book image to be identified and preprocessing the image include: converting the ancient book image into a black and white image; performing tilt correction on the black and white image; the tilt correction refers to rotating and adjusting the image with a tilted plane shooting angle so that its page edge is in a horizontal or vertical state; S2: Inputting the ancient book image into the target detection model to obtain one or more positioning frames contained in the ancient book image, including: Input the ancient book image into the target detection model to obtain one or more sets of vertex coordinate sets; wherein each set of vertex coordinate sets includes four pairs of position coordinates, and each pair of position coordinates is used to represent the position of a vertex in the positioning frame in the ancient book image; Generate the one or more positioning frames according to the one or more sets of vertex coordinate sets; the positioning frames are used to represent Chinese character areas that are arranged vertically and continuously and have the same font form; After the step of inputting the ancient book image into the target detection model to obtain one or more positioning frames contained in the ancient book image, the method further includes: Determine the regional image contained in each positioning frame; The regional image is stored in a memory mapping database in a preset order; wherein the preset order is determined according to the vertex positions of the positioning frame; S3: Inputting the area image determined by each positioning frame into a text recognition model to obtain the text contained in the area image, including: Acquire the region image from the memory mapping database according to the preset order; Inputting the region image into a deep residual network model to output corresponding extracted text region features; The extracted text region features are input into the LSTM model to output the corresponding sequence relationship information; Inputting the sequence relationship information into a CTC model or an attention model to output the text contained in the region image; S4: determining a text recognition result of the ancient book image according to the text contained in all the regional images; in, The training steps of the target detection model include: Constructing a training picture set, wherein the training pictures include a mixture of single-column Chinese characters and / or double-column Chinese characters in different font forms composed of traditional Chinese characters; Annotating the training image with one or more corresponding positioning training frames, wherein the positioning training frames are used to represent Chinese character regions that are arranged vertically continuously and have the same font form; The training picture is used as input data, and one or more sets of vertex coordinate training sets corresponding to the one or more positioning training frames are used as output data to train a DBNet model or a CRAFT model; wherein each set of vertex coordinate training sets contains four pairs of position training coordinates, and each pair of position training coordinates is used to represent the position of a vertex in the positioning training frame in the training picture; When the error function is less than the preset second threshold, the training ends.

2. The text recognition method according to claim 1, characterized in that: The step of inputting the sequence relationship information into a CTC model or an attention model to output the text contained in the region image includes: Determining the number of characters contained in the regional image; When the number of characters is greater than a first threshold, the selected features are input into the CTC model; otherwise, the selected features are input into the attention model.

3. A device for recognizing characters in ancient books, characterized in that: include: An image acquisition module, adapted to acquire an image of an ancient book to be identified; Obtain the ancient book image to be identified and perform preprocessing; The steps of obtaining the ancient book image to be identified and preprocessing the image include: converting the ancient book image into a black and white image; performing tilt correction on the black and white image; the tilt correction refers to rotating and adjusting the image with a tilted plane shooting angle so that its page edge is in a horizontal or vertical state; The target detection module is adapted to input the ancient book image into a target detection model to obtain one or more positioning frames contained in the ancient book image, including: Input the ancient book image into the target detection model to obtain one or more sets of vertex coordinate sets; wherein each set of vertex coordinate sets includes four pairs of position coordinates, and each pair of position coordinates is used to represent the position of a vertex in the positioning frame in the ancient book image; Generate the one or more positioning frames according to the one or more sets of vertex coordinate sets; the positioning frames are used to represent Chinese character areas that are arranged vertically and continuously and have the same font form; After the step of inputting the ancient book image into the target detection model to obtain one or more positioning frames contained in the ancient book image, the method further includes: Determine the regional image contained in each positioning frame; The regional image is stored in a memory mapping database in a preset order; wherein the preset order is determined according to the vertex positions of the positioning frame; The text recognition module is adapted to input the area image determined by each positioning frame into a text recognition model to obtain the text contained in the area image, including: Acquire the region image from the memory mapping database according to the preset order; Inputting the region image into a deep residual network model to output corresponding extracted text region features; The extracted text region features are input into the LSTM model to output the corresponding sequence relationship information; Inputting the sequence relationship information into a CTC model or an attention model to output the text contained in the region image; An integration module, adapted to determine a text recognition result of the ancient book image according to the text contained in all the regional images; in, The training steps of the target detection model include: Constructing a training picture set, wherein the training pictures include a mixture of single-column Chinese characters and / or double-column Chinese characters in different font forms composed of traditional Chinese characters; Annotating the training image with one or more corresponding positioning training frames, wherein the positioning training frames are used to represent Chinese character regions that are arranged vertically continuously and have the same font form; The training picture is used as input data, and one or more sets of vertex coordinate training sets corresponding to the one or more positioning training frames are used as output data to train a DBNet model or a CRAFT model; wherein each set of vertex coordinate training sets contains four pairs of position training coordinates, and each pair of position training coordinates is used to represent the position of a vertex in the positioning training frame in the training picture; When the error function is less than the preset second threshold, the training ends.

4. A computing device comprising a memory, a processor, and computer instructions stored in the memory and executable on the processor, characterized in that: When the processor executes the instructions, the steps of the method according to any one of claims 1 to 2 are implemented.

5. A computer-readable storage medium storing computer instructions, characterized in that: When the instruction is executed by a processor, the steps of the method described in any one of claims 1 to 2 are implemented.

Citation Information

Patent Citations

  • Character recognition method and device based on probability calibration, computer equipment and medium

    CN113420689A

  • Ancient book document digitization method

    CN111507351A