Ancient topographic map place name identification method and system

Through two-stage strategy and improved model, the layout complexity and font diversity problems in ancient topographic map place name recognition are solved, and higher recognition accuracy and efficiency are achieved.

CN120452009APending Publication Date: 2025-08-08SHENYANG PEDLIN TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510514767.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-23
Publication Date
2025-08-08

AI Technical Summary

Technical Problem

The existing OCR recognition algorithm cannot effectively adapt to the recognition of place name text in ancient topographic maps, mainly due to the complex map layout, font diversity and overlapping text and background.

Method used

A two-stage strategy is adopted, firstly, by constructing a text area detection model to detect text areas, and then using the improved character recognition model for precise identification, combining the spatial attention cross-dimensional reconstruction module and image recovery module to enhance the adaptability and accuracy of the model to the ancient map.

Benefits of technology

It improves the recognition accuracy of ancient topographic map place names, reduces the interference between text and background, enhances the adaptability to variable fonts and different fonts, and improves the overall recognition efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120452009A_ABST
    Figure CN120452009A_ABST
Patent Text Reader

Abstract

The invention discloses an ancient topographic map place name identification method and system, and relates to the field of computer vision. And a two-stage strategy of character area detection and character recognition is designed, so that the end-to-end accuracy of place name recognition is effectively improved. According to the method, through processing of first image cutting and then detection in a first stage, adverse effects caused by too large scale difference between images and characters are reduced, accurate positioning of character areas is realized, and reasoning time is shortened; a space attention cross-dimension reconstruction module is utilized in a first-stage algorithm, and space, channel and frequency domain features are combined, so that the feature extraction capability of the model is improved, the space redundancy is reduced, and the adaptability of the model to variable fonts, variable directions, variant characters and the like in an ancient map is enhanced; in the second stage, in the preprocessing process, background features are weakened by adopting grey-scale map conversion, filtering and GrabCut algorithms, so that character features are highlighted; the original branch and the newly-added branch based on the image recovery module are used for cooperatively recognizing the characters, and the accuracy of low-quality character image recognition is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer vision, and in particular to a method and system for recognizing place names on ancient topographic maps. Background Art

[0002] With the development of "graphic 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 provide a crucial bridge between the past and the present. However, the compilation of place names on ancient maps is still in its infancy. As a precursor to these tasks, place name OCR extraction algorithms will provide a data foundation for subsequent research in cartographic and place name history.

[0003] To extract text from paper documents or existing images to form text documents, performing optical character recognition (OCR) on images is a relatively common method. Chinese invention patent specification CN202411113565.0 discloses an OCR recognition method for airline itineraries. The method includes pre-dividing the airline itinerary into six sections based on the content of printed items, performing OCR recognition on the airline itinerary, and determining the coordinate range of each section based on the coordinates of the vertices of the reference printed items in each section, thereby generating an airline itinerary information table. This method effectively improves the OCR recognition accuracy and information completeness of airline itineraries. Similarly, Chinese invention patent specification CN202410306337.9 discloses an invention patent for recognizing ancient text in ancient books. The method includes: acquiring an image; identifying text locations in the image; identifying all text characters in the text locations; and then invoking a language model trained with a preset corpus training sample set to retrieve and recognize text characters from a first set of candidate characters based on the text content of the missing characters. By adopting the technology provided by this invention, the accuracy of ancient book text recognition can be effectively improved.

[0004] The above patent technology CN202411113565.0 adopts OCR (Optical Character Recognition) technology. The basic process is: an electronic device (such as a scanner or digital camera) checks the characters printed on paper, determines their shape by detecting dark and light patterns, and then uses a character recognition method to translate the shape into computer text. This method is based on a detection algorithm based on deep learning. Among them, the text block merging (Connectionist Text Proposal Network, CPTN) algorithm, the CPTN algorithm believes that the text box exists in the form of a long rectangle. First, a long and thin rectangular box is used to detect the content of the text image, and whether there is text content in the rectangular box is determined. Then, the rectangular boxes containing text content are merged to obtain the coordinates of the text block. Compared with traditional algorithms, the CPTN algorithm uses a convolutional neural network to extract image features, and its performance has been improved, but the detection effect on distorted text is poor, and naturally it cannot adapt to scenarios for ancient maps.

[0005] The above patented technology CN202410306337.9 also adopts a two-stage OCR technology, the principle of which is to identify the text position in the image; identify all text characters in the text position; when a missing character is identified, identify the first character of the missing character, wherein the first character is a partial component of the text character; based on the first character, generate a first text candidate set containing the first character; call the language model trained with the preset corpus training sample set, and obtain the text character from the first text candidate set and complete the recognition based on the text content of the missing character. Although this invention technology can effectively improve the accuracy of ancient text recognition. However, in the scenario of ancient topographic maps, the map background is too complex, and the text size, direction, and font diversity are extremely large. This technology still cannot show a good recognition effect.

[0006] In summary, existing OCR recognition algorithms are not well suited to the scenario of 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 used by modern OCR (Optical Character Recognition) systems. The base maps of ancient topographic maps are complex and varied, and the overall map size is large. The scale of the place names on the map is small relative to their size. These factors increase the difficulty and interference in the OCR recognition process.

[0008] (2) Font information processing: The font information in paleotopographic maps is complex and varied, including both traditional and simplified Chinese characters. In addition, the same character may have multiple variant forms within the same map. Furthermore, the writing direction of the characters is highly variable, and their distribution lacks uniform rules. These characteristics pose significant challenges to existing OCR recognition algorithms, making them incapable of direct application to text recognition in paleotopographic maps.

[0009] (3) Overlapping of text and background: In ancient topographic maps, there is a common phenomenon of overlapping of text and map background elements. This phenomenon significantly interferes with the text recognition process and greatly increases the difficulty of OCR technology. Summary of the Invention

[0010] In view of the shortcomings of the existing technology, the present invention provides a method and system for recognizing place names on ancient topographic maps to solve the problem that the existing text recognition method is not suitable for scenes with ancient topographic maps.

[0011] The technical solution of the present invention is:

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

[0013] Constructing a text region detection dataset and a character recognition dataset; the text region detection dataset includes several ancient topographic maps, each of which uses a rectangular box to mark the text region; the character recognition dataset includes several text image slices, each of which uses the traditional Chinese character corresponding to the text contained therein as a label;

[0014] Constructing the first-stage text region detection model to detect the text region in the input map block and output the text region in the form of a rectangular frame;

[0015] Build the second-stage character recognition model, adding an additional branch to the single-branch model structure of the SVTR algorithm for character recognition;

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

[0017] The character recognition model of the second stage is trained using the character recognition data set to obtain a trained character recognition model of the second stage;

[0018] The first-stage text region detection model and the second-stage character recognition model that have been trained are used to realize the recognition of place names in ancient topographic maps.

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

[0020] A1: Obtain several ancient topographic maps;

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

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

[0023] A4: Use rectangular boxes to mark each text area in the map block as a label for each ancient topographic map, and then construct a text area detection dataset;

[0024] A5: Crop each text area in the map block to obtain several text image slices. Use the traditional Chinese characters corresponding to the text contained in the text image slices as labels for the text image slices, and then construct a preliminary character recognition dataset.

[0025] A6: Acquire and preprocess the ancient book image to obtain a preprocessed image block;

[0026] The method for preprocessing the ancient book image specifically comprises: cutting the ancient book image into a plurality of blocks according to a set size, and then randomly adding lines;

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

[0028] A8: Perform background weakening processing on the text image slices in the preliminary character recognition dataset to obtain processed text image slices, and then obtain the final character recognition dataset.

[0029] Furthermore, the text region detection model in the first stage adds a spatial attention cross-dimensional reconstruction module SACR after convolutional layer 4 and convolutional layer 5 of the Resnet50 backbone network of the text detection model DB++;

[0030] The spatial attention cross-dimensional reconstruction module SACR first transforms the input feature I sacr After adjusting the number of channels through 1*1 convolution, feature X is obtained, and then feature X is input to the spatial attention reconstruction unit SARU. The output feature of the spatial attention reconstruction unit SARU and feature X are superimposed on the channel to obtain the spliced feature X'; the spliced feature X' is then input to the channel reconstruction unit CRU for channel reconstruction to obtain the channel reconstruction feature J; the frequency reconstruction unit FRU is used to reconstruct the input feature Isacr Convert to frequency domain space for feature extraction to obtain frequency domain space feature Z; input feature I sacr , channel reconstruction features J and frequency domain spatial features Z are superimposed on each other, and then the number of channels is adjusted by 1*1 convolution and output to obtain the output features of the spatial attention cross-dimensional reconstruction module SACR.

[0031] Furthermore, the spatial attention reconstruction unit SARU comprises a separation stage, a reconstruction stage and a spatial feature enhancement stage. The separation stage separates the information-rich features from the input feature X. and information-poor characteristics The reconstruction phase converts the information-rich features and information-poor characteristics Make neutralization domain changes to obtain spatial refined feature X w In the spatial feature enhancement stage, the spatial feature X is refined by the spatial attention mechanism. w Perform adaptive spatial feature enhancement to generate output features of the spatial attention reconstruction unit SARU;

[0032] The process of the separation stage is specifically as follows:

[0033] First, perform group normalization on the input feature X to obtain the group normalized feature X out ; Calculate the group normalized feature X out The normalized weight of each channel and the group-normalized feature X out Each channel of is multiplied by the corresponding normalized weight to the weight feature Y; then the weight feature Y is mapped to the range of [0,1] through the nonlinear activation function Sigmoid, and based on the weight feature after the nonlinear activation function, the input feature X is divided into information-rich features through threshold processing. and information-poor characteristics

[0034] The normalized feature X out The normalized weight of each channel is:

[0035]

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

[0037] The threshold processing is specifically as follows: setting a gate threshold, setting the weight value of the channel whose value is greater than the gate threshold in the weight feature after the nonlinear activation function to 1, and setting the weight value of the remaining channels to 0, to obtain the feature weight W of the information-rich part 1,i , minus the feature weight W of the information-rich part from 1 1,i Get the feature weight W of the information-poor part 2,i , and then get the feature weight matrix W1 of the information-rich part and the feature weight matrix W2 of the information-poor part, and multiply the input feature X by the feature weight matrix W1 of the information-rich part and the feature weight matrix W2 of the information-poor part element by element to get the information-rich feature and information-poor characteristics

[0038] The process of the reconstruction stage is as follows: first, the information-rich features are and information-poor characteristics Divide into two parts with equal number of channels, using information-rich features The first half of the information-poor feature The second half of the pixel is added pixel by pixel to get the feature X w1 , using informative features The second half of the information-poor feature The first half of the pixel is added pixel by pixel to get the feature X w2 , and then the feature X w1 and feature X w2 Perform channel superposition to obtain the spatial refined feature X w ;

[0039] The process of the spatial feature enhancement stage is specifically as follows: first, the spatial refinement feature X w Perform maximum pooling and average pooling along the channel dimension respectively, concatenate the results of maximum pooling and average pooling in the channel dimension, and then process them sequentially through 7*7 convolution and nonlinear activation function sigmoid to obtain the spatial attention weight matrix M. The spatial attention weight matrix M is combined with the spatial refined feature X w Multiply them together to get the output features of the spatial attention reconstruction unit SARU.

[0040] Furthermore, the frequency reconstruction unit FRU first transforms the input feature I sacr Convert it into a frequency domain complex tensor F, then split the frequency domain complex tensor into the frequency domain real part and the frequency domain imaginary part, and then perform three convolution layer operations on the frequency domain real part and the imaginary part respectively, extract and adjust the features in the frequency domain, and obtain the real feature layer R and the imaginary feature layer I, and merge the real feature layer R and the imaginary feature layer I to obtain the frequency domain feature F filtered, through global average pooling and nonlinear activation function Sigmoid to form an adaptive gating structure, dynamically adjust the frequency domain feature gating weight g, and the frequency domain feature gating weight g is expanded to the frequency domain feature F through the broadcast mechanism. filtered The same dimension and with the frequency domain feature F filtered Perform element-by-element multiplication to obtain the gated frequency domain feature F gated , the frequency domain feature F after gate gated Convert back to the original domain through inverse Fourier transform to obtain the final output tensor;

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

[0042]

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

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

[0045]

[0046] Among them, C real represents the convolutional layer of the real feature layer R, C imag Represents the convolutional layer of the imaginary feature layer I;

[0047] The frequency domain feature F filtered for:

[0048]

[0049] Among them, stack is the channel superposition operation;

[0050] The calculation method of the frequency domain feature gating weight g is:

[0051]

[0052] Among them, v is the channel weight vector, h represents the frequency domain feature F filtered The numbers in the middle row, w represents the frequency domain feature F filtered The number of the column, Represents the frequency domain feature F filtered It has 5 dimensions, namely B, C, h, w, d; d is used to distinguish the imaginary part from the real part. When d = 1, it represents the real part, and when d = 2, it represents the imaginary part.

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

[0054]

[0055] Among them, g expanded is the frequency domain feature gating weight after expansion through the broadcast mechanism;

[0056] The final output tensor is:

[0057]

[0058] Among them, F complex is the complex tensor obtained after conversion, view_as_complex is the complex conversion function, IFFT is the two-dimensional inverse Fourier transform, and Q is the final output tensor.

[0059] Furthermore, the character recognition model of the second stage adds an additional branch in the single-branch model structure of the SVTR algorithm. The new branch shares the trunk and neck network with the original branch, and sends the feature layer output by the neck network to the image recovery module of the new branch for processing. Then, the new branch is subjected to probability prediction by a parallel linear classification predictor composed of several fully connected layers to obtain a 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 after weighting, they are processed by the softmax function and the argmax function to obtain the predicted character index value. Thus, the corresponding characters are obtained;

[0060] The result of weighting the probability distribution P1 of the original branch prediction and the probability distribution P2 of the newly added branch prediction is:

[0061]

[0062] Among them, P final is the weighted probability distribution, 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 a prompt based on the feature vector F1 of the input image and the prompt component P n Generate a corresponding conditional prompt P; the prompt interaction module is used to dynamically enhance the feature vector F1 of the input image according to the conditional prompt P to obtain the enhanced feature representation

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

[0065]

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

[0067] Among them, Conv 1*1 and Conv 3*3 Represent 1*1 convolution and 3*3 convolution respectively; n is the number of prompt components, N is the number of prompt components, Softmax is the Softmax activation function, MP is the mixed pooling function, y j is the hint component weight vector;

[0068] The overall process of the prompt interaction module PIM is as follows:

[0069]

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

[0071] Furthermore, the text region detection model of the first stage and the character recognition model of the second stage are used to recognize place names on ancient topographic maps, specifically:

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

[0073] B2: Input several map blocks corresponding to the ancient topographic map to be identified into the trained first-stage text region detection model for inference to obtain text regions in the form of rectangular frames;

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

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

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

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

[0078] An ancient topographic map acquisition module, used to acquire the ancient topographic map to be identified;

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

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

[0081] A weakening processing module is used to cut out text image slices according to the rectangular frame and perform background weakening processing;

[0082] The character recognition model in the second stage is used to identify the corresponding traditional Chinese characters from the text image slices after the background is weakened.

[0083] The 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. When the electronic device is running, the processor and the memory communicate through 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, which stores a computer program. When the computer program is executed by a processor, the method for identifying place names on ancient topographic maps as described above is executed.

[0085] Compared with the prior art, the present invention has the following beneficial effects:

[0086] A two-stage strategy for text region detection and character recognition was designed, effectively improving the end-to-end accuracy of place name recognition. By pre-slicing the image before detecting it in the first stage, the adverse effects of the large scale difference between the image and the text are reduced, enabling precise localization of text regions and shortening inference time. The first-stage algorithm utilizes the 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 enhance the model's adaptability to the diverse fonts, orientations, and variant forms found in ancient maps. In the second stage, preprocessing employs grayscale conversion, filtering, and the GrabCut algorithm to de-emphasize background features and highlight text features. The original branch and a new branch based on the image restoration module are used to collaboratively recognize text, improving the accuracy of low-quality text image recognition. BRIEF DESCRIPTION OF THE DRAWINGS

[0087] Figure 1 Flowchart of 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 4 is a structural diagram of a text region detection model in the first stage in an embodiment of the present invention;

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

[0091] Figure 5 2 is a structural diagram of a spatial attention reconstruction unit in a spatial attention cross-dimensional reconstruction module in an embodiment of the present 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 reasoning in the second stage of an embodiment of the present invention;

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

[0095] This embodiment provides a method for accurately identifying place names on ancient topographic maps, focusing on the precise recognition of Traditional Chinese characters in ancient documents. The core of this technology lies in developing an efficient deep learning algorithm specifically for identifying place names on ancient Chinese topographic maps, thereby improving the accuracy and efficiency of optical character recognition (OCR) technology when processing such historical documents.

[0096] This embodiment provides a method for identifying place names in ancient topographic maps. Figure 1 As shown, the following steps are included:

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

[0098] The text region detection dataset includes several ancient topographic maps, each of which uses a rectangular box to mark the text region; the character recognition dataset includes several text image slices, each of which uses the traditional Chinese character corresponding to the text contained therein as a label;

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

[0100] In this embodiment, we first need to perform basic screening on the ancient topographic maps in the ancient map dataset, and retain the ancient topographic maps with basically uniform layout, such as Figure 2As shown, an example of an ancient topographic map for the application scenario in this embodiment, wherein the text is in traditional Chinese, the text directions are different, and the map layout and background are complex;

[0101] Step 1.2: performing image preprocessing on the ancient topographic map to obtain an image preprocessed ancient topographic map; the image preprocessing includes rotation, scaling, brightness and contrast adjustment, and noise addition;

[0102] Step 1.3: Crop the pre-processed ancient topographic map into several map blocks according to the set size;

[0103] Because the entire ancient topographic map is too large, often reaching a resolution of around 9000, but the scale of individual place names is very small, only 10 to 20 pixels, it is not reasonable to perform training and inference directly on the entire map. Therefore, the operation of first segmenting and then performing subsequent processes is adopted. After testing, this method greatly improves the accuracy and speed of recognition. In this implementation, each entire ancient topographic map is cropped into 1024*1024 map blocks, and the common overlapping areas between the map blocks are retained to completely preserve the place names at the cropping edges;

[0104] Step 1.4: Use a rectangular box to mark each text area in the map block as a label for each ancient topographic map, and then construct a text area detection dataset;

[0105] In this implementation, data annotation is performed on each image block with a resolution of 1024*1024, and a rectangular box is selected and labeled for each character to obtain the label of the text area detection dataset;

[0106] Step 1.5: Crop each text area in the map block to obtain several text image slices. Use the traditional Chinese characters corresponding to the text contained in the text image slices as the labels of the text image slices to construct a preliminary character recognition dataset;

[0107] In this embodiment, the text in the rectangular frame area is annotated for subsequent preparation of a character recognition data set. In this process, traditional Chinese characters are used as labels.

[0108] Step 1.6: Obtain the ancient book image and preprocess the ancient book image to obtain a preprocessed image block;

[0109] The method for preprocessing the ancient book image is specifically as follows: cutting the ancient book image into a plurality of blocks according to a set size, and then randomly adding lines to imitate the background layout of an ancient map;

[0110] Step 1.7: Crop each text region in the preprocessed image block to obtain several text image slices. Use the traditional Chinese characters corresponding to the text contained in the text image slices as labels for 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 processed text image slices, and then obtain the final character recognition dataset. At this point, the character recognition dataset is constructed;

[0113] The specific method of background weakening is as follows: first, the text image slice is converted into a grayscale image, and then the complex background lines are weakened by using filtering and GrabCut algorithms to highlight the text features;

[0114] To overcome background interference caused by the overlapping of text and background during the recognition of place-name characters on ancient topographic maps, background reduction processing is required before both the training and inference stages. A consistent background reduction preprocessing algorithm is employed in both stages, converting the image to grayscale. Filtering and algorithms such as GrabCut are then used to reduce the complex background lines to highlight the text features, significantly reducing the impact of background interference on text recognition. This process effectively suppresses background interference, thereby improving text recognition accuracy.

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

[0116] For the task of identifying place names on ancient topographic maps, experimental results show that direct recognition methods are not effective. The main reason is that the scale of place name characters is small and there is inconsistency in the size of the characters. For this reason, this application adopts a two-stage algorithm strategy. In the first stage, the position of the text area is first detected; in the second stage, the detected text area is accurately identified. This method allows the algorithms of each stage to be optimized separately, and the reasoning is also a serial reasoning prediction. The advantage of this method is that the algorithms of the two stages can be optimized separately, thereby synergistically improving the accuracy (Accuracy, referred to as ACC) of the entire place name recognition;

[0117] The text area detection model in the first stage is as follows: Figure 3As shown in the figure, it is used to detect text areas in the input map blocks and output the text areas in the form of rectangular boxes. The text area detection model is improved from the text detection model DB++. The specific improvement is to add a spatial attention cross-dimensional reconstruction module (SACR) after the convolution layer 4 (conv layer 4) and convolution layer 5 (conv layer 5) of the backbone network Resnet50 of the text detection model DB++ to improve the feature extraction capability to adapt to the complex scenes 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 through 1*1 convolution, feature X is obtained, and then feature X is input to the spatial attention reconstruction unit (SARU). The output feature of the spatial attention reconstruction unit (SARU) and feature X are superimposed on each other to obtain the spliced feature X'; the spliced feature X' is then input to the channel reconstruction unit (CRU) for channel reconstruction to obtain the channel reconstruction feature J; the frequency reconstruction unit (FRU) is used to reconstruct the input feature I sacr Convert to frequency domain space for feature extraction to obtain frequency domain space feature Z; input feature I sacr , channel reconstruction features J and frequency domain spatial features Z are superimposed on each other, and then the number of channels is adjusted by 1*1 convolution and the output is obtained to obtain the output features of the spatial attention cross-dimensional reconstruction module (SACR); experimental results show that it can use a small amount of model parameters and computational complexity as the cost, enable the model to learn more representative features, improve the model's ability to extract features, 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 separation stage, reconstruction stage and spatial feature enhancement stage. In the separation stage, information-rich features are separated from the input feature X. and information-poor characteristics The reconstruction phase converts the information-rich features and information-poor characteristics Make neutralization domain changes to obtain spatial refined feature X w , effectively reducing spatial redundancy; in the spatial feature enhancement stage, the spatial refinement feature X is processed through the spatial attention mechanism w Adaptive spatial feature enhancement is performed to make the first-stage text region detection model pay more attention to key regional information, such as text texture and edges, and generate output features of the Spatial Attention Reconstruction Unit (SARU). This improves the robustness of the model detection to different font diversity.

[0120] The process of the separation stage is specifically as follows:

[0121] First, the input feature X is group normalized (GN), and the learnable scaling factor γ in group normalization (GN) is used to evaluate the information content of several groups of channels of the input feature X to obtain the group normalized feature X out ; Calculate the group normalized feature X out The normalized weight of each channel and the group-normalized feature X out Each channel of is multiplied by the corresponding normalized weight to the weight feature Y; then the weight feature Y is mapped to the range of [0,1] through the nonlinear activation function Sigmoid, and based on the weight feature after the nonlinear activation function, the input feature X is divided into information-rich features through threshold processing. and information-poor characteristics

[0122] The process of group normalization is:

[0123]

[0124] Where μ and σ are the mean and standard deviation of feature X, respectively. ε is a very small positive number set to correctly calculate division, 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 weight of each channel is:

[0126]

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

[0128] The weight 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 weight feature Y to the range of [0,1] through the nonlinear activation function Sigmoid is:

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

[0133] Among them, sigmoid is a nonlinear activation function; Y i is the value of the i-th channel in the weight feature Y, Y sigmoid,i is the value of the i-th channel in the weight feature after the nonlinear activation function;

[0134] The threshold processing is specifically as follows: setting the gate threshold to 0.5, setting the weight value of the channel whose value is greater than the gate threshold in the weight feature after the nonlinear activation function to 1, and setting the weight value of the remaining channels to 0, to obtain the feature weight W of the information-rich part 1,i , minus the feature weight W of the information-rich part from 1 1,i Get the feature weight W of the information-poor part 2,i ; Then we get the feature weight matrix W1 of the information-rich part and the feature weight matrix W2 of the information-poor part, and multiply the input feature X by the feature weight matrix W1 of the information-rich part and the feature weight matrix W2 of the information-poor part element by element to get the information-rich feature and information-poor characteristics

[0135]

[0136] Among them, W 1,i is the feature weight of the information-rich part corresponding to the i-th channel, W 2,i is the feature weight of the information-poor part corresponding to the i-th channel;

[0137] The process of the reconstruction stage is specifically as follows: cross reconstruction operation is used to fully combine the information-rich features and information-poor characteristics Specifically, the information-rich features are first and information-poor characteristics Divide into two parts with equal number of channels, using information-rich features The first half of the information-poor feature The second half of the pixel is added pixel by pixel to get the feature X w1 , using informative features The second half of the information-poor feature The first half of the pixel is added pixel by pixel to get the feature X w2 , and then the feature X w1 and feature X w2 Perform channel superposition to obtain the spatial refined feature X w ;

[0138] The process of the spatial feature enhancement stage is specifically as follows: first, the spatial refinement feature X w Perform maximum pooling and average pooling along the channel dimension respectively, concatenate the results of maximum pooling and average pooling in the channel dimension, and then process them sequentially through 7*7 convolution and nonlinear activation function sigmoid to obtain the spatial attention weight matrix M. The spatial attention weight matrix M is combined with the spatial refined feature X w Multiply them together to get the output features of the spatial attention reconstruction unit (SARU);

[0139] The channel reconstruction unit (CRU) is used to handle channel redundancy, divide the channel of the input spliced feature X' into two parts, and use 1x1 convolution to compress it to reduce the amount of computation. Group convolution (GWC) and point convolution (PWC) are used to extract rich feature representations to reduce computational costs. Point convolution (PWC) is used to generate feature maps with supplementary detail information, and feature maps are reused to reduce computational costs. Global average pooling (Pooling) and soft attention mechanisms are used to adaptively fuse feature maps from the up-conversion stage and the down-conversion stage to generate more representative channel refined feature maps. CRU can effectively reduce channel redundancy and reduce computational costs and storage requirements.

[0140] The frequency reconstruction unit (FRU), such as Figure 6 As shown, firstly, the input feature I is transformed into sacr Convert it into a frequency domain complex tensor F, and then split the frequency domain complex tensor into the frequency domain real part and the frequency domain imaginary part, that is, the high-frequency detail information related to the target contour and the low-frequency global information related to the background. Then perform three convolution layer operations on the frequency domain real part and the imaginary part respectively to extract and adjust the features in the frequency domain to obtain the real feature layer R and the imaginary feature layer I. Merge the real feature layer R and the imaginary feature layer I to obtain the frequency domain feature F filtered , through global average pooling and nonlinear activation function Sigmoid to form an adaptive gating structure, dynamically adjust the frequency domain feature gating weight g, and the frequency domain feature gating weight g is extended to the frequency domain feature F through the broadcast mechanism. filtered The same dimension and with the frequency domain feature F filtered Perform element-by-element multiplication to obtain the gated frequency domain feature F gated , the frequency domain feature F after gate gated The final output tensor is obtained by converting back to the original domain through inverse Fourier transform, which enhances the first-stage text region detection model's utilization of multi-dimensional information, thereby improving the detection effect;

[0141] The frequency domain complex tensor is:

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

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

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

[0145]

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

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

[0148]

[0149] Among them, C real represents the convolutional layer of the real feature layer R, C imag Represents the convolutional layer of the imaginary feature layer I;

[0150] The frequency domain feature F filtered for:

[0151]

[0152] Among them, stack is the channel superposition operation;

[0153] The calculation method of the frequency domain feature gating weight g is:

[0154]

[0155] Among them, v is the channel weight vector, h represents the frequency domain feature F filtered The numbers in the middle row, w represents the frequency domain feature F filtered The number of the column, Represents the frequency domain feature F filtered It has 5 dimensions, namely B, C, h, w, d; d is used to distinguish the imaginary part from the real part. When d = 1, it represents the real part, and when d = 2, it represents the imaginary part.

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

[0157]

[0158] Among them, g expanded is the frequency domain feature gating weight after expansion through the broadcast mechanism;

[0159] The final output tensor is:

[0160]

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

[0162] Step 3: Build the second-stage character recognition model;

[0163] Recognition algorithms are at the core of the task of recognizing place names on ancient maps. Given the particularities of ancient maps, this patent provides targeted optimization based on the scene text recognition algorithm (SVTR) based on a single visual model. The SVTR algorithm is an advanced algorithm focused on text recognition tasks and has demonstrated excellent performance in this area. However, when applied to ancient map place name recognition, the limitations of the SVTR algorithm become apparent, especially when faced with discontinuous place name text, blurred text, and inconsistent text quality.

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

[0165] The result of weighting the probability distribution P1 of the original branch prediction and the probability distribution P2 of the newly added branch prediction is:

[0166]

[0167] Among them, P final is the weighted probability distribution, 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 component PIM based on the feature vector F1 of the input image and the prompt component P n Generate a corresponding conditional prompt P; the prompt interaction module is used to dynamically enhance the feature vector F1 of the input image according to the conditional prompt P to obtain the enhanced feature representation By combining the PGM and PIM modules, the Prompt Restore Block image restoration module can automatically generate conditional prompts for different types of degraded images, effectively guiding the precise restoration of the feature layer of blurred images. This improves the recognition of poor-quality characters, such as discontinuous and blurred characters. Furthermore, the Prompt Restore Block image restoration module can further enhance performance by adjusting parameters and optimizing algorithms.

[0172] The prompt generation module usually adopts a sequence model such as Transformer, which can use 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 Represents 1*1 convolution and 3*3 convolution respectively; n is the number of prompt components, N is the number of prompt components, Softmax is the Softmax activation function, which can convert vectors into probability quantities, MP is the mixed pooling function, y j is the hint component weight vector;

[0177] The prompt interaction module PIM generally adopts technologies such as a fully connected layer and an activation function. The overall process of the prompt interaction module PIM can be expressed as the following formula:

[0178]

[0179] Where, ; is the cascade operation, MDTA is expressed as D=W p V·Softmax(K·Q / α)+E, where E and D are the input and output features, respectively. Q, K, and V represent the query projection, key projection, and value projection, respectively, which are obtained by performing 1×1 point-wise convolution and 3×3 depth-wise convolution on the layer-normalized input feature map. W p is point-by-point convolution, α is a learnable scaling parameter, and · is the dot product interaction. The GDFN process 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 depth convolution and nonlinear activation function GeLU;

[0180] The innovation of this patent lies in its ability to improve text recognition accuracy by simultaneously utilizing the original branch and a new branch based on the image restoration module during training and inference. This patented technology effectively addresses the problems encountered by the aforementioned existing algorithms in recognizing place names on ancient maps. This innovative design significantly improves the algorithm's ability to recognize text on ancient maps, especially when dealing with non-contiguous and low-quality text.

[0181] Step 4: Use the text region detection dataset to train the text region detection model of the first stage to obtain a trained text region detection model of the first stage;

[0182] Step 5: Use the character recognition data set to train the second-stage character recognition model to obtain a trained second-stage character recognition model;

[0183] Step 6: Use the trained text region detection model from the first stage and the character recognition model from the second stage to recognize place names on ancient topographic maps;

[0184] Step 6.1: To maintain the same format for training and inference, crop the ancient topographic map to be identified into several map blocks according to the set size;

[0185] Step 6.2: Input several map blocks corresponding to the ancient topographic map to be identified into the trained first-stage text region detection model for inference to obtain the text region in the form of a rectangular frame;

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

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

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

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

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

[0191] An ancient topographic map acquisition module, used to acquire the ancient topographic map to be identified;

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

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

[0194] A weakening processing module is used to cut out text image slices according to the rectangular frame and perform background weakening processing;

[0195] The character recognition model in the second stage is used to identify the corresponding traditional Chinese characters from the text image slices after the background is weakened.

[0196] This embodiment also provides an electronic device, including: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor and the memory communicate through 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.

[0197] This embodiment also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the method for identifying place names on ancient topographic maps as described above is executed.

[0198] The above description is merely a preferred embodiment of the present 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 the present disclosure is not limited to the technical solutions formed by a specific combination of the above-mentioned technical features, but should also encompass other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the above-mentioned inventive concept. For example, a technical solution formed by mutually replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in the embodiments of the present disclosure.

Claims

1. A method for identifying place names on ancient topographic maps, characterized in that: The following steps are involved: Constructing a text region detection dataset and a character recognition dataset; the text region detection dataset includes several ancient topographic maps, each of which uses a rectangular box to mark the text region; the character recognition dataset includes several text image slices, each of which uses the traditional Chinese character corresponding to the text contained therein as a label; Constructing the first-stage text region detection model to detect the text region in the input map block and output the text region in the form of a rectangular frame; Build the second-stage character recognition model, adding an additional branch to the single-branch model structure of the SVTR algorithm for character recognition; The first-stage text region detection model is trained using the text region detection dataset to obtain a trained first-stage text region detection model; The character recognition model of the second stage is trained using the character recognition data set to obtain a trained character recognition model of the second stage; The first-stage text region detection model and the second-stage character recognition model that have been trained are used to realize the recognition of place names in ancient topographic maps.

2. The method for identifying place names on ancient topographic maps according to claim 1, characterized in that: The construction of the text area detection dataset and the character recognition dataset is specifically as follows: A1: Obtain several ancient topographic maps; A2: Perform image preprocessing on the ancient topographic map to obtain the ancient topographic map after image preprocessing; A3: Crop the pre-processed ancient topographic map into several map blocks according to the set size; A4: Use rectangular boxes to mark each text area in the map block as a label for each ancient topographic map, and then construct a text area detection dataset; A5: Crop each text area in the map block to obtain several text image slices. Use the traditional Chinese characters corresponding to the text contained in the text image slices as labels for the text image slices, and then construct a preliminary character recognition dataset. A6: Acquire and preprocess the ancient book image to obtain a preprocessed image block; The method for preprocessing the ancient book image specifically comprises: cutting the ancient book image into a plurality of blocks according to a set size, and then randomly adding lines; A7: Crop each text region in the preprocessed image block to obtain several text image slices. Use the traditional Chinese characters corresponding to the text contained in the text image slices as labels for the text image slices. Add the obtained text image slices and their labels to the preliminary character recognition dataset obtained in A5. A8: Perform background weakening processing on the text image slices in the preliminary character recognition dataset to obtain processed text image slices, and then obtain the final character recognition dataset.

3. The method for identifying place names on ancient topographic maps according to claim 1, characterized in that: The text region detection model in the first stage adds a spatial attention cross-dimensional reconstruction module SACR after convolutional layer 4 and convolutional layer 5 of the Resnet50 backbone network of the text detection model DB++; The spatial attention cross-dimensional reconstruction module SACR first transforms the input feature I sacr After adjusting the number of channels through 1*1 convolution, feature X is obtained, and 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 on the channels to obtain the spliced feature X'; Then input the splicing feature X' into the channel reconstruction unit CRU to reconstruct the channel and obtain the channel reconstruction feature J; use the frequency reconstruction unit FRU to reconstruct the input feature I sacr Convert to frequency domain space for feature extraction to obtain frequency domain space feature Z; input feature I sacr , channel reconstruction features J and frequency domain spatial features Z are superimposed on each other, and then the number of channels is adjusted by 1*1 convolution and output to obtain the output features of the spatial attention cross-dimensional reconstruction module SACR.

4. The method for identifying place names on ancient topographic maps according to claim 3, characterized in that: The spatial attention reconstruction unit SARU includes a separation stage, a reconstruction stage and a spatial feature enhancement stage. The separation stage separates the information-rich features from the input feature X and information-poor characteristics The reconstruction phase converts the information-rich features and information-poor characteristics Make neutralization domain changes to obtain spatial refined feature X w In the spatial feature enhancement stage, the spatial feature X is refined by the spatial attention mechanism. w Perform adaptive spatial feature enhancement to generate output features of the spatial attention reconstruction unit SARU; The process of the separation stage is specifically as follows: First, perform group normalization on the input feature X to obtain the group normalized feature X out ; Calculate the group normalized feature X out The normalized weight of each channel and the group-normalized feature X out Each channel of is multiplied by the corresponding normalized weight to the weight feature Y; then the weight feature Y is mapped to the range of [0,1] through the nonlinear activation function Sigmoid, and based on the weight feature after the nonlinear activation function, the input feature X is divided into information-rich features through threshold processing. and information-poor characteristics The normalized feature X out The normalized weight of each channel is: Among them, w i is the normalized feature X out The normalized weight of the i-th channel, i and j are the channel numbers, and c is the number of channels; γ i and γ j is the normalized feature X out The original weight values of the i-th and j-th channels in ; The threshold processing is specifically as follows: setting a gate threshold, setting the weight value of the channel whose value is greater than the gate threshold in the weight feature after the nonlinear activation function to 1, and setting the weight value of the remaining channels to 0, to obtain the feature weight W of the information-rich part 1,i , minus the feature weight W of the information-rich part from 1 1,i Get the feature weight W of the information-poor part 2,i , and then get the feature weight matrix W1 of the information-rich part and the feature weight matrix W2 of the information-poor part, and multiply the input feature X by the feature weight matrix W1 of the information-rich part and the feature weight matrix W2 of the information-poor part element by element to get the information-rich feature and information-poor characteristics The process of the reconstruction stage is as follows: first, the information-rich features are and information-poor characteristics Divide into two parts with equal number of channels, and use information-rich features The first half of the information-poor feature The second half of the pixel is added pixel by pixel to get the feature X w1 , using informative features The second half of the information-poor feature The first half of the pixel is added pixel by pixel to get the feature X w2 , and then the feature X w1 and feature X w2 Perform channel superposition to obtain the spatial refined feature X w ; The process of the spatial feature enhancement stage is specifically as follows: first, the spatial refinement feature X w Perform maximum pooling and average pooling along the channel dimension respectively, concatenate the results of maximum pooling and average pooling in the channel dimension, and then process them sequentially through 7*7 convolution and nonlinear activation function sigmoid to obtain the spatial attention weight matrix M. The spatial attention weight matrix M is combined with the spatial refined feature X w Multiply them together to get the output features of the spatial attention reconstruction unit SARU.

5. The method for recognizing place names on ancient topographic maps according to claim 3, characterized in that: The frequency reconstruction unit FRU first converts the input feature I into sacr Convert it into a frequency domain complex tensor F, then split the frequency domain complex tensor into the frequency domain real part and the frequency domain imaginary part, and then perform three convolution layer operations on the frequency domain real part and the imaginary part respectively, extract and adjust the features in the frequency domain, and obtain the real feature layer R and the imaginary feature layer I, and merge the real feature layer R and the imaginary feature layer I to obtain the frequency domain feature F filtered , through global average pooling and nonlinear activation function Sigmoid to form an adaptive gating structure, dynamically adjust the frequency domain feature gating weight g, and the frequency domain feature gating weight g is expanded to the frequency domain feature F through the broadcast mechanism. filtered The same dimension and with the frequency domain feature F filtered Perform element-by-element multiplication to obtain the gated frequency domain feature F gated , the frequency domain feature F after gate gated Convert back to the original domain through inverse Fourier transform to obtain the final output tensor; The frequency domain real part and the frequency domain imaginary part are: Among them, F real is the real part in the frequency domain, F imag is the imaginary part of the frequency domain, Re is the real part tensor calculation function, IM is the imaginary part tensor calculation function, B is the batch size, C is the number of channels, H is the feature map height, and W is the feature map width; F * is the complex conjugate of F, i * is an imaginary unit; The real characteristic layer R and the imaginary characteristic layer I are: Among them, C real represents the convolutional layer of the real feature layer R, C imag Represents the convolutional layer of the imaginary feature layer I; The frequency domain feature Ffiltered is: Among them, stack is the channel superposition operation; The calculation method of the frequency domain feature gating weight g is: Among them, v is the channel weight vector, h represents the frequency domain feature F filtered The numbers in the middle row, w represents the frequency domain feature F filtered The number of the column, Represents the frequency domain feature F filtered It has 5 dimensions, namely B, C, h, w, d; d is used to distinguish the imaginary part from the real part. When d = 1, it represents the real part, and when d = 2, it represents the imaginary part. The gated frequency domain feature F gated for: Among them, g expanded is the frequency domain feature gating weight after expansion through the broadcast mechanism; The final output tensor is: Among them, F complex is the complex tensor obtained after conversion, view_as_complex is the complex conversion function, IFFT is the two-dimensional inverse Fourier transform, and Q is the final output tensor.

6. The method for recognizing place names on ancient topographic maps according to claim 1, characterized in that: The character recognition model of the second stage adds an additional branch to the single-branch model structure of the SVTR algorithm. The new branch shares the trunk and neck network with the original branch, and sends the feature layer output by the neck network to the image restoration module of the new branch for processing. Then, the new branch performs probability prediction on the parallel linear classification predictor composed of several fully connected layers to obtain 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 function and the argmax function to obtain the predicted character index value. So as to get the corresponding characters; The result of weighting the probability distribution P1 of the original branch prediction and the probability distribution P2 of the newly added branch prediction is: Among them, P final is the weighted probability distribution, G is the 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 a prompt based on the feature vector F1 of the input image and the prompt component P n Generate a corresponding conditional prompt P; the prompt interaction module is used to dynamically enhance the feature vector F1 of the input image according to the conditional prompt P to obtain the enhanced feature representation The overall process of the prompt generation module is: and j =Softmax(Conv 3*3 (MP(F1))) (23) Among them, Conv 1*1 and Conv 3*3 Represent 1*1 convolution and 3*3 convolution respectively; n is the number of prompt components, N is the number of prompt components, Softmax is the Softmax activation function, MP is the mixed pooling function, y j is the hint component weight vector; The overall process of the prompt interaction module PIM is as follows: Where, ; is the cascade operation, MDTA is expressed as D=W p V·Softmax(K·Q / α)+E, where E and D are input and output features, respectively, Q, K, and V represent query projection, key projection, and value projection, respectively; W p is the point-by-point convolution, α is a learnable scaling parameter, · is the dot product interaction, and GDFN is the gated deep fusion network.

7. The method for recognizing 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 recognize place names on ancient topographic maps is as follows: B1: Crop the ancient topographic map to be identified into several map blocks according to the set size; B2: Input several map blocks corresponding to the ancient topographic map to be identified into the trained first-stage text region detection model for inference to obtain text regions in the form of rectangular frames; B3: Cut out the text image slices according to the rectangular frame and weaken the background; B4: Input the text image slice after background weakening processing into the second-stage character recognition model trained to obtain the corresponding traditional Chinese character result, i.e., the place name text information; B5: Visualize the text area in the form of a rectangular frame and the place name text information on the ancient topographic map to be identified to obtain the final place name recognition result.

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

9. An electronic device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor and the memory communicate via the bus. When the machine-readable instructions are executed by the processor, a method for identifying place names on ancient topographic maps as described in any one of claims 1 to 7 is executed.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, which, when executed by a processor, executes a method for identifying place names on ancient topographic maps as described in any one of claims 1 to 7.

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

  • End-to-end printed Mongolian recognition translation method based on spatial transformation network

    CN112329760A

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

    CN113989484A

  • End-to-end recognition method for scene text in any shape

    WO2019192397A1