Complex scene text recognition enhancement method based on artificial intelligence

By introducing variational autoencoders and reinforcement learning frameworks, the latent space representation and dynamic recognition strategies are optimized, solving the problems of insufficient feature representation and adaptation in text recognition under complex scenarios, and improving recognition accuracy and stability.

CN121330698AActive Publication Date: 2026-01-13TIBET CHAVAYUN TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202511720544.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-21
Publication Date
2026-01-13
Estimated Expiration
2045-11-21

AI Technical Summary

Technical Problem

Existing text recognition algorithms lack the ability to express features in complex scenarios and lack dynamic adaptive mechanisms, resulting in decreased recognition accuracy and performance fluctuations.

Method used

A variational autoencoder structure and contrastive learning are introduced to optimize the latent space representation. Combined with a reinforcement learning framework, an Actor-Critic structure network is used to learn dynamic reinforcement strategies, which adjust the decoder attention weights and CTC thresholds in real time, forming a closed-loop feedback mechanism.

Benefits of technology

This improved the model's recognition stability and confidence in complex backgrounds, enabling high-confidence recognition output in variable environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121330698A_ABST
    Figure CN121330698A_ABST
Patent Text Reader

Abstract

The invention relates to the field of computer vision, in particular to a complex scene text recognition enhancement method based on artificial intelligence. Comprising the steps of complex scene text image construction and division, conditional feature fusion, comparative learning optimization potential space representation, decoding reconstruction, loss function optimization, latent variable extraction and enhanced feature output, reinforcement learning optimization and final recognition output, a variational auto-encoder structure is introduced, the comparative learning optimization potential space representation is combined, and the final recognition output is obtained. The model can learn latent variable representation with discrimination under various font, illumination and noise conditions, positive and negative sample comparison constraints are introduced into a latent variable space, and feature distribution differences under different scenes are reduced; according to the method, a reinforcement learning framework is introduced into complex scene text recognition, a recognition result and confidence are used as state input, a dynamic enhancement strategy is learned through an Actor-Critic structure strategy network, and joint optimization of recognition error rate and confidence improvement is realized by defining a linear and nonlinear composite reward function.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of computer vision, in particular to a complex scene text recognition enhancement method based on artificial intelligence. BACKGROUND

[0002] With the popularization of intelligent devices and the improvement of image acquisition capability, image-based text recognition technology has been widely used in intelligent transportation, bill recognition, advertisement text extraction, video caption detection and other fields. However, the existing text recognition algorithm still has the following main problems in complex scenes:

[0003] (1) The problem of insufficient feature expression ability

[0004] Traditional OCR algorithms are mostly based on convolutional neural networks (CNN) or recurrent neural networks (RNN) to extract features, but in complex backgrounds, feature aliasing and fuzzy text boundaries are easy to occur, which leads to a significant decrease in recognition accuracy, especially in scenes with light changes or font distortion, the model is difficult to capture semantic-related robust features;

[0005] (2) The problem of lack of dynamic adaptive mechanism in recognition strategy

[0006] Most existing methods use static feature extraction and decoding strategies, and the model parameters are fixed during inference, which cannot be dynamically adjusted according to the complexity or confidence of the input image, resulting in large fluctuations in recognition performance in different scenes. SUMMARY

[0007] In view of the above situation, in order to overcome the defects of the prior art, the present application provides a complex scene text recognition enhancement method based on artificial intelligence. In view of the problem of insufficient feature expression ability, the present application introduces a variational autoencoder structure, combines contrastive learning to optimize the latent space representation, so that the model can learn discriminative latent variable representation under various font, light and noise conditions. By introducing positive and negative sample contrast constraints in the latent variable space, the feature distribution difference under different scenes is significantly reduced, and the recognition stability of the model in complex backgrounds, reflections, fuzzy text and other cases is improved; In view of the problem of lack of dynamic adaptive mechanism in recognition strategy, the present application introduces a reinforcement learning framework in complex scene text recognition, takes the recognition result and confidence as the state input, learns a dynamic enhancement strategy through an Actor-Critic structure strategy network, defines a linear and nonlinear compound reward function, realizes the joint optimization of recognition error rate and confidence improvement, and adjusts the decoder attention weight and CTC threshold in real time according to the recognition result during inference, thereby dynamically optimizing the recognition strategy, forming a closed-loop feedback from "recognition result→model adjustment→recognition again". Compared with traditional static recognition methods, the present application can continuously and adaptively optimize feature enhancement and strategy allocation, so that the system can maintain high-confidence recognition output in a variable environment.

[0008] The technical scheme adopted by the present application is as follows: The present application provides an artificial intelligence-based complex scene text recognition enhancement method, which comprises the following steps:

[0009] Step S1: Complex scene text image construction and division, collect complex scene text images, perform sliding window division to obtain window image samples, label text region condition labels for each window image sample, including font type, size and illumination condition;

[0010] Step S2: Condition feature fusion, input the window image sample and the text region condition label into an encoder network, the encoder network comprises a feature extraction unit, a time sequence encoding layer, a condition fusion unit and a parameter output head, and specifically comprises the following contents:

[0011] The feature extraction unit adopts a convolutional neural network structure, performs multi-scale feature extraction on the input window image sample, and obtains a high-dimensional visual feature vector set, represented as F i =[ f 1 , f 2 , ... , f T ] wherein represents the position sequence length;

[0012] The time sequence encoding layer is used for sequence modeling of the high-dimensional visual feature vector set, and captures spatial dependency through a self-attention mechanism, and outputs sequence context feature representation;

[0013] The condition fusion unit fuses the sequence context feature and the corresponding text region condition label to obtain joint feature representation;

[0014] The parameter output head constructs a variational posterior approximate distribution, and the used formula is as follows:

[0015] ;

[0016] wherein, represents a variational posterior approximate distribution parameterized by the encoder network, is a latent variable vector of the window image sample, representing the latent semantic feature of the window image sample ; represents the text region condition label, is a posterior mean vector, is a posterior variance vector, represents a Gaussian distribution;

[0017] Step S3: Contrastive learning optimizes the latent space representation, introduces a contrastive learning mechanism, selects one window image sample as an anchor sample from the window image samples each time in the contrastive learning training process, defines the window image samples with the same text region conditional label as the anchor sample as positive samples, and the window image samples with different text region conditional labels as negative samples, constructs a contrastive loss function based on the latent representation, and the formula is as follows:

[0018] ;

[0019] wherein, is the contrastive loss function based on the latent representation, represents the cosine similarity, is a temperature parameter, represents the latent variable vector corresponding to the anchor sample, represents the latent variable vector corresponding to the positive sample, represents the latent variable vector corresponding to the negative sample, represents the traversal summation of all negative samples;

[0020] Step S4: Decoding reconstruction, set the decoder network as a VAE decoder, denoted as , under the condition of the latent variable vector of the window image sample and the text region conditional label, the decoder network reconstructs the window image sample to obtain a reconstructed sample, and by minimizing the error between the input sample and the reconstructed sample, a reconstruction loss function is defined, and the formula is as follows:

[0021] ;

[0022] wherein, represents the decoder network controlled by the parameter , represents the reconstructed sample, represents the reconstruction loss function;

[0023] Step S5: Loss function optimization, combine the reconstruction loss function, the KL divergence regular term and the contrastive loss function based on the latent representation to construct a joint optimization objective function, and the formula is as follows:

[0024] ;

[0025] wherein, and are adjustable hyperparameters, represents the joint optimization objective function;

[0026] Step S6: latent variable extraction and enhanced feature output, after training, extract the latent variable distribution parameters from the encoder network, use the reparameterization trick to sample the derivable latent variable vector, input the text region condition label into the decoder network to obtain the enhanced feature representation of the complex scene text image, input the enhanced feature representation into the CTC decoder to obtain the recognition result and recognition confidence index;

[0027] Step S7: reinforcement learning optimization, use the recognition result and recognition confidence index as input state, construct a deep reinforcement learning policy network, learn the optimal recognition enhancement and policy optimization mechanism through interactive training, and obtain the reinforcement learning decision output result;

[0028] Step S8: final recognition output, according to the reinforcement learning decision output result, adjust the enhanced feature and the decoder of the complex scene text image, and obtain the final text recognition result and confidence index.

[0029] Further, step S7, specifically comprising the following steps:

[0030] Step S71: state definition normalization, construct the system state space, represented as follows:

[0031] s t =[ Q i , c i ] ;

[0032] Among them, represents the system state vector, represents the recognition confidence index, represents the recognition result;

[0033] Step S72: action space construction, define the action set of the reinforcement learning agent , including adjusting the enhanced image feature weight, adjusting the decoder attention weight strategy, adjusting the CTC decoding confidence threshold and maintaining the current state;

[0034] Step S73: reward function design, design a composite reward function , including linear reward function and nonlinear reward function, the used functions are as follows:

[0035] Linear reward function:

[0036] ;

[0037] Among them, is the recognition error rate improvement, is the recognition confidence improvement, , is a weight coefficient;

[0038] Nonlinear reward function:

[0039]

[0040] Step S74: Network initialization, initialize the deep reinforcement learning policy network, which contains the following components:

[0041] Actor network: adopt multilayer perceptron structure, parameters are , updated by policy gradient;

[0042] Critic network: evaluate the value of state-action, parameters are , updated by minimizing the temporal difference error;

[0043] Target network: a set of parameter copies are set for the Actor network and the Critic network respectively;

[0044] Experience replay buffer: capacity is 100000, store the processed state vectors;

[0045] Step S75: Network update and training, randomly sample the processed state vectors from the experience replay buffer, update the Critic network parameters, and achieve by minimizing the following loss function, the formula is as follows:

[0046]

[0047]

[0048] wherein, represents the current state vector, represents the action of the current reinforcement learning agent, represents the reward value at the current time, represents the loss function, represents the target Q value, represents the discount factor, represents the target Actor network parameters, represents the target Critic network parameters, represents the target Actor network, represents the target Critic network, represents the number of randomly sampled processed state vectors from the experience replay buffer;

[0049] According to the policy gradient formula, update the parameters of the Actor network, the formula is as follows:

[0050] ;​​​

[0051] wherein, denotes a policy objective function, denotes an action policy generated by an Actor network, denotes gradient feedback of a Critic network;

[0052] The two target networks are updated by a soft update mechanism, and the formula is as follows:

[0053]

[0054] wherein, denotes a soft update coefficient, denotes network parameters of the two targets, denotes two network parameters;

[0055] An updated deep reinforcement learning policy network is obtained.

[0056] Step S76: policy optimization, repeating the training process in step Q5, setting a training threshold, when the loss function converges to the training threshold, ending the iteration, and outputting the optimal deep reinforcement learning policy network;

[0057] Step S77: result output, deploying the optimal deep reinforcement learning policy network, and outputting the reinforcement learning decision output result.

[0058] The beneficial effects obtained by the above scheme are as follows:

[0059] (1) In view of the problem of insufficient feature expression capability, the present application introduces a variational autoencoder structure, optimizes the latent space representation by combining contrastive learning, so that the model can learn discriminative latent variable representation under various fonts, illumination and noise conditions, and by introducing positive and negative sample contrast constraints in the latent variable space, the feature distribution difference under different scenes is significantly reduced, and the recognition stability of the model under complex background, reflection, fuzzy text and other conditions is improved;

[0060] (2) In view of the problem that the recognition strategy lacks a dynamic adaptive mechanism, the present application introduces a reinforcement learning framework in complex scene text recognition, takes the recognition result and confidence as state input, learns a dynamic enhancement strategy through an Actor-Critic structure policy network, defines a linear and nonlinear compound reward function, realizes the joint optimization of recognition error rate and confidence improvement, and dynamically optimizes the recognition strategy according to the recognition result in the inference process, thereby forming a closed-loop feedback from "recognition result→model adjustment→recognition again". Compared with the traditional static recognition method, the present application can continuously and adaptively optimize feature enhancement and strategy allocation, so that the system can maintain high confidence recognition output in a variable environment.​ Attached Figure Description

[0061] Figure 1 This is a flowchart illustrating the AI-based text recognition enhancement method for complex scenes provided by the present invention.

[0062] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used together with the embodiments of the invention to explain the invention and do not constitute a limitation thereof. Detailed Implementation

[0063] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.

[0064] In the description of this invention, it should be understood that the terms "upper", "lower", "front", "rear", "left", "right", "top", "bottom", "inner", "outer", etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this invention.

[0065] Example 1, see Figure 1 The present invention provides an artificial intelligence-based method for enhancing text recognition in complex scenes, which includes the following steps:

[0066] Step S1: Construct and segment text images for complex scenes. Collect text images of complex scenes, perform sliding window segmentation to obtain window image samples, and label each window image sample with text region condition labels, including font type, size and lighting conditions.

[0067] Step S2: Conditional Feature Fusion. The window image samples and text region conditional labels are input into the encoder network. The encoder network includes a feature extraction unit, a temporal coding layer, a conditional fusion unit, and a parameter output head, specifically including the following:

[0068] The feature extraction unit employs a convolutional neural network structure to perform multi-scale feature extraction on the input window image samples, obtaining a high-dimensional visual feature vector set, represented as follows: F i =[ f 1 , f 2 , ... , f T ] wherein denotes the position sequence length;

[0069] The temporal encoding layer is used for serializing modeling of the high-dimensional visual feature vector set, capturing spatial dependency through a self-attention mechanism, and outputting a sequence context feature representation;

[0070] The conditional fusion unit fuses the sequence context feature and the corresponding text region condition label to obtain a joint feature representation;

[0071] The parameter output head constructs a variational posterior approximate distribution, and the formula used is as follows:

[0072] ;

[0073] wherein, denotes a variational posterior approximate distribution parameterized by an encoder network, is a latent variable vector of a window image sample, and denotes a latent semantic feature of the window image sample ; denotes a text region condition label, is a posterior mean vector, is a posterior variance vector, denotes a Gaussian distribution;

[0074] Step S3: Optimize the latent space representation through contrastive learning. In the contrastive learning training process, one window image sample is selected each time as an anchor sample. Window image samples with the same text region condition label as the anchor sample are defined as positive samples, and window image samples with different text region condition labels from the anchor sample are defined as negative samples. A contrastive loss function based on the latent representation is constructed, and the formula used is as follows:

[0075] ;

[0076] wherein, is a contrastive loss function based on the latent representation, denotes a cosine similarity, is a temperature parameter, denotes a latent variable vector corresponding to the anchor sample, denotes a latent variable vector corresponding to the positive sample, denotes a latent variable vector corresponding to the negative sample, denotes a traversal summation of all negative samples;

[0077] Step S4: Decoding reconstruction. The decoder network is set to be a VAE decoder, denoted as Under the condition of the latent variable vector of the window image sample and the text region conditional label, the decoder network reconstructs the window image sample to obtain a reconstructed sample, and a reconstruction loss function is defined by minimizing the error between the input sample and the reconstructed sample, and the formula is as follows:

[0078] ;

[0079] wherein, denotes the parameter controlled decoder network, denotes the reconstructed sample, denotes the reconstruction loss function;

[0080] Step S5: loss function optimization, combining the reconstruction loss function, the KL divergence regularization term and the contrastive loss function based on the latent representation, a joint optimization objective function is constructed, and the formula is as follows:

[0081] ;

[0082] wherein, and are adjustable hyperparameters, denotes the joint optimization objective function;

[0083] Step S6: latent variable extraction and enhanced feature output, after training, the latent variable distribution parameters are extracted from the encoder network, the reparameterization trick is used to sample the derivable latent variable vector, which is input into the decoder network combined with the text region conditional label to obtain the enhanced feature representation of the complex scene text image. The enhanced feature representation is input into the CTC decoder to obtain the recognition result and the recognition confidence index;

[0084] Step S7: reinforcement learning optimization, using the recognition result and the recognition confidence index as the input state, a deep reinforcement learning policy network is constructed, and the optimal recognition enhancement and policy optimization mechanism are learned through interactive training to obtain the reinforcement learning decision output result;

[0085] Step S8: final recognition output, according to the reinforcement learning decision output result, the enhanced feature of the complex scene text image is adjusted and the decoder is optimized to obtain the final text recognition result and the confidence index.

[0086] In this embodiment, the complex scene text images of the public data sets ICDAR2019-ReCTS and SynthText are selected as training samples;

[0087] The original image is divided into window image samples with a size of 64x64 pixels by sliding window technology, and each window corresponds to at least one character region;

[0088] The text region conditional labels of each window are manually labeled, including font type, font size and illumination condition;

[0089] The window image sample is input into the encoder network through conditional feature fusion, and the encoder network has the following structure:

[0090] The feature extraction unit is a convolutional neural network based on ResNet-34, which performs multi-scale feature extraction on the window image sample, and the output dimension is 256x16x16;

[0091] The time sequence encoding layer uses a bidirectional Transformer Encoder with 6 layers, a hidden dimension of 512 and 8 attention mechanisms to model local and global spatial relationships;

[0092] The conditional fusion unit fuses the extracted context features and the corresponding text region conditional labels through concatenation and linear projection to obtain a joint feature representation;

[0093] The parameter output head outputs the parameters of the variational posterior distribution, which are 128-dimensional mean and variance vectors, to construct the posterior distribution;

[0094] In the training phase, anchor samples are selected from each batch of samples, and the positive samples are window image samples with the same font type and similar illumination conditions, and the negative samples are different font type samples. The cosine similarity is used to construct the contrastive loss function;

[0095] The decoder network is set to a symmetric VAE decoder composed of five deconvolutional networks, and the reconstruction size is 64x64;

[0096] Under the constraints of and , the output is a reconstructed image;

[0097] The reconstruction performance is optimized by minimizing the following loss:

[0098] Considering the reconstruction loss, KL divergence regularization term and contrastive loss, the joint optimization objective is constructed as follows:

[0099] ;

[0100] After the model training is completed, the latent variable distribution parameters are extracted from the encoder, and the reparameterization is used as follows:

[0101] ;

[0102] The sampled and The enhanced visual feature representation is input into a decoder to obtain a text sequence result and a recognition confidence;

[0103] A deep reinforcement learning policy network is constructed using the text sequence result and the recognition confidence as input states, wherein:

[0104] The Actor network adopts a three-layer fully connected structure;

[0105] The Critic network adopts a double-branch structure;

[0106] The reward function is designed as:

[0107] ;

[0108] wherein , ;

[0109] The reinforcement learning network dynamically adjusts the enhanced feature weight and the CTC decoding parameter during the training process.

[0110] In embodiment two, based on the above embodiment, step S7 specifically includes the following steps:

[0111] Step S71: State definition normalization, constructing a system state space, represented as follows:

[0112] s t =[ Q i , c i ] ;

[0113] wherein, represents a system state vector, represents a recognition confidence index, represents a recognition result;

[0114] Step S72: Action space construction, defining the action set of the reinforcement learning agent , including adjusting the enhanced image feature weight, adjusting the decoder attention weight strategy, adjusting the CTC decoding confidence threshold, and maintaining the current state;

[0115] Step S73: Reward function design, designing a composite reward function , containing a linear reward function and a nonlinear reward function, the functions used are as follows:

[0116] Linear reward function:

[0117] ;

[0118] wherein, is the identified error rate improvement amount, is the identified confidence level improvement amount, , is a weight coefficient;

[0119] a non-linear reward function:

[0120] ;

[0121] Step S74: network structure initialization, initializing the deep reinforcement learning policy network, specifically containing the following components:

[0122] Actor network: adopting a multi-layer perceptron structure, parameters are updated through policy gradient;

[0123] Critic network: evaluating the value of state-action, parameters are updated by minimizing the temporal difference error;

[0124] target network: a set of parameter copies are set for the Actor network and the Critic network respectively;

[0125] experience replay buffer: capacity is 100000, storing the processed state vectors;

[0126] Step S75: network updating and training, randomly sampling the processed state vectors from the experience replay buffer, using Critic network parameter updating, and achieving by minimizing the following loss function, the used formula is as follows:

[0127] ;

[0128] ;

[0129] wherein, represents the current state vector, represents the action of the current reinforcement learning agent, represents the reward value at the current time, represents the loss function, represents the target Q value, represents the discount factor, represents the target Actor network parameter, represents the target Critic network parameter, represents the target Actor network, represents the target Critic network, represents the number of randomly sampled processed state vectors from the experience replay buffer;

[0130] The parameters of the Actor network are updated according to the policy gradient formula, as follows:

[0131] ;

[0132] in, This represents the policy objective function. This represents the action policy generated by the Actor network. This represents the gradient feedback of the Critic network;

[0133] A soft update mechanism is used to perform smooth updates for the networks of two targets, and the formula used is as follows:

[0134] ;

[0135] in, Indicates the soft update coefficient. A unified representation of the network parameters for two targets. To uniformly represent the two network parameters;

[0136] The updated deep reinforcement learning policy network is obtained;

[0137] Step S76: Policy optimization. Repeat the training process in step Q5, set a training threshold, and end the iteration when the loss function converges to the training threshold, outputting the optimal deep reinforcement learning policy network.

[0138] Step S77: Output the results. Deploy the optimal deep reinforcement learning policy network and output the reinforcement learning decision results.

[0139] Example 3, based on the above examples, uses the following core code for steps S71 to S77:

[0140] import numpy as np

[0141] import torch

[0142] import torch.nn as nn

[0143] import torch.optim as optim

[0144] # Actor Network Example

[0145] class Actor(nn.Module):

[0146] def __init__(self):

[0147] super().__init__()

[0148] self.fc1 = nn.Linear(2, 128)

[0149] self.fc2 = nn.Linear(128, 64)

[0150] self.out = nn.Linear(64, 4) # Action space size is 4

[0151] def forward(self, s):

[0152] x = torch.relu(self.fc1(s))

[0153] x = torch.relu(self.fc2(x))

[0154] return torch.softmax(self.out(x), dim=-1)

[0155] # Critic Network Example

[0156] class Critic(nn.Module):

[0157] def __init__(self):

[0158] super().__init__()

[0159] self.fc1 = nn.Linear(2 + 4, 128) # 2D state + 4D action

[0160] self.fc2 = nn.Linear(128, 64)

[0161] self.out = nn.Linear(64, 1)

[0162] def forward(self, s, a):

[0163] x = torch.relu(self.fc1(torch.cat([s, a], dim=-1)))

[0164] x = torch.relu(self.fc2(x))

[0165] return self.out(x)

[0166] # Loss function L = (y - Q(s,a))^2

[0167] def critic_loss(Q, y):

[0168] return ((Q - y)**2).mean()。

[0169] It is to be understood that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting; it is also possible in the present application that units other than those mentioned are employed and / or that functions can be aggregated or distributed among individual units. Although the application has been described by way of example and with reference to possible embodiments thereof, it is to be appreciated that modifications can be made without departing from the spirit and scope of the application, which are to be determined by the appended claims and their equivalents.

[0170] While the embodiments of the application have been illustrated and described, it will be understood by those skilled in the art that various changes, modifications, substitutions, and alterations can be made therein without departing from the spirit and scope of the application in its broadest form. The scope of the application should therefore not be limited to the embodiments described above, but should be defined only by the claims and equivalents thereof.

[0171] The above description of the application and its embodiments is not restrictive, and the embodiments shown in the drawings are only one of the embodiments of the application, and the actual structure is not limited thereto. In general, if a person skilled in the art is inspired by it, without departing from the purpose of the application, without creative design, similar structure and embodiments of the technical solution should belong to the protection scope of the application.

Claims

1. An artificial intelligence-based complex scene text recognition enhancement method, characterized in that: The method comprises the following steps: Step S1: complex scene text image construction and division, collecting complex scene text images, performing sliding window division to obtain window image samples, and labeling text region condition labels for each window image sample; Step S2: conditional feature fusion, inputting the window image sample and the text region condition label into an encoder network, the encoder network comprising a feature extraction unit, a time sequence encoding layer, a condition fusion unit and a parameter output head, and specifically comprising the following contents: The feature extraction unit adopts a convolutional neural network structure to perform multi-scale feature extraction on the input window image sample to obtain a high-dimensional visual feature vector set; The time sequence encoding layer is used for sequential modeling of the high-dimensional visual feature vector set, captures spatial dependency through a self-attention mechanism, and outputs sequence context feature representation; The condition fusion unit fuses the sequence context feature and the corresponding text region condition label to obtain joint feature representation; The parameter output head constructs a variational posterior approximate distribution; Step S3: optimizing latent space representation through contrastive learning, introducing a contrastive learning mechanism, selecting one window image sample as an anchor sample each time in the contrastive learning training process, defining a window image sample with the same text region condition label as the anchor sample as a positive sample, and defining a window image sample with a different text region condition label as the anchor sample as a negative sample, and constructing a contrast loss function based on the latent representation; Step S4: decoding and reconstruction, setting the decoder network as a VAE decoder, and under the condition of the latent variable vector of the window image sample and the text region condition label, the decoder network reconstructs the window image sample to obtain a reconstructed sample, and defines a reconstruction loss function by minimizing the error between the input sample and the reconstructed sample; Step S5: loss function optimization, combining the reconstruction loss function, the KL divergence regular term and the contrast loss function based on the latent representation to construct a joint optimization objective function; Step S6: latent variable extraction and enhanced feature output, after the training is completed, the latent variable distribution parameters are extracted from the encoder network, the reparameterization trick is used to sample to obtain a differentiable latent variable vector, the text region condition label is input into the decoder network, and an enhanced feature representation of the complex scene text image is obtained, the enhanced feature representation is input into a CTC decoder to obtain a recognition result and a recognition confidence index; Step S7: reinforcement learning optimization, using the recognition result and the recognition confidence index as an input state to construct a deep reinforcement learning strategy network, learning an optimal recognition enhancement and strategy optimization mechanism through interactive training to obtain a reinforcement learning decision output result; Step S8: final recognition output, adjusting the enhanced features and optimizing the decoder according to the reinforcement learning decision output result to obtain a final text recognition result and a confidence index. 2.The AI-based complex-scene text recognition enhancement method of claim 1, wherein: Step S7, specifically comprising the following steps: Step S71: state definition normalization, constructing a system state space, represented as follows: ; wherein, represents a system state vector, represents a recognition confidence indicator, represents a recognition result; Step S72: action space construction, defining the action set of the reinforcement learning agent including adjusting the enhanced image feature weight, adjusting the decoder attention weight strategy, adjusting the CTC decoding confidence threshold, and maintaining the current state; Step S73: reward function design, design a compound reward function , including a linear reward function and a nonlinear reward function, the functions used are as follows: Linear reward function: ; wherein, is an error rate improvement amount, is a confidence level improvement amount, , is a weight coefficient; Nonlinear reward function: ; Step S74: network structure initialization, initializing the deep reinforcement learning strategy network, specifically comprising the following components: Actor network: a multi-layer perceptron with parameters updated by policy gradient. Critic network: evaluates the value of state-action, parameterized by , updated by minimizing the temporal difference error; Target network: a set of parameter copies are set for the Actor network and the Critic network respectively; Experience replay buffer: capacity is 100000, stores the processed state vector; Step S75: network update and training, randomly sample the processed state vector from the experience replay buffer, use the Critic network parameter update, and realize it by minimizing the following loss function, the formula is as follows: ; ; wherein, denotes the current state vector, denotes the action of the current reinforcement learning agent, denotes the reward value at the current time, denotes the loss function, denotes the target Q value, denotes the discount factor, denotes the target Actor network parameters, denotes the target Critic network parameters, denotes the target Actor network, denotes the target Critic network, denotes the number of processed state vectors randomly sampled from the experience replay buffer. Update the parameters of the Actor network according to the policy gradient formula, the formula is as follows: ; wherein, represents a policy objective function, represents an action policy generated by the Actor network, represents a gradient feedback of the Critic network; Smoothly update the two target networks using the soft update mechanism, the formula is as follows: ; wherein, denotes a soft update coefficient, unifies the network parameters of both targets, unifies the network parameters of both targets; Get the updated deep reinforcement learning policy network; Step S76: policy optimization, repeat the training process in step Q5, set the training threshold, when the loss function converges to the training threshold, end the iteration, and output the optimal deep reinforcement learning policy network; Step S77: result output, deploy the optimal deep reinforcement learning policy network, and output the reinforcement learning decision output result.

Citation Information

Patent Citations

  • Content extraction method, device and equipment for text image as well as storage medium

    CN108830186A

  • Semantic enhanced scene text recognition method and device

    CN113591546A

  • Infrared and visible light image fusion method for text supervised contrast learning

    CN120599421A

  • Multi-modality reinforcement learning in logic-rich scene generation

    US20250299061A1