Character position and content identification method based on AI

By introducing AI-based text position and content recognition methods in OCR technology, using multi-scale feature extraction and context understanding technology, the problem of low recognition accuracy of existing OCR technology in complex scenarios is solved, and higher recognition accuracy is achieved. stability.

CN119445589AActive Publication Date: 2025-02-14TAIYUAN YISI SOFTWARE TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411490258.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-24
Publication Date
2025-02-14
Estimated Expiration
2044-10-24

AI Technical Summary

Technical Problem

The existing OCR technology is low in recognition accuracy when dealing with complex scenes, low contrast text, distorted or skewed text, and difficult to cope with multi-scale, diverse images and complex contexts, resulting in large errors in recognition results, affecting data reliability and Widely applicable.

Method used

Using AI-based text position and content recognition methods, accurate positioning and content recognition of text is achieved through image preprocessing, multi-scale feature extraction, bidirectional LSTM model and attention mechanism, connection timing classification algorithm and language model.

Benefits of technology

It significantly improves the accuracy and stability of text recognition, enhances the system's processing ability of complex and deformed images, improves the robustness and adaptability of recognition, and ensures the accuracy and consistency of recognition results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119445589A_ABST
    Figure CN119445589A_ABST
Patent Text Reader

Abstract

The invention discloses a character position and content recognition method based on AI, and relates to the technical field of character recognition, and the method comprises the steps: extracting sequence features from multi-scale fusion features through a bidirectional LSTM model, carrying out the aggregation through combining context information, introducing an attention mechanism, and outputting context features. And performing character prediction on the context features through a connection time sequence classification CTC algorithm, outputting a prediction probability, and decoding a prediction result in combination with a language model LM to obtain a decoded character sequence. Furthermore, the decoding result is corrected through a self-adaptive correction model, and a final recognition result is output. Results of all the steps are summarized, intelligent decision making and feedback adjustment are conducted on the recognition result through the comprehensive evaluation coefficient Sfinal, the system can dynamically adapt to different input conditions through a series of optimization measures, the recognition precision is improved, and the self-adaptability and robustness of the system are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of text recognition, and in particular to a method for identifying text position and content based on AI. Background Art

[0002] With the growing development of artificial intelligence (AI) technology, computer vision has become one of the important areas of AI application. Computer vision involves the processing and analysis of images and videos, and one of the key tasks is text recognition (OCR). The application of text recognition OCR technology is very extensive, especially in the logistics weighing process. The AI-based text location and content recognition method further expands the capabilities of traditional OCR. By combining image preprocessing, multi-scale feature extraction, sequence modeling and context understanding, it can achieve more accurate text positioning and content recognition for documents such as identity cards, driver's licenses, vehicle registration certificates, vehicle lists, as well as logistics documents, containers, train compartment identification and cargo surface coding information.

[0003] In existing text recognition systems, traditional OCR technology is often affected by factors such as image quality, irregular text arrangement, and background noise, resulting in reduced recognition accuracy. Traditional methods usually perform poorly when dealing with complex scenes such as handwriting, low-contrast text, distorted or tilted text, etc. In existing technologies, most systems lack the ability to process multi-scale and diverse images, and have difficulty coping with complex contexts, which in turn affects the overall recognition effect and the breadth of application;

[0004] These current situations and shortcomings are mainly due to the limitations of traditional OCR technology in algorithm design, such as single-scale feature extraction and lack of effective context modeling. The existence of these problems not only affects the performance of the system in practical applications, but may also lead to serious errors in recognition results, especially when dealing with documents with complex backgrounds or mixed fonts. These errors will significantly affect the reliability and consistency of the data. In addition, in fields such as industry, medicine, and finance that require extremely high data accuracy, low-precision text recognition may also lead to information errors, low work efficiency, and even serious economic losses. Summary of the invention

[0005] In view of the deficiencies of the prior art, the present invention provides an AI-based text position and content recognition method, which solves the problems mentioned in the background technology.

[0006] To achieve the above objectives, the present invention is implemented by the following technical solutions: A method for identifying text position and content based on AI, comprising the following steps:

[0007] S1. Preprocess the input image, output the preprocessed image IMGdenoise, obtain the standard image IMGnom through multi-scale normalization, use the spatial transformer network STN variant model to calibrate the standard image IMGnom, and output the calibrated image IMGcorr;

[0008] S2. Using OCR text detection technology, the text area is detected from the corrected image IMGcorr, and then the multi-scale convolutional neural network MS-CNN is used to extract the multi-scale feature Fms from the text area of ​​the corrected image IMGcorr. Then, multi-scale feature fusion is performed based on the extracted multi-scale feature Fms to obtain the multi-scale fusion feature Ffusion;

[0009] S3. Use the bidirectional LSTM model to extract sequence features from the fused multi-scale fusion feature Ffusion, aggregate them with context information, output the aggregated sequence feature Fseq, and introduce the attention mechanism to output the context feature Fcontext.

[0010] S4, using the linked temporal classification CTC algorithm to predict the characters of the context feature Fcontext, output the prediction probability Pctc, and decode the prediction probability Pctc in combination with the language model LM to obtain the decoded text sequence Tdecoded;

[0011] S5, processing the decoded text sequence Tdecoded, adaptively adjusting the recognition result based on the context, outputting the recognition result Tfinal, and adaptively correcting the recognition result Tfinal to obtain the corrected result Tadaptive;

[0012] S6. Summarize the corrected image IMGcorr, multi-scale fusion feature Efusion, context feature Fcontext, decoded text sequence Tdecoded and correction result Tadaptive, output the evaluation function fi(Params), and perform comprehensive summary calculation to output the comprehensive evaluation coefficient Sfinal, and compare and evaluate the preset recognition threshold Threshold with the comprehensive evaluation coefficient Sfinal, and output the action decision Execfinal.

[0013] Preferably, said S1 includes S11, S12 and S13;

[0014] S11, by collecting text image input, performing image denoising and color space conversion processing on the image, and outputting a pre-processed image IMGdenoise, so as to ensure that the text in the image can be accurately processed regardless of its tilt, bending or other deformation conditions, and then performing multi-scale normalization processing on the output pre-processed image IMGdenoise, and outputting a standard image IMGnom;

[0015] The pre-processed image IMGdenoise and the standard image IMGnom are processed in the following manner;

[0016] IMGdenoise=Denoise(IMG)IMGcolor=ColorTransform(IMGdenoise)

[0017]

[0018] In the formula, Denoise(IMG) represents the denoising function, which is used for denoising operation, ColorTransform(IMGdenoise) represents the color space conversion function, which is used for color space conversion operation, and IMGnom (s) Represents the standard image normalized at scale s, IMGdenoise( s ) represents the preprocessed image at scale s, μIMG (s) represents the mean of the image at scale s, σIMG( s ) represents the standard deviation of the image at scale s, and IMGcolor represents the color conversion function;

[0019] S12, the output standard image IMGnom is then rectified using a spatial transformer network STN variant model, and a rectified image IMGcorr is output;

[0020] The corrected image IMGcorr is obtained by outputting the following spatial transformer network STN variant model;

[0021]

[0022] In the formula, S represents the total number of different scales, λs represents the weight coefficient of the sth scale, represents the transformation function of the spatial transformation network variant model at scale s;

[0023] S13. Use the EAST model in OCR to obtain the bounding box of the corrected image IMGcorr through convolutional layers and multi-scale image pyramid processing. In the EAST model, branches 1 and 2 are responsible for detecting text boundaries, while branches 3 and 4 are responsible for detecting the orientation of the text bounding box. The detected area is then scaled using ROIPooling technology to ensure that the feature map maintains high resolution, reduce the impact of text size changes, and output optimized text areas.

[0024] Preferably, S2 includes S21 and S22;

[0025] S21. Use the multi-scale convolutional neural network MS-CNN to perform convolution operations on the text area of ​​the corrected image IMGcorr at different scales to extract features at different levels, including edge features, texture features, and shape features. At the same time, the convolutional features are pooled to optimize the feature dimensions while retaining the image information, enhancing the model's anti-interference ability, and applying the nonlinear activation function ReLU to perform nonlinear transformation on the convolution results to extract multi-scale features Fms.

[0026] The multi-scale feature Fms is calculated and obtained by the following algorithm formula;

[0027]

[0028] In the formula, α s represents the weight coefficient of the sth scale, σ represents the nonlinear activation function, Represents the operation of applying a convolutional neural network CNN at scale s, which includes multiple layers of convolution, pooling, and nonlinear activation;

[0029] S22, by performing a pooling operation on the multi-scale feature Fms, optimizing the amount of calculation and removing redundant information, and then weighted summing the pooled features at different scales s to obtain the multi-scale fusion feature Ffusion;

[0030]

[0031] In the formula, β s represents the fusion weight coefficient of the s-th scale, and Pool represents the pooling operation.

[0032] Preferably, said S3 includes S31 and S32;

[0033] S31, using the bidirectional LSTM in the CRNN model to extract sequence features from the multi-scale fusion feature Ffusion, extracting the context information of each time step through two LSTM layer models, wherein one of the two LSTM layer models processes the sequence from front to back and the other processes the sequence from back to front, and outputs the aggregated sequence feature Fseq;

[0034] The aggregate sequence feature Fseq is output by the following model;

[0035] Fseq = hBiLSTM (Ffusion);

[0036] In the formula, hBiLSTM represents a bidirectional LSTM function, which is used to convert the input multi-scale fusion feature Ffusion into a sequence feature;

[0037] S32, by introducing the output context feature Fcontext of the attention mechanism, dynamically adjust the degree of attention to each time step;

[0038] The context feature Fcontext is obtained by introducing the following attention mechanism and context modeling formula;

[0039]

[0040] In the formula, T represents the number of time steps contained in the sequence feature, t represents the time step, and γ t represents the attention weight at time step t, Attention represents the attention machine function, and Fseq (t) Represents the feature vector of the aggregated sequence feature Fseq at time step t.

[0041] Preferably, said S4 includes S41 and S42;

[0042] S41, using the connection temporal classification algorithm CTC, calculate the probability of each character in each time step, perform character prediction on the context feature Fcontext, and output the prediction probability Pctc;

[0043] The predicted probability Pctc is calculated by the following algorithm formula:

[0044]

[0045] In the formula, CSeq represents the character sequence, CTC represents the connection time classification, and Fcontext (t) represents the feature representation of the context feature vector at time step t.

[0046] Preferably, S42, combining the prediction probability Pctc output by the connection time series classification algorithm CTC with the language model LM, decoding the predicted character sequence through the n-gram model in the language model LM combined with BeamSearch, and obtaining the decoded text sequence Tdecoded;

[0047] The decoded text sequence Tdecoded is obtained by calculating the following language model LM decoding formula;

[0048]

[0049] Where N represents the number of LMs of different n-geam language models, LMdecode represents the decoding function performed by the language model LM, and δ n Represents the weight coefficient of n-gram in the language model. n-gram represents the phonetic model LM of the next character predicted by the nth preceding character.

[0050] Preferably, said S5 includes S51 and S52;

[0051] S51, further processing the decoded text sequence Tdecoded by using an optimization method based on edit distance, including removing redundant characters and correcting recognition errors, and adaptively adjusting based on context, and outputting a recognition result Tfinal;

[0052] The recognition result Tfinal is obtained by calculating the following edit distance optimization algorithm;

[0053] Tfinal=Optimize(Tdecoded, GT, Sim);

[0054] In the formula, Sim represents the semantic similarity function, Optimize represents the optimization function, which is used to integrate the results of edit distance and semantic similarity, and GT represents the target text.

[0055] Preferably, S52, inputting the obtained recognition result Tfinal into the adaptive correction model, adaptively correcting the coherence and readability of the text in the context, and outputting the correction result Tadaptive;

[0056] The correction result Tadaptive is output through the following adaptive correction model;

[0057] Tadaptive=Tfinal+ε·Adapt(Tfinal,Sim);

[0058] Where Adapt represents the adaptive correction function, and ε represents the correction coefficient.

[0059] Preferably, said S6 includes S61 and S62;

[0060] S61, comprehensively summarize the output correction image IMGcorr, multi-scale fusion feature Efusion, context feature Fcontext, decoded text sequence Tdecoded and correction result Tadaptive, and perform comprehensive calculation to output evaluation function fi(Params), wherein the evaluation function fi(Params)=f{IMGcorr, Efusion, Fcontext, Tdecoded, Tadaptive}(Params), and then perform correlation calculation to output comprehensive evaluation coefficient Sfinal;

[0061] The comprehensive evaluation coefficient Sfinal is calculated and output by the following algorithm formula;

[0062]

[0063] Where η i represents the number of the i-th step, I represents the number of different processing steps, where the processing steps include image correction, feature extraction, decoding and correction, and fi(Params) represents the evaluation function of the i-th step.

[0064] Preferably, S62, the user presets the recognition threshold Threshold based on the recognition requirement, inputs the comprehensive evaluation coefficient Sfinal for comparative evaluation, and outputs the action decision Execfinal according to the evaluation result, outputs the recognition result, generates a report and automatically archives it. The specific evaluation content is as follows;

[0065] When the comprehensive evaluation coefficient Sfinal ≥ the recognition threshold Threshold, it means that the current text recognition is normal, the automation task is executed and the action decision Execfinal is output;

[0066] When the comprehensive evaluation coefficient Sfinal is less than the recognition threshold Threshold, it indicates that the current text recognition is abnormal, triggering the abnormality handling process and prompting manual intervention in the recognition;

[0067] The action decision Execfinal is executed by the following algorithm:

[0068] Execfinal=Action(Sfinal,Threshold)Feedback;

[0069] In the formula, Action represents the execution action function, which performs intelligent operations based on the evaluation results and the set recognition threshold Threshold, and Feedback represents the feedback mechanism function, which is used to adjust the model parameters to optimize future recognition performance.

[0070] The present invention provides a method for identifying text position and content based on AI, which has the following beneficial effects:

[0071] (1) In the image preprocessing stage, this method generates a preprocessed image IMGdenoise by performing image denoising and color space conversion on the input image, and further obtains the standard image IMGnom through multi-scale normalization. These operations ensure that the text in the image can be accurately processed regardless of its tilt, curvature or other deformation. By introducing the spatial transformer network STN variant model, the standard image is corrected and the corrected image IMGcorr is finally output. The optimization of these steps greatly improves the system's ability to handle complex and deformed images, reduces recognition errors caused by image distortion, and thus improves recognition accuracy and stability.

[0072] (2) In the feature extraction and fusion stage, this method uses a multi-scale convolutional neural network MS-CNN to extract features from the corrected image IMGcorr at different scales to obtain features Fms at different levels, including edge, texture, and shape features. Subsequently, the feature dimension is optimized through a pooling operation, and the nonlinear activation function ReLU is applied to perform a nonlinear transformation on the convolution result to finally extract multi-scale features. By pooling and fusing these multi-scale features, the multi-scale fusion feature Ffusion is obtained. This process ensures that the system can retain important information when faced with complex image features, and enhances the robustness and accuracy of recognition by fusing features at different scales.

[0073] (3) In the recognition stage, this method extracts sequence features Fseq from multi-scale fusion features Ffusion through a bidirectional LSTM model, aggregates them in combination with context information, introduces an attention mechanism, and outputs context features Fcontext. Characters are predicted for context features through the connected temporal classification CTC algorithm, and the prediction probability Pctc is output. The prediction results are decoded in combination with the language model LM to obtain the decoded text sequence Tdecoded. Furthermore, the decoding results are corrected through an adaptive correction model, and the final recognition result Tadaptive is output. Finally, the results of each step are summarized, and the recognition results are intelligently decided and feedback adjusted through the comprehensive evaluation coefficient Sfinal. This series of optimization measures enables the system to dynamically adapt to different input conditions, which not only improves the recognition accuracy, but also improves the system's adaptability and robustness, thereby maintaining efficient recognition performance in various complex scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0074] Figure 1 The figure is a schematic diagram of the steps of the text position and content recognition method based on AI of the present invention. DETAILED DESCRIPTION

[0075] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0076] Example 1

[0077] See also Figure 1 The present invention provides a method for identifying text position and content based on AI. To achieve the above purpose, the present invention is implemented by the following technical scheme, including the following steps:

[0078] S1. Preprocess the input image, output the preprocessed image IMGdenoise, obtain the standard image IMGnom through multi-scale normalization, use the spatial transformer network STN variant model to calibrate the standard image IMGnom, and output the calibrated image IMGcorr;

[0079] S2. Using OCR text detection technology, the text area is detected from the corrected image IMGcorr, and then the multi-scale convolutional neural network MS-CNN is used to extract the multi-scale feature Fms from the text area of ​​the corrected image IMGcorr. Then, multi-scale feature fusion is performed based on the extracted multi-scale feature Fms to obtain the multi-scale fusion feature Ffusion;

[0080] S3. Use the bidirectional LSTM model to extract sequence features from the fused multi-scale fusion feature Ffusion, aggregate them with context information, output the aggregated sequence feature Fseq, and introduce the attention mechanism to output the context feature Fcontext.

[0081] S4, using the linked temporal classification CTC algorithm to predict the characters of the context feature Fcontext, output the prediction probability Pctc, and decode the prediction probability Pctc in combination with the language model LM to obtain the decoded text sequence Tdecoded;

[0082] S5, processing the decoded text sequence Tdecoded, adaptively adjusting the recognition result based on the context, outputting the recognition result Tfinal, and adaptively correcting the recognition result Tfinal to obtain the corrected result Tadaptive;

[0083] S6. Summarize the corrected image IMGcorr, multi-scale fusion feature Efusion, context feature Fcontext, decoded text sequence Tdecoded and correction result Tadaptive, output the evaluation function fi(Params), and perform comprehensive summary calculation to output the comprehensive evaluation coefficient Sfinal, and compare and evaluate the preset recognition threshold Threshold with the comprehensive evaluation coefficient Sfinal, and output the action decision Execfinal.

[0084] In this embodiment, in the S1 step of the method, through the application of image denoising, multi-scale normalization and spatial transformation network STN, the system effectively corrects the distortion and deformation in the input image and outputs a high-quality corrected image IMGcorr. This lays a solid foundation for subsequent feature extraction. In S2, the multi-scale convolutional neural network MS-CNN is used to extract and fuse multi-scale features Ffusion, which enhances the system's ability to capture image details, especially when dealing with complex backgrounds or diverse images, and significantly improves the accuracy of feature extraction. In S3, the sequence feature Fseq is extracted by the bidirectional LSTM model and the context feature Fcontext is generated in combination with the attention mechanism. The system can better understand the contextual relationship between characters and improve the accuracy and coherence of character recognition. Subsequently, in S4 and S5, the system uses the connection time series classification CTC algorithm and the language model LM to predict and decode the characters, and optimizes the recognition result Tadaptive through the adaptive correction mechanism, ensuring the semantic and grammatical consistency of the final output text sequence. Finally, through the comprehensive evaluation and intelligent decision-making of S6, the system can automatically judge the quality of the recognition results and make corresponding execution decisions Execfinal according to the preset threshold Threshold, thereby achieving continuous self-optimization. Compared with traditional technologies, this method has made important breakthroughs in image correction, multi-scale feature extraction, context modeling and adaptive correction. These improvements significantly improve the recognition performance of the system when dealing with complex scenes, different fonts and various text layouts, and ultimately greatly improve the accuracy, stability and intelligence level of text recognition.

[0085] Example 2

[0086] This embodiment is explained in Example 1, please refer to Figure 1 , specifically: S1 includes S11, S12 and S13;

[0087] S11, by collecting text image input, performing image denoising and color space conversion processing on the image, and outputting a pre-processed image IMGdenoise, so as to ensure that the text in the image can be accurately processed regardless of its tilt, bending or other deformation conditions, and then performing multi-scale normalization processing on the output pre-processed image IMGdenoise, and outputting a standard image IMGnom;

[0088] The preprocessed image IMGdenoise and the standard image IMGnom are processed in the following way;

[0089] IMGdenoise=Denoise(IMG)IMGcolor=ColorTransform(IMGdenoise)

[0090]

[0091] In the formula, Denoise(IMG) represents the denoising function, which is used for denoising operation, ColorTransform(IMGdenoise) represents the color space conversion function, which is used for color space conversion operation, and IMGnom (s) Represents the standard image normalized at scale s, IMGdenoise( s ) represents the preprocessed image at scale s, μIMG (s) represents the mean of the image at scale s, σIMG( s ) represents the standard deviation of the image at scale s, and IMGcolor represents the color conversion function;

[0092] S12, the output standard image IMGnom is then rectified using a spatial transformer network STN variant model, and a rectified image IMGcorr is output;

[0093] The corrected image IMGcorr is obtained through the output of the following spatial transformer network STN variant model;

[0094]

[0095] In the formula, S represents the total number of different scales, λs represents the weight coefficient of the sth scale, represents the transformation function of the spatial transformation network variant model at scale s;

[0096] S13. Use the EAST model in OCR to obtain the bounding box of the corrected image IMGcorr through convolutional layers and multi-scale image pyramid processing. In the EAST model, branches 1 and 2 are responsible for detecting text boundaries, while branches 3 and 4 are responsible for detecting the orientation of the text bounding box. The detected area is then scaled using ROIPooling technology to ensure that the feature map maintains high resolution, reduce the impact of text size changes, and output optimized text areas.

[0097] In this embodiment, the method achieves significant technical progress in image preprocessing and correction by implementing step S1. Specifically, through the image denoising and color space conversion processing in S11, the system can effectively remove the noise in the image, and generate a standard image IMGnom through multi-scale normalization processing. These operations ensure that no matter how the text in the input image is tilted, bent or otherwise deformed, the system can accurately identify and process it, thereby greatly improving the accuracy and stability of image processing. Then in S12, the standard image is corrected using the spatial transformation network STN variant model, and the corrected image IMGcorr is further output. This correction process eliminates the geometric deformation in the image, making subsequent feature extraction and recognition more reliable and accurate. Compared with traditional technologies, this method has significantly improved the accuracy of image preprocessing and correction. By introducing multi-scale normalization and STN models, the system performs better when processing complex and deformed images, greatly reducing recognition errors caused by poor image quality. Ultimately, these improvements effectively improve the overall performance of text recognition, ensure the adaptability and robustness of the system in complex scenes, and significantly improve the accuracy and consistency of recognition results.

[0098] Example 3

[0099] This embodiment is explained in Example 2. Please refer to Figure 1 , specifically: S2 includes S21 and S22;

[0100] S21. Use the multi-scale convolutional neural network MS-CNN to perform convolution operations on the text area of ​​the corrected image IMGcorr at different scales to extract features at different levels, including edge features, texture features, and shape features. At the same time, the convolutional features are pooled to optimize the feature dimensions while retaining the image information, enhancing the model's anti-interference ability, and applying the nonlinear activation function ReLU to perform nonlinear transformation on the convolution results to extract multi-scale features Fms.

[0101] The multi-scale feature Fms is calculated and obtained by the following algorithm formula;

[0102]

[0103] In the formula, α s represents the weight coefficient of the sth scale, σ represents the nonlinear activation function, Represents the operation of applying a convolutional neural network CNN at scale s, which includes multiple layers of convolution, pooling, and nonlinear activation;

[0104] S22, by performing a pooling operation on the multi-scale feature Fms, optimizing the amount of calculation and removing redundant information, and then weighted summing the pooled features at different scales s to obtain the multi-scale fusion feature Ffusion;

[0105]

[0106] In the formula, β s represents the fusion weight coefficient of the s-th scale, and Pool represents the pooling operation.

[0107] In this embodiment, the method achieves significant technical improvements in feature extraction and fusion by implementing step S2. Specifically, in S21, a multi-scale convolution operation is performed on the corrected image IMGcorr using a multi-scale convolution neural network MS-CNN, and the system can extract multi-level image features from different scales, including edge, texture and shape features. The extraction of these features not only optimizes the feature dimension and reduces the computational complexity through convolution and pooling operations, but also further enhances the model's adaptability and anti-interference ability to complex images by applying nonlinear activation functions such as ReLU, and finally generates a multi-scale feature Fms. In S22, by performing pooling operations on these multi-scale features, removing redundant information, and obtaining a multi-scale fusion feature Ffusion after weighted summation, the system effectively fuses image information at different scales, making the feature representation more comprehensive and robust. This method has significantly improved the accuracy of feature extraction and the efficiency of feature fusion. By introducing MS-CNN and a multi-scale fusion strategy, the system can more accurately capture the detail information in the image, and improve the anti-interference and recognition accuracy of the model through the multi-level fusion of features. These improvements enable the system to perform better when processing complex backgrounds and diverse images, ultimately improving the overall effect of text recognition and ensuring the stability and reliability of the recognition results.

[0108] Example 4

[0109] This embodiment is explained in Example 3, please refer to Figure 1 , specifically: S3 includes S31 and S32;

[0110] S31. Use the bidirectional LSTM in the CRNN model to extract sequence features from the multi-scale fusion feature Ffusion, and use two LSTM layer models to extract the context information of each time step. One of the two LSTM layer models processes the sequence from front to back, and the other processes the sequence from back to front, and outputs the aggregated sequence feature Fseq.

[0111] The aggregate sequence feature Fseq is output by the following model;

[0112] Fseq = hBiLSTM (Ffusion);

[0113] In the formula, hBiLSTM represents a bidirectional LSTM function, which is used to convert the input multi-scale fusion feature Ffusion into a sequence feature;

[0114] S32, by introducing the output context feature Fcontext of the attention mechanism, dynamically adjust the degree of attention to each time step;

[0115] The context feature Fcontext is obtained by introducing the following attention mechanism and context modeling formula;

[0116]

[0117] In the formula, T represents the number of time steps contained in the sequence feature, t represents the time step, and γ t represents the attention weight at time step t, Attention represents the attention machine function, and Fseq (t) Represents the feature vector of the aggregated sequence feature Fseq at time step t.

[0118] In this embodiment, the method achieves significant technical progress in sequence feature extraction and context modeling by implementing step S3. In S31, the bidirectional LSTM model is used to extract sequence features from the multi-scale fusion feature Ffusion, and the system can capture the context information of the character sequence from both the forward and backward directions to generate the aggregate sequence feature Fseq. This bidirectional processing method significantly improves the system's ability to understand the dependencies between characters, especially when processing long texts or complex character arrangements, and can better retain context information. In S32, the attention mechanism is introduced so that the system can dynamically adjust the degree of attention to different time steps and output the context feature Fcontext. In this way, the system can focus on the most important features for the recognition results, so that the accuracy and reliability of recognition are further improved. This method has obvious advantages in sequence modeling and context understanding. Through the combination of bidirectional LSTM and attention mechanism, the system can not only capture the complex relationship between characters more accurately, but also optimize the recognition effect by focusing on important features. These improvements make the system perform better when processing complex texts, and ultimately greatly improve the accuracy, coherence and context consistency of text recognition.

[0119] Example 5

[0120] This embodiment is explained in Example 4. Please refer to Figure 1 , specifically: S4 includes S41 and S42;

[0121] S41, using the connection temporal classification algorithm CTC, calculate the probability of each character in each time step, perform character prediction on the context feature Fcontext, and output the prediction probability Pctc;

[0122] The predicted probability Pctc is calculated by the following algorithm formula;

[0123]

[0124] In the formula, CSeq represents the character sequence, CTC represents the connection time classification, and Fcontext( t ) represents the feature representation of the context feature vector at time step t.

[0125] S42, combining the prediction probability Pctc output by the connection time series classification algorithm CTC with the language model LM, decoding and predicting the character sequence through the n-gram model in the language model LM combined with BeamSearch, and obtaining the decoded text sequence Tdecoded;

[0126] The decoded text sequence Tdecoded is calculated by the following language model LM decoding formula;

[0127]

[0128] Where N represents the number of LMs of different n-geam language models, LMdecode represents the decoding function performed by the language model LM, and δ n Represents the weight coefficient of n-gram in the language model. n-gram represents the phonetic model LM of the next character predicted by the nth preceding character.

[0129] In this embodiment, the method achieves significant technical improvements in character prediction and decoding by implementing step S4. In S41, the connected temporal classification CTC algorithm is adopted, and the system can calculate the probability of each character in each time step without explicit alignment, perform character prediction on the context feature Fcontext, and output the predicted probability Pctc. The introduction of the CTC algorithm solves the problem of inconsistency between the length of the character sequence and the length of the input sequence, so that the system can flexibly process input data of different lengths and improve the accuracy of character prediction. In S42, by combining the predicted probability Pctc output by CTC with the language model LM, especially using the n-gram model to decode the character sequence, the system can further optimize the decoding process and generate a more accurate and coherent decoded text sequence Tdecoded.

[0130] Example 6

[0131] This embodiment is explained in Example 5. Please refer to Figure 1 , specifically: S5 includes S51 and S52;

[0132] S51, further processing the decoded text sequence Tdecoded by using an optimization method based on edit distance, including removing redundant characters and correcting recognition errors, and adaptively adjusting based on context, and outputting a recognition result Tfinal;

[0133] The recognition result Tfinal is calculated by the following edit distance optimization algorithm;

[0134] Tfinal=Optimize(Tdecoded, GT, Sim);

[0135] In the formula, Sim represents the semantic similarity function, Optimize represents the optimization function, which is used to integrate the results of edit distance and semantic similarity, and GT represents the target text.

[0136] S52, inputting the obtained recognition result Tfinal into the adaptive correction model, adaptively correcting the coherence and readability of the text in the context, and outputting the correction result Tadaptive;

[0137] The correction result Tadaptive is output through the following adaptive correction model;

[0138] Tadaptive=Tfinal+ε·Adapt(Tfinal,Sim);

[0139] Where Adapt represents the adaptive correction function, and ε represents the correction coefficient.

[0140] In this embodiment, the method achieves significant technical improvement in the optimization and correction of recognition results by implementing step S5. In S51, the system further processes the decoded text sequence Tdecoded through an optimization method based on edit distance, removes redundant characters and corrects recognition errors. At the same time, the recognition result is adaptively adjusted in combination with the semantic similarity function Sim, and a more accurate recognition result Tfinal is output. This process ensures the accuracy of the recognition result at the character level and the semantic level, so that the system can better cope with complex text recognition tasks. In S52, by inputting the recognition result Tfinal into the adaptive correction model, the system further optimizes the coherence and readability of the text in the context, and finally outputs the correction result Tadaptive. This adaptive correction method makes the recognition result more natural and in line with language habits, and the method has significant improvements in the accuracy of the recognition result and the coherence of the text. By combining the optimization method of edit distance and semantic similarity, and the adaptive correction model, the system not only greatly reduces recognition errors, but also significantly improves the readability and semantic consistency of the final output text. These improvements ensure that the system can generate more accurate, consistent, and natural recognition results when processing complex text and diverse inputs, ultimately improving the overall performance and application value of text recognition.

[0141] Example 7

[0142] This embodiment is explained in Example 6. Please refer to Figure 1 , specifically: S6 includes S61 and S62;

[0143] S61, comprehensively summarize the output correction image IMGcorr, multi-scale fusion feature Efusion, context feature Fcontext, decoded text sequence Tdecoded and correction result Tadaptive, and perform comprehensive calculation to output evaluation function fi(Params), evaluation function fi(Params)=f{IMGcorr, Efusion, Fcontext, Tdecoded, Tadaptive}(Params), and then perform correlation calculation to output comprehensive evaluation coefficient Sfinal;

[0144] The comprehensive evaluation coefficient Sfinal is calculated and output by the following algorithm formula;

[0145]

[0146] Where η i represents the number of the i-th step, I represents the number of different processing steps, where the processing steps include image correction, feature extraction, decoding and correction, and fi(Params) represents the evaluation function of the i-th step.

[0147] S62, the user presets the recognition threshold Threshold based on the recognition requirements, inputs the comprehensive evaluation coefficient Sfinal for comparative evaluation, and outputs the action decision Execfinal according to the evaluation result, outputs the recognition result, generates a report and automatically archives it. The specific evaluation content is as follows;

[0148] When the comprehensive evaluation coefficient Sfinal ≥ the recognition threshold Threshold, it means that the current text recognition is normal, the automation task is executed and the action decision Execfinal is output;

[0149] When the comprehensive evaluation coefficient Sfinal is less than the recognition threshold Threshold, it indicates that the current text recognition is abnormal, triggering the abnormality handling process and prompting manual intervention in the recognition;

[0150] The action decision Execfinal is executed through the following algorithm;

[0151] Execfinal=Action(Sfinal,Threshold)Feedback;

[0152] In the formula, Action represents the execution action function, which performs intelligent operations based on the evaluation results and the set recognition threshold Threshold, and Feedback represents the feedback mechanism function, which is used to adjust the model parameters to optimize future recognition performance.

[0153] In this embodiment, the method achieves systematic improvement in comprehensive evaluation and intelligent decision-making by implementing step S6. In S61, the system comprehensively summarizes the correction image IMGcorr, multi-scale fusion feature Efusion, context feature Fcontext, decoded text sequence Tdecoded and correction result Tadaptive outputted in the previous steps, and quantitatively evaluates the effect of each step by calculating the evaluation function fi (Params), and finally outputs the comprehensive evaluation coefficient Sfinal. This process ensures that the system comprehensively evaluates the contribution of each processing step as a whole, and ensures the quality and reliability of the final recognition result. In S62, by comparing and evaluating the comprehensive evaluation coefficient Sfinal with the preset recognition threshold Threshold, the system can make an automated decision Execfinal according to actual needs, such as outputting recognition results, generating reports or automatically archiving. If the recognition result does not meet the standard, the system can also trigger the exception handling process and prompt manual intervention, thereby ensuring the flexibility and safety of the recognition process. This method has significantly improved the intelligent level of evaluation and decision-making. Through comprehensive summary and precise quantitative evaluation, the system can fully and accurately grasp the contribution and effect of each processing step; and through intelligent decision-making and feedback mechanisms, the system achieves automated operation and continuous performance optimization. These improvements not only greatly improve the system's work efficiency and recognition accuracy, but also enhance the system's adaptability and reliability, enabling it to maintain efficient and stable performance in different application scenarios.

[0154] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. AI-based text position and content recognition method, characterized by: The following steps are involved: S1. Preprocess the input image, output the preprocessed image IMGdenoise, obtain the standard image IMGnom through multi-scale normalization, use the spatial transformer network STN variant model to calibrate the standard image IMGnom, and output the calibrated image IMGcorr; S2. Using OCR text detection technology, the text area is detected from the corrected image IMGcorr, and then the multi-scale convolutional neural network MS-CNN is used to extract the multi-scale feature Fms from the text area of ​​the corrected image IMGcorr. Then, multi-scale feature fusion is performed based on the extracted multi-scale feature Fms to obtain the multi-scale fusion feature Ffusion; S3. Use the bidirectional LSTM model to extract sequence features from the fused multi-scale fusion feature Ffusion, aggregate them with context information, output the aggregated sequence feature Fseq, and introduce the attention mechanism to output the context feature Fcontext. S4, using the linked temporal classification CTC algorithm to predict the characters of the context feature Fcontext, output the prediction probability Pctc, and decode the prediction probability Pctc in combination with the language model LM to obtain the decoded text sequence Tdecoded; S5, processing the decoded text sequence Tdecoded, adaptively adjusting the recognition result based on the context, outputting the recognition result Tfinal, and adaptively correcting the recognition result Tfinal to obtain the corrected result Tadaptive; S6. Summarize the corrected image IMGcorr, multi-scale fusion feature Efusion, context feature Fcontext, decoded text sequence Tdecoded and correction result Tadaptive, output the evaluation function fi(Params), and perform comprehensive summary calculation to output the comprehensive evaluation coefficient Sfinal, and compare and evaluate the preset recognition threshold Threshold with the comprehensive evaluation coefficient Sfinal, and output the action decision Execfinal.

2. The AI-based text position and content recognition method according to claim 1, characterized in that: Said S1 includes S11, S12 and S13; S11, by collecting text image input, performing image denoising and color space conversion processing on the image, outputting a pre-processed image IMGdenoise, and then performing multi-scale normalization processing on the pre-processed image IMGdenoise, and outputting a standard image IMGnom; The pre-processed image IMGdenoise and the standard image IMGnom are processed in the following manner; IMGdenoise=Denoise(IMG)IMGcolor=ColorTransform(IMGdenoise) In the formula, Denoise(IMG) represents the denoising function, which is used for denoising operation, ColorTransform(IMGdenoise) represents the color space conversion function, which is used for color space conversion operation, and IMGnom (s) Represents the standard image normalized at scale s, IMGdenoise( s ) represents the preprocessed image at scale s, μIMG (s) represents the mean of the image at scale s, σIMG( s ) represents the standard deviation of the image at scale s, and IMGcolor represents the color conversion function; S12, the output standard image IMGnom is then rectified using a spatial transformer network STN variant model, and a rectified image IMGcorr is output; The corrected image IMGcorr is obtained by outputting the following spatial transformer network STN variant model; In the formula, S represents the total number of different scales, λs represents the weight coefficient of the sth scale, represents the transformation function of the spatial transformation network variant model at scale s; S13. Use the EAST model in OCR to obtain the bounding box of the corrected image IMGcorr through convolutional layers and multi-scale image pyramid processing. In the EAST model, branches 1 and 2 are responsible for detecting text boundaries, while branches 3 and 4 are responsible for detecting the orientation of the text bounding box. The detected area is then scaled using ROIPooling technology to ensure that the feature map maintains high resolution, reduce the impact of text size changes, and output optimized text areas.

3. The AI-based text position and content recognition method according to claim 1, characterized in that: The S2 includes S21 and S22; S21. Use the multi-scale convolutional neural network MS-CNN to perform convolution operations on the text area of ​​the corrected image IMGcorr at different scales to extract features at different levels, including edge features, texture features, and shape features. At the same time, the convolutional features are pooled to optimize the feature dimensions while retaining the image information. The nonlinear activation function ReLU is applied to perform nonlinear transformation on the convolution results to extract multi-scale features Fms. The multi-scale feature Fms is calculated and obtained by the following algorithm formula; In the formula, α s represents the weight coefficient of the sth scale, σ represents the nonlinear activation function, Represents the operation of applying a convolutional neural network CNN at scale s, which includes multiple layers of convolution, pooling, and nonlinear activation; S22, by performing a pooling operation on the multi-scale feature Fms, optimizing the amount of calculation and removing redundant information, and then weighted summing the pooled features at different scales s to obtain the multi-scale fusion feature Ffusion; In the formula, β s represents the fusion weight coefficient of the s-th scale, and Pool represents the pooling operation.

4. The AI-based text position and content recognition method according to claim 1, characterized in that: The S3 includes S31 and S32; S31, using the bidirectional LSTM in the CRNN model to extract sequence features from the multi-scale fusion feature Ffusion, extracting the context information of each time step through two LSTM layer models, wherein one of the two LSTM layer models processes the sequence from front to back and the other processes the sequence from back to front, and outputs the aggregated sequence feature Fseq; The aggregate sequence feature Fseq is output by the following model; Fseq = hBiLSTM (Ffusion); In the formula, hBiLSTM represents a bidirectional LSTM function, which is used to convert the input multi-scale fusion feature Ffusion into a sequence feature; S32, by introducing the attention mechanism to output the context feature Fcontext, dynamically adjust the degree of attention to each time step; The context feature Fcontext is obtained by introducing the following attention mechanism and context modeling formula; In the formula, T represents the number of time steps contained in the sequence feature, t represents the time step, and γ t represents the attention weight at time step t, Attention represents the attention machine function, and Fseq (t) Represents the feature vector of the aggregated sequence feature Fseq at time step t.

5. The AI-based text position and content recognition method according to claim 4, characterized in that: The S4 includes S41 and S42; S41, using the connection temporal classification algorithm CTC, calculate the probability of each character in each time step, perform character prediction on the context feature Fcontext, and output the prediction probability Pctc; The predicted probability Pctc is calculated by the following algorithm formula: In the formula, CSeq represents the character sequence, CTC represents the connection time classification, and Fcontext (t) represents the feature representation of the context feature vector at time step t.

6. The AI-based text position and content recognition method according to claim 5, characterized in that: S42, combining the prediction probability Pctc output by the connection time series classification algorithm CTC with the language model LM, decoding and predicting the character sequence through the n-gram model in the language model LM combined with BeamSearch, and obtaining the decoded text sequence Tdecoded; The decoded text sequence Tdecoded is obtained by calculating the following language model LM decoding formula; Where N represents the number of LMs of different n-geam language models, LMdecode represents the decoding function performed by the language model LM, and δ n Represents the weight coefficient of n-gram in the language model. n-gram represents the phonetic model LM of the next character predicted by the nth preceding character.

7. The AI-based text position and content recognition method according to claim 1, characterized in that: The S5 includes S51 and S52; S51, further processing the decoded text sequence Tdecoded by using an optimization method based on edit distance, including removing redundant characters and correcting recognition errors, and adaptively adjusting based on context, and outputting a recognition result Tfinal; The recognition result Tfinal is obtained by calculating the following edit distance optimization algorithm; Tfinal=Optimize(Tdecoded, GT, Sim); In the formula, Sim represents the semantic similarity function, Optimize represents the optimization function, which is used to integrate the results of edit distance and semantic similarity, and GT represents the target text.

8. The AI-based text position and content recognition method according to claim 7, characterized in that: S52, inputting the obtained recognition result Tfinal into the adaptive correction model, adaptively correcting the coherence and readability of the text in the context, and outputting the correction result Tadaptive; The correction result Tadaptive is output through the following adaptive correction model; Tadaptive=Tfinal+ε·Adapt(Tfinal,Sim); Where Adapt represents the adaptive correction function, and ε represents the correction coefficient.

9. The AI-based text position and content recognition method according to claim 1, characterized in that: The S6 includes S61 and S62; S61, comprehensively summarize the output correction image IMGcorr, multi-scale fusion feature Efusion, context feature Fcontext, decoded text sequence Tdecoded and correction result Tadaptive, and perform comprehensive calculation to output evaluation function fi(Params), wherein the evaluation function fi(Params)=f{IMGcorr, Efusion, Fcontext, Tdecoded, Tadaptive}(Params), and then perform correlation calculation to output comprehensive evaluation coefficient Sfinal; The comprehensive evaluation coefficient Sfinal is calculated and output by the following algorithm formula; Where η i represents the number of the i-th step, I represents the number of different processing steps, where the processing steps include image correction, feature extraction, decoding and correction, and fi(Params) represents the evaluation function of the i-th step.

10. The AI-based text position and content recognition method according to claim 9, characterized in that: S62, the user presets the recognition threshold Threshold based on the recognition requirements, inputs the comprehensive evaluation coefficient Sfinal for comparative evaluation, and outputs the action decision Execfinal according to the evaluation result, outputs the recognition result, generates a report and automatically archives it. The specific evaluation content is as follows; When the comprehensive evaluation coefficient Sfinal ≥ the recognition threshold Threshold, it means that the current text recognition is normal, the automation task is executed and the action decision Execfinal is output; When the comprehensive evaluation coefficient Sfinal is less than the recognition threshold Threshold, it indicates that the current text recognition is abnormal, triggering the abnormality handling process and prompting manual intervention in the recognition; The action decision Execfinal is executed by the following algorithm: Execfinal=Action(Sfinal,Threshold)Feedback; In the formula, Action represents the execution action function, which performs intelligent operations based on the evaluation results and the set recognition threshold Threshold, and Feedback represents the feedback mechanism function, which is used to adjust the model parameters to optimize future recognition performance.

Citation Information

Patent Citations

  • A character detection and recognition method for boarding pass information verification

    CN109902622A

  • Power equipment nameplate recognition method and device and electronic equipment

    CN113554026A

  • End-to-end bill identification method and device

    CN118587728A

  • Detection method using fusion network based on attention mechanism, and terminal device

    US11222217B1