Patent ID: 11881038
Assignee: TSINGHUA UNIVERSITY
Field: Computer technology (Electrical engineering)
Classification: CPC G | IPC G

Claim 8:
9. The method of claim 8, wherein:
an input of the decoder includes two parts, the first part is hidden representations output from the encoder, the second part is the text ground-truth in the training stage, or the recognition text output from the decoder in the test stage, the character sequence of the second part input is gradually converted into the vector through character embedding, and processed by the self-attention layer, and then sent to the encoder-decoder attention layer together with the first part input, and the acquired result is input into the feed forward network module to acquire a decoder output,
in the training stage, mask processing is introduced into the decoder self-attention layer, and only the current character and the previous text ground-truth are used when calculating the attention score,
in the training stage, the cross entropy of the recognized text and the text ground-truth is set as the objective function, and optimization is performed for parameters of the entire network including the feature extractor, the encoder, and the decoder, and
in the training stage, horizontal scene text and vertical scene text training data are divided into two subsets according to the direction, and data of each iteration are drawn from two subsets according to Equations 1 and 2 below when training,, p
          H
        
        =
        
          
            N
            H
          
          
            
              N
              H
            
            +
            
              N
              V
            
          
        
      
    
    
      
        (
        
          Equation
          ⁢
          
            
          
          ⁢
          1
        
        )
      
    
  
  
    
      
        
          p
          V
        
        =
        
          
            N
            V
          
          
            
              N
              H
            
            +
            
              N
              V
            
          
        
      
    
    
      
        (
        
          Equation
          ⁢
          
            
          
          ⁢
          2
        
        )
      
    
  

wherein PH and PV mean sampling probabilities in a horizontal text subset and a vertical text subset, respectively, NH and NV mean the numbers of remaining samples in the horizontal text subset and the vertical text subset, respectively, and as the drawn samples, all samples of two subsets are drawn by random sampling without replacement until training of one epoch is completed.