An ancient topographic map place name recognition method and system

CN120452009BActive Publication Date: 2026-10-16SHENYANG PEDLIN TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510514767.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-23
Publication Date
2026-10-16
Estimated Expiration
2045-04-23

AI Technical Summary

Technical Problem

[0010]针对现有技术的不足,本发明提供一种古代地形图地名的识别方法和系统,以解决现有文字识别方法不适用于古代地形地图的场景的问题

Benefits of technology

[0086] A two-stage strategy for text region detection and character recognition was designed to effectively improve the end-to-end accuracy of place name recognition. In the first stage, image slicing followed by detection reduces the adverse effects of large scale differences between the image and text, achieving accurate text region localization and reducing inference time. The first-stage algorithm utilizes a Spatial Attention Cross-Dimensional Reconstruction (SACR) module, combining spatial, channel, and frequency domain features to enhance the model's feature extraction capabilities, reduce spatial redundancy, and improve the model's adaptability to variable fonts, directions, and variant characters in ancient maps. In the second stage, preprocessing employs conversion to grayscale, filtering, and the GrabCut algorithm to weaken background features and highlight text features. The original branch and a newly added branch based on the image restoration module are used to collaboratively recognize text, improving the accuracy of low-quality text image recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120452009B_ABST
    Figure CN120452009B_ABST
Patent Text Reader

Abstract

The application discloses an ancient topographic map place name recognition method and system, and relates to the field of computer vision. A two-stage strategy of character region detection and character recognition is designed, which effectively improves the end-to-end accuracy of place name recognition. Through the processing of cutting the image and then detecting in the first stage, the adverse effects caused by the too large scale difference between the image and the text are reduced, the text region is accurately positioned, and the reasoning time is reduced; the spatial attention cross-dimension reconstruction module is used on the first-stage algorithm, the spatial, channel and frequency domain features are combined, so that the feature extraction capability of the model is improved, the spatial redundancy is reduced, and the adaptability of the model to the variable font, variable direction and variant characters in the ancient map is enhanced; in the second stage, the gray image conversion, filtering and GrabCut algorithm are used in the pretreatment to weaken the background features and highlight the text features; the original branch and the newly added branch based on the image restoration module are used to cooperatively recognize the text, and the accuracy of the low-quality text image recognition is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer vision, and more particularly to a method and system for recognizing place names on ancient topographic maps. Background Technology

[0002] With the development of "visual history" and digital humanities, the collection, organization, and digitization of historical maps have become a research hotspot. Analyzing these place names allows us to trace historical events, explore cultural exchange and integration, and provides an important bridge connecting the past and present. However, the organization of place names in ancient maps is still in its early stages. Place name OCR extraction algorithms, as the first step in these tasks, will provide a data foundation for subsequent research in cartographic history and place name history.

[0003] To extract text from printed documents or existing images and form textual data, OCR recognition of images is a common method. Chinese Invention Patent CN202411113565.0 discloses an OCR recognition method for airline itineraries. This method includes: pre-dividing the airline itinerary into six sections according to the content of printed fields; performing OCR recognition on the itinerary; determining the coordinate range of each section based on the coordinates of the vertices of the reference printed fields in each section; and then generating an airline itinerary information table. This method effectively improves the accuracy and information completeness of OCR recognition for airline itineraries. Similarly, Chinese Invention Patent CN202410306337.9 discloses an invention patent for ancient book text recognition. This method for recognizing ancient book text containing dirt and omissions includes: acquiring an image; identifying the text position in the image; identifying all text characters in the text position; calling a language model trained on a preset corpus training sample set; and retrieving text characters from a first text candidate set based on the text content where the missing characters are located, and completing the recognition. By adopting the technology provided by this invention, the accuracy of ancient text recognition can be effectively improved.

[0004] The aforementioned patent technology CN202411113565.0 employs OCR (Optical Character Recognition) technology. The basic process involves an electronic device (such as a scanner or digital camera) examining printed characters on paper, determining their shape by detecting dark and light patterns, and then translating the shape into computer text using character recognition methods. This method is based on deep learning detection algorithms. Among these, the Connectionist Text Proposal Network (CPTN) algorithm assumes that text boxes exist as long rectangles. It first uses long, narrow rectangles to detect the content of the text image, determining whether there is text content within the rectangles. Then, it merges the rectangles containing text content to obtain the coordinates of the text blocks. Compared to traditional algorithms, the CPTN algorithm uses convolutional neural networks to extract image features, resulting in improved performance. However, it performs poorly in detecting distorted text, making it unsuitable for scenarios involving ancient maps.

[0005] The aforementioned patent technology CN202410306337.9 also employs a two-stage OCR technology. The principle is as follows: First, identify the text location in the image; second, identify all text characters within the text location; third, when a missing character is identified, identify the first character of the missing character, where the first character is a partial component of the text character; fourth, generate a first candidate character set containing the first character; fifth, call a language model trained on a preset corpus training sample set, and retrieve text characters from the first candidate character set based on the text content containing the missing character, thus completing the recognition. While this invention can effectively improve the accuracy of ancient text recognition, it still cannot achieve good recognition results when dealing with ancient topographic maps, where the map background is too complex and the text size, direction, and font diversity are extremely high.

[0006] In conclusion, existing OCR recognition algorithms are not well-suited for recognizing place names in ancient topographic maps. The specific reasons are as follows:

[0007] (1) Map layout design: The layout of ancient topographic maps differs significantly from that of modern OCR (Optical Character Recognition) systems. Ancient topographic maps have complex and varied base maps and are generally large in size. Compared to the size of place names on the map, the text appears relatively small. These factors together increase the difficulty and interference in the OCR recognition process.

[0008] (2) Font Information Processing: The font information in ancient topographic maps is complex and varied, containing both traditional and simplified Chinese characters, and multiple variant forms of the same character exist within the same map. Furthermore, the writing direction of the characters varies, and their distribution lacks a unified rule. These characteristics pose significant challenges to existing OCR recognition algorithms, making them unsuitable for direct application to text recognition in ancient topographic maps.

[0009] (3) Text and background overlap problem: In ancient topographic maps, there is a common phenomenon of text and map background elements overlapping each other. This phenomenon causes significant interference to the text recognition process and greatly increases the processing difficulty of OCR technology. Summary of the Invention

[0010] To address the shortcomings of existing technologies, this invention provides a method and system for identifying place names on ancient topographic maps, thereby solving the problem that existing text recognition methods are not applicable to scenarios involving ancient topographic maps.

[0011] The technical solution of this invention is as follows:

[0012] The first aspect of this invention provides a method for identifying place names on ancient topographic maps, comprising the following steps:

[0013] Construct a text region detection dataset and a character recognition dataset; the text region detection dataset includes several ancient topographic maps, with text regions marked by rectangles in each ancient topographic map; the character recognition dataset includes several text image slices, with each text image slice using the traditional Chinese characters corresponding to the characters contained therein as labels;

[0014] The first-stage text region detection model is constructed to detect text regions in the input map tiles and output the text regions in the form of rectangular boxes;

[0015] To construct the second-stage character recognition model, an additional branch is added to the single-branch model structure of the SVTR algorithm for character recognition.

[0016] The first-stage text region detection model is trained using a text region detection dataset to obtain the trained first-stage text region detection model.

[0017] The character recognition model for the second stage is trained using a character recognition dataset to obtain the trained character recognition model for the second stage.

[0018] By utilizing the first-stage text region detection model and the second-stage character recognition model that have been trained, the recognition of place names on ancient topographic maps can be achieved.

[0019] Furthermore, the construction of the text region detection dataset and the character recognition dataset specifically involves:

[0020] A1: Obtain several ancient topographic maps;

[0021] A2: Perform image preprocessing on the ancient topographic map to obtain the preprocessed ancient topographic map;

[0022] A3: Cut the pre-processed ancient topographic map into several map tiles according to the set size;

[0023] A4: Use bounding boxes to label each text region in the map tile as a label for each ancient topographic map, and then construct a text region detection dataset;

[0024] A5: Cropping out each text region from the map tile yields several text image slices. The traditional Chinese characters corresponding to the text contained in the text image slices are used as the labels for the text image slices, thereby constructing a preliminary character recognition dataset.

[0025] A6: Acquire images of ancient books and preprocess them to obtain preprocessed image tiles;

[0026] The method for preprocessing ancient book images specifically involves: cropping the ancient book image into several blocks according to a set size, and then randomly adding lines;

[0027] A7: Crop out each text region in the preprocessed image patch to obtain several text image slices. Use the traditional Chinese characters corresponding to the characters contained in the text image slices as the labels of the text image slices. Add the obtained text image slices and their labels to the preliminary character recognition dataset obtained in A5.

[0028] A8: The background of the text image slices in the preliminary character recognition dataset is weakened to obtain the processed text image slices, which in turn yields the final character recognition dataset.

[0029] Furthermore, in the first-stage text region detection model, after convolutional layers 4 and 5 of the ResNet50 backbone network of the text detection model DB++, a spatial attention cross-dimensional reconstruction module (SACR) is added respectively.

[0030] The Spatial Attention Cross-Dimensional Reconstruction Module (SACR) first converts the input feature I... sacr After adjusting the number of channels using a 1x1 convolution, feature X is obtained. Feature X is then input into a Spatial Attention Reconstruction Unit (SARU). The output features of the SARU and feature X are then superimposed to obtain a concatenated feature X'. This concatenated feature X' is then input into a Channel Reconstruction Unit (CRU) for channel reconstruction, yielding the reconstructed channel feature J. Finally, a Frequency Reconstruction Unit (FRU) is used to process the input feature J.sacr Transform to the frequency domain space for feature extraction to obtain frequency domain space features Z; input features I sacr The channel reconstruction features J and frequency domain spatial features Z are superimposed, and then the number of channels is adjusted by 1*1 convolution before output, which yields the output features of the spatial attention cross-dimensional reconstruction module SACR.

[0031] Furthermore, the Spatial Attention Reconstruction Unit (SARU) includes a separation stage, a reconstruction stage, and a spatial feature enhancement stage. The separation stage separates information-rich features from the input features X. and the characteristics of information poverty The reconstruction phase will incorporate information-rich features. and the characteristics of information poverty By performing neutralization domain transformation, we obtain the spatially refined feature X. w The spatial feature enhancement stage uses a spatial attention mechanism to refine spatial features X. w Adaptive spatial feature enhancement is performed to generate the output features of the Spatial Attention Reconstruction Unit (SARU);

[0032] The separation phase process is specifically as follows:

[0033] First, group normalization is performed on the input feature X to obtain the group-normalized feature X. out ;Calculate the normalized feature X of the group out Normalized weights for each channel and grouped normalized features X out Each channel is multiplied by its corresponding normalized weight to form a weight feature Y; then, the weight feature Y is mapped to the range [0,1] using a non-linear activation function, Sigmoid. Based on the weight feature after the non-linear activation function, the input feature X is divided into information-rich features through thresholding. and the characteristics of information poverty

[0034] The normalized feature X out The normalized weights for each channel are:

[0035]

[0036] Among them, w i The normalized feature X out The normalized weight of the i-th channel, where i and j are the channel numbers, and c is the number of channels; γ i and γ j The normalized feature X out The original weight values ​​of the i-th and j-th channels;

[0037] The threshold processing specifically involves setting a gating threshold, setting the weight values ​​of channels whose channel values ​​are greater than the gating threshold in the weighted features after the nonlinear activation function to 1, and setting the weight values ​​of the remaining channels to 0, thereby obtaining the feature weights W of the information-rich portion. 1,i Subtract the feature weight W of the information-rich part from 1. 1,i Obtain the feature weights W for the information-poor parts. 2,i This yields the feature weight matrix W1 for the information-rich part and the feature weight matrix W2 for the information-poor part. The input feature X is then multiplied element-wise by both the information-rich and information-poor feature weight matrices W1 and W2 to obtain the information-rich feature. and the characteristics of information poverty

[0038] The reconstruction phase specifically involves: first, reconstructing information-rich features... and the characteristics of information poverty Each segment is divided into two parts with an equal number of channels, and information-rich features are used. The first half is characterized by information scarcity The latter half is summed pixel by pixel to obtain feature X. w1 Using information-rich features The latter half is characterized by information scarcity. The first half is summed pixel by pixel to obtain feature X. w2 Then feature X w1 and feature X w2 Channel overlay is performed to obtain the spatially refined feature X. w ;

[0039] The spatial feature enhancement stage specifically involves: firstly refining the spatial feature X... w Max pooling and average pooling are performed along the channel dimension. The results of max pooling and average pooling are concatenated along the channel dimension, and then processed by 7*7 convolution and the non-linear activation function sigmoid to obtain the spatial attention weight matrix M. The spatial attention weight matrix M is then combined with the spatial refined feature X. w Multiplying these features yields the output characteristics of the Spatial Attention Reconstruction Unit (SARU).

[0040] Furthermore, the frequency reconstruction unit (FRU) first converts the input feature I into a two-dimensional fast Fourier transform. sacr The function is converted into a frequency domain complex tensor F. Then, the frequency domain complex tensor is split into a frequency domain real part and a frequency domain imaginary part. Three convolutional layers are then applied to each of the frequency domain real and imaginary parts to extract and adjust the features in the frequency domain, resulting in a real part feature layer R and an imaginary part feature layer I. Finally, the real part feature layer R and the imaginary part feature layer I are merged to obtain the frequency domain feature F. filteredAn adaptive gating structure is constructed using global average pooling and the nonlinear activation function Sigmoid, dynamically adjusting the frequency domain feature gating weights g. These gating weights g are then extended to the frequency domain feature F via a broadcast mechanism. filtered Same dimension, and with frequency domain feature F filtered The frequency domain feature F after gating is obtained by performing element-wise multiplication. gated The frequency domain features F after gated gated The final output tensor is obtained by transforming it back to the original domain through inverse Fourier transform.

[0041] The real part and imaginary part in the frequency domain are:

[0042]

[0043] Among them, F real F is the real part in the frequency domain. imag For the frequency domain imaginary part, Re is the real part tensor computation function, IM is the imaginary part tensor computation function, B is the batch size, C is the number of channels, H is the feature map height, W is the feature map width; F * For the complex conjugate of F, i * It is the imaginary unit;

[0044] The real feature layer R and the imaginary feature layer I are:

[0045]

[0046] Among them, C real C represents a convolutional layer with real feature layers R. imag This represents the convolutional layer representing the imaginary part feature layer I;

[0047] The frequency domain feature F filtered for:

[0048]

[0049] Where stack represents the channel overlay operation;

[0050] The frequency domain feature gate weight g is calculated as follows:

[0051]

[0052] Where v is the channel weight vector, and h represents the frequency domain feature F filtered The Bank of China's serial number, w represents the frequency domain feature F. filtered The numbering in the middle column, Representing frequency domain features F filtered It has 5 dimensions, namely B, C, h, w, and d; d is used to distinguish between the imaginary part and the real part. When d = 1, it represents the real part, and when d = 2, it represents the imaginary part.

[0053] The frequency domain feature F after gating gated for:

[0054]

[0055] Among them, g expanded The frequency domain feature gating weights are those extended through a broadcast mechanism;

[0056] The final output tensor is:

[0057]

[0058] Among them, F complex The complex tensor obtained after transformation is view_as_complex, the complex transformation function is IFFT, the inverse fourier transform is 2D, and Q is the final output tensor.

[0059] Furthermore, in the second-stage character recognition model, an additional branch is added to the single-branch model structure of the SVTR algorithm. This new branch shares the backbone and neck network with the original branch. The feature layer output from the neck network is fed into the image restoration module of the new branch for processing. Then, it is processed by a parallel linear classification predictor composed of several fully connected layers in the new branch to predict the probability distribution P2. The probability distribution P1 predicted by the original branch and the probability distribution P2 predicted by the new branch are weighted and then processed by the softmax and argmax functions to obtain the predicted character index value. Thus, the corresponding character is obtained;

[0060] The weighted sum of the probability distribution P1 of the original branch prediction and the probability distribution P2 of the new branch prediction is as follows:

[0061]

[0062] Among them, P final This is the weighted probability distribution, where G is the number of character categories;

[0063] The image restoration module includes: a prompt generation module and a prompt interaction module; the prompt generation module is used to generate prompts based on the feature vector F1 of the input image and the prompt component P. n A corresponding conditional cue P is generated; the cue interaction module is used to dynamically enhance the feature vector F1 of the input image based on the conditional cue P, to obtain the enhanced feature representation.

[0064] The overall process of the prompt generation module is as follows:

[0065]

[0066] y j =Softmax(Conv 3*3 (MP(F1))) (23)

[0067] Among them, Conv 1*1 and Conv 3*3 These represent 1x1 convolution and 3x3 convolution, respectively; n is the cue component number, N is the number of cue components, Softmax is the Softmax activation function, MP is the hybrid pooling function, and y... j To indicate the component weight vector;

[0068] The overall process of the PIM (Prompt Interaction Module) is as follows:

[0069]

[0070] Where, ; represents a cascade operation, and MDTA is represented as D = W. p V·Softmax(K·Q / α)+E, where E and D are the input and output features, respectively, and Q, K, and V represent the query projection, key projection, and value projection, respectively; W p For pointwise convolution, α is a learnable scaling parameter, · represents dot product interaction, and GDFN is a gated deep fusion network.

[0071] Furthermore, the recognition of place names on ancient topographic maps is achieved by utilizing the trained first-stage text region detection model and the second-stage character recognition model, specifically as follows:

[0072] B1: Cut the ancient topographic map to be identified into several map tiles according to the set size;

[0073] B2: Input several map tiles corresponding to the ancient topographic map to be identified into the first-stage text region detection model after training to infer and obtain text regions in the form of rectangular boxes;

[0074] B3: Cut out text image slices according to the rectangular frame and weaken the background;

[0075] B4: Input the text image slices after background weakening into the trained second-stage character recognition model to obtain the corresponding traditional Chinese characters, i.e., place name text information;

[0076] B5: Visualize the rectangular text area and place name information on the ancient topographic map to be identified, and obtain the final place name recognition result.

[0077] A second aspect of the present invention provides a system for identifying place names on ancient topographic maps, used to implement the aforementioned method for identifying place names on ancient topographic maps, comprising:

[0078] The ancient topographic map acquisition module is used to acquire ancient topographic maps to be identified.

[0079] The cropping module is used to crop the ancient topographic map to be identified into several map tiles according to a set size;

[0080] The first-stage text region detection model is used to mark text regions in the form of rectangular boxes from several input map tiles;

[0081] The background blurring module is used to cut out text image slices according to the rectangular frame and blur the background.

[0082] The second-stage character recognition model is used to identify the corresponding traditional Chinese characters from text image slices that have undergone background weakening processing.

[0083] A third aspect of the present invention provides an electronic device, comprising: a processor, a memory, and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the memory via the bus, and when the machine-readable instructions are executed by the processor, the method for identifying place names on ancient topographic maps is executed.

[0084] A fourth aspect of the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, performs a method for identifying place names on ancient topographic maps as described above.

[0085] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0086] A two-stage strategy for text region detection and character recognition was designed to effectively improve the end-to-end accuracy of place name recognition. In the first stage, image slicing followed by detection reduces the adverse effects of large scale differences between the image and text, achieving accurate text region localization and reducing inference time. The first-stage algorithm utilizes a Spatial Attention Cross-Dimensional Reconstruction (SACR) module, combining spatial, channel, and frequency domain features to enhance the model's feature extraction capabilities, reduce spatial redundancy, and improve the model's adaptability to variable fonts, directions, and variant characters in ancient maps. In the second stage, preprocessing employs conversion to grayscale, filtering, and the GrabCut algorithm to weaken background features and highlight text features. The original branch and a newly added branch based on the image restoration module are used to collaboratively recognize text, improving the accuracy of low-quality text image recognition. Attached Figure Description

[0087] Figure 1 This is a flowchart illustrating a method for identifying place names on ancient topographic maps according to an embodiment of the present invention;

[0088] Figure 2 This is an example of an ancient topographic map in an embodiment of the present invention;

[0089] Figure 3 This is a structural diagram of the text region detection model in the first stage of this invention embodiment;

[0090] Figure 4 This is a structural diagram of the spatial attention cross-dimensional reconstruction module in an embodiment of the present invention;

[0091] Figure 5 This is a structural diagram of the spatial attention reconstruction unit in the spatial attention cross-dimensional reconstruction module of this invention.

[0092] Figure 6 This is a structural diagram of the frequency reconstruction unit in the spatial attention cross-dimensional reconstruction module in an embodiment of the present invention;

[0093] Figure 7 This is a flowchart of the character recognition model inference process in the second stage of this invention.

[0094] Figure 8 This is a structural diagram of the general image restoration module (Prompt Restore Block) in an embodiment of the present invention. Detailed Implementation

[0095] This embodiment provides a method for recognizing place names on ancient topographic maps, involving the accurate recognition of traditional Chinese characters in ancient documents. The core of this technology lies in developing a highly efficient deep learning algorithm specifically designed to recognize place name characters on ancient Chinese topographic maps, thereby improving the accuracy and efficiency of OCR technology when processing such historical documents.

[0096] This embodiment provides a method for identifying place names on ancient topographic maps, such as... Figure 1 As shown, it includes the following steps:

[0097] Step 1: Construct a text region detection dataset and a character recognition dataset;

[0098] The text region detection dataset includes several ancient topographic maps, with text regions marked by rectangles in each map; the character recognition dataset includes several text image slices, with each slice labeled using the traditional Chinese characters corresponding to the characters it contains.

[0099] Step 1.1: Obtain several ancient topographic maps;

[0100] In this embodiment, the ancient topographic maps in the ancient map dataset are first subjected to basic screening, retaining ancient topographic maps with a basically uniform format, such as... Figure 2As shown, this embodiment presents an example of an ancient topographic map used in an application scenario. The text is in Traditional Chinese, the text direction is inconsistent, and the map layout and background are complex.

[0101] Step 1.2: Perform image preprocessing on the ancient topographic map to obtain a preprocessed ancient topographic map; the image preprocessing includes rotation, scaling, brightness and contrast adjustment, and noise reduction, etc.

[0102] Step 1.3: Cut the preprocessed ancient topographic map into several map tiles according to the set size;

[0103] Because the overall size of ancient topographic maps is too large, often reaching around 9000 pixels in resolution, while the scale of individual place name characters is very small, only 10 to 20 pixels, it is unreasonable to perform training and inference directly on the entire map. Therefore, a method of segmenting the map before proceeding with subsequent processes is adopted. Tests have shown that this method greatly improves the accuracy and speed of recognition. In this embodiment, each entire ancient topographic map is cropped into 1024*1024 map tiles, and the common overlapping areas between map tiles are preserved to completely retain the place name characters at the cropping edges.

[0104] Step 1.4: Use bounding boxes to label each text region in the map tile as a label for each ancient topographic map, thereby constructing a text region detection dataset;

[0105] In this embodiment, data annotation is performed on each 1024*1024 resolution tile, and rectangular selection annotation is performed on individual characters to obtain the label of the text region detection dataset;

[0106] Step 1.5: Crop out each text region in the map tile to obtain several text image slices. Use the traditional Chinese characters corresponding to the characters contained in the text image slices as the labels of the text image slices, and then construct a preliminary character recognition dataset.

[0107] In this embodiment, the text within the rectangular area is labeled with characters for subsequent character recognition dataset creation. Traditional Chinese characters are used as labels in this process.

[0108] Step 1.6: Acquire images of ancient books and preprocess them to obtain preprocessed image patches;

[0109] The method for preprocessing ancient book images specifically involves: cropping the ancient book images into several blocks according to a set size, and then randomly adding lines to imitate the background layout of ancient maps;

[0110] Step 1.7: Crop out each text region in the preprocessed image patch to obtain several text image slices. Use the traditional Chinese characters corresponding to the characters contained in the text image slices as the labels of the text image slices. Add the obtained text image slices and their labels to the preliminary character recognition dataset obtained in Step 1.5.

[0111] This embodiment obtains text image slices and their labels based on an ancient book dataset, which includes RGB format images of ancient books such as the Diamond Sutra.

[0112] Step 1.8: Perform background weakening processing on the text image slices in the preliminary character recognition dataset to obtain the processed text image slices, and then obtain the final character recognition dataset. At this point, the character recognition dataset construction is complete.

[0113] The specific method for weakening the background is as follows: First, the text image slices are converted into grayscale images, and then algorithms such as filtering and GrabCut are used to weaken the complex background lines in order to highlight the text features.

[0114] To overcome the background interference problem caused by text overlay during the character recognition stage of ancient topographic maps, background weakening processing is required before both the training and inference stages. In both stages, a consistent background weakening preprocessing algorithm is used to convert the image to grayscale. Then, filtering and GrabCut algorithms are employed to weaken complex background lines, highlighting text features and significantly reducing the impact of the background on character recognition. This process effectively suppresses background interference, thereby improving the accuracy of character recognition.

[0115] Step 2: Construct the first-stage text region detection model;

[0116] For the task of recognizing place name characters on ancient topographic maps, experimental results show that direct recognition methods are ineffective. The main reason is the small scale of the place name characters and the inconsistency in character size. Therefore, this application adopts a two-stage algorithm strategy. In the first stage, the location of the character region is detected; in the second stage, the detected character region is accurately recognized. This method allows for separate optimization of each stage's algorithm, while the inference is also a sequential inference prediction. The advantage of this method is that the algorithms of the two stages can be optimized separately, thereby synergistically improving the overall accuracy (ACC) of place name recognition.

[0117] The text region detection model in the first stage, such as Figure 3As shown, the text region detection model is used to detect text regions in the input map tile and output the text regions in the form of rectangles. The text region detection model is an improvement of the text detection model DB++. Specifically, after the convolutional layer 4 and convolutional layer 5 of the backbone network Resnet50 of the text detection model DB++, a spatial attention cross-dimensional reconstruction module (SACR) is added to improve the feature extraction capability and adapt to the complex scene of ancient maps.

[0118] The Spatial Attention Cross-Dimensional Reconstruction Module (SACR), such as Figure 4 As shown, first input feature I sacr After adjusting the number of channels using a 1x1 convolution, feature X is obtained. Feature X is then input into a Spatial Attention Reconstruction Unit (SARU). The output feature of the SARU and feature X are then superimposed on each other to obtain a concatenated feature X'. This concatenated feature X' is then input into a Channel Reconstruction Unit (CRU) for channel reconstruction, yielding channel reconstructed feature J. Finally, a Frequency Reconstruction Unit (FRU) is used to convert the input feature J into a channel reconstructed feature J. sacr Transform to the frequency domain space for feature extraction to obtain frequency domain space features Z; input features I sacr The channel reconstruction features J and frequency domain spatial features Z are superimposed, and then the number of channels is adjusted by 1*1 convolution before output, which yields the output features of the Spatial Attention Cross-Dimensional Reconstruction Module (SACR). Experimental results show that it can enable the model to learn more representative features with a small number of model parameters and computational cost, improve the model's feature extraction ability, and enhance the model's feature extraction efficiency and detection effect.

[0119] The Spatial Attention Reconstruction Unit (SARU), such as Figure 5 As shown, it includes a separation stage, a reconstruction stage, and a spatial feature enhancement stage. The separation stage separates information-rich features from the input features X. and the characteristics of information poverty The reconstruction phase will incorporate information-rich features. and the characteristics of information poverty By performing neutralization domain transformation, we obtain the spatially refined feature X. w This effectively reduces spatial redundancy; the spatial feature enhancement stage uses a spatial attention mechanism to refine spatial features X. w Adaptive spatial feature enhancement is performed to make the first-stage text region detection model pay more attention to key region information, such as the texture and edges of the text, and generate output features of the spatial attention reconstruction unit (SARU) to improve the robustness of the model detection to different font diversity.

[0120] The separation phase process is specifically as follows:

[0121] First, group normalization (GN) is performed on the input feature X. Then, a learnable scaling factor γ in group normalization (GN) is used to evaluate the information content of several channels of the input feature X, resulting in the group-normalized feature X. out ;Calculate the normalized feature X of the group out Normalized weights for each channel and grouped normalized features X out Each channel is multiplied by its corresponding normalized weight to form a weight feature Y; then, the weight feature Y is mapped to the range [0,1] using a non-linear activation function, Sigmoid. Based on the weight feature after the non-linear activation function, the input feature X is divided into information-rich features through thresholding. and the characteristics of information poverty

[0122] The group normalization process is as follows:

[0123]

[0124] Where μ and σ are the mean and standard deviation of feature X, respectively, ε is a very small positive number set for correct division calculation, which is set to 1e-7 here, γ is a learnable scaling factor, β is a learnable offset factor, and GN represents group normalization.

[0125] The normalized feature X out The normalized weights for each channel are:

[0126]

[0127] Among them, w i The normalized feature X out The normalized weight of the i-th channel, where i and j are the channel numbers, and c is the number of channels; γ i and γ j The normalized feature X out The original weight values ​​of the i-th and j-th channels;

[0128] The weighted feature Y is:

[0129] Y = X out ⊙{w i} (3)

[0130] Among them, {w i} is the set of normalized weights for each channel;

[0131] The result of mapping the weighted feature Y to the range [0,1] using the nonlinear activation function Sigmoid is as follows:

[0132] Y sigmoid,i =sigmoid(Y i (4)

[0133] Where sigmoid is a non-linear activation function; Y i Let Y be the value of the i-th channel in the weighted feature Y. sigmoid,i This represents the value of the i-th channel in the weighted features after the nonlinear activation function;

[0134] The threshold processing specifically involves: setting a gate threshold of 0.5; setting the weight values ​​of channels whose channel values ​​are greater than the gate threshold in the weighted features after the nonlinear activation function to 1, and setting the weight values ​​of the remaining channels to 0, thereby obtaining the feature weights W of the information-rich portion. 1,i Subtract the feature weight W of the information-rich part from 1. 1,i Obtain the feature weights W for the information-poor parts. 2,i Then, the feature weight matrix W1 of the information-rich part and the feature weight matrix W2 of the information-poor part are obtained. The input feature X is then multiplied element-wise with the feature weight matrix W1 of the information-rich part and the feature weight matrix W2 of the information-poor part to obtain the information-rich feature. and the characteristics of information poverty

[0135]

[0136] Among them, W 1,i W represents the feature weights of the information-rich portion corresponding to the i-th channel. 2,i The feature weights for the information-poor portion corresponding to the i-th channel;

[0137] The reconstruction phase specifically involves: employing cross-reconstruction operations to fully integrate information-rich features. and the characteristics of information poverty Specifically, first, the information-rich features and the characteristics of information poverty Each segment is divided into two parts with an equal number of channels, and information-rich features are used. The first half is characterized by information scarcity The latter half is summed pixel by pixel to obtain feature X. w1 Using information-rich features The latter half is characterized by information scarcity. The first half is summed pixel by pixel to obtain feature X. w2 Then feature X w1 and feature X w2 Channel overlay is performed to obtain the spatially refined feature X. w ;

[0138] The spatial feature enhancement stage specifically involves: firstly refining the spatial feature X... w Max pooling and average pooling are performed along the channel dimension. The results of max pooling and average pooling are concatenated along the channel dimension, and then processed by 7*7 convolution and the non-linear activation function sigmoid to obtain the spatial attention weight matrix M. The spatial attention weight matrix M is then combined with the spatial refined feature X. w Multiplying these together yields the output features of the Spatial Attention Reconstruction Unit (SARU);

[0139] The Channel Reconstruction Unit (CRU) handles channel redundancy by dividing the channels of the input concatenated feature X' into two parts and compressing them using 1x1 convolutions to reduce computation. It then uses group convolution (GWC) and point convolution (PWC) to extract rich feature representations, further reducing computational cost. Point convolution (PWC) is used to generate feature maps with supplementary detailed information, and these feature maps are reused to further reduce computation. Global average pooling and soft attention mechanisms are used to adaptively fuse the feature maps from the up-transformation and down-transformation stages, generating more representative channel-refined feature maps. The CRU effectively reduces channel redundancy and lowers computational cost and storage requirements.

[0140] The frequency reconstruction unit (FRU), such as Figure 6 As shown, the input feature I is first transformed using a two-dimensional Fast Fourier Transform (2D Fast Fourier Transform). sacr The function is converted into a frequency domain complex tensor F. This tensor is then split into a real part and an imaginary part, representing high-frequency detail information related to the target contour and low-frequency global information related to the background. Three convolutional layers are then applied to both the real and imaginary parts to extract and adjust the features in the frequency domain, resulting in a real feature layer R and an imaginary feature layer I. Finally, the real feature layer R and the imaginary feature layer I are merged to obtain the frequency domain feature F. filtered An adaptive gating structure is constructed using global average pooling and the nonlinear activation function Sigmoid, dynamically adjusting the frequency domain feature gating weights g. These gating weights g are then extended to the frequency domain feature F via a broadcast mechanism. filtered Same dimension, and with frequency domain feature F filtered The frequency domain feature F after gating is obtained by performing element-wise multiplication. gated The frequency domain features F after gated gated By transforming back to the original domain through inverse Fourier transform, the final output tensor is obtained, which enhances the utilization of multi-dimensional information by the first-stage text region detection model, thereby improving the detection effect.

[0141] The frequency domain complex tensor is:

[0142] F = FFT(I) sacr (7)

[0143] Here, FFT stands for 2D Fast Fourier Transform;

[0144] The real part and imaginary part in the frequency domain are:

[0145]

[0146] Among them, F real F is the real part in the frequency domain. imag For the frequency domain imaginary part, Re is the real part tensor computation function, IM is the imaginary part tensor computation function, B is the batch size, C is the number of channels, H is the feature map height, W is the feature map width; F * For the complex conjugate of F (i.e., the imaginary part of all elements is inverted), i * It is the imaginary unit;

[0147] The real feature layer R and the imaginary feature layer I are:

[0148]

[0149] Among them, C real C represents a convolutional layer with real feature layers R. imag This represents the convolutional layer representing the imaginary part feature layer I;

[0150] The frequency domain feature F filtered for:

[0151]

[0152] Where stack represents the channel overlay operation;

[0153] The frequency domain feature gate weight g is calculated as follows:

[0154]

[0155] Where v is the channel weight vector, and h represents the frequency domain feature F filtered The Bank of China's serial number, w represents the frequency domain feature F. filtered The numbering in the middle column, Representing frequency domain features F filtered It has 5 dimensions, namely B, C, h, w, and d; d is used to distinguish between the imaginary part and the real part. When d = 1, it represents the real part, and when d = 2, it represents the imaginary part.

[0156] The frequency domain feature F after gating gated for:

[0157]

[0158] Among them, g expanded The frequency domain feature gating weights are those extended through a broadcast mechanism;

[0159] The final output tensor is:

[0160]

[0161] Among them, F complex The complex tensor obtained after conversion, view_as_complex is the complex conversion function, which converts a tensor of shape (...,2) into a complex type tensor, IFFT is the two-dimensional inverse Fourier transform, and Q is the final output tensor;

[0162] Step 3: Construct the character recognition model for the second stage;

[0163] Recognition algorithms are the core of place name recognition tasks on ancient maps. Given the unique characteristics of ancient maps, this patent presents targeted optimizations to the Scene Text Recognition (SVTR) algorithm based on a single visual model. The SVTR algorithm is an advanced algorithm focused on text recognition tasks, demonstrating superior performance in this field. However, when applied to place name recognition on ancient maps, especially when dealing with discontinuous place name text, blurred text, and inconsistent text quality, the limitations of the SVTR algorithm become apparent.

[0164] The character recognition model in the second stage, such as Figure 7 As shown, in the single-branch model structure of the SVTR algorithm, an additional branch is added to recognize text in parallel with the original branch. This new branch shares the backbone and neck network with the original branch. The feature layer output from the neck network is fed into the image restoration module (Prompt Restore Block) of the new branch for processing. Then, it passes through the parallel linear classification predictor composed of several fully connected layers in the new branch to predict the probability distribution P2. The probability distribution P1 predicted by the original branch and the probability distribution P2 predicted by the new branch are weighted and then processed by the softmax and argmax functions to obtain the predicted character index value. Thus, the corresponding character is obtained;

[0165] The weighted sum of the probability distribution P1 of the original branch prediction and the probability distribution P2 of the new branch prediction is as follows:

[0166]

[0167] Among them, P final This is the weighted probability distribution, where G is the number of character categories;

[0168] The predicted character index value is:

[0169]

[0170] Among them, the predicted character category index

[0171] The image restoration module (Prompt Restore Block) is as follows: Figure 8 As shown, it includes: a Prompt Generation Module (PGM) and a Prompt Interaction Module (PIM); the Prompt Generation Module is used to generate a prompt based on the feature vector F1 of the input image and the prompt component P. n A corresponding conditional cue P is generated; the cue interaction module is used to dynamically enhance the feature vector F1 of the input image based on the conditional cue P, to obtain the enhanced feature representation. By combining the PGM and PIM modules, the image restoration module Prompt RestoreBlock can automatically generate conditional prompts for different types of degraded images, thereby effectively guiding the precise repair of feature layers in blurred images. This improves the recognition performance in cases of poor character image quality, such as non-continuous characters and blurred characters. Furthermore, the performance of the image restoration module Prompt RestoreBlock can be further improved by adjusting parameters and optimizing algorithms.

[0172] The prompt generation module typically uses sequence models such as Transformer, which can utilize contextual information and semantic relationships to generate more accurate conditional prompts;

[0173] The overall process of the prompt generation module can be summarized as follows:

[0174]

[0175] y j =Softmax(Conv 3*3 (MP(F1))) (23)

[0176] Among them, Conv 1*1 and Conv 3*3 These represent 1x1 and 3x3 convolutions respectively; n is the cue component number, N is the number of cue components, Softmax is the Softmax activation function, which converts a vector into a probability, MP is the hybrid pooling function, and y j To indicate the component weight vector;

[0177] The Prompt Interaction Module (PIM) typically employs techniques such as fully connected layers and activation functions. The overall process of the PIM can be represented by the following formula:

[0178]

[0179] Where, ; represents a cascade operation, and MDTA is represented as D = W. p V·Softmax(K·Q / α)+E, where E and D are the input and output features, respectively, and Q, K, and V represent the query projection, key projection, and value projection, respectively, obtained by performing 1×1 pointwise convolution and 3×3 depthwise convolution on the layer-normalized input feature map; W p For pointwise convolution, α is a learnable scaling parameter, and · is the dot product interaction. The process of GDFN is defined as a controlled transformation of input features to suppress irrelevant information and retain useful information. GDFN is a gated deep fusion network, which mainly consists of two parts: 3×3 deep convolution and the non-linear activation function GeLU.

[0180] The innovation of this patent lies in its collaborative text recognition by simultaneously utilizing the original branch and a newly added branch based on the image restoration module during training and inference. This improves the accuracy of text recognition and effectively solves the problems encountered by existing algorithms in processing ancient map place name recognition. This innovative design significantly enhances the algorithm's ability to recognize ancient map place name text, especially in handling non-continuous and low-quality text scenes.

[0181] Step 4: Train the first-stage text region detection model using the text region detection dataset to obtain the trained first-stage text region detection model.

[0182] Step 5: Train the second-stage character recognition model using the character recognition dataset to obtain the trained second-stage character recognition model;

[0183] Step 6: Using the trained first-stage text region detection model and the second-stage character recognition model, the place names on ancient topographic maps are identified;

[0184] Step 6.1: In order to maintain the consistency of the training and inference formats, the ancient topographic map to be identified is cut into several map tiles according to the set size;

[0185] Step 6.2: Input several map tiles corresponding to the ancient topographic map to be identified into the first-stage text region detection model that has been trained to infer the text regions in the form of rectangular boxes;

[0186] Step 6.3: Cut out text image slices according to the rectangular frame, and weaken the background;

[0187] Step 6.4: Input the text image slices after background weakening into the trained second-stage character recognition model to obtain the corresponding traditional Chinese characters, i.e., place name text information;

[0188] Step 6.5: Visualize the rectangular text area and place name information on the ancient topographic map to be identified, and obtain the final place name recognition result.

[0189] By adopting the algorithm and process improvements designed in this scheme, both the qualitative and quantitative indicators of ancient map place name recognition have been significantly improved. Experimental results show that the accuracy of this method reached 82.03% in the two-stage place name recognition process.

[0190] This embodiment also provides a system for identifying place names on ancient topographic maps, used to implement the aforementioned method for identifying place names on ancient topographic maps, including:

[0191] The ancient topographic map acquisition module is used to acquire ancient topographic maps to be identified.

[0192] The cropping module is used to crop the ancient topographic map to be identified into several map tiles according to a set size;

[0193] The first-stage text region detection model is used to mark text regions in the form of rectangular boxes from several input map tiles;

[0194] The background blurring module is used to cut out text image slices according to the rectangular frame and blur the background.

[0195] The second-stage character recognition model is used to identify the corresponding traditional Chinese characters from text image slices that have undergone background weakening processing.

[0196] This embodiment also provides an electronic device, including: a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory via the bus. When the machine-readable instructions are executed by the processor, the method for identifying place names on ancient topographic maps is executed.

[0197] This embodiment also provides a computer-readable storage medium storing a computer program that, when executed by a processor, performs a method for identifying place names on ancient topographic maps as described above.

[0198] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of the invention involved in the embodiments of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described inventive concept. For example, technical solutions formed by substituting the above-described features with (but not limited to) technical features with similar functions disclosed in the embodiments of this disclosure.

Claims

1. A method for identifying place names on ancient topographic maps, characterized in that, Includes the following steps: Construct a text region detection dataset and a character recognition dataset; the text region detection dataset includes several ancient topographic maps, with text regions marked by rectangles in each ancient topographic map; the character recognition dataset includes several text image slices, with each text image slice using the traditional Chinese characters corresponding to the characters contained therein as labels; The first-stage text region detection model is constructed to detect text regions in the input map tiles and output the text regions in the form of rectangular boxes; In the first stage of the text region detection model, after the convolutional layers numbered 4 and 5 of the Resnet50 backbone network of the text detection model DB++, a spatial attention cross-dimensional reconstruction module (SACR) is added respectively. The Spatial Attention Cross-Dimensional Reconstruction Module (SACR) first converts the input feature I... sacr After 1 1. Convolution adjusts the number of channels to obtain feature X. Then, feature X is input into the Spatial Attention Reconstruction Unit (SARU). The output features of the Spatial Attention Reconstruction Unit (SARU) and feature X are superimposed by channels to obtain the concatenated feature X'. The spliced ​​feature X' is then input into the channel reconstruction unit (CRU) for channel reconstruction, resulting in the channel reconstruction feature J; the frequency reconstruction unit (FRU) then processes the input feature I. sacr Transform to the frequency domain space for feature extraction to obtain frequency domain space features Z; input features I sacr Channel reconstruction features J and frequency domain spatial features Z are superimposed on each channel, and then processed by 1... After adjusting the number of channels through convolution, the output features of the Spatial Attention Cross-Dimensional Reconstruction (SACR) module are obtained. To construct the second-stage character recognition model, an additional branch is added to the single-branch model structure of the SVTR algorithm for character recognition. The first-stage text region detection model is trained using a text region detection dataset to obtain the trained first-stage text region detection model. The character recognition model for the second stage is trained using a character recognition dataset to obtain the trained character recognition model for the second stage. By utilizing the first-stage text region detection model and the second-stage character recognition model that have been trained, the recognition of place names on ancient topographic maps can be achieved.

2. The method for identifying place names on ancient topographic maps according to claim 1, characterized in that, The construction of the text region detection dataset and the character recognition dataset specifically involves: A1: Obtain several ancient topographic maps; A2: Perform image preprocessing on the ancient topographic map to obtain the preprocessed ancient topographic map; A3: Cut the pre-processed ancient topographic map into several map tiles according to the set size; A4: Use bounding boxes to label each text region in the map tile, which serves as the label for each map tile, thereby constructing a text region detection dataset; A5: Cropping out each text region from the map tile yields several text image slices. The traditional Chinese characters corresponding to the text contained in the text image slices are used as the labels for the text image slices, thereby constructing a preliminary character recognition dataset. A6: Acquire images of ancient books and preprocess them to obtain preprocessed image tiles; The method for preprocessing ancient book images specifically involves: cropping the ancient book image into several blocks according to a set size, and then randomly adding lines; A7: Crop out each text region in the preprocessed image patch to obtain several text image slices. Use the traditional Chinese characters corresponding to the characters contained in the text image slices as the labels of the text image slices. Add the obtained text image slices and their labels to the preliminary character recognition dataset obtained in A5. A8: The background of the text image slices in the preliminary character recognition dataset is weakened to obtain the processed text image slices, which in turn yields the final character recognition dataset.

3. The method for identifying place names on ancient topographic maps according to claim 1, characterized in that, The Spatial Attention Reconstruction Unit (SARU) comprises a separation stage, a reconstruction stage, and a spatial feature enhancement stage. The separation stage extracts information-rich features from the input features X. and the characteristics of information poverty The reconstruction phase involves incorporating information-rich features. and the characteristics of information poverty By performing neutralization domain transformation, we obtain the spatially refined feature X. w The spatial feature enhancement stage uses a spatial attention mechanism to refine spatial features X. w Adaptive spatial feature enhancement is performed to generate the output features of the Spatial Attention Reconstruction Unit (SARU); The separation phase process is specifically as follows: First, group normalization is performed on the input feature X to obtain the group-normalized feature. ; Calculate the normalized features of the group Normalized weights for each channel and grouped normalized features Each channel is multiplied by its corresponding normalized weight to obtain the weighted feature. ; Then, the weighted features are further processed using the non-linear activation function Sigmoid. Mapped to the range [0,1], based on the weighted features after a non-linear activation function, the input feature X is divided into information-rich features through thresholding. and the characteristics of information poverty ; The normalized features The normalized weights for each channel are: (2) in, Features after normalization The Normalized weights for each channel, and For the channel number, The number of channels; and Features after normalization The Middle The and the first The original weight values ​​of each channel; The threshold processing specifically involves setting a gating threshold, setting the weight values ​​of channels whose channel values ​​are greater than the gating threshold in the weighted features after the nonlinear activation function to 1, and setting the weight values ​​of the remaining channels to 0, thereby obtaining the feature weights of the information-rich portion. Subtract the feature weights of the information-rich parts from 1. Obtain the feature weights of the information-poor parts. This leads to the feature weight matrix of the information-rich portion. Feature weight matrix of information-poor parts The input feature X is compared with the feature weight matrix of the information-rich part. Feature weight matrix of information-poor parts Element-wise multiplication yields information-rich features and the characteristics of information poverty ; The reconstruction phase specifically involves: first, reconstructing information-rich features... and the characteristics of information poverty Each segment is divided into two parts with an equal number of channels, and information-rich features are used. The first half is characterized by information scarcity The latter half is summed pixel by pixel to obtain feature X. w1 Using information-rich features The latter half is characterized by information scarcity. The first half is summed pixel by pixel to obtain feature X. w2 Then feature X w1 and feature X w2 Channel overlay is performed to obtain the spatially refined feature X. w ; The spatial feature enhancement stage specifically involves: firstly refining the spatial feature X... w Perform max pooling and average pooling along the channel dimension, concatenate the results of max pooling and average pooling along the channel dimension, and then pass them through 7... The convolution and sigmoid activation function of 7 are used to obtain the spatial attention weight matrix M. The spatial attention weight matrix M is then combined with the spatial refined features X. w Multiplying these features yields the output characteristics of the Spatial Attention Reconstruction Unit (SARU).

4. The method for identifying place names on ancient topographic maps according to claim 1, characterized in that, The frequency reconstruction unit (FRU) first converts the input feature I into a two-dimensional fast Fourier transform. sacr Convert to frequency domain complex tensor Then, the frequency domain complex tensor is split into a real part and an imaginary part. Three convolutional layers are then applied to each part to extract and adjust features in the frequency domain, resulting in a real feature layer R and an imaginary feature layer I. Finally, the real feature layer R and the imaginary feature layer I are merged to obtain the frequency domain feature F. filtered An adaptive gating structure is constructed using global average pooling and the nonlinear activation function Sigmoid, dynamically adjusting the frequency domain feature gating weights g. These gating weights g are then extended to the frequency domain feature F via a broadcast mechanism. filtered Same dimension, and with frequency domain feature F filtered The frequency domain feature F after gating is obtained by performing element-wise multiplication. gated The frequency domain features F after gated gated The final output tensor is obtained by transforming it back to the original domain through inverse Fourier transform. The real part and imaginary part in the frequency domain are: (8) (9) (10) (11) in, For the real part in the frequency domain, For the imaginary part in the frequency domain, The function for calculating the real part of the tensor. The function for calculating the imaginary part tensor. The batch size is [size]. For the number of channels, For feature map height, The width of the feature map; for The complex conjugate, It is the imaginary unit; The real feature layer R and the imaginary feature layer I are: (12) (13) in, The convolutional layer representing the real feature layer R is... This represents the convolutional layer representing the imaginary part feature layer I; The frequency domain feature Ffiltered is: (14) in, This is a channel overlay operation; The frequency domain feature gate weight g is calculated as follows: (15) (16) in, For channel weight vectors, Representing frequency domain features F filtered Bank of China's serial number, Representing frequency domain features F filtered The numbering in the middle column, Representing frequency domain features F filtered It has 5 dimensions, namely ; Used to distinguish between imaginary and real parts, when When indicates the actual part, Time represents the imaginary part; The frequency domain feature F after gating gated for: (17) in, The frequency domain feature gating weights are those extended through a broadcast mechanism; The final output tensor is: (18) (19) in, The complex tensor obtained after transformation, For complex number transformation functions, It is a two-dimensional inverse Fourier transform. This is the final output tensor.

5. The method for identifying place names on ancient topographic maps according to claim 1, characterized in that, In the second stage of the character recognition model, an additional branch is added to the single-branch model structure of the SVTR algorithm. This new branch shares the backbone and neck network with the original branch. The feature layer output from the neck network is fed into the image restoration module of the new branch for processing. Then, it is processed by a parallel linear classification predictor composed of several fully connected layers in the new branch to predict the probability distribution P2. The probability distribution P1 predicted by the original branch and the probability distribution P2 predicted by the new branch are weighted and then processed by the softmax and argmax functions to obtain the predicted character index value. This allows us to obtain the corresponding character. The weighted sum of the probability distribution P1 of the original branch prediction and the probability distribution P2 of the new branch prediction is as follows: (20) in, This is the weighted probability distribution. Number of character categories; The image restoration module includes: a prompt generation module and a prompt interaction module; the prompt generation module is used to generate prompts based on the feature vector F1 of the input image and the prompt component P. n A corresponding conditional cue P is generated; the cue interaction module is used to dynamically enhance the feature vector F1 of the input image based on the conditional cue P, to obtain the enhanced feature representation. ; The overall process of the prompt generation module is as follows: (22) (23) in, and Representing 1 respectively 1 convolution and 3 3 convolutions; Here, N is the number of the cue components, Softmax is the Softmax activation function, and MP is the hybrid pooling function. To indicate the component weight vector; The overall process of the PIM (Prompt Interaction Module) is as follows: (24) in, It is a cascaded operation, MDTA is represented as D = W p V·Softmax(K·Q / α)+E, where E and D are the input and output features, respectively, and Q, K, and V represent the query projection, key projection, and value projection, respectively; W p For pointwise convolution, α is a learnable scaling parameter, · represents dot product interaction, and GDFN is a gated deep fusion network.

6. The method for identifying place names on ancient topographic maps according to claim 1, characterized in that, The method of using the trained first-stage text region detection model and the second-stage character recognition model to identify place names on ancient topographic maps is as follows: B1: Cut the ancient topographic map to be identified into several map tiles according to the set size; B2: Input several map tiles corresponding to the ancient topographic map to be identified into the first-stage text region detection model after training to infer and obtain text regions in the form of rectangular boxes; B3: Cut out text image slices according to the rectangular frame and weaken the background; B4: Input the text image slices after background weakening into the trained second-stage character recognition model to obtain the corresponding traditional Chinese characters, i.e., place name text information; B5: Visualize the rectangular text area and place name information on the ancient topographic map to be identified, and obtain the final place name recognition result.

7. A system for identifying place names on ancient topographic maps, used to implement the method for identifying place names on ancient topographic maps as described in any one of claims 1-6, characterized in that, include: The ancient topographic map acquisition module is used to acquire ancient topographic maps to be identified. The cropping module is used to crop the ancient topographic map to be identified into several map tiles according to a set size; Will The first-stage text region detection model is used to mark text regions in the form of rectangular boxes from several input map tiles; The background blurring module is used to cut out text image slices according to the rectangular frame and blur the background. The second-stage character recognition model is used to identify the corresponding traditional Chinese characters from text image slices that have undergone background weakening processing.

8. An electronic device, characterized in that, include: The device includes a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory via the bus. When the machine-readable instructions are executed by the processor, they perform the method for identifying place names on ancient topographic maps as described in any one of claims 1-6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium contains a computer program that, when executed by a processor, performs a method for identifying place names on ancient topographic maps as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Character recognition method for ancient books with smudginess and omission and ancient book recognition equipment

    CN118038467A

  • OCR (Optical Character Recognition) method for aviation travel itinerary

    CN119027954A

  • Character recognition method and device for ancient books, computer equipment and storage medium

    CN113989484A