A method for recognizing Chinese text with adaptive position calibration and variation compensation

CN122990720APending Publication Date: 2026-10-27HUZHOU UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611256445.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-19
Publication Date
2026-10-27

AI Technical Summary

Benefits of technology

本公开通过引入局部特征强化模块,利用多尺度级联卷积增强了对字符笔画、边界结构及局部纹理的表征能力;利用自适应位置编码校准模块,通过动态学习位置偏移量有效缓解了固定位置编码在非均匀字符布局场景下的建模偏差问题;通过全局和局部双分支评估并生成调制参数,实现了对变异较小区域保持原始特征权重、对变异较大区域进行特征补偿的自适应处理。实验结果表明,本公开在石碑拓片数据集上的行准确度达到83.82%,相比基线模型提升了3.80个百分点;在场景数据集上提升了2.60个百分点,在网页数据集上提升了1.92个百分点,在文档数据集上提升了1.69个百分点。整体方案显著提升了模型在石碑拓片及多种中文文本场景下的识别精度与鲁棒性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122990720A_ABST
    Figure CN122990720A_ABST
Patent Text Reader

Abstract

The present disclosure proposes a Chinese text recognition method with adaptive position calibration and variation compensation, comprising the following steps: acquiring an image feature sequence; performing multi-scale feature extraction and fusion on the image feature sequence to obtain an output after local feature enhancement; dynamically predicting an offset and calibrating position encoding according to the spatial position information of the output after local feature enhancement to obtain a feature after position calibration; performing adaptive variation compensation processing on the feature after position calibration to evaluate the variation degree of characters and generate adaptive modulation parameters, element-by-element modulating the feature after position calibration to obtain a feature after variation compensation; and decoding the feature after variation compensation to predict a character sequence and output a text recognition result. The present disclosure can significantly improve the recognition accuracy and robustness of the model in stone rubbing and various Chinese text scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of Chinese text recognition technology, and in particular to a Chinese text recognition method with adaptive position calibration and variation compensation. Background Technology

[0002] Stone tablets, as important carriers of documents, engrave and preserve a wealth of valuable information about history, culture, art, and science, serving as crucial material historical records for studying ancient social forms, political systems, economic activities, and intellectual culture. Rubbing techniques, a traditional method for preserving and disseminating the content of stone tablets, have a history of over a thousand years, providing vital support for the transmission, collation, and research of stone tablet documents. However, affected by natural weathering, environmental erosion, and human damage, the original appearance of stone tablets often suffers varying degrees of wear, damage, and deformation. Furthermore, the production and preservation of rubbings are also affected by paper aging, ink decay, and limitations in storage conditions, making it difficult to present the textual information completely and clearly. Therefore, research on the digital preservation and intelligent identification of stone tablet rubbings not only helps improve the efficiency of organizing and utilizing ancient documents but also has significant historical value and practical significance for promoting cultural heritage protection, digital humanities research, and the inheritance of outstanding traditional culture.

[0003] Existing Chinese text recognition methods have significant shortcomings when dealing with the task of recognizing rubbings from stone tablets. On the one hand, the characters in rubbings often exhibit non-uniform spacing, unlike the regular layout of modern printed text. This complex spatial arrangement increases the technical difficulty of recognition. Most existing methods use sine-cosine positional coding to model the positional information of character sequences, achieving good results in modern text scenarios with regular character arrangement. However, in rubbings with inconsistent character spacing, the positional modeling assumptions are difficult to hold, leading to inaccurate characterization of the relative spatial relationships between adjacent characters. On the other hand, due to differences in writing style or rubbing techniques, the same character may appear differently under different conditions—a problem of intra-class variability—significantly increasing the difficulty of recognition. Most existing methods employ uniform feature extraction and weight allocation strategies, which are insufficient to effectively characterize the appearance differences of the same character under different conditions. Furthermore, the scarcity of publicly available datasets, their limited size, and the high cost and difficulty of annotation make data scarcity a significant bottleneck. Therefore, effectively addressing the problems of uneven character spacing and intra-class variability has become a critical technical issue that urgently needs to be solved in the field of stone tablet rubbing text recognition. Summary of the Invention

[0004] The purpose of this disclosure is to provide a Chinese text recognition method with adaptive position calibration and variation compensation to address the shortcomings of existing technologies. It can alleviate the modeling bias problem of fixed position encoding in non-uniform character layout scenarios. With the help of the adaptive variation compensation module, modulation parameters are evaluated and generated through global and local dual branches, which realizes adaptive processing that maintains the original feature weights in regions with small variations and performs feature compensation in regions with large variations.

[0005] This disclosure provides a Chinese text recognition method with adaptive position calibration and variation compensation, including the following steps: Obtain image feature sequences; Multi-scale feature extraction and fusion are performed on the image feature sequence to obtain the output after local feature enhancement; the offset is dynamically predicted and the position encoding is calibrated based on the spatial position information of the output after local feature enhancement to obtain the position-calibrated features; Adaptive variation compensation processing is performed on the position-calibrated features to evaluate the degree of character variation and generate adaptive modulation parameters. The position-calibrated features are then modulated element by element to obtain the variation-compensated features. The variant-compensated features are then used for character decoding to predict character sequences and output text recognition results.

[0006] The adaptive position calibration and variation compensation method for Chinese text recognition described above, optionally, involves performing multi-scale feature extraction and fusion on the image feature sequence to obtain a locally enhanced output, which includes the following steps: The image feature sequence is rearranged into a two-dimensional feature map and then linearly projected. Local features at different scales are extracted layer by layer through multiple cascaded convolutional branches. Each convolutional branch contains two convolutional layers, followed by batch normalization and activation functions. The outputs of each convolutional branch are concatenated with the original features and then fused through convolution. The output after local feature enhancement is obtained through residual connections and layer normalization.

[0007] The adaptive position calibration and variation compensation method for Chinese text recognition described above, optionally, includes the following steps in the process of obtaining the position-calibrated features: Normalized grid coordinates are generated for each spatial location in the feature map; Predict the two-dimensional offset of each spatial location; The two-dimensional offset is mapped to the feature space to obtain the offset feature; The offset features are added to the original features and then normalized by layers to obtain the calibrated features.

[0008] In the Chinese text recognition method with adaptive position calibration and variation compensation as described above, optionally, the module used to perform adaptive variation compensation processing on the features after position calibration is an adaptive variation compensation module. The adaptive mutation compensation module includes a global branch and a local branch; the global branch is used to extract the overall mutation evaluation value of the image through global average pooling and a multilayer perceptron network. The local branch is used to convert the location-calibrated features into a two-dimensional feature map, and extracts the local variation evaluation values ​​of each region through window pooling and depthwise separable convolution.

[0009] In the Chinese text recognition method with adaptive position calibration and variation compensation as described above, optionally, the overall variation evaluation value and the local variation evaluation value are fused by a fusion weight. The fusion weights can be automatically learned during training and scaling and offset parameters can be generated based on the fusion results.

[0010] In the Chinese text recognition method with adaptive position calibration and variation compensation described above, optionally, the method for modulating the position-calibrated features element-by-element is to modulate the position-calibrated features element-by-element within a preset range by a cropping operation based on scaling parameters and offset parameters.

[0011] The Chinese text recognition method with adaptive position calibration and variation compensation described above, optionally, uses a character decoding module to predict character sequences; The character decoding module is built on a permutation language modeling framework. It predicts character sequences in any order by separating the position query stream and the content information stream.

[0012] In the Chinese text recognition method with adaptive position calibration and mutation compensation described above, optionally, the overall loss function used during training is composed of a weighted sum of recognition loss, position calibration regularization loss, and mutation compensation regularization loss.

[0013] In the Chinese text recognition method with adaptive position calibration and variation compensation as described above, optionally, the magnitude of the constraint offset of the position calibration regularization loss and the constraint scaling parameter of the variation compensation regularization loss are both greater than 0.9 and less than 1, and the offset parameter is greater than 0 and less than 0.1.

[0014] The adaptive position calibration and variation compensation Chinese text recognition method described above may optionally include obtaining the image feature sequence by performing feature extraction on the input Chinese text image through a feature extractor; wherein the feature extractor adopts a ViT structure, divides the input image into multiple patches, superimposes position codes after linear projection, and uses a self-attention mechanism to model the global context.

[0015] Compared with the prior art, this disclosure has the following beneficial effects: This disclosure enhances the representation of character strokes, boundary structures, and local textures by introducing a local feature enhancement module and utilizing multi-scale cascaded convolutions. It also mitigates the modeling bias problem of fixed-position encoding in non-uniform character layout scenarios by employing an adaptive positional encoding calibration module, which dynamically learns positional offsets. Furthermore, it achieves adaptive processing by evaluating and generating modulation parameters through global and local dual-branch evaluation, preserving the original feature weights for regions with small variations and compensating for features in regions with large variations. Experimental results show that this disclosure achieves a line accuracy of 83.82% on the stone inscription rubbing dataset, a 3.80 percentage point improvement over the baseline model; a 2.60 percentage point improvement on the scene dataset; a 1.92 percentage point improvement on the webpage dataset; and a 1.69 percentage point improvement on the document dataset. The overall scheme significantly improves the model's recognition accuracy and robustness in stone inscription rubbings and various Chinese text scenarios. Attached Figure Description

[0016] To more clearly illustrate the technical solutions of this disclosure, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this specification. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0017] Figure 1 A schematic diagram of the model structure for the adaptive position calibration and variation compensation Chinese text recognition method provided in this disclosure; Figure 2 A schematic diagram of the local feature enhancement module of the adaptive position calibration and variation compensation Chinese text recognition method provided in this disclosure; Figure 3 A schematic diagram of the adaptive position coding calibration module of the Chinese text recognition method with adaptive position calibration and variation compensation provided in this disclosure; Figure 4 A schematic diagram of the adaptive variation compensation module of the Chinese text recognition method with adaptive position calibration and variation compensation provided in this disclosure; Figure 5 A flowchart illustrating the steps of the method provided in this disclosure. Detailed Implementation

[0018] Embodiments of this disclosure are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain this disclosure, and should not be construed as limiting this disclosure.

[0019] In the description of this disclosure, it should be understood that the terms "longitudinal," "transverse," "thickness," "upper," "lower," "top," "bottom," "inner," "outer," and "radial," etc., indicating orientation or positional relationships based on the orientation or positional relationships shown in the accompanying drawings, are only for the convenience of describing this disclosure 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, and therefore should not be construed as a limitation of this disclosure. Furthermore, in the description of this disclosure, unless otherwise stated, "a plurality of" means two or more. In the description of this disclosure, it should be noted that, unless otherwise expressly specified and limited, the terms "installed," "connected," and "joined" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal communication of two components. Those skilled in the art can understand the specific meaning of the above terms in this disclosure based on the specific circumstances.

[0020] This disclosure applies to the automatic recognition of text from rubbings of stone tablets. The complex scenarios faced in recognizing text from rubbings of stone tablets refer to situations where the text information is interfered with by various factors, leading to difficulties in recognition. These factors include character damage and stroke breakage caused by natural weathering and environmental erosion of the stone tablet; uneven ink color due to differences in rubbing techniques; differences in character morphology from different historical periods and writing styles, i.e., intraclass variability; and the uneven spacing of characters in the rubbings. These challenges significantly increase the difficulty of recognizing text from rubbings of stone tablets.

[0021] This disclosure aims to overcome the limitations of existing technologies in the recognition of text from stone rubbings, and proposes an innovative text recognition model—A²PV (Adaptive Position Calibration and Adaptive Variability Compensation)—to achieve high-precision text recognition of stone rubbings under complex conditions. The model structure is as follows: Figure 1 As shown.

[0022] based on Figure 1 The model shown in this embodiment provides a Chinese text recognition method with adaptive position calibration and variation compensation.

[0023] Recognizing text from rubbings of stone tablets presents unique challenges, such as uneven character spacing, intra-class variability, and loss of local details. This disclosure, building upon existing text recognition methods for rubbings of stone tablets, constructs a dataset of rubbings covering important inscriptions from the Tang and Song dynasties, and proposes several technological innovations to address these unique challenges. Specifically, in the feature extraction stage, Vision Transformer is used to extract global features; in the feature enhancement stage, a Local Feature Enhancement Module (LFEM) is proposed, which enhances the representation ability of local features through multi-scale cascaded convolutions; in the position calibration stage, an Adaptive Position Coding Calibration Module (APCM) is proposed, which calibrates the spatial positional relationships between characters by dynamically learning position offsets; in the variation compensation stage, an Adaptive Variation Compensation Module (AVCM) is proposed, which evaluates the degree of character variation through global and local dual branches and generates adaptive modulation parameters for feature compensation; in the decoding stage, a character decoding module based on a permutation language modeling framework is used to output the recognition results.

[0024] To explain this method in detail, the following sections will first describe the various modules used in this disclosure.

[0025] The feature extractor processes the input image of the rubbing of a stone tablet. It employs a Vision Transformer (ViT) architecture, dividing the input image into several patches, linearly projecting them, and then superimposing positional codes. A self-attention mechanism is used to model the global context, outputting an image feature sequence. Where B is the batch size, N is the sequence length, and C is the feature dimension. The encoder uses a 12-layer ViT with 6 attention heads. The feature extractor models global context information through a self-attention mechanism, ensuring that key character features can still be extracted even with uneven character spacing and character corruption.

[0026] The local feature enhancement module is used to enhance the model's ability to represent character strokes, boundary structures, and local textures. Although Vision Transformer has significant advantages in modeling long-range dependencies and global context, its ability to characterize local features is relatively limited.

[0027] like Figure 2 As shown, the specific implementation steps of LFEM are as follows: First, the feature sequence M output by the feature extractor is rearranged into a two-dimensional feature map. : (1) in, and These are the height and width of the input image, respectively. The feature dimensions are transformed using linear projection. dimension: (2) rearranged features The input is passed to three cascaded convolutional branches, each containing two 3×3 convolutional layers. Each convolutional layer is followed by batch normalization and a ReLU activation function. The first convolutional layer reduces the number of channels from... Halved to The second layer keeps the number of channels unchanged: (3) The outputs of all branches are concatenated with the original features, and multi-scale features are fused through 1×1 convolution and mapped back to the original dimensions. : (4) (5) Finally, the fused features are added to the original input features via residual connections and then normalized by layers to obtain the output L of the local feature enhancement module. (6).

[0028] The Adaptive Position Coding and Calibration Module (APCM) addresses the issue of uneven character spacing and potential positional distortion in stone rubbings, which traditional sinusoidal position coding methods fall short of. APCM learns positional offsets and dynamically adjusts the spatial representation of characters. For example... Figure 3 As shown, the specific implementation steps of APCM are as follows: For each location in the feature map Generate normalized grid coordinates: (7) in The height of the feature map, The width of the feature map is denoted as . After stacking and reshaping the coordinates into a sequence format, the 2D offset is predicted using an MLP network containing two fully connected layers: (8) in, It contains two layers of fully connected networks. , Through learnable projection matrices Map the two-dimensional offset to the feature space: (9) Finally, the offset features are added to the original features and then normalized by layers to obtain the position-calibrated features: (10).

[0029] The Adaptive Variation Compensation Module (AVCM) addresses a core challenge in stone inscription text recognition: intra-class variability. AVCM employs a two-branch structure to evaluate character variations and generates adaptive modulation parameters based on the evaluation results. It preserves the original distribution of character features with minor variations while compensating for and normalizing damaged or highly varied character features.

[0030] like Figure 4 As shown, AVCM includes a global branch and local branches. The global branch extracts global feature representations through global average pooling: (11).

[0031] The global features are then mapped to a two-dimensional matrix using a lightweight MLP network, and activated by a Sigmoid function to ensure that the output is between [0, 1]. (12).

[0032] Local branches convert sequence features into two-dimensional feature maps, through Convolution dimensionality reduction, after window size is The average pooling aggregates local features, evaluates local variability through depthwise separable convolution, activates Sigmoid, and restores the original size using bilinear interpolation to obtain the local evaluation value. .

[0033] The global and local evaluation values ​​are weighted and fused using a learnable fusion weight α (initialized to 0.5): (13); The initial value of the fusion weight α is 0.5. The fusion weight can be automatically learned during training and scaling and offset parameters can be generated based on the fusion result.

[0034] Scaling parameters are generated based on the fused evaluation values. and offset parameters The parameter range is limited through a pruning operation. Finally, mutation compensation is achieved through element-wise modulation. (14).

[0035] The character decoding module is built upon a permutation language modeling framework and consists of a masked multi-head self-attention layer (MHSA), a cross-attention layer, and a feedforward neural network (FFN). The decoder has 12 attention heads. By separating the position query stream from the content information stream, it fully utilizes the context while avoiding information leakage, enabling flexible prediction of character sequences in any order.

[0036] Loss function optimization, the overall loss function in this disclosure It can be represented as: (15) in, and All are 0.01. To identify the loss in the partial loss function, the cross-entropy loss function is used. The magnitude of the offset is constrained to account for the loss of the adaptive position encoding calibration module. (16) Loss for the adaptive mutation compensation module: in, To constrain the offset of the position calibration regularization loss. The constraint scaling parameter is used to compensate for the regularization loss due to mutation. This is the offset parameter.

[0037] In practical applications, to comprehensively evaluate the performance of the method disclosed herein on Chinese text recognition tasks, this embodiment uses two metrics for evaluation: Line Accuracy (LACC) and Normalized Edit Distance (NED). The magnitude of the position calibration regularization loss constraint offset and the constraint scaling parameter of the variation compensation regularization loss both approach 1, such as being between 0.9 and 1, while the offset parameter approaches 0, such as being between 0 and 0.1.

[0038] Line accuracy measures the proportion of text lines that the model correctly identifies, and its calculation formula is as follows: (18) in, Indicates the number of samples. For indicator functions, For the model to predict sequences, The predicted sequence must be identical to the true sequence. This metric requires that the predicted sequence be completely identical to the true sequence, including character order and length.

[0039] However, LACC is limited by its binary nature, failing to distinguish between "almost correct" and "completely incorrect" results. Therefore, this paper also incorporates NED to measure the similarity between the predicted and true sequences. Edit distance is defined as the minimum number of single-character editing operations required to transform one string into another, including insertion, deletion, and replacement operations. The calculation formula is: (19) in, Represents the true sequence and predicted sequence Edit distance between This indicates the maximum length of the actual or predicted sequence.

[0040] Please refer to Figure 5 The adaptive position calibration and variation compensation Chinese text recognition method disclosed in this disclosure includes the following specific steps: S1, Obtain the image feature sequence; extract features from the input Chinese text image using a feature extractor to obtain the image feature sequence. Specifically, the process of obtaining the image feature sequence includes extracting features from the input Chinese text image using a feature extractor; wherein, the feature extractor adopts a ViT structure, divides the input image into multiple patches, superimposes positional encoding after linear projection, and uses a self-attention mechanism to model the global context, which can ensure that key character feature information can still be extracted even when the character spacing is uneven and the characters are damaged.

[0041] S2, perform multi-scale feature extraction and fusion on the image feature sequence to obtain the output after local feature enhancement; this step specifically includes steps S21 to S24. S21, rearrange the image feature sequence into a two-dimensional feature map and perform linear projection; S22, extract local features at different scales layer by layer through multiple cascaded convolutional branches, each convolutional branch containing two convolutional layers, followed by batch normalization and activation functions; S23, concatenate the outputs of each convolutional branch with the original features and then fuse them through convolution; S24, obtain the output after local feature enhancement through residual connections and layer normalization. In practical applications, the input feature sequence is input into the local feature enhancement module, which implements steps S21 to S24. The local feature enhancement module aims to enhance the model's ability to represent character strokes, boundary structures, and local textures.

[0042] S3: Based on the spatial location information of the output after local feature enhancement, dynamically predict the offset and calibrate the position encoding to obtain the position-calibrated features. This step addresses the issue of uneven character spacing and potential positional distortion in stone tablet rubbings, making targeted adjustments to reduce inaccuracies caused by uneven character spacing and positional distortion, thereby improving the accuracy of stone tablet rubbing recognition. Specifically, this step includes steps S31 to S34: S31: Generate normalized grid coordinates for each spatial location in the feature map; S32: Predict the two-dimensional offset for each spatial location; S33: Map the two-dimensional offset to the feature space to obtain the offset features; S34: Add the offset features to the original features and perform layer normalization to obtain the calibrated features. This step utilizes an adaptive position encoding calibration module. For the processes of generating normalized grid coordinates, predicting two-dimensional offsets, and mapping the two-dimensional offsets to the feature space, refer to the aforementioned description of the adaptive position encoding calibration module (APCM).

[0043] S4, perform adaptive mutation compensation processing on the position-calibrated features to evaluate the degree of character variation and generate adaptive modulation parameters. Then, perform element-wise modulation on the position-calibrated features to obtain the variation-compensated features. The method for element-wise modulation of the position-calibrated features is to perform element-wise modulation on the position-calibrated features within a preset range through a cropping operation based on scaling and offset parameters. In specific implementation, this step is implemented through an adaptive mutation compensation module. Specifically, the adaptive mutation compensation module includes a global branch and a local branch. The global branch is used to extract the overall variation evaluation value of the image through global average pooling and a multilayer perceptron network. The local branch is used to convert the position-calibrated features into a two-dimensional feature map and extract the local variation evaluation value of each region through window pooling and depthwise separable convolution. The adaptive mutation compensation module (AVCM) is mainly used to solve the intra-class variation problem faced by rubbings of stone tablets. AVCM evaluates character variation through a two-branch structure and generates adaptive modulation parameters based on the evaluation results. It maintains the original distribution of character features with small variations and compensates and normalizes character features that are damaged or have large variations. Regarding the adaptive mutation compensation module, please refer to the adaptive mutation compensation module (AVCM) described above, which will not be repeated here.

[0044] S5, the variant-compensated features are decoded to predict the character sequence and output the text recognition result. This step is implemented through a character decoding module with 12 attention heads. By separating the position query stream and the content information stream, the context is fully utilized while avoiding information leakage, allowing for flexible prediction of character sequences in any order. Please refer to the aforementioned description of the character decoding module for details.

[0045] In practical applications, to verify the method proposed in this disclosure, model training and optimization were performed. Training was conducted using a PyTorch-based deep learning framework and an NVIDIA RTX 4090 GPU (24GB VRAM). The AdamW optimizer was used for model training. Data augmentation techniques were employed during training, including random rotation angle ranges. Random scaling range [0.9, 1.1], brightness, contrast, and saturation are randomly adjusted. All data augmentation operations are based on probability. Random application.

[0046] This publication presents comprehensive experimental validation on a stone inscription rubbing dataset and a benchmark dataset for Chinese text recognition. The training dataset, synthesized from the Kangxi Dictionary and the Siku Quanshu corpus, contains 40,000 samples. The test dataset consists of 3,963 real stone inscription rubbing images, primarily derived from important Tang and Song dynasty inscriptions, such as the Daoyin Master Stele, the Duobao Pagoda Stele, the Yanta Sacred Teachings Preface, and the Feng Shiying Epitaph. Furthermore, supplementary experiments were conducted on other benchmark Chinese datasets, including scene datasets, webpage datasets, and document datasets.

[0047] Experimental results show that the method disclosed in this paper outperforms existing technologies in both stone rubbing text recognition and Chinese text recognition. Specifically, on the stone rubbing dataset, the line accuracy (LACC) reaches 83.82%, and the normalized edit distance (NED) is 0.958, representing improvements of 3.80 percentage points and 0.035 percentage points, respectively, compared to the baseline model. On the scene dataset, the LCC reaches 80.21%, an improvement of 2.60 percentage points; on the webpage dataset, the LCC reaches 74.41%, an improvement of 1.92 percentage points; and on the document dataset, the LCC reaches 99.10%, an improvement of 1.69 percentage points. Ablation experiments further demonstrate the effectiveness of each module in improving the overall performance: the APCM module improves by 1.48 percentage points, the AVCM module further improves by 1.23 percentage points, and the LFEM module further improves by 1.09 percentage points, as shown in Table 1.

[0048] In Table 1, APCM is the Adaptive Position Coding Calibration Module, AVCM is the Adaptive Variation Compensation Module, and LFEM is the Local Feature Enhancement Module. Table 1 shows the row accuracy (LACC) and edit distance (NED) for modules with and without the Adaptive Position Coding Calibration Module, Adaptive Variation Compensation Module, and Local Feature Enhancement Module. In Table 1, the data before “ / ” is the LACC, and the data after “ / ” is the NED, with units of %. According to formulas (18) and (19), it can be seen that the larger the LACC, the higher the recognition accuracy, and the closer the NED value is to 1, the higher the recognition accuracy.

[0049] Table 1 Furthermore, Table 2 also shows a comparison with existing models. In Table 2, A... 2 PV is compared with state-of-the-art methods on stone rubbing datasets and Chinese scene text datasets. The evaluation metrics are LACC / NED, presented in percentage and decimal formats, respectively. A higher LACC value (closer to 100%) indicates higher accuracy, and a higher NED value (closer to 1) indicates higher accuracy.

[0050] Table 2 The method disclosed in this paper not only performs well on experimental datasets, but also has broad application prospects, such as the digitization of ancient books, the preservation of inscriptions and documents, the intelligent management of cultural heritage, and digital humanities research.

[0051] This disclosure includes a feature extractor, a local feature enhancement module, an adaptive positional encoding calibration module, an adaptive mutation compensation module, and a character decoding module. The Vision Transformer feature extractor acquires global features of the input image. The local feature enhancement module enhances local feature representation capabilities through multi-scale cascaded convolutions. The adaptive positional encoding calibration module calibrates the spatial relationships between characters by dynamically learning positional offsets, adapting to non-uniform character spacing. The adaptive mutation compensation module evaluates the degree of character mutation through global and local dual-branch approaches, generating adaptive scaling and offset modulation parameters to achieve differentiated processing of features with different degrees of mutation. The character decoding module predicts character sequences based on a permutation language modeling framework.

[0052] This invention effectively improves the recognition accuracy and robustness of rubbings from stone tablets, demonstrating significant advantages in complex scenarios such as uneven character spacing, character damage, and intraclass variability. Experimental results show that this method achieves superior performance metrics compared to existing methods on both stone tablet rubbing datasets and multiple Chinese text recognition benchmark datasets. This invention has broad applicability in the fields of ancient book digitization, preservation of inscribed documents, intelligent management of cultural heritage, and related document recognition, possessing significant application value and promising prospects for wider application.

[0053] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "illustrative embodiment," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this disclosure. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0054] Although embodiments of this disclosure have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of this disclosure, the scope of which is defined by the claims and their equivalents.

Claims

1. A Chinese text recognition method with adaptive position calibration and variation compensation, comprising the following steps: Obtain image feature sequences; Multi-scale feature extraction and fusion are performed on the image feature sequence to obtain an output with enhanced local features; characterized in that, Based on the spatial location information of the output after local feature enhancement, the offset is dynamically predicted and the location encoding is calibrated to obtain the features after location calibration. Adaptive variation compensation processing is performed on the position-calibrated features to evaluate the degree of character variation and generate adaptive modulation parameters. The position-calibrated features are then modulated element by element to obtain the variation-compensated features. The variant-compensated features are then used for character decoding to predict character sequences and output text recognition results.

2. The Chinese text recognition method with adaptive position calibration and variation compensation according to claim 1, characterized in that, The process of performing multi-scale feature extraction and fusion on the image feature sequence to obtain the output with enhanced local features includes the following steps: The image feature sequence is rearranged into a two-dimensional feature map and then linearly projected. Local features at different scales are extracted layer by layer through multiple cascaded convolutional branches. Each convolutional branch contains two convolutional layers, followed by batch normalization and activation functions. The outputs of each convolutional branch are concatenated with the original features and then fused through convolution. The output after local feature enhancement is obtained through residual connections and layer normalization.

3. The Chinese text recognition method with adaptive position calibration and variation compensation according to claim 2, characterized in that, The process of obtaining the location-calibrated features includes the following steps: Normalized grid coordinates are generated for each spatial location in the feature map output after the local features are enhanced; Predict the two-dimensional offset of each of the aforementioned spatial locations; The two-dimensional offset is mapped to the feature space to obtain the offset feature; The offset features are added to the original features and then normalized by layers to obtain the calibrated features.

4. The Chinese text recognition method with adaptive position calibration and variation compensation according to claim 3, characterized in that, The module used to perform adaptive variation compensation processing on the features after position calibration is the adaptive variation compensation module; The adaptive mutation compensation module includes a global branch and a local branch; the global branch is used to extract the overall mutation evaluation value of the image through global average pooling and a multilayer perceptron network. The local branch is used to convert the position-calibrated features into a two-dimensional feature map, and extract the local variation evaluation values ​​of each region through window pooling and depthwise separable convolution.

5. The Chinese text recognition method with adaptive position calibration and variation compensation according to claim 4, characterized in that, The overall variation assessment value and the local variation assessment value are weighted and fused using a fusion weight; The fusion weights can be automatically learned during training and scaling and offset parameters can be generated based on the fusion results.

6. The Chinese text recognition method with adaptive position calibration and variation compensation according to claim 5, characterized in that, The method for modulating the position-calibrated features element by element is to modulate the position-calibrated features element by element within a preset range by using a cropping operation based on scaling parameters and offset parameters.

7. The Chinese text recognition method with adaptive position calibration and variation compensation according to claim 1, characterized in that, Character sequence prediction is achieved through a character decoding module; The character decoding module is built on a permutation language modeling framework. It predicts character sequences in any order by separating the position query stream and the content information stream.

8. The Chinese text recognition method with adaptive position calibration and variation compensation according to claim 1, characterized in that, The overall loss function used during training consists of a weighted sum of recognition loss, position calibration regularization loss, and mutation compensation regularization loss.

9. The Chinese text recognition method with adaptive position calibration and variation compensation according to claim 8, characterized in that, The magnitude of the constraint offset of the position calibration regularization loss and the constraint scaling parameter of the variation compensation regularization loss both tend to be greater than 0.9 and less than 1, while the offset parameter is greater than 0 and less than 0.

1.

10. The Chinese text recognition method with adaptive position calibration and variation compensation according to any one of claims 1-9, characterized in that, The process of obtaining the image feature sequence includes extracting features from the input Chinese text image using a feature extractor. The feature extractor adopts a ViT structure, which divides the input image into multiple patches, superimposes positional codes after linear projection, and models the global context using a self-attention mechanism.