A text learning and proofreading system based on image and text recognition

By introducing text detection, adjustment and recognition modules into the text recognition system, combined with advanced image processing algorithms and attention mechanisms, the problems of low efficiency and insufficient accuracy of text recognition in the existing technology are solved, and a more efficient and accurate system is achieved. Text recognition process.

CN118135578BInactive Publication Date: 2024-09-24SHENYANG PUBLISHING HOUSE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410573260.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-10
Publication Date
2024-09-24
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing text recognition methods are inefficient and cannot effectively combine the associated information of adjacent independent characters, resulting in low recognition accuracy.

Method used

A text learning and proofreading system based on image and text recognition is designed, including a user login module, an image and text management module, an image and text recognition module, a user management module and a recognition result management module. The image and text are processed through text detection, adjustment and recognition modules. The data is detected and adjusted for typos, easily confused words and lines, and is combined with flood filling, maximum inter-class variance method and attention mechanism for text recognition.

Benefits of technology

It improves the accuracy and efficiency of text recognition, reduces the probability of errors, and achieves traceability of recognition results by recording and managing graphic information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118135578B
    Figure CN118135578B
Patent Text Reader

Abstract

The invention discloses a text learning and proofreading system based on image-text recognition, which relates to the field of text proofreading and comprises a user login module, an image-text management module, an image-text recognition module, a user management module and a recognition result management module. The text learning and proofreading system based on image-text recognition records image-text information in an image-text data table, performs text detection on the image-text information input by the user, wherein the text detection comprises wrong character detection and line detection, performs text adjustment on the image-text data detected by the text detection module, wherein the text adjustment comprises wrong character adjustment and position adjustment, performs text recognition and easily confused character recognition, and simultaneously performs easily confused character adjustment on easily confused characters. Such an arrangement can not only realize text recognition of image-text information, but also recognize and adjust easily confused characters in a targeted manner during text recognition, thereby reducing the probability of errors occurring during the text recognition process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to text proofreading technology, and in particular to a text learning and proofreading system based on image and text recognition. Background Art

[0002] Book proofreading refers to a method of ensuring the quality of books and improving their readability and credibility by checking and correcting errors and problems in the content, format, typesetting and other aspects of books during the publishing and printing process.

[0003] With the continuous development of informatization and intelligence, text recognition has become an important method for book proofreading. The current text recognition method mainly divides the text in the image into multiple independent characters and recognizes each independent character separately. This method is inefficient and cannot combine the association information between adjacent independent characters, resulting in low recognition accuracy. Summary of the invention

[0004] The purpose of the present invention is to provide a text learning and proofreading system based on image and text recognition to solve the above-mentioned deficiencies in the prior art.

[0005] In order to achieve the above object, the present invention provides the following technical solution: a text learning and proofreading system based on image and text recognition, comprising:

[0006] A user login module is used to help users register and log in to the image and text recognition system, and then detect and recognize images. Whenever a new user registers, the new user name and password will be recorded in the user table;

[0007] An image and text management module, which is responsible for managing the image and text information input by the user. When the user enters an image and text in the system, the image and text information will be recorded in the image and text data table. Recording the image and text information can ensure that each recognized image and text has a traceable path, which is convenient for future reference and modification;

[0008] An image and text recognition module, which is used to receive the image and text data input by the image and text management module, and perform text detection, text adjustment and text recognition on the received image and text data;

[0009] A user management module, which is used to manage user accounts and maintain user information;

[0010] The recognition result management module is responsible for managing the recognition results. Whenever a new image and text is transmitted to the system, the recognized text content will be stored in the recognition result data table.

[0011] Furthermore, the image and text recognition module includes:

[0012] A text detection module, which is used to perform text detection on the text and image data input by the text and image management module received by the text and image recognition module. The text detection includes indistinguishable character detection, misspelled character detection, and line detection;

[0013] A text adjustment module, which is used to adjust the text in the text and image data detected by the text detection module. The text adjustment includes indistinguishable character adjustment, misspelled character adjustment, and position adjustment;

[0014] A text recognition module, which is used to perform text recognition on the text and image data adjusted by the text adjustment module.

[0015] Furthermore, the text detection module includes:

[0016] An indistinguishable character detection module, which is used to detect indistinguishable characters in the text and image data. The indistinguishable characters include but are not limited to the number "0" and the letter "O", the number "1" and the letter "I", the Chinese character "妹" and the Chinese character "妺", and the punctuation mark "." and the punctuation symbol ",";

[0017] A misspelled character detection module, which is used to detect misspelled characters in the text and image data;

[0018] A line detection module, which is used to perform position detection and line segmentation on the text in the text and image data.

[0019] Furthermore, the text adjustment module includes:

[0020] A position adjustment module, which is used to adjust the positions of the characters in the same line detected by the line detection module to ensure that the characters in the same line are on the same horizontal line;

[0021] A misspelled character adjustment module, which is used to automatically adjust the misspelled characters detected by the misspelled character detection module;

[0022] An indistinguishable character adjustment module, which is used to select matching characters in combination with the context of indistinguishable characters and display the replacement results.

[0023] Furthermore, the text recognition module includes the following working steps:

[0024] A1. To fill the fine holes inside the text strokes, use the flood fill algorithm to fill the background with white pixels, perform image NOT operation on the filled image, and perform image XOR operation on the original image and the image after the NOT operation. Through these three steps, the small holes inside the text strokes can be completely filled;

[0025] A2: There are still some isolated small dots in the stroke area, which are eliminated by opening operation;

[0026] A3, the stroke image is processed with three different weights of RGB to obtain a grayscale image. The calculation formula for grayscale processing is as follows:

[0027] Among them, R, G, and B represent the values ​​of the three primary colors of the leaf vein segmentation image - red, green, and blue, and "Gray" represents the grayscale value;

[0028] A4, in order to retain more stroke details, use median filtering to smooth the outline of the text and remove noise points. The specific steps include:

[0029] A41, the pixel values ​​of the stroke image are divided into [1, 2, ..., l] levels, n i It is used to represent the number of image pixel values. Therefore, the calculation formula for the total pixel value of the stroke image is as follows:

[0030] ;

[0031] A42, where the frequency of a single pixel in the image is p i The calculation formula is as follows:

[0032] ;

[0033] A43, define two variables as the sum of the frequency values ​​of local variables w0 and w1. The relationship between the two is shown in the following formula:

[0034] ;

[0035] A44, the foreground pixel frequency u0 and background pixel frequency u1 of the stroke area image are as follows:

[0036] , where U T Represents the sum of foreground pixel frequency u0 and background pixel frequency u1;

[0037] A5, use the maximum inter-class variance method to perform binary processing on the image;

[0038] A6, in order to measure the stroke length, the original morphological stroke algorithm is finally integrated to construct a thinning algorithm to obtain a single-pixel stroke line without burrs;

[0039] A7, the text to be recognized is obtained by combining the obtained single-pixel stroke lines.

[0040] Furthermore, the easily-confusable-word adjustment module includes the following working steps:

[0041] B1, when recognizing easily confused characters, the recognition method based on the text recognition module obtains the vectors of each stroke of the easily confused characters, thereby combining and obtaining the easily confused character vector;

[0042] B2, when recognizing the easily confused character context, the recognition method based on the text recognition module obtains the vector of each stroke of the easily confused character context, thereby combining to obtain the context vector;

[0043] B3, filter out useless features in the easily confused word vector feature information, use the activation function as the gate state, and then multiply the easily confused word vector feature by the point multiplication, and then use the activation function to obtain the gate unit to filter the features;

[0044] B4, use the attention mechanism to strengthen the key vector feature information in the context, and obtain the embedding vector t and the feature representation of the text according to the vector feature type. T , score each feature in the text to perceive the important information in the text, as shown in the following formula:

[0045] ;

[0046] B5, we can get the feature representation of the context after evaluation , as shown below:

[0047] , , is the context vector matrix;

[0048] B6, query representation obtained by fusion of vector feature information and context feature representation , and then calculated by the maximum similarity (MaxSim), through and Calculate the score between the easily confused word vector and the context vector, which is the sum of the maximum similarities between each easily confused word vector and the remaining context vector, as shown in the following formula: .

[0049] Furthermore, the method specifically includes the following working steps:

[0050] S1, the user logs into the text learning and proofreading system through the login interface;

[0051] S2, determine whether the current user is logging in for the first time. If the judgment result is yes, the user registers through the login interface and the registration information is recorded in the user table. If the judgment result is no, execute step S3;

[0052] S3, after the user inputs the image and text information, the image and text information is recorded in the image and text data table;

[0053] S4, performing text detection on the graphic information input by the user, wherein the text detection includes wrong character detection and line detection;

[0054] S5, performing text adjustment on the image and text data detected by the text detection module, wherein the text adjustment includes wrong character adjustment and position adjustment;

[0055] S6, performing text recognition and easily confused word recognition, performing easily confused word adjustment on the easily confused words, and transmitting the recognition results to a recognition result data table;

[0056] S7, displaying the text recognition result and the easily-confusable character adjustment result.

[0057] Compared with the prior art, the present invention provides a text learning and proofreading system based on image and text recognition, which records image and text information into an image and text data table, performs text detection on the image and text information input by the user, wherein the text detection includes wrong character detection and line detection, performs text adjustment on the image and text data detected by the text detection module, wherein the text adjustment includes wrong character adjustment and position adjustment, performs text recognition and easily confused character recognition, and simultaneously performs easily confused character adjustment on easily confused characters. Such a setting can not only realize text recognition of image and text information, but also recognize and adjust easily confused characters in a targeted manner during text recognition, thereby reducing the probability of errors occurring during the text recognition process. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.

[0059] Figure 1 A schematic diagram of the overall structure provided by an embodiment of the present invention;

[0060] Figure 2 A schematic diagram of the structure provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0061] In order to enable those skilled in the art to better understand the technical solution of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings.

[0062] See also Figure 1-2 , a text learning and proofreading system based on image and text recognition, comprising:

[0063] User login module: The user login module is used to help users register and log in to the image recognition system, and then detect and recognize images. Whenever a new user registers, the new user name and password will be recorded in the user table;

[0064] The image and text management module is responsible for managing the image and text information input by the user. When the user enters the image and text in the system, the image and text information will be recorded in the image and text data table. Recording the image and text information can ensure that each recognized image and text has a traceable path, which is convenient for future reference and modification;

[0065] The image and text recognition module is used to receive the image and text data input by the image and text management module, and perform text detection, text adjustment and text recognition on the received image and text data;

[0066] User management module: The user management module is used to manage user accounts and maintain user information;

[0067] The recognition result management module is responsible for managing the recognition results. Whenever a new image is passed into the system, the recognized text content will be stored in the recognition result data table.

[0068] Specifically, the following working steps are included: the user logs in to the text learning and proofreading system through the login interface, and determines whether the current user is logging in for the first time. If the judgment result is yes, the user registers through the login interface, and the registration information is recorded in the user table. If the judgment result is no, the user enters the graphic information, and the graphic information is recorded in the graphic data table, and text detection is performed on the graphic information entered by the user, wherein the text detection includes wrong character detection and line detection, and text adjustment is performed on the graphic data detected by the text detection module, wherein the text adjustment includes wrong character adjustment and position adjustment, and text recognition and easily confused character recognition are performed, and easily confused characters are adjusted at the same time. In this setting, by performing targeted recognition and adjustment of easily confused characters during text recognition, the probability of errors occurring during text recognition is reduced, and the recognition result is transmitted to the recognition result data table, and the text recognition result and the easily confused character adjustment result are displayed.

[0069] The image and text recognition module includes:

[0070] The text detection module is used to perform text detection on the image and text data input by the image and text management module after being received by the image and text recognition module. The text detection includes easily confused character detection, wrong character detection and line detection;

[0071] A text adjustment module, which is used to adjust the text data detected by the text detection module. The text adjustment includes easily confused characters adjustment, wrong characters adjustment and position adjustment.

[0072] The character recognition module is used to perform character recognition on the graphic and text data adjusted by the text adjustment module.

[0073] The character detection module includes:

[0074] The easily confused character detection module is used to detect easily confused characters in the graphic and text data. The confused characters include but are not limited to the number "0" and the letter "O", the number "1" and the letter "I", the Chinese character "妹" and the Chinese character "妺", and the punctuation mark "." and the punctuation symbol ",";

[0075] The misspelled character detection module is used to detect misspelled characters in the graphic and text data;

[0076] The line detection module is used to perform position detection and line segmentation on the characters in the graphic and text data.

[0077] The text adjustment module includes:

[0078] The position adjustment module is used to adjust the positions of the characters in the same line detected by the line detection module to ensure that the characters in the same line are on the same horizontal line;

[0079] The misspelled character adjustment module is used to automatically adjust the misspelled characters detected by the misspelled character detection module;

[0080] The easily confused character adjustment module is used to select matching characters in combination with the context of the easily confused characters and display the replacement results.

[0081] The character recognition module includes the following working steps:

[0082] A1. To fill the fine holes inside the character strokes, use the flood fill algorithm to fill the background with white pixel points, perform image NOT operation on the filled image, and perform image XOR operation on the original image and the image after the NOT operation. Through these three steps, the small holes inside the character strokes can be completely filled;

[0083] A2. There are still some isolated small dots in the stroke area, which are eliminated by performing opening operation;

[0084] A3. The stroke image is processed with three different weights of RGB to obtain a grayscale image. The calculation formula for grayscale processing is as follows:

[0085] Among them, R, G, and B represent the values of the three primary colors - red, green, and blue - of the vein segmentation image, and "Gray" represents the grayscale value;

[0086] A4, in order to retain more stroke details, use median filtering to smooth the outline of the text and remove noise points. The specific steps include:

[0087] A41, the pixel values ​​of the stroke image are divided into [1, 2, ..., l] levels, n i It is used to represent the number of image pixel values. Therefore, the calculation formula for the total pixel value of the stroke image is as follows:

[0088] ;

[0089] A42, where the frequency of a single pixel in the image is p i The calculation formula is as follows:

[0090] ;

[0091] A43, define two variables as the sum of the frequency values ​​of local variables w0 and w1. The relationship between the two is shown in the following formula:

[0092] ;

[0093] A44, the foreground pixel frequency u0 and background pixel frequency u1 of the stroke area image are as follows:

[0094] , where U T Represents the sum of foreground pixel frequency u0 and background pixel frequency u1;

[0095] A5, use the maximum inter-class variance method to perform binary processing on the image;

[0096] A6, in order to measure the stroke length, the original morphological stroke algorithm is finally integrated to construct a thinning algorithm to obtain a single-pixel stroke line without burrs;

[0097] A7, the text to be recognized is obtained by combining the obtained single-pixel stroke lines.

[0098] The easily confused word adjustment module includes the following working steps:

[0099] B1, when recognizing easily confused characters, the recognition method based on the text recognition module obtains the vectors of each stroke of the easily confused characters, thereby combining and obtaining the easily confused character vector;

[0100] B2, when recognizing the easily confused character context, the recognition method based on the text recognition module obtains the vector of each stroke of the easily confused character context, thereby combining to obtain the context vector;

[0101] B3, filter out useless features in the easily confused word vector feature information, use the activation function as the gate state, and then multiply the easily confused word vector feature by the point multiplication, and then use the activation function to obtain the gate unit to filter the features;

[0102] B4, use the attention mechanism to strengthen the key vector feature information in the context, and obtain the embedding vector t and the feature representation of the text according to the vector feature type. T , score each feature in the text to perceive the important information in the text, as shown in the following formula:

[0103] ;

[0104] B5, we can get the feature representation of the context after evaluation , as shown below: , , is the context vector matrix;

[0105] B6, query representation obtained by fusion of vector feature information and context feature representation , and then calculated by the maximum similarity (MaxSim), through and Calculate the score between the easily confused word vector and the context vector, which is the sum of the maximum similarities between each easily confused word vector and the remaining context vector, as shown in the following formula: .

[0106] The above description is only by way of illustration of certain exemplary embodiments of the present invention. It is undoubted that those skilled in the art can modify the described embodiments in various ways without departing from the spirit and scope of the present invention. Therefore, the above drawings and descriptions are illustrative in nature and should not be construed as limiting the scope of protection of the claims of the present invention.

Claims

1. A text learning and proofreading system based on image and text recognition, characterized in that: Including: A user login module, which is used to help users register and log in to the graphic recognition system, and then perform detection and recognition of graphic images. Whenever a new user registers, the user name and password of the new user will be recorded in the user table. A graphic management module, which is responsible for managing the graphic information input by users. When users input graphics in the system, the graphic information will be recorded in the graphic data table. Recording the graphic information can ensure that every recognized graphic can be traced, facilitating future reference and modification. A graphic recognition module, which is used to receive the graphic data input by the graphic management module and perform text detection, text adjustment, and text recognition on the received graphic data. The graphic recognition module includes: A text detection module, which is used to perform text detection on the graphic data input by the graphic management module received by the graphic recognition module. The text detection includes homophone detection, misspelling detection, and line detection. A text adjustment module, which is used to adjust the graphic data detected by the text detection module. The text adjustment includes homophone adjustment, misspelling adjustment, and position adjustment. A text recognition module, which is used to perform text recognition on the graphic data adjusted by the text adjustment module. The text recognition module includes the following working steps: A1. To fill the fine holes inside the text strokes, use the flood fill algorithm to fill the background with white pixel points, perform image NOT operation on the filled image, and perform image XOR operation on the original image and the image after the NOT operation. Through these three steps, the small holes inside the text strokes can be completely filled. A2. There are still some isolated small dots in the stroke area, which are eliminated by opening operation. A3, the stroke image is processed with three different weights of RGB to obtain a grayscale image. The calculation formula for grayscale processing is as follows: Among them, R, G, B represent the values ​​of the three primary colors of the leaf vein segmentation image - red, green, and blue, and "Gray" represents the grayscale value; A4. To retain more details of the strokes, use median filtering to smooth the outline of the text and remove noise points, specifically including the following steps: A41, the pixel values ​​of the stroke image are divided into [1, 2, ..., l] levels, n i It is used to represent the number of image pixel values. Therefore, the calculation formula for the total pixel value of the stroke image is as follows: ; A42, where the frequency of a single pixel in the image is p i The calculation formula is as follows: ; A43, define two variables as the sum of the frequency values ​​of local variables w0 and w1. The relationship between the two is shown in the following formula: ; A44, the foreground pixel frequency u0 and background pixel frequency u1 of the stroke area image are as follows: in , where U T Represents the sum of foreground pixel frequency u0 and background pixel frequency u1; A5. Use the Otsu method to perform binary processing on the image. A6. To measure the stroke length, finally incorporate the original morphological stroke algorithm to construct a thinning algorithm to obtain a single-pixel stroke line without burrs. A7. Obtain the text to be recognized by combining the obtained single-pixel stroke lines. A user management module, which is used to manage the user's account and maintain user information. A recognition result management module, which is responsible for managing the recognition results. Whenever a new graphic is input into the system, the recognized text content will be stored in the recognition result data table.

2. A text learning and proofreading system based on image and text recognition according to claim 1, characterized in that: The text detection module includes: A homophone detection module, which is used to detect homophones in the graphic data. The homophones include but are not limited to the number "0" and the letter "O", the number "1" and the letter "I", the Chinese characters "妹" and "妺", and the punctuation mark "." and the punctuation symbol ",". A misspelling detection module, which is used to detect misspelled words in the graphic data. A line detection module, which is used to perform position detection and line segmentation on the text in the graphic data.

3. A text learning and proofreading system based on image and text recognition according to claim 2, characterized in that: The text adjustment module comprises: A position adjustment module, which is used to adjust the position of the same line of text detected by the line detection module to ensure that the same line of text is on the same horizontal line; A wrong character adjustment module, which is used to automatically adjust the wrong characters detected by the wrong character detection module; The easily confused character adjustment module is used to select matching characters in combination with the context of the easily confused characters and display the replacement results.

4. A text learning and proofreading system based on image and text recognition according to claim 3, characterized in that: The easily confused word adjustment module includes the following working steps: B1, when recognizing easily confused characters, the recognition method based on the text recognition module obtains the vectors of each stroke of the easily confused characters, thereby combining and obtaining the easily confused character vector; B2, when recognizing the easily confused character context, the recognition method based on the text recognition module obtains the vector of each stroke of the easily confused character context, thereby combining to obtain the context vector; B3, filter out useless features in the easily confused word vector feature information, use the activation function as the gate state, and then multiply the easily confused word vector feature by the point multiplication, and then use the activation function to obtain the gate unit to filter the features; B4, use the attention mechanism to strengthen the key vector feature information in the context, and obtain the embedding vector t and the feature representation of the text according to the vector feature type. , through t T , score each feature in the text to perceive the important information in the text, as shown in the following formula: ; B5, we can get the feature representation of the context after evaluation , as shown below: in is the attention vector, is the context vector matrix; B6, query representation obtained by fusion of vector feature information and context feature representation , and then calculated by the maximum similarity (MaxSim), through and Calculate the score between the easily confused word vector and the context vector, which is the sum of the maximum similarities between each easily confused word vector and the remaining context vector, as shown in the following formula: .

5. The text learning and proofreading system based on image and text recognition according to claim 4 is characterized in that: The specific work steps include: S1, the user logs into the text learning and proofreading system through the login interface; S2, determine whether the current user is logging in for the first time. If the judgment result is yes, the user registers through the login interface and the registration information is recorded in the user table. If the judgment result is no, execute step S3; S3, after the user inputs the image and text information, the image and text information is recorded in the image and text data table; S4, performing text detection on the graphic information input by the user, wherein the text detection includes wrong character detection and line detection; S5, performing text adjustment on the image and text data detected by the text detection module, wherein the text adjustment includes wrong character adjustment and position adjustment; S6, performing text recognition and easily confused word recognition, performing easily confused word adjustment on the easily confused words, and transmitting the recognition results to a recognition result data table; S7, displaying the text recognition result and the easily-confusable character adjustment result.